mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-18 10:49:54 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11729 201d5d3c-b55e-5fd7-737f-ddc643e51545
47 lines
22 KiB
JavaScript
47 lines
22 KiB
JavaScript
jQuery(function(b){function f(){a.width("99.99%");setTimeout(function(){a.removeAttr("style");d.height()>a.height()&&a.height(d.height())},100)}window.scrollTo(0,0);b(".x .skipNav>a").click(function(){b(b(this).attr("href")).attr("tabindex","0").css("outline","0").focus()});b(document.body).on("click",".x [data-toggle]",function(){var a=b(this),d=b(a.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():a.focus();return!1});b(document.body).on("click",".x [data-show]",function(){b(b(this).attr("data-show")).show().attr("tabindex","0").focus();return!1});b(document.body).on("click",".x [data-hide]",function(){var a=b(this);b(a.attr("data-hide")).hide();a.focus();return!1});b.fn.xeTabbable=function(){b(this).each(function(){var a=b(this);a.find(">.x_nav-tabs>li>a").each(function(a){b(this).attr("data-index",
|
|
a+1)});a.find(">.x_tab-content>.x_tab-pane").each(function(a){b(this).attr("data-index",a+1)})});b('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide()};b(".x .x_tabbable").xeTabbable();b(document.body).on("click",'.x .x_nav-tabs>li>a[href*="#"]',function(){var a=b(this);a.parent("li").addClass("x_active").siblings().removeClass("x_active");a.closest(".x_nav-tabs").next(".x_tab-content").find(">.x_tab-pane").eq(a.attr("data-index")-1).addClass("x_active").show().siblings().removeClass("x_active").hide();
|
|
return!1});var e=b(".x>.body"),a=e.children("#content.content"),d=e.find(">.gnb"),g=d.find(">ul>li");g.find("a").prepend("<i />");g.find(">ul>li.active_").clone().addClass("active").prependTo("#gnbNav");g.find("ul").prev("a").bind("click focus",function(){b(this).parent("li").addClass("open").siblings("li").removeClass("open");e.removeClass("wide");f();return!1});d.find('>a[href="#gnbNav"]').click(function(){b(this).parent(".gnb").toggleClass("open");e.toggleClass("wide");f();return!1});d.prepend('<button type="button" class="close before" />').append('<button type="button" class="close after" />');
|
|
d.find(">.close").focus(function(){e.addClass("wide");f()});b('.x th>input[type="checkbox"]').change(function(){var a=b(this),d=a.data("name");a.closest("table").find("input:checkbox").filter(function(){var a=b(this);return!a.prop("disabled")&&(a.attr("name")==d||a.data("name")==d)}).prop("checked",a.prop("checked")).end().end().trigger("update.checkbox",[d,this.checked])});b(document.body).on("click",".x .x_pagination .x_disabled, .x .x_pagination .x_active",function(){return!1});b(".x .section>h1").append('<button type="button" class="snToggle x_icon-chevron-up">Toggle this section</button>');
|
|
b(".x .section>h1>.snToggle").click(function(){var a=b(this),d=a.closest(".section");d.hasClass("collapse")?(d.removeClass("collapse").children("h1:first").siblings().show(),a.removeClass("x_icon-chevron-down").addClass("x_icon-chevron-up")):(d.addClass("collapse").children("h1:first").siblings().hide(),a.removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down"));f()});g=b(".x .x_alert");g.prepend('<button type="button" class="x_close">×</button>');g.children(".x_close").click(function(){b(this).parent(".x_alert").hide()});
|
|
b(".x .x_btn").click(function(){if(b(this).hasClass("x_disabled"))return!1});b(".x i").each(function(){var a=b(this);"|"==a.text()&&a.addClass("vr")})});
|
|
jQuery(function(b){b.fn.xeModalWindow=function(){this.not(".xe-modal-window").addClass("xe-modal-window").each(function(){b(b(this).attr("href")).addClass("x").hide()}).click(function(){var f=b(this);"showing"==b(f.attr("href")).data("state")?f.trigger("close.mw"):f.trigger("open.mw");return!1}).bind("open.mw",function(){var f=b(this),e,a;e=b(f.attr("href"));e.parent("body").length||(a=b('<button type="button" class="x_close">×</button>'),a.click(function(){e.data("anchor").trigger("close.mw")}),
|
|
e.find("[data-hide]").click(function(){e.data("anchor").trigger("close.mw")}),b("body").append('<div class="x_modal-backdrop"></div>').append(e),e.prepend(a));e.data("anchor",f);a=b.Event("before-open.mw");f.trigger(a);if(a.isDefaultPrevented())return!1;e=b(f.attr("href"));a=f.data("duration")||"fast";e.data("state","showing");b(document).bind("keydown.mw",function(a){if(27==a.which)return f.trigger("close.mw"),!1});e.fadeIn(a,function(){f.trigger("after-open.mw")}).find("button.x_close:first").focus().end().prev(".x_modal-backdrop").show()}).bind("close.mw",
|
|
function(){var f=b(this),e,a;e=b.Event("before-close.mw");f.trigger(e);if(e.isDefaultPrevented())return!1;e=b(f.attr("href"));a=f.data("duration")||"fast";e.data("state","hiding");e.fadeOut(a,function(){f.trigger("after-close.mw")}).prev(".x_modal-backdrop").hide();f.focus()});b("div.x_modal").addClass("x").hide()};b("a.modalAnchor").xeModalWindow()});
|
|
jQuery(function(b){var f=!1;b.fn.xeContentToggler=function(){this.not(".xe-content-toggler").addClass("xe-content-toggler").each(function(){var e=b(this);$layer=b(e.attr("href"));$layer.hide().not(".xe-toggling-content").addClass("xe-toggling-content").mousedown(function(){f=!0}).focusout(function(){setTimeout(function(){!f&&(!$layer.find(":focus").length&&"showing"==$layer.data("state"))&&e.trigger("close.tc");f=!1},1)})}).click(function(){var e=b(this),a;a=b(e.attr("href"));a.data("anchor",e);"showing"==
|
|
a.data("state")?e.trigger("close.tc"):e.trigger("open.tc");return!1}).bind("open.tc",function(){function e(){a.trigger("after-open.tc")}var a=b(this),d,g,n;d=b(a.attr("href"));g=a.data("effect");n=a.data("duration")||"fast";d.data("state","showing");a.trigger("before-open.tc");f=!1;b(document).unbind("mousedown.tc keydown.tc").bind("mousedown.tc keydown.tc",function(e){if(e&&("keydown"==e.type&&27!=e.which||"mousedown"==e.type&&(e=b(e.target),e.is("html,.tgAnchor,.tgContent")||d.has(e).length)))return!0;
|
|
a.trigger("close.tc");return!1});switch(g){case "slide":d.slideDown(n,e);break;case "slide-h":g=d.css({"overflow-x":"",width:""}).width();d.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:g},n,function(){d.css({"overflow-x":"",width:""});e()});break;case "fade":d.fadeIn(n,e);break;default:d.show(),a.trigger("after-open.tc")}}).bind("close.tc",function(){function e(){a.trigger("after-close.tc")}var a=b(this),d,g,f;b(document).unbind("mousedown.tc keydown.tc");d=b(a.attr("href"));g=a.data("effect");
|
|
f=a.data("duration")||"fast";d.data("state","hiding");a.trigger("before-close.tc");switch(g){case "slide":d.slideUp(f,e);break;case "slide-h":d.animate({width:0},f,function(){d.hide();e()});break;case "fade":d.fadeOut(f,e);break;default:d.hide(),a.trigger("after-close.tc")}});return this};b("a.tgAnchor").xeContentToggler()});
|
|
jQuery(function(b){b.fn.xeModuleFinder=function(){this.not(".xe-module-finder").addClass("xe-module-finder").find("a.tgAnchor.findsite").bind("before-open.tc",function(){var f,e,a;f=b(this);e=b(f.attr("href")).find(">ul");a=f.prev("input:text").val();b.exec_json("admin.getSiteAllList",{domain:a},function(a){var g=a.site_list,n,k;e.empty();f.closest(".modulefinder").find(".moduleList,.moduleIdList").attr("disabled","disabled");if(a.error||!b.isArray(g))f.trigger("close.tc");else{n=0;for(k=g.length;n<
|
|
k;n++)a=b("<li />").appendTo(e),b('<button type="button" />').text(g[n].domain).data("site_srl",g[n].site_srl).appendTo(a)}})}).end().find(".tgContent.suggestion").delegate("button","click",function(){var f,e;f=b(this);e=f.closest(".modulefinder");e.find("a.tgAnchor.findsite").trigger("close.tc");b.exec_json("module.procModuleAdminGetList",{site_srl:f.data("site_srl")},function(a){var d=a.module_list,f;if(!a.error&&d){a=e.find(".moduleList").data("module_list",d).removeAttr("disabled").empty();for(f in d)d.hasOwnProperty(f)&&
|
|
b("<option />").attr("value",f).text(d[f].title).appendTo(a);a.prop("selectedIndex",0).change().focus();a.is(":visible")||a.slideDown(100,function(){e.find(".moduleIdList:not(:visible)").slideDown(100).trigger("show")}).trigger("show")}})}).end().find(".moduleList,.moduleIdList").hide().end().find(".moduleList").change(function(){var f,e,a;f=b(this);e=f.val();a=f.data("module_list");if(a[e]){a=a[e].list;f=f.closest(".modulefinder").find(".moduleIdList").removeAttr("disabled").empty();for(var d in a)a.hasOwnProperty(d)&&
|
|
b("<option />").attr("value",a[d].module_srl).text(a[d].browser_title).appendTo(f);f.prop("selectedIndex",0).change()}});return this};b(".modulefinder").xeModuleFinder()});
|
|
jQuery(function(b){var f=0;_xeModuleSearch=function(){var e=this,a=b(this),d=a.data("multiple");d||(d="");var g="__module_searcher_"+f;f++;b.exec_json("module.getModuleAdminModuleSearcherHtml",{id:g,is_multiple:d},function(d){function f(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 m(a){var d,e=RegExp(a,"ig"),g=u;p.empty();i=0;for(c=g.length;i<
|
|
c;i++){d=g[i].domain;if(a){if(!d.match(e))continue;d=d.replace(e,function(a){return'<span class="highlight">'+a+"</span>"})}$li=b("<li />").appendTo(p);b("<a>").attr("href","#").html(d).data("site_srl",g[i].site_srl).appendTo($li)}f(p,t-r.parent("div").height())}if(d&&d.html){a.after(d.html).addClass("tgAnchor").attr("href","#"+g).xeContentToggler();var j=a.next(".moduleWindow"),d=j.find(".siteList"),h=j.find(".moduleList"),l=j.find(".instanceList"),p=d.find(">ul"),q=h.find(">ul"),s=l.find(">select"),
|
|
r=j.find("input.siteFinder"),u,t=280;r.keyup(function(){m(r.val())});"undefined"==typeof console&&(console={log:function(){}});a.not(".xe-module-search").addClass("xe-module-search").parent().find("a.moduleTrigger").bind("before-open.tc",function(){var a;a=b(this);p.empty();s.empty();h.hide();l.hide();b.exec_json("admin.getSiteAllList",{domain:""},function(d){var e=d.site_list;d.error||!b.isArray(e)?a.trigger("close.tc"):(u=e,m(r.val()),r.focus())})});j.find(".siteList>ul").delegate("a","click",function(a){var d;
|
|
d=b(this);d.closest(".moduleSearch");q.empty();l.hide();b.exec_json("module.procModuleAdminGetList",{site_srl:d.data("site_srl")},function(a){var e=a.module_list,g;if(!a.error&&e){for(g in e)e.hasOwnProperty(g)&&($li=b("<li />").appendTo(q),b("<a>").attr("href","#").html(e[g].title).data("moduleInstanceList",e[g].list).appendTo($li));j.find(".moduleList").show();f(q,t);p.find("li").removeClass("x_active");d.parent("li").addClass("x_active")}});a.preventDefault()}).end().find(".moduleList>ul").delegate("a",
|
|
"click",function(a){var d,g;d=b(this);if(g=d.data("moduleInstanceList")){e.sSelectedModuleType=d.text();s.empty();for(var p in g)g.hasOwnProperty(p)&&($li=b("<option />").html(g[p].browser_title+" ("+g[p].mid+")").appendTo(s).val(g[p].module_srl).data("mid",g[p].mid).data("module_srl",g[p].module_srl).data("layout_srl",g[p].layout_srl).data("browser_title",g[p].browser_title));l.show();f(s,t);q.find("li").removeClass("x_active");d.parent("li").addClass("x_active");a.preventDefault()}}).end().find(".moduleSearch_ok").click(function(d){var g=
|
|
[];s.find("option:selected").each(function(){g.push({type:e.sSelectedModuleType,module_srl:b(this).data("module_srl"),layout_srl:b(this).data("layout_srl"),browser_title:b(this).data("browser_title"),mid:b(this).data("mid")})});a.trigger("moduleSelect",[g]);b("a.moduleTrigger").trigger("close.tc");d.preventDefault()})}});return this};b.fn.xeModuleSearch=function(){b(this).each(_xeModuleSearch)};b(".moduleTrigger").xeModuleSearch();b.fn.xeModuleSearchHtml=function(){var e=0;b(this).each(function(){var a=
|
|
b(this),d=a.attr("id");d||(d="__module_search_"+e);e++;var d=b('<a class="x_btn moduleTrigger">'+xe.cmd_find+"</a>"),g=b('<input type="text" readonly>');a.after(d).after(" ").after(g).hide();d.xeModuleSearch();d.bind("moduleSelect",function(b,d){g.val(d[0].browser_title+" ("+d[0].mid+")");a.val(d[0].module_srl)});a.val()&&b.exec_json("module.getModuleAdminModuleInfo",{module_srl:a.val()},function(a){a&&a.module_info&&g.val(a.module_info.browser_title+" ("+a.module_info.mid+")")})});return this};
|
|
b(".module_search").xeModuleSearchHtml()});
|
|
jQuery(function(b){function f(a,b){for(var e=0,f=0;a&&a!=b;)e+=a.offsetTop,f+=a.offsetLeft,a=a.offsetParent;return{top:e,left:f}}var e=b('<tr class="placeholder"><td> </td></tr>');b.fn.xeSortableTable=function(){this.not(".xe-sortable-table").addClass("xe-sortable-table").delegate("button.dragBtn","mousedown.st",function(a){var d,g,n,k,m,j,h,l,p,q;if(1==a.which){g=b(this);n=g.closest("tr");k=g.closest("table");q=k.get(0).offsetParent;g=n.height();m=n.width();before_event=b.Event("before-drag.st");
|
|
k.trigger(before_event);if(before_event.isDefaultPrevented())return!1;d=a.pageY;j=f(n.get(0),q);$clone=n.attr("target",!0).clone(!0).appendTo(k);p=(a=k.find("thead th")).length;a.filter("[colspan]").attr("colspan",function(a,b){p+=b-1});e.find("td").attr("colspan",p);h=[];k.find("tbody>tr:not([target],.sticky,:hidden)").each(function(){var a=b(this),d;d=f(this,q);h.push({top:d.top,bottom:d.top+a.height(),$item:a})});$clone.addClass("draggable").css({position:"absolute",opacity:0.6,width:m,height:g,
|
|
left:j.left,top:j.top,zIndex:100});e.css({position:"absolute",opacity:0.6,width:m,height:"10px",left:j.left,top:j.top,backgroundColor:"#bbb",overflow:"hidden",zIndex:99}).appendTo(k);n.css("opacity",0.6);b(document).unbind("mousedown.st mouseup.st").bind("mousemove.st",function(a){var b,f,g;l=null;a=j.top-(d-a.pageY);b=0;for(f=h.length;b<f;b++)g=h[b],b&&g.top>a||b<f-1&&g.bottom<a||(l={element:g.$item},g.top>a-12?(l.state="before",e.css("top",g.top-5)):(l.state="after",e.css("top",g.bottom-5)));$clone.css({top:a})}).bind("mouseup.st",
|
|
function(){var a;b(document).unbind("mousemove.st mouseup.st");n.removeAttr("target").css("opacity","");$clone.remove();e.remove();l&&(a=b(l.element),a[l.state](n),k.trigger("after-drag.st"))})}});return this};b("table.sortable").xeSortableTable();jQuery(function(a){a(".filebox").bind("before-open.mw",function(){function b(f){e.html(f.html);e.find(".select").bind("click",function(){var b=a("input.select_checkbox:checked");0==b.length?(b=a(this).closest("tr").find("img.filebox_item").attr("src"))?
|
|
(d.trigger("filebox.selected",[b]),d.trigger("close.mw")):alert("None selected!"):(d.trigger("filebox.selected",[b]),d.trigger("close.mw"));return!1});e.find(".x_pagination").find("a").filter(function(){return a(this).data("toggle")||a(this).parent().hasClass("x_disabled")||a(this).parent().hasClass("x_active")?!1:!0}).bind("click",function(){var d=a(this).attr("page");a.exec_json("module.getFileBoxListHtml",{page:d},b);return!1});a("#goToFileBox").find("button").bind("click",function(){var d=a(this).prev("input").val();
|
|
a.exec_json("module.getFileBoxListHtml",{page:d},b);return!1});e.closest(".x_modal-body").scrollTop(0)}var d,e,f;d=a(this);f=d.attr("href");e=a(f).find(".filebox_list");a.exec_json("module.getFileBoxListHtml",{page:"1"},b)});var b=a(".x .dsTg .__simple"),e=a(".x .dsTg .__detail");a(".x .dsTg td.title").each(function(){var b=a(this);0==b.find("p.update").length?b.addClass("tg").find(">*:not(:first-child)").hide():b.addClass("up")});var f=a(".x .dsTg td.tg>*:not(:first-child)");b.click(function(){f.slideUp(200);
|
|
e.removeClass("x_active");b.addClass("x_active")});e.click(function(){f.slideDown(200);e.addClass("x_active");b.removeClass("x_active")})});b.fn.xeMultilingualWindow=function(a){function d(){if(h.is(":visible")&&h.find(".editMode").length){var a=h.find("form.item");confirm(xe.msg_confirm_save_and_use_multilingual)?a.find(".save").trigger("click").end().find("textarea").attr("disabled","disabled"):a.find(".cancel").trigger("click")}return!0}function e(){h.find(".item > fieldset").hide().prev("a").children("i").removeClass("x_icon-chevrom-up").addClass("x_icon-chevron-down");
|
|
m.find('[href="#lang_create"]').trigger("click");j.find(".editMode").children("textarea").val("");l=!1;return!0}function f(a,b){var d=m.data("lang-target");l=!1;d&&d.trigger("selected.g11n",[a,b])}function k(e,g,l,j){"undefined"==typeof e&&(e=1);"undefined"==typeof g&&(g="");"undefined"==typeof l&&(l="");"undefined"==typeof j&&(j=!0);console.log(j);b.exec_json("module.getModuleAdminLangListHtml",{page:e,search_keyword:g,name:l,list_count:a.list_count},function(e){e&&e.html&&(h.html(e.html),h.find(".x_pagination a").click(function(){var a=
|
|
b(this).data("page"),d=b(this).data("search_keyword");if(a)return k(a,d),!1}),h.find(".x_pagination").submit(function(){var a=b(this).find('[name="page"]').val(),d=b(this).data("search_keyword");if(!a)return!1;k(a,d);return!1}),h.find(".search").submit(function(){var a=b(this).find('[name="search_keyword"]').val();k(1,a);return!1}),h.find("#search_cancel").click(function(){k(1,"")}),h.find(".set").append('<i class="x_icon-chevron-down"></i>').click(function(){function a(d){e.next("fieldset").find("textarea").each(function(){var a=
|
|
b(this),e=d.langs[a.data("lang")];/^\$user_lang->/.test(e)?a.val("").data("value",""):a.val(e).data("value",e)});e.data("is_loaded",!0)}var e=b(this),f=e.data("lang_code");d();e.next("fieldset").is(":visible")?e.children("i").removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down"):(e.parent(".item").siblings(".item").find("a > i").removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down").end().children("fieldset").hide(),e.children("i").removeClass("x_icon-chevron-down").addClass("x_icon-chevron-up"));
|
|
"undefined"==typeof e.data("is_loaded")&&b.exec_json("module.getModuleAdminLangCode",{name:f},a)}),a.view_use||h.find(".useit").hide(),a.view_modify||h.find(".modify").hide(),a.view_delete||h.find(".delete").hide(),"save"==a.modify_type&&h.find(".save").text(xe.cmd_save),h.find(".modify").click(function(){b(this).closest("fieldset").addClass("editMode").find("textarea").removeAttr("disabled");b(this).siblings(".cancel").prependTo(b(this).parent());b(this).siblings(".delete").attr("disabled","disabled")}),
|
|
h.find(".cancel").click(function(){b(this).closest("fieldset").removeClass("editMode").find("textarea").attr("disabled","disabled").each(function(){var a=b(this);a.val(a.data("value"))});b(this).siblings(".modify").prependTo(b(this).parent());b(this).siblings(".delete").removeAttr("disabled");return!1}),h.find(".delete").click(function(){confirm(xe.confirm_delete)&&(lang_name=b(this).closest(".item").find('[href^="#lang-"]').data("lang_code"),b.exec_json("module.procModuleAdminDeleteLang",{name:lang_name},
|
|
function(a){if(a)if(a.error)alert(a.message);else{var b=h.find(".x_pagination"),a=b.data("page"),b=b.data("search_keyword");a||($page=1);k(a,b)}}))}),h.find(".item").submit(function(){var a=b(this),d=a.find(".editMode").children("textarea"),e=a.find('[href^="#lang-"]'),f={},g=null;d.each(function(){var a=b(this);f[a.attr("class")]=a.val();a.data("tmp_value",a.val());xe.current_lang==a.attr("class")&&(g=a.val())});f.lang_name=e.data("lang_code");b.exec_json("module.procModuleAdminInsertLang",f,function(f){f&&
|
|
(!f.error&&f.name)&&(d.each(function(){var a=b(this);a.data("value",a.data("tmp_value"))}),e.children("span").html(g),h.find(".cancel").trigger("click"),a.find(".useit").trigger("click"))});return!1}),h.find(".useit").click(function(){var a=b(this).closest(".item").find('[href^="#lang-"]'),d=a.data("lang_code"),a=a.children("span").text();f(d,a)}),j&&(document.location.href="#lang_search"),l&&b("#lang_search").find('[href^="#lang-"]').trigger("click"))})}var m=b(this),j=m.find("#lang_create"),h=m.find("#lang_search"),
|
|
l=!1,a=b.extend({create_type:"save_and_use",modify_type:"save_and_use",view_use:!0,view_modify:!0,view_delete:!1,list_count:5},a||{});"save_and_use"!=a.create_type&&j.find(".save-useit").text(xe.cmd_save);m.find(".x_tabbable").xeTabbable();j.find(".editMode textarea").change(function(){l=!0});j.submit(function(){var d={},h=null;b(this).find(".editMode").children("textarea").each(function(){var a=b(this);d[a.attr("class")]=a.val();xe.current_lang==a.attr("class")&&(h=a.val())});if(!h)return alert(xe.msg_empty_multilingual),
|
|
!1;b.exec_json("module.procModuleAdminInsertLang",d,function(b){b&&(!b.error&&b.name)&&("save_and_use"==a.create_type?f(b.name,h):(alert(b.message),e()))});return!1});m.bind("reset.g11n",function(){e()});m.bind("before-open.g11n",function(a,b){b?(k(1,"",b,!1),m.find('[href="#lang_search"]').trigger("click")):k(1,"","",!1)});m.bind("before-close.g11n",function(){var a;j.is(":visible")&&l&&confirm(xe.msg_confirm_save_and_use_multilingual)&&j.find(".save-useit").trigger("click");a=!d()||!e()?!1:void 0;
|
|
return a});return this};jQuery(function(a){var b=a('.vLang[type="hidden"]'),e=a(".lang_code");(b.length||e.length)&&a.exec_json("module.getModuleAdminMultilingualHtml",{},function(f){var k=a(".x #content");k.append(f.html);var m=k.find("#g11n").xeMultilingualWindow();b.each(function(){var b=a(this);b.removeClass("vLang").addClass("lang_code");b.parent().find(".editUserLang").remove()});e=a(".lang_code");var j=0;e.each(function(){var b=a(this),d=b.attr("id");d||(d="__lang_code_"+j,j++,b.attr("id",
|
|
d));var e="TEXTAREA"==this.tagName||b.next("textarea.vLang").length?a('<textarea id="lang_'+d+'" class="displayInput" style="width:179px">').data("lang-id",d):a('<input type="text" id="lang_'+d+'" class="displayInput" style="width:179px">').data("lang-id",d),f=a('<button type="button" class="x_add-on remover" title="'+xe.cmd_remove_multilingual_text+'"><i class="x_icon-remove"></i>'+xe.cmd_remove_multilingual_text+"</button>").data("lang-target",d),g=a('<a href="#g11n" class="x_add-on modalAnchor" title="'+
|
|
xe.cmd_set_multilingual_text+'"><i class="x_icon-globe"></i>'+xe.cmd_set_multilingual_text+"</a>").data("lang-target",d);b.parent().addClass("g11n").addClass("x_input-append");b.after(e,f,g);b.parent().find(".vLang").remove();b.hide();g.attr("href","#g11n").xeModalWindow();e.bind("selected.g11n",function(a,b,d){e.width(135).attr("disabled","disabled").val(d).parent(".g11n").addClass("active");e.siblings("#"+e.data("lang-id")).val("$user_lang->"+b);g.trigger("close.mw")});g.bind("open.mw",function(){var b=
|
|
a(this),d=b.siblings(".displayInput");b.closest(".g11n").hasClass("active")?m.trigger("before-open.g11n",d.prev(".lang_code").val().replace("$user_lang->","")):m.trigger("before-open.g11n");m.data("lang-target",d)});g.bind("before-close.mw",function(){return m.trigger("before-close.g11n")});f.click(function(){var b=a(this);a("#lang_"+b.data("lang-target")).val("").removeAttr("disabled").width(179).parent(".g11n").removeClass("active");b.siblings(".lang_code").val("")});var k=b;e.bind("change, keyup",
|
|
function(){b=a(this);b.closest(".g11n").hasClass("active")||k.val(b.val())});e.val(k.val());/^\$user_lang->/.test(e.val())&&a.exec_json("module.getModuleAdminLangCode",{name:e.val().replace("$user_lang->","")},function(a){a&&a.langs&&(e.closest(".g11n").addClass("active"),e.val(a.langs[xe.current_lang]).attr("disabled","disabled").width(135))})})})})});
|