1var suz_ConfirmMsgFlg = true; 2 3$(function() { 4 // registration 5 suz_submitRestriction(); 6 if($("#suz_regArea").length>0){ 7 $("#suz_regArea").on('change', '#suz_countryID', function(ev) { 8 $.ajax({ 9 url : suz_getCurrentDomain() + "/ajax/registrationAjax/getFormList/", 10 type : "POST", 11 data : { 12 countryId : $(this).val(), 13 stateId : null, 14 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").val(), 15 rwd : document.getElementById("suz-responsive") != null 16 }, 17 dataType : "html", 18 scriptCharset : "UTF-8" 19 }).then(function(html) { 20 var $regArea = $("#suz_regArea"); 21 var $group; 22 $regArea.html(html); 23 $("#js-formStep-totalNum").text($("#hidMaxStepCount").val()); 24 25 suz_showRegisterTopBottomGuide(); 26 27 if ($('#js-multiStepForm').length) { 28 mlc_resetMultiStepForm(); 29 window.KeyenceForm.ControlErrorDisplay.resetPanelProgressData(ev.currentTarget.id); 30 window.KeyenceForm.ControlErrorDisplay.addInvalidEvent(); 31 window.kpi_cartObj._changeUserRegistProgressButton(); 32 window.KeyenceForm.MultiFactorAuthentication.init(); 33 window.KeyenceForm.MultiFactorAuthentication.removeSubmitTriggerDisabled(); 34 } 35 36 if ($regArea.hasClass('is-preInput-completed')) { 37 $group = $('#suz_countryID').parent('#suz_div_countryID'); 38 39 if ($group.hasClass('is-hide')) { 40 $group.removeClass('is-hide'); 41 } 42 } 43 44 $('#suz_countryID').trigger("focus"); 45 $('#suz_countryID').trigger("blur"); 46 47 suz_checkFollowing($('#suz_countryID')); 48 window.KeyenceForm.ControlErrorDisplay.validateInactivePanel(ev.currentTarget.id); 49 }, 50 function(req, stat, err) { 51 if(req.status == 401 || req.status == 404 || req.status == 500){ 52 window.location.href = suz_getCurrentDomain() + "/error/tokenError.jsp"; 53 return false; 54 } 55 alert(err); 56 return false; 57 }); 58 }); 59 $("#suz_regArea").on('change', '#suz_stateID', function(ev) { 60 let privacyChkList = $('input[name="privacyChk"]'); 61 let privacyChkPushList = []; 62 63 for(let i=0; i < 4;i++){ 64 if(privacyChkList.length != 0 &&privacyChkList[i].checked){ 65 privacyChkPushList[i] = privacyChkList[i].value; 66 } 67 else{ 68 privacyChkPushList[i] = null; 69 } 70 } 71 $.ajax({ 72 url : suz_getCurrentDomain() + "/ajax/registrationAjax/getFormList/", 73 data : { 74 countryId : $("#suz_countryID").val(), 75 stateId : $(this).val(), 76 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").val(), 77 rwd : document.getElementById("suz-responsive") != null, 78 privacyChk1 : privacyChkPushList[0] , 79 privacyChk2 : privacyChkPushList[1] , 80 privacyChk3 : privacyChkPushList[2] , 81 privacyChk4 : privacyChkPushList[3] 82 }, 83 dataType : "html", 84 scriptCharset : "UTF-8" 85 }).then(function(html) { 86 var $regArea = $("#suz_regArea"); 87 var $group; 88 89 $regArea.html(html); 90 91 if ($('#js-multiStepForm').length) { 92 window.KeyenceForm.ControlErrorDisplay.resetPanelProgressData(ev.currentTarget.id); 93 window.KeyenceForm.ControlErrorDisplay.addInvalidEvent(); 94 window.kpi_cartObj._changeUserRegistProgressButton(); 95 } 96 97 suz_showRegisterTopBottomGuide(); 98 suz_callRegValidator($('#suz_stateID').attr('name'), $('#suz_stateID').val()); 99 100 if ($('#js-multiStepForm').length) { 101 mlc_resetMultiStepForm(); 102 window.KeyenceForm.MultiFactorAuthentication.init(); 103 window.KeyenceForm.MultiFactorAuthentication.removeSubmitTriggerDisabled(); 104 } 105 106 if ($regArea.hasClass('is-preInput-completed')) { 107 $group = $('#suz_stateID').parent('#suz_div_stateID'); 108 109 if ($group.hasClass('is-hide')) { 110 $group.removeClass('is-hide'); 111 } 112 } 113 114 $('#suz_stateID').trigger("focus"); 115 $('#suz_stateID').trigger("blur"); 116 117 suz_checkFollowing($('#suz_stateID')); 118 window.KeyenceForm.ControlErrorDisplay.validateInactivePanel(ev.currentTarget.id); 119 }, 120 function(req, stat, err) { 121 if(req.status == 401 || req.status == 404 || req.status == 500){ 122 window.location.href = suz_getCurrentDomain() + "/error/tokenError.jsp"; 123 return false; 124 } 125 alert(err); 126 return false; 127 }); 128 }); 129 $("#suz_regArea").on('change', '#suz_cityID', function(ev) { 130 var countryId = $("select[name='countryID']").val(); 131 var stateId = $("select[name='stateID']").val(); 132 cityId = $(this).val(); 133 $.ajax({
134 url : suz_getCurrentDomain() + "/ajax/registrationAjax/changeCity/", 135 data : { 136 countryId : countryId, 137 stateId : stateId, 138 cityId : cityId, 139 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").val() 140 }, 141 dataType : "jsonp", 142 jsonp : "callback", 143 scriptCharset : "UTF-8" 144 }).then(function(data) { 145 if(countryId ==='TW'){ 146 var zipCd = $("input[name='zipCode']"); 147 if (data['count'] == 0) { 148 zipCd.val(data['zipCode']); 149 } else { 150 zipCd.val(""); 151 } 152 suz_callRegValidator('zipCode', zipCd.val()); 153 }else if(countryId ==='VN'){ 154 $("select[name='industrialParkID']").html(data['result']); 155 }else if(countryId ==='CN'){ 156 $("select[name='districtID']").html(data['result']); 157 }else if(countryId ==='TH'){ 158 $("select[name='districtID']").html(data['result']); 159 } 160 }, 161 function(req, stat, err) { 162 if(req.status == 401){ 163 window.location.href = suz_getCurrentDomain() + "/error/tokenError.jsp"; 164 return false; 165 } 166 alert(err); 167 return false; 168 }); 169 }); 170 $("#submit2").on('click', function() { 171 suz_ConfirmMsgFlg = false; 172 }); 173 $('body').on('change', '#agreeAll', function() { 174 if (!$(".js-changeButtonStateByAgreement").length) { 175 suz_linkedCheckBox($('#as_agreeBoxCheked input'), $(this).prop('checked')); 176 } 177 suz_checkBoxDecision(); 178 }); 179 $('body').on('change', '#as_agreeBoxCheked input:not(#agreeAll)', function() { 180 if (!$(".js-changeButtonStateByAgreement").length) { 181 suz_linkedCheckBox($('#agreeAll'), $('#as_agreeBoxCheked input:not(#agreeAll)').length == $('#as_agreeBoxCheked input:not(#agreeAll):checked').length); 182 suz_checkBoxDecision(); 183 } 184 }); 185 $("#suz_regArea").on('focus', ":text,:password,:radio,input[type='email'],input[type='tel']", function() { 186 suz_checkPrev($(this)); 187 }); 188 $("#suz_regArea").on('focus', "input.prd-checkbox-nativeControl", function() { 189 suz_checkPrev($(this)); 190 }); 191 $("#suz_regArea").on('focus', "select.prd-select", function() { 192 suz_checkPrev($(this).prev()); 193 }); 194 $("#suz_regArea").on('click', "select.prd-select", function() { 195 suz_ConfirmMsgFlg = false; 196 setTimeout(function() { 197 suz_ConfirmMsgFlg = true; 198 }, 0); 199 }); 200 $("#suz_regArea").on('blur', ":text,:password,input[type='email'],input[type='tel']", function(ev) { 201 var relatedTarget = ev.relatedTarget; 202 var btnOpenSearchID = 'js-open-zipCodeSearch'; 203 var availableValidator = window.KeyenceForm.AvailableValidator; 204 var patternMatchValidator = window.KeyenceForm.PatternMatchValidator; 205 var registeredValidator = window.KeyenceForm.RegisteredValidator; 206 var controlErrorDisplay = window.KeyenceForm.ControlErrorDisplay; 207 var multiFactorAuthentication = window.KeyenceForm.MultiFactorAuthentication; 208 var fieldWrapper = null; 209 var $errorText = null; 210 var isErrorDisplayActive = false; 211 var errorFieldWrapper = null; 212 var authenticationInitialErrorValue = ''; 213 214 if (relatedTarget) { 215 if (relatedTarget.getAttribute('id') === btnOpenSearchID || relatedTarget.parentNode.getAttribute('id') === btnOpenSearchID) { 216 return; 217 } 218 } 219 if ($(this).attr('name') == 'verificationCode' || $(this).attr('name') == 'verificationEmailCode') { 220 suz_callSetForm($(this).attr('name'), $(this).val()); 221 if ($('#suz_registrationMode').html() != 'edit') { 222 suz_callRegValidator($(this).attr('name'), $(this).val()); 223 } 224 return; 225 } 226 if (multiFactorAuthentication.initialErrorItemRootArray.length) { 227 errorFieldWrapper = this.closest('.is-error'); 228 229 if (multiFactorAuthentication.isMatchedInitialErrorField(errorFieldWrapper)) { 230 authenticationInitialErrorValue = multiFactorAuthentication.getInitialInputValue(this); 231 if (this.value === authenticationInitialErrorValue) { 232 return; 233 } else { 234 multiFactorAuthentication.removeInitialErrorArray(errorFieldWrapper); 235 } 236 } 237 } 238 if ($(this).attr('name')) { 239 if (registeredValidator.hasRegisteredCheckClass(this)) { 240 registeredValidator.run(this); 241 } else { 242 isErrorDisplayActive = controlErrorDisplay.isTriggerClicked(this); 243 244 if (isErrorDisplayActive) { 245 if (availableValidator.hasTargetClass(this)) { 246 availableValidator.runValidate($(this).attr('name'), true).always(function (field) { 247 suz_callRegValidator(field.name, field.value, isErrorDisplayActive); 248 });
249 } else if ($(this).hasClass(patternMatchValidator.classNames.replaceValueTrigger)) { 250 patternMatchValidator.updateFieldStatus(this); 251 252 if (!$(this).hasClass(patternMatchValidator.classNames.status)) { 253 suz_callRegValidator($(this).attr('name'), $(this).val(), isErrorDisplayActive); 254 } 255 } else { 256 suz_callRegValidator($(this).attr('name'), $(this).val(), isErrorDisplayActive); 257 } 258 } else { 259 if (availableValidator.hasTargetClass(this)) { 260 availableValidator.runValidate($(this).attr('name'), true).always(function (field) { 261 if (!field) { 262 return; 263 } 264 265 fieldWrapper = availableValidator.getFieldWrapper(field.name); 266 267 if (fieldWrapper && fieldWrapper.dataset.unavailable && fieldWrapper.classList.contains('is-error')) { 268 fieldWrapper.classList.remove('is-error'); 269 270 $errorText = $(fieldWrapper).find('.js-formErrText'); 271 $errorText.html(''); 272 273 if (!$errorText.attr('style')) { 274 $errorText.addClass('is-hide'); 275 } else { 276 $errorText.css('display', 'none'); 277 } 278 } 279 280 suz_callRegValidator(field.name, field.value); 281 }); 282 } else if ($(this).hasClass(patternMatchValidator.classNames.replaceValueTrigger)) { 283 patternMatchValidator.updateFieldStatus(this); 284 suz_callRegValidator($(this).attr('name'), $(this).val()); 285 } else { 286 suz_callRegValidator($(this).attr('name'), $(this).val()); 287 } 288 } 289 } 290 } 291 if ($(this).hasClass('passwordShowing') || $(this).attr('name') == 'password') { 292 var cnfPwd = $("#suz_regArea").find('#suz_tr_confirmPassword,#suz_div_confirmPassword').find(":password"); 293 if (cnfPwd.length > 0) { 294 var cnfPwdVal = cnfPwd.val(); 295 if (cnfPwd.css('display') == 'none') { 296 cnfPwdVal = $("#suz_regArea").find('#suz_tr_confirmPassword,#suz_div_confirmPassword').find(".passwordShowing").val(); 297 } 298 if (cnfPwdVal !== '') { 299 suz_callRegValidator('confirmPassword', cnfPwdVal); 300 } 301 } 302 } 303 if ($("#suz_regArea").find('#suz_tr_confirmEmailAddress').length > 0 && $(this).attr('name') == 'emailAddress') { 304 var cnfEmailVal = $("#suz_regArea").find('#suz_tr_confirmEmailAddress').find(":text").val(); 305 if (cnfEmailVal !== '') { 306 suz_callRegValidator('confirmEmailAddress', cnfEmailVal); 307 } 308 } 309 }); 310 $("#suz_regArea").on('change', ":radio", function() { 311 suz_callRegValidator($(this).attr('name'), $(this).val()); 312 }); 313 $("#suz_regArea").on('change', "select", function() { 314 suz_callRegValidator($(this).attr('name'), $(this).val()); 315 }); 316 $('#suz_regArea').on('change', 'input.prd-checkbox-nativeControl', function() { 317 if($(this).prop('checked')){ 318 suz_callRegValidator($(this).attr('name'), "on"); 319 }else{ 320 suz_callRegValidator($(this).attr('name'), "off"); 321 } 322 }); 323 324 mlc_updateFormByIPAddressCountryId(); 325 326 $('body').on('click', '#suzShowPasswordBtn', function() { 327 $('.suzPwdViewMode').get(0).type = 'text'; 328 $('#suzHidePasswordBtn').css('display', 'inline'); 329 $(this).css('display', 'none'); 330 }); 331 $('body').on('click', '#suzHidePasswordBtn', function() { 332 $('.suzPwdViewMode').get(0).type = 'password'; 333 $('#suzShowPasswordBtn').css('display', 'inline'); 334 $(this).css('display', 'none'); 335 }); 336 } 337 // restore (use questionInfo) 338 if("suz_restoreJson" in window ) { 339 for(var i in suz_restoreJson) { 340 var e_name = "enq" + suz_restoreJson[i].idx; 341 var e_value = suz_restoreJson[i].value.replace(/</g,'<'); 342 if($("input[type=text][name="+ e_name +"]").length) { 343 $("input[name="+ e_name +"]").val(e_value); 344 } else if($("input[type=password][name="+ e_name +"]").length) { 345 $("input[name="+ e_name +"]").val(e_value); 346 } else if($("textarea[name="+ e_name +"]").length) { 347 $("textarea[name="+ e_name +"]").val(e_value); 348 } else if($("input[type=checkbox][name="+ e_name +"]").length) { 349 var c_values = e_value.split(","); 350 $("input[type=checkbox][name="+ e_name +"]").val(c_values); 351 } else if($("input[type=radio][name="+ e_name +"]").length) { 352 $("input[type=radio][name="+ e_name +"]").val([e_value]); 353 } else if($("select[name="+ e_name +"]").length) { 354 $("select[name="+ e_name +"]").val(e_value); 355 } 356 } 357 } 358 // my keyence 359 360 function getDownloadHistoryDispLimitParam() { 361 var paramString = ''; 362 363 $('.js-downloadHistoryTable').each(function () { 364 var $table = $(this); 365 var suz_dispLimit = $table.find('tbody .Check').length; 366 367 paramString += "&downloadHistoryDispLimit=" + suz_dispLimit; 368 }); 369 370 return paramString; 371 } 372 373 $("[id^='SortBy_']").on("change", function(evd) { 374 var suz_downloadHistoryDispLimit = getDownloadHistoryDispLimitParam(); 375 var suz_sort1 = $(this).val(); 376 var suz_tabId = $('.js-downloadHistoryTabButton[aria-selected="true"] .js-downloadHistoryTabName').text(); 377 var suzApiUrl; 378 if (typeof kpi_currentDomain == "undefined") { 379 if (typeof kpi_originalDomain == "undefined") { 380 suzApiUrl = ""; 381 } else { 382 suzApiUrl = kpi_originalDomain; 383 } 384 } else { 385 suzApiUrl = kpi_currentDomain; 386 } 387 location.href = suzApiUrl 388 + "/mykeyence/sortDownloadHistory"
389 + "?downloadHistorySort1=" + suz_sort1 390 + "&downloadHistoryTab=" + suz_tabId 391 + suz_downloadHistoryDispLimit; 392 }); 393 394 // my keyence download 395 $("#suz_downloadListUl").on("click", "a.js-myKeyenceDownload-button", function() { 396 $('input:hidden', $(this).closest("li")).remove(); 397 }); 398 $("#suz_regArea").on('blur','#suz_zipCode', function(ev) { 399 var relatedTarget = ev.relatedTarget; 400 var btnOpenSearchID = 'js-open-zipCodeSearch'; 401 402 if (relatedTarget) { 403 if (relatedTarget.getAttribute('id') === btnOpenSearchID || relatedTarget.parentNode.getAttribute('id') === btnOpenSearchID) { 404 return; 405 } 406 } 407 408 //Ajaxéä¿¡ 409 /* 410 $.ajax({ 411 url : suz_getCurrentDomain() + "/ajax/registrationAjax/getCityName/", 412 data : { 413 countryId : $("select[name='countryID']").val(), 414 fieldName : $(this).attr('name'), 415 fieldValue : $(this).val(), 416 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").attr("value") 417 }, 418 dataType : "jsonp", 419 jsonp : "callback", 420 scriptCharset: "UTF-8" 421 }).then(function(data) { 422 var cityName = $("input[name='cityName']"); 423 if (data['status'] == 0) { 424 cityName.val(data['cityName']); 425 suz_callRegValidator('cityName', cityName.val()); 426 } 427 }, 428 function(req, stat, err) { 429 if(req.status == 401){ 430 window.location.href = suz_getCurrentDomain() + "/error/tokenError.jsp"; 431 return false; 432 } 433 alert(err); 434 return false; 435 }); 436 */ 437 }); 438 if ($('.suzPwdViewMode').length>0) { 439 suz_showPassword(); 440 } 441}); 442// registration 443function suz_checkPrev(trgt) { 444 var $trgtDiv = trgt.closest('.suz_rr'); 445 var $parentDiv = $trgtDiv.parent(); 446 var seen = new Set(); 447 448 function runCheckItem($base) { 449 var $prevDivs = $base.prevAll(); 450 451 $prevDivs.not('.suz_rr').find('.suz_rr').add($prevDivs.filter('.suz_rr')).each(function () { 452 if (seen.has(this)) { 453 return; 454 } 455 seen.add(this); 456 suz_checkEntryItem($(this)); 457 }); 458 } 459 460 runCheckItem($trgtDiv); 461 462 while ($parentDiv.length && 463 !$parentDiv.is('[data-panel-index]') && 464 !$parentDiv.is('form') 465 ) { 466 runCheckItem($parentDiv); 467 $parentDiv = $parentDiv.parent(); 468 } 469} 470function suz_checkFollowing(trgt) { 471 var $trgtDiv = trgt.closest('.suz_rr'); 472 var $parentDiv = $trgtDiv.parent(); 473 var seen = new Set(); 474 475 function runCheckItem($base) { 476 var $prevDivs = $base.nextAll(); 477 478 $prevDivs.not('.suz_rr').find('.suz_rr').add($prevDivs.filter('.suz_rr')).each(function () { 479 if (seen.has(this)) { 480 return; 481 } 482 seen.add(this); 483 suz_checkEntryItem($(this)); 484 }); 485 } 486 487 runCheckItem($trgtDiv); 488 489 while ($parentDiv.length && 490 !$parentDiv.is('[data-panel-index]') && 491 !$parentDiv.is('form') 492 ) { 493 runCheckItem($parentDiv); 494 $parentDiv = $parentDiv.parent(); 495 } 496} 497function suz_checkEntryItem(trgt) { 498 if (trgt.hasClass("suzChecked")) { 499 return true; 500 } 501 var prevItem = trgt.find(":text,:password,:radio,select,input[type='email'],input[type='tel']"); 502 if (prevItem.attr('name') == 'verificationCode' || prevItem.attr('name') == 'verificationEmailCode' || prevItem.attr('name') == 'mobileCountryID') { 503 return true; 504 } 505 if (prevItem.length == 2) { 506 if (prevItem[0].style.display == 'none') { 507 suz_callRegValidator(prevItem[1].name, prevItem[1].value); 508 } else { 509 if (prevItem[1].name == 'mobileNumber' || prevItem[1].name == 'mobilePhoneNumber' || prevItem[1].name == 'phoneNumber') { 510 suz_callRegValidator(prevItem[0].name, prevItem[0].value); 511 suz_callRegValidator(prevItem[1].name, prevItem[1].value); 512 }else{ 513 suz_callRegValidator(prevItem[1].name, prevItem[0].value); 514 } 515 } 516 return true; 517 } else if (prevItem.length == 1) { 518 suz_callRegValidator(prevItem.attr('name'), prevItem.val()); 519 return true; 520 } 521 prevItem = trgt.find(":checkbox"); 522 suz_callRegValidator(prevItem.attr('name'), prevItem.prop('checked') ? 'on' : 'off'); 523} 524function suz_getCurrentDomain() { 525 return (typeof kpi_currentDomain == "undefined") ? kpi_originalDomain : kpi_currentDomain; 526} 527function suz_callRegValidator(fldNm, fldVal, isErrorDisplayActive) { 528 var trgtTr = $("#suz_tr_" + fldNm); 529 var trgtDiv = $("#suz_div_" + fldNm); 530 if (fldNm == 'mobileNumber' && $('#suz_registrationMode').html() == 'edit') { 531 trgtDiv = $("#suz_div_mobileCountryID"); 532 } 533 var deferred = new $.Deferred(); 534 var errorText = null; 535 536 $.ajax({
537 url : suz_getCurrentDomain() + "/ajax/registrationAjax/validator/", 538 data : { 539 fieldName : fldNm, 540 fieldValue : encodeURIComponent(fldVal), 541 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").val() 542 }, 543 dataType : "jsonp", 544 jsonp : "callback", 545 scriptCharset : "UTF-8" 546 }).then(function(data) { 547 if (trgtTr[0]) { 548 if (data['message']) { 549 trgtTr.removeClass("ProperRow"); 550 trgtTr.addClass("is-error"); 551 trgtTr.find("p").html(data['message']); 552 trgtTr.find("p").parent().css('display', 'block'); 553 } else { 554 trgtTr.removeClass("is-error"); 555 trgtTr.addClass("ProperRow"); 556 trgtTr.find("p").html(""); 557 trgtTr.find("p").parent().css('display', 'none'); 558 } 559 trgtTr.addClass("suzChecked") 560 } 561 if (trgtDiv[0]) { 562 errorText = trgtDiv.find('.js-formErrText'); 563 564 if (window.KeyenceForm.MultiFactorAuthentication.isMatchedInitialErrorField(trgtDiv[0]) || 565 window.KeyenceForm.MultiFactorAuthentication.isDisabledTarget(trgtDiv[0]) 566 ) { 567 if ('available' in trgtDiv[0].dataset || 568 'unavailable' in trgtDiv[0].dataset 569 ) { 570 delete trgtDiv[0].dataset.available; 571 delete trgtDiv[0].dataset.unavailable; 572 } 573 574 window.KeyenceForm.AvailableValidator.changeDisplayNoteText(fldNm); 575 deferred.resolve(data); 576 577 return; 578 } 579 580 if (isErrorDisplayActive || 581 (!isErrorDisplayActive && window.KeyenceForm.ControlErrorDisplay.isTriggerClicked(trgtDiv.get(0)))) { 582 if (data['message']) { 583 trgtDiv.addClass("is-error"); 584 errorText.html(data['message']); 585 if (!errorText.attr('style')) { 586 errorText.removeClass('is-hide'); 587 } else { 588 errorText.css('display', 'block'); 589 } 590 window.KeyenceForm.AvailableValidator.removeUnavailableStatus(fldNm); 591 } else { 592 trgtDiv.removeClass("is-error"); 593 errorText.html(""); 594 if (!errorText.attr('style')) { 595 errorText.addClass('is-hide'); 596 } else { 597 errorText.css('display', 'none'); 598 } 599 window.KeyenceForm.AvailableValidator.changeDisplayNoteText(fldNm); 600 } 601 } else { 602 window.KeyenceForm.AvailableValidator.changeDisplayNoteText(fldNm); 603 } 604 605 trgtDiv.addClass("suzChecked"); 606 } 607 608 deferred.resolve(data); 609 }, 610 function(req, stat, err) { 611 if(req.status == 401){ 612 window.location.href = suz_getCurrentDomain() + "/error/tokenError.jsp"; 613 614 return false; 615 } 616 if(req.status != 0){ 617 alert(err); 618 } 619 deferred.reject(); 620 return false; 621 }); 622 623 return deferred.promise(); 624} 625function suz_callSetForm(fldNm, fldVal) { 626 var trgtTr = $("#suz_tr_" + fldNm); 627 var trgtDiv = $("#suz_div_" + fldNm); 628 var deferred = new $.Deferred(); 629 630 $.ajax({ 631 url : suz_getCurrentDomain() + "/ajax/registrationAjax/setForm/", 632 data : { 633 fieldName : fldNm, 634 fieldValue : encodeURIComponent(fldVal), 635 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").val() 636 }, 637 dataType : "jsonp", 638 jsonp : "callback", 639 scriptCharset : "UTF-8" 640 }).then(function(data) { 641 deferred.resolve(data); 642 }, 643 function(req, stat, err) { 644 if(req.status == 401){ 645 window.location.href = suz_getCurrentDomain() + "/error/tokenError.jsp"; 646 647 return false; 648 } 649 alert(err); 650 deferred.reject(); 651 return false; 652 }); 653 654 return deferred.promise(); 655} 656function suz_submitRestriction() { 657 var suz_formfilter = function() { 658 return $(this).find("input[type='submit']").length > 1; 659 }; 660 $("#ContentsArea form").filter(suz_formfilter).each(function() { 661 $(this).find("input[type=text],input[type=password],input[type=radio],input[type=checkbox]").on('keypress', function(ev) { 662 if ((ev.which && ev.which === 13) || (ev.keyCode && ev.keyCode === 13)) { 663 return false; 664 } 665 }); 666 }); 667} 668function suz_showRegisterTopBottomGuide() { 669 var incFlPath = suz_getCurrentDomain() + "/register/entry/register/rwd"; 670 if (document.getElementById('suz_profileTopGuide') != null) { 671 incFlPath = suz_getCurrentDomain() + "/my-keyence/edit-profile/edit/rwd"; 672 } 673 if ($('#suz_agreementControl').html() !== '') { 674 $('#suz_registerTopGuide, #suz_profileTopGuide').load(incFlPath + '/topGuide_'+$('#suz_agreementControl').html()+'.html', function() { 675 $('#suz_registerBottomGuide, #suz_profileBottomGuide').load(incFlPath + '/bottomGuide_'+$('#suz_agreementControl').html()+'.html', function() { 676 $('#suz_registerTopGuide .CustomCheckbox, #suz_registerBottomGuide .CustomCheckbox, #suz_profileTopGuide .CustomCheckbox, #suz_profileBottomGuide .CustomCheckbox').checkbox({ 677 view : true, 678 uiClass : 'CustomCheckbox', 679 labelClass : 'UIElm-check-label', 680 checkedClass : 'checked', 681 disabledClass : 'disabled' 682 }); 683 if ($('#suz_agreementState1').html() !== '') { 684 suz_linkedCheckBox($('#as_agreeBoxCheked input'), true); 685 } 686 if ($('#suz_agreementState2').html() !== '') { 687 suz_linkedSelectCheckBox(1); 688 } 689 if ($('#suz_agreementState3').html() !== '') { 690 suz_linkedSelectCheckBox(2); 691 } 692 if ($('#suz_agreementState4').html() !== '') { 693 suz_linkedSelectCheckBox(3); 694 } 695 suz_checkBoxDecision(); 696 }); 697 }); 698 } else { 699 if ($('#suz_dspLanguage').html() != null && $('#suz_dspLanguage').html() !== '') { 700 var topGuideFileName = incFlPath + '/topGuide_' + $('#suz_dspLanguage').html() + '.html'; 701 var bottomGuideFileName = incFlPath + '/bottomGuide_' + $('#suz_dspLanguage').html() + '.html'; 702 } else { 703 var topGuideFileName = incFlPath + '/topGuide.html'; 704 var bottomGuideFileName = incFlPath + '/bottomGuide.html'; 705 } 706 setKRCheckboxControl(); 707 $('#suz_registerTopGuide, #suz_profileTopGuide').load(topGuideFileName, function() { 708 $('#suz_registerBottomGuide, #suz_profileBottomGuide').load(bottomGuideFileName, function() { 709 suz_checkBoxDecision(); 710 }); 711 }); 712 } 713} 714function setKRCheckboxControl() { 715 if ($('#suz_dspLanguage').html() == 'ko-KR') { 716 $('#suz_registerTopGuide .CustomCheckbox, #suz_registerBottomGuide .CustomCheckbox, #suz_profileTopGuide .CustomCheckbox, #suz_profileBottomGuide .CustomCheckbox').checkbox({ 717 view: true 718 ,uiClass: 'CustomCheckbox' 719 ,labelClass: 'UIElm-check-label' 720 ,checkedClass: 'checked' 721 ,disabledClass: 'disabled' 722 }); 723 } 724} 725function suz_linkedSelectCheckBox(index){ 726 var box = $('#as_agreeBoxCheked input') 727 var count = 0; 728 box.each(function(){ 729 if(count == index){ 730 $(this).prop('checked', true); 731 $(this).checkbox('checkOn', $(this).attr('id')); 732 } 733 count ++; 734 }); 735 736} 737function suz_linkedCheckBox(checkBoxes, onOff) { 738 checkBoxes.prop('checked', onOff); 739 740 checkBoxes.each(function(){ 741 if(onOff){
742 $(this).checkbox('checkOn', $(this).attr('id')); 743 }else{ 744 $(this).checkbox('checkOff', $(this).attr('id')); 745 } 746 }); 747} 748function suz_checkBoxDecision() { 749 var $DownloadListLicenseSoftwareJObj = $('#DownloadListLicenseSoftware'); 750 var $DownloadListLicenseCadJObj = $('#DownloadListLicenseCad'); 751 752 if ($('#as_agreeBoxCheked input').length == $('#as_agreeBoxCheked input:checked').length) { 753 if ($DownloadListLicenseSoftwareJObj.length || $DownloadListLicenseCadJObj.length) { 754 if (window.kpi_cartObj._isDownloadLicenseAgreed($DownloadListLicenseSoftwareJObj, $DownloadListLicenseCadJObj)) { 755 changeRegisterProgressButtonActive(); 756 window.kpi_cartObj._changeUserRegisterButtonActive($('.js-multiStep-target .js-regForm-btnNext')); 757 } 758 } else { 759 changeRegisterProgressButtonActive(); 760 } 761 } else { 762 $('#as_agreeBoxCheked_btn').css({opacity : '0.3'}).addClass('checkOff'); 763 $('#as_agreeBoxCheked_btn input,#as_agreeBoxCheked_btn button').prop('disabled', true); 764 $('.js-multiStep-target .js-regForm-btnNext').attr('tabindex', -1).prop('disabled', true).attr('data-disabled', true).attr('aria-disabled', true); 765 $('.js-regForm-btnSubmit').attr('data-disabled', true); 766 $('.js-regForm-btnSubmit').attr('tabindex', -1).prop('disabled', true); 767 $('.js-regForm-btnSubmit').parent('.of-inputElement').attr('aria-disabled', true); 768 } 769} 770function changeRegisterProgressButtonActive() { 771 $('#as_agreeBoxCheked_btn').css({opacity : '1'}).removeClass('checkOff'); 772 $('#as_agreeBoxCheked_btn input,#as_agreeBoxCheked_btn button').prop('disabled', false); 773 $('.js-multiStep-target .js-regForm-btnNext').attr('tabindex', 0).prop('disabled', false).attr('data-disabled', false).attr('aria-disabled', false); 774 if ($('.js-regForm-btnSubmit').is(':visible')) { 775 $('.js-regForm-btnSubmit').attr('data-disabled', false); 776 $('.js-regForm-btnSubmit').attr('tabindex', 0).prop('disabled', false); 777 $('.js-regForm-btnSubmit').parent('.of-inputElement').attr('aria-disabled', false); 778 } 779} 780function mlc_resetMultiStepForm() { 781 var KeyenceForm = window.KeyenceForm; 782 var SMSCodeButton = KeyenceForm.SMSCodeButton; 783 var smscodeButtonInfo; 784 var $regArea = $("#suz_regArea"); 785 var panelNum = $('#js-multiStepForm-registration').attr('data-index-current'); 786 787 if (panelNum === undefined || panelNum === '0') { 788 panelNum = 1; 789 } else { 790 panelNum = window.parseInt(panelNum, 10); 791 } 792 793 window.MultiStepForm.Register.setPanelAttributes(); 794 795 if (typeof panelNum === 'number' && !isNaN(panelNum)) { 796 window.MultiStepForm.Register.showPanelByIndex(panelNum - 1); 797 window.MultiStepForm.Register.changeProgress(panelNum); 798 } 799 800 if ($('#as_agreeBoxCheked').length) { 801 window.suz_checkBoxDecision(); 802 } 803 804 if (window.KeyenceForm) { 805 window.KeyenceForm.SelectCountryNumber.init(); 806 } 807 808 if (SMSCodeButton && SMSCodeButton.timeIds) { 809 smscodeButtonInfo = SMSCodeButton.timeIds; 810 811 Object.keys(smscodeButtonInfo).forEach(function (buttonId) { 812 var $button = $regArea.find('#' + buttonId); 813 var buttonElement = $button.get(0); 814 815 if ($button.length) { 816 window.clearInterval(smscodeButtonInfo[buttonId].timeId); 817 818 SMSCodeButton.disableButton(buttonElement); 819 SMSCodeButton.replaceButtonText(buttonElement, buttonElement.getAttribute('data-resend-text'));
820 SMSCodeButton.toggleResendCount(buttonElement, 'show'); 821 SMSCodeButton.countResendTime(buttonElement, smscodeButtonInfo[buttonId].timerCount); 822 } 823 }); 824 } 825} 826 827function mlc_updateFormByIPAddressCountryId() { 828 var $regForm = $('#js-multiStepForm-registration'); 829 var observer; 830 var defCountryId = $('#suz_countryID').val(); 831 832 var updateHTML = function () { 833 $.ajax({ 834 url : suz_getCurrentDomain() + "/ajax/registrationAjax/ipAddressCountryId/", 835 data : {}, 836 dataType : "jsonp", 837 jsonp : "callback", 838 scriptCharset : "UTF-8" 839 }).then(function(data) { 840 if (data && defCountryId != data['countryId']){ 841 $.ajax({ 842 url : suz_getCurrentDomain() + "/ajax/registrationAjax/getFormList/", 843 data : { 844 countryId : data['countryId'], 845 stateId : $("#suz_stateID").val(), 846 token : $("input[name='org.apache.struts.taglib.html.TOKEN']").val(), 847 rwd : document.getElementById("suz-responsive") != null 848 }, 849 dataType : "html", 850 scriptCharset : "UTF-8" 851 }).then(function(html) { 852 $("#suz_regArea").html(html); 853 $("#js-formStep-totalNum").text($("#hidMaxStepCount").val()); 854 suz_showRegisterTopBottomGuide(); 855 856 if ($('#js-multiStepForm').length) { 857 mlc_resetMultiStepForm(); 858 } 859 }, 860 function(data, status) { 861 suz_showRegisterTopBottomGuide(); 862 }); 863 }else{ 864 suz_showRegisterTopBottomGuide(); 865 } 866 }, 867 function() { 868 suz_showRegisterTopBottomGuide(); 869 }); 870 }; 871 872 if ($regForm.length) { 873 observer = new MutationObserver(function (mutations) { 874 if (mutations[0].target.classList.contains('is-initialized')) { 875 updateHTML(); 876 observer.disconnect(); 877 } 878 }); 879 880 observer.observe($regForm.get(0), { 881 attributes: true, 882 attributeFilter: ['class'] 883 }); 884 } else { 885 updateHTML(); 886 } 887} 888function suz_showPassword() { 889 $('.suzPwdViewMode').showPassword({ 890 linkClass: 'showPasswordLink form-showPasswordLink', //Class to use for the toggle link 891 linkText: $('.suzShowPassword').html(), //Text for the link 892 showPasswordLinkText: $('.suzHidePassword').html(), //Text for the link when password is not masked 893 showPasswordInputClass: 'form-showPassword', //Class for the text input that will show the password 894 linkRightOffset: 0, //Offset from the right of the parent 895 linkTopOffset: 0 //Offset from the top of the parent 896 }); 897}
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.