diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 21edddb8b..75c50fb86 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -1570,18 +1570,23 @@ jQuery(function($){ }); // load value - $displayInput.val($hiddenInput.val()); - var pattern = /^\$user_lang->/; - if(pattern.test($displayInput.val())){ - function on_complete2(data){ - if(!data || !data.langs) return; + function loadValue(){ + $displayInput.val($hiddenInput.val()); + var pattern = /^\$user_lang->/; + if(pattern.test($displayInput.val())){ + function on_complete2(data){ + if(!data || !data.langs) return; - $displayInput.closest('.g11n').addClass('active'); - $displayInput.val(data.langs[xe.current_lang]).attr('disabled', 'disabled').width(135); + $displayInput.closest('.g11n').addClass('active'); + $displayInput.val(data.langs[xe.current_lang]).attr('disabled', 'disabled').width(135); + } + + $.exec_json('module.getModuleAdminLangCode', {'name': $displayInput.val().replace('$user_lang->', '')}, on_complete2); } - - $.exec_json('module.getModuleAdminLangCode', {'name': $displayInput.val().replace('$user_lang->', '')}, on_complete2); } + + $this.bind('reload-multilingual', loadValue); + loadValue(); } if($('#g11n').length){ diff --git a/modules/admin/tpl/js/admin.min.js b/modules/admin/tpl/js/admin.min.js index 6afedd5d5..bbec744d4 100644 --- a/modules/admin/tpl/js/admin.min.js +++ b/modules/admin/tpl/js/admin.min.js @@ -3,8 +3,8 @@ function doUpdateModule(a){var e=[];e.module_name=a;exec_xml("install","procInst jQuery(function(a){window.scrollTo(0,0);a(".x .skipNav>a").click(function(){a(a(this).attr("href")).attr("tabindex","0").css("outline","0").focus()});a(document.body).on("click",".x [data-toggle]",function(){var b=a(this),d=a(b.attr("data-toggle"));d.toggle();d.is(":visible")&&!d.find("a,input,button,textarea,select").length?d.attr("tabindex","0").not(":disabled").focus():d.is(":visible")&&d.find("a,input,button,textarea,select").length?d.find("a,input,button,textarea,select").not(":disabled").eq(0).focus(): b.focus();return!1});a(document.body).on("click",".x [data-show]",function(){a(a(this).attr("data-show")).show().attr("tabindex","0").focus();return!1});a(document.body).on("click",".x [data-hide]",function(){var b=a(this);a(b.attr("data-hide")).hide();b.focus();return!1});a.fn.xeTabbable=function(){a(this).each(function(){var b=a(this);b.find(">.x_nav-tabs>li>a").each(function(b){a(this).attr("data-index",b+1)});b.find(">.x_tab-content>.x_tab-pane").each(function(b){a(this).attr("data-index",b+1)})}); a('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide()};a(".x .x_tabbable").xeTabbable();a(document.body).on("click",'.x .x_nav-tabs>li>a[href*="#"]',function(){var b=a(this);b.parent("li").addClass("x_active").siblings().removeClass("x_active");b.closest(".x_nav-tabs").next(".x_tab-content").find(">.x_tab-pane").eq(b.attr("data-index")-1).addClass("x_active").show().siblings().removeClass("x_active").hide();a(this).parents(".x_tabbable").trigger("tab_change",[parseInt(a(this).attr("data-index"))- -1,a(this)]);return!1});a.fn.gnb=function(){function b(){e.width("99.99%");setTimeout(function(){e.removeAttr("style");g.height()>e.height()&&e.height(g.height())},100)}var d=a(".x>.xin>.body"),e=d.children("#content.content"),g=d.find(">.gnb"),f=g.find(">ul>li");f.find("a").prepend("");f.each(function(b){a(this).attr("data-index",b+1)});var k=f.find(">ul>li.active_").closest("li.active").attr("data-index");f.find(">ul>li.active_").clone().addClass("active").attr("data-index",k).prependTo("#gnbNav"); -f.find("ul").prev("a").bind("click focus",function(){a(this).parent("li").addClass("open").siblings("li").removeClass("open");d.removeClass("wide");b();return!1});g.find('>a[href="#gnbNav"]').click(function(){a(this).parent(".gnb").toggleClass("open");d.toggleClass("wide");b();return!1});g.prepend('').append('');g.find(">.close").focus(function(){d.addClass("wide");b()})};a(".gnb").gnb();a(".x #lang").mouseleave(function(){a(this).hide()}).focusout(function(){var b= +1,a(this)]);return!1});a.fn.gnb=function(){function b(){e.width("99.99%");setTimeout(function(){e.removeAttr("style");f.height()>e.height()&&e.height(f.height())},100)}var d=a(".x>.xin>.body"),e=d.children("#content.content"),f=d.find(">.gnb"),g=f.find(">ul>li");g.find("a").prepend("");g.each(function(b){a(this).attr("data-index",b+1)});var k=g.find(">ul>li.active_").closest("li.active").attr("data-index");g.find(">ul>li.active_").clone().addClass("active").attr("data-index",k).prependTo("#gnbNav"); +g.find("ul").prev("a").bind("click focus",function(){a(this).parent("li").addClass("open").siblings("li").removeClass("open");d.removeClass("wide");b();return!1});f.find('>a[href="#gnbNav"]').click(function(){a(this).parent(".gnb").toggleClass("open");d.toggleClass("wide");b();return!1});f.prepend('').append('');f.find(">.close").focus(function(){d.addClass("wide");b()})};a(".gnb").gnb();a(".x #lang").mouseleave(function(){a(this).hide()}).focusout(function(){var b= a(this);setTimeout(function(){b.find("a:focus").length||b.mouseleave()},0)});a('.x th>input[type="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(document.body).on("click",".x .x_pagination .x_disabled, .x .x_pagination .x_active",function(){return!1}); var e=a(".x .section").find(">h1:first");e.append('');a(".x .section.collapse>h1>.snToggle").removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down");e.find(">.snToggle").click(function(){var b=a(this),d=b.closest(".section");d.hasClass("collapse")?(d.removeClass("collapse").children("h1:first").siblings().show(),b.removeClass("x_icon-chevron-down").addClass("x_icon-chevron-up")):(d.addClass("collapse").children("h1:first").siblings().hide(), b.removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down"));reflow()});e=a(".x .x_alert");e.prepend('');e.children(".x_close").click(function(){a(this).parent(".x_alert").hide()});a(".x .x_btn").click(function(){if(a(this).hasClass("x_disabled"))return!1});a.fn.vr=function(){this.each(function(){var b=a(this);"|"==b.text()&&b.addClass("vr").filter(":first-child, :last-child").remove()})};a(".x i").vr();a.fn.labelMaker=function(){this.each(function(b){var b= @@ -17,42 +17,42 @@ jQuery(function(a){a.fn.xeModalWindow=function(){this.not(".xe-modal-window").ad a("body").append('
').append(b),b.prepend(d));b.data("anchor",e);d=a.Event("before-open.mw");e.trigger(d);if(d.isDefaultPrevented())return!1;b=a(e.attr("href"));d=e.data("duration")||"fast";b.data("state","showing");a(document).bind("keydown.mw",function(a){if(27==a.which)return e.trigger("close.mw"),!1});b.fadeIn(d,function(){e.trigger("after-open.mw")}).find("button.x_close:first").focus().end().prev(".x_modal-backdrop").show();a("body").css("overflow","hidden")}).bind("close.mw", function(){var e=a(this),b,d;b=a.Event("before-close.mw");e.trigger(b);if(b.isDefaultPrevented())return!1;b=a(e.attr("href"));d=e.data("duration")||"fast";b.data("state","hiding");b.fadeOut(d,function(){e.trigger("after-close.mw")}).prev(".x_modal-backdrop").hide();a("body").css("overflow","auto");e.focus()});a("div.x_modal").addClass("x").hide()};a("a.modalAnchor").xeModalWindow()}); jQuery(function(a){var e=!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(){e=!0}).focusout(function(){setTimeout(function(){!e&&(!$layer.find(":focus").length&&"showing"==$layer.data("state"))&&b.trigger("close.tc");e=!1},1)})}).click(function(){var b=a(this),d;d=a(b.attr("href"));d.data("anchor",b);"showing"== -d.data("state")?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),h,g,f;h=a(d.attr("href"));g=d.data("effect");f=d.data("duration")||"fast";h.data("state","showing");d.trigger("before-open.tc");e=!1;a(document).unbind("mousedown.tc keydown.tc").bind("mousedown.tc keydown.tc",function(b){if(b&&("keydown"==b.type&&27!=b.which||"mousedown"==b.type&&(b=a(b.target),b.is("html,.tgAnchor,.tgContent")||h.has(b).length)))return!0; -d.trigger("close.tc");return!1});switch(g){case "slide":h.slideDown(f,b);break;case "slide-h":g=h.css({"overflow-x":"",width:""}).width();h.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:g},f,function(){h.css({"overflow-x":"",width:""});b()});break;case "fade":h.fadeIn(f,b);break;default:h.show(),d.trigger("after-open.tc")}}).bind("close.tc",function(){function b(){d.trigger("after-close.tc")}var d=a(this),e,g,f;a(document).unbind("mousedown.tc keydown.tc");e=a(d.attr("href"));g=d.data("effect"); -f=d.data("duration")||"fast";e.data("state","hiding");d.trigger("before-close.tc");switch(g){case "slide":e.slideUp(f,b);break;case "slide-h":e.animate({width:0},f,function(){e.hide();b()});break;case "fade":e.fadeOut(f,b);break;default:e.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 e,b,d;e=a(this);b=a(e.attr("href")).find(">ul");d=e.prev("input:text").val();a.exec_json("admin.getSiteAllList",{domain:d},function(d){var g=d.site_list,f,k;b.empty();e.closest(".modulefinder").find(".moduleList,.moduleIdList").attr("disabled","disabled");if(d.error||!a.isArray(g))e.trigger("close.tc");else{f=0;for(k=g.length;f< -k;f++)d=a("").appendTo(b),a('').text(g[f].domain).data("site_srl",g[f].site_srl).appendTo(d)}})}).end().find(".tgContent.suggestion").delegate("button","click",function(){var e,b;e=a(this);b=e.closest(".modulefinder");b.find("a.tgAnchor.findsite").trigger("close.tc");a.exec_json("module.procModuleAdminGetList",{site_srl:e.data("site_srl")},function(d){var e=d.module_list,g;if(!d.error&&e){d=b.find(".moduleList").data("module_list",e).removeAttr("disabled").empty();for(g in e)e.hasOwnProperty(g)&& -a("").attr("value",g).text(e[g].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 e,b,d;e=a(this);b=e.val();d=e.data("module_list");if(d[b]){d=d[b].list;e=e.closest(".modulefinder").find(".moduleIdList").removeAttr("disabled").empty();for(var h in d)d.hasOwnProperty(h)&& +d.data("state")?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),h,f,g;h=a(d.attr("href"));f=d.data("effect");g=d.data("duration")||"fast";h.data("state","showing");d.trigger("before-open.tc");e=!1;a(document).unbind("mousedown.tc keydown.tc").bind("mousedown.tc keydown.tc",function(b){if(b&&("keydown"==b.type&&27!=b.which||"mousedown"==b.type&&(b=a(b.target),b.is("html,.tgAnchor,.tgContent")||h.has(b).length)))return!0; +d.trigger("close.tc");return!1});switch(f){case "slide":h.slideDown(g,b);break;case "slide-h":f=h.css({"overflow-x":"",width:""}).width();h.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:f},g,function(){h.css({"overflow-x":"",width:""});b()});break;case "fade":h.fadeIn(g,b);break;default:h.show(),d.trigger("after-open.tc")}}).bind("close.tc",function(){function b(){d.trigger("after-close.tc")}var d=a(this),e,f,g;a(document).unbind("mousedown.tc keydown.tc");e=a(d.attr("href"));f=d.data("effect"); +g=d.data("duration")||"fast";e.data("state","hiding");d.trigger("before-close.tc");switch(f){case "slide":e.slideUp(g,b);break;case "slide-h":e.animate({width:0},g,function(){e.hide();b()});break;case "fade":e.fadeOut(g,b);break;default:e.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 e,b,d;e=a(this);b=a(e.attr("href")).find(">ul");d=e.prev("input:text").val();a.exec_json("admin.getSiteAllList",{domain:d},function(d){var f=d.site_list,g,k;b.empty();e.closest(".modulefinder").find(".moduleList,.moduleIdList").attr("disabled","disabled");if(d.error||!a.isArray(f))e.trigger("close.tc");else{g=0;for(k=f.length;g< +k;g++)d=a("").appendTo(b),a('').text(f[g].domain).data("site_srl",f[g].site_srl).appendTo(d)}})}).end().find(".tgContent.suggestion").delegate("button","click",function(){var e,b;e=a(this);b=e.closest(".modulefinder");b.find("a.tgAnchor.findsite").trigger("close.tc");a.exec_json("module.procModuleAdminGetList",{site_srl:e.data("site_srl")},function(d){var e=d.module_list,f;if(!d.error&&e){d=b.find(".moduleList").data("module_list",e).removeAttr("disabled").empty();for(f in e)e.hasOwnProperty(f)&& +a("").attr("value",f).text(e[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 e,b,d;e=a(this);b=e.val();d=e.data("module_list");if(d[b]){d=d[b].list;e=e.closest(".modulefinder").find(".moduleIdList").removeAttr("disabled").empty();for(var h in d)d.hasOwnProperty(h)&& a("").attr("value",d[h].module_srl).text(d[h].browser_title).appendTo(e);e.prop("selectedIndex",0).change()}});return this};a(".modulefinder").xeModuleFinder()}); -jQuery(function(a){var e=0;_xeModuleSearch=function(){var b=this,d=a(this),h=d.data("multiple");h||(h="");var g="__module_searcher_"+e;e++;a.exec_json("module.getModuleAdminModuleSearcherHtml",{id:g,is_multiple:h},function(e){function h(a,b){var d;a.find("li div").width("");a.css("height","auto");a.css("overflow-y","");a.height()>b&&(d=a.find("li div"),d.width(d.width()-20+"px"),a.css("height",b+"px"),a.css("overflow-y","auto"))}function j(b){var d,e=RegExp(b,"ig"),f=u;m.empty();i=0;for(c=f.length;i< -c;i++){d=f[i].domain;if(b){if(!d.match(e))continue;d=d.replace(e,function(a){return''+a+""})}$li=a("").appendTo(m);a("").attr("href","#").html(d).data("site_srl",f[i].site_srl).appendTo($li)}h(m,t-q.parent("div").height())}if(e&&e.html){d.after(e.html).addClass("tgAnchor").attr("href","#"+g).xeContentToggler();var l=d.next(".moduleWindow"),e=l.find(".siteList"),n=l.find(".moduleList"),p=l.find(".instanceList"),m=e.find(">ul"),s=n.find(">ul"),r=p.find(">select"), -q=l.find("input.siteFinder"),u,t=280;q.keyup(function(){j(q.val())});"undefined"==typeof console&&(console={log:function(){}});d.not(".xe-module-search").addClass("xe-module-search").parent().find("a.moduleTrigger").bind("before-open.tc",function(){var b;b=a(this);m.empty();r.empty();n.hide();p.hide();a.exec_json("admin.getSiteAllList",{domain:""},function(d){var e=d.site_list;d.error||!a.isArray(e)?b.trigger("close.tc"):(u=e,j(q.val()),q.focus())})});l.find(".siteList>ul").delegate("a","click",function(b){var d; -d=a(this);d.closest(".moduleSearch");s.empty();p.hide();a.exec_json("module.procModuleAdminGetList",{site_srl:d.data("site_srl")},function(b){var e=b.module_list,f;if(!b.error&&e){for(f in e)e.hasOwnProperty(f)&&($li=a("").appendTo(s),a("").attr("href","#").html(e[f].title).data("moduleInstanceList",e[f].list).appendTo($li));l.find(".moduleList").show();h(s,t);m.find("li").removeClass("x_active");d.parent("li").addClass("x_active")}});b.preventDefault()}).end().find(".moduleList>ul").delegate("a", +jQuery(function(a){var e=0;_xeModuleSearch=function(){var b=this,d=a(this),h=d.data("multiple");h||(h="");var f="__module_searcher_"+e;e++;a.exec_json("module.getModuleAdminModuleSearcherHtml",{id:f,is_multiple:h},function(e){function h(a,b){var d;a.find("li div").width("");a.css("height","auto");a.css("overflow-y","");a.height()>b&&(d=a.find("li div"),d.width(d.width()-20+"px"),a.css("height",b+"px"),a.css("overflow-y","auto"))}function j(b){var d,e=RegExp(b,"ig"),f=u;n.empty();i=0;for(c=f.length;i< +c;i++){d=f[i].domain;if(b){if(!d.match(e))continue;d=d.replace(e,function(a){return''+a+""})}$li=a("").appendTo(n);a("").attr("href","#").html(d).data("site_srl",f[i].site_srl).appendTo($li)}h(n,t-q.parent("div").height())}if(e&&e.html){d.after(e.html).addClass("tgAnchor").attr("href","#"+f).xeContentToggler();var l=d.next(".moduleWindow"),e=l.find(".siteList"),m=l.find(".moduleList"),p=l.find(".instanceList"),n=e.find(">ul"),s=m.find(">ul"),r=p.find(">select"), +q=l.find("input.siteFinder"),u,t=280;q.keyup(function(){j(q.val())});"undefined"==typeof console&&(console={log:function(){}});d.not(".xe-module-search").addClass("xe-module-search").parent().find("a.moduleTrigger").bind("before-open.tc",function(){var b;b=a(this);n.empty();r.empty();m.hide();p.hide();a.exec_json("admin.getSiteAllList",{domain:""},function(d){var e=d.site_list;d.error||!a.isArray(e)?b.trigger("close.tc"):(u=e,j(q.val()),q.focus())})});l.find(".siteList>ul").delegate("a","click",function(b){var d; +d=a(this);d.closest(".moduleSearch");s.empty();p.hide();a.exec_json("module.procModuleAdminGetList",{site_srl:d.data("site_srl")},function(b){var e=b.module_list,f;if(!b.error&&e){for(f in e)e.hasOwnProperty(f)&&($li=a("").appendTo(s),a("").attr("href","#").html(e[f].title).data("moduleInstanceList",e[f].list).appendTo($li));l.find(".moduleList").show();h(s,t);n.find("li").removeClass("x_active");d.parent("li").addClass("x_active")}});b.preventDefault()}).end().find(".moduleList>ul").delegate("a", "click",function(d){var e,f;e=a(this);if(f=e.data("moduleInstanceList")){b.sSelectedModuleType=e.text();r.empty();for(var g in f)f.hasOwnProperty(g)&&($li=a("").html(f[g].browser_title+" ("+f[g].mid+")").appendTo(r).val(f[g].module_srl).data("mid",f[g].mid).data("module_srl",f[g].module_srl).data("layout_srl",f[g].layout_srl).data("browser_title",f[g].browser_title));p.show();h(r,t);s.find("li").removeClass("x_active");e.parent("li").addClass("x_active");d.preventDefault()}}).end().find(".moduleSearch_ok").click(function(e){var f= [];r.find("option:selected").each(function(){f.push({type:b.sSelectedModuleType,module_srl:a(this).data("module_srl"),layout_srl:a(this).data("layout_srl"),browser_title:a(this).data("browser_title"),mid:a(this).data("mid")})});d.trigger("moduleSelect",[f]);a("a.moduleTrigger").trigger("close.tc");e.preventDefault()})}});return this};a.fn.xeModuleSearch=function(){a(this).each(_xeModuleSearch)};a(".moduleTrigger").xeModuleSearch();a.fn.xeModuleSearchHtml=function(){var b=0;a(this).each(function(){var d= -a(this),e=d.attr("id");e||(e="__module_search_"+b);b++;var e=a(''+xe.cmd_find+""),g=a('');d.after(e).after(" ").after(g).hide();e.xeModuleSearch();e.bind("moduleSelect",function(a,b){g.val(b[0].browser_title+" ("+b[0].mid+")");d.val(b[0].module_srl)});d.val()&&a.exec_json("module.getModuleAdminModuleInfo",{module_srl:d.val()},function(a){a&&a.module_info&&g.val(a.module_info.browser_title+" ("+a.module_info.mid+")")})});return this}; +a(this),e=d.attr("id");e||(e="__module_search_"+b);b++;var e=a(''+xe.cmd_find+""),f=a('');d.after(e).after(" ").after(f).hide();e.xeModuleSearch();e.bind("moduleSelect",function(a,b){f.val(b[0].browser_title+" ("+b[0].mid+")");d.val(b[0].module_srl)});d.val()&&a.exec_json("module.getModuleAdminModuleInfo",{module_srl:d.val()},function(a){a&&a.module_info&&f.val(a.module_info.browser_title+" ("+a.module_info.mid+")")})});return this}; a(".module_search").xeModuleSearchHtml()}); -jQuery(function(a){var e=a('