mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-23 16:23:13 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
(function(d){var a=d.telerik;function c(f){var e=f?f.toLowerCase():"";return e&&e.indexOf("http")!==0&&e.indexOf("https")!==0}function b(e){if(d.browser.msie&&d.browser.version<7){e.find(".t-resize-e,.t-resize-w").css("height",e.height()).end().find(".t-resize-n,.t-resize-s").css("width",e.width()).end().find(".t-overlay").css({width:e.width(),height:e.height()})}}a.fx.zoom=function(e){this.element=e};a.fx.zoom.prototype={play:function(h,f){var i=this.element.show();var g=i.find("> .t-window-content");var e={width:g.width(),height:g.height(),left:parseInt(i.css("left")),top:parseInt(i.css("top"))};i.css({left:e.left+20,top:e.top+20}).animate({left:e.left,top:e.top},h.openDuration);g.css({width:e.width-40,height:e.height-40}).animate({width:e.width,height:e.height},h.openDuration)},rewind:function(h,f){var i=this.element;var g=i.find("> .t-window-content");var e={width:g.width(),height:g.height(),left:parseInt(i.css("left")),top:parseInt(i.css("top"))};g.animate({width:e.width-40,height:e.height-40},h.closeDuration);i.animate({left:e.left+20,top:e.top+20},h.closeDuration,function(){i.css({left:e.left,top:e.top}).hide();g.css({width:e.width,height:e.height});if(f){f()}})}};a.fx.zoom.defaults=function(){return{list:[{name:"zoom"}],openDuration:"fast",closeDuration:"fast"}};a.window=function(f,g){this.element=f;var h=d(f);if(!h.is(".t-window")){h.addClass("t-widget t-window");a.window.create(f,g)}d.extend(this,g);var e=".t-window-titlebar .t-window-action";h.delegate(".t-window-titlebar","dblclick",d.proxy(this.toggleMaximization,this)).delegate(e,"mouseenter",a.hover).delegate(e,"mouseleave",a.leave).delegate(e,"click",d.proxy(this.windowActionHandler,this));if(this.resizable){h.append(a.window.getResizeHandlesHtml());b(h);a.draganddrop(this.element.id+"Resize",d.extend({draggables:h.find(".t-resize-handle"),hitTestOffset:0},a.draganddrop.applyContext(a.draganddrop.windowResize,this)))}if(this.draggable){a.draganddrop(this.element.id+"Move",d.extend({draggables:h.find(".t-window-titlebar")},a.draganddrop.applyContext(a.draganddrop.windowMove,this)))}a.bind(this,{open:this.onOpen,close:this.onClose,refresh:this.onRefresh,resize:this.onResize,error:this.onError,load:this.onLoad,move:this.onMove});if(!h.parent().is("body")){h.css(h.offset()).appendTo(document.body)}if(this.modal&&d("body > .t-overlay").length==0){this.overlay(h.is(":visible"))}d(window).resize(d.proxy(this.onDocumentResize,this));if(c(this.contentUrl)){this.ajaxRequest()}};a.window.prototype={overlay:function(e){var f=d("body > .t-overlay");if(f.length==0){f=d('<div class="t-overlay" />').toggle(e).appendTo(this.element.ownerDocument.body)}var g=d(document);if(d.browser.msie&&d.browser.version<7){f.css({width:g.width()-21,height:g.height(),position:"absolute"})}return f},windowActionHandler:function(h){var g=d(h.target).closest(".t-window-action").find(".t-icon");var f=this;d.each({"t-close":this.close,"t-maximize":this.maximize,"t-restore":this.restore,"t-refresh":this.refresh},function(i,e){if(g.hasClass(i)){h.preventDefault();e.call(f);return false}})},center:function(){var e=d(this.element);var f=d(window);e.css({left:(f.width()-e.width())/2,top:(f.height()-e.height())/2});return this},title:function(f){var e=d(".t-window-titlebar > .t-window-title",this.element);if(!f){return e.text()}e.text(f);return this},content:function(e){var f=d("> .t-window-content",this.element);if(!e){return f.html()}f.html(e);return this},open:function(h){var f=d(this.element);if(!f.is(":visible")){if(!a.trigger(this.element,"open")){if(this.modal){var g=this.overlay(false);if(this.effects.list.length>0&&this.effects.list[0].name!="toggle"){g.css("opacity",0).show().animate({opacity:0.5},this.effects.openDuration)}else{g.css("opacity",0.5).show()}}a.fx.play(this.effects,f)}}return this},close:function(h){var f=d(this.element);if(f.is(":visible")){if(!a.trigger(this.element,"close")){var g=this.modal?this.overlay(true):d(undefined);g.animate({opacity:0},this.effects.closeDuration);a.fx.rewind(this.effects,f,null,function(){g.add(f[0]).hide()})}}if(this.isMaximized){d("html, body
|