Compressed JavaScript files are added and updated.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9375 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-09-27 10:43:50 +00:00
parent a27b849355
commit 873800fc38
8 changed files with 257 additions and 2092 deletions

View file

@ -94,14 +94,14 @@ _xe_base = {
* @brief Unregister an application instance
*/
unregisterApp : function(oApp) {
var sName = oPlugin.getName().toLowerCase();
var sName = oApp.getName().toLowerCase();
var nIndex = $.inArray(oApp, _apps);
if (nIndex >= 0) _apps.splice(nIndex, 1);
if (nIndex >= 0) _apps = _apps.splice(nIndex, 1);
if ($.isArray(_apps[sName])) {
nIndex = $.inArray(oApp, _apps[sName]);
if (nIndex >= 0) _apps[sName].splice(nIndex, 1);
if (nIndex >= 0) _apps[sName] = _apps[sName].splice(nIndex, 1);
}
// unregister event
@ -316,8 +316,8 @@ if(jQuery) jQuery.noConflict();
* @brief 특정 name을 가진 체크박스들의 checked 속성 변경
* @param [itemName='cart',][options={}]
*/
checkboxToggleAll : function() {
var itemName='cart';
checkboxToggleAll : function(itemName) {
if(!is_def(itemName)) itemName='cart';
var options = {
wrap : null,
checked : 'toggle',
@ -330,6 +330,7 @@ if(jQuery) jQuery.noConflict();
itemName = arguments[0];
} else {
$.extend(options, arguments[0] || {});
itemName = 'cart';
}
break;
case 2:
@ -346,7 +347,7 @@ if(jQuery) jQuery.noConflict();
var obj = $('input[name='+itemName+']:checkbox');
}
if(options.checked == 'toggle') {
if(options.checked == 'toggle') {
obj.each(function() {
$(this).attr('checked', ($(this).attr('checked')) ? false : true);
});
@ -385,9 +386,6 @@ if(jQuery) jQuery.noConflict();
case "popup" :
click_str = " onclick=\"popopen(this.href,'"+target+"'); return false;\"";
break;
case "self" :
//click_str = " onclick=\"location.href='"+url+"' return false;\"";
break;
case "javascript" :
click_str = " onclick=\""+url+"; return false; \"";
url="#";
@ -735,26 +733,22 @@ function zbxe_folder_close(id) {
* popup_layout 에서 window.onload 자동 요청됨.
**/
function setFixedPopupSize() {
var $ = jQuery;
var $win = $(window);
var $pc = $('body>.popup');
var w = Math.max($pc[0].offsetWidth, 600);
var h = $pc[0].offsetHeight;
var dw = $win.width();
var dh = $win.height();
var _w = 0, _h = 0;
var $ = jQuery, $win = $(window), $pc = $('body>.popup'), w, h, dw, dh, offset;
if (w != dw) _w = w - dw;
if (h != dh) _h = h - dh;
offset = $pc.css({overflow:'scroll'}).offset();
if (_w || _h) {
window.resizeBy(_w, _h);
}
w = $pc.width(10).height(10000).get(0).scrollWidth + offset.left*2;
h = $pc.height(10).width(10000).get(0).scrollHeight + offset.top*2;
if (!arguments.callee.executed) {
setTimeout(setFixedPopupSize, 300);
arguments.callee.executed = true;
}
if(w < 600) w = 600 + offset.left*2;
dw = $win.width();
dh = $win.height();
if(w != dw) window.resizeBy(w - dw, 0);
if(h != dh) window.resizeBy(0, h - dh);
$pc.width(w-offset.left*2).css({overflow:'',height:''});
}
/**
@ -1235,14 +1229,16 @@ jQuery(function($){
};
var response_tags = 'error message menus'.split(' ');
// prevent default action
evt.preventDefault();
evt.stopPropagation();
if(is_def(window.xeVid)) params.vid = xeVid;
if(is_def(XE.loaded_popup_menus[params.menu_id])) return XE.displayPopupMenu(params, response_tags, params) && false;
if(is_def(XE.loaded_popup_menus[params.menu_id])) return XE.displayPopupMenu(params, response_tags, params);
show_waiting_message = false;
exec_xml('member', action, params, XE.displayPopupMenu, response_tags, params);
show_waiting_message = true;
return false;
});
/**
@ -1498,7 +1494,7 @@ $.exec_xml = window.exec_xml = function(module, act, params, callback_func, resp
function onsuccess(data, textStatus, xhr) {
var resp_xml = $(data).find('response')[0], resp_obj, txt='', ret=[], tags={}, json_str='';
waiting_obj.css('display', 'none');
waiting_obj.css('display', 'none').trigger('cancel_confirm');
if(!resp_xml) {
alert(_xhr.responseText);
@ -1562,7 +1558,9 @@ $.exec_xml = window.exec_xml = function(module, act, params, callback_func, resp
msg = textStatus;
}
alert(msg);
try{
console.log(msg);
}catch(ee){}
}
});
} catch(e) {
@ -1573,10 +1571,7 @@ $.exec_xml = window.exec_xml = function(module, act, params, callback_func, resp
// ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음)
var waiting_obj = $('.wfsr');
if(show_waiting_message && waiting_obj.length) {
var d = $(document);
waiting_obj.html(waiting_message).css({
'display' : 'none'
});
waiting_obj.html(waiting_message).show();
}
}
function send_by_form(url, params) {
@ -1613,6 +1608,7 @@ function arr2obj(arr) {
return ret;
}
/**
* @brief exec_json (exec_xml와 같은 용도)
**/
@ -1620,10 +1616,7 @@ $.exec_json = function(action,data,func){
if(typeof(data) == 'undefined') data = {};
action = action.split(".");
if(action.length == 2){
if(show_waiting_message) {
$(".wfsr").html(waiting_message).css('display','none');
}
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
$.extend(data,{module:action[0],act:action[1]});
if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid});
@ -1634,7 +1627,7 @@ $.exec_json = function(action,data,func){
,contentType:"application/json"
,data:$.param(data)
,success : function(data){
$(".wfsr").css('display','none');
$(".wfsr").hide().trigger('cancel_confirm');
if(data.error > 0) alert(data.message);
if($.isFunction(func)) func(data);
}
@ -1649,9 +1642,7 @@ $.fn.exec_html = function(action,data,type,func,args){
var self = $(this);
action = action.split(".");
if(action.length == 2){
if(show_waiting_message) {
$(".wfsr").html(waiting_message).css('display','none');
}
if(show_waiting_message) $(".wfsr").html(waiting_message).show();
$.extend(data,{module:action[0],act:action[1]});
$.ajax({
@ -1660,13 +1651,28 @@ $.fn.exec_html = function(action,data,type,func,args){
,url:request_uri
,data:$.param(data)
,success : function(html){
$(".wfsr").css('display','none');
$(".wfsr").hide().trigger('cancel_confirm');
self[type](html);
if($.isFunction(func)) func(args);
}
});
}
};
function beforeUnloadHandler(){
return '';
}
$(function($){
$('.wfsr')
.ajaxStart(function(){
$(window).bind('beforeunload', beforeUnloadHandler);
})
.bind('ajaxStop cancel_confirm', function(){
$(window).unbind('beforeunload', beforeUnloadHandler);
});
});
})(jQuery);
/**
* @file common/js/xml_js_filter.js
@ -1680,7 +1686,7 @@ $.fn.exec_html = function(action,data,type,func,args){
var messages = [];
var rules = [];
var filters = [];
var filters = {};
var callbacks = [];
var extras = {};
@ -1698,16 +1704,16 @@ var Validator = xe.createApp('Validator', {
this.cast('ADD_RULE', ['user_id', regUserid]);
// url
var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;
var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-]+)+(:\d+)?/;
this.cast('ADD_RULE', ['url', regUrl]);
this.cast('ADD_RULE', ['homepage', regUrl]);
// korean
var regKor = /^[가-힣]*$/;
var regKor = new RegExp('^[\uAC00-\uD7A3]*$');
this.cast('ADD_RULE', ['korean', regKor]);
// korean_number
var regKorNum = /^[가-힣0-9]*$/;
var regKorNum = new RegExp('^[\uAC00-\uD7A30-9]*$');
this.cast('ADD_RULE', ['korean_number', regKorNum]);
// alpha
@ -1755,23 +1761,72 @@ var Validator = xe.createApp('Validator', {
});
},
API_VALIDATE : function(sender, params) {
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;
var result = true, form = params[0], elems = form.elements, filter, filter_to_add, ruleset, callback;
var fields, names, name, el, val, mod, len, lenb, max, min, maxb, minb, rules, e_el, e_val, i, c, r, if_, fn;
if (form.elements['_filter']) filter = form.elements['_filter'].value;
if (!filter) return true;
if ($.isFunction(callbacks[filter])) callback = callbacks[filter];
if(elems['ruleset']) filter = form.elements['ruleset'].value;
else if(elems['_filter']) filter = form.elements['_filter'].value;
if(!filter) return true;
if($.isFunction(callbacks[filter])) callback = callbacks[filter];
filter = $.extend({}, filters[filter.toLowerCase()] || {}, extras);
function regex_quote(str){
return str.replace(/([\.\+\-\[\]\{\}\(\)\\])/g, '\\$1');
};
// get form names
fields = [];
for(i=0,c=form.elements.length; i < c; i++) {
el = elems[i];
name = el.name;
if(!name || !elems[name]) continue;
if(!elems[name].length || elems[name][0] === el) fields.push(name);
};
fields = fields.join('\n');
// get field names matching patterns
filter_to_add = {};
for(name in filter) {
if(!filter.hasOwnProperty(name)) continue;
names = [];
if(name.substr(0,1) == '^') {
names = fields.match( (new RegExp('^'+regex_quote(name.substr(1))+'.*$','gm')) );
} else {
continue;
}
if(!names) names = [];
for(i=0,c=names.length; i < c; i++) {
filter_to_add[names[i]]= filter[name];
}
filter[name] = null;
delete filter[name];
};
filter = $.extend(filter, filter_to_add);
for(name in filter) {
if(!filter.hasOwnProperty(name)) continue;
f = filter[name];
el = form.elements[name];
el = elems[name];
val = el?$.trim(get_value($(el))):'';
mod = (f.modifier||'')+',';
if(!el) continue;
if(!el || el.disabled) continue;
if(f['if']) {
if(!$.isArray(f['if'])) f['if'] = [f['if']];
for(i=0;i<f['if'].length;i++) {
if_ = f['if'][i];
fn = new Function('el', 'return !!(' + (if_.test.replace(/\$(\w+)/g, 'el["$1"].value')) +')');
if(fn(elems)) f[if_.attr] = if_.value;
}
}
if(!val) {
if(f['default']) val = f['default'];
@ -1790,7 +1845,7 @@ var Validator = xe.createApp('Validator', {
}
if(f.equalto) {
e_el = form.elements[f.equalto];
e_el = elems[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;
@ -1807,9 +1862,9 @@ var Validator = xe.createApp('Validator', {
return this.cast('ALERT', [form, name, 'invalid_'+r]) && false;
}
}
}
};
if ($.isFunction(callback)) return callback(form);
if($.isFunction(callback)) return callback(form);
return true;
},
@ -1943,17 +1998,17 @@ var EditorStub = xe.createPlugin('editor_stub', {
oValidator.registerPlugin(new EditorStub);
// functions
function get_value(elem) {
function get_value($elem) {
var vals = [];
if (elem.is(':radio')){
return elem.filter(':checked').val();
} else if (elem.is(':checkbox')) {
elem.filter(':checked').each(function(){
if ($elem.is(':radio')){
return $elem.filter(':checked').val();
} else if ($elem.is(':checkbox')) {
$elem.filter(':checked').each(function(){
vals.push(this.value);
});
return vals.join('|@|');
} else {
return elem.val();
return $elem.val();
}
}

2093
common/js/xe.min.js vendored

File diff suppressed because it is too large Load diff

37
modules/admin/tpl/js/admin.min.js vendored Normal file
View file

@ -0,0 +1,37 @@
jQuery(function(a){a(".form li").find(">input:text,>input:password,>textarea").filter('input[value!=""],textarea:not(:empty)').prev("label").css("visibility","hidden").end().end().prev("label").addClass("overlap").css({top:"15px",left:"5px"}).next().focus(function(){var b=a(this).prev().stop().animate({opacity:0,left:"25px"},"fast",function(){b.css("visibility","hidden")})}).blur(function(){var b=a(this);a.trim(b.val())==""&&b.prev().stop().css("visibility","visible").animate({opacity:1,left:"5px"},
"fast")}).end().parent().css("position","relative");var c=a("input:radio+label,input:checkbox+label").prev("input");c.change(function(){var b=a(this).attr("name");c.filter(function(){return this.name==b}).next("label").css("font-weight","normal").end().filter(":checked").next("label").css("font-weight","bold").end()}).change();a(".form th>input:checkbox").change(function(){var b=a(this),d=b.data("name");b.closest("table").find("input:checkbox").filter(function(){var b=a(this);return!b.prop("disabled")&&
(b.attr("name")==d||b.data("name")==d)}).prop("checked",b.prop("checked")).end().end().trigger("update.checkbox",[d,this.checked])});a.fn.xePagination=function(){this.not(".xe-pagination").addClass("xe-pagination").find("span.tgContent").css("whiteSpace","nowrap").end().find("a.tgAnchor").each(function(){var b=a(this);b.after(a(b.attr("href")))}).end();return this};a(".pagination").xePagination();a(".portlet .action").css({display:"none",position:"absolute"}).parent().mouseleave(function(){a(this).find(">.action").fadeOut(100)}).mouseenter(function(){a(this).find(">.action").fadeIn(100)}).focusin(function(){a(this).mouseenter()}).focusout(function(){var b=
a(this),d;clearTimeout(b.data("timer"));d=setTimeout(function(){b.find(":focus").length||b.mouseleave()},10);b.data("timer",d)});a(".dashboard>.section>.portlet:odd").after('<br style="clear:both" />');a(".header>.siteTool>a.i").bind("before-open.tc",function(){a(this).addClass("active").next("div.tgContent").find(">.section:gt(0)").hide().end().find(">.btnArea>button").show()}).bind("after-close.tc",function(){a(this).removeClass("active")}).next("#siteMapList").find(">.section:last").after('<p class="btnArea"><button type="button">&rsaquo; more</button></p>').find("+p>button").click(function(){a(this).hide().parent().prevAll(".section").show()});
a.fn.xeMask=function(){this.each(function(){var b=a(this),d=b.text();b.data("originalText",d);/^([\w\-\.]+?)@(([\w-]+\.)+[a-z]{2,})$/ig.test(d)&&b.data("maskedText",RegExp.$1+"...");b.text(b.data("maskedText"))}).mouseover(function(){a(this).text(a(this).data("originalText"))}).mouseout(function(){a(this).text(a(this).data("maskedText"))}).focus(function(){a(this).mouseover()}).blur(function(){a(this).mouseout()})};a(".masked").xeMask()});
jQuery(function(a){a.fn.xeMenu=function(){this.removeClass("jx").attr("role","navigation").find("li").attr("role","menuitem").find(">ul").hide().end().filter(":has(>ul)").attr("aria-haspopup","true").end().end().delegate("li",{mouseover:function(){a(this).addClass("active").find(">ul").show().end().parentsUntil(".gnb").filter("li").addClass("active").end().end()},mouseleave:function(){a(this).removeClass("active").find(">ul").hide()},focusout:function(){var c=a(this);setTimeout(function(){c.find(":focus").length||
c.removeClass("active").find(">ul").hide()},1)}}).delegate("a",{focus:function(){a(this).parent("li").mouseover()}})};a("div.gnb").xeMenu()});
jQuery(function(a){a.fn.xeModalWindow=function(){this.not(".xe-modal-window").addClass("xe-modal-window").each(function(){a(a(this).attr("href")).addClass("x").hide()}).click(function(){var c=a(this),b,d;b=a(c.attr("href"));b.parent("body").length||(d=a('<button type="button" class="modalClose" title="Close this layer">X</button>'),d.click(function(){b.data("anchor").trigger("close.mw")}),b.prepend('<span class="bg"></span>').append('<\!--[if IE 6]><iframe class="ie6"></iframe><![endif]--\>').find(">.fg").prepend(d).append(d.clone(!0)).end().appendTo("body"));
b.data("anchor",c);b.data("state")=="showing"?c.trigger("close.mw"):c.trigger("open.mw");return!1}).bind("open.mw",function(){var c=a(this),b,d;b=a.Event("before-open.mw");c.trigger(b);if(b.isDefaultPrevented())return!1;b=a(c.attr("href"));d=c.data("duration")||"fast";b.data("state","showing");a("html,body").addClass("modalContainer");a(document).bind("keydown.mw",function(a){if(a.which==27)return c.trigger("close.mw"),!1});b.fadeIn(d,function(){c.trigger("after-open.mw")}).find(">.bg").height(a(document).height()).end().find("button.modalClose:first").focus()}).bind("close.mw",
function(){var c=a(this),b,d;b=a.Event("before-close.mw");c.trigger(b);if(b.isDefaultPrevented())return!1;b=a(c.attr("href"));d=c.data("duration")||"fast";b.data("state","hiding");a("html,body").removeClass("modalContainer");b.fadeOut(d,function(){c.trigger("after-close.mw")});c.focus()})};a("a.modalAnchor").xeModalWindow();a("div.modal").addClass("x").hide()});
jQuery(function(a){var c=!1;a.fn.xeContentToggler=function(){this.not(".xe-content-toggler").addClass("xe-content-toggler").each(function(){var b=a(this);$layer=a(b.attr("href"));$layer.hide().not(".xe-toggling-content").addClass("xe-toggling-content").mousedown(function(){c=!0}).focusout(function(){setTimeout(function(){!c&&!$layer.find(":focus").length&&$layer.data("state")=="showing"&&b.trigger("close.tc");c=!1},1)})}).click(function(){var b=a(this),d;d=a(b.attr("href"));d.data("anchor",b);d.data("state")==
"showing"?b.trigger("close.tc"):b.trigger("open.tc");return!1}).bind("open.tc",function(){function b(){d.trigger("after-open.tc")}var d=a(this),g,f,e;g=a(d.attr("href"));f=d.data("effect");e=d.data("duration")||"fast";g.data("state","showing");d.trigger("before-open.tc");c=!1;a(document).unbind("mousedown.tc keydown.tc").bind("mousedown.tc keydown.tc",function(b){if(b){if(b.type=="keydown"&&b.which!=27)return!0;if(b.type=="mousedown"&&(b=a(b.target),b.is("html,.tgAnchor,.tgContent")||g.has(b).length))return!0}d.trigger("close.tc");
return!1});switch(f){case "slide":g.slideDown(e,b);break;case "slide-h":f=g.css({"overflow-x":"",width:""}).width();g.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:f},e,function(){g.css({"overflow-x":"",width:""});b()});break;case "fade":g.fadeIn(e,b);break;default:g.show(),d.trigger("after-open.tc")}}).bind("close.tc",function(){function b(){d.trigger("after-close.tc")}var d=a(this),c,f,e;a(document).unbind("mousedown.tc keydown.tc");c=a(d.attr("href"));f=d.data("effect");e=d.data("duration")||
"fast";c.data("state","hiding");d.trigger("before-close.tc");switch(f){case "slide":c.slideUp(e,b);break;case "slide-h":c.animate({width:0},e,function(){c.hide();b()});break;case "fade":c.fadeOut(e,b);break;default:c.hide(),d.trigger("after-close.tc")}});return this};a("a.tgAnchor").xeContentToggler()});
jQuery(function(a){a.fn.xeModuleFinder=function(){this.not(".xe-module-finder").addClass("xe-module-finder").find("a.tgAnchor.findsite").bind("before-open.tc",function(){var c,b,d;c=a(this);b=a(c.attr("href")).find(">ul");d=c.prev("input:text").val();a.exec_json("admin.getSiteAllList",{domain:d},function(d){var f=d.site_list,e,i;b.empty();c.closest(".modulefinder").find(".moduleList,.moduleIdList").attr("disabled","disabled");if(d.error||!a.isArray(f))c.trigger("close.tc");else for(e=0,i=f.length;e<
i;e++)d=a("<li />").appendTo(b),a('<button type="button" />').text(f[e].domain).data("site_srl",f[e].site_srl).appendTo(d)})}).end().find(".tgContent.suggestion").delegate("button","click",function(){var c,b;c=a(this);b=c.closest(".modulefinder");b.find("a.tgAnchor.findsite").trigger("close.tc");a.exec_json("module.procModuleAdminGetList",{site_srl:c.data("site_srl")},function(d){var c=d.module_list,f;if(!d.error&&c){d=b.find(".moduleList").data("module_list",c).removeAttr("disabled").empty();for(f in c)c.hasOwnProperty(f)&&
a("<option />").attr("value",f).text(c[f].title).appendTo(d);d.prop("selectedIndex",0).change().focus();d.is(":visible")||d.slideDown(100,function(){b.find(".moduleIdList:not(:visible)").slideDown(100).trigger("show")}).trigger("show")}})}).end().find(".moduleList,.moduleIdList").hide().end().find(".moduleList").change(function(){var c,b,d;c=a(this);b=c.val();d=c.data("module_list");if(d[b]){d=d[b].list;c=c.closest(".modulefinder").find(".moduleIdList").removeAttr("disabled").empty();for(var g in d)d.hasOwnProperty(g)&&
a("<option />").attr("value",d[g].module_srl).text(d[g].browser_title).appendTo(c);c.prop("selectedIndex",0).change()}});return this};a(".modulefinder").xeModuleFinder()});
jQuery(function(a){function c(a,b){for(var c=0,e=0;a&&a!=b;)c+=a.offsetTop,e+=a.offsetLeft,a=a.offsetParent;return{top:c,left:e}}var b=a('<tr class="placeholder"><td>&nbsp;</td></tr>');a.fn.xeSortableTable=function(){this.not(".xe-sortable-table").addClass("xe-sortable-table").delegate("button.dragBtn","mousedown.st",function(d){var g,f,e,i,k,h,j,m,l,n;if(d.which==1){f=a(this);e=f.closest("tr");i=f.closest("table");n=i.get(0).offsetParent;f=e.height();k=e.width();before_event=a.Event("before-drag.st");
i.trigger(before_event);if(before_event.isDefaultPrevented())return!1;g=d.pageY;h=c(e.get(0),n);$clone=e.attr("target",!0).clone(!0).appendTo(i);l=(d=i.find("thead th")).length;d.filter("[colspan]").attr("colspan",function(a,b){l+=b-1});b.find("td").attr("colspan",l);j=[];i.find("tbody>tr:not([target],.sticky,:hidden)").each(function(){var b=a(this),d;d=c(this,n);j.push({top:d.top,bottom:d.top+b.height(),$item:b})});$clone.addClass("draggable").css({position:"absolute",opacity:0.6,width:k,height:f,
left:h.left,top:h.top,zIndex:100});b.css({position:"absolute",opacity:0.6,width:k,height:"10px",left:h.left,top:h.top,backgroundColor:"#bbb",overflow:"hidden",zIndex:99}).appendTo(i);e.css("opacity",0.6);a(document).unbind("mousedown.st mouseup.st").bind("mousemove.st",function(a){var d,c,l;m=null;a=h.top-(g-a.pageY);for(d=0,c=j.length;d<c;d++)if(l=j[d],!(d&&l.top>a||d<c-1&&l.bottom<a))m={element:l.$item},l.top>a-12?(m.state="before",b.css("top",l.top-5)):(m.state="after",b.css("top",l.bottom-5));
$clone.css({top:a})}).bind("mouseup.st",function(){a(document).unbind("mousemove.st mouseup.st");e.removeAttr("target").css("opacity","");$clone.remove();b.remove();m&&(a(m.element)[m.state](e),i.trigger("after-drag.st"))})}});return this};a("table.sortable").xeSortableTable()});
jQuery(function(a){function c(b){function d(){var a=[];f.each(function(){a.push(this.value)});return a.join("\n")}function c(){b.data("multilang-current-name")?b.find("h2").find("strong").text(i==q?h:k).end().find("a").text(i==q?k:h).show().end():b.find("h2").find("strong").text(h).end().find("a").hide()}var e,f,g="",j=0,i,h,k,o=[],q=0,s=1;b.data("init-multilang-editor")||(b.data("init-multilang-editor",!0).bind("multilang-reset",function(){b.data("multilang-current-name","").find(".langInput li").find(">input:text,>textarea").val(" ").prev("label").css("visibility",
"visible");i=q;c()}).find("h2 a").click(function(){i=!i;c();return!1}).end().delegate("a.langItem","click",function(){var f=a(this),r,h,k;h=b.data("multilang-list");k=f.data("multilang-name");if(h&&h[k]){h=h[k];r=b.find(".langInput");b.trigger("multilang-reset").find(".langList li.active").removeClass("active").end().data("multilang-current-name",k);f.parent("li").addClass("active");for(var p in h)h.hasOwnProperty(p)&&r.find("li."+p).find(">input:text,>textarea").data("multilang-value",h[p]).val(h[p]).prev("label").css("visibility",
"hidden");g=d();j=0;e.val(o[j]);i=s;c();return!1}}).data("layer_index",m).find(".langInput").attr("id","langInput_"+m++),k=b.find("h2 strong").text(),h=b.find("h2 a").text(),f=b.find("input:text,textarea").change(function(){var a=d()==g?0:1;a!=j&&e.val(o[j=a])}),e=b.find("input[type=submit]").click(function(){function c(){b.hide().closest(".multiLangEdit").find(".vLang").eq(0).val("$user_lang->"+h).end().eq(1).val(b.find(".langInput li."+xe.current_lang).find(">input:text,>textarea").val()).end()}
function e(){var b={};if(h&&i==s)b.lang_name=h;f.each(function(){var d=a(this);b[d.parent("li").attr("class")]=d.val()});a.exec_json("module.procModuleAdminInsertLang",b,t)}function t(a){if(a&&!a.error&&a.name)h=a.name,c()}var h=b.data("multilang-current-name");d()==g?c():e();return!1}),o=e.val().split("|"),e.val(o[0]))}function b(a){var b,d,c={},e;for(b=0,d=a.length;b<d;b++)e=a[b],c[e.name]||(c[e.name]={}),c[e.name][e.lang_code]=e.value;return c}function d(a){var b=0,d;for(d in a)a.hasOwnProperty(d)&&
b++;return b}var g=null,f=null,e=0,i=null,k=!1,h=!1,j;a(".multiLangEdit").delegate("input.vLang:text,textarea.vLang",{textchange:function(){var b=a(this),d=a.trim(b.val()),c;f&&(clearTimeout(f),f=null);b.data("mle-container");c=j.find(">ul");!d||k?(k=!1,c.parent().hide()):(b.data("mle-langkey").val(""),f=setTimeout(function(){b.addClass("loading");c.parent().is(":visible")&&c.parent().hide();a.exec_json("module.getLangListByLangcodeForAutoComplete",{search_keyword:d},function(d){return function(f){var h=
f.results,g,n;if(!f.error&&h&&e==d+1){b.removeClass("loading");c.empty();for(g=0,n=h.length;g<n;g++)f=a('<button type="button" class="_btnLang" />').data("langkey",h[g].name).text(h[g].value),a("<li />").append(f).appendTo(c);j.trigger("show")}}}(e++))},100))},keydown:function(b){var d,c,e=b.which;a(this);b=j.find(">ul");if(!j.is(":visible")||a.inArray(e,[38,40,13,27])<0)return!0;if(e==27)return j.trigger("hide"),!1;d=b.find("button.active");if(e==13)return d.click(),!1;if(!d.length)return b.find("li>button:first").addClass("active"),
!1;e==38?(c=d.parent().prev("li").find(">button"),c.length||(c=b.find(">li:last>button"))):e==40&&(c=d.parent().next("li").find(">button"),c.length||(c=b.find(">li:first>button")));d.removeClass("active");c.addClass("active");return!1},focus:function(){var b=a(this),d=a.trim(b.val()),c=b.closest(".multiLangEdit");b.after(j);b.data("mle-container")||b.data("mle-container",c);b.data("mle-langkey")||b.data("mle-langkey",c.find("input.vLang:first"));(function(){var c=a.trim(b.val());c!=d&&(d=c,b.trigger("textchange"));
g=setTimeout(arguments.callee,50)})()},blur:function(){clearTimeout(g);g=null;a(this).closest(".multiLangEdit").focusout()},focusout:function(){var b=a(this);clearTimeout(i);i=setTimeout(function(){h?h=!1:b.find(":focus").is(".vLang,button._btnLang")||j.trigger("hide")},10)}}).delegate("a.tgAnchor.editUserLang",{"before-open.tc":function(){var e,f,g;e=a(this);f=a(e.attr("href")).insertBefore(e);g=e.closest(".multiLangEdit").find("input.vLang,textarea.vLang");e=g.eq(0).val();g=g.eq(1).val();c(f);f.trigger("multilang-reset").removeClass("showChild").find(".langList").empty().end();
f.find(".langInput li."+xe.current_lang).find(">input:text,>textarea").val(g).prev("label").css("visibility","hidden");j.trigger("hide");/^\$user_lang->(.+)$/.test(e)?(e="module.getModuleAdminLangListByName",g={lang_name:RegExp.$1}):(e="module.getModuleAdminLangListByValue",g={value:g});show_waiting_message=!1;a.exec_json(e,g,function(c){var e=c.lang_list,g;!c.error&&e&&(e=b(e),f.data("multilang-list",e),g=f.find(".langList"),a.each(e,function(b){var c=a("<li />").appendTo(g),d=f.data("layer_index");
a('<a href="#langInput_'+d+'" class="langItem" />').text(this[xe.current_lang]).data("multilang-name",b).appendTo(c)}),d(e)>1&&f.addClass("showChild"),f.find(".langList>li>a:first").click())});show_waiting_message=!0}}).delegate("button._btnLang",{click:function(){var b=a(this);k=!0;j.trigger("hide");b.closest(".multiLangEdit").find("input.vLang,textarea.vLang").eq(0).val(b.data("langkey")).end().eq(1).val(b.text()).end();return!1},mousedown:function(){h=!0},focus:function(){a(this).mouseover()},
mouseover:function(){a(this).closest("ul").find("button.active").removeClass("active")}});j=a('<div class="suggestion"><ul></ul></div>').bind("show",function(){a(this).show()}).bind("hide",function(){a(this).hide()});var m=0});
jQuery(function(a){a(".filebox").bind("before-open.mw",function(){function c(f){d.html(f.html);d.find(".lined .select").bind("click",function(){var c=a(this).parent().find("img.filebox_item").attr("src");b.trigger("filebox.selected",[c]);b.trigger("close.mw");return!1});d.find(".pagination").find("a").filter(function(){return a(this).hasClass("tgAnchor")?!1:!0}).bind("click",function(){var b=a(this).attr("page");a.exec_json("module.getFileBoxListHtml",{page:b},c);a(window).scrollTop(a(g).find(".modalClose").offset().top);
return!1});a("#FileBoxGoTo").find("button").bind("click",function(){var b=a(this).prev("input").val();a.exec_json("module.getFileBoxListHtml",{page:b},c);a(window).scrollTop(a(g).find(".modalClose").offset().top);return!1})}var b,d,g;b=a(this);g=b.attr("href");d=a(g).find(".filebox_list");a.exec_json("module.getFileBoxListHtml",{page:"1"},c)})});
function showWaitingFogLayer(){var a=jQuery('<span class="bg"></span>');a.height(jQuery(window).height());jQuery(".wfsr").wrap('<div class="wfsr_fog" />').before(a)}function hideWaitingFogLayer(){jQuery(".wfsr").prev("span").remove();jQuery(".wfsr").unwrap()}function doInstallModule(a){var c=[];c.module_name=a;exec_xml("install","procInstallAdminInstall",c,completeInstallModule);showWaitingFogLayer()}
function doUpdateModule(a){var c=[];c.module_name=a;exec_xml("install","procInstallAdminUpdate",c,completeInstallModule);showWaitingFogLayer()}function completeInstallModule(a){alert(a.message);location.reload()}jQuery(document).ready(function(a){a("body").ajaxComplete(function(){hideWaitingFogLayer()})});jQuery(function(a){a(".x>.body>.lnb").length==0&&a(".x>.body>.content").addClass("single")});

6
modules/admin/tpl/js/config.min.js vendored Normal file
View file

@ -0,0 +1,6 @@
jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a);jQuery("#index_module_srl").val(b);jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}
function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value=typeof a!="undefined"?a:!b.ftp_root_path.value&&typeof b.sftp!="undefined"&&b.sftp.checked?xe_root:"/";a=[];a.ftp_user=jQuery("#ftp_user").val();a.ftp_password=jQuery("#ftp_password").val();a.ftp_host=jQuery("#ftp_host").val();a.ftp_port=jQuery("#ftp_port").val();a.ftp_root_path=jQuery("#ftp_root_path").val();exec_xml("admin","getAdminFTPList",a,completeGetFtpInfo,["list","error","message"],a,b)}
function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}
function completeGetFtpInfo(a){if(a.error!=0)alert(a.error),alert(a.message);else{var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]);pwd=jQuery("#ftp_form").get(0).ftp_root_path.value;pwd!="/"&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var e=0;e<a.list.item.length;e++){var d=a.list.item[e];d!="../"&&d!="./"&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+
pwd+d+"')\">"+d+"</button></li>")}b.append(jQuery("<ul>"+c+"</ul>"))}}var icon=null;function deleteIcon(a){var b=[];b.iconname=a;exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b);icon=a}function iconDeleteMessage(a){alert(a.message);a.error=="0"&&(icon=="favicon.ico"?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):icon=="mobicon.png"&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}
function doRecompileCacheFile(){exec_xml("admin","procAdminRecompileCacheFile",[],completeCacheMessage)}function completeCacheMessage(a){alert(a.message)};

View file

@ -0,0 +1,8 @@
jQuery(function(b){function k(a){if(moduleList=a.menuList){var d=b("#menuNameList"),g;for(g in moduleList){var e=moduleList[g],a=b('<optgroup label="'+g+'" />').appendTo(d),c;for(c in e)a.append('<option value="'+g+":"+c+'">'+e[c].title+"</option>")}}}var c,h=b("#editForm"),a=b("#listForm");b("a._add").click(function(){c=b(this).parent().prevAll("._item_key").val();h.find("input[name=parent_srl]").val(c);exec_xml("menu","procMenuAdminAllActList",[],k,["menuList"])});b("a._parent_delete").click(function(){var i=
b(this).parent().prevAll("._parent_key").val();a.find("input[name=menu_item_srl]").val(i);a.submit()});b("a._child_delete").click(function(){var i=b(this).parents("li").find("._item_key").val();a.find("input[name=menu_item_srl]").val(i);a.submit()})});
jQuery(function(b){function k(a,b){for(var d=0,c=0;a&&a!=b;)d+=a.offsetTop,c+=a.offsetLeft,a=a.offsetParent;return{top:d,left:c}}b("form.siteMap").delegate("li:not(.placeholder)","dropped.st",function(){var a=b(this),c;c=a.find(">input._parent_key");a.parent("ul").parent("li").length?c.val(a.parent("ul").parent("li").find(">input._item_key").val()):c.val("0")});var c=!1,h=b('<li class="placeholder">');b("div.adminMenu").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(a){var i,d,g,
e,m,n,j,l,f;if(!(b(a.target).is("a,input,label,textarea")||a.which!=1)){c=!0;d=b(this);n=d.height();m=d.width();g=d.parentsUntil(".siteMap").filter("ul");e=g.eq(-1);e.css("position","relative");i=a.pageY;j=k(this,e.get(0));$clone=d.clone(!0).attr("target",!0);for(a=g.length-1;a;a--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();l=[];e.find("li").each(function(){if(d[0]===this||d.has(this).length)return!0;var a=k(this,e.get(0));l.push({top:a.top,bottom:a.top+32,$item:b(this)})});$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",
opacity:0.6,width:m,height:n,left:j.left,top:j.top,zIndex:100}).appendTo(e.eq(0));h.css({position:"absolute",opacity:0.6,width:m,height:"10px",left:j.left,top:j.top,zIndex:99}).appendTo(e.eq(0));d.css("opacity",0.6);b(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,d,c;f=null;a=j.top-(i-a.pageY);for(b=0,d=l.length;b<d;b++)if(c=l[b],!(c.top>a||c.bottom<a))f={element:c.$item},c.$item.hasClass("parent")?(f.state="prepend",h.css("top",c.bottom-5)):c.top>a-12?(f.state=
"before",h.css("top",c.top-5)):(f.state="after",h.css("top",c.bottom-5));$clone.css({top:a})}).bind("mouseup.st",function(){var a,e;c=!1;b(document).unbind("mousemove.st mouseup.st");d.css("opacity","");$clone.remove();h.remove();e=b("<li />").height(d.height());if(f){a=b(f.element);d.before(e);if(f.state=="prepend")a.find(">ul").length||a.find(">.side").after("<ul>"),a.find(">ul").prepend(d.hide());else a[f.state](d.hide());d.slideDown(100,function(){d.removeClass("active")});e.slideUp(100,function(){var a=
e.parent();e.remove();a.children("li").length||a.remove()});d.trigger("dropped.st")}});return!1}},"mouseover.st":function(){c||b(this).addClass("active");return!1},"mouseout.st":function(){c||b(this).removeClass("active");return!1}}).find("li").prepend('<button type="button" class="moveTo">Move to</button>').filter(".parent").find(">button.moveTo").css({visibility:"hidden","margin-left":"-12px"}).end().end().end();b('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",
opacity:0.7}).appendTo("body")});

View file

@ -0,0 +1,2 @@
[option]
use_closure_compiler=true

6
modules/admin/tpl/js/sitemap.min.js vendored Normal file
View file

@ -0,0 +1,6 @@
jQuery(function(c){function o(a,c){for(var b=0,h=0;a&&a!=c;)b+=a.offsetTop,h+=a.offsetLeft,a=a.offsetParent;return{top:b,left:h}}var l=!1,k=c('<li class="placeholder">');c("form.siteMap").delegate("li:not(.placeholder)",{"mousedown.st":function(a){var d,b,h,g,n,p,i,m,j;if(!(c(a.target).is("a,input,label,textarea")||a.which!=1)){l=!0;b=c(this);p=b.height();n=b.width();h=b.parentsUntil(".siteMap").filter("ul");g=h.eq(-1);g.css("position","relative");d=a.pageY;i=o(this,g.get(0));$clone=b.clone(!0).attr("target",
!0);for(a=h.length-1;a;a--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();m=[];g.find("li").each(function(){if(b[0]===this||b.has(this).length)return!0;var a=o(this,g.get(0));m.push({top:a.top,bottom:a.top+32,item:this})});$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:0.6,width:n,height:p,left:i.left,top:i.top,zIndex:100}).appendTo(g.eq(0));k.css({position:"absolute",opacity:0.6,width:n,height:"5px",left:i.left,top:i.top,zIndex:99}).appendTo(g.eq(0));
b.css("opacity",0.6);c(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f;j=null;a=i.top-(d-a.pageY);for(b=0,c=m.length;b<c;b++){f=a;e=m[b];if(b==0&&f<e.top)f=e.top;if(b==c-1&&f>e.bottom)f=e.bottom;if(e.top<=f&&e.bottom>=f){b=e.item;Math.abs(e.top-f)<=3?(k.css({top:e.top-3,height:"5px"}),f="before"):Math.abs(e.bottom-f)<=3?(k.css({top:e.bottom-3,height:"5px"}),f="after"):(k.css({top:e.top+3,height:"27px"}),f="prepend");j={element:b,state:f};break}}$clone.css({top:a})}).bind("mouseup.st",
function(){var a,d;l=!1;c(document).unbind("mousemove.st mouseup.st");b.css("opacity","");$clone.remove();k.remove();d=c("<li />").height(b.height());if(j){a=c(j.element);b.before(d);if(j.state=="prepend")a.find(">ul").length||a.find(">.side").after("<ul>"),a.find(">ul").prepend(b.hide());else a[j.state](b.hide());b.slideDown(100,function(){b.removeClass("active")});d.slideUp(100,function(){var a=d.parent();d.remove();a.children("li").length||a.remove()});b.trigger("dropped.st")}});return!1}},"mouseover.st":function(){l||
c(this).addClass("active");return!1},"mouseout.st":function(){l||c(this).removeClass("active");return!1}}).find("li").prepend('<button type="button" class="moveTo">Move to</button>').append('<span class="vr"></span><span class="hr"></span>').find("input:text").focus(function(){var a=c(this),d=a.prev("label"),b=a.parent();a.width(b.width()-(parseInt(b.css("text-indent"))||0)-a.next(".side").width()-60).css("opacity","");d.hide()}).blur(function(){var a=c(this),d=a.prev("label"),b=a.val();a.width(0).css("opacity",
0);d.removeClass("no-text").empty().text(b).show();b||d.addClass("no-text").text("---")}).each(function(a){var d=c(this),a="sitemap-id-"+a;d.attr("id",a).css({width:0,opacity:0,overflow:"hidden"}).before("<label />").prev("label").attr("for",a).text(d.val())}).end().end()});

6
modules/admin/tpl/js/theme.min.js vendored Normal file
View file

@ -0,0 +1,6 @@
jQuery(function(c){c("#theme,#skin").find("button.showAll").text("Show All").click(function(){var a=c(this),b=c("#skin").find(">.thumbPreview");a.toggleClass("hideAll").hasClass("hideAll")?(a.text("Hide All"),b.children("li").addClass("active").removeClass("highlight").eq(0).addClass("highlight").end().find(">ul.a:not(.selected)").show()):(a.text("Show All"),b.children("li").removeClass("active highlight").find(">ul.a:not(.selected)").hide())}).end().find(">.thumbPreview").removeClass("jx").find("ul.a").hide().before('<ul class="a selected"></ul>').prev("ul.a").each(function(){var a=
c(this);a.delegate("span.thumb","click",function(){c(this).closest(".a").nextAll("a.prevToggle:first").trigger("toggle.tp");return!1}).append(a.next(".a").find(">li.noDirection:first"))}).end().after('<a href="#toggle-tp" class="prevToggle">Show</a>').next("a.prevToggle").bind("toggle.tp",function(){var a=c(this).prev(".a");a.closest(".thumbPreview").children("li").removeClass("highlight").end();a.parent().toggleClass("active").hasClass("active")?a.slideDown(100).closest("li").addClass("highlight"):
a.slideUp(100)}).click(function(){c(this).trigger("toggle.tp");return!1}).end().find("span.thumb").attr("role","radio").click(function(){c(this).next("input:radio").prop("checked",!0).change()}).end().find("> .i > label").attr("title",function(){return c(this).text()}).end().find("input:radio").bind("redraw",function(){var a=c(this),b=a.closest(".a").prev(".a"),e=a.val();e!=b.find(">li:eq(1)").data("value")&&(b.find(">li:not(.noDirection)").remove(),e?(a.closest("li").clone().find("input:radio").remove().end().find("label").wrapInner("<strong>").find(">strong").text(function(){return c(this).attr("title")}).unwrap().end().end().appendTo(b),
b.find(">li.noDirection").hide()):b.children("li.noDirection").show())}).change(function(){var a=c(this);a.trigger("redraw");a.attr("name")!="themeItem"&&c("#theme").trigger("select-theme")}).filter(":checked").change().end().filter('[name="themeItem"]').change(function(){var a=c(this),b,e;if(a=(c("#theme").data("themes")||{})[a.val()]){b=c("#skin").find(".i > input:radio").filter('[value=""]').prop("checked",!0).end();for(var d in a)a.hasOwnProperty(d)&&(e=d=="layout"?d:d+"-skin",a[d]&&b.filter('[name="'+
e+'"][value="'+a[d]+'"]').prop("checked",!0));b.filter(":checked").trigger("redraw")}}).end();c("#theme").bind("select-theme",function(){function a(a){var c="",b;for(b in a)if(a.hasOwnProperty(b)&&(b=="layout"||i.elements[b+"-skin"]))c+=b+"\t"+a[b]+"\n";return c}var b=c(this),e,d,i,f,j={};e=b.data("themes")||{};d=c("#skin").find(".i > input:radio");f=d.filter(':checked[value!=""]').get();i=d.get(0).form;for(var g=0,k=f.length;g<k;g++)d=f[g].name.match(/^layout|(\w+)-skin$/),j[d[1]||d[0]]=f[g].value;
f=a(j);for(var h in e)if(e.hasOwnProperty(h)&&f==a(e[h])){b.find('input:radio[name="themeItem"][value="'+h+'"]').prop("checked",!0).change();return}b.find('input:radio[name="themeItem"][value="user_define"]').prop("checked",!0).change()})});