1'use strict'; 2 3let preVal; 4 5/************************************************************** 6 * í¬í¸ ì 무 javascript 7 * 8 * @author 9 * @since 2021. 11. 15 10 * @version 1.0 11 * 12 * == ê°ì ì´ë ¥ (Modification Information) == 13 * 14 * ìì ì¼ ìì ì ìì ë´ì© 15 * ------------ ------------------- ------------------------------ 16 * 2021. 11. 15 ìµì´ ìì± 17 *************************************************************/ 18const portal = (function($) { 19 if(!opener){ 20 window.name=""; 21 } 22 /** 23 * ================================================== 24 * pushState + Ajax 25 * ================================================== 26 */ 27 if ($.support.pjax) { 28 $(document).on('pjax:complete', function(xhr, status, options) { 29 if (status.status === 200 && status.statusText === 'success') { 30 //íì ì init í¨ì 31 } 32 }); 33 } else { 34 toastr.error('ì¹ë¸ë¼ì°ì ê° pjax 를 ì§ìíì§ ììµëë¤.'); 35 } 36 37 return{ 38 setSideMenu : function(topMenu, nowMenu) { 39 frms.ajax({ 40 url: '/menu/sidemenu', 41 data: { 42 topMenu: topMenu, 43 nowMenu: nowMenu 44 }, 45 success: function(result, status, xhr) { 46 $('aside.main-sidebar').html(result); 47 } 48 }); 49 }, 50 setLocation : function(topMenu, nowMenu) { 51 frms.ajax({ 52 url: '/menu/location', 53 data: { 54 topMenu: topMenu, 55 nowMenu: nowMenu 56 }, 57 success: function(result, status, xhr) { 58 $('div.location-wrap').html(result); 59 } 60 }); 61 }, 62 getExistContainer : function(){ 63 if($('#pjax-container').length == 0){ 64 location.href='#main-container'; 65 }else{ 66 location.href='#pjax-container'; 67 } 68 }, 69 nvl : function(text, returnText) { 70 let result = returnText == null ? '' : returnText; 71 if(text){ 72 result = text; 73 } 74 return result; 75 }, 76 isNull : function(str){ 77 if(str == null || str.length < 1){ 78 return true; 79 } 80 return false; 81 }, 82 juminValidate : function(jumin){ 83 let ssn, 84 arr_ssn = [], 85 compare = [2,3,4,5,6,7,8,9,2,3,4,5], 86 sum = 0; 87 88 ssn = jumin.toString(); 89 90 // ì ë ¥ê° ì²´í¬ 91 if(isNaN(jumin)){ 92 alert("주민ë±ë¡ë²í¸ë ì«ìë§ ì ë ¥íì ì¼ í©ëë¤"); 93 return false; 94 } 95 // ì릿ì ì²´í¬ 96 if(ssn.length != 13){ 97 alert("ì¬ë°ë¥¸ 주민ë±ë¡ ë²í¸ë¥¼ ì ë ¥íì¬ ì£¼ì¸ì.") 98 return false; 99 } 100 101 // ê³µì: M = (11 - ((2*A + 3*B + 4*C + 5*D + 6*E + 7*E + 8*G + 9*H + 2*I + 3*J + 4*K + 5*L) * 11)) % 10) 102 for(var i = 0; i < 13; i++){ 103 arr_ssn[i] = ssn.substring(i, i+1); 104 } 105 106 for(var i = 0; i < 12; i++){ 107 sum = sum + (parseInt(arr_ssn[i], 10) * compare[i]); 108 } 109 110 sum = (11 - (sum % 11)) % 10; 111 112 if(sum != arr_ssn[12]){ 113 alert("ì¬ë°ë¥¸ 주민ë±ë¡ ë²í¸ë¥¼ ì ë ¥íì¬ ì£¼ì¸ì."); 114 return false; 115 } 116 117 return true; 118 }, 119 /** 120 * DOMì ê¸ì¡ííë¡ ì½¤ë§ ì¶ê° ë° ììì ì리ì 리미í¸. (Key ì´ë²¤í¸ ì©) 121 * EX) fcmsportal.setCommaWithDecimal( $("#id"), 4 ); 122 * @param $obj DOM 123 * @param point ì²´í¬í ììì ì리ì 124 * 2020.03.31 ì¡°í´ê´ 125 */ 126 setCommaWithDecimal: function($obj, point) { 127 128 if (-1 != $obj.val().indexOf(".")) { 129 let splitPoint = $obj.val().toString().split("."); 130 if (point < splitPoint[1].length || 2 < splitPoint.length) { 131 $obj.val(preVal); 132 return; 133 } else { 134 preVal = $obj.val(); 135 } 136 $obj.val(portal.unComma(splitPoint[0]).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "." + splitPoint[1].replace(/[^\d]+/g, "")); 137 return; 138 } else { 139 $obj.val(portal.unComma($obj.val()).replace(/\B(?=(\d{3})+(?!\d))/g, ",")); 140 } 141 }, 142 /** 143 * ì«ìì ì½¤ë§ ì ê±° 144 */ 145 unComma: function(value) { 146 if (value != null) return value.toString().replace(/[^\.0-9]/g, ''); 147 }, 148 /** 149 * ì«ìì ì½¤ë§ ì¶ê° 150 */ 151 comma: function(value) { 152 if (value != null) return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); 153 }, 154 commaWithDecimal: function(value) { 155 156 if (-1 != String(value).indexOf(".")) { 157 let splitPoint = String(value).toString().split("."); 158 return portal.unComma(splitPoint[0]).replace(/\B(?=(\d{3})+(?!\d))/g, ",") + "." + splitPoint[1].replace(/[^\d]+/g, ""); 159 } else { 160 return portal.unComma(value).replace(/\B(?=(\d{3})+(?!\d))/g, ","); 161 } 162 }, 163 /** 164 * byte ì©ëì íì°íì¬ ë°í 165 * ì©ëì í¬ê¸°ì ë°ë¼ MB, KB, byte ë¨ìë¡ íì°í¨ 166 * @param fileSize byte ê° 167 * @param fixed íì°ë ì©ëì ììì ì릿ì 168 * @returns {String} 169 */ 170 byte: function(fileSize, fixed) { 171 var str 172 if (fileSize >= 1024 * 1024) { //MB ë¨ì ì´ìì¼ë MB ë¨ìë¡ íì° 173 fileSize = fileSize / (1024 * 1024); 174 fileSize = (fixed === undefined) ? fileSize : fileSize.toFixed(fixed); 175 str = portal.comma(fileSize) + ' MB'; 176 } 177 else if (fileSize >= 1024) { //KB ë¨ì ì´ìì¼ë KB ë¨ìë¡ íì° 178 fileSize = fileSize / 1024; 179 fileSize = (fixed === undefined) ? fileSize : fileSize.toFixed(fixed); 180 str = portal.comma(fileSize) + ' KB'; 181 } 182 else { //KB ë¨ìë³´ë¤ ììë byte ë¨ìë¡ íì° 183 fileSize = (fixed === undefined) ? fileSize : fileSize.toFixed(fixed); 184 str = portal.comma(fileSize) + ' byte'; 185 } 186 return str; 187 }, 188 checkFilter: function(str, level){ 189 if (level == undefined || level == 0) { 190 str = str.replace(/\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\.|\-/g,""); 191 } else if (level != undefined && level == 1) { 192 str = str.replace(/\</g, "<"); 193 str = str.replace(/\>/g, ">"); 194 } 195 return str; 196 } 197 } 198}(jQuery));
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.