sonarr-repo-only/packages/TelerikMvcExtensions.2011.2.../content/Scripts/2011.2.712/telerik.grid.min.js

1 line
28 KiB
JavaScript
Raw Normal View History

(function(e){var d={TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F12:123};var k=e.telerik;var c=/"+\\\/Date\((.*?)\)\\\/"+/g;var g="tr:not(.t-grouping-row,.t-group-footer,.t-detail-row,.t-no-data,.t-footer-template):visible",f=">td:not(.t-group-cell,.t-hierarchy-cell)",a=g+f+":first";FOCUSED="t-state-focused";k.scripts.push("telerik.grid.js");function h(l){return new Function("data",("var p=[];with(data){p.push('"+unescape(l).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 j(l){return(l!=null?l+"":"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}k.grid=function(l,m){this.element=l;this.groups=[];this.editing={};this.filterBy="";this.groupBy="";this.orderBy="";e.extend(this,m);this.sorted=e.grep(this.columns,function(t){return t.order});this.$tbody=e("> .t-grid-content > table > tbody",l);this.scrollable=this.$tbody.length>0;if(!this.scrollable){this.$tbody=e("> table > tbody",l);this.$header=e("> table > thead tr",l);this.$footer=e("> table > tfoot",l)}else{e("> .t-grid-content",l).tScrollable();this.$header=e("> .t-grid-header tr",l);this.$footer=e("> .t-grid-footer",l)}this.$headerWrap=e("> .t-grid-header > .t-grid-header-wrap",l);this.$footerWrap=e("> .t-grid-footer > .t-grid-footer-wrap",l);var r=this.$headerWrap.add(this.$footerWrap);var p=this;e("> .t-grid-content",l).bind("scroll",function(){if(p.pageOnScroll){var t=this.scrollTop+this.clientHeight;if(t===this.scrollHeight&&p.currentPage<p.totalPages()){p.pageTo(p.currentPage+1)}}r.scrollLeft(this.scrollLeft)});if(this.rowTemplate){this.rowTemplate=h(this.rowTemplate)}this.$tbody.delegate(".t-hierarchy-cell .t-plus, .t-hierarchy-cell .t-minus","click",k.stopAll(function(x){var v=e(x.target);var u=v.hasClass("t-plus");v.toggleClass("t-minus",u).toggleClass("t-plus",!u);var t=v.closest("tr.t-master-row");if(this.detail&&!t.next().hasClass("t-detail-row")){var w=0;e.each(this.columns,function(){if(!this.hidden){w++}});e(new k.stringBuilder().cat('<tr class="t-detail-row">').rep('<td class="t-group-cell"></td>',t.find(".t-group-cell").length).cat('<td class="t-hierarchy-cell"></td>').cat('<td class="t-detail-cell" colspan="').cat(w).cat('">').cat(this.displayDetails(this.dataItem(t))).cat("</td></tr>").string()).insertAfter(t)}k.trigger(this.element,u?"detailViewExpand":"detailViewCollapse",{masterRow:t[0],detailRow:t.next(".t-detail-row")[0]});t.next().toggle(u)},this));this.$pager=e("> .t-grid-pager .t-pager",l);var q=new k.dropDown({effects:k.fx.slide.defaults(),onClick:e.proxy(function(t){this.changePageSize(e(t.item).text());q.close()},this)});q.dataBind(m.pageSizesInDropDown||[]);e(document.documentElement).bind("mousedown",function(u){var t=q.$element[0];if(!e.contains(t,u.target)){q.close()}});this.$pager.delegate(".t-state-disabled","click",k.preventDefault).delegate(".t-link:not(.t-state-disabled)","mouseenter",k.hover).delegate(".t-link:not(.t-state-disabled)","mouseleave",k.leave).delegate("input[type=text]","keydown",e.proxy(this.pagerKeyDown,this)).delegate(".t-page-size .t-dropdown-wrap","click",function(){var t=e(this);q.open({offset:t.offset(),outerHeight:t.outerHeight(),outerWidth:t.outerWidth(),zIndex:k.getElementZIndex(this)})});e("> .t-grid-pager",l).delegate(".t-refresh","click",e.proxy(this.refreshClick,this));e(l).delegate(".t-button","hover",k.preventDefault);if(this.sort){this.$header.delegate("a.t-link","hover",function(){e(this).toggleClass("t-state-hover")})}var s="tr:not(.t-grouping-row,.t-detail-row,.t-no-data,:has(>.t-edit-container))";if(this.selectable){var n=this.$tbody[0];this.$tbody.delegate(s,"click",function(t){if(this.parentNode==n){p.rowClick(t)}}).delegate(s,"hover",function(t){if(this.parentNode==n){if(t.type=="mouseenter"){e(this).addClass("t-state-hover")}else{e(this).removeClass("t-state-hover")}}})}if(this.isAjax()||this.operationMode==="client"){this.$pager.delegate(".t-link:not(.t-state-di