mirror of https://github.com/Radarr/Radarr
1 line
7.7 KiB
JavaScript
1 line
7.7 KiB
JavaScript
(function(d){try{if(document.execCommand){document.execCommand("BackgroundImageCache",false,true)}}catch(c){}var b=d.telerik={create:function(e,f){var h=f.name;var g=d.extend({},d.fn[h].defaults,f.options);return e.each(function(){var i=d(this);g=d.meta?d.extend({},g,i.data()):g;if(!i.data(h)){var j=f.init(this,g);i.data(h,j);b.trigger(this,"load");if(f.success){f.success(j)}}})},toJson:function(e){var f=[];for(var h in e){var g=e[h];if(typeof g!="object"){f.push('"'+h+'":"'+g+'"')}else{f.push('"'+h+'":'+this.toJson(g))}}return"{"+f.join(",")+"}"},delegate:function(f,e){return function(g){e.apply(f,[g,this])}},stop:function(e,f){return function(g){g.stopPropagation();e.apply(f||this,arguments)}},stopAll:function(e,f){return function(g){g.preventDefault();g.stopPropagation();e.apply(f||this,arguments)}},bind:function(e,f){var g=d(e.element);d.each(f,function(h){if(d.isFunction(this)){g.bind(h,this)}})},preventDefault:function(f){f.preventDefault()},hover:function(){d(this).addClass("t-state-hover")},leave:function(){d(this).removeClass("t-state-hover")},buttonHover:function(){d(this).addClass("t-button-hover")},buttonLeave:function(){d(this).removeClass("t-button-hover")},stringBuilder:function(){this.buffer=[]},ajaxError:function(h,g,e,i){var f=this.trigger(h,g,{XMLHttpRequest:e,textStatus:i});if(!f){if(i=="error"&&e.status!="0"){alert("Error! The requested URL returned "+e.status+" - "+e.statusText)}if(i=="timeout"){alert("Error! Server timeout.")}}},trigger:function(g,f,h){h=d.extend(h||{},new d.Event(f));h.stopPropagation();d(g).trigger(h);return h.isDefaultPrevented()},getType:function(e){if(e instanceof Date){return"date"}if(!isNaN(e)){return"number"}return"object"},formatString:function(){var j=arguments[0];for(var e=0,f=arguments.length-1;e<f;e++){var h=new RegExp("\\{"+e+"(:([^\\}]+))?\\}","gm");var g=arguments[e+1];var k=this.formatters[this.getType(g)];if(k){var m=h.exec(j);g=k(g,m[2])}j=j.replace(h,function(i){return g})}return j},lastIndexOf:function(e,f){var g=f.length;for(var h=e.length-1;h>-1;h--){if(e.substr(h,g)==f){return h}}return -1},caretPos:function(e){var f=-1;if(document.selection){f=Math.abs(e.document.selection.createRange().moveStart("character",-e.value.length))}else{if(e.selectionStart!==undefined){f=e.selectionStart}}return f},formatters:{},fx:{},cultureInfo:{}};b.datetime=function(){if(arguments.length==0){this.value=new Date()}else{if(arguments.length==1){this.value=new Date(arguments[0])}else{if(arguments.length==3){this.value=new Date(arguments[0],arguments[1],arguments[2])}else{if(arguments.length==6){this.value=new Date(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])}else{this.value=new Date(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6])}}}}return this};d.extend(b.datetime,{msPerMinute:60000,msPerDay:86400000,add:function(i,f){var g=i.timeOffset();var h=new b.datetime(i.time()+f);var e=h.timeOffset()-g;return new b.datetime(h.time()+e*b.datetime.msPerMinute)},subtract:function(h,g){g=new b.datetime(g).toDate();var e=h.time()-g;var f=h.timeOffset()-g.timeOffset();return e-(f*b.datetime.msPerMinute)},firstDayOfMonth:function(e){return new b.datetime(0).hours(0).minutes(0).year(e.year(),e.month(),1)},firstVisibleDay:function(e){var f=new b.datetime(e.year(),e.month(),0);while(f.day()!=0){b.datetime.modify(f,-1*b.datetime.msPerDay)}return f},modify:function(i,e){var g=i.timeOffset();var f=new b.datetime(i.time()+e);var h=f.timeOffset()-g;i.time(f.time()+h*b.datetime.msPerMinute)}});b.datetime.prototype={year:function(){if(arguments.length==0){return this.value.getFullYear()}else{if(arguments.length==1){this.value.setFullYear(arguments[0])}else{this.value.setFullYear(arguments[0],arguments[1],arguments[2])}}return this},timeOffset:function(){return this.value.getTimezoneOffset()},day:function(){return this.value.getDay()},toDate:function(){return this.value},addMonth:function(e){this.month(this.month()+e)},addYear:function(e){this.year(this.year()+e)}};d.each(["Month","Date","Hours","Minutes","Seconds","Milliseconds","Time"],function(e,f){b.datetime.prototype[f.toLowerCase()]=function(){if(arguments.length==1){this.value["set"+f](arguments[0])}else{return this.value["get"+f]()}return this}});b.stringBuilder.prototype={cat:function(e){this.buffer.push(e);return this},rep:function(f,e){for(var g=0;g<e;g++){this.cat(f)}return this},catIf:function(f,e){if(e){this.cat(f)}return this},string:function(){return this.buffer.join("")}};var a=function(g,e,f){if(e.length==0&&f){f();return null}var h=g.list.length;return function(){if(--h==0&&f){f()}}};d.extend(b.fx,{_wrap:function(e){if(!e.parent().hasClass("t-animation-container")){e.wrap(d("<div/>").addClass("t-animation-container").css({width:e.outerWidth(),height:e.outerHeight()}))}return e.parent()},play:function(j,k,g,e){var m=a(j,k,e);if(m===null){return}k.stop(false,true);for(var f=0,l=j.list.length;f<l;f++){var h=new b.fx[j.list[f].name](k);if(!k.data("effect-"+f)){h.play(d.extend(j.list[f],{openDuration:j.openDuration,closeDuration:j.closeDuration},g),m);k.data("effect-"+f,h)}}},rewind:function(j,k,g,e){var l=a(j,k,e);if(l===null){return}for(var f=j.list.length-1;f>=0;f--){var h=k.data("effect-"+f)||new b.fx[j.list[f].name](k);h.rewind(d.extend(j.list[f],{openDuration:j.openDuration,closeDuration:j.closeDuration},g),l);k.data("effect-"+f,null)}}});b.fx.toggle=function(e){this.element=e.stop(false,true)};b.fx.toggle.prototype={play:function(e,f){this.element.show();if(f){f()}},rewind:function(e,f){this.element.hide();if(f){f()}}};b.fx.toggle.defaults=function(){return{list:[{name:"toggle"}]}};b.fx.slide=function(e){this.element=e;this.animationContainer=b.fx._wrap(e)};b.fx.slide.prototype={play:function(f,j){var e=this.animationContainer;this.element.css("display","block").stop();e.css({display:"block",overflow:"hidden"});var g=this.element.outerWidth();var l=this.element.outerHeight();var k=f.direction=="bottom"?"marginTop":"marginLeft";var h=f.direction=="bottom"?-l:-g;e.css({width:g,height:l});var i={};i[k]=0;this.element.css("width",this.element.width()).each(function(){this.style.cssText=this.style.cssText}).css(k,h).animate(i,{queue:false,duration:f.openDuration,easing:"linear",complete:function(){e.css("overflow","");if(j){j()}}})},rewind:function(g,f){var h=this.animationContainer;this.element.stop();h.css({overflow:"hidden"});var e;switch(g.direction){case"bottom":e={marginTop:-this.element.outerHeight()};break;case"right":e={marginLeft:-this.element.outerWidth()};break}this.element.animate(e,{queue:false,duration:g.closeDuration,easing:"linear",complete:function(){h.css({display:"none",overflow:""});if(f){f()}}})}};b.fx.slide.defaults=function(){return{list:[{name:"slide"}],openDuration:"fast",closeDuration:"fast"}};b.fx.property=function(e){this.element=e};b.fx.property.prototype={_animate:function(i,h,f,e){var j={overflow:"hidden"},k={},g=this.element;d.each(i,function(m,n){var l;switch(n){case"height":case"width":l=g[n]();break;case"opacity":l=1;break;default:l=g.css(n);break}j[n]=f?l:0;k[n]=f?0:l});g.css(j).show().animate(k,{queue:false,duration:h,easing:"linear",complete:function(){if(f){g.hide()}d.each(k,function(l){k[l]=""});g.css(d.extend({overflow:""},k));if(e){e()}}})},play:function(f,e){this._animate(f.properties,f.openDuration,false,e)},rewind:function(f,e){this._animate(f.properties,f.closeDuration,true,e)}};b.fx.property.defaults=function(){return{list:[{name:"property",properties:arguments}],openDuration:"fast",closeDuration:"fast"}};d(document).ready(function(){if(d.browser.msie&&typeof(Sys)!="undefined"&&typeof(Sys.Mvc)!="undefined"&&typeof(Sys.Mvc.FormContext)!="undefined"){Sys.Mvc.FormContext._getFormElementsWithName=function(f,e){return d.grep(f.getElementsByTagName("*"),function(g){return g.name==e})}}})})(jQuery); |