1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 03:15:19 +00:00
Radarr/NzbDrone.Web/Scripts/2011.3.1115/telerik.window.min.js

1 line
13 KiB
JavaScript
Raw Normal View History

2011-11-23 01:51:44 +00:00
(function(a){var b=a.telerik;b.scripts.push("telerik.window.js");function d(e){return e&&!(/^([a-z]+:)?\/\//i).test(e)}function c(e){if(a.browser.msie&&a.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()})}}b.fx.zoom=function(e){this.element=e};b.fx.zoom.prototype={play:function(h,f){var e=this.element.show();var i=e.find("> .t-window-content");var g={width:i.width(),height:i.height(),left:parseInt(e.css("left"))||0,top:parseInt(e.css("top"))||0};e.css({left:g.left+20,top:g.top+20}).animate({left:g.left,top:g.top},h.openDuration);i.css({width:g.width-40,height:g.height-40}).animate({width:g.width,height:g.height},h.openDuration,function(){if(f){f()}})},rewind:function(h,f){var e=this.element;var i=e.find("> .t-window-content");var g={width:i.width(),height:i.height(),left:parseInt(e.css("left")),top:parseInt(e.css("top"))};i.animate({width:g.width-40,height:g.height-40},h.closeDuration);e.animate({left:g.left+20,top:g.top+20},h.closeDuration,function(){e.css({left:g.left,top:g.top}).hide();setTimeout(function(){i.css({width:g.width,height:g.height})},0);if(f){f()}})}};b.fx.zoom.defaults=function(){return{list:[{name:"zoom"}],openDuration:"fast",closeDuration:"fast"}};b.window=function(f,i){this.element=f;var e=a(f),g=a.extend({},i);delete g.title;delete g.content;a.extend(this,g);if(!e.is(".t-window")){e.addClass("t-widget t-window");b.window.create(f,i)}if(!e.is("body")){var h;if(e.is(":visible")){h=e.offset();e.css({top:h.top,left:h.left})}else{e.css({visibility:"hidden",display:""});h=e.offset();e.css({top:h.top,left:h.left}).css({visibility:"visible",display:"none"})}e.toggleClass("t-rtl",e.closest(".t-rtl").length>0).appendTo(document.body)}this.bringToTop();e.bind("mousedown",a.proxy(this.bringToTop,this));if(this.modal&&e.is(":visible")){this.overlay(true).css({opacity:0.5,zIndex:parseInt(e.css("zIndex"),10)-1})}var j=".t-window-titlebar .t-link";e.delegate(j,"mouseenter",b.hover).delegate(j,"mouseleave",b.leave).delegate(j,"click",a.proxy(this.windowActionHandler,this));if(this.resizable){e.delegate(".t-window-titlebar","dblclick",a.proxy(this.toggleMaximization,this)).append(b.window.getResizeHandlesHtml());c(e);(function(n){function l(p){var o=a(n.element);n.initialCursorPosition=o.offset();n.resizeDirection=/t-resize-([nesw]+)/gi.exec(p.$draggable[0].className)[1];n.resizeElement=o.find("> .t-window-content");n.initialSize={width:n.resizeElement.width(),height:n.resizeElement.height()};n.outlineSize={left:n.resizeElement.outerWidth()-n.resizeElement.width()+o.outerWidth()-o.width(),top:n.resizeElement.outerHeight()-n.resizeElement.height()+o.outerHeight()-o.height()+o.find("> .t-window-titlebar").outerHeight()};a('<div class="t-overlay" />').appendTo(n.element);o.find(".t-resize-handle").not(p.$draggable).hide();a(document.body).css("cursor",p.$draggable.css("cursor"))}function k(p){var o=a(n.element);var q={e:function(){var r=b.touchLocation(p),s=r.x-n.initialCursorPosition.left-n.outlineSize.left;n.resizeElement.width((s<n.minWidth?n.minWidth:(n.maxWidth&&s>n.maxWidth)?n.maxWidth:s))},s:function(){var s=b.touchLocation(p),r=s.y-n.initialCursorPosition.top-n.outlineSize.top;n.resizeElement.height((r<n.minHeight?n.minHeight:(n.maxHeight&&r>n.maxHeight)?n.maxHeight:r))},w:function(){var r=b.touchLocation(p),t=n.initialCursorPosition.left+n.initialSize.width;o.css("left",r.x>(t-n.minWidth)?t-n.minWidth:r.x<(t-n.maxWidth)?t-n.maxWidth:r.x);var s=t-r.x;n.resizeElement.width((s<n.minWidth?n.minWidth:(n.maxWidth&&s>n.maxWidth)?n.maxWidth:s))},n:function(){var s=b.touchLocation(p),t=n.initialCursorPosition.top+n.initialSize.height;o.css("top",s.y>(t-n.minHeight)?t-n.minHeight:s.y<(t-n.maxHeight)?t-n.maxHeight:s.y);var r=t-s.y;n.resizeElement.height((r<n.minHeight?n.minHeight:(n.maxHeight&&r>n.maxHeight)?n.maxHeight:r))}};a.each(n.resizeDirection.split(""),function(){q[this]()});c(o);if(a.browser.msie&&parseInt(a.browser.version)>=9){o[0].style.cssText=o[0].style.css