sonarr-repo-only/NzbDrone.Web/Scripts/2011.1.315/telerik.grid.min.js

1 line
18 KiB
JavaScript
Raw Normal View History

2011-03-29 04:52:17 +00:00
(function(c){var g=c.telerik;var a=/"\\\/Date\((.*?)\)\\\/"/g;function d(h){return new Function("data",("var p=[];with(data){p.push('"+unescape(h).replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');"))}function f(h){return(h!=null?h+"":"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}g.grid=function(h,j){this.element=h;this.groups=[];this.editing={};this.filterBy="";this.groupBy="";this.orderBy="";c.extend(this,j);this.sorted=c.grep(this.columns,function(i){return i.order});this.$tbody=c("> .t-grid-content > table > tbody",h);this.scrollable=this.$tbody.length>0;if(!this.scrollable){this.$tbody=c("> table > tbody",h);this.$header=c("> table > thead tr",h);this.$footer=c("> table > tfoot",h)}else{c("> .t-grid-content",h).tScrollable();this.$header=c("> .t-grid-header tr",h);this.$footer=c("> .t-grid-footer",h)}this.$headerWrap=c("> .t-grid-header > .t-grid-header-wrap",h);this.$footerWrap=c("> .t-grid-footer > .t-grid-footer-wrap",h);var o=this.$headerWrap.add(this.$footerWrap);c("> .t-grid-content",h).bind("scroll",function(){o.scrollLeft(this.scrollLeft)});this.$tbody.delegate(".t-hierarchy-cell .t-plus, .t-hierarchy-cell .t-minus","click",g.stopAll(function(s){var r=c(s.target);var q=r.hasClass("t-plus");r.toggleClass("t-minus",q).toggleClass("t-plus",!q);var i=r.closest("tr.t-master-row");if(this.detail&&!i.next().hasClass("t-detail-row")){c(new g.stringBuilder().cat('<tr class="t-detail-row">').rep('<td class="t-group-cell"></td>',i.find(".t-group-cell").length).cat('<td class="t-hierarchy-cell"></td>').cat('<td class="t-detail-cell" colspan="').cat(this.$header.find("th:not(.t-group-cell,.t-hierarchy-cell):visible").length).cat('">').cat(this.displayDetails(this.dataItem(i))).cat("</td></tr>").string()).insertAfter(i)}g.trigger(this.element,q?"detailViewExpand":"detailViewCollapse",{masterRow:i[0],detailRow:i.next(".t-detail-row")[0]});i.next().toggle(q)},this));this.$pager=c("> .t-grid-pager .t-pager",h);var n=new g.dropDown({effects:g.fx.slide.defaults(),onClick:c.proxy(function(i){this.changePageSize(c(i.item).text());n.close()},this)});n.dataBind(j.pageSizesInDropDown||[]);c(document.documentElement).bind("mousedown",function(q){var i=n.$element[0];if(!c.contains(i,q.target)){n.close()}});this.$pager.delegate(".t-state-disabled","click",g.preventDefault).delegate(".t-link:not(.t-state-disabled)","mouseenter",g.hover).delegate(".t-link:not(.t-state-disabled)","mouseleave",g.leave).delegate("input[type=text]","keydown",c.proxy(this.pagerKeyDown,this)).delegate(".t-page-size .t-dropdown-wrap","click",function(){var i=c(this);n.open({offset:i.offset(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth(),zIndex:g.getElementZIndex(this)})});c("> .t-grid-pager",h).delegate(".t-refresh","click",c.proxy(this.refreshClick,this));c(h).delegate(".t-button","hover",g.preventDefault);if(this.sort){this.$header.delegate(".t-link","hover",function(){c(this).toggleClass("t-state-hover")})}var p="tr:not(.t-grouping-row,.t-detail-row,.t-no-data,:has(>.t-edit-container))";if(this.selectable){var m=this.$tbody[0];var l=this;this.$tbody.delegate(p,"click",function(i){if(this.parentNode==m){l.rowClick(i)}}).delegate(p,"hover",function(){if(this.parentNode==m){c(this).toggleClass("t-state-hover")}})}if(this.isAjax()){this.$pager.delegate(".t-link:not(.t-state-disabled)","click",g.stop(this.pagerClick,this));if(this.sort){this.$header.delegate(".t-link","click",g.stop(this.headerClick,this))}}for(var k=0;k<this.plugins.length;k++){g[this.plugins[k]].initialize(this)}g.bind(this,{columnResize:this.onColumnResize,columnReorder:this.onColumnReorder,"delete":this.onDelete,detailViewExpand:this.onDetailViewExpand,detailViewCollapse:this.onDetailViewCollapse,dataBinding:this.onDataBinding,dataBound:this.onDataBound,edit:this.onEdit,error:this.onError,load:this.onLoad,rowSelect:this.onRowSelect,rowDataBound:this.onRowDataBound,save:this.onSave,submitChanges:this.onSubm