diff --git a/modules/admin/tpl/js/admin.min.js b/modules/admin/tpl/js/admin.min.js index 5e1f59e74..82710b3b4 100644 --- a/modules/admin/tpl/js/admin.min.js +++ b/modules/admin/tpl/js/admin.min.js @@ -1,1178 +1,38 @@ -/* NHN (developers@xpressengine.com) */ -jQuery(function($){ - // Constants - var ESC_KEY = 27; - - // Overlapping label - $('.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 $label = $(this).prev().stop().animate({opacity:0, left:'25px'},'fast',function(){ $label.css('visibility','hidden') }); - }) - .blur(function(){ - var $this = $(this), $label; - if($.trim($this.val()) == '') { - $label = $this.prev().stop().css('visibility','visible').animate({opacity:1, left:'5px'},'fast'); - } - }) - .end() - .parent() - .css('position', 'relative'); - - // Make selected checkbox elements bold - var $rc_label = $('input:radio+label,input:checkbox+label'), $input_rc = $rc_label.prev('input'); - $input_rc - .change(function(){ - var name = $(this).attr('name'); - $input_rc - .filter(function(){ return this.name == name }) - .next('label').css('font-weight', 'normal').end() - .filter(':checked') - .next('label').css('font-weight', 'bold').end(); - }) - .change(); - - // Toogle checkbox all - $('.form th>input:checkbox') - .change(function() { - var $this = $(this), name = $this.data('name'); - - $this.closest('table') - .find('input:checkbox') - .filter(function(){ - var $this = $(this); - return !$this.prop('disabled') && (($this.attr('name') == name) || ($this.data('name') == name)); - }) - .prop('checked', $this.prop('checked')) - .end() - .end() - .trigger('update.checkbox', [name, this.checked]); - }); - - // pagination - $.fn.xePagination = function(){ - this - .not('.xe-pagination') - .addClass('xe-pagination') - .find('span.tgContent').css('whiteSpace', 'nowrap').end() - .find('a.tgAnchor') - .each(function(idx){ - var $this = $(this); - $this.after( $($this.attr('href')) ); - }) - .end(); - - return this; - }; - $('.pagination').xePagination(); - - // Portlet Action - $('.portlet .action') - .css({display:'none',position:'absolute'}) - .parent() - .mouseleave(function(){ $(this).find('>.action').fadeOut(100); }) - .mouseenter(function(){ $(this).find('>.action').fadeIn(100); }) - .focusin(function(){ $(this).mouseenter() }) - .focusout(function(){ - var $this = $(this), timer; - - clearTimeout($this.data('timer')); - timer = setTimeout(function(){ if(!$this.find(':focus').length) $this.mouseleave() }, 10); - - $this.data('timer', timer); - }); - - // Display the dashboard in two column - $(window).resize(function(){ - if($(document).width() < 1280){ - $('.dashboard>.section>br').remove(); - $('.dashboard>.section>.portlet:odd').after('
'); - } else { - $('.dashboard>.section>br').remove(); - $('.dashboard>.section>.portlet:eq(2),.dashboard>.section>.portlet:eq(5)').after('
'); - } - }); - $(window).resize(); - - - // Popup list : 'Move to site' and 'Site map' - $('.header>.siteTool>a.i') - .bind('before-open.tc', function(){ - $(this) - .addClass('active') - .next('div.tgContent') - .find('>.section:gt(0)').hide().end() - .find('>.btnArea>button').show(); - }) - .bind('after-close.tc', function(){ - $(this).removeClass('active'); - }) - .next('#siteMapList') - .find('>.section:last') - .after('

') - .find('+p>button') - .click(function(){ - // Display all sections then hide this button - $(this).hide().parent().prevAll('.section').show(); - }); - - $.fn.xeMask = function(){ - this - .each(function(){ - var $this = $(this), text = $this.text(); - var reg_mail = /^([\w\-\.]+?)@(([\w-]+\.)+[a-z]{2,})$/ig; - $this.data('originalText', text); - - if(reg_mail.test(text)) { - $this.data('maskedText', RegExp.$1+'...'); - } - - $this.text( $this.data('maskedText') ); - }) - .mouseover(function(){ - $(this).text( $(this).data('originalText') ); - }) - .mouseout(function(){ - $(this).text( $(this).data('maskedText') ); - }) - .focus(function(){ $(this).mouseover(); }) - .blur(function(){ $(this).mouseout(); }); - }; - $('.masked').xeMask(); -}); - -// Global Navigation Bar -jQuery(function($){ - -$.fn.xeMenu = function(){ - this - .removeClass('jx') - .attr('role', 'navigation') // WAI-ARIA role - .find('li') - .attr('role', 'menuitem') // WAI-ARIA role - .find('>ul').hide().end() - .filter(':has(>ul)') - .attr('aria-haspopup', 'true') // WAI-ARIA - .end() - .end() - .delegate('li', { - mouseover : function(){ - $(this) - .addClass('active') - .find('>ul').show().end() - .parentsUntil('.gnb') - .filter('li').addClass('active').end() - .end() - }, - mouseleave : function(){ - $(this) - .removeClass('active') - .find('>ul').hide(); - }, - focusout : function(){ - var $this = $(this); - setTimeout(function(){ - if(!$this.find(':focus').length) { - $this.removeClass('active').find('>ul').hide(); - } - }, 1); - } - }) - .delegate('a', { - focus : function(){ - $(this).parent('li').mouseover(); - } - }); -}; - -$('div.gnb').xeMenu(); - -}); - -// Modal Window -jQuery(function($){ - -var ESC = 27; - -$.fn.xeModalWindow = function(){ - this - .not('.xe-modal-window') - .addClass('xe-modal-window') - .each(function(){ - $( $(this).attr('href') ).addClass('x').hide(); - }) - .click(function(){ - var $this = $(this), $modal, $btnClose, disabled; - - // get and initialize modal window - $modal = $( $this.attr('href') ); - if(!$modal.parent('body').length) { - $btnClose = $(''); - $btnClose.click(function(){ $modal.data('anchor').trigger('close.mw') }); - - $modal - .prepend('') - .append('') - .find('>.fg') - .prepend($btnClose) - .append($btnClose.clone(true)) - .end() - .appendTo('body'); - } - - // set the related anchor - $modal.data('anchor', $this); - - if($modal.data('state') == 'showing') { - $this.trigger('close.mw'); - } else { - $this.trigger('open.mw'); - } - - return false; - }) - .bind('open.mw', function(){ - var $this = $(this), before_event, $modal, duration; - - // before event trigger - before_event = $.Event('before-open.mw'); - $this.trigger(before_event); - - // is event canceled? - if(before_event.isDefaultPrevented()) return false; - - // get modal window - $modal = $( $this.attr('href') ); - - // get duration - duration = $this.data('duration') || 'fast'; - - // set state : showing - $modal.data('state', 'showing'); - - // workaroud for IE6 - $('html,body').addClass('modalContainer'); - - // after event trigger - function after(){ $this.trigger('after-open.mw') }; - - $(document).bind('keydown.mw', function(event){ - if(event.which == ESC) { - $this.trigger('close.mw'); - return false; - } - }); - - $modal - .fadeIn(duration, after) - .find('>.bg').height($(document).height()).end() - .find('button.modalClose:first').focus(); - }) - .bind('close.mw', function(){ - var $this = $(this), before_event, $modal, duration; - - // before event trigger - before_event = $.Event('before-close.mw'); - $this.trigger(before_event); - - // is event canceled? - if(before_event.isDefaultPrevented()) return false; - - // get modal window - $modal = $( $this.attr('href') ); - - // get duration - duration = $this.data('duration') || 'fast'; - - // set state : hiding - $modal.data('state', 'hiding'); - - // workaroud for IE6 - $('html,body').removeClass('modalContainer'); - - // after event trigger - function after(){ $this.trigger('after-close.mw') }; - - $modal.fadeOut(duration, after); - $this.focus(); - }); -}; -$('a.modalAnchor').xeModalWindow(); -$('div.modal').addClass('x').hide(); - -}); - -// Content Toggler -jQuery(function($){ - -var dont_close_this_time = false; -var ESC = 27; - -$.fn.xeContentToggler = function(){ - this - .not('.xe-content-toggler') - .addClass('xe-content-toggler') - .each(function(){ - var $anchor = $(this); $layer = $($anchor.attr('href')); - - $layer.hide() - .not('.xe-toggling-content') - .addClass('xe-toggling-content') - .mousedown(function(event){ dont_close_this_time = true }) - .focusout(function(event){ - setTimeout(function(){ - if(!dont_close_this_time && !$layer.find(':focus').length && $layer.data('state') == 'showing') $anchor.trigger('close.tc'); - dont_close_this_time = false; - }, 1); - }); - }) - .click(function(){ - var $this = $(this), $layer; - - // get content container - $layer = $( $this.attr('href') ); - - // set anchor object - $layer.data('anchor', $this); - - if($layer.data('state') == 'showing') { - $this.trigger('close.tc'); - } else { - $this.trigger('open.tc'); - } - - return false; - }) - .bind('open.tc', function(){ - var $this = $(this), $layer, effect, duration; - - // get content container - $layer = $( $this.attr('href') ); - - // get effeect - effect = $this.data('effect'); - - // get duration - duration = $this.data('duration') || 'fast'; - - // set state : showing - $layer.data('state', 'showing'); - - // before event trigger - $this.trigger('before-open.tc'); - - dont_close_this_time = false; - - // When mouse button is down or when ESC key is pressed close this layer - $(document) - .unbind('mousedown.tc keydown.tc') - .bind('mousedown.tc keydown.tc', - function(event){ - if(event) { - if(event.type == 'keydown' && event.which != ESC) return true; - if(event.type == 'mousedown') { - var $t = $(event.target); - if($t.is('html,.tgAnchor,.tgContent') || $layer.has($t).length) return true; - } - } - - $this.trigger('close.tc'); - - return false; - } - ); - - // triggering after - function trigger_after(){ $this.trigger('after-open.tc') } - - switch(effect) { - case 'slide': - $layer.slideDown(duration, trigger_after); - break; - case 'slide-h': - var w = $layer.css({'overflow-x':'',width:''}).width(); - $layer - .show() - .css({'overflow-x':'hidden',width:'0px'}) - .animate({width:w}, duration, function(){ $layer.css({'overflow-x':'',width:''}); trigger_after(); }); - break; - case 'fade': - $layer.fadeIn(duration, trigger_after); - break; - default: - $layer.show(); - $this.trigger('after-open.tc'); - } - }) - .bind('close.tc', function(){ - var $this = $(this), $layer, effect, duration; - - // unbind document's event handlers - $(document).unbind('mousedown.tc keydown.tc'); - - // get content container - $layer = $( $this.attr('href') ); - - // get effeect - effect = $this.data('effect'); - - // get duration - duration = $this.data('duration') || 'fast'; - - // set state : hiding - $layer.data('state', 'hiding'); - - // before event trigger - $this.trigger('before-close.tc'); - - // triggering after - function trigger_after(){ $this.trigger('after-close.tc') }; - - // close this layer - switch(effect) { - case 'slide': - $layer.slideUp(duration, trigger_after); - break; - case 'slide-h': - $layer.animate({width:0}, duration, function(){ $layer.hide(); trigger_after(); }); - break; - case 'fade': - $layer.fadeOut(duration, trigger_after); - break; - default: - $layer.hide(); - $this.trigger('after-close.tc'); - } - }); - - return this; -}; - -$('a.tgAnchor').xeContentToggler(); - -}); - -// Module finder -jQuery(function($){ - -$.fn.xeModuleFinder = function(){ - this - .not('.xe-module-finder') - .addClass('xe-module-finder') - .find('a.tgAnchor.findsite') - .bind('before-open.tc', function(){ - var $this, $ul, val; - - $this = $(this); - $ul = $($this.attr('href')).find('>ul'); - val = $this.prev('input:text').val(); - - function on_complete(data) { - var $li, list = data.site_list, i, c; - - $ul.empty(); - $this.closest('.modulefinder').find('.moduleList,.moduleIdList').attr('disabled','disabled'); - - if(data.error || !$.isArray(list)) { - $this.trigger('close.tc'); - return; - } - - for(i=0,c=list.length; i < c; i++) { - $li = $('
  • ').appendTo($ul); - $('

    ').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(''),d.click(function(){b.data("anchor").trigger("close.mw")}),b.prepend('').append('<\!--[if IE 6]>').find(">.fg").prepend(d).append(d.clone(true)).end().appendTo("body")); +b.data("anchor",c);b.data("state")=="showing"?c.trigger("close.mw"):c.trigger("open.mw");return false}).bind("open.mw",function(){var c=a(this),b,d;b=a.Event("before-open.mw");c.trigger(b);if(b.isDefaultPrevented())return false;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"),false});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 false;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=false;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=true}).focusout(function(){setTimeout(function(){!c&&!$layer.find(":focus").length&&$layer.data("state")=="showing"&&b.trigger("close.tc");c=false},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 false}).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=false;a(document).unbind("mousedown.tc keydown.tc").bind("mousedown.tc keydown.tc",function(b){if(b){if(b.type=="keydown"&&b.which!=27)return true;if(b.type=="mousedown"&&(b=a(b.target),b.is("html,.tgAnchor,.tgContent")|| +g.has(b).length))return true}d.trigger("close.tc");return false});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("
  • ").appendTo(b),a('