rhymix/modules/admin/tpl/js/admin.min.js
2012-09-25 13:30:14 +00:00

17 lines
8 KiB
JavaScript

jQuery(function(a){function d(){g.width("99.99%");setTimeout(function(){g.removeAttr("style")},0)}function c(){h.each(function(){var c=a(this),b=c.parent("label"),d=b.siblings('input[type="text"]:first'),g=b.siblings("select:first"),e=c.closest(".multilingual").siblings(".multilingual_item:first");c.is(":checked")?(d.hide(),g.show(),b.addClass("checked"),e.show()):(d.show(),g.hide(),b.removeClass("checked"),e.hide())})}window.top.scrollTo(0,0);a(".x .skipNav>a").click(function(){a(a(this).attr("href")).attr("tabindex",
"0").css("outline","0").focus()});a(".x [data-toggle]").click(function(){a(a(this).attr("data-toggle")).toggle();return!1});a(".x [data-show]").click(function(){a(a(this).attr("data-show")).show();return!1});a(".x [data-hide]").click(function(){a(a(this).attr("data-hide")).hide();return!1});a('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide();a(".x .x_nav-tabs").find('>li>a[href^="#"]').click(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(b.attr("href")).addClass("x_active").show().siblings().removeClass("x_active").hide();
return!1});var b=a(".x>.body"),g=b.find(">.content"),f=b.find(">.gnb"),e=f.find(">ul>li");a(window).resize(function(){setTimeout(function(){980>=a(window).width()||1240<a(window).width()?b.removeClass("wide"):b.addClass("wide")},100)}).resize();e.find("ul").prev("a").bind("click focus",function(){var b=a(this);e.not(b.parent("li")).removeClass("open");a(this).parent("li").toggleClass("open");f.trigger("mouseenter");return!1});f.mouseenter(function(){980<=a(window).width()&&(b.removeClass("wide"),
d())}).mouseleave(function(){980<=a(window).width()&&1240>a(window).width()&&(b.addClass("wide"),d())});f.find('>a[href="#gnbNav"]').click(function(){a(this).parent(".gnb").toggleClass("open");return!1});f.prepend('<button type="button" class="close before" />').append('<button type="button" class="close after" />');f.find(">.close").focus(function(){b.addClass("wide");d()});var h=a('.x .multilingual>label>input[type="checkbox"]');c();h.change(c);a('.x th>input[type="checkbox"]').change(function(){var b=
a(this),c=b.data("name");b.closest("table").find("input:checkbox").filter(function(){var b=a(this);return!b.prop("disabled")&&(b.attr("name")==c||b.data("name")==c)}).prop("checked",b.prop("checked")).end().end().trigger("update.checkbox",[c,this.checked])});a(".x .x_pagination .x_disabled, .x .x_pagination .x_active").click(function(){return!1});a(".x .section>h1").append('<button type="button" class="snToggle x_icon-chevron-up">Toggle this section</button>');a(".x .section>h1>.snToggle").click(function(){var b=
a(this),c=b.closest(".section");c.hasClass("collapse")?(c.removeClass("collapse").children("h1:first").siblings().show(),b.removeClass("x_icon-chevron-down").addClass("x_icon-chevron-up")):(c.addClass("collapse").children("h1:first").siblings().hide(),b.removeClass("x_icon-chevron-up").addClass("x_icon-chevron-down"))})});
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 d=a(this),c,b;c=a(d.attr("href"));c.parent("body").length||(b=a('<button type="button" class="x_close">&times;</button>'),b.click(function(){c.data("anchor").trigger("close.mw")}),c.find("[data-hide]").click(function(){c.data("anchor").trigger("close.mw")}),a("body").append('<div class="x_modal-backdrop"></div>').append(c),
c.prepend(b));c.data("anchor",d);"showing"==c.data("state")?d.trigger("close.mw"):d.trigger("open.mw");return!1}).bind("open.mw",function(){var d=a(this),c,b;c=a.Event("before-open.mw");d.trigger(c);if(c.isDefaultPrevented())return!1;c=a(d.attr("href"));b=d.data("duration")||"fast";c.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});c.fadeIn(b,function(){d.trigger("after-open.mw")}).find("button.x_close:first").focus();
a(".x_modal-backdrop").show()}).bind("close.mw",function(){var d=a(this),c,b;c=a.Event("before-close.mw");d.trigger(c);if(c.isDefaultPrevented())return!1;c=a(d.attr("href"));b=d.data("duration")||"fast";c.data("state","hiding");a("html,body").removeClass("modalContainer");c.fadeOut(b,function(){d.trigger("after-close.mw")});a(".x_modal-backdrop").hide();d.focus()})};a("a.modalAnchor").xeModalWindow();a("div.x_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 c=a(this);$layer=a(c.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"))&&c.trigger("close.tc");d=!1},1)})}).click(function(){var c=a(this),b;b=a(c.attr("href"));b.data("anchor",c);"showing"==
b.data("state")?c.trigger("close.tc"):c.trigger("open.tc");return!1}).bind("open.tc",function(){function c(){b.trigger("after-open.tc")}var b=a(this),g,f,e;g=a(b.attr("href"));f=b.data("effect");e=b.data("duration")||"fast";g.data("state","showing");b.trigger("before-open.tc");d=!1;a(document).unbind("mousedown.tc keydown.tc").bind("mousedown.tc keydown.tc",function(c){if(c&&("keydown"==c.type&&27!=c.which||"mousedown"==c.type&&(c=a(c.target),c.is("html,.tgAnchor,.tgContent")||g.has(c).length)))return!0;
b.trigger("close.tc");return!1});switch(f){case "slide":g.slideDown(e,c);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:""});c()});break;case "fade":g.fadeIn(e,c);break;default:g.show(),b.trigger("after-open.tc")}}).bind("close.tc",function(){function c(){b.trigger("after-close.tc")}var b=a(this),d,f,e;a(document).unbind("mousedown.tc keydown.tc");d=a(b.attr("href"));f=b.data("effect");
e=b.data("duration")||"fast";d.data("state","hiding");b.trigger("before-close.tc");switch(f){case "slide":d.slideUp(e,c);break;case "slide-h":d.animate({width:0},e,function(){d.hide();c()});break;case "fade":d.fadeOut(e,c);break;default:d.hide(),b.trigger("after-close.tc")}});return this};a("a.tgAnchor").xeContentToggler()});
jQuery(function(a){function d(a,c){for(var d=0,e=0;a&&a!=c;)d+=a.offsetTop,e+=a.offsetLeft,a=a.offsetParent;return{top:d,left:e}}var c=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 g,f,e,h,m,j,k,i,l,n;if(1==b.which){f=a(this);e=f.closest("tr");h=f.closest("table");n=h.get(0).offsetParent;f=e.height();m=e.width();before_event=a.Event("before-drag.st");
h.trigger(before_event);if(before_event.isDefaultPrevented())return!1;g=b.pageY;j=d(e.get(0),n);$clone=e.attr("target",!0).clone(!0).appendTo(h);l=(b=h.find("thead th")).length;b.filter("[colspan]").attr("colspan",function(a,c){l+=c-1});c.find("td").attr("colspan",l);k=[];h.find("tbody>tr:not([target],.sticky,:hidden)").each(function(){var c=a(this),b;b=d(this,n);k.push({top:b.top,bottom:b.top+c.height(),$item:c})});$clone.addClass("draggable").css({position:"absolute",opacity:0.6,width:m,height:f,
left:j.left,top:j.top,zIndex:100});c.css({position:"absolute",opacity:0.6,width:m,height:"10px",left:j.left,top:j.top,backgroundColor:"#bbb",overflow:"hidden",zIndex:99}).appendTo(h);e.css("opacity",0.6);a(document).unbind("mousedown.st mouseup.st").bind("mousemove.st",function(a){var b,d,e;i=null;a=j.top-(g-a.pageY);b=0;for(d=k.length;b<d;b++)e=k[b],b&&e.top>a||b<d-1&&e.bottom<a||(i={element:e.$item},e.top>a-12?(i.state="before",c.css("top",e.top-5)):(i.state="after",c.css("top",e.bottom-5)));$clone.css({top:a})}).bind("mouseup.st",
function(){var b;a(document).unbind("mousemove.st mouseup.st");e.removeAttr("target").css("opacity","");$clone.remove();c.remove();i&&(b=a(i.element),b[i.state](e),h.trigger("after-drag.st"))})}});return this};a("table.sortable").xeSortableTable()});