PageSourceSearch

https://www.yanggu.go.kr/contract/js/comm/cmiosComm.js

js yanggu.go.kr collected 2026-10-02 16:39:57 UTC 6,309 bytes, 255 lines download raw bytes

1var CS_LOG_INFO = 1;
2var CS_LOG_DEBUG = 2;
3
4var CS_LOG_LEVEL = CS_LOG_DEBUG;
5
6var CMIOS_RETURN_CODE = "cmiosRtnCode";
7
8String.prototype.toCamelize = function(){
9    return this.toLowerCase().replace(/_+(.)?/g, function(match, chr){return chr ? chr.toUpperCase() : '';});
10};
11
12String.prototype.replaceAll = function(target, replacement){
13   return this.split(target).join(replacement);
14};
15
16String.prototype.digits = function(){
17   return this.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
18};
19
20String.prototype.trim = function() {
21    return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
22};
23
24function isEmpty(s) {
25    if (s == null || s == undefined || s == "" || (""+s).trim().length == 0) {
26        return true;
27    }
28
29    return false;
30}
31
32function jsonToString(obj) {
33    var t = typeof (obj);
34    if (t != "object" || obj === null) {
35        if (t == "string")
36            obj = '"' + obj + '"';
37        return String(obj);
38    } else {
39        var v, json = [], arr = (obj && obj.constructor == Array);
40        for ( var n in obj) {
41            v = obj[n];
42            t = typeof (v);
43            if (t == "string")
44                v = '"' + v + '"';
45            else if (t == "object" && v !== null)
46                v = jsonToString(v);
47            json.push((arr ? "" : '"' + n + '":') + String(v));
48        }
49        return (arr ? "[" : "{") + String(json) + (arr ? "]" : "}");
50    }
51}
52
53function addCommaStr(str){
54    if(isEmpty(str) == true){
55        str = "0";
56    }
57    
58    str = "" + str;
59    var strArr = str.split('.');
60    var str1 = strArr[0];
61    var str2 = strArr.length > 1 ? '.' + strArr[1] : '';
62    
63    return str1.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + str2;
64}
65
66function toDateFormat(str){
67    if(isEmpty(str) == true){
68        return "";
69    }
70    
71    str = str.replace(/[^a-zA-Z0-9]/g, '');
72    
73    if(str.length < 5){
74        return str;
75    }
76    
77    if(str.length < 7){
78        return str.substring(0, 4) + "-" + str.substring(4, 6);
79    }
80    
81    return str.substring(0, 4) + "-" + str.substring(4, 6) + "-" + str.substring(6, 8);
82};
83
84function beforeFill(str, fillStr, size){
85    str = "" + str;
86    if(isEmpty(str) == true){
87        str = "";
88    }
89    
90    var tempFill = "";
91    for(var i = 0; i < size - str.length; i++){
92        if(str.length == 11){
93            alert("i:" + i + "size:" + size);
94        }
95        tempFill += fillStr;
96    }
97
98    return tempFill + str;
99}
100
101function beforeZeroFill(str, size){
102    return beforeFill(str, "0", size);
103}
104
105function cmiosPrintPage(){
106    window.print();
107}
108
109function cmiosMovePage(url, data) {
110
111    var formId = 'cmiosMovePageForm';
112
113    var form = $('<form action="' + ctx + url + '" method="post" name="' + formId + '" id="' + formId + '"></form>');
114    $(form).appendTo('body');
115
116    if (data) {
117        for ( var i in data) {
118            $('<input type="hidden" name="' + i + '" value="' + encodeURIComponent(data[i]) + '" />').appendTo(form);
119        }
120    }
121
122    form.submit();
123}
124
125function cmiosMovePage2(url, data) {
126
127    var formId = 'cmiosMovePageForm';
128
129    var form = $('<form action="' + url + '" method="post" name="' + formId + '" id="' + formId + '"></form>');
130    $(form).appendTo('body');
131
132    if (data) {
133        for ( var i in data) {
134            $('<input type="hidden" name="' + i + '" value="' + encodeURIComponent(data[i]) + '" />').appendTo(form);
135        }
136    }
137
138    form.submit();
139}
140
141function getElementValueToString(eleValue) {
142    var strValue = "";
143
144    if (eleValue == "[object]") {
145        strValue = eleValue.value;
146    } else {
147        strValue = eleValue;
148    }
149    return strValue;
150}
151
152function isRequired(eleValue) {
153    var strValue = getElementValueToString(eleValue);
154
155    if (strValue.replace(/^(\s+)|(\s+)$/g, "").length == 0) {
156        return false;
157    } else {
158        return true;
159    }
160}
161
162function fnLimitLength(str, length) {
163    str = str + "";
164    if (getLengthByteUTF8(str) > length) {
165        return false;
166    }
167
168    return true;
169}
170
171function getLengthByteUTF8(input) {
172    var byteLength = 0;
173
174    for ( var inx = 0; inx < input.length; inx++) {
175        var oneChar = input.charAt(inx);
176        byteLength += charByteSize(oneChar);
177    }
178
179    return byteLength;
180}
181
182function charByteSize(ch) {
183    if (ch == null || ch.length == 0) {
184        return 0;
185    }
186    var charCode = ch.charCodeAt(0);
187    if (charCode <= 0x00007F) {
188        return 1;
189    } else if (charCode <= 0x0007FF) {
190        return 2;
191    } else if (charCode <= 0x00FFFF) {
192        return 3;
193    } else {
194        return 4;
195    }
196}
197
198function isValidURL(url) {
199    var RegExp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
200
201    if (RegExp.test(url)) {
202        return true;
203    } else {
204        return false;
205    }
206}
207
208/* 리뉴얼 */
209
210//JavaScript Document
211//Main   Page
212function getContextPath(){
213    var offset=location.href.indexOf(location.host)+location.host.length;
214    var ctxPath=location.href.substring(offset,location.href.indexOf('/',offset+1));
215    return ctxPath;
216}
217function subOff() {
218 // m1.style.display="none";m2.style.display="none";m3.style.display="none";m4.style.display="none";/*m5.style.display="none";m6.style.display="none";*/ 
219  $("#m1, #m2, #m3, #m4, #m5, #m6").css("display", "none");
220 }
221 function subOn() {
222 // m1.style.display="block";m2.style.display="block";m3.style.display="block";m4.style.display="block";/*m5.style.display="block";m6.style.display="block";*/
223  $("#m1, #m2, #m3, #m4, #m5, #m6").css("display", "block");
224 }
225function bgRestore(menu) {
226//menu.style.background="url(image/topmenu_bg.png)";
227menu.style.background="#ffffff";
228}
229function bgSwap(menu,bgName) {
230menu.style.background="url(bgName)";
231}
232function listOff(list) {
233 list.style.display="none"; 
234}
235function listOn(list) {
236 list.style.display="block";
237}
238function slideSwitch() {
239    var $active = $('#slideshow IMG.active');
240
241    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
242
243    var $next =  $active.next().length ? $active.next()
244        : $('#slideshow IMG:first');
245    $active.addClass('last-active');
246
247    $next.css({opacity: 0.0})
248        .addClass('active')
249        .animate({opacity: 1.0}, 1000, function() {
250            $active.removeClass('active last-active');
251        });
252}
253$(function() {
254    setInterval( "slideSwitch()", 2000 );
255});

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.