From df0465716e12e506d7bebfcf1cec904c7375f3d0 Mon Sep 17 00:00:00 2001 From: taggon Date: Wed, 15 Jun 2011 08:24:10 +0000 Subject: [PATCH] Update minifying JavaScript files git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8483 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- common/js/x.min.js | 84 ++++++++++++++---------------------- common/js/xe.js | 103 +++++++++++++++++++++++++++++++------------- common/js/xe.min.js | 83 +++++++++++++++++------------------ 3 files changed, 147 insertions(+), 123 deletions(-) diff --git a/common/js/x.min.js b/common/js/x.min.js index a1dfffced..0b5023bfd 100644 --- a/common/js/x.min.js +++ b/common/js/x.min.js @@ -3,54 +3,36 @@ * Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com * Copyright 2001-2005 Michael Foster (Cross-Browser.com) **/ -function xDeprecate(funcName){var msg='DEPRECATED : '+funcName+'() is deprecated function.';if(typeof console=='object'&&typeof console.log=='function')console.log(msg)};var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7}}else if(navigator.vendor!='KDE'&&document.all&&xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;xIE6=xUA.indexOf('msie 6')!=-1}else if(document.layers)xNN4=true;var xMac=xUA.indexOf('mac')!=-1,xFF=xUA.indexOf('firefox')!=-1 -function xAddEventListener(e,eT,eL,cap){xDeprecate('xAddEventListener');if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if((!xIE4Up&&!xOp7Up)&&e==window){if(eT=='resize'){window.xPCW=xClientWidth();window.xPCH=xClientHeight();window.xREL=eL;xResizeEvent();return};if(eT=='scroll'){window.xPSL=xScrollLeft();window.xPST=xScrollTop();window.xSEL=eL;xScrollEvent();return}};var eh='e.on'+eT+'=eL';if(e.addEventListener){e.addEventListener(eT,eL,cap)}else if(e.attachEvent){e.attachEvent('on'+eT,eL)}else eval(eh)} -function xResizeEvent(){xDeprecate('xResizeEvent');if(window.xREL)setTimeout('xResizeEvent()',250);var cw=xClientWidth(),ch=xClientHeight();if(window.xPCW!=cw||window.xPCH!=ch){window.xPCW=cw;window.xPCH=ch;if(window.xREL)window.xREL()}} -function xScrollEvent(){xDeprecate('xScrollEvent');if(window.xSEL)setTimeout('xScrollEvent()',250);var sl=xScrollLeft(),st=xScrollTop();if(window.xPSL!=sl||window.xPST!=st){window.xPSL=sl;window.xPST=st;if(window.xSEL)window.xSEL()}} -function xAppendChild(oParent,oChild){xDeprecate('xAppendChild');if(oParent.appendChild){return oParent.appendChild(oChild)}else return null} -function xClientHeight(){xDeprecate('xClientHeight');var h=0;if(xOp6Dn){h=window.innerHeight}else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientHeight){h=document.documentElement.clientHeight}else if(document.body&&document.body.clientHeight){h=document.body.clientHeight}else if(xDef(window.innerWidth,window.innerHeight,document.width)){h=window.innerHeight;if(document.width>window.innerWidth)h-=16};return h} -function xClientWidth(){xDeprecate('xClientWidth');var w=0;if(xOp6Dn){w=window.innerWidth}else if(document.compatMode=='CSS1Compat'&&!window.opera&&document.documentElement&&document.documentElement.clientWidth){w=document.documentElement.clientWidth}else if(document.body&&document.body.clientWidth){w=document.body.clientWidth}else if(xDef(window.innerWidth,window.innerHeight,document.height)){w=window.innerWidth;if(document.height>window.innerHeight)w-=16};return w} -function xCreateElement(sTag){xDeprecate('xCreateElement');if(document.createElement){return document.createElement(sTag)}else return null} -function xDef(){xDeprecate('xDef');for(var i=0;i0){var offset=document.cookie.indexOf(search);if(offset!=-1){offset+=search.length;var end=document.cookie.indexOf(";",offset);if(end==-1)end=document.cookie.length;value=unescape(document.cookie.substring(offset,end))}};return value} -function xGetElementById(e){xDeprecate('xGetElementById');if(typeof (e)!='string')return e;if(document.getElementById){e=document.getElementById(e)}else if(document.all){e=document.all[e]}else e=null;return e} -function xGetElementsByAttribute(sTag,sAtt,sRE,fn){xDeprecate('xGetElementsByAttribute');var a,list,found=new Array(),re=new RegExp(sRE,'i');list=xGetElementsByTagName(sTag);for(var i=0;i=0){var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pt=gcs(e,'padding-top',1);if(pt!==null){pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1)}else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h}};h-=(pt+pb+bt+bb);if(isNaN(h)||h<0){return null}else e.style.height=h+'px'};h=e.offsetHeight}else if(css&&xDef(e.style.pixelHeight)){if(h>=0)e.style.pixelHeight=h;h=e.style.pixelHeight};return h} -function xHex(sn,digits,prefix){xDeprecate('xHex');var p='',n=Math.ceil(sn);if(prefix)p=prefix;n=n.toString(16);for(var i=0;i=0){var pl=0,pr=0,bl=0,br=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pl=gcs(e,'padding-left',1);if(pl!==null){pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1)}else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w}};w-=(pl+pr+bl+br);if(isNaN(w)||w<0){return null}else e.style.width=w+'px'};w=e.offsetWidth}else if(css&&xDef(e.style.pixelWidth)){if(w>=0)e.style.pixelWidth=w;w=e.style.pixelWidth};return w} -function xZIndex(e,uZ){xDeprecate('xZIndex');if(!(e=xGetElementById(e)))return 0;if(e.style&&xDef(e.style.zIndex)){if(xNum(uZ))e.style.zIndex=uZ;uZ=parseInt(e.style.zIndex)};return uZ} -function xStopPropagation(evt){xDeprecate('xStopPropagation');if(evt&&evt.stopPropagation){evt.stopPropagation()}else if(window.event)window.event.cancelBubble=true} \ No newline at end of file +function xDeprecate(a){typeof console=="object"&&typeof console.log=="function"&&console.log("DEPRECATED : "+a+"() is deprecated function.")}var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xIE6,xNN4,xUA=navigator.userAgent.toLowerCase(); +if(window.opera){var i=xUA.indexOf("opera");if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7}}else navigator.vendor!="KDE"&&document.all&&xUA.indexOf("msie")!=-1?(xIE4Up=parseFloat(navigator.appVersion)>=4,xIE4=xUA.indexOf("msie 4")!=-1,xIE5=xUA.indexOf("msie 5")!=-1,xIE6=xUA.indexOf("msie 6")!=-1):document.layers&&(xNN4=!0);var xMac=xUA.indexOf("mac")!=-1,xFF=xUA.indexOf("firefox")!=-1; +function xAddEventListener(a,b,d,e){xDeprecate("xAddEventListener");if(a=xGetElementById(a)){b=b.toLowerCase();if(!xIE4Up&&!xOp7Up&&a==window){if(b=="resize"){window.xPCW=xClientWidth();window.xPCH=xClientHeight();window.xREL=d;xResizeEvent();return}if(b=="scroll"){window.xPSL=xScrollLeft();window.xPST=xScrollTop();window.xSEL=d;xScrollEvent();return}}var f="e.on"+b+"=eL";a.addEventListener?a.addEventListener(b,d,e):a.attachEvent?a.attachEvent("on"+b,d):eval(f)}} +function xResizeEvent(){xDeprecate("xResizeEvent");window.xREL&&setTimeout("xResizeEvent()",250);var a=xClientWidth(),b=xClientHeight();if(window.xPCW!=a||window.xPCH!=b)window.xPCW=a,window.xPCH=b,window.xREL&&window.xREL()}function xScrollEvent(){xDeprecate("xScrollEvent");window.xSEL&&setTimeout("xScrollEvent()",250);var a=xScrollLeft(),b=xScrollTop();if(window.xPSL!=a||window.xPST!=b)window.xPSL=a,window.xPST=b,window.xSEL&&window.xSEL()} +function xAppendChild(a,b){xDeprecate("xAppendChild");return a.appendChild?a.appendChild(b):null} +function xClientHeight(){xDeprecate("xClientHeight");var a=0;if(xOp6Dn)a=window.innerHeight;else if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientHeight)a=document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)a=document.body.clientHeight;else if(xDef(window.innerWidth,window.innerHeight,document.width))a=window.innerHeight,document.width>window.innerWidth&&(a-=16);return a} +function xClientWidth(){xDeprecate("xClientWidth");var a=0;if(xOp6Dn)a=window.innerWidth;else if(document.compatMode=="CSS1Compat"&&!window.opera&&document.documentElement&&document.documentElement.clientWidth)a=document.documentElement.clientWidth;else if(document.body&&document.body.clientWidth)a=document.body.clientWidth;else if(xDef(window.innerWidth,window.innerHeight,document.height))a=window.innerWidth,document.height>window.innerHeight&&(a-=16);return a} +function xCreateElement(a){xDeprecate("xCreateElement");return document.createElement?document.createElement(a):null}function xDef(){xDeprecate("xDef");for(var a=0;ab?a:b}function xGetBodyHeight(){xDeprecate("xGetBodyHeight");var a=xClientHeight(),b=window.document.body.scrollHeight;return a>b?a:b} +function xGetComputedStyle(a,b,d){xDeprecate("xGetComputedStyle");var e="undefined",f=document.defaultView;if(f&&f.getComputedStyle)(a=f.getComputedStyle(a,""))&&(e=a.getPropertyValue(b));else if(a.currentStyle){e=b.split("-");b=e[0];for(f=1;f0&&(a=document.cookie.indexOf(d),a!=-1)){a+=d.length;b=document.cookie.indexOf(";",a);if(b==-1)b=document.cookie.length;b=unescape(document.cookie.substring(a,b))}return b}function xGetElementById(a){xDeprecate("xGetElementById");if(typeof a!="string")return a;return a=document.getElementById?document.getElementById(a):document.all?document.all[a]:null} +function xGetElementsByAttribute(a,b,d,e){xDeprecate("xGetElementsByAttribute");var f,h=[],d=RegExp(d,"i");f=xGetElementsByTagName(a);for(var g=0;g=0){var e=d=0,f=0,h=0;if(document.compatMode=="CSS1Compat"){var g=xGetComputedStyle,d=g(a,"padding-top",1);if(d!==null)e=g(a,"padding-bottom",1),f=g(a,"border-top-width",1),h=g(a,"border-bottom-width",1);else if(xDef(a.offsetHeight, +a.style.height))a.style.height=b+"px",d=a.offsetHeight-b}b-=d+e+f+h;if(isNaN(b)||b<0)return null;else a.style.height=b+"px"}b=a.offsetHeight}else if(d&&xDef(a.style.pixelHeight)){if(b>=0)a.style.pixelHeight=b;b=a.style.pixelHeight}return b}function xHex(a,b,d){xDeprecate("xHex");var e="",a=Math.ceil(a);d&&(e=d);a=a.toString(16);for(d=0;d=0){var e=d=0,f=0,h=0;if(document.compatMode=="CSS1Compat"){var g=xGetComputedStyle,d=g(a,"padding-left",1);if(d!==null)e=g(a,"padding-right",1),f=g(a,"border-left-width",1),h=g(a,"border-right-width",1);else if(xDef(a.offsetWidth, +a.style.width))a.style.width=b+"px",d=a.offsetWidth-b}b-=d+e+f+h;if(isNaN(b)||b<0)return null;else a.style.width=b+"px"}b=a.offsetWidth}else if(d&&xDef(a.style.pixelWidth)){if(b>=0)a.style.pixelWidth=b;b=a.style.pixelWidth}return b}function xZIndex(a,b){xDeprecate("xZIndex");if(!(a=xGetElementById(a)))return 0;if(a.style&&xDef(a.style.zIndex)){if(xNum(b))a.style.zIndex=b;b=parseInt(a.style.zIndex)}return b} +function xStopPropagation(a){xDeprecate("xStopPropagation");if(a&&a.stopPropagation)a.stopPropagation();else if(window.event)window.event.cancelBubble=!0}; diff --git a/common/js/xe.js b/common/js/xe.js index f69e67ba4..72663421c 100644 --- a/common/js/xe.js +++ b/common/js/xe.js @@ -1194,6 +1194,10 @@ function ucfirst(str) { return str.charAt(0).toUpperCase() + str.slice(1); } +function xGetElementById(id) { + return document.getElementById(id); +} + jQuery(function($){ $('.lang_code').each( function() @@ -1244,6 +1248,22 @@ jQuery(function($){ return false; }); + + /** + * Create popup windows automatically. + * Find anchors that have the '_xe_popup' class, then add popup script to them. + */ + $('a._xe_popup').click(function(){ + var $this = $(this), name = $this.attr('name'), href = $this.attr('href'), win; + + if(!name) name = '_xe_popup_'+Math.floor(Math.random()*1000); + + win = window.open(href, name, 'left=10,top=10,width=10,hegiht=10,resizable=no,scrollbars=no,toolbars=no'); + if(win) win.focus(); + + // cancel default action + return false; + }); }); /** * @file common/js/xml_handler.js @@ -1741,48 +1761,58 @@ var Validator = xe.createApp('Validator', { }); }, API_VALIDATE : function(sender, params) { - var self = this, result = true, form = params[0], filter=null, callback=null; + var result = true, form = params[0], filter=null, callback=null; + var name, el, val, mod, len, lenb, max, min, maxb, minb, rules, e_el, e_val, i, c, r, result; if (form.elements['_filter']) filter = form.elements['_filter'].value; if (!filter) return true; if ($.isFunction(callbacks[filter])) callback = callbacks[filter]; filter = $.extend({}, filters[filter.toLowerCase()] || {}, extras); - $.each(filter, function(name) { - var _el = form.elements[name]; + for(name in filter) { + if(!filter.hasOwnProperty(name)) continue; - if (!_el) return true; + f = filter[name]; + el = form.elements[name]; + val = el?$.trim(get_value($(el))):''; + mod = (f.modifier||'')+','; - var el = $(_el), val = $.trim(get_value(el)); - var minlen = parseInt(this.minlength) || 0; - var maxlen = parseInt(this.maxlength) || 0; - var rule = (this.rule || '').split(','); + if(!val) { + if(f['default']) val = f['default']; + if(f.required) return this.cast('ALERT', [form, name, 'isnull']) && false; + else continue; + } - if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false)); - if (!this.required && !val) return (result = true); - if ((minlen && val.length < minlen) || (maxlen && val.length > maxlen)) return (result = (!!self.cast('ALERT', [form, name, 'outofrange', minlen, maxlen]) && false)); + min = parseInt(f.minlength) || 0; + max = parseInt(f.maxlength) || 0; + minb = /b$/.test(f.minlength||''); + maxb = /b$/.test(f.maxlength||''); + len = val.length; + if(minb || maxb) lenb = get_bytes(val); + if((min && min > (minb?lenb:len)) || (max && max < (maxb?lenb:len))) { + return this.cast('ALERT', [form, name, 'outofrange', min, max]) && false; + } - if (this.equalto) { - var eq_val = get_value($(form.elements[this.equalto])); - if (eq_val != val) return (result = (!!self.cast('ALERT', [form, name, 'equalto']) && false)); + if(f.equalto) { + e_el = form.elements[f.equalto]; + e_val = e_el?$.trim(get_value($(e_el))):''; + if(e_el && e_val !== val) { + return this.cast('ALERT', [form, name, 'equalto']) && false; + } } + + rules = (f.rule || '').split(','); + for(i=0,c=rules.length; i < c; i++) { + if(!(r = rules[i])) continue; - if (rule) { - $.each(rule, function(i,r) { - if (!r) return true; - - var ret = self.cast('APPLY_RULE', [r, val]); - if (!ret) { - self.cast('ALERT', [form, name, 'invalid_'+this]); - return (result = false); - } - }); + result = this.cast('APPLY_RULE', [r, val]); + if(mod.indexOf('not,') > -1) result = !result; + if(!result) { + return this.cast('ALERT', [form, name, 'invalid_'+r]) && false; + } } + } - if (!result) return false; - }); - - if (!result) return false; if ($.isFunction(callback)) return callback(form); return true; @@ -1841,9 +1871,10 @@ var Validator = xe.createApp('Validator', { var name = params[0]; var value = params[1]; - if (typeof(rules[name]) == 'undefined') return true; // no filter - if ($.isFunction(rules[name])) return rules[name](value); - if (rules[name] instanceof RegExp) return rules[name].test(value); + if(typeof(rules[name]) == 'undefined') return true; // no filter + if($.isFunction(rules[name])) return rules[name](value); + if(rules[name] instanceof RegExp) return rules[name].test(value); + if($.isArray(rules[name])) return ($.inArray(value, rules[name]) > -1); return true; }, @@ -1930,6 +1961,16 @@ function get_value(elem) { } } +function get_bytes(str) { + str += ''; + if(!str.length) return 0; + + str = encodeURI(str); + var c = str.split('%').length - 1; + + return str.length - c*2; +} + })(jQuery); /** diff --git a/common/js/xe.min.js b/common/js/xe.min.js index 5a89ff177..dac44d568 100644 --- a/common/js/xe.min.js +++ b/common/js/xe.min.js @@ -3,71 +3,72 @@ * @author NHN (developers@xpressengine.com) * @brief XE Common JavaScript **/ -(function(a){function b(){return function(){var e=this;if(a.isArray(this._plugins))this._plugins=[];this._messages?this._messages={}:this._binded_fn={};a.each(this,function(c,b){if(!a.isFunction(b))return!0;if(!/^API_([A-Z0-9_]+)$/.test(c))return!0;var d=RegExp.$1,f=function(a,b){return e[c](a,b)};e._messages?e._messages[d]=[f]:e._binded_fn[d]=f});a.isFunction(this.init)&&this.init.apply(this,arguments)}}var d,c,f=[];d={_plugins:[],_messages:{},getPlugin:function(e){e=e.toLowerCase();return a.isArray(this._plugins[e])? +(function(a){function b(){return function(){var e=this;if(a.isArray(this._plugins))this._plugins=[];this._messages?this._messages={}:this._binded_fn={};a.each(this,function(c,b){if(!a.isFunction(b))return!0;if(!/^API_([A-Z0-9_]+)$/.test(c))return!0;var d=RegExp.$1,g=function(a,b){return e[c](a,b)};e._messages?e._messages[d]=[g]:e._binded_fn[d]=g});a.isFunction(this.init)&&this.init.apply(this,arguments)}}var d,c,g=[];d={_plugins:[],_messages:{},getPlugin:function(e){e=e.toLowerCase();return a.isArray(this._plugins[e])? this._plugins[e]:[]},registerPlugin:function(e){var c=this,b=e.getName().toLowerCase();if(a.inArray(e,this._plugins)>=0)return!1;this._plugins.push(e);a.isArray(this._plugins[b])||(this._plugins[b]=[]);this._plugins[b].push(e);a.each(e._binded_fn,function(a,e){c.registerHandler(a,e)});e.oApp=this;a.isFunction(e.activate)&&e.activate();return!0},registerHandler:function(e,c){var b=this._messages,e=e.toUpperCase();a.isArray(b[e])||(b[e]=[]);b[e].push(c)},cast:function(a,c){return this._cast(this,a, -c||[])},broadcast:function(a,c,b){this.parent&&this.parent._broadcast&&this.parent._broadcast(a,c,b)},_cast:function(c,b,d){var f,l=this._messages,b=b.toUpperCase();if(!l["BEFORE_"+b]&&!this["API_BEFORE_"+b]||this._cast(c,"BEFORE_"+b,d)){var g=[];if(a.isArray(l[b]))for(f=0;f=0&&f.splice(d,1);a.isArray(f[b])&&(d=a.inArray(c,f[b]),d>=0&&f[b].splice(d,1));a.isFunction(c.deactivate)&&c.deactivate()},broadcast:function(a,c){this._broadcast(this,a,c)}, -_broadcast:function(a,c,b){for(var d=0;d=0&&g.splice(d,1);a.isArray(g[b])&&(d=a.inArray(c,g[b]),d>=0&&g[b].splice(d,1));a.isFunction(c.deactivate)&&c.deactivate()},broadcast:function(a,c){this._broadcast(this,a,c)}, +_broadcast:function(a,c,b){for(var d=0;d"+k+" "}}this.loaded_popup_menus[c]=b}if(b){c=a("#popup_menu_area").html("
    "+ -b+"
");f={top:f.page_y,left:f.page_x};if(c.outerHeight()+f.top>a(window).height()+a(window).scrollTop())f.top=a(window).height()-c.outerHeight()+a(window).scrollTop();if(c.outerWidth()+f.left>a(window).width()+a(window).scrollLeft())f.left=a(window).width()-c.outerWidth()+a(window).scrollLeft();c.css({top:f.top,left:f.left}).show()}}}})(jQuery); -jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var e=!1,d=[],h=0;h-1?d[a]:h;if(e&&(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 d=a("div.fold_container", +arguments[1]||{})}if(c.doClick==!0)c.checked=null;if(typeof c.wrap=="string")c.wrap="#"+c.wrap;b=c.wrap?a(c.wrap).find("input[name="+b+"]:checkbox"):a("input[name="+b+"]:checkbox");c.checked=="toggle"?b.each(function(){a(this).attr("checked",a(this).attr("checked")?!1:!0)}):c.doClick==!0?b.click():b.attr("checked",c.checked)},displayPopupMenu:function(b,c,g){var c=g.menu_id,e=b.menus,b="";if(this.loaded_popup_menus[c])b=this.loaded_popup_menus[c];else{if(e){e=e.item;if(typeof e.length=="undefined"|| +e.length<1)e=Array(e);if(e.length)for(var k=0;k"+l+" "}}this.loaded_popup_menus[c]=b}if(b){c=a("#popup_menu_area").html("
    "+ +b+"
");g={top:g.page_y,left:g.page_x};if(c.outerHeight()+g.top>a(window).height()+a(window).scrollTop())g.top=a(window).height()-c.outerHeight()+a(window).scrollTop();if(c.outerWidth()+g.left>a(window).width()+a(window).scrollLeft())g.left=a(window).width()-c.outerWidth()+a(window).scrollLeft();c.css({top:g.top,left:g.left}).show()}}}})(jQuery); +jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var e=!1,d=[],j=0;j-1?d[a]:j;if(e&&(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 d=a("div.fold_container", b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(d).show()});a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(d).hide()})}});String.prototype.getQuery=function(a){var b=this.indexOf("?");if(b==-1)return null;var d={};this.substr(b+1,this.length).replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,e){d[b]=e});a=d[a];typeof a=="undefined"&&(a="");return a}; -String.prototype.setQuery=function(a,b){var d=this.indexOf("?"),c=this.replace(/#$/,"");if(d!=-1){var f=c.substr(d+1,this.length),e={},j=[],c=this.substr(0,d);f.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){e[b]=c});e[a]=b;jQuery.each(e,function(a,b){jQuery.trim(b)&&j.push(a+"="+decodeURI(b))});f=j.join("&");c+=f?"?"+f:""}else b.toString().trim()&&(c=c+"?"+a+"="+b);d=/https:\/\/([^:\/]+)(:\d+|)/i;if(f=d.exec(c))f="http://"+f[1],typeof http_port!="undefined"&&http_port!=80&&(f+=":"+http_port),c= -c.replace(d,f);d=!1;if(typeof enforce_ssl!="undefined"&&enforce_ssl)d=!0;else if(typeof ssl_actions!="undefined"&&typeof ssl_actions.length!="undefined"&&c.getQuery("act")){f=c.getQuery("act");for(i=0;i-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));try{b!="_blank"&&winopen_list[b]&&(winopen_list[b].close(),winopen_list[b]=null)}catch(c){}typeof b=="undefined"&&(b="_blank");typeof d=="undefined"&&(d="");a=window.open(a,b,d);a.focus();b!="_blank"&&(winopen_list[b]=a)} function popopen(a,b){typeof b=="undefined"&&(b="_blank");typeof xeVid!="undefined"&&a.indexOf(request_uri)>-1&&!a.getQuery("vid")&&(a=a.setQuery("vid",xeVid));winopen(a,b,"left=10,top=10,width=10,height=10,scrollbars=no,resizable=yes,toolbars=no")}function sendMailTo(a){location.href="mailto:"+a}function move_url(a,b){if(!a)return!1;typeof b=="undefined"&&(b="N");b=b=="N"?!1:!0;/^\./.test(a)&&(a=request_uri+a);b?winopen(a):location.href=a;return!1} function displayMultimedia(a,b,d,c){(a=_displayMultimedia(a,b,d,c))&&document.writeln(a)} -function _displayMultimedia(a,b,d,c){a.indexOf("files")==0&&(a=request_uri+a);var c=jQuery.extend({wmode:"transparent",allowScriptAccess:"sameDomain",quality:"high",flashvars:"",autostart:!1},c||{}),f=c.autostart&&c.autostart!="false"?"true":"false";delete c.autostart;var e="",e=e="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(a))e='';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))e='';else if(/\.swf/i.test(a)){e='';e+='';for(var j in c)c[j]!="undefined"&&c[j]!=""&&(e+='');e+=''}else{if(jQuery.browser.mozilla||jQuery.browser.opera)f=c.autostart&&c.autostart!="false"?"1":"0";e='';else if(/\.flv$/i.test(a)||/\.mov$/i.test(a)||/\.moov$/i.test(a)||/\.m4v$/i.test(a))e='';else if(/\.swf/i.test(a)){e='';e+='';for(var k in c)c[k]!="undefined"&&c[k]!=""&&(e+='');e+=''}else{if(jQuery.browser.mozilla||jQuery.browser.opera)g=c.autostart&&c.autostart!="false"?"1":"0";e='400&&b.css({overflow:"auto",overflowX:"hidden",height:"400px"});var d=a(window),b=a("#popup_content"),a=Math.max(b[0].offsetWidth,600),b=b[0].offsetHeight,c=d.width(),d=d.height(),f=0,e=0;a!=c&&(f=a-c);b!=d&&(e=b-d);(f||e)&&window.resizeBy(f,e);if(!arguments.callee.executed)setTimeout(setFixedPopupSize,300),arguments.callee.executed=!0} +function setFixedPopupSize(){var a=jQuery;a("#popHeader");var b=a("#popBody");b.length&&b.height()>400&&b.css({overflow:"auto",overflowX:"hidden",height:"400px"});var d=a(window),b=a("#popup_content"),a=Math.max(b[0].offsetWidth,600),b=b[0].offsetHeight,c=d.width(),d=d.height(),g=0,e=0;a!=c&&(g=a-c);b!=d&&(e=b-d);(g||e)&&window.resizeBy(g,e);if(!arguments.callee.executed)setTimeout(setFixedPopupSize,300),arguments.callee.executed=!0} function doCallModuleAction(a,b,d){var c=[];c.target_srl=d;c.cur_mid=current_mid;exec_xml(a,b,c,completeCallModuleAction)}function completeCallModuleAction(a){a.message!="success"&&alert(a.message);location.reload()}function completeMessage(a){alert(a.message);location.reload()}function doChangeLangType(a){typeof a=="string"?setLangType(a):setLangType(a.options[a.selectedIndex].value);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(;a.nodeName!="FORM";)a=a.parentNode;if(a.nodeName=="FORM"){a=a.getAttribute("editor_sequence");a=editorGetContent(a);window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes");var b=jQuery("#previewDocument");b.length||(jQuery('
').appendTo(document.body),b= jQuery("#previewDocument")[0]);if(b)b.content.value=a,b.submit()}} -function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),d=editorRelKeys[b].content.value;if(typeof b!="undefined"&&b&&typeof editorRelKeys!="undefined"&&typeof editorGetContent=="function"){var c=editorGetContent(b);editorRelKeys[b].content.value=c}var f={},c=jQuery(a.form).serializeArray();jQuery.each(c,function(a,b){var c=jQuery.trim(b.value);if(!c)return!0;if(/\[\]$/.test(b.name))b.name=b.name.replace(/\[\]$/,"");f[b.name]?f[b.name]+="|@|"+c:f[b.name]=b.value});exec_xml("document", -"procDocumentTempSave",f,completeDocumentSave,["error","message","document_srl"],f,a.form);editorRelKeys[b].content.value=d;return!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl);alert(a.message)}var objForSavedDoc=null;function doDocumentLoad(a){objForSavedDoc=a.form;popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))} +function doDocumentSave(a){var b=a.form.getAttribute("editor_sequence"),d=editorRelKeys[b].content.value;if(typeof b!="undefined"&&b&&typeof editorRelKeys!="undefined"&&typeof editorGetContent=="function"){var c=editorGetContent(b);editorRelKeys[b].content.value=c}var g={},c=jQuery(a.form).serializeArray();jQuery.each(c,function(a,b){var c=jQuery.trim(b.value);if(!c)return!0;if(/\[\]$/.test(b.name))b.name=b.name.replace(/\[\]$/,"");g[b.name]?g[b.name]+="|@|"+c:g[b.name]=b.value});exec_xml("document", +"procDocumentTempSave",g,completeDocumentSave,["error","message","document_srl"],g,a.form);editorRelKeys[b].content.value=d;return!1}function completeDocumentSave(a){jQuery("input[name=document_srl]").eq(0).val(a.document_srl);alert(a.message)}var objForSavedDoc=null;function doDocumentLoad(a){objForSavedDoc=a.form;popopen(request_uri.setQuery("module","document").setQuery("act","dispTempSavedList"))} function doDocumentSelect(a){if(opener&&opener.objForSavedDoc)opener.location.href=opener.current_url.setQuery("document_srl",a).setQuery("act","dispBoardWrite");window.close()}function viewSkinInfo(a,b){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+a+"&skin="+b,"SkinInfo")}var addedDocument=[];function doAddDocumentCart(a){addedDocument[addedDocument.length]=a.value;setTimeout(function(){callAddDocumentCart(addedDocument.length)},100)} function callAddDocumentCart(a){if(!(addedDocument.length<1||a!=addedDocument.length))a=[],a.srls=addedDocument.join(","),exec_xml("document","procDocumentAddCart",a,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 a="",b=0;b>2,d=(d&3)<<4|c>>4,j=(c&15)<<2|f>>6,h=f&63,isNaN(c)?j=h=64:isNaN(f)&&(h=64),b=b+this._keyStr.charAt(e)+this._keyStr.charAt(d)+this._keyStr.charAt(j)+this._keyStr.charAt(h);return b},decode:function(a){for(var b="",d,c,f,e,j,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h< -a.length;)d=this._keyStr.indexOf(a.charAt(h++)),c=this._keyStr.indexOf(a.charAt(h++)),e=this._keyStr.indexOf(a.charAt(h++)),j=this._keyStr.indexOf(a.charAt(h++)),d=d<<2|c>>4,c=(c&15)<<4|e>>2,f=(e&3)<<6|j,b+=String.fromCharCode(d),e!=64&&(b+=String.fromCharCode(c)),j!=64&&(b+=String.fromCharCode(f));return b=Base64._utf8_decode(b)},_utf8_encode:function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",d=0;d127&&c<2048?b+=String.fromCharCode(c>> +var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){for(var b="",d,c,g,e,k,j,l=0,a=Base64._utf8_encode(a);l>2,d=(d&3)<<4|c>>4,k=(c&15)<<2|g>>6,j=g&63,isNaN(c)?k=j=64:isNaN(g)&&(j=64),b=b+this._keyStr.charAt(e)+this._keyStr.charAt(d)+this._keyStr.charAt(k)+this._keyStr.charAt(j);return b},decode:function(a){for(var b="",d,c,g,e,k,j=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j< +a.length;)d=this._keyStr.indexOf(a.charAt(j++)),c=this._keyStr.indexOf(a.charAt(j++)),e=this._keyStr.indexOf(a.charAt(j++)),k=this._keyStr.indexOf(a.charAt(j++)),d=d<<2|c>>4,c=(c&15)<<4|e>>2,g=(e&3)<<6|k,b+=String.fromCharCode(d),e!=64&&(b+=String.fromCharCode(c)),k!=64&&(b+=String.fromCharCode(g));return b=Base64._utf8_decode(b)},_utf8_encode:function(a){for(var a=a.replace(/\r\n/g,"\n"),b="",d=0;d127&&c<2048?b+=String.fromCharCode(c>> 6|192):(b+=String.fromCharCode(c>>12|224),b+=String.fromCharCode(c>>6&63|128)),b+=String.fromCharCode(c&63|128))}return b},_utf8_decode:function(a){for(var b="",d=0,c=c1=c2=0;d191&&c<224?(c2=a.charCodeAt(d+1),b+=String.fromCharCode((c&31)<<6|c2&63),d+=2):(c2=a.charCodeAt(d+1),c3=a.charCodeAt(d+2),b+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63),d+=3);return b}}; if(typeof resizeImageContents=="undefined")var resizeImageContents=function(){};if(typeof activateOptionDisabled=="undefined")var activateOptionDisabled=function(){};objectExtend=jQuery.extend;function toggleDisplay(a){jQuery("#"+a).toggle()}function checkboxSelectAll(a,b,d){var c={};if(typeof a!="undefined")c.wrap=a;if(typeof d!="undefined")c.checked=d;XE.checkboxToggleAll(b,c)}function clickCheckBoxAll(a,b){var d={doClick:!0};if(typeof a!="undefined")d.wrap=a;XE.checkboxToggleAll(b,d)} 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,d){typeof b=="undefined"&&(b="");var c="./common/tpl/calendar.php?";a&&(c+="fo_id="+a);b&&(c+="&day_str="+b);d&&(c+="&callback_func="+d);popopen(c,"Calendar")}var loaded_popup_menus=XE.loaded_popup_menus; function createPopupMenu(){}function chkPopupMenu(){}function displayPopupMenu(a,b,d){XE.displayPopupMenu(a,b,d)}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,d,c){a=a+"="+escape(b)+(!d?"":"; expires="+d.toGMTString())+"; path="+(!c?"/":c);document.cookie=a} -function is_def(a){return typeof a!="undefined"}function ucfirst(a){return a.charAt(0).toUpperCase()+a.slice(1)} +function is_def(a){return typeof a!="undefined"}function ucfirst(a){return a.charAt(0).toUpperCase()+a.slice(1)}function xGetElementById(a){return document.getElementById(a)} jQuery(function(a){a(".lang_code").each(function(){var b=a(this),d=b.attr("id");typeof d=="undefined"&&(d=b.attr("name"));typeof d!="undefined"&&b.after("find_langcode")});a(document).click(function(b){var d=a("#popup_menu_area");d.length||(d=a('