1let firstCnt = 0; 2(function ($) { 3 4 $.goPage = function (page, popup) { 5 if (page && (page.indexOf("/") == 0)) { 6 page = page.substring(1); 7 } 8 9 if (popup) { 10 window.open(gContextPath + page); 11 } else { 12 location.href = gContextPath + page; 13 } 14 }; 15 16 $.goMyPage = function () { 17 $.member(function (user) { 18 if (user) { 19 if (user.userType == "S") { 20 $.goPage("/user/mypage/startup"); 21 } else if (user.userType == "C") { 22 $.goPage("/user/mypage/company"); 23 } else { 24 $.goPage("/user/mypage/member"); 25 } 26 } else { 27 $.alert("not authorized yet", () => { 28 $.goPage("/user/signin") 29 }); 30 } 31 }); 32 }; 33 34 $.fn.saveFilter = function () { 35 36 }; 37 38 $.fn.loadFilter = function () { 39 40 }; 41 42 /* ì ë ¥ í¼ìì ì¬ì©ìì ìí ë³ê²½ì´ ì¼ì´ë¬ëì§ ì¬ë¶ë¥¼ ì¶ì íë¤. */ 43 $.fn.monitorChanged = function (settings) { 44 let defaultSettings = { 45 callback: () => { 46 } 47 }; 48 49 let options = $.extend({}, defaultSettings, settings || {}); 50 51 return this.each(function () { 52 let manager = ChangeMonitor.get($(this)); 53 54 manager.firstData = $(this).serialize(); 55 $(this).find("[type='file']").each((index, item) => { 56 manager.firstData += "&" + $(item).attr("name") + "=" + $(item).val(); 57 }); 58 59 if (!manager.eventSet) { 60 $(this).find(":input").on("change click keyup", (event) => { 61 let data = $(this).serialize(); 62 63 $(this).find("[type='file']").each((index, item) => { 64 data += "&" + $(item).attr("name") + "=" + $(item).val(); 65 }); 66 67 options.callback((data != manager.firstData)); 68 }); 69 70 manager.eventSet = true; 71 } 72 }); 73 }; 74 75 function ChangeMonitor(layer) { 76 this.layer = layer; 77 }; 78 79 ChangeMonitor.pool = []; 80 81 ChangeMonitor.get = function (element) { 82 for (var i in ChangeMonitor.pool) { 83 if (ChangeMonitor.pool[i].layer.is(element)) { 84 return ChangeMonitor.pool[i]; 85 } 86 } 87 88 var manager = new ChangeMonitor(element); 89 ChangeMonitor.pool.push(manager); 90 91 return manager; 92 }; 93 94 95 $.isAdminPage = function () { 96 var url = location.href; 97 return (url.indexOf("admin") > 0); 98 }; 99 100 $.dateFormat = function (str) { 101 if (!str || str == "") { 102 return ""; 103 } 104 105 var date = new Date(str); 106 if (date) { 107 return date.toLocaleString(); 108 } else { 109 return str; 110 } 111 }; 112 113 $.imageUrl = function (idx) { 114 return gContextPath + "user/image/" + idx; 115 }; 116 117 $.htmlUrl = function (idx) { 118 return gContextPath + "user/html/" + idx; 119 }; 120 121 $.fileDownload = function (idx) { 122 return gContextPath + "user/file/" + idx; 123 }; 124 125 $.fn.makeParams = function () { 126 var obj = {}; 127 128 $(this).find("[name]").each((index, item) => { 129 let value = $(item).val(); 130 if (value && value !== "") { 131 obj[$(item).attr("name")] = value; 132 } 133 134 }); 135 136 return obj; 137 }; 138 139 $.industrialFileds = function (job, data) { 140 if (job == "parent") { 141 142 } else if (job == "children") { 143 144 } else if (job == "list") { 145 return industrialFieldsManager.makeList(data); 146 } 147 }; 148 149 /* íì¼ì í¬ê¸°ì extension ê²ì¬ */ 150/* $.fileCheck = function (selector, required, extensions, sizeLimit) { 151 let $file = $(selector); 152 let result = { 153 valid: true 154 }; 155 156 if ($file.length > 0) { 157 let file = $file[0].files[0]; 158 159 if (file) { 160 if (extensions) { 161 let fileName = file.name; 162 let index = fileName.lastIndexOf("."); 163 let extension = (index >= 0) ? fileName.substring(index).toUpperCase() : undefined; 164 165 let valid = false; 166 for (let i in extensions) { 167 if (extensions[i].toUpperCase() == extension) { 168 valid = true; 169 break; 170 } 171 } 172 173 if (!valid) { 174 result.valid = false; 175 result.message = "file type mismatch"; 176 177 return result; 178 } 179 } 180 181 if (sizeLimit && sizeLimit > 0) { 182 if (file.size > sizeLimit) { 183 result.valid = false; 184 result.message = "file size overflow"; 185 186 return result; 187 } 188 } 189 } else { 190 if (required) { 191 result.valid = false; 192 result.message = "mandatory"; 193 } else { 194 result.valid = true; 195 } 196 } 197 } else { 198 throw new Error("invalid selector"); 199 } 200 201 return result; 202 },*/ 203 204 //íì¼ extesion ê²ì¬_2 205 $.fileCheck = function (selector, required, extensions, sizeLimit) { 206 let $file = $(selector); 207 let result = {
208 valid: true 209 }; 210 211 if ($file.length > 0) { 212 let file = $file[0].files[0]; 213 214 if (file) { 215 if (extensions && extensions.length > 0) { 216 let fileName = file.name; 217 let index = fileName.lastIndexOf("."); 218 let extension = (index >= 0) ? fileName.substring(index).toLowerCase() : undefined; 219 220 let valid = extensions.some(ext => ext.toLowerCase() === extension); 221 222 if (!valid) { 223 result.valid = false; 224 result.message = "file type mismatch"; 225 return result; 226 } 227 } 228 229 if (sizeLimit && sizeLimit > 0 && file.size > sizeLimit) { 230 result.valid = false; 231 result.message = "file size overflow"; 232 return result; 233 } 234 } else { 235 if (required) { 236 result.valid = false; 237 result.message = "mandatory"; 238 } 239 } 240 } else { 241 throw new Error("invalid selector"); 242 } 243 244 return result; 245 }; 246 247 /* ì½ê´ íì ëì°ê¸° - layerPopupì ui.jsì */ 248 $.showTerms = function (terms) { 249 var title; 250 let terms1; 251 if ("service" == terms) { 252 terms1 = "T1"; 253 title = "the Terms of Service"; 254 } else if ("privacy" == terms) { 255 terms1 = "T2"; 256 title = "the Privacy Terms"; 257 } else if ("thirdParty" == terms) { 258 terms1 = "T3"; 259 title = "the Third party information Terms"; 260 } 261 262 get("user-common/api/terms", {terms: terms1}, data => { 263 console.log("terms", data); 264 if (data == null || data == "") { 265 $("#agreePop .title").html(title); 266 $("#agreePop .content").html(""); 267 268 $.alert("Sorry. " + title + " is not registered."); 269 } else { 270 $("#agreePop .title").html(title); 271 $("#agreePop .content").html(data.content); 272 273 layerPopup.open("#agreePop"); 274 275 $("#agreePop .btn_agree").one("click", () => { 276 $(".terms[data-terms='" + terms + "']").prop("checked", true); 277 $("#agreePop .btnPopClose").trigger("click"); 278 $(".terms[data-terms='" + terms + "']").trigger("change"); 279 }); 280 } 281 }); 282 }; 283 284 $.checkPeriod = function () { 285 let startDate = $("[name='startDate']").val(); 286 let endDate = $("[name='endDate']").val(); 287 let field = $("#guide_period"); 288 289 field.addClass("validation_fail"); 290 291 if (startDate == "" || endDate == "") { 292 field.html("required"); 293 return false; 294 } else if (startDate > endDate) { 295 field.html("invalid data"); 296 return false; 297 } 298 299 field.removeClass("validation_fail"); 300 field.html(""); 301 return true; 302 }; 303 304 $.fn.textareaCharCounts = function (settings) { 305 const defaultSettings = {}; 306 307 var options = $.extend({}, defaultSettings, settings || {}); 308 309 return $(this).each(function () { 310 $(this).on("change keyup", () => { 311 if (options.target) { 312 $(options.target).html($(this).val().length); 313 } 314 }); 315 316 if (options.target) { 317 $(options.target).html($(this).val().length); 318 } 319 }); 320 }; 321 322 323 /* innobranch ì¬ì©ì íì´ì§ìì ì¬ì©ì ì ë ¥ ê²ì¬ */ 324 $.fn.validateInput = function (param1) { 325 var options = { 326 fnMonitor: function (valid, invalidList) { 327 if (typeof (param1) == "string") { 328 $(param1).attr("disabled", !valid); 329 } else if (typeof (param1) == "function") { 330 param1(valid, invalidList); 331 } 332 }, 333 334 fnFailMessage: function (element, result) { 335 Form1.error(element, false); 336 Form1.error(element, result.failMessage); 337 }, 338 339 fnSuccessMessage: function (element) { 340 Form1.error(element, false); 341 } 342 }; 343 344 $(this).inputValidate("init", options); 345 }; 346 347 $.fn.onlyDigit = function () { 348 349 return $(this).each((index, item) => { 350 $(item).on("keyup blur", event => { 351 var elem = $(event.target); 352 var value = elem.val(); 353 var text = ""; 354 355 for (var i = 0; i < value.length; i++) { 356 if (value.charAt(i) >= '0' && value.charAt(i) <= '9') { 357 text += value.charAt(i); 358 } 359 } 360 361 elem.val(text); 362 elem.trigger("change"); 363 }); 364 });
365 366 }; 367 368 369 /* íê¸ ì ë ¥ ê¸ì§ */ 370 $.fn.preventHangeul = function () { 371 372 return $(this).each((index, item) => { 373 $(item).on("keyup blur", event => { 374 var elem = $(event.target); 375 var value = elem.val(); 376 var text = ""; 377 378 for (var i = 0; i < value.length; i++) { 379 if (value.charAt(i) < 'ã±' || value.charAt(i) > 'í£') { 380 text += value.charAt(i); 381 } 382 } 383 384 elem.val(text); 385 elem.trigger("change"); 386 }); 387 }); 388 389 }; 390 391 /* íê¸ ì ë ¥ ê¸ì§ */ 392 $.fn.preventHangeulDigit = function () { 393 394 return $(this).each((index, item) => { 395 $(item).on("keyup blur", event => { 396 var elem = $(event.target); 397 var value = elem.val(); 398 var text = ""; 399 400 for (var i = 0; i < value.length; i++) { 401 if ((value.charAt(i) < 'ã±' || value.charAt(i) > 'í£') && 402 (value.charAt(i) < '0' || value.charAt(i) > '9')) { 403 text += value.charAt(i); 404 } 405 } 406 407 elem.val(text); 408 elem.trigger("change"); 409 }); 410 }); 411 412 }; 413 414 415 $.fn.initFilter = function (data) { 416 if (typeof (data) == "string") { 417 data = JSON.parse(data); 418 } 419 420 return $(this).each((index, item) => { 421 Object.keys(data).map(k => { 422 $(item).find("[name='" + k + "']").val(data[k]); 423 }); 424 }); 425 }, 426 427 $.fn.countryCodeCombo = function (settings) { 428 429 return $(this).each((index, item) => { 430 431 for (var i in gCountries) { 432 var option = $("<option></option>"); 433 var country = gCountries[i]; 434 435 option.html(country.name + "(" + country.code2 + ")"); 436 option.attr("value", country.phone); 437 option.data("code2", country.code2); 438 option.data("code3", country.code3); 439 440 $(item).append(option); 441 } 442 443 $(item).on('change', function() { 444 var $selectedOption = $(this).find('option:selected'); 445 var code2 = $selectedOption.data('code2'); 446 447 $(this).closest('div').find('input[type="hidden"]').val(code2); 448 }); 449 }); 450 }; 451 452 $.fn.setSystemCodeCombe = function (code) { 453 if (!code) return; 454 455 return $(this).each((index, item) => { 456 457 _getSystemCode(code, "", (list) => { 458 459 for (var i in list) { 460 var option = $("<option></option>"); 461 var code = list[i]; 462 463 option.html(list[i].IEM_NM); 464 option.attr("value", list[i].IEM_SE_CODE_ID); 465 466 $(item).append(option); 467 } 468 469 }); 470 }); 471 472 }; 473 474 $.getCountry = function (query) { 475 476 for (var i in gCountries) { 477 if (gCountries[i].phone == query) { 478 return gCountries[i]; 479 } 480 } 481 482 for (var i in gCountries) { 483 if (gCountries[i].code2 == query) { 484 return gCountries[i]; 485 } 486 } 487 488 for (var i in gCountries) { 489 if (gCountries[i].code3 == query) { 490 return gCountries[i]; 491 } 492 } 493 }, 494 495 $.sizeStr = function (size) { 496 size = size - 0; 497 498 let unit = 0; 499 while (size > 1024) { 500 size = size / 1024; 501 unit++; 502 } 503 504 if (unit > 0) { 505 size = Math.floor(size * 10) / 10; 506 } 507 508 const unitArray = ["", "KB", "MB", "GB"]; 509 510 return size + unitArray[unit]; 511 }; 512 513 $.phoneNumberStr = function (value) { 514 515 if (!value) { 516 return ""; 517 } else if (value.length < 6) { 518 return value; 519 } else if (value.length < 7) { 520 return value.substring(0, 3) + "-" + value.substring(3); 521 } else if (value.length <= 9) { 522 return value.substring(0, 2) + "-" + value.substring(2, 5) + "-" + value.substring(5); 523 } else if (value.length == 10) { 524 return value.substring(0, 3) + "-" + value.substring(3, 6) + "-" + value.substring(6); 525 } else if (value.length >= 11) { 526 return value.substring(0, 3) + "-" + value.substring(3, 7) + "-" + value.substring(7); 527 } 528 529 }, 530 531 $.youtubeCode = function (address) { 532 if (!address) { 533 return null; 534 } 535 536 if (address.startsWith("https://youtu.be/")) { 537 return address.substring("https://youtu.be/".length); 538 } else if (address.startsWith("https://www.youtube.com/watch?v=")) { 539 return address.substring("https://www.youtube.com/watch?v=".length); 540 } else { 541 return address; 542 } 543 }, 544 545 546 $.fn.innoEditor = function (type) { 547 const defaultSettings = { 548 fnChange: function () { 549 }, 550 height: "300px" 551 }; 552 553 var job = "make"; 554 555 if (type === 'data' || type === 'editor') { 556 job = type; 557 } 558 559 var settings; 560 var data; 561 var readOnly = false; 562 563 if (typeof (arguments[0]) == "string") { 564 job = arguments[0]; 565 if (typeof (arguments[1]) == "object") { 566 settings = arguments[1]; 567 } else if (typeof (arguments[1]) == "string") { 568 data = arguments[1]; 569 } 570 } else if (typeof (arguments[0]) == "object") { 571 settings = arguments[0]; 572 } else if (typeof (arguments[0]) == "boolean") { 573 readOnly = arguments[0]; 574 } 575 576 var options = $.extend({}, defaultSettings, settings || {}); 577 var editor = InnoEditor.getManager($(this)); 578 579 if (job == "make") { 580 return editor.make(options, readOnly); 581 } else if (job == "data") { 582 if (data) { 583 editor.setData(data); 584 } else { 585 return editor.getData(); 586 } 587 } else if (job === 'editor') { 588 return editor; 589 } 590 }; 591 592 function InnoEditor(element) { 593 this.layer = element; 594 } 595 596 InnoEditor.pool = []; 597 598 InnoEditor.getManager = function (element) { 599 for (var i in InnoEditor.pool) { 600 if (InnoEditor.pool[i].layer.is(element)) { 601 return InnoEditor.pool[i]; 602 } 603 } 604 605 var manager = new InnoEditor(element); 606 InnoEditor.pool.push(manager); 607 608 return manager; 609 }; 610 611 InnoEditor.prototype = { 612 613 make: function (settings, readOnly) { 614 this.settings = settings; 615 this.editor = null; 616 617 var this1 = this; 618 619 ClassicEditor.create(this.layer[0], { 620 ckfinder: { 621 //uploadUrl: '/file-upload' 622 uploadUrl: '/user-common/api/file-upload' 623 }, 624 625 link: { 626 addTargetToExternalLinks: true, 627 defaultProtocol: 'http://' 628 }, 629 630 mediaEmbed: { 631 previewsInData: true 632 }, 633 634 //toolbar: [] 635 removePlugins: ["List", "SpecialCharacters"], 636 637 readOnly : true 638 639 }) 640 .then(function (editor) { 641 this1.editor = editor; 642 643 if(window.editorArr) window.editorArr.push(editor); 644 else window.editorArr = [editor]; 645 646 editor.model.document.on('change:data', function () { 647 this1.layer.val(this1.editor.getData()); 648 this1.layer.trigger("change"); 649 650 if (this1.settings.fnChange) { 651 this1.settings.fnChange(); 652 } 653 }); 654 655 if (this1.settings.height) { 656 this1.setHeight(this1.settings.height); 657 } 658 659 if(readOnly) { 660 editor.isReadOnly = true; 661 $(editor.sourceElement).parent().addClass("ck-off"); 662 } 663 }); 664 665 return this; 666 }, 667 668 getData: function () { 669 return this.editor.getData(); 670 }, 671 672 setData: function (data) { 673 this.editor.setData(data); 674 }, 675 676 setHeight: function (height) { 677 let style = $("<style>.ck-editor__editable {height: " + height + "}</style>"); 678 $("head").append(style); 679 }, 680 681 setReadOnly: function(readOnly){ 682 this.editor.isReadOnly = readOnly; 683 if(readOnly){ 684 $(this.editor.sourceElement).parent().addClass("ck-off"); 685 }else{ 686 $(this.editor.sourceElement).parent().removeClass("ck-off"); 687 } 688 } 689 690 }; 691 692 693 $.fn.fill = function () { 694 const defaultSettings = { 695 method: "get", 696 params: null, 697 dataSlot: ".data_slot" 698 }; 699 700 var job; 701 var settings; 702 703 if (typeof (arguments[0]) == "string") { 704 job = arguments[0]; 705 settings = arguments[1]; 706 } else if (typeof (arguments[0]) == "object") { 707 job = "default"; 708 settings = arguments[0]; 709 } 710 711 var options = $.extend({}, defaultSettings, settings || {}); 712 var filler = Filler.getManager($(this)); 713 714 filler.init(options); 715 if (job == "default") { 716 filler.readAndFill(); 717 } else if (job == "fill") { 718 filler.fill(); 719 } 720 }; 721 722 function Filler(element) { 723 this.layer = element; 724 //this.layer.empty(); 725 } 726 727 Filler.pool = []; 728 729 Filler.getManager = function (element) { 730 for (var i in Filler.pool) { 731 if (Filler.pool[i].layer.is(element)) { 732 return Filler.pool[i]; 733 } 734 } 735 736 var manager = new Filler(element); 737 Filler.pool.push(manager); 738 739 return manager; 740 }; 741 742 Filler.prototype = { 743 init: function (settings) { 744 this.settings = settings; 745 }, 746 747 readAndFill: function () { 748 749 var this1 = this; 750 this.read((data) => { 751 this.fill(data); 752 }); 753 }, 754 755 fill: function (data) { 756 if (!data) { 757 data = this.settings.data; 758 } 759 760 this._fills(data); 761 if (this.settings.fnSuccess) { 762 this.settings.fnSuccess(data); 763 } 764 }, 765 766 read: function (callback) { 767 var params = [ 768 this.settings.method, 769 this.settings.url, 770 this.settings.params, 771 data => { 772 callback(data); 773 }, 774 message => { 775 if (this.settings.fnFail) { 776 this.settings.fnFail(message); 777 } 778 } 779 ]; 780 781 $.rest.apply(this, params); 782 783 784 //eval(this.settings.method).apply(this, params); 785 }, 786 787 _fills: function (data) { 788 if (data && typeof (data) == "string") { 789 data = data.trim(); 790 } 791 792 $(this.settings.dataSlot).fillData(data); 793 } 794 }; 795 796 797 $.rest = function () { 798 try { 799 var options = restManager.makeOptions(arguments); 800 restManager.execute(options); 801 } catch (error) { 802 console.error(error); 803 } 804 805 }; 806 807 var restManager = { 808 809 execute: function (options) { 810 this.options = options; 811 812 $.ajax({
813 url: gContextPath + options.url, 814 method: options.method, 815 data: options.params, 816 //contentType: "application/json;charset=UTF-8", 817 //dataType: "JSON", 818 beforeSend: function (xhr) { 819 xhr.setRequestHeader("X-AUTH-TOKEN", localStorage.getItem("accessToken")); 820 } 821 }).done(response => { 822 if (options.fnSuccess) { 823 options.fnSuccess(response); 824 } 825 }).fail(jqXHR => { 826 this.handleFail(jqXHR); 827 }); 828 }, 829 830 handleFail: function (jqXHR) { 831 console.log("handleFail", jqXHR); 832 833 var fn = this["handle" + jqXHR.status]; 834 if (fn) { 835 fn.call(this, jqXHR); 836 } else { 837 if (this.options.fnFail) { 838 this.options.fnFail(jqXHR.responseText); 839 } 840 } 841 }, 842 843 handle403: function (jqXHR) { 844 localStorage.kickedPage = location.href; 845 location.href = gContextPath + "user/signin"; 846 }, 847 848 handle500: function (jqXHR) { 849 if (this.options.fnFail) { 850 this.options.fnFail(jqXHR.responseText); 851 } 852 }, 853 854 makeOptions: function (args) { 855 var result = { 856 method: "GET", 857 url: null, 858 params: null, 859 fnSuccess: null, 860 fnFail: null 861 }; 862 863 if (typeof (args[0]) == "string") { 864 if (args.length == 1) { 865 result.url = args[0]; 866 } else if (typeof (args[1]) == "string") { 867 result.method = args[0]; 868 result.url = args[1]; 869 870 if (args.length > 2) { 871 if (typeof (args[2]) == "object") { 872 result.params = args[2]; 873 874 if (args.length > 3) { 875 if (typeof (args[3]) == "function") { 876 result.fnSuccess = args[3]; 877 878 if (args.length > 4) { 879 if (typeof (args[4]) == "function") { 880 result.fnFail = args[4]; 881 } else { 882 throw new Error("invalid arguments"); 883 } 884 } 885 } else { 886 throw new Error("invalid arguments"); 887 } 888 } 889 } else if (typeof (args[2]) == "function") { 890 result.fnSuccess = args[2]; 891 892 if (args.length > 3) { 893 if (typeof (args[3]) == "function") { 894 result.fnFail = args[3]; 895 } else { 896 throw new Error("invalid arguments"); 897 } 898 } 899 } else { 900 throw new Error("invalid arguments"); 901 } 902 } 903 } else if (typeof (args[1]) == "object") { 904 result.url = args[0]; 905 result.params = args[1]; 906 907 if (args.length > 2) { 908 if (typeof (args[2]) == "function") { 909 result.fnSuccess = args[2]; 910 911 if (args.length > 3) { 912 if (typeof (args[3]) == "function") { 913 result.fnFail = args[3]; 914 } else { 915 throw new Error("invalid arguments"); 916 } 917 } 918 } else { 919 throw new Error("invalid arguments"); 920 } 921 } 922 } else if (typeof (args[1]) == "function") { 923 result.url = args[0]; 924 result.fnSuccess = args[1]; 925 926 if (args.length > 2) { 927 if (typeof (args[2]) == "function") { 928 result.fnFail = args[2]; 929 } else { 930 throw new Error("invalid arguments"); 931 } 932 } 933 } else { 934 throw new Error("invalid arguments"); 935 } 936 937 } else { 938 throw new Error("invalid arguments"); 939 } 940 941 return result; 942 } 943 944 }; 945 946 947 let industrialFieldsManager = { 948 makeList: function (data1) { 949 var data = data1.split("|"); 950 var list = []; 951 952 var first; 953 for (var i in data) { 954 if (this.isFirst(data[i])) { 955 first = data[i]; 956 } else { 957 first = this.findParent(data[i]); 958 } 959 960 this._appendFirst(list, first); 961 962 if (!this.isFirst(data[i])) { 963 this._appendSecond(list, first, data[i]); 964 } 965 } 966 967 return list; 968 }, 969 970 isFirst: function (data) { 971 for (var i in gIndustrialFields) { 972 if (gIndustrialFields[i].name == data) { 973 return true; 974 } 975 } 976 977 return false; 978 }, 979 980 findParent: function (data) { 981 for (var i in gIndustrialFields) { 982 var children = gIndustrialFields[i].children; 983 for (var j in children) { 984 if (children[j].name == data) { 985 return gIndustrialFields[i].name; 986 } 987 } 988 } 989 }, 990 991 _appendFirst: function (list, value) { 992 for (var i in list) { 993 if (list[i].name == value) { 994 return; 995 } 996 } 997 998 list.push({industryEnName: value, children: []}); 999 }, 1000 1001 _appendSecond: function (list, first, value) { 1002 for (var i in list) { 1003 if (list[i].name == first) { 1004 list[i].children.push({industryEnName: value}); 1005 } 1006 } 1007 } 1008 }; 1009 1010 1011})(jQuery); 1012 1013 1014const Form1 = { 1015 error: function (target, massege) { 1016 if (massege) { 1017 $(target).closest('.show_error').addClass('error1'); 1018 $('<div class="errorText"></div>').appendTo($(target).closest('.show_error')).text(massege); 1019 } else { 1020 $(target).closest('.show_error').removeClass('error1').find('.errorText').remove(); 1021 } 1022 }, 1023 success: function (target, massege) { 1024 if (massege) { 1025 $(target).closest('.show_error').addClass('error1'); 1026 $('<div class="errorText"></div>').appendTo($(target).closest('.show_error')).text(massege); 1027 } else { 1028 $(target).closest('.show_error').removeClass('error1').find('.errorText').remove(); 1029 } 1030 }, 1031 1032 /*success:function(target, massege){ 1033 if(massege){ 1034 $(target).closest('.formBox').addClass('success'); 1035 $('<div class="successText"></div>').appendTo($(target).closest('.formBox')).text(massege); 1036 }else{ 1037 $(target).closest('.formBox').removeClass('success').find('.successText').remove(); 1038 } 1039 }*/ 1040} 1041 1042 1043function get() {
1044 _doAjaxRequesting(_parseArguments("get", arguments)); 1045} 1046 1047function post() { 1048 _doAjaxRequesting(_parseArguments("post", arguments)); 1049} 1050 1051function ajaxDelete() { 1052 _doAjaxRequesting(_parseArguments("delete", arguments)); 1053} 1054 1055 1056function doAjaxSubmit(caller, form, fnSuccess, fnFail) { 1057 var option = { 1058 /*dataType: "JSON",*/ 1059 1060 type: form.attr("method"), 1061 1062 success: function (response) { 1063 if (fnSuccess) { 1064 fnSuccess.call(caller, response); 1065 } 1066 }, 1067 1068 error: function (jqXHR, textStatus, errorThrown) { 1069 console.log("fail", jqXHR, textStatus); 1070 if (fnFail) { 1071 var obj = { 1072 jqXHR: jqXHR, 1073 textStatus: textStatus, 1074 errorThrown: errorThrown, 1075 message: "" 1076 }; 1077 1078 if (jqXHR.status == 500) { 1079 if (jqXHR.responseJSON) { 1080 obj.message = jqXHR.responseJSON.message; 1081 } else { 1082 obj.message = jqXHR.responseText; 1083 } 1084 } else { 1085 1086 } 1087 1088 obj.failMessage = obj.message; 1089 1090 fnFail.call(caller, obj); 1091 } 1092 }, 1093 1094 beforeSubmit: function () { 1095 //return form.inputValidate("check"); 1096 return true; 1097 }, 1098 }; 1099 1100 form.ajaxSubmit(option); 1101} 1102 1103function _doAjaxRequesting(args) { 1104 $.ajax({ 1105 url: gContextPath + args.url, 1106 method: args.method, 1107 data: args.params, 1108 //contentType: "application/json;charset=UTF-8", 1109 //dataType: "JSON", 1110 beforeSend: function (xhr) { 1111 xhr.setRequestHeader("X-AUTH-TOKEN", localStorage.accessToken); 1112 } 1113 }).done(function (response) { 1114 if (args.fnSuccess) { 1115 if (args.caller) { 1116 args.fnSuccess.call(args.caller, response); 1117 } else { 1118 args.fnSuccess(response); 1119 } 1120 } 1121 }).fail(function (jqXHR) { 1122 __handleAjaxResponseFail(jqXHR, args); 1123 }); 1124 1125} 1126 1127 1128function _parseArguments(method, params) { 1129 const parsingMap = [
1130 {"name": "caller", "type": "object"}, 1131 {"name": "url", "type": "string"}, 1132 {"name": "params", "type": "object"}, 1133 {"name": "fnSuccess", "type": "function"}, 1134 {"name": "fnFail", "type": "function"} 1135 ]; 1136 1137 1138 var index = 0; 1139 var result = {"method": method}; 1140 1141 for (var i = 0; i < params.length; i++) { 1142 for (var j = index; j < parsingMap.length; j++) { 1143 index++; 1144 if (parsingMap[j].type == typeof (params[i])) { 1145 result[parsingMap[j].name] = params[i]; 1146 break; 1147 } 1148 } 1149 } 1150 1151 return result; 1152} 1153 1154 1155function __handleAjaxResponseFail(jqXHR, args) { 1156 console.log(jqXHR, jqXHR.statusCode()); 1157 1158 let statusCode = jqXHR.status; 1159 1160 switch (statusCode) { 1161 case 403: 1162 console.log("forbidden"); 1163 break; 1164 } 1165 1166 1167 if (args.fnFail) { 1168 args.fnFail(jqXHR.responseJSON.message); 1169 } 1170} 1171 1172 1173const gCountries = [{"name": "Afghanistan", "phone": "93", "code2": "AF", "code3": "AFG"}, { 1174 "name": "Albania", 1175 "phone": "355", 1176 "code2": "AL", 1177 "code3": "ALB" 1178}, {"name": "Algeria", "phone": "213", "code2": "DZ", "code3": "DZA"}, { 1179 "name": "American Samoa", 1180 "phone": "1-684", 1181 "code2": "AS", 1182 "code3": "ASM" 1183}, {"name": "Andorra", "phone": "376", "code2": "AD", "code3": "AND"}, { 1184 "name": "Angola", 1185 "phone": "244", 1186 "code2": "AO", 1187 "code3": "AGO" 1188}, {"name": "Anguilla", "phone": "1-264", "code2": "AI", "code3": "AIA"}, { 1189 "name": "Antarctica", 1190 "phone": "672", 1191 "code2": "AQ", 1192 "code3": "ATA" 1193}, {"name": "Antigua and Barbuda", "phone": "1-268", "code2": "AG", "code3": "ATG"}, { 1194 "name": "Argentina", 1195 "phone": "54", 1196 "code2": "AR", 1197 "code3": "ARG" 1198}, {"name": "Armenia", "phone": "374", "code2": "AM", "code3": "ARM"}, { 1199 "name": "Aruba", 1200 "phone": "297", 1201 "code2": "AW", 1202 "code3": "ABW" 1203}, {"name": "Australia", "phone": "61", "code2": "AU", "code3": "AUS"}, { 1204 "name": "Austria", 1205 "phone": "43", 1206 "code2": "AT", 1207 "code3": "AUT" 1208}, {"name": "Azerbaijan", "phone": "994", "code2": "AZ", "code3": "AZE"}, { 1209 "name": "Bahamas", 1210 "phone": "1-242", 1211 "code2": "BS", 1212 "code3": "BHS" 1213}, {"name": "Bahrain", "phone": "973", "code2": "BH", "code3": "BHR"}, { 1214 "name": "Bangladesh", 1215 "phone": "880", 1216 "code2": "BD", 1217 "code3": "BGD" 1218}, {"name": "Barbados", "phone": "1-246", "code2": "BB", "code3": "BRB"}, { 1219 "name": "Belarus", 1220 "phone": "375", 1221 "code2": "BY", 1222 "code3": "BLR" 1223}, {"name": "Belgium", "phone": "32", "code2": "BE", "code3": "BEL"}, { 1224 "name": "Belize", 1225 "phone": "501", 1226 "code2": "BZ", 1227 "code3": "BLZ" 1228}, {"name": "Benin", "phone": "229", "code2": "BJ", "code3": "BEN"}, { 1229 "name": "Bermuda", 1230 "phone": "1-441", 1231 "code2": "BM", 1232 "code3": "BMU" 1233}, {"name": "Bhutan", "phone": "975", "code2": "BT", "code3": "BTN"}, { 1234 "name": "Bolivia", 1235 "phone": "591", 1236 "code2": "BO", 1237 "code3": "BOL" 1238}, {"name": "Bosnia and Herzegovina", "phone": "387", "code2": "BA", "code3": "BIH"}, { 1239 "name": "Botswana", 1240 "phone": "267", 1241 "code2": "BW", 1242 "code3": "BWA" 1243}, {"name": "Brazil", "phone": "55", "code2": "BR", "code3": "BRA"}, { 1244 "name": "British Indian Ocean Territory", 1245 "phone": "246", 1246 "code2": "IO", 1247 "code3": "IOT" 1248}, {"name": "British Virgin Islands", "phone": "1-284", "code2": "VG", "code3": "VGB"}, { 1249 "name": "Brunei", 1250 "phone": "673", 1251 "code2": "BN", 1252 "code3": "BRN" 1253}, {"name": "Bulgaria", "phone": "359", "code2": "BG", "code3": "BGR"}, { 1254 "name": "Burkina Faso", 1255 "phone": "226", 1256 "code2": "BF", 1257 "code3": "BFA" 1258}, {"name": "Burundi", "phone": "257", "code2": "BI", "code3": "BDI"}, { 1259 "name": "Cambodia", 1260 "phone": "855", 1261 "code2": "KH", 1262 "code3": "KHM" 1263}, {"name": "Cameroon", "phone": "237", "code2": "CM", "code3": "CMR"}, { 1264 "name": "Canada", 1265 "phone": "1", 1266 "code2": "CA", 1267 "code3": "CAN" 1268}, {"name": "Cape Verde", "phone": "238", "code2": "CV", "code3": "CPV"}, { 1269 "name": "Cayman Islands", 1270 "phone": "1-345", 1271 "code2": "KY", 1272 "code3": "CYM" 1273}, {"name": "Central African Republic", "phone": "236", "code2": "CF", "code3": "CAF"}, { 1274 "name": "Chad", 1275 "phone": "235",
1276 "code2": "TD", 1277 "code3": "TCD" 1278}, {"name": "Chile", "phone": "56", "code2": "CL", "code3": "CHL"}, { 1279 "name": "China", 1280 "phone": "86", 1281 "code2": "CN", 1282 "code3": "CHN" 1283}, {"name": "Christmas Island", "phone": "61", "code2": "CX", "code3": "CXR"}, { 1284 "name": "Cocos Islands", 1285 "phone": "61", 1286 "code2": "CC", 1287 "code3": "CCK" 1288}, {"name": "Colombia", "phone": "57", "code2": "CO", "code3": "COL"}, { 1289 "name": "Comoros", 1290 "phone": "269", 1291 "code2": "KM", 1292 "code3": "COM" 1293}, {"name": "Cook Islands", "phone": "682", "code2": "CK", "code3": "COK"}, { 1294 "name": "Costa Rica", 1295 "phone": "506", 1296 "code2": "CR", 1297 "code3": "CRI" 1298}, {"name": "Croatia", "phone": "385", "code2": "HR", "code3": "HRV"}, { 1299 "name": "Cuba", 1300 "phone": "53", 1301 "code2": "CU", 1302 "code3": "CUB" 1303}, {"name": "Curacao", "phone": "599", "code2": "CW", "code3": "CUW"}, { 1304 "name": "Cyprus", 1305 "phone": "357", 1306 "code2": "CY", 1307 "code3": "CYP" 1308}, { 1309 "name": "Czech Republic", 1310 "phone": "420", 1311 "code2": "CZ", 1312 "code3": "CZE" 1313}, {"name": "Democratic Republic of the Congo", "phone": "243", "code2": "CD", "code3": "COD"}, { 1314 "name": "Denmark", 1315 "phone": "45", 1316 "code2": "DK", 1317 "code3": "DNK" 1318}, {"name": "Djibouti", "phone": "253", "code2": "DJ", "code3": "DJI"}, { 1319 "name": "Dominica", 1320 "phone": "1-767", 1321 "code2": "DM", 1322 "code3": "DMA" 1323}, {"name": "Dominican Republic", "phone": "1-809", "code2": "DO", "code3": "DOM"}, { 1324 "name": "East Timor", 1325 "phone": "670", 1326 "code2": "TL", 1327 "code3": "TLS" 1328}, {"name": "Ecuador", "phone": "593", "code2": "EC", "code3": "ECU"}, { 1329 "name": "Egypt", 1330 "phone": "20", 1331 "code2": "EG", 1332 "code3": "EGY" 1333}, {"name": "El Salvador", "phone": "503", "code2": "SV", "code3": "SLV"}, { 1334 "name": "Equatorial Guinea", 1335 "phone": "240", 1336 "code2": "GQ", 1337 "code3": "GNQ" 1338}, {"name": "Eritrea", "phone": "291", "code2": "ER", "code3": "ERI"}, { 1339 "name": "Estonia", 1340 "phone": "372", 1341 "code2": "EE", 1342 "code3": "EST" 1343}, {"name": "Ethiopia", "phone": "251", "code2": "ET", "code3": "ETH"}, { 1344 "name": "Falkland Islands", 1345 "phone": "500", 1346 "code2": "FK", 1347 "code3": "FLK" 1348}, {"name": "Faroe Islands", "phone": "298", "code2": "FO", "code3": "FRO"}, { 1349 "name": "Fiji", 1350 "phone": "679", 1351 "code2": "FJ", 1352 "code3": "FJI" 1353}, {"name": "Finland", "phone": "358", "code2": "FI", "code3": "FIN"}, { 1354 "name": "France", 1355 "phone": "33", 1356 "code2": "FR", 1357 "code3": "FRA" 1358}, {"name": "French Polynesia", "phone": "689", "code2": "PF", "code3": "PYF"}, { 1359 "name": "Gabon", 1360 "phone": "241", 1361 "code2": "GA", 1362 "code3": "GAB" 1363}, {"name": "Gambia", "phone": "220", "code2": "GM", "code3": "GMB"}, { 1364 "name": "Georgia", 1365 "phone": "995", 1366 "code2": "GE", 1367 "code3": "GEO" 1368}, {"name": "Germany", "phone": "49", "code2": "DE", "code3": "DEU"}, { 1369 "name": "Ghana", 1370 "phone": "233", 1371 "code2": "GH", 1372 "code3": "GHA" 1373}, {"name": "Gibraltar", "phone": "350", "code2": "GI", "code3": "GIB"}, { 1374 "name": "Greece", 1375 "phone": "30", 1376 "code2": "GR", 1377 "code3": "GRC" 1378}, {"name": "Greenland", "phone": "299", "code2": "GL", "code3": "GRL"}, { 1379 "name": "Grenada", 1380 "phone": "1-473", 1381 "code2": "GD", 1382 "code3": "GRD" 1383}, {"name": "Guam", "phone": "1-671", "code2": "GU", "code3": "GUM"}, { 1384 "name": "Guatemala", 1385 "phone": "502", 1386 "code2": "GT",
1387 "code3": "GTM" 1388}, {"name": "Guernsey", "phone": "44-1481", "code2": "GG", "code3": "GGY"}, { 1389 "name": "Guinea", 1390 "phone": "224", 1391 "code2": "GN", 1392 "code3": "GIN" 1393}, {"name": "Guinea-Bissau", "phone": "245", "code2": "GW", "code3": "GNB"}, { 1394 "name": "Guyana", 1395 "phone": "592", 1396 "code2": "GY", 1397 "code3": "GUY" 1398}, {"name": "Haiti", "phone": "509", "code2": "HT", "code3": "HTI"}, { 1399 "name": "Honduras", 1400 "phone": "504", 1401 "code2": "HN", 1402 "code3": "HND" 1403}, {"name": "Hong Kong", "phone": "852", "code2": "HK", "code3": "HKG"}, { 1404 "name": "Hungary", 1405 "phone": "36", 1406 "code2": "HU", 1407 "code3": "HUN" 1408}, {"name": "Iceland", "phone": "354", "code2": "IS", "code3": "ISL"}, { 1409 "name": "India", 1410 "phone": "91", 1411 "code2": "IN", 1412 "code3": "IND" 1413}, {"name": "Indonesia", "phone": "62", "code2": "ID", "code3": "IDN"}, { 1414 "name": "Iran", 1415 "phone": "98", 1416 "code2": "IR", 1417 "code3": "IRN" 1418}, {"name": "Iraq", "phone": "964", "code2": "IQ", "code3": "IRQ"}, { 1419 "name": "Ireland", 1420 "phone": "353", 1421 "code2": "IE", 1422 "code3": "IRL" 1423}, {"name": "Isle of Man", "phone": "44-1624", "code2": "IM", "code3": "IMN"}, { 1424 "name": "Israel", 1425 "phone": "972", 1426 "code2": "IL", 1427 "code3": "ISR" 1428}, {"name": "Italy", "phone": "39", "code2": "IT", "code3": "ITA"}, { 1429 "name": "Ivory Coast", 1430 "phone": "225", 1431 "code2": "CI", 1432 "code3": "CIV" 1433}, {"name": "Jamaica", "phone": "1-876", "code2": "JM", "code3": "JAM"}, { 1434 "name": "Japan", 1435 "phone": "81", 1436 "code2": "JP", 1437 "code3": "JPN" 1438}, {"name": "Jersey", "phone": "44-1534", "code2": "JE", "code3": "JEY"}, { 1439 "name": "Jordan", 1440 "phone": "962", 1441 "code2": "JO", 1442 "code3": "JOR" 1443}, {"name": "Kazakhstan", "phone": "7", "code2": "KZ", "code3": "KAZ"}, { 1444 "name": "Kenya", 1445 "phone": "254", 1446 "code2": "KE", 1447 "code3": "KEN" 1448}, {"name": "Kiribati", "phone": "686", "code2": "KI", "code3": "KIR"}, { 1449 "name": "Kosovo", 1450 "phone": "383", 1451 "code2": "XK", 1452 "code3": "XKX" 1453}, {"name": "Kuwait", "phone": "965", "code2": "KW", "code3": "KWT"}, { 1454 "name": "Kyrgyzstan", 1455 "phone": "996", 1456 "code2": "KG", 1457 "code3": "KGZ" 1458}, {"name": "Laos", "phone": "856", "code2": "LA", "code3": "LAO"}, { 1459 "name": "Latvia", 1460 "phone": "371", 1461 "code2": "LV", 1462 "code3": "LVA" 1463}, {"name": "Lebanon", "phone": "961", "code2": "LB", "code3": "LBN"}, { 1464 "name": "Lesotho", 1465 "phone": "266", 1466 "code2": "LS", 1467 "code3": "LSO" 1468}, {"name": "Liberia", "phone": "231", "code2": "LR", "code3": "LBR"}, { 1469 "name": "Libya", 1470 "phone": "218", 1471 "code2": "LY", 1472 "code3": "LBY" 1473}, {"name": "Liechtenstein", "phone": "423", "code2": "LI", "code3": "LIE"}, { 1474 "name": "Lithuania", 1475 "phone": "370", 1476 "code2": "LT", 1477 "code3": "LTU" 1478}, {"name": "Luxembourg", "phone": "352", "code2": "LU", "code3": "LUX"}, { 1479 "name": "Macau", 1480 "phone": "853", 1481 "code2": "MO", 1482 "code3": "MAC" 1483}, {"name": "Macedonia", "phone": "389", "code2": "MK", "code3": "MKD"}, { 1484 "name": "Madagascar", 1485 "phone": "261", 1486 "code2": "MG", 1487 "code3": "MDG" 1488}, {"name": "Malawi", "phone": "265", "code2": "MW", "code3": "MWI"}, { 1489 "name": "Malaysia", 1490 "phone": "60", 1491 "code2": "MY", 1492 "code3": "MYS" 1493}, {"name": "Maldives", "phone": "960", "code2": "MV", "code3": "MDV"}, { 1494 "name": "Mali", 1495 "phone": "223", 1496 "code2": "ML", 1497 "code3": "MLI" 1498}, {"name": "Malta", "phone": "356", "code2": "MT", "code3": "MLT"}, { 1499 "name": "Marshall Islands", 1500 "phone": "692", 1501 "code2": "MH", 1502 "code3": "MHL" 1503}, {"name": "Mauritania", "phone": "222", "code2": "MR", "code3": "MRT"}, { 1504 "name": "Mauritius", 1505 "phone": "230", 1506 "code2": "MU", 1507 "code3": "MUS" 1508}, {"name": "Mayotte", "phone": "262", "code2": "YT", "code3": "MYT"}, { 1509 "name": "Mexico", 1510 "phone": "52", 1511 "code2": "MX", 1512 "code3": "MEX" 1513}, {"name": "Micronesia", "phone": "691", "code2": "FM", "code3": "FSM"}, { 1514 "name": "Moldova", 1515 "phone": "373", 1516 "code2": "MD", 1517 "code3": "MDA" 1518}, {"name": "Monaco", "phone": "377", "code2": "MC", "code3": "MCO"}, { 1519 "name": "Mongolia", 1520 "phone": "976",
1521 "code2": "MN", 1522 "code3": "MNG" 1523}, {"name": "Montenegro", "phone": "382", "code2": "ME", "code3": "MNE"}, { 1524 "name": "Montserrat", 1525 "phone": "1-664", 1526 "code2": "MS", 1527 "code3": "MSR" 1528}, {"name": "Morocco", "phone": "212", "code2": "MA", "code3": "MAR"}, { 1529 "name": "Mozambique", 1530 "phone": "258", 1531 "code2": "MZ", 1532 "code3": "MOZ" 1533}, {"name": "Myanmar", "phone": "95", "code2": "MM", "code3": "MMR"}, { 1534 "name": "Namibia", 1535 "phone": "264", 1536 "code2": "NA", 1537 "code3": "NAM" 1538}, {"name": "Nauru", "phone": "674", "code2": "NR", "code3": "NRU"}, { 1539 "name": "Nepal", 1540 "phone": "977", 1541 "code2": "NP", 1542 "code3": "NPL" 1543}, {"name": "Netherlands", "phone": "31", "code2": "NL", "code3": "NLD"}, { 1544 "name": "Netherlands Antilles", 1545 "phone": "599", 1546 "code2": "AN", 1547 "code3": "ANT" 1548}, {"name": "New Caledonia", "phone": "687", "code2": "NC", "code3": "NCL"}, { 1549 "name": "New Zealand", 1550 "phone": "64", 1551 "code2": "NZ", 1552 "code3": "NZL" 1553}, {"name": "Nicaragua", "phone": "505", "code2": "NI", "code3": "NIC"}, { 1554 "name": "Niger", 1555 "phone": "227", 1556 "code2": "NE", 1557 "code3": "NER" 1558}, {"name": "Nigeria", "phone": "234", "code2": "NG", "code3": "NGA"}, { 1559 "name": "Niue", 1560 "phone": "683", 1561 "code2": "NU", 1562 "code3": "NIU" 1563}, {"name": "North Korea", "phone": "850", "code2": "KP", "code3": "PRK"}, { 1564 "name": "Northern Mariana Islands", 1565 "phone": "1-670", 1566 "code2": "MP", 1567 "code3": "MNP" 1568}, {"name": "Norway", "phone": "47", "code2": "NO", "code3": "NOR"}, { 1569 "name": "Oman", 1570 "phone": "968", 1571 "code2": "OM", 1572 "code3": "OMN" 1573}, {"name": "Pakistan", "phone": "92", "code2": "PK", "code3": "PAK"}, { 1574 "name": "Palau", 1575 "phone": "680", 1576 "code2": "PW", 1577 "code3": "PLW" 1578}, {"name": "Palestine", "phone": "970", "code2": "PS", "code3": "PSE"}, { 1579 "name": "Panama", 1580 "phone": "507", 1581 "code2": "PA", 1582 "code3": "PAN" 1583}, {"name": "Papua New Guinea", "phone": "675", "code2": "PG", "code3": "PNG"}, { 1584 "name": "Paraguay", 1585 "phone": "595", 1586 "code2": "PY", 1587 "code3": "PRY" 1588}, {"name": "Peru", "phone": "51", "code2": "PE", "code3": "PER"}, { 1589 "name": "Philippines", 1590 "phone": "63", 1591 "code2": "PH", 1592 "code3": "PHL" 1593}, {"name": "Pitcairn", "phone": "64", "code2": "PN", "code3": "PCN"}, { 1594 "name": "Poland", 1595 "phone": "48", 1596 "code2": "PL", 1597 "code3": "POL" 1598}, {"name": "Portugal", "phone": "351", "code2": "PT", "code3": "PRT"}, { 1599 "name": "Puerto Rico", 1600 "phone": "1-787", 1601 "code2": "PR", 1602 "code3": "PRI" 1603}, {"name": "Qatar", "phone": "974", "code2": "QA", "code3": "QAT"}, { 1604 "name": "Republic of the Congo", 1605 "phone": "242", 1606 "code2": "CG", 1607 "code3": "COG" 1608}, {"name": "Reunion", "phone": "262", "code2": "RE", "code3": "REU"}, { 1609 "name": "Romania", 1610 "phone": "40", 1611 "code2": "RO", 1612 "code3": "ROU" 1613}, {"name": "Russia", "phone": "7", "code2": "RU", "code3": "RUS"}, { 1614 "name": "Rwanda", 1615 "phone": "250", 1616 "code2": "RW", 1617 "code3": "RWA" 1618}, {"name": "Saint Barthelemy", "phone": "590", "code2": "BL", "code3": "BLM"}, { 1619 "name": "Saint Helena", 1620 "phone": "290", 1621 "code2": "SH", 1622 "code3": "SHN" 1623}, {"name": "Saint Kitts and Nevis", "phone": "1-869", "code2": "KN", "code3": "KNA"}, { 1624 "name": "Saint Lucia", 1625 "phone": "1-758", 1626 "code2": "LC", 1627 "code3": "LCA" 1628}, {"name": "Saint Martin", "phone": "590", "code2": "MF", "code3": "MAF"}, { 1629 "name": "Saint Pierre and Miquelon", 1630 "phone": "508", 1631 "code2": "PM", 1632 "code3": "SPM" 1633}, {"name": "Saint Vincent and the Grenadines", "phone": "1-784", "code2": "VC", "code3": "VCT"}, { 1634 "name": "Samoa", 1635 "phone": "685", 1636 "code2": "WS", 1637 "code3": "WSM" 1638}, {"name": "San Marino", "phone": "378", "code2": "SM", "code3": "SMR"}, { 1639 "name": "Sao Tome and Principe", 1640 "phone": "239", 1641 "code2": "ST", 1642 "code3": "STP" 1643}, {"name": "Saudi Arabia", "phone": "966", "code2": "SA", "code3": "SAU"}, { 1644 "name": "Senegal", 1645 "phone": "221", 1646 "code2": "SN", 1647 "code3": "SEN" 1648}, {"name": "Serbia", "phone": "381", "code2": "RS", "code3": "SRB"}, { 1649 "name": "Seychelles", 1650 "phone": "248",
1651 "code2": "SC", 1652 "code3": "SYC" 1653}, {"name": "Sierra Leone", "phone": "232", "code2": "SL", "code3": "SLE"}, { 1654 "name": "Singapore", 1655 "phone": "65", 1656 "code2": "SG", 1657 "code3": "SGP" 1658}, {"name": "Sint Maarten", "phone": "1-721", "code2": "SX", "code3": "SXM"}, { 1659 "name": "Slovakia", 1660 "phone": "421", 1661 "code2": "SK", 1662 "code3": "SVK" 1663}, {"name": "Slovenia", "phone": "386", "code2": "SI", "code3": "SVN"}, { 1664 "name": "Solomon Islands", 1665 "phone": "677", 1666 "code2": "SB", 1667 "code3": "SLB" 1668}, {"name": "Somalia", "phone": "252", "code2": "SO", "code3": "SOM"}, { 1669 "name": "South Africa", 1670 "phone": "27", 1671 "code2": "ZA", 1672 "code3": "ZAF" 1673}, {"name": "South Korea", "phone": "82", "code2": "KR", "code3": "KOR"}, { 1674 "name": "South Sudan", 1675 "phone": "211", 1676 "code2": "SS", 1677 "code3": "SSD" 1678}, {"name": "Spain", "phone": "34", "code2": "ES", "code3": "ESP"}, { 1679 "name": "Sri Lanka", 1680 "phone": "94", 1681 "code2": "LK", 1682 "code3": "LKA" 1683}, {"name": "Sudan", "phone": "249", "code2": "SD", "code3": "SDN"}, { 1684 "name": "Suriname", 1685 "phone": "597", 1686 "code2": "SR", 1687 "code3": "SUR" 1688}, {"name": "Svalbard and Jan Mayen", "phone": "47", "code2": "SJ", "code3": "SJM"}, { 1689 "name": "Swaziland", 1690 "phone": "268", 1691 "code2": "SZ", 1692 "code3": "SWZ" 1693}, {"name": "Sweden", "phone": "46", "code2": "SE", "code3": "SWE"}, { 1694 "name": "Switzerland", 1695 "phone": "41", 1696 "code2": "CH", 1697 "code3": "CHE" 1698}, {"name": "Syria", "phone": "963", "code2": "SY", "code3": "SYR"}, { 1699 "name": "Taiwan", 1700 "phone": "886", 1701 "code2": "TW", 1702 "code3": "TWN" 1703}, {"name": "Tajikistan", "phone": "992", "code2": "TJ", "code3": "TJK"}, { 1704 "name": "Tanzania", 1705 "phone": "255", 1706 "code2": "TZ", 1707 "code3": "TZA" 1708}, {"name": "Thailand", "phone": "66", "code2": "TH", "code3": "THA"}, { 1709 "name": "Togo", 1710 "phone": "228", 1711 "code2": "TG", 1712 "code3": "TGO" 1713}, {"name": "Tokelau", "phone": "690", "code2": "TK", "code3": "TKL"}, { 1714 "name": "Tonga", 1715 "phone": "676", 1716 "code2": "TO", 1717 "code3": "TON" 1718}, {"name": "Trinidad and Tobago", "phone": "1-868", "code2": "TT", "code3": "TTO"}, { 1719 "name": "Tunisia", 1720 "phone": "216", 1721 "code2": "TN", 1722 "code3": "TUN" 1723}, {"name": "Turkey", "phone": "90", "code2": "TR", "code3": "TUR"}, { 1724 "name": "Turkmenistan", 1725 "phone": "993", 1726 "code2": "TM", 1727 "code3": "TKM" 1728}, {"name": "Turks and Caicos Islands", "phone": "1-649", "code2": "TC", "code3": "TCA"}, { 1729 "name": "Tuvalu", 1730 "phone": "688", 1731 "code2": "TV", 1732 "code3": "TUV" 1733}, {"name": "U.S. Virgin Islands", "phone": "1-340", "code2": "VI", "code3": "VIR"}, { 1734 "name": "Uganda", 1735 "phone": "256", 1736 "code2": "UG", 1737 "code3": "UGA" 1738}, {"name": "Ukraine", "phone": "380", "code2": "UA", "code3": "UKR"}, { 1739 "name": "United Arab Emirates", 1740 "phone": "971", 1741 "code2": "AE", 1742 "code3": "ARE" 1743}, {"name": "United Kingdom", "phone": "44", "code2": "GB", "code3": "GBR"}, { 1744 "name": "United States", 1745 "phone": "1", 1746 "code2": "US", 1747 "code3": "USA" 1748}, {"name": "Uruguay", "phone": "598", "code2": "UY", "code3": "URY"}, { 1749 "name": "Uzbekistan", 1750 "phone": "998", 1751 "code2": "UZ", 1752 "code3": "UZB" 1753}, {"name": "Vanuatu", "phone": "678", "code2": "VU", "code3": "VUT"}, { 1754 "name": "Vatican", 1755 "phone": "379", 1756 "code2": "VA", 1757 "code3": "VAT" 1758}, {"name": "Venezuela", "phone": "58", "code2": "VE", "code3": "VEN"}, { 1759 "name": "Vietnam", 1760 "phone": "84", 1761 "code2": "VN", 1762 "code3": "VNM" 1763}, {"name": "Wallis and Futuna", "phone": "681", "code2": "WF", "code3": "WLF"}, { 1764 "name": "Western Sahara", 1765 "phone": "212", 1766 "code2": "EH", 1767 "code3": "ESH" 1768}, {"name": "Yemen", "phone": "967", "code2": "YE", "code3": "YEM"}, { 1769 "name": "Zambia", 1770 "phone": "260", 1771 "code2": "ZM", 1772 "code3": "ZMB" 1773}, {"name": "Zimbabwe", "phone": "263", "code2": "ZW", "code3": "ZWE"}] 1774 1775var gIndustrialFields = [ 1776 { 1777 name: "B2B Software and Services", 1778 children: [ 1779 {name: "Analytics"}, 1780 {name: "Artificial Intelligence"}, 1781 {name: "Engineering, Product and Design"}, 1782 {name: "Finance and Accounting"}, 1783 {name: "Human Resources"},
1784 {name: "Infrastructure"}, 1785 {name: "Legal"}, 1786 {name: "Marketing"}, 1787 {name: "Office Management"}, 1788 {name: "Operations"}, 1789 {name: "Productivity"}, 1790 {name: "Recruiting and Talent"}, 1791 {name: "Retail"}, 1792 {name: "Sales"}, 1793 {name: "Security"}, 1794 {name: "Supply Chain and Logistics"} 1795 ] 1796 }, 1797 1798 { 1799 name: "Consumer", 1800 children: [ 1801 {name: "Apparel and Cosmetics"}, 1802 {name: "Consumer Electronics"}, 1803 {name: "Content"}, 1804 {name: "Food and Beverage"}, 1805 {name: "Gaming"}, 1806 {name: "Home and Personal"}, 1807 {name: "Job and Career Services"}, 1808 {name: "Social"}, 1809 {name: "Electric Device"}, 1810 {name: "Transportation"}, 1811 {name: "Travel, Leisure and Tourism"}, 1812 {name: "Virtual and Augmented Reality"}, 1813 ] 1814 }, 1815 1816 { 1817 name: "Education", 1818 children: [] 1819 }, 1820 1821 { 1822 name: "Financial Technology", 1823 children: [ 1824 {name: "Asset Management"}, 1825 {name: "Banking and Exchange"}, 1826 {name: "Consumer Finance"}, 1827 {name: "Credit and Lending"}, 1828 {name: "Insurance"}, 1829 {name: "Payments"}, 1830 ] 1831 }, 1832 1833 { 1834 name: "Government", 1835 children: [] 1836 }, 1837 1838 { 1839 name: "Healthcare", 1840 children: [ 1841 {name: "Consumer Health and Wellness"}, 1842 {name: "Diagnostics"}, 1843 {name: "Drug Discovery and Delivery"}, 1844 {name: "Healthcare IT"}, 1845 {name: "Healthcare Services"}, 1846 {name: "Industrial Bio"}, 1847 {name: "Medical Devices"}, 1848 {name: "Therapeutics"}, 1849 ] 1850 }, 1851 1852 { 1853 name: "Industrials", 1854 children: [ 1855 {name: "Agriculture"}, 1856 {name: "Automotive and Mobility"}, 1857 {name: "Aviation and Space"}, 1858 {name: "Climate"}, 1859 {name: "Drones"}, 1860 {name: "Energy"}, 1861 {name: "Manufacturing tech and Robotics"}, 1862 ] 1863 }, 1864 1865 { 1866 name: "Real Estate and Construction", 1867 children: [ 1868 {name: "Construction"}, 1869 {name: "Housing and Real Estate"}, 1870 ] 1871 }, 1872 1873 { 1874 name: "Unspecified", 1875 children: [] 1876 }, 1877]; 1878 1879function _getSystemCode(codeId, upperId, callBack) { 1880 var params = { 1881 groupSeCodeId: codeId, 1882 upperIemSeCodeId: upperId 1883 } 1884 $.rest("syscode/api/get-syslist", params, callBack); 1885} 1886 1887function _setSggSelect(elementID, elementID2) { 1888 1889 _getSystemCode("DOSI_CODE", "", (list) => { 1890 1891 $selsido = $("#" + elementID); 1892 $("#" + elementID).append("<option value=''>ì/ë ì í</option>"); 1893 $.each(list, function (index, item) { 1894 $selsido.append("<option value='" + list[index].IEM_SE_CODE_ID + "'>" + list[index].IEM_NM + "</option>"); 1895 }); 1896 1897 }) 1898 if (firstCnt == 0 && "sigunguCode" == elementID2 + "") { 1899 _getSystemCode("SIGUNGU_CODE", "", (list) => { 1900 1901 //console.log(list); 1902 1903 var $gugun = $("#" + elementID2); // ì íìì 군구 ê°ì²´ 1904 $("option", $gugun).remove(); // 구군 ì´ê¸°í 1905 $("#" + elementID2).append("<option value=''>ì/êµ°/구 ì í</option>"); 1906 $.each(list, function (index, item) { 1907 $gugun.append("<option value='" + list[index].IEM_SE_CODE_ID + "'>" + list[index].IEM_NM + "</option>"); 1908 }); 1909 1910 1911 }); 1912 } 1913 // ì/ë ì íì 구/êµ° ì¤ì 1914 $("#" + elementID).change(function () { 1915 1916 var area = $(this).val(); // ì íì§ìì 구군 Array 1917 1918 1919 _getSystemCode("SIGUNGU_CODE", area, (list) => { 1920 1921 //console.log(list); 1922 1923 var $gugun = $("#" + elementID2); // ì íìì 군구 ê°ì²´ 1924 $("option", $gugun).remove(); // 구군 ì´ê¸°í 1925 $("#" + elementID2).append("<option value=''>ì/êµ°/구 ì í</option>"); 1926 $.each(list, function (index, item) { 1927 $gugun.append("<option value='" + list[index].IEM_SE_CODE_ID + "'>" + list[index].IEM_NM + "</option>"); 1928 }); 1929 }); 1930 }) 1931 firstCnt++; 1932} 1933 1934function getGlobalMessage(key) { 1935 if (!key) { 1936 return; 1937 } 1938 1939 let message = null; 1940 1941 $.ajax({ 1942 url: '/messages/get', 1943 data: {key: key}, 1944 type: 'POST', 1945 async: false, 1946 success: function (response) { 1947 message = response; 1948 }, 1949 error: function (xhr, status, error) { 1950 console.log(error); 1951 }, 1952 }); 1953 1954 return message; 1955} 1956 1957function getGlobalMessageByString(m1, m2) { 1958 if (_getCookie('lang') === 'ko') { 1959 return m2; 1960 } 1961 return m1; 1962} 1963 1964function _getCookie(name) { 1965 var value = "; " + document.cookie; 1966 var parts = value.split("; " + name + "="); 1967 1968 if (parts.length === 2) 1969 return parts.pop().split(";").shift(); 1970} 1971 1972/*========================================================================================*/
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.