mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-11 23:01:41 +09:00
6 lines
No EOL
31 KiB
JavaScript
6 lines
No EOL
31 KiB
JavaScript
/*! Copyright (C) NAVER <http://www.navercorp.com> */
|
|
/**!
|
|
* @file common.js + js_app.js + xml_handler.js + xml_js_filter.js
|
|
* @brief XE Common JavaScript
|
|
**/
|
|
function xSleep(a){a/=1e3;for(var b=new Date,c=new Date;c.getTime()-b.getTime()<a;)c=new Date}function isDef(){for(var a=0;a<arguments.length;++a)if("undefined"==typeof arguments[a])return!1;return!0}function winopen(a,b,c){"undefined"!=typeof xeVid&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));try{"_blank"!=b&&winopen_list[b]&&(winopen_list[b].close(),winopen_list[b]=null)}catch(d){}"undefined"==typeof b&&(b="_blank"),"undefined"==typeof c&&(c="");var e=window.open(a,b,c);e.focus(),"_blank"!=b&&(winopen_list[b]=e)}function popopen(a,b){"undefined"==typeof b&&(b="_blank"),"undefined"!=typeof xeVid&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid)),winopen(a,b,"width=800,height=600,scrollbars=yes,resizable=yes,toolbars=no")}function sendMailTo(a){location.href="mailto:"+a}function move_url(a,b){return a?("undefined"==typeof b&&(b="N"),b="N"==b?!1:!0,/^\./.test(a)&&(a=request_uri+a),b?winopen(a):location.href=a,!1):!1}function displayMultimedia(a,b,c,d){var e=_displayMultimedia(a,b,c,d);e&&document.writeln(e)}function _displayMultimedia(a,b,c,d){0===a.indexOf("files")&&(a=request_uri+a);var e={wmode:"transparent",allowScriptAccess:"sameDomain",quality:"high",flashvars:"",autostart:!1},f=jQuery.extend(e,d||{}),g=f.autostart&&"false"!=f.autostart?"true":"false";delete f.autostart;var h="",i="",j="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(a))j='<img src="'+a+'" width="'+b+'" height="'+c+'" />';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))j='<embed src="'+request_uri+'common/img/flvplayer.swf" allowfullscreen="true" autostart="'+g+'" width="'+b+'" height="'+c+'" flashvars="&file='+a+"&width="+b+"&height="+c+"&autostart="+g+'" wmode="'+f.wmode+'" />';else if(/\.swf/i.test(a)){h="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",i="undefined"!=typeof enforce_ssl&&enforce_ssl?"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0":"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0",j='<object classid="'+h+'" codebase="'+i+'" width="'+b+'" height="'+c+'" flashvars="'+f.flashvars+'">',j+='<param name="movie" value="'+a+'" />';for(var k in f)"undefined"!=f[k]&&""!==f[k]&&(j+='<param name="'+k+'" value="'+f[k]+'" />');j+='<embed src="'+a+'" autostart="'+g+'" width="'+b+'" height="'+c+'" flashvars="'+f.flashvars+'" wmode="'+f.wmode+'"></embed></object>'}else(jQuery.browser.mozilla||jQuery.browser.opera)&&(g=f.autostart&&"false"!=f.autostart?"1":"0"),j='<embed src="'+a+'" autostart="'+g+'" width="'+b+'" height="'+c+'"',"transparent"==f.wmode&&(j+=' windowlessvideo="1"'),j+="></embed>";return j}function zbxe_folder_open(a){jQuery("#folder_open_"+a).hide(),jQuery("#folder_close_"+a).show(),jQuery("#folder_"+a).show()}function zbxe_folder_close(a){jQuery("#folder_open_"+a).show(),jQuery("#folder_close_"+a).hide(),jQuery("#folder_"+a).hide()}function setFixedPopupSize(){var a,b,c,d,e,f=jQuery,g=f(window),h=f("body>.popup");e=h.css({overflow:"scroll"}).offset(),a=h.width(10).height(1e4).get(0).scrollWidth+2*e.left,b=h.height(10).width(1e4).get(0).scrollHeight+2*e.top,800>a&&(a=800+2*e.left),c=g.width(),d=g.height(),a!=c&&window.resizeBy(a-c,0),b!=d&&window.resizeBy(0,b-d),h.width(a-2*e.left).css({overflow:"",height:""})}function doCallModuleAction(a,b,c){var d={target_srl:c,cur_mid:current_mid,mid:current_mid};exec_xml(a,b,d,completeCallModuleAction)}function completeCallModuleAction(a){"success"!=a.message&&alert(a.message),location.reload()}function completeMessage(a){alert(a.message),location.reload()}function doChangeLangType(a){if("string"==typeof a)setLangType(a);else{var b=a.options[a.selectedIndex].value;setLangType(b)}location.href=location.href.setQuery("l","")}function setLangType(a){var b=new Date;b.setTime(b.getTime()+6048e8),setCookie("lang_type",a,b,"/")}function doDocumentPreview(a){for(var b=a;"FORM"!=b.nodeName;)b=b.parentNode;if("FORM"==b.nodeName){var c=b.getAttribute("editor_sequence"),d=editorGetContent(c),e=(window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes"),jQuery("#previewDocument"));e.length?e=e[0]:(jQuery('<form id="previewDocument" target="previewDocument" method="post" action="'+request_uri+'"><input type="hidden" name="module" value="document" /><input type="hidden" name="act" value="dispDocumentPreview" /><input type="hidden" name="content" /></form>').appendTo(document.body),e=jQuery("#previewDocument")[0]),e&&(e.content.value=d,e.submit())}}function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),c=editorRelKeys[b].content.value;if("undefined"!=typeof b&&b&&"undefined"!=typeof editorRelKeys&&"function"==typeof editorGetContent){var d=editorGetContent(b);editorRelKeys[b].content.value=d}var e={},f=["error","message","document_srl"],g=(a.form.elements,jQuery(a.form).serializeArray());return jQuery.each(g,function(a,b){var c=jQuery.trim(b.value);return c?(/\[\]$/.test(b.name)&&(b.name=b.name.replace(/\[\]$/,"")),e[b.name]?e[b.name]+="|@|"+c:e[b.name]=b.value,void 0):!0}),exec_xml("document","procDocumentTempSave",e,completeDocumentSave,f,e,a.form),editorRelKeys[b].content.value=c,!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl),alert(a.message)}function doDocumentLoad(a){objForSavedDoc=a.form,popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))}function doDocumentSelect(a){return opener&&opener.objForSavedDoc?(opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispBoardWrite"),window.close(),void 0):(window.close(),void 0)}function viewSkinInfo(a,b){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+a+"&skin="+b,"SkinInfo")}function doAddDocumentCart(a){var b=a.value;addedDocument[addedDocument.length]=b,setTimeout(function(){callAddDocumentCart(addedDocument.length)},100)}function callAddDocumentCart(a){if(!(addedDocument.length<1||a!=addedDocument.length)){var b=[];b.srls=addedDocument.join(","),exec_xml("document","procDocumentAddCart",b,null),addedDocument=[]}}function transRGB2Hex(a){if(!a)return a;if(a.indexOf("#")>-1)return a.replace(/^#/,"");if(a.toLowerCase().indexOf("rgb")<0)return a;a=a.replace(/^rgb\(/i,"").replace(/\)$/,""),value_list=a.split(",");for(var b="",c=0;c<value_list.length;c++){var d=parseInt(value_list[c],10).toString(16);1==d.length&&(d="0"+d),b+=d}return b}function toggleSecuritySignIn(){var a=location.href;location.href=/https:\/\//i.test(a)?a.replace(/^https/i,"http"):a.replace(/^http/i,"https")}function reloadDocument(){location.reload()}function toggleDisplay(a){jQuery("#"+a).toggle()}function svc_folder_open(a){jQuery("#_folder_open_"+a).hide(),jQuery("#_folder_close_"+a).show(),jQuery("#_folder_"+a).show()}function svc_folder_close(a){jQuery("#_folder_open_"+a).show(),jQuery("#_folder_close_"+a).hide(),jQuery("#_folder_"+a).hide()}function open_calendar(a,b,c){"undefined"==typeof b&&(b="");var d="./common/tpl/calendar.php?";a&&(d+="fo_id="+a),b&&(d+="&day_str="+b),c&&(d+="&callback_func="+c),popopen(d,"Calendar")}function createPopupMenu(){}function chkPopupMenu(){}function displayPopupMenu(a,b,c){XE.displayPopupMenu(a,b,c)}function GetObjLeft(a){return jQuery(a).offset().left}function GetObjTop(a){return jQuery(a).offset().top}function replaceOuterHTML(a,b){jQuery(a).replaceWith(b)}function getOuterHTML(a){return jQuery(a).html().trim()}function setCookie(a,b,c,d){var e=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+"; path="+(d?d:"/");document.cookie=e}function getCookie(a){var b=document.cookie.match(new RegExp(a+"=(.*?)(?:;|$)"));return b?unescape(b[1]):void 0}function is_def(a){return"undefined"!=typeof a}function ucfirst(a){return a.charAt(0).toUpperCase()+a.slice(1)}function get_by_id(a){return document.getElementById(a)}function xml2json(a,b,c){var d={toObj:function(a){var b={};if(1==a.nodeType){if(c&&a.attributes.length)for(var e=0;e<a.attributes.length;e++)b["@"+a.attributes[e].nodeName]=(a.attributes[e].nodeValue||"").toString();if(a.firstChild){for(var f=0,g=0,h=!1,i=a.firstChild;i;i=i.nextSibling)1==i.nodeType?h=!0:3==i.nodeType&&i.nodeValue.match(/[^ \f\n\r\t\v]/)?f++:4==i.nodeType&&g++;if(h)if(2>f&&2>g){d.removeWhite(a);for(var j=a.firstChild;j;j=j.nextSibling)3==j.nodeType?b=d.escape(j.nodeValue):4==j.nodeType?b=d.escape(j.nodeValue):b[j.nodeName]?b[j.nodeName]instanceof Array?b[j.nodeName][b[j.nodeName].length]=d.toObj(j):b[j.nodeName]=[b[j.nodeName],d.toObj(j)]:b[j.nodeName]=d.toObj(j)}else a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(f)a.attributes.length?b["#text"]=d.escape(d.innerXml(a)):b=d.escape(d.innerXml(a));else if(g)if(g>1)b=d.escape(d.innerXml(a));else for(var k=a.firstChild;k;k=k.nextSibling)b=d.escape(k.nodeValue)}a.attributes.length||a.firstChild||(b=null)}else 9==a.nodeType?b=d.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,c){var e=b?'"'+b+'"':"";if(a instanceof Array){for(var f=0,g=a.length;g>f;f++)a[f]=d.toJson(a[f],"",c+" ");e+=(b?":[":"[")+(a.length>1?"\n"+c+" "+a.join(",\n"+c+" ")+"\n"+c:a.join(""))+"]"}else if(null===a)e+=(b&&":")+"null";else if("object"==typeof a){var h=[];for(var i in a)h[h.length]=d.toJson(a[i],i,c+" ");e+=(b?":{":"{")+(h.length>1?"\n"+c+" "+h.join(",\n"+c+" ")+"\n"+c:h.join(""))+"}"}else e+="string"==typeof a?(b&&":")+'"'+a.toString()+'"':(b&&":")+a.toString();return e},innerXml:function(a){var b="";if("innerHTML"in a)b=a.innerHTML;else for(var c=function(a){var b="";if(1==a.nodeType){b+="<"+a.nodeName;for(var d=0;d<a.attributes.length;d++)b+=" "+a.attributes[d].nodeName+'="'+(a.attributes[d].nodeValue||"").toString()+'"';if(a.firstChild){b+=">";for(var e=a.firstChild;e;e=e.nextSibling)b+=c(e);b+="</"+a.nodeName+">"}else b+="/>"}else 3==a.nodeType?b+=a.nodeValue:4==a.nodeType&&(b+="<![CDATA["+a.nodeValue+"]]>");return b},d=a.firstChild;d;d=d.nextSibling)b+=c(d);return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var b=a.firstChild;b;)if(3==b.nodeType)if(b.nodeValue.match(/[^ \f\n\r\t\v]/))b=b.nextSibling;else{var c=b.nextSibling;a.removeChild(b),b=c}else 1==b.nodeType?(d.removeWhite(b),b=b.nextSibling):b=b.nextSibling;return a}};9==a.nodeType&&(a=a.documentElement);var e,f=d.toObj(d.removeWhite(a));return e=d.toJson(f,a.nodeName,""),"{"+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"}"}function filterAlertMessage(a){var b=(a.error,a.message),c=a.act,d=a.redirect_url,e=location.href;"undefined"!=typeof b&&b&&"success"!=b&&alert(b),"undefined"!=typeof c&&c?e=current_url.setQuery("act",c):"undefined"!=typeof d&&d&&(e=d),e==location.href&&(e=e.replace(/#(.*)$/,"")),location.href=e}function procFilter(a,b){return b(a),!1}function legacy_filter(a,b,c,d,e,f,g,h){var i=xe.getApp("Validator")[0],j=jQuery,k=[];return i?(b.elements._filter||j(b).prepend('<input type="hidden" name="_filter" />'),b.elements._filter.value=a,k[0]=a,k[1]=function(a){var i={},k=(a.elements,j(a).serializeArray());return j.each(k,function(a,b){var c=j.trim(b.value),d=b.name;return c&&d?(h[d]&&(d=h[d]),/\[\]$/.test(d)&&(d=d.replace(/\[\]$/,"")),i[d]?i[d]+="|@|"+c:i[d]=b.value,void 0):!0}),g&&!confirm(g)?!1:(exec_xml(c,d,i,e,f,i,b),void 0)},i.cast("ADD_CALLBACK",k),i.cast("VALIDATE",[b,a]),!1):!1}jQuery&&jQuery.noConflict(),function(a){var b=navigator.userAgent.toLowerCase();a.os={Linux:/linux/.test(b),Unix:/x11/.test(b),Mac:/mac/.test(b),Windows:/win/.test(b)},a.os.name=a.os.Windows?"Windows":a.os.Linux?"Linux":a.os.Unix?"Unix":a.os.Mac?"Mac":"",window.XE={loaded_popup_menus:[],addedDocument:[],checkboxToggleAll:function(b){is_def(b)||(b="cart");var c,d={wrap:null,checked:"toggle",doClick:!1};switch(arguments.length){case 1:"string"==typeof arguments[0]?b=arguments[0]:(a.extend(d,arguments[0]||{}),b="cart");break;case 2:b=arguments[0],a.extend(d,arguments[1]||{})}d.doClick===!0&&(d.checked=null),"string"==typeof d.wrap&&(d.wrap="#"+d.wrap),c=d.wrap?a(d.wrap).find("input[name="+b+"]:checkbox"):a("input[name="+b+"]:checkbox"),"toggle"==d.checked?c.each(function(){a(this).attr("checked",a(this).attr("checked")?!1:!0)}):d.doClick===!0?c.click():c.attr("checked",d.checked)},displayPopupMenu:function(b,c,d){var e=(d.target_srl,d.menu_id),f=b.menus,g="";if(this.loaded_popup_menus[e])g=this.loaded_popup_menus[e];else{if(f){var h=f.item;if(("undefined"==typeof h.length||h.length<1)&&(h=new Array(h)),h.length)for(var i=0;i<h.length;i++){var j=h[i].url,k=h[i].str,l=(h[i].icon,h[i].target),m="",n="";switch(l){case"popup":n="onclick=\"popopen(this.href, '"+l+"'); return false;\"";break;case"javascript":n='onclick="'+j+'; return false; "',j="#";break;default:n='target="_blank"'}g+="<li "+m+'><a href="'+j+'" '+n+">"+k+"</a></li> "}}this.loaded_popup_menus[e]=g}if(g){var o=a("#popup_menu_area").html("<ul>"+g+"</ul>"),p={top:d.page_y,left:d.page_x};o.outerHeight()+p.top>a(window).height()+a(window).scrollTop()&&(p.top=a(window).height()-o.outerHeight()+a(window).scrollTop()),o.outerWidth()+p.left>a(window).width()+a(window).scrollLeft()&&(p.left=a(window).width()-o.outerWidth()+a(window).scrollLeft()),o.css({top:p.top,left:p.left}).show().focus()}}}}(jQuery),jQuery(function(a){a('a[href^="#"]').click(function(){a(a(this).attr("href")).attr("tabindex","0").focus()}),a.browser.msie&&a("select").each(function(a,b){for(var c=!1,d=[],e=0;e<b.options.length;e++)b.options[e].disabled?(b.options[e].style.color="#CCCCCC",c=!0):d[a]=d[a]>-1?d[a]:e;c&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},b.selectedIndex>=0&&b.options[b.selectedIndex].disabled&&b.onchange())});var b=a(".xe_content .fold_button");if(b.size()){var c=a("div.fold_container",b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(c).show()}),a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(c).hide()})}jQuery('input[type="submit"],button[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){return function(){b.attr("disabled","disabled")}}(),0),setTimeout(function(){return function(){b.removeAttr("disabled")}}(),3e3)})}),function(){function a(a,b){return a.replace(/#.*$/,"")===b.replace(/#.*$/,"")}var b=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(b){var c=a(this,window.location.href)?current_url:this,d=c.indexOf("?");if(-1==d)return null;var e=c.substr(d+1,this.length),f={};e.replace(/([^=]+)=([^&]*)(&|$)/g,function(){f[arguments[1]]=arguments[2]});var g=f[b];return"undefined"==typeof g&&(g=""),g},String.prototype.setQuery=function(c,d){var e,f,g,h,i=a(this,window.location.href)?current_url:this,j=i.indexOf("?"),k=i.replace(/#$/,"");if("undefined"==typeof d&&(d=""),-1!=j){var l=k.substr(j+1,i.length),m={},n=[];k=i.substr(0,j),l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c}),m[c]=d;for(var o in m)m.hasOwnProperty(o)&&(g=String(m[o]).trim())&&n.push(o+"="+decodeURI(g));l=n.join("&"),k+=l?"?"+l:""}else String(d).trim()&&(k=k+"?"+c+"="+d);f=/^https:\/\/([^:\/]+)(:\d+|)/i,f.test(k)&&(h="http://"+RegExp.$1,window.http_port&&80!=http_port&&(h+=":"+http_port),k=k.replace(f,h));var p=!!window.enforce_ssl;if(!p&&b(window.ssl_actions)&&(e=k.getQuery("act")))for(var q=0,r=ssl_actions.length;r>q;q++)if(ssl_actions[q]===e){p=!0;break}return f=/http:\/\/([^:\/]+)(:\d+|)/i,p&&f.test(k)&&(h="https://"+RegExp.$1,window.https_port&&443!=https_port&&(h+=":"+https_port),k=k.replace(f,h)),k=k.replace(/\/(index\.php)?\?/,"/index.php?"),encodeURI(k)},String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}}();var winopen_list=[],objForSavedDoc=null,addedDocument=[],Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=Base64._utf8_encode(a);j<a.length;)b=a.charCodeAt(j++),c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=b>>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",j=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j<a.length;)e=this._keyStr.indexOf(a.charAt(j++)),f=this._keyStr.indexOf(a.charAt(j++)),g=this._keyStr.indexOf(a.charAt(j++)),h=this._keyStr.indexOf(a.charAt(j++)),b=e<<2|f>>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!=g&&(i+=String.fromCharCode(c)),64!=h&&(i+=String.fromCharCode(d));return i=Base64._utf8_decode(i)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=0,e=0,f=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):d>191&&224>d?(e=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&e),c+=2):(e=a.charCodeAt(c+1),f=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&e)<<6|63&f),c+=3);return b}};"undefined"==typeof resizeImageContents&&(window.resizeImageContents=function(){}),"undefined"==typeof activateOptionDisabled&&(window.activateOptionDisabled=function(){}),objectExtend=jQuery.extend;var loaded_popup_menus=XE.loaded_popup_menus;jQuery(function(a){a(document).click(function(b){var c=a("#popup_menu_area");c.length||(c=a('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body)),c.hide();var d=a(b.target).filter("a,div,span");if(d.length||(d=a(b.target).closest("a,div,span")),d.length){var e,f=d.attr("class");if(f&&(e=f.match(new RegExp("(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)",""))),e){var g="get"+ucfirst(e[2])+"Menu",h={mid:current_mid,cur_mid:current_mid,menu_id:e[1],target_srl:e[3],cur_act:current_url.getQuery("act"),page_x:b.pageX,page_y:b.pageY},i="error message menus".split(" ");if(b.preventDefault(),b.stopPropagation(),is_def(window.xeVid)&&(h.vid=xeVid),is_def(XE.loaded_popup_menus[h.menu_id]))return XE.displayPopupMenu(h,i,h);show_waiting_message=!1,exec_xml("member",g,h,XE.displayPopupMenu,i,h),show_waiting_message=!0}}}),a("a._xe_popup").click(function(){var b,c=a(this),d=c.attr("name"),e=c.attr("href");return d||(d="_xe_popup_"+Math.floor(1e3*Math.random())),b=window.open(e,d,"left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no"),b&&b.focus(),!1}),a.datepicker&&a.datepicker.setDefaults({dateFormat:"yy-mm-dd"})}),function(a){function b(){var b=function(){var b=this;a.isArray(this._plugins)&&(this._plugins=[]),this._messages?this._messages={}:this._binded_fn={},a.each(this,function(c,d){if(!a.isFunction(d))return!0;if(!/^API_([A-Z0-9_]+)$/.test(c))return!0;var e=RegExp.$1,f=function(a,d){return b[c](a,d)};b._messages?b._messages[e]=[f]:b._binded_fn[e]=f}),a.isFunction(this.init)&&this.init.apply(this,arguments)};return b}var c,d,e,f=[];c={getName:function(){return"Core"},createApp:function(c,e){var f=b();return a.extend(f.prototype,d,e),f.prototype.getName=function(){return c},f},createPlugin:function(c,d){var f=b();return a.extend(f.prototype,e,d),f.prototype.getName=function(){return c},f},getApps:function(){return a.makeArray(f)},getApp:function(a){return a=(a||"").toLowerCase(),"undefined"!=typeof f[a]?f[a]:null},registerApp:function(b){var c=b.getName().toLowerCase();f.push(b),a.isArray(f[c])||(f[c]=[]),f[c].push(b),b.parent=this,a.isFunction(b.activate)&&b.activate()},unregisterApp:function(b){var c=b.getName().toLowerCase(),d=a.inArray(b,f);d>=0&&(f=f.splice(d,1)),a.isArray(f[c])&&(d=a.inArray(b,f[c]),d>=0&&(f[c]=f[c].splice(d,1))),a.isFunction(b.deactivate)&&b.deactivate()},broadcast:function(a,b){this._broadcast(this,a,b)},_broadcast:function(a,b,c){for(var d=0;d<f.length;d++)f[d]._cast(a,b,c);this._cast(a,b,c)}},d={_plugins:[],_messages:{},getPlugin:function(b){return b=b.toLowerCase(),a.isArray(this._plugins[b])?this._plugins[b]:[]},registerPlugin:function(b){var c=this,d=b.getName().toLowerCase();return a.inArray(b,this._plugins)>=0?!1:(this._plugins.push(b),a.isArray(this._plugins[d])||(this._plugins[d]=[]),this._plugins[d].push(b),a.each(b._binded_fn,function(a,b){c.registerHandler(a,b)}),b.oApp=this,a.isFunction(b.activate)&&b.activate(),!0)},registerHandler:function(b,c){var d=this._messages;b=b.toUpperCase(),a.isArray(d[b])||(d[b]=[]),d[b].push(c)},cast:function(a,b){return this._cast(this,a,b||[])},broadcast:function(a,b,c){this.parent&&this.parent._broadcast&&this.parent._broadcast(a,b,c)},_cast:function(b,c,d){var e,f=this._messages;if(c=c.toUpperCase(),f["BEFORE_"+c]||this["API_BEFORE_"+c]){var g=this._cast(b,"BEFORE_"+c,d);if(!g)return}var h=[];if(a.isArray(f[c]))for(e=0;e<f[c].length;e++)h.push(f[c][e](b,d));return h.length<2&&(h=h[0]),(f["AFTER_"+c]||this["API_AFTER_"+c])&&this._cast(b,"AFTER_"+c,d),/^(?:AFTER|BEFORE)_/.test(c)?a.isArray(h)?a.inArray(!1,h)<0:"undefined"==typeof h?!0:!!h:h}},e={oApp:null,cast:function(a,b){return this.oApp&&this.oApp._cast?this.oApp._cast(this,a,b||[]):void 0},broadcast:function(a,b){this.oApp&&this.oApp.broadcast&&this.oApp.broadcast(this,mag,b||[])}},window.xe=a.extend(d,c),window.xe.lang={},a(function(){xe.broadcast("ONREADY")}),a(window).load(function(){xe.broadcast("ONLOAD")})}(jQuery);var show_waiting_message=!0;!function(a){function b(b,c){var d="xeTmpIframe",e="xeVirtualForm";a("#"+d).length||a('<iframe name="%id%" id="%id%" style="position:absolute;left:-1px;top:1px;width:1px;height:1px"></iframe>'.replace(/%id%/g,d)).appendTo(document.body),a("#"+e).remove();var f=a('<form id="%id%"></form>'.replace(/%id%/g,e)).attr({id:e,method:"post",action:b,target:d});c.xeVirtualRequestMethod="xml",c.xeRequestURI=location.href.replace(/#(.*)$/i,""),c.xeVirtualRequestUrl=request_uri,a.each(c,function(b,c){a('<input type="hidden">').attr("name",b).attr("value",c).appendTo(f)}),f.appendTo(document.body).submit()}function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(){return""}a.exec_xml=window.exec_xml=function(d,e,f,g,h,i,j){function k(b){var c,f=a(b).find("response")[0],k="",l=[],m={},n="";if(w.css("display","none").trigger("cancel_confirm"),!f)return alert(u.responseText),null;if(n=xml2json(f,!1,!1),c=jQuery.parseJSON(n),c=c.response,"undefined"==typeof c){l.error=-1,l.message="Unexpected error occured.";try{"undefined"!=typeof(k=f.childNodes[0].firstChild.data)&&(l.message+="\r\n"+k)}catch(o){}return l}return a.each(h,function(a,b){m[b]=!0}),m.redirect_url=!0,m.act=!0,a.each(c,function(a,b){m[a]&&(l[a]=b)}),"0"!=l.error?a.isFunction(a.exec_xml.onerror)?a.exec_xml.onerror(d,e,l,g,h,i,j):(alert((l.message||"An unknown error occured while loading ["+d+"."+e+"]").replace(/\\n/g,"\n")),null):l.redirect_url?(location.href=l.redirect_url.replace(/&/g,"&"),null):(a.isFunction(g)&&g(l,h,i,j),void 0)}var l=request_uri+"index.php";if(f||(f={}),a.isArray(f)&&(f=c(f)),f.module=d,f.act=e,"undefined"!=typeof xeVid&&(f.vid=xeVid),"undefined"==typeof h||h.length<1?h=["error","message"]:h.push("error","message"),a.isArray(ssl_actions)&&f.act&&a.inArray(f.act,ssl_actions)>=0){var m=default_url||request_uri,n=window.https_port||443,o=a("<a>").attr("href",m)[0],p="https://"+o.hostname.replace(/:\d+$/,"");443!=n&&(p+=":"+n),"/"!=o.pathname[0]&&(p+="/"),p+=o.pathname,l=p.replace(/\/$/,"")+"/index.php"}var q=a("<a>").attr("href",location.href)[0],r=a("<a>").attr("href",l)[0];if(q.protocol!=r.protocol||q.port!=r.port)return b(l,f);var s=[],t=0;s[t++]='<?xml version="1.0" encoding="utf-8" ?>',s[t++]="<methodCall>",s[t++]="<params>",a.each(f,function(a,b){s[t++]="<"+a+"><![CDATA["+b+"]]></"+a+">"}),s[t++]="</params>",s[t++]="</methodCall>";var u=null;u&&0!==u.readyState&&u.abort();try{a.ajax({url:l,type:"POST",dataType:"xml",data:s.join("\n"),contentType:"text/plain",beforeSend:function(a){u=a},success:k,error:function(a,b){w.css("display","none");var c="";if("parsererror"==b){if(c="The result is not valid XML :\n-------------------------------------\n",""===a.responseText)return;c+=a.responseText.replace(/<[^>]+>/g,"")}else c=b;try{console.log(c)}catch(d){}}})}catch(v){return alert(v),void 0}var w=a(".wfsr");if(show_waiting_message&&w.length){var x=a(".wfsr").data("timeout_id");x&&clearTimeout(x),a(".wfsr").css("opacity",0),a(".wfsr").data("timeout_id",setTimeout(function(){a(".wfsr").css("opacity","")},1e3)),w.html(waiting_message).show()}},a.exec_json=window.exec_json=function(b,c,d,e){if("undefined"==typeof c&&(c={}),b=b.split("."),2==b.length){var f=a(".wfsr").data("timeout_id");f&&clearTimeout(f),a(".wfsr").css("opacity",0),a(".wfsr").data("timeout_id",setTimeout(function(){a(".wfsr").css("opacity","")},1e3)),show_waiting_message&&a(".wfsr").html(waiting_message).show(),a.extend(c,{module:b[0],act:b[1]}),"undefined"!=typeof xeVid&&a.extend(c,{vid:xeVid}),a.ajax({type:"POST",dataType:"json",url:request_uri,contentType:"application/json",data:a.param(c),success:function(b){return a(".wfsr").hide().trigger("cancel_confirm"),"0"!=b.error&&b.error>-1e3?-1==b.error&&"msg_is_not_administrator"==b.message?(alert("You are not logged in as an administrator"),a.isFunction(e)&&e(b),void 0):(alert(b.message),a.isFunction(e)&&e(b),void 0):(a.isFunction(d)&&d(b),void 0)}})}},a.fn.exec_html=function(b,c,d,e,f){"undefined"==typeof c&&(c={}),a.inArray(d,["html","append","prepend"])||(d="html");var g=a(this);if(b=b.split("."),2==b.length){var h=a(".wfsr").data("timeout_id");h&&clearTimeout(h),a(".wfsr").css("opacity",0),a(".wfsr").data("timeout_id",setTimeout(function(){a(".wfsr").css("opacity","")},1e3)),show_waiting_message&&a(".wfsr").html(waiting_message).show(),a.extend(c,{module:b[0],act:b[1]}),a.ajax({type:"POST",dataType:"html",url:request_uri,data:a.param(c),success:function(b){a(".wfsr").hide().trigger("cancel_confirm"),g[d](b),a.isFunction(e)&&e(f)}})}},a(function(a){a(".wfsr").ajaxStart(function(){a(window).bind("beforeunload",d)}).bind("ajaxStop cancel_confirm",function(){a(window).unbind("beforeunload",d)})})}(jQuery),function(a){function b(a){var b=[];return a.is(":radio")?a.filter(":checked").val():a.is(":checkbox")?(a.filter(":checked").each(function(){b.push(this.value)}),b.join("|@|")):a.val()}function c(a){if(a+="",!a.length)return 0;a=encodeURI(a);var b=a.split("%").length-1;return a.length-2*b}var d=[],e=[],g={},h=[],i={},j=xe.createApp("Validator",{init:function(){var a=/^[\w-]+((?:\.|\+|\~)[\w-]+)*@[\w-]+(\.[\w-]+)+$/;this.cast("ADD_RULE",["email",a]),this.cast("ADD_RULE",["email_address",a]);var b=/^[a-z]+[\w-]*[a-z0-9_]+$/i;this.cast("ADD_RULE",["userid",b]),this.cast("ADD_RULE",["user_id",b]);var c=/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-]+)+(:\d+)?/;this.cast("ADD_RULE",["url",c]),this.cast("ADD_RULE",["homepage",c]);var d=new RegExp("^[가-힣]*$");this.cast("ADD_RULE",["korean",d]);var e=new RegExp("^[가-힣0-9]*$");this.cast("ADD_RULE",["korean_number",e]);var f=/^[a-z]*$/i;this.cast("ADD_RULE",["alpha",f]);var g=/^[a-z][a-z0-9_]*$/i;this.cast("ADD_RULE",["alpha_number",g]);var h=/^[0-9]*$/;this.cast("ADD_RULE",["number",h])},run:function(a){var b="";a._filter&&(b=a._filter.value);var c=[a,b],d=this.cast("VALIDATE",c);return"undefined"==typeof d&&(d=!1),d},API_ONREADY:function(){var b=this;a("form").each(function(){this.onsubmit&&(this["xe:onsubmit"]=this.onsubmit,this.onsubmit=null)}).submit(function(c){var d=this["xe:onsubmit"],e=a.isFunction(d),f=e?d.apply(this):b.run(this);return f||c.stopImmediatePropagation(),f})},API_VALIDATE:function(d,e){function j(a){return a.replace(/([\.\+\-\[\]\{\}\(\)\\])/g,"\\$1")}var k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=!0,I=e[0],J=I.elements;if(J.ruleset?k=I.elements.ruleset.value:J._filter&&(k=I.elements._filter.value),!k)return!0;for(a.isFunction(h[k])&&(m=h[k]),k=a.extend({},g[k.toLowerCase()]||{},i),n=[],C=0,D=I.elements.length;D>C;C++)q=J[C],p=q.name,p&&J[p]&&(J[p].length&&J[p][0]!==q||n.push(p));n=n.join("\n"),l={};for(p in k)if(k.hasOwnProperty(p)&&(o=[],"^"==p.substr(0,1))){for(o=n.match(new RegExp("^"+j(p.substr(1))+".*$","gm")),o||(o=[]),C=0,D=o.length;D>C;C++)l[o[C]]=k[p];k[p]=null,delete k[p]}k=a.extend(k,l);for(p in k)if(k.hasOwnProperty(p)&&(f=k[p],q=J[p],q||(q=J[p+"[]"]),r=q?a.trim(b(a(q))):"",s=(f.modifier||"")+",",q&&!q.disabled)){if(f["if"])for(a.isArray(f["if"])||(f["if"]=[f["if"]]),C=0;C<f["if"].length;C++)F=f["if"][C],G=new Function("el","return !!("+F.test.replace(/\$(\w+)/g,"(jQuery('[name=$1]').is(':radio, :checkbox') ? jQuery('[name=$1]:checked').val() : jQuery('[name=$1]').val())")+")"),G(J)?f[F.attr]=F.value:delete f[F.attr];if(r){if(w=parseInt(f.minlength)||0,v=parseInt(f.maxlength)||0,y=/b$/.test(f.minlength||""),x=/b$/.test(f.maxlength||""),t=r.length,(y||x)&&(u=c(r)),w&&w>(y?u:t)||v&&(x?u:t)>v)return this.cast("ALERT",[I,p,"outofrange",w,v])&&!1;if(f.equalto&&(A=J[f.equalto],B=A?a.trim(b(a(A))):"",A&&B!==r))return this.cast("ALERT",[I,p,"equalto"])&&!1;for(z=(f.rule||"").split(","),C=0,D=z.length;D>C;C++)if((E=z[C])&&(H=this.cast("APPLY_RULE",[E,r]),s.indexOf("not,")>-1&&(H=!H),!H))return this.cast("ALERT",[I,p,"invalid_"+E])&&!1}else if(f["default"]&&(r=f["default"]),f.required)return this.cast("ALERT",[I,p,"isnull"])&&!1}return a.isFunction(m)?m(I):!0},API_ADD_RULE:function(a,b){var c=b[0].toLowerCase();e[c]=b[1]},API_DEL_RULE:function(a,b){var c=b[0].toLowerCase();delete e[c]},API_GET_RULE:function(a,b){var c=b[0].toLowerCase();return e[c]?e[c]:null},API_ADD_FILTER:function(a,b){var c=b[0].toLowerCase(),d=b[1];g[c]=d},API_DEL_FILTER:function(a,b){var c=b[0].toLowerCase();delete g[c]},API_GET_FILTER:function(a,b){var c=b[0].toLowerCase();return g[c]?g[c]:null},API_ADD_EXTRA_FIELD:function(a,b){var c=b[0].toLowerCase(),d=b[1];i[c]=d},API_GET_EXTRA_FIELD:function(a,b){var c=b[0].toLowerCase();return i[c]},API_DEL_EXTRA_FIELD:function(a,b){var c=b[0].toLowerCase();delete i[c]},API_APPLY_RULE:function(b,c){var d=c[0],f=c[1];return"undefined"==typeof e[d]?!0:a.isFunction(e[d])?e[d](f):e[d]instanceof RegExp?e[d].test(f):a.isArray(e[d])?a.inArray(f,e[d])>-1:!0},API_ALERT:function(b,c){var d=c[0],e=c[1],f=c[2],g=c[3],h=c[4],i=this.cast("GET_MESSAGE",[e]),j=this.cast("GET_MESSAGE",[f]);j!=f&&(j=j.indexOf("%s")<0?i+j:j.replace("%s",i)),(g||h)&&(j+="("+(g||"")+"~"+(h||"")+")"),this.cast("SHOW_ALERT",[j]),a(d.elements[e]).focus()},API_SHOW_ALERT:function(a,b){alert(b[0])},API_ADD_MESSAGE:function(a,b){var c=b[0],e=b[1];d[c]=e},API_GET_MESSAGE:function(a,b){var c=b[0];return d[c]||c},API_ADD_CALLBACK:function(a,b){var c=b[0],d=b[1];h[c]=d},API_REMOVE_CALLBACK:function(a,b){var c=b[0];delete h[c]}}),k=new j;xe.registerApp(k);var l=xe.createPlugin("editor_stub",{API_BEFORE_VALIDATE:function(a,b){var c=b[0],d=c.getAttribute("editor_sequence");if(d&&"object"==typeof d&&(d=d.value),d)try{editorRelKeys[d].content.value=editorRelKeys[d].func(d)||""}catch(e){}}});k.registerPlugin(new l)}(jQuery); |