1/** 2 * ç»é¢ãã¼ãæå¦ç 3 * åæè¡¨ç¤º 4 */ 5$(function () { 6 7 //ãã¼ã«ã«ã¹ãã¬ã¼ã¸åé¤ 8 clearLocalStrage(); 9 10 // æªä¼å¡ã¨ã©ã¼è¡¨ç¤º 11 if (location.search == "?error=1") { 12 fadeError("ä¼å¡æ å ±ãã¿ã¤ããã¾ãã"); 13 } 14 15 // ç»é²æ¸ã¨ã©ã¼ 16 if (location.search == "?error=2") { 17 fadeError("ç»é²æ¸ã¿ã®ã¢ã«ã¦ã³ãã§ã"); 18 } 19 20 // çå¾è¿½å ç»é²ï¼ç®¡çè ã¢ã«ã¦ã³ãï¼ 21 if (location.search == "?error=3") { 22 fadeError("管çè ã»ã¹ã¿ããã¢ã«ã¦ã³ãã§ã"); 23 } 24 25 // ã¹ã¿ãã追å ç»é²ï¼åè¬è ã¢ã«ã¦ã³ãï¼ 26 if (location.search == "?error=4") { 27 fadeError("åè¬è ã¢ã«ã¦ã³ãã§ã"); 28 } 29 30 // ã¢ããªç 31 if (DEVICE !== "isWeb") { 32 $(".nonweb").css("display", "block"); 33 $("#student_regist a.nonweb").css("display", "inline-block"); 34 } 35 36 //ãã©ã¡ã¼ã¿åå¾ 37 var info_uid = getParam("id"); 38 39 var uid = ""; 40 var code = ""; 41 var urlparam = location.search.substring(1); 42 if (urlparam) { 43 if (urlparam !== "openExternalBrowser=1") { 44 var param = urlparam.split('&'); 45 var paramArray = []; 46 for (i = 0; i < param.length; i++) { 47 var paramItem = param[i].split('='); 48 paramArray[paramItem[0]] = paramItem[1]; 49 } 50 var uid = paramArray.id; 51 var code = paramArray.code; 52 } 53 } 54 55 // LINEãã°ã¤ã³ 56 $(document).on("click", "#linelogin", function () { 57 var random = Math.random(); 58 // ã¦ã§ãã®å ´å 59 if (!IS_APP) { 60 var lineurl = "https://access.line.me/oauth2/v2.1/authorize?response_type=code&bot_prompt=aggressive&client_id=" + CLIENT_ID + "&redirect_uri=" + APP_DOMAIN + "/ajax/oauth/line.php&state=" + random + "@none_login&scope=profile"; 61 window.location.href = lineurl; 62 } 63 // ã¢ããªã®å ´å 64 else { 65 // ã¢ã㪠66 if (window.cordova && cordova.InAppBrowser) { 67 var lineurl = "https://access.line.me/oauth2/v2.1/authorize?response_type=code&bot_prompt=aggressive&client_id=" + CLIENT_ID + "&redirect_uri=" + APP_DOMAIN + "/ajax/oauth/line.php&state=" + random + "@none_applogin&scope=profile"; 68 cordova.InAppBrowser.open(lineurl, '_system', 'location=yes'); 69 } else { 70 // ä¸ãä¸ãã©ã°ã¤ã³ãç¡ãå ´åã®ãã©ã¼ã«ãã㯠71 var lineurl = "https://access.line.me/oauth2/v2.1/authorize?response_type=code&bot_prompt=aggressive&client_id=" + CLIENT_ID + "&redirect_uri=" + APP_DOMAIN + "/ajax/oauth/line.php&state=" + random + "@none_login&scope=profile"; 72 window.location.href = lineurl; 73 } 74 } 75 }); 76 77 // Appleãã°ã¤ã³ 78 var inAppBrowserRef = null; 79 var appleCallbackUrl = null; 80 var appleLoginError = false; 81 $(document).on("click", "#sign-in-with-apple-button", function () { 82 83 if (IS_APP) { 84 appleCallbackUrl = null; 85 appleLoginError = false; 86 inAppBrowserRef = cordova.InAppBrowser.open( 87 APP_DOMAIN + '/app/oauth/apple.html', 88 '_blank', 89 'location=no,footer=yes' 90 ); 91 92 inAppBrowserRef.addEventListener('customscheme', function (event) { 93 if (!event.url) return; 94 // Appleèªè¨¼ã¯æåãããDEKITAã¢ã«ã¦ã³ãããªã 95 if (event.url.indexOf('appsdekita://apple_login_error') === 0) { 96 appleLoginError = true; 97 if (inAppBrowserRef) { 98 inAppBrowserRef.close(); 99 } 100 return; 101 } 102 103 // æ£å¸¸ãã°ã¤ã³ 104 if (event.url.indexOf('appsdekita://') === 0) { 105 appleCallbackUrl = event.url; 106 if (inAppBrowserRef) { 107 inAppBrowserRef.close(); 108 } 109 } 110 }); 111 112 inAppBrowserRef.addEventListener('exit', function () { 113 inAppBrowserRef = null; 114 // Appleã¢ã«ã¦ã³ãæªç»é² 115 if (appleLoginError) { 116 appleLoginError = false;
117 alert( 118 "ãã®Apple Accountã«ç´ã¥ãã¢ã«ã¦ã³ããè¦ã¤ããã¾ããã\n" + 119 "ç»é²æ¸ã¿ã®ãã°ã¤ã³æ¹æ³ã§ãã°ã¤ã³ãã¦ãã ããã" 120 ); 121 return; 122 } 123 124 // æ£å¸¸ãã°ã¤ã³ 125 if (appleCallbackUrl) { 126 var callbackUrl = appleCallbackUrl; 127 appleCallbackUrl = null; 128 setTimeout(function () { 129 handleOpenURL(callbackUrl); 130 }, 100); 131 } 132 }); 133 } 134 return; 135 }); 136 137 // éç¥è¨å®ã¯ãªã¢ 138 $(document).on("click", "#push_clear", function () { 139 // ã¢ããªã®å ´å 140 if (IS_APP) { 141 FirebasePlugin.setAutoInitEnabled(false, function () { 142 // alert("éç¥è¨å®ã¯ãªã¢"); 143 FirebasePlugin.unregister(); 144 }); 145 } 146 return; 147 }); 148 149 // æ°è¦ã¹ã¯ã¼ã«éè¨ 150 $(document).on("click", "#regist_newschool", function () { 151 // ã¦ã§ãã®å ´å 152 if (!IS_APP) { 153 window.open(APP_DOMAIN + '/app/onb/signup.html', "_blank"); 154 } 155 // ã¢ããªã®å ´å 156 else { 157 // ã¢ã㪠158 if (window.cordova && cordova.InAppBrowser) { 159 cordova.InAppBrowser.open(APP_DOMAIN + '/app/onb/signup.html', '_system', 'location=yes'); 160 } else { 161 // ä¸ãä¸ãã©ã°ã¤ã³ãç¡ãå ´åã®ãã©ã¼ã«ãã㯠162 window.open(APP_DOMAIN + '/app/onb/signup.html', "_blank"); 163 } 164 } 165 }); 166 167 if (uid !== "") { 168 clearLocalStrage(); 169 } 170 171 /** 172 * 管çç¨ãã°ã¤ã³ 173 */ 174 if (uid && code) { 175 $.ajax({ 176 url: APP_DOMAIN + "/ajax/oauth/login.php", 177 type: "POST", 178 data: { 179 id: paramArray.id, 180 code: paramArray.code, 181 type: "manage" 182 }, 183 error: function (XMLHttpRequest, textStatus, errorThrown) { 184 fadeError("éä¿¡ã«å¤±æãã¾ãã"); 185 }, 186 success: function (arr) { 187 if (arr == "" || arr == "null") { 188 fadeError("æ£ããã¡ã¼ã«ã¢ãã¬ã¹ã¨ãã¹ã¯ã¼ããå ¥åãã¦ãã ãã"); 189 } else { 190 var data = $.parseJSON(arr); 191 var kubun = data.user.kubun; 192 //ãã¼ã«ã«ãã¼ã¿æ´æ° 193 setLocalStorage(data); 194 if (kubun == 1 || kubun == 2) { 195 window.location.href = "../lesson/mcalendar.html"; 196 } else { 197 window.location.href = "../lesson/calendar.html"; 198 } 199 } 200 } 201 }); 202 } 203 /** 204 * ãã¼ã«ã«ã¹ãã¬ã¼ã¸ãããã°ã¤ã³ 205 */ 206 else if (uid == "" && LOGIN_ID !== "" && TOKEN !== "") { 207 $.ajax({ 208 url: APP_DOMAIN + "/ajax/oauth/login.php", 209 type: "POST", 210 data: { 211 school_id: selected_school_id, 212 login_id: LOGIN_ID, 213 localtoken: TOKEN, 214 type: "local" 215 }, 216 error: function (XMLHttpRequest, textStatus, errorThrown) { 217 fadeError("éä¿¡ã«å¤±æãã¾ãã"); 218 }, 219 success: function (arr) { 220 if (arr == "") { 221 fadeError("æ£ããã¡ã¼ã«ã¢ãã¬ã¹ã¨ãã¹ã¯ã¼ããå ¥åãã¦ãã ãã(LOCAL)"); 222 } else { 223 var data = $.parseJSON(arr); 224 var kubun = data.user.kubun; 225 //ãã¼ã«ã«ãã¼ã¿æ´æ° 226 setLocalStorage(data); 227 //ãç¥ãã詳細㸠228 if (info_uid !== null) { 229 var transition = "../info/detail.html?id=" + info_uid; 230 } 231 //ã«ã¬ã³ãã¼ã¸ 232 else { 233 if (kubun == 1 || kubun == 2) { 234 if (location.search == "?cd=reopen") { 235 var transition = "../lesson/mcalendar.html?d=reopen"; 236 } else { 237 var transition = "../lesson/mcalendar.html"; 238 } 239 } else { 240 var transition = "../lesson/calendar.html"; 241 } 242 } 243 // ã¦ã§ãã®å ´å 244 if (!IS_APP) { 245 window.location.href = transition; 246 } 247 // ã¢ããªã®å ´å 248 else { 249 // ã¢ã㪠250 if (window.cordova && cordova.InAppBrowser) { 251 setTimeout(function () { 252 registFirebaseToken(data.user.login_
252id, data.user.kubun, DEVICE, 0) 253 .then(() => ssoRedirect(data.user.login_id, data.user.passcode, transition)); 254 }, 1000); 255 } else { 256 // ä¸ãä¸ãã©ã°ã¤ã³ãç¡ãå ´åã®ãã©ã¼ã«ãã㯠257 window.location.href = transition; 258 } 259 } 260 } 261 } 262 }); 263 } 264 265 var flg = true; 266 $(document).on("click", "button", function () { 267 if (flg) { 268 flg = false; 269 setTimeout(function () { 270 flg = true; 271 }, 5000); 272 } 273 }); 274 275 //ã¡ã¼ã«ã¢ãã¬ã¹ã§ãã°ã¤ã³ 276 var disableFlag = true; 277 $(document).on("click", "#mailadr", function () { 278 if (disableFlag) { 279 disableFlag = false; 280 $("form").show(); 281 setTimeout(function () { 282 disableFlag = true; 283 }, 3000); 284 } 285 }); 286 287 /** 288 * ãã°ã¤ã³èªè¨¼ 289 */ 290 $("form").validate({ 291 rules: { 292 email: { 293 required: true, 294 email: true 295 }, 296 password: { 297 required: true, 298 pwcheck: true, 299 minlength: 6 300 } 301 }, 302 messages: { 303 email: { 304 required: "ã¡ã¼ã«ã¢ãã¬ã¹ãå ¥åãã¦ãã ãã", 305 email: "æ£ããã¡ã¼ã«ã¢ãã¬ã¹ãå ¥åãã¦ãã ãã" 306 }, 307 password: { 308 required: "ãã¹ã¯ã¼ããå ¥åãã¦ãã ãã", 309 pwcheck: "ãã¹ã¯ã¼ãã¯åè§è±æ°åã§å ¥åãã¦ãã ãã", 310 minlength: "ãã¹ã¯ã¼ãã¯6æå以ä¸å ¥åãã¦ãã ãã" 311 } 312 }, 313 submitHandler: function () { 314 315 //éè¤ç»é²é²æ¢ 316 $("input[type='submit']").prop("disabled", true); 317 $("#loading").show(); 318 319 var $form = $("form"); 320 var data = $form.serialize(); 321 322 $.ajax({ 323 url: APP_DOMAIN + "/ajax/oauth/login.php", 324 type: "POST", 325 data: data + "&type=form&school_id=" + selected_school_id, 326 error: function (XMLHttpRequest, textStatus, errorThrown) { 327 //éè¤ç»é²è§£é¤ 328 $("input[type='submit']").prop("disabled", false); 329 $("#loading").hide(); 330 fadeError("éä¿¡ã«å¤±æãã¾ãã"); 331 }, 332 success: function (arr) { 333 if (arr == "noexist" || arr == "") { 334 //éè¤ç»é²è§£é¤ 335 $("input[type='submit']").prop("disabled", false); 336 $("#loading").hide(); 337 fadeError("æ£ããã¡ã¼ã«ã¢ãã¬ã¹ã¨ãã¹ã¯ã¼ããå ¥åãã¦ãã ãã(FORM)"); 338 } else if (arr == "nomember") { 339 var data = $.parseJSON(arr); 340 var kubun = data.user.kubun; 341 //ãã¼ã«ã«ãã¼ã¿æ´æ° 342 setLocalStorage(data); 343 window.location.href = "../lesson/calendar.html"; 344 } else { 345 var data = $.parseJSON(arr); 346 var school = data.school; 347 var kubun = data.user.kubun; 348 349 //ãã¼ã«ã«ãã¼ã¿æ´æ° 350 setLocalStorage(data); 351 352 if (data.school && data.school.length > 0) { 353 //ãç¥ãã詳細㸠354 if (info_uid !== null) { 355 var transition = "../info/detail.html?id=" + info_uid; 356 } 357 //ã«ã¬ã³ãã¼ã¸ 358 else { 359 if (kubun == 1 || kubun == 2) { 360 if (location.search == "?cd=reopen") { 361 var transition = "../lesson/mcalendar.html?d=reopen"; 362 } else { 363 var transition = "../lesson/mcalendar.html"; 364 } 365 } else { 366 var transition = "../lesson/calendar.html"; 367 } 368 } 369 } 370 //æå±ãªã 371 else { 372 var transition = "../member/detail.html"; 373 } 374 375 // ã¦ã§ãã®å ´å 376 if (!IS_APP) { 377 window.location.href = transition; 378 } 379 // ã¢ããªã®å ´å 380 else { 381 // ã¢ã㪠382 if (window.cordova && cordova.InAppBrowser) { 383 registFirebaseToken(data.user.login_
383id, data.user.kubun, DEVICE, 0) 384 .then(() => ssoRedirect(data.user.login_id, data.user.passcode, transition)); 385 } else { 386 // ä¸ãä¸ãã©ã°ã¤ã³ãç¡ãå ´åã®ãã©ã¼ã«ãã㯠387 window.location.href = transition; 388 } 389 } 390 } 391 } 392 }); 393 } 394 }); 395 396 //ãã¹ã¯ã¼ãç¢ºèª 397 $.validator.addMethod("pwcheck", function (value, element) { 398 return /^[A-Za-z0-9\d=!\-@._*]+$/.test(value); 399 }); 400 401}); 402 403function exitCallBack() { 404 clearLocalStrage(); 405 window.location.href = "login.html"; 406}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.