diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 73d67f969..b5685994c 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -580,7 +580,10 @@ $('.modulefinder').xeModuleFinder(); jQuery(function($){ $.fn.xeModuleSearch = function(){ - var $moduleSearchWindow = $(this).find(".moduleSearchWindow"); + var t = this; + var $t = $(this); + + var $moduleSearchWindow = $t.find(".moduleSearchWindow"); var $siteListDiv = $moduleSearchWindow.find('.siteList'); var $moduleTypeListDiv = $moduleSearchWindow.find('.moduleTypeList'); @@ -594,10 +597,7 @@ $.fn.xeModuleSearch = function(){ var aSiteListData; var MAX_LIST_HEIGHT = 280; - - var t = this; - var $t = $(this); - + function setListSize($UL, nHeight){ var nWidth, $div; $UL.find('li div').width(''); @@ -645,7 +645,7 @@ $.fn.xeModuleSearch = function(){ console={log:function(){}}; } - this + $t .not('.xe-module-search') .addClass('xe-module-search') .find('a.tgAnchor.moduleSearch') @@ -753,15 +753,8 @@ $.fn.xeModuleSearch = function(){ t.sSelectedModuleInstanceName = $this.text(); t.sSelectedModuleSrl = $this.data('module_srl'); -/* - var onModuleSelect = t.onModuleSelect; - if(typeof $t.data('onModuleSelect') === 'function'){ - onModuleSelect = $t.data('onModuleSelect'); - } - onModuleSelect(t.sSelectedModuleType, t.sSelectedModuleInstanceName, t.sSelectedModuleSrl); -*/ - t.trigger('moduleSelect', [t.sSelectedModuleType, t.sSelectedModuleInstanceName, t.sSelectedModuleSrl]); + $t.trigger('moduleSelect', [t.sSelectedModuleType, t.sSelectedModuleInstanceName, t.sSelectedModuleSrl]); $('.tgAnchor.moduleSearch').trigger('close.tc'); oEvent.preventDefault(); @@ -770,8 +763,7 @@ $.fn.xeModuleSearch = function(){ return this; }; -xe.ModuleSearch = $('.moduleSearch').xeModuleSearch(); - +$('.moduleSearch').each($.fn.xeModuleSearch); }); // Sortable table diff --git a/modules/admin/tpl/js/admin.min.js b/modules/admin/tpl/js/admin.min.js index dac02ee79..6e98a2f65 100644 --- a/modules/admin/tpl/js/admin.min.js +++ b/modules/admin/tpl/js/admin.min.js @@ -10,36 +10,36 @@ jQuery(function(a){a.fn.xeModalWindow=function(){this.not(".xe-modal-window").ad b.data("anchor",d);"showing"==b.data("state")?d.trigger("close.mw"):d.trigger("open.mw");return!1}).bind("open.mw",function(){var d=a(this),b,e;b=a.Event("before-open.mw");d.trigger(b);if(b.isDefaultPrevented())return!1;b=a(d.attr("href"));e=d.data("duration")||"fast";b.data("state","showing");a("html,body").addClass("modalContainer");a(document).bind("keydown.mw",function(a){if(27==a.which)return d.trigger("close.mw"),!1});b.fadeIn(e,function(){d.trigger("after-open.mw")}).find(">.bg").height(a(document).height()).end().find("button.modalClose:first").focus()}).bind("close.mw", function(){var d=a(this),b,e;b=a.Event("before-close.mw");d.trigger(b);if(b.isDefaultPrevented())return!1;b=a(d.attr("href"));e=d.data("duration")||"fast";b.data("state","hiding");a("html,body").removeClass("modalContainer");b.fadeOut(e,function(){d.trigger("after-close.mw")});d.focus()})};a("a.modalAnchor").xeModalWindow();a("div.modal").addClass("x").hide()}); jQuery(function(a){var d=!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(){d=!0}).focusout(function(){setTimeout(function(){!d&&(!$layer.find(":focus").length&&"showing"==$layer.data("state"))&&b.trigger("close.tc");d=!1},1)})}).click(function(){var b=a(this),e;e=a(b.attr("href"));e.data("anchor",b);"showing"== -e.data("state")?b.trigger("close.tc"):b.trigger("open.tc");return!1}).bind("open.tc",function(){function b(){e.trigger("after-open.tc")}var e=a(this),k,g,f;k=a(e.attr("href"));g=e.data("effect");f=e.data("duration")||"fast";k.data("state","showing");e.trigger("before-open.tc");d=!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")||k.has(b).length)))return!0; -e.trigger("close.tc");return!1});switch(g){case "slide":k.slideDown(f,b);break;case "slide-h":g=k.css({"overflow-x":"",width:""}).width();k.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:g},f,function(){k.css({"overflow-x":"",width:""});b()});break;case "fade":k.fadeIn(f,b);break;default:k.show(),e.trigger("after-open.tc")}}).bind("close.tc",function(){function b(){e.trigger("after-close.tc")}var e=a(this),d,g,f;a(document).unbind("mousedown.tc keydown.tc");d=a(e.attr("href"));g=e.data("effect"); +e.data("state")?b.trigger("close.tc"):b.trigger("open.tc");return!1}).bind("open.tc",function(){function b(){e.trigger("after-open.tc")}var e=a(this),j,g,f;j=a(e.attr("href"));g=e.data("effect");f=e.data("duration")||"fast";j.data("state","showing");e.trigger("before-open.tc");d=!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; +e.trigger("close.tc");return!1});switch(g){case "slide":j.slideDown(f,b);break;case "slide-h":g=j.css({"overflow-x":"",width:""}).width();j.show().css({"overflow-x":"hidden",width:"0px"}).animate({width:g},f,function(){j.css({"overflow-x":"",width:""});b()});break;case "fade":j.fadeIn(f,b);break;default:j.show(),e.trigger("after-open.tc")}}).bind("close.tc",function(){function b(){e.trigger("after-close.tc")}var e=a(this),d,g,f;a(document).unbind("mousedown.tc keydown.tc");d=a(e.attr("href"));g=e.data("effect"); f=e.data("duration")||"fast";d.data("state","hiding");e.trigger("before-close.tc");switch(g){case "slide":d.slideUp(f,b);break;case "slide-h":d.animate({width:0},f,function(){d.hide();b()});break;case "fade":d.fadeOut(f,b);break;default:d.hide(),e.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 d,b,e;d=a(this);b=a(d.attr("href")).find(">ul");e=d.prev("input:text").val();a.exec_json("admin.getSiteAllList",{domain:e},function(e){var g=e.site_list,f,j;b.empty();d.closest(".modulefinder").find(".moduleList,.moduleIdList").attr("disabled","disabled");if(e.error||!a.isArray(g))d.trigger("close.tc");else{f=0;for(j=g.length;f< -j;f++)e=a("
").appendTo(b),a('').text(g[f].domain).data("site_srl",g[f].site_srl).appendTo(e)}})}).end().find(".tgContent.suggestion").delegate("button","click",function(){var d,b;d=a(this);b=d.closest(".modulefinder");b.find("a.tgAnchor.findsite").trigger("close.tc");a.exec_json("module.procModuleAdminGetList",{site_srl:d.data("site_srl")},function(e){var d=e.module_list,g;if(!e.error&&d){e=b.find(".moduleList").data("module_list",d).removeAttr("disabled").empty();for(g in d)d.hasOwnProperty(g)&& -a("").attr("value",g).text(d[g].title).appendTo(e);e.prop("selectedIndex",0).change().focus();e.is(":visible")||e.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 d,b,e;d=a(this);b=d.val();e=d.data("module_list");if(e[b]){e=e[b].list;d=d.closest(".modulefinder").find(".moduleIdList").removeAttr("disabled").empty();for(var k in e)e.hasOwnProperty(k)&& -a("").attr("value",e[k].module_srl).text(e[k].browser_title).appendTo(d);d.prop("selectedIndex",0).change()}});return this};a(".modulefinder").xeModuleFinder()}); -jQuery(function(a){a.fn.xeModuleSearch=function(){function d(a,b){var e;a.find("li div").width("");a.css("height","");a.css("overflow-y","");a.height()>b&&(e=a.find("li div"),e.width(e.width()-20+"px"),a.css("height",b+"px"),a.css("overflow-y","auto"))}function b(b){var e,f=RegExp(b,"ig"),h=m;j.empty();i=0;for(c=h.length;i