fixed a initial width of multilingual input

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11951 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-10-29 09:44:19 +00:00
parent f142d5bebf
commit a7849f9d13
2 changed files with 30 additions and 29 deletions

View file

@ -1507,11 +1507,12 @@ jQuery(function($){
function makeUI(){
var $multilingualWindow = $('#g11n');
var width = $this.width() - 44;
if(t.tagName == 'TEXTAREA' || $this.data('type') == 'textarea'){
var $displayInput = $('<textarea id="lang_' + id + '" class="displayInput" style="width:179px">').data('lang-id', id);
var $displayInput = $('<textarea id="lang_' + id + '" class="displayInput" style="width:' + width + 'px">').data('lang-id', id);
}else{
var $displayInput = $('<input type="text" id="lang_' + id + '" class="displayInput" style="width:179px">').data('lang-id', id);
var $displayInput = $('<input type="text" id="lang_' + id + '" class="displayInput" style="width:' + width + 'px">').data('lang-id', id);
}
var $remover = $('<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', id);
var $setter = $('<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', id);

View file

@ -17,42 +17,42 @@ jQuery(function(a){a.fn.xeModalWindow=function(){this.not(".xe-modal-window").ad
a("body").append('<div class="x_modal-backdrop"></div>').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,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");
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),j,f,g;j=a(d.attr("href"));f=d.data("effect");g=d.data("duration")||"fast";j.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")||j.has(b).length)))return!0;
d.trigger("close.tc");return!1});switch(f){case "slide":j.slideDown(g,b);break;case "slide-h":f=j.css({"overflow-x":"",width:""}).width();j.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:f},g,function(){j.css({"overflow-x":"",width:""});b()});break;case "fade":j.fadeIn(g,b);break;default:j.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("<li />").appendTo(b),a('<button type="button" />').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("<option />").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("<option />").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 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;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'<span class="highlight">'+a+"</span>"})}$li=a("<li />").appendTo(m);a("<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","#"+f).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("<li />").appendTo(s),a("<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",
"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("<option />").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=
a("<option />").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 j in d)d.hasOwnProperty(j)&&
a("<option />").attr("value",d[j].module_srl).text(d[j].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),j=d.data("multiple");j||(j="");var f="__module_searcher_"+e;e++;a.exec_json("module.getModuleAdminModuleSearcherHtml",{id:f,is_multiple:j},function(e){function j(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 h(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'<span class="highlight">'+a+"</span>"})}$li=a("<li />").appendTo(n);a("<a>").attr("href","#").html(d).data("site_srl",f[i].site_srl).appendTo($li)}j(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(){h(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,h(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("<li />").appendTo(s),a("<a>").attr("href","#").html(e[f].title).data("moduleInstanceList",e[f].list).appendTo($li));l.find(".moduleList").show();j(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("<option />").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();j(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('<a class="x_btn moduleTrigger">'+xe.cmd_find+"</a>"),f=a('<input type="text" readonly>');d.after(e).after("&nbsp;").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('<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(b){var d,h,f,g,k,j,l,n,p,m;if(1==b.which){h=a(this);f=h.closest("tr");g=h.closest("table");m=g.get(0).offsetParent;h=f.height();k=f.width();before_event=a.Event("before-drag.st");g.trigger(before_event);if(before_event.isDefaultPrevented())return!1;d=b.pageY;j=getOffset(f.get(0),m);
$clone=f.attr("target",!0).clone(!0).appendTo(g);p=(b=g.find("thead th")).length;b.filter("[colspan]").attr("colspan",function(a,b){p+=b-1});e.find("td").attr("colspan",p);l=[];g.find("tbody>tr:not([target],.sticky,:hidden)").each(function(){var b=a(this),d;d=getOffset(this,m);l.push({top:d.top,bottom:d.top+b.height(),$item:b})});$clone.addClass("draggable").css({position:"absolute",opacity:0.6,width:k,height:h,left:j.left,top:j.top,zIndex:100});e.css({position:"absolute",opacity:0.6,width:k,height:"10px",
left:j.left,top:j.top,backgroundColor:"#bbb",overflow:"hidden",zIndex:99}).appendTo(g);f.css("opacity",0.6);a(document).unbind("mousedown.st mouseup.st").bind("mousemove.st",function(a){var b,f,g;n=null;a=j.top-(d-a.pageY);b=0;for(f=l.length;b<f;b++)g=l[b],b&&g.top>a||b<f-1&&g.bottom<a||(n={element:g.$item},g.top>a-12?(n.state="before",e.css("top",g.top-5)):(n.state="after",e.css("top",g.bottom-5)));$clone.css({top:a})}).bind("mouseup.st",function(){var b;a(document).unbind("mousemove.st mouseup.st");
f.removeAttr("target").css("opacity","");$clone.remove();e.remove();n&&(b=a(n.element),b[n.state](f),g.trigger("after-drag.st"))})}});return this};a("table.sortable").xeSortableTable()});
jQuery(function(a){a(".filebox").bind("before-open.mw",function(){function b(j){e.html(j.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")||
jQuery(function(a){var e=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(b){var d,j,f,g,k,h,l,m,p,n;if(1==b.which){j=a(this);f=j.closest("tr");g=j.closest("table");n=g.get(0).offsetParent;j=f.height();k=f.width();before_event=a.Event("before-drag.st");g.trigger(before_event);if(before_event.isDefaultPrevented())return!1;d=b.pageY;h=getOffset(f.get(0),n);
$clone=f.attr("target",!0).clone(!0).appendTo(g);p=(b=g.find("thead th")).length;b.filter("[colspan]").attr("colspan",function(a,b){p+=b-1});e.find("td").attr("colspan",p);l=[];g.find("tbody>tr:not([target],.sticky,:hidden)").each(function(){var b=a(this),d;d=getOffset(this,n);l.push({top:d.top,bottom:d.top+b.height(),$item:b})});$clone.addClass("draggable").css({position:"absolute",opacity:0.6,width:k,height:j,left:h.left,top:h.top,zIndex:100});e.css({position:"absolute",opacity:0.6,width:k,height:"10px",
left:h.left,top:h.top,backgroundColor:"#bbb",overflow:"hidden",zIndex:99}).appendTo(g);f.css("opacity",0.6);a(document).unbind("mousedown.st mouseup.st").bind("mousemove.st",function(a){var b,f,g;m=null;a=h.top-(d-a.pageY);b=0;for(f=l.length;b<f;b++)g=l[b],b&&g.top>a||b<f-1&&g.bottom<a||(m={element:g.$item},g.top>a-12?(m.state="before",e.css("top",g.top-5)):(m.state="after",e.css("top",g.bottom-5)));$clone.css({top:a})}).bind("mouseup.st",function(){var b;a(document).unbind("mousemove.st mouseup.st");
f.removeAttr("target").css("opacity","");$clone.remove();e.remove();m&&(b=a(m.element),b[m.state](f),g.trigger("after-drag.st"))})}});return this};a("table.sortable").xeSortableTable()});
jQuery(function(a){a(".filebox").bind("before-open.mw",function(){function b(h){e.html(h.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,k;d=a(this);k=d.attr("href");e=a(k).find(".filebox_list");a.exec_json("module.getFileBoxListHtml",{page:"1"},b)});var e=a(".x .dsTg .__simple"),
b=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 d=a(".x .dsTg td.tg>*:not(:first-child)");e.click(function(){d.slideUp(200);b.removeClass("x_active");e.addClass("x_active")});b.click(function(){d.slideDown(200);b.addClass("x_active");e.removeClass("x_active")})});
jQuery(function(a){a.fn.xeMultilingualWindow=function(e){function b(){if(j.is(":visible")&&j.find(".editMode").length){var a=j.find(".editMode");confirm(xe.msg_confirm_save_and_use_multilingual)?a.find(".save").trigger("click"):a.find(".cancel").trigger("click")}return!0}function d(){j.find(".item > fieldset").hide().prev("a").children("i").removeClass("x_icon-chevrom-up").addClass("x_icon-chevron-down");g.find('[href="#lang_create"]').trigger("click");k.find(".editMode").children("textarea").val("");
l=!1;return!0}function h(a,b){var d=g.data("lang-target");l=!1;d&&d.trigger("selected.g11n",[a,b])}function f(d,g,m,k){"undefined"==typeof d&&(d=1);"undefined"==typeof g&&(g="");"undefined"==typeof m&&(m="");"undefined"==typeof k&&(k=!0);a.exec_json("module.getModuleAdminLangListHtml",{page:d,search_keyword:g,name:m,list_count:e.list_count},function(d){d&&d.html&&(j.html(d.html),j.find(".x_pagination a").click(function(){var b=a(this).data("page"),d=a(this).data("search_keyword");if(b)return f(b,
d),!1}),j.find(".x_pagination").submit(function(){var b=a(this).find('[name="page"]').val(),d=a(this).data("search_keyword");if(!b)return!1;f(b,d);return!1}),j.find(".search").submit(function(){var b=a(this).find('[name="search_keyword"]').val();f(1,b);return!1}),j.find("#search_cancel").click(function(){f(1,"")}),j.find(".set").append('<i class="x_icon-chevron-down"></i>').click(function(){function d(b){e.next("fieldset").find("textarea").each(function(){var d=a(this),e=b.langs[d.data("lang")];/^\$user_lang->/.test(e)?
jQuery(function(a){a.fn.xeMultilingualWindow=function(e){function b(){if(h.is(":visible")&&h.find(".editMode").length){var a=h.find(".editMode");confirm(xe.msg_confirm_save_and_use_multilingual)?a.find(".save").trigger("click"):a.find(".cancel").trigger("click")}return!0}function d(){h.find(".item > fieldset").hide().prev("a").children("i").removeClass("x_icon-chevrom-up").addClass("x_icon-chevron-down");g.find('[href="#lang_create"]').trigger("click");k.find(".editMode").children("textarea").val("");
l=!1;return!0}function j(a,b){var d=g.data("lang-target");l=!1;d&&d.trigger("selected.g11n",[a,b])}function f(d,g,n,k){"undefined"==typeof d&&(d=1);"undefined"==typeof g&&(g="");"undefined"==typeof n&&(n="");"undefined"==typeof k&&(k=!0);a.exec_json("module.getModuleAdminLangListHtml",{page:d,search_keyword:g,name:n,list_count:e.list_count},function(d){d&&d.html&&(h.html(d.html),h.find(".x_pagination a").click(function(){var b=a(this).data("page"),d=a(this).data("search_keyword");if(b)return f(b,
d),!1}),h.find(".x_pagination").submit(function(){var b=a(this).find('[name="page"]').val(),d=a(this).data("search_keyword");if(!b)return!1;f(b,d);return!1}),h.find(".search").submit(function(){var b=a(this).find('[name="search_keyword"]').val();f(1,b);return!1}),h.find("#search_cancel").click(function(){f(1,"")}),h.find(".set").append('<i class="x_icon-chevron-down"></i>').click(function(){function d(b){e.next("fieldset").find("textarea").each(function(){var d=a(this),e=b.langs[d.data("lang")];/^\$user_lang->/.test(e)?
d.val("").data("value",""):d.val(e).data("value",e)});e.data("is_loaded",!0)}var e=a(this),f=e.data("lang_code");b();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")&&
a.exec_json("module.getModuleAdminLangCode",{name:f},d)}),e.view_use||j.find(".useit").hide(),e.view_modify||j.find(".modify").hide(),e.view_delete||j.find(".delete").hide(),"save"==e.modify_type&&j.find(".save").text(xe.cmd_save),j.find(".modify").click(function(){a(this).closest("fieldset").addClass("editMode").find("textarea").removeAttr("disabled");a(this).siblings(".cancel").prependTo(a(this).parent());a(this).siblings(".delete").attr("disabled","disabled")}),j.find(".cancel").click(function(){a(this).closest("fieldset").removeClass("editMode").find("textarea").attr("disabled",
"disabled").each(function(){var b=a(this);b.val(b.data("value"))});a(this).siblings(".modify").prependTo(a(this).parent());a(this).siblings(".delete").removeAttr("disabled");return!1}),j.find(".delete").click(function(){confirm(xe.confirm_delete)&&(lang_name=a(this).closest(".item").find('[href^="#lang-"]').data("lang_code"),a.exec_json("module.procModuleAdminDeleteLang",{name:lang_name},function(a){if(a)if(a.error)alert(a.message);else{var b=j.find(".x_pagination"),a=b.data("page"),b=b.data("search_keyword");
a||($page=1);f(a,b)}}))}),j.find(".item").submit(function(){var b=a(this),d=b.find(".editMode").children("textarea"),e=b.find('[href^="#lang-"]'),f={},g=null;d.each(function(){var b=a(this);f[b.attr("class")]=b.val();b.data("tmp_value",b.val());xe.current_lang==b.attr("class")&&(g=b.val())});f.lang_name=e.data("lang_code");a.exec_json("module.procModuleAdminInsertLang",f,function(f){f&&(!f.error&&f.name)&&(d.each(function(){var b=a(this);b.data("value",b.data("tmp_value"))}),e.children("span").html(g),
j.find(".cancel").trigger("click"),b.find(".useit").trigger("click"))});return!1}),j.find(".useit").click(function(){var b=a(this).closest(".item").find('[href^="#lang-"]'),d=b.data("lang_code"),b=b.children("span").text();h(d,b)}),k&&(document.location.href="#lang_search"),m&&a("#lang_search").find('[href^="#lang-"]').trigger("click"))})}var g=a(this),k=g.find("#lang_create"),j=g.find("#lang_search"),l=!1,e=a.extend({create_type:"save_and_use",modify_type:"save_and_use",view_use:!0,view_modify:!0,
a.exec_json("module.getModuleAdminLangCode",{name:f},d)}),e.view_use||h.find(".useit").hide(),e.view_modify||h.find(".modify").hide(),e.view_delete||h.find(".delete").hide(),"save"==e.modify_type&&h.find(".save").text(xe.cmd_save),h.find(".modify").click(function(){a(this).closest("fieldset").addClass("editMode").find("textarea").removeAttr("disabled");a(this).siblings(".cancel").prependTo(a(this).parent());a(this).siblings(".delete").attr("disabled","disabled")}),h.find(".cancel").click(function(){a(this).closest("fieldset").removeClass("editMode").find("textarea").attr("disabled",
"disabled").each(function(){var b=a(this);b.val(b.data("value"))});a(this).siblings(".modify").prependTo(a(this).parent());a(this).siblings(".delete").removeAttr("disabled");return!1}),h.find(".delete").click(function(){confirm(xe.confirm_delete)&&(lang_name=a(this).closest(".item").find('[href^="#lang-"]').data("lang_code"),a.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);f(a,b)}}))}),h.find(".item").submit(function(){var b=a(this),d=b.find(".editMode").children("textarea"),e=b.find('[href^="#lang-"]'),f={},g=null;d.each(function(){var b=a(this);f[b.attr("class")]=b.val();b.data("tmp_value",b.val());xe.current_lang==b.attr("class")&&(g=b.val())});f.lang_name=e.data("lang_code");a.exec_json("module.procModuleAdminInsertLang",f,function(f){f&&(!f.error&&f.name)&&(d.each(function(){var b=a(this);b.data("value",b.data("tmp_value"))}),e.children("span").html(g),
h.find(".cancel").trigger("click"),b.find(".useit").trigger("click"))});return!1}),h.find(".useit").click(function(){var b=a(this).closest(".item").find('[href^="#lang-"]'),d=b.data("lang_code"),b=b.children("span").text();j(d,b)}),k&&(document.location.href="#lang_search"),n&&a("#lang_search").find('[href^="#lang-"]').trigger("click"))})}var g=a(this),k=g.find("#lang_create"),h=g.find("#lang_search"),l=!1,e=a.extend({create_type:"save_and_use",modify_type:"save_and_use",view_use:!0,view_modify:!0,
view_delete:!1,list_count:5},e||{});"save_and_use"!=e.create_type&&k.find(".save-useit").text(xe.cmd_save);g.find(".x_tabbable").xeTabbable();k.find(".editMode textarea").change(function(){l=!0});k.submit(function(){var b={},f=null;a(this).find(".editMode").children("textarea").each(function(){var d=a(this);b[d.attr("class")]=d.val();xe.current_lang==d.attr("class")&&(f=d.val())});if(!f)return alert(xe.msg_empty_multilingual),!1;a.exec_json("module.procModuleAdminInsertLang",b,function(a){a&&(!a.error&&
a.name)&&("save_and_use"==e.create_type?h(a.name,f):(alert(a.message),d()))});return!1});g.find('[href="#lang_search"]').click(function(){f()});g.bind("reset.g11n",function(){d()});g.bind("before-open.g11n",function(a,b){b?(f(1,"",b,!1),g.find('[href="#lang_search"]').trigger("click")):f(1,"","",!1)});g.bind("before-close.g11n",function(){var a;k.is(":visible")&&l&&confirm(xe.msg_confirm_save_and_use_multilingual)&&k.find(".save-useit").trigger("click");a=!b()||!d()?!1:void 0;return a});return this}});
a.name)&&("save_and_use"==e.create_type?j(a.name,f):(alert(a.message),d()))});return!1});g.find('[href="#lang_search"]').click(function(){f()});g.bind("reset.g11n",function(){d()});g.bind("before-open.g11n",function(a,b){b?(f(1,"",b,!1),g.find('[href="#lang_search"]').trigger("click")):f(1,"","",!1)});g.bind("before-close.g11n",function(){var a;k.is(":visible")&&l&&confirm(xe.msg_confirm_save_and_use_multilingual)&&k.find(".save-useit").trigger("click");a=!b()||!d()?!1:void 0;return a});return this}});
var is_loaded_multilingual_window_html=!1;jQuery(function(a){a.fn.xeLoadMultilingualWindowHtml=function(){a.exec_json("module.getModuleAdminMultilingualHtml",{},function(e){var b=a(".x #content");a(e.html).appendTo(b).xeMultilingualWindow();a(".lang_code").trigger("loaded-multilingualWindow")});return this}});var multilingual_id_count=0;
jQuery(function(a){a.fn.xeApplyMultilingualUI=function(){a(this).each(function(){function e(){function e(){var b=n.val();j.trigger("click");n.val(b);k.val(b);/^\$user_lang->/.test(k.val())&&a.exec_json("module.getModuleAdminLangCode",{name:k.val().replace("$user_lang->","")},function(a){if(a&&a.langs){var b=k.width();k.closest(".g11n").addClass("active");k.val(a.langs[xe.current_lang]).attr("disabled","disabled").width(b-44)}})}var g=a("#g11n"),k="TEXTAREA"==d.tagName||"textarea"==b.data("type")?
a('<textarea id="lang_'+h+'" class="displayInput" style="width:179px">').data("lang-id",h):a('<input type="text" id="lang_'+h+'" class="displayInput" style="width:179px">').data("lang-id",h),j=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",h),l=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",h);b.parent().addClass("g11n").addClass("x_input-append");b.after(k,j,l);b.hide();l.attr("href","#g11n").xeModalWindow();k.bind("selected.g11n",function(b,d,e){b=k.width();a(this).parent().hasClass("active")||(b-=44);k.width(b).attr("disabled","disabled").val(e).parent(".g11n").addClass("active");k.siblings("#"+k.data("lang-id")).val("$user_lang->"+d);l.trigger("close.mw")});l.bind("open.mw",function(){var b=a(this),d=b.siblings(".displayInput");
b.closest(".g11n").hasClass("active")?g.trigger("before-open.g11n",d.prev(".lang_code").val().replace("$user_lang->","")):g.trigger("before-open.g11n");g.data("lang-target",d)});l.bind("before-close.mw",function(){return g.trigger("before-close.g11n")});j.click(function(){var b=a(this),d=a("#lang_"+b.data("lang-target")),e=d.width();d.val("").removeAttr("disabled").width(e+44).parent(".g11n").removeClass("active");b.siblings(".lang_code").val("")});var n=b;k.bind("change keyup",function(){b=a(this);
b.closest(".g11n").hasClass("active")||n.val(b.val())});b.bind("reload-multilingual",e);e()}is_loaded_multilingual_window_html||(a().xeLoadMultilingualWindowHtml(),is_loaded_multilingual_window_html=!0);var b=a(this),d=this;b.parent().hasClass("g11n")?b.siblings().remove():b.wrap("<span></span>");var h=b.attr("id");h||(h="__lang_code_"+multilingual_id_count,multilingual_id_count++,b.attr("id",h));a("#g11n").length?e():b.bind("loaded-multilingualWindow",e)});return this};a('.vLang[type="hidden"]').each(function(){var e=
jQuery(function(a){a.fn.xeApplyMultilingualUI=function(){a(this).each(function(){function e(){function e(){var b=p.val();l.trigger("click");p.val(b);h.val(b);/^\$user_lang->/.test(h.val())&&a.exec_json("module.getModuleAdminLangCode",{name:h.val().replace("$user_lang->","")},function(a){if(a&&a.langs){var b=h.width();h.closest(".g11n").addClass("active");h.val(a.langs[xe.current_lang]).attr("disabled","disabled").width(b-44)}})}var g=a("#g11n"),k=b.width()-44,h="TEXTAREA"==d.tagName||"textarea"==
b.data("type")?a('<textarea id="lang_'+j+'" class="displayInput" style="width:'+k+'px">').data("lang-id",j):a('<input type="text" id="lang_'+j+'" class="displayInput" style="width:'+k+'px">').data("lang-id",j),l=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",j),m=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",j);b.parent().addClass("g11n").addClass("x_input-append");b.after(h,l,m);b.hide();m.attr("href","#g11n").xeModalWindow();h.bind("selected.g11n",function(b,d,e){b=h.width();a(this).parent().hasClass("active")||(b-=44);h.width(b).attr("disabled","disabled").val(e).parent(".g11n").addClass("active");h.siblings("#"+h.data("lang-id")).val("$user_lang->"+d);m.trigger("close.mw")});m.bind("open.mw",function(){var b=a(this),d=b.siblings(".displayInput");
b.closest(".g11n").hasClass("active")?g.trigger("before-open.g11n",d.prev(".lang_code").val().replace("$user_lang->","")):g.trigger("before-open.g11n");g.data("lang-target",d)});m.bind("before-close.mw",function(){return g.trigger("before-close.g11n")});l.click(function(){var b=a(this),d=a("#lang_"+b.data("lang-target")),e=d.width();d.val("").removeAttr("disabled").width(e+44).parent(".g11n").removeClass("active");b.siblings(".lang_code").val("")});var p=b;h.bind("change keyup",function(){b=a(this);
b.closest(".g11n").hasClass("active")||p.val(b.val())});b.bind("reload-multilingual",e);e()}is_loaded_multilingual_window_html||(a().xeLoadMultilingualWindowHtml(),is_loaded_multilingual_window_html=!0);var b=a(this),d=this;b.parent().hasClass("g11n")?b.siblings().remove():b.wrap("<span></span>");var j=b.attr("id");j||(j="__lang_code_"+multilingual_id_count,multilingual_id_count++,b.attr("id",j));a("#g11n").length?e():b.bind("loaded-multilingualWindow",e)});return this};a('.vLang[type="hidden"]').each(function(){var e=
a(this);e.next("textarea.vLang").length&&e.data("type","textarea");e.removeClass("vLang").addClass("lang_code");e.parent().find(".editUserLang").remove().end().find(".vLang").remove()});a(".lang_code").xeApplyMultilingualUI()});function getOffset(a,e){for(var b=0,d=0;a&&a!=e;)b+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:b,left:d}};