Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
151 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. Ext.ns("Ext.ux.grid");Ext.ux.grid.BufferView=Ext.extend(Ext.grid.GridView,{rowHeight:19,borderHeight:2,scrollDelay:100,cacheSize:20,cleanDelay:500,initTemplates:function(){Ext.ux.grid.BufferView.superclass.initTemplates.call(this);var a=this.templates;a.rowHolder=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"></div>');a.rowHolder.disableFormats=true;a.rowHolder.compile();a.rowBody=new Ext.Template('<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",(this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':""),"</tbody></table>");a.rowBody.disableFormats=true;a.rowBody.compile()},getStyleRowHeight:function(){return Ext.isBorderBox?(this.rowHeight+this.borderHeight):this.rowHeight},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight},getVisibleRowCount:function(){var b=this.getCalculatedRowHeight(),a=this.scroller.dom.clientHeight;return(a<1)?0:Math.ceil(a/b)},getVisibleRows:function(){var a=this.getVisibleRowCount(),b=this.scroller.dom.scrollTop,c=(b===0?0:Math.floor(b/this.getCalculatedRowHeight())-1);return{first:Math.max(c,0),last:Math.min(c+a+2,this.ds.getCount()-1)}},doRender:function(g,k,u,a,s,A,l){var b=this.templates,f=b.cell,h=b.row,x=b.rowBody,n=s-1,t=this.getStyleRowHeight(),z=this.getVisibleRows(),d="width:"+this.getTotalWidth()+";height:"+t+"px;",D=[],w,E,v={},m={tstyle:d},q;for(var y=0,C=k.length;y<C;y++){q=k[y];w=[];var o=(y+a),e=o>=z.first&&o<=z.last;if(e){for(var B=0;B<s;B++){E=g[B];v.id=E.id;v.css=B===0?"x-grid3-cell-first ":(B==n?"x-grid3-cell-last ":"");v.attr=v.cellAttr="";v.value=E.renderer(q.data[E.name],v,q,o,B,u);v.style=E.style;if(v.value===undefined||v.value===""){v.value="&#160;"}if(q.dirty&&typeof q.modified[E.name]!=="undefined"){v.css+=" x-grid3-dirty-cell"}w[w.length]=f.apply(v)}}var F=[];if(A&&((o+1)%2===0)){F[0]="x-grid3-row-alt"}if(q.dirty){F[1]=" x-grid3-dirty-row"}m.cols=s;if(this.getRowClass){F[2]=this.getRowClass(q,o,m,u)}m.alt=F.join(" ");m.cells=w.join("");D[D.length]=!e?b.rowHolder.apply(m):(l?x.apply(m):h.apply(m))}return D.join("")},isRowRendered:function(a){var b=this.getRow(a);return b&&b.childNodes.length>0},syncScroll:function(){Ext.ux.grid.BufferView.superclass.syncScroll.apply(this,arguments);this.update()},update:function(){if(this.scrollDelay){if(!this.renderTask){this.renderTask=new Ext.util.DelayedTask(this.doUpdate,this)}this.renderTask.delay(this.scrollDelay)}else{this.doUpdate()}},onRemove:function(d,a,b,c){Ext.ux.grid.BufferView.superclass.onRemove.apply(this,arguments);if(c!==true){this.update()}},doUpdate:function(){if(this.getVisibleRowCount()>0){var f=this.grid,b=f.colModel,h=f.store,e=this.getColumnData(),a=this.getVisibleRows(),j;for(var d=a.first;d<=a.last;d++){if(!this.isRowRendered(d)&&(j=this.getRow(d))){var c=this.doRender(e,[h.getAt(d)],h,d,b.getColumnCount(),f.stripeRows,true);j.innerHTML=c}}this.clean()}},clean:function(){if(!this.cleanTask){this.cleanTask=new Ext.util.DelayedTask(this.doClean,this)}this.cleanTask.delay(this.cleanDelay)},doClean:function(){if(this.getVisibleRowCount()>0){var b=this.getVisibleRows();b.first-=this.cacheSize;b.last+=this.cacheSize;var c=0,d=this.getRows();if(b.first<=0){c=b.last+1}for(var a=this.ds.getCount();c<a;c++){if((c<b.first||c>b.last)&&d[c].innerHTML){d[c].innerHTML=""}}}},removeTask:function(b){var a=this[b];if(a&&a.cancel){a.cancel();this[b]=null}},destroy:function(){this.removeTask("cleanTask");this.removeTask("renderTask");Ext.ux.grid.BufferView.superclass.destroy.call(this)},layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update()}});Ext.ns("Ext.ux.layout");Ext.ux.layout.CenterLayout=Ext.extend(Ext.layout.FitLayout,{setItemSize:function(b,a){this.container.addClass("ux-layout-center");b.addClass("ux-layout-center-item");if(b&&a.height>0){if(b.width){a.width=b.width}b.setSize(a)}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.
  16. /*
  17. * Ext JS Library 3.3.0
  18. * Copyright(c) 2006-2010 Ext JS, Inc.
  19. * licensing@extjs.com
  20. * http://www.extjs.com/license
  21. */
  22. Ext.ns("Ext.ux.grid");Ext.ux.grid.LockingGridView=Ext.extend(Ext.grid.GridView,{lockText:"Lock",unlockText:"Unlock",rowBorderWidth:1,lockedBorderWidth:1,syncHeights:false,initTemplates:function(){var a=this.templates||{};if(!a.masterTpl){a.masterTpl=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-locked">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset" style="{lstyle}">{lockedHeader}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{lstyle}">{lockedBody}</div><div class="x-grid3-scroll-spacer"></div></div>',"</div>",'<div class="x-grid3-viewport x-grid3-unlocked">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset" style="{ostyle}">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{bstyle}">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>")}this.templates=a;Ext.ux.grid.LockingGridView.superclass.initTemplates.call(this)},getEditorParent:function(a){return this.el.dom},initElements:function(){var e=Ext.get(this.grid.getGridEl().dom.firstChild),g=e.child("div.x-grid3-locked"),c=g.child("div.x-grid3-header"),b=g.child("div.x-grid3-scroller"),f=e.child("div.x-grid3-viewport"),d=f.child("div.x-grid3-header"),a=f.child("div.x-grid3-scroller");if(this.grid.hideHeaders){c.setDisplayed(false);d.setDisplayed(false)}if(this.forceFit){a.setStyle("overflow-x","hidden")}Ext.apply(this,{el:e,mainWrap:f,mainHd:d,innerHd:d.dom.firstChild,scroller:a,mainBody:a.child("div.x-grid3-body"),focusEl:a.child("a"),resizeMarker:e.child("div.x-grid3-resize-marker"),resizeProxy:e.child("div.x-grid3-resize-proxy"),lockedWrap:g,lockedHd:c,lockedScroller:b,lockedBody:b.child("div.x-grid3-body"),lockedInnerHd:c.child("div.x-grid3-header-inner",true)});this.focusEl.swallowEvent("click",true)},getLockedRows:function(){return this.hasRows()?this.lockedBody.dom.childNodes:[]},getLockedRow:function(a){return this.getLockedRows()[a]},getCell:function(c,a){var b=this.cm.getLockedCount();if(a<b){return this.getLockedRow(c).getElementsByTagName("td")[a]}return Ext.ux.grid.LockingGridView.superclass.getCell.call(this,c,a-b)},getHeaderCell:function(a){var b=this.cm.getLockedCount();if(a<b){return this.lockedHd.dom.getElementsByTagName("td")[a]}return Ext.ux.grid.LockingGridView.superclass.getHeaderCell.call(this,a-b)},addRowClass:function(c,a){var b=this.getLockedRow(c);if(b){this.fly(b).addClass(a)}Ext.ux.grid.LockingGridView.superclass.addRowClass.call(this,c,a)},removeRowClass:function(c,a){var b=this.getLockedRow(c);if(b){this.fly(b).removeClass(a)}Ext.ux.grid.LockingGridView.superclass.removeRowClass.call(this,c,a)},removeRow:function(a){Ext.removeNode(this.getLockedRow(a));Ext.ux.grid.LockingGridView.superclass.removeRow.call(this,a)},removeRows:function(c,b){var a=this.lockedBody.dom,d=c;for(;d<=b;d++){Ext.removeNode(a.childNodes[c])}Ext.ux.grid.LockingGridView.superclass.removeRows.call(this,c,b)},syncScroll:function(a){this.lockedScroller.dom.scrollTop=this.scroller.dom.scrollTop;Ext.ux.grid.LockingGridView.superclass.syncScroll.call(this,a)},updateSortIcon:function(d,c){var a=this.sortClasses,e=this.lockedHd.select("td").removeClass(a),g=this.mainHd.select("td").removeClass(a),f=this.cm.getLockedCount(),b=a[c=="DESC"?1:0];if(d<f){e.item(d).addClass(b)}else{g.item(d-f).addClass(b)}},updateAllColumnWidths:function(){var g=this.getTotalWidth(),n=this.cm.getColumnCount(),b=this.getLockedWidth(),d=this.cm.getLockedCount(),k=[],h,e;this.updateLockedWidth();for(e=0;e<n;e++){k[e]=this.getColumnWidth(e);var f=this.getHeaderCell(e);f.style.width=k[e]}var a=this.getLockedRows(),m=this.getRows(),o,l,c;for(e=0,h=m.length;e<h;e++){o=a[e];o.style.width=b;if(o.firstChild){o.firstChild.style.width=b;l=o.firstChild.rows[0];for(c=0;c<d;c++){l.childNodes[c].style.width=k[c]}}o=m[e];
  23. </body>
  24. </html>