You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2016/01/23 02:10:17 UTC
[04/51] [partial] qpid-dispatch git commit: DISPATCH-201 - Removing
all files not needed for stand-alone version. Adding any missing licensing
info.
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e5a144ce/console/lib/ColReorder.min.js
----------------------------------------------------------------------
diff --git a/console/lib/ColReorder.min.js b/console/lib/ColReorder.min.js
deleted file mode 100644
index 111f4b8..0000000
--- a/console/lib/ColReorder.min.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * File: ColReorder.min.js
- * Version: 1.0.8
- * Author: Allan Jardine (www.sprymedia.co.uk)
- *
- * Copyright 2010-2012 Allan Jardine, all rights reserved.
- *
- * This source file is free software, under either the GPL v2 license or a
- * BSD (3 point) style license, as supplied with this software.
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- */
-(function(f,o,g){function m(a){for(var b=[],d=0,c=a.length;d<c;d++)b[a[d]]=d;return b}function j(a,b,d){b=a.splice(b,1)[0];a.splice(d,0,b)}function n(a,b,d){for(var c=[],e=0,f=a.childNodes.length;e<f;e++)1==a.childNodes[e].nodeType&&c.push(a.childNodes[e]);b=c[b];null!==d?a.insertBefore(b,c[d]):a.appendChild(b)}f.fn.dataTableExt.oApi.fnColReorder=function(a,b,d){var c,e,h,l,k=a.aoColumns.length,i;if(b!=d)if(0>b||b>=k)this.oApi._fnLog(a,1,"ColReorder 'from' index is out of bounds: "+b);else if(0>d||
-d>=k)this.oApi._fnLog(a,1,"ColReorder 'to' index is out of bounds: "+d);else{var g=[];c=0;for(e=k;c<e;c++)g[c]=c;j(g,b,d);g=m(g);c=0;for(e=a.aaSorting.length;c<e;c++)a.aaSorting[c][0]=g[a.aaSorting[c][0]];if(null!==a.aaSortingFixed){c=0;for(e=a.aaSortingFixed.length;c<e;c++)a.aaSortingFixed[c][0]=g[a.aaSortingFixed[c][0]]}c=0;for(e=k;c<e;c++){i=a.aoColumns[c];h=0;for(l=i.aDataSort.length;h<l;h++)i.aDataSort[h]=g[i.aDataSort[h]]}c=0;for(e=k;c<e;c++)i=a.aoColumns[c],"number"==typeof i.mData&&(i.mData=
-g[i.mData],i.fnGetData=a.oApi._fnGetObjectDataFn(i.mData),i.fnSetData=a.oApi._fnSetObjectDataFn(i.mData));if(a.aoColumns[b].bVisible){l=this.oApi._fnColumnIndexToVisible(a,b);i=null;for(c=d<b?d:d+1;null===i&&c<k;)i=this.oApi._fnColumnIndexToVisible(a,c),c++;h=a.nTHead.getElementsByTagName("tr");c=0;for(e=h.length;c<e;c++)n(h[c],l,i);if(null!==a.nTFoot){h=a.nTFoot.getElementsByTagName("tr");c=0;for(e=h.length;c<e;c++)n(h[c],l,i)}c=0;for(e=a.aoData.length;c<e;c++)null!==a.aoData[c].nTr&&n(a.aoData[c].nTr,
-l,i)}j(a.aoColumns,b,d);j(a.aoPreSearchCols,b,d);c=0;for(e=a.aoData.length;c<e;c++)f.isArray(a.aoData[c]._aData)&&j(a.aoData[c]._aData,b,d),j(a.aoData[c]._anHidden,b,d);c=0;for(e=a.aoHeader.length;c<e;c++)j(a.aoHeader[c],b,d);if(null!==a.aoFooter){c=0;for(e=a.aoFooter.length;c<e;c++)j(a.aoFooter[c],b,d)}c=0;for(e=k;c<e;c++)f(a.aoColumns[c].nTh).unbind("click"),this.oApi._fnSortAttachListener(a,a.aoColumns[c].nTh,c);f(a.oInstance).trigger("column-reorder",[a,{iFrom:b,iTo:d,aiInvertMapping:g}]);"undefined"!=
-typeof a.oInstance._oPluginFixedHeader&&a.oInstance._oPluginFixedHeader.fnUpdate()}};ColReorder=function(a,b){(!this.CLASS||"ColReorder"!=this.CLASS)&&alert("Warning: ColReorder must be initialised with the keyword 'new'");"undefined"==typeof b&&(b={});this.s={dt:null,init:b,fixed:0,dropCallback:null,mouse:{startX:-1,startY:-1,offsetX:-1,offsetY:-1,target:-1,targetIndex:-1,fromIndex:-1},aoTargets:[]};this.dom={drag:null,pointer:null};this.s.dt=a.oInstance.fnSettings();this._fnConstruct();a.oApi._fnCallbackReg(a,
-"aoDestroyCallback",jQuery.proxy(this._fnDestroy,this),"ColReorder");ColReorder.aoInstances.push(this);return this};ColReorder.prototype={fnReset:function(){for(var a=[],b=0,d=this.s.dt.aoColumns.length;b<d;b++)a.push(this.s.dt.aoColumns[b]._ColReorder_iOrigCol);this._fnOrderColumns(a)},_fnConstruct:function(){var a=this,b,d;"undefined"!=typeof this.s.init.iFixedColumns&&(this.s.fixed=this.s.init.iFixedColumns);"undefined"!=typeof this.s.init.fnReorderCallback&&(this.s.dropCallback=this.s.init.fnReorderCallback);
-b=0;for(d=this.s.dt.aoColumns.length;b<d;b++)b>this.s.fixed-1&&this._fnMouseListener(b,this.s.dt.aoColumns[b].nTh),this.s.dt.aoColumns[b]._ColReorder_iOrigCol=b;this.s.dt.oApi._fnCallbackReg(this.s.dt,"aoStateSaveParams",function(c,b){a._fnStateSave.call(a,b)},"ColReorder_State");var c=null;"undefined"!=typeof this.s.init.aiOrder&&(c=this.s.init.aiOrder.slice());this.s.dt.oLoadedState&&("undefined"!=typeof this.s.dt.oLoadedState.ColReorder&&this.s.dt.oLoadedState.ColReorder.length==this.s.dt.aoColumns.length)&&
-(c=this.s.dt.oLoadedState.ColReorder);if(c)if(a.s.dt._bInitComplete)b=m(c),a._fnOrderColumns.call(a,b);else{var e=!1;this.s.dt.aoDrawCallback.push({fn:function(){if(!a.s.dt._bInitComplete&&!e){e=true;var b=m(c);a._fnOrderColumns.call(a,b)}},sName:"ColReorder_Pre"})}},_fnOrderColumns:function(a){if(a.length!=this.s.dt.aoColumns.length)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"ColReorder - array reorder does not match known number of columns. Skipping.");else{for(var b=0,d=a.length;b<d;b++){var c=
-f.inArray(b,a);b!=c&&(j(a,c,b),this.s.dt.oInstance.fnColReorder(c,b))}(""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY)&&this.s.dt.oInstance.fnAdjustColumnSizing();this.s.dt.oInstance.oApi._fnSaveState(this.s.dt)}},_fnStateSave:function(a){var b,d,c,e=this.s.dt;for(b=0;b<a.aaSorting.length;b++)a.aaSorting[b][0]=e.aoColumns[a.aaSorting[b][0]]._ColReorder_iOrigCol;aSearchCopy=f.extend(!0,[],a.aoSearchCols);a.ColReorder=[];b=0;for(d=e.aoColumns.length;b<d;b++)c=e.aoColumns[b]._ColReorder_iOrigCol,
-a.aoSearchCols[c]=aSearchCopy[b],a.abVisCols[c]=e.aoColumns[b].bVisible,a.ColReorder.push(c)},_fnMouseListener:function(a,b){var d=this;f(b).bind("mousedown.ColReorder",function(a){a.preventDefault();d._fnMouseDown.call(d,a,b)})},_fnMouseDown:function(a,b){var d=this,c=this.s.dt.aoColumns,e="TH"==a.target.nodeName?a.target:f(a.target).parents("TH")[0],e=f(e).offset();this.s.mouse.startX=a.pageX;this.s.mouse.startY=a.pageY;this.s.mouse.offsetX=a.pageX-e.left;this.s.mouse.offsetY=a.pageY-e.top;this.s.mouse.target=
-b;this.s.mouse.targetIndex=f("th",b.parentNode).index(b);this.s.mouse.fromIndex=this.s.dt.oInstance.oApi._fnVisibleToColumnIndex(this.s.dt,this.s.mouse.targetIndex);this.s.aoTargets.splice(0,this.s.aoTargets.length);this.s.aoTargets.push({x:f(this.s.dt.nTable).offset().left,to:0});for(var h=e=0,j=c.length;h<j;h++)h!=this.s.mouse.fromIndex&&e++,c[h].bVisible&&this.s.aoTargets.push({x:f(c[h].nTh).offset().left+f(c[h].nTh).outerWidth(),to:e});0!==this.s.fixed&&this.s.aoTargets.splice(0,this.s.fixed);
-f(g).bind("mousemove.ColReorder",function(a){d._fnMouseMove.call(d,a)});f(g).bind("mouseup.ColReorder",function(a){d._fnMouseUp.call(d,a)})},_fnMouseMove:function(a){if(null===this.dom.drag){if(5>Math.pow(Math.pow(a.pageX-this.s.mouse.startX,2)+Math.pow(a.pageY-this.s.mouse.startY,2),0.5))return;this._fnCreateDragNode()}this.dom.drag.style.left=a.pageX-this.s.mouse.offsetX+"px";this.dom.drag.style.top=a.pageY-this.s.mouse.offsetY+"px";for(var b=!1,d=1,c=this.s.aoTargets.length;d<c;d++)if(a.pageX<
-this.s.aoTargets[d-1].x+(this.s.aoTargets[d].x-this.s.aoTargets[d-1].x)/2){this.dom.pointer.style.left=this.s.aoTargets[d-1].x+"px";this.s.mouse.toIndex=this.s.aoTargets[d-1].to;b=!0;break}b||(this.dom.pointer.style.left=this.s.aoTargets[this.s.aoTargets.length-1].x+"px",this.s.mouse.toIndex=this.s.aoTargets[this.s.aoTargets.length-1].to)},_fnMouseUp:function(){f(g).unbind("mousemove.ColReorder");f(g).unbind("mouseup.ColReorder");null!==this.dom.drag&&(g.body.removeChild(this.dom.drag),g.body.removeChild(this.dom.pointer),
-this.dom.drag=null,this.dom.pointer=null,this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex),(""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY)&&this.s.dt.oInstance.fnAdjustColumnSizing(),null!==this.s.dropCallback&&this.s.dropCallback.call(this),this.s.dt.oInstance.oApi._fnSaveState(this.s.dt))},_fnCreateDragNode:function(){var a=this;this.dom.drag=f(this.s.dt.nTHead.parentNode).clone(!0)[0];for(this.dom.drag.className+=" DTCR_clonedTable";0<this.dom.drag.getElementsByTagName("caption").length;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("caption")[0]);
-for(;0<this.dom.drag.getElementsByTagName("tbody").length;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("tbody")[0]);for(;0<this.dom.drag.getElementsByTagName("tfoot").length;)this.dom.drag.removeChild(this.dom.drag.getElementsByTagName("tfoot")[0]);f("thead tr:eq(0)",this.dom.drag).each(function(){f("th",this).eq(a.s.mouse.targetIndex).siblings().remove()});f("tr",this.dom.drag).height(f("tr:eq(0)",a.s.dt.nTHead).height());f("thead tr:gt(0)",this.dom.drag).remove();f("thead th:eq(0)",
-this.dom.drag).each(function(){this.style.width=f("th:eq("+a.s.mouse.targetIndex+")",a.s.dt.nTHead).width()+"px"});this.dom.drag.style.position="absolute";this.dom.drag.style.top="0px";this.dom.drag.style.left="0px";this.dom.drag.style.width=f("th:eq("+a.s.mouse.targetIndex+")",a.s.dt.nTHead).outerWidth()+"px";this.dom.pointer=g.createElement("div");this.dom.pointer.className="DTCR_pointer";this.dom.pointer.style.position="absolute";""===this.s.dt.oScroll.sX&&""===this.s.dt.oScroll.sY?(this.dom.pointer.style.top=
-f(this.s.dt.nTable).offset().top+"px",this.dom.pointer.style.height=f(this.s.dt.nTable).height()+"px"):(this.dom.pointer.style.top=f("div.dataTables_scroll",this.s.dt.nTableWrapper).offset().top+"px",this.dom.pointer.style.height=f("div.dataTables_scroll",this.s.dt.nTableWrapper).height()+"px");g.body.appendChild(this.dom.pointer);g.body.appendChild(this.dom.drag)},_fnDestroy:function(){for(var a=0,b=ColReorder.aoInstances.length;a<b;a++)if(ColReorder.aoInstances[a]===this){ColReorder.aoInstances.splice(a,
-1);break}f(this.s.dt.nTHead).find("*").unbind(".ColReorder");this.s=this.s.dt.oInstance._oPluginColReorder=null}};ColReorder.aoInstances=[];ColReorder.fnReset=function(a){for(var b=0,d=ColReorder.aoInstances.length;b<d;b++)ColReorder.aoInstances[b].s.dt.oInstance==a&&ColReorder.aoInstances[b].fnReset()};ColReorder.prototype.CLASS="ColReorder";ColReorder.VERSION="1.0.8";ColReorder.prototype.VERSION=ColReorder.VERSION;"function"==typeof f.fn.dataTable&&"function"==typeof f.fn.dataTableExt.fnVersionCheck&&
-f.fn.dataTableExt.fnVersionCheck("1.9.3")?f.fn.dataTableExt.aoFeatures.push({fnInit:function(a){var b=a.oInstance;"undefined"==typeof b._oPluginColReorder?b._oPluginColReorder=new ColReorder(a,"undefined"!=typeof a.oInit.oColReorder?a.oInit.oColReorder:{}):b.oApi._fnLog(a,1,"ColReorder attempted to initialise twice. Ignoring second");return null},cFeature:"R",sFeature:"ColReorder"}):alert("Warning: ColReorder requires DataTables 1.9.3 or greater - www.datatables.net/download")})(jQuery,window,document);
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e5a144ce/console/lib/KeyTable.js
----------------------------------------------------------------------
diff --git a/console/lib/KeyTable.js b/console/lib/KeyTable.js
deleted file mode 100644
index edcdb8a..0000000
--- a/console/lib/KeyTable.js
+++ /dev/null
@@ -1,1115 +0,0 @@
-/*
- * File: KeyTable.js
- * Version: 1.1.7
- * CVS: $Idj$
- * Description: Keyboard navigation for HTML tables
- * Author: Allan Jardine (www.sprymedia.co.uk)
- * Created: Fri Mar 13 21:24:02 GMT 2009
- * Modified: $Date$ by $Author$
- * Language: Javascript
- * License: GPL v2 or BSD 3 point style
- * Project: Just a little bit of fun :-)
- * Contact: www.sprymedia.co.uk/contact
- *
- * Copyright 2009-2011 Allan Jardine, all rights reserved.
- *
- * This source file is free software, under either the GPL v2 license or a
- * BSD style license, available at:
- * http://datatables.net/license_gpl2
- * http://datatables.net/license_bsd
- */
-
-
-function KeyTable ( oInit )
-{
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * API parameters
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
- /*
- * Variable: block
- * Purpose: Flag whether or not KeyTable events should be processed
- * Scope: KeyTable - public
- */
- this.block = false;
-
- /*
- * Variable: event
- * Purpose: Container for all event application methods
- * Scope: KeyTable - public
- * Notes: This object contains all the public methods for adding and removing events - these
- * are dynamically added later on
- */
- this.event = {
- "remove": {}
- };
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * API methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
- /*
- * Function: fnGetCurrentPosition
- * Purpose: Get the currently focused cell's position
- * Returns: array int: [ x, y ]
- * Inputs: void
- */
- this.fnGetCurrentPosition = function ()
- {
- return [ _iOldX, _iOldY ];
- };
-
-
- /*
- * Function: fnGetCurrentData
- * Purpose: Get the currently focused cell's data (innerHTML)
- * Returns: string: - data requested
- * Inputs: void
- */
- this.fnGetCurrentData = function ()
- {
- return _nOldFocus.innerHTML;
- };
-
-
- /*
- * Function: fnGetCurrentTD
- * Purpose: Get the currently focused cell
- * Returns: node: - focused element
- * Inputs: void
- */
- this.fnGetCurrentTD = function ()
- {
- return _nOldFocus;
- };
-
-
- /*
- * Function: fnSetPosition
- * Purpose: Set the position of the focused cell
- * Returns: -
- * Inputs: int:x - x coordinate
- * int:y - y coordinate
- * Notes: Thanks to Rohan Daxini for the basis of this function
- */
- this.fnSetPosition = function( x, y )
- {
- if ( typeof x == 'object' && x.nodeName )
- {
- _fnSetFocus( x );
- }
- else
- {
- _fnSetFocus( _fnCellFromCoords(x, y) );
- }
- };
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private parameters
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
- /*
- * Variable: _nBody
- * Purpose: Body node of the table - cached for renference
- * Scope: KeyTable - private
- */
- var _nBody = null;
-
- /*
- * Variable:
- * Purpose:
- * Scope: KeyTable - private
- */
- var _nOldFocus = null;
-
- /*
- * Variable: _iOldX and _iOldY
- * Purpose: X and Y coords of the old elemet that was focused on
- * Scope: KeyTable - private
- */
- var _iOldX = null;
- var _iOldY = null;
-
- /*
- * Variable: _that
- * Purpose: Scope saving for 'this' after a jQuery event
- * Scope: KeyTable - private
- */
- var _that = null;
-
- /*
- * Variable: sFocusClass
- * Purpose: Class that should be used for focusing on a cell
- * Scope: KeyTable - private
- */
- var _sFocusClass = "focus";
-
- /*
- * Variable: _bKeyCapture
- * Purpose: Flag for should KeyTable capture key events or not
- * Scope: KeyTable - private
- */
- var _bKeyCapture = false;
-
- /*
- * Variable: _oaoEvents
- * Purpose: Event cache object, one array for each supported event for speed of searching
- * Scope: KeyTable - private
- */
- var _oaoEvents = {
- "action": [],
- "esc": [],
- "focus": [],
- "blur": []
- };
-
- /*
- * Variable: _oDatatable
- * Purpose: DataTables object for if we are actually using a DataTables table
- * Scope: KeyTable - private
- */
- var _oDatatable = null;
-
- var _bForm;
- var _nInput;
- var _bInputFocused = false;
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Private methods
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Key table events
- */
-
- /*
- * Function: _fnEventAddTemplate
- * Purpose: Create a function (with closure for sKey) event addition API
- * Returns: function: - template function
- * Inputs: string:sKey - type of event to detect
- */
- function _fnEventAddTemplate( sKey )
- {
- /*
- * Function: -
- * Purpose: API function for adding event to cache
- * Returns: -
- * Inputs: 1. node:x - target node to add event for
- * 2. function:y - callback function to apply
- * or
- * 1. int:x - x coord. of target cell (can be null for live events)
- * 2. int:y - y coord. of target cell (can be null for live events)
- * 3. function:z - callback function to apply
- * Notes: This function is (interally) overloaded (in as much as javascript allows for
- * that) - the target cell can be given by either node or coords.
- */
- return function ( x, y, z ) {
- if ( (x===null || typeof x == "number") &&
- (y===null || typeof y == "number") &&
- typeof z == "function" )
- {
- _fnEventAdd( sKey, x, y, z );
- }
- else if ( typeof x == "object" && typeof y == "function" )
- {
- var aCoords = _fnCoordsFromCell( x );
- _fnEventAdd( sKey, aCoords[0], aCoords[1], y );
- }
- else
- {
- alert( "Unhandable event type was added: x" +x+ " y:" +y+ " z:" +z );
- }
- };
- }
-
-
- /*
- * Function: _fnEventRemoveTemplate
- * Purpose: Create a function (with closure for sKey) event removal API
- * Returns: function: - template function
- * Inputs: string:sKey - type of event to detect
- */
- function _fnEventRemoveTemplate( sKey )
- {
- /*
- * Function: -
- * Purpose: API function for removing event from cache
- * Returns: int: - number of events removed
- * Inputs: 1. node:x - target node to remove event from
- * 2. function:y - callback function to apply
- * or
- * 1. int:x - x coord. of target cell (can be null for live events)
- * 2. int:y - y coord. of target cell (can be null for live events)
- * 3. function:z - callback function to remove - optional
- * Notes: This function is (interally) overloaded (in as much as javascript allows for
- * that) - the target cell can be given by either node or coords and the function
- * to remove is optional
- */
- return function ( x, y, z ) {
- if ( (x===null || typeof arguments[0] == "number") &&
- (y===null || typeof arguments[1] == "number" ) )
- {
- if ( typeof arguments[2] == "function" )
- {
- _fnEventRemove( sKey, x, y, z );
- }
- else
- {
- _fnEventRemove( sKey, x, y );
- }
- }
- else if ( typeof arguments[0] == "object" )
- {
- var aCoords = _fnCoordsFromCell( x );
- if ( typeof arguments[1] == "function" )
- {
- _fnEventRemove( sKey, aCoords[0], aCoords[1], y );
- }
- else
- {
- _fnEventRemove( sKey, aCoords[0], aCoords[1] );
- }
- }
- else
- {
- alert( "Unhandable event type was removed: x" +x+ " y:" +y+ " z:" +z );
- }
- };
- }
-
- /* Use the template functions to add the event API functions */
- for ( var sKey in _oaoEvents )
- {
- if ( sKey )
- {
- this.event[sKey] = _fnEventAddTemplate( sKey );
- this.event.remove[sKey] = _fnEventRemoveTemplate( sKey );
- }
- }
-
-
- /*
- * Function: _fnEventAdd
- * Purpose: Add an event to the internal cache
- * Returns: -
- * Inputs: string:sType - type of event to add, given by the available elements in _oaoEvents
- * int:x - x-coords to add event to - can be null for "blanket" event
- * int:y - y-coords to add event to - can be null for "blanket" event
- * function:fn - callback function for when triggered
- */
- function _fnEventAdd( sType, x, y, fn )
- {
- _oaoEvents[sType].push( {
- "x": x,
- "y": y,
- "fn": fn
- } );
- }
-
-
- /*
- * Function: _fnEventRemove
- * Purpose: Remove an event from the event cache
- * Returns: int: - number of matching events removed
- * Inputs: string:sType - type of event to look for
- * node:nTarget - target table cell
- * function:fn - optional - remove this function. If not given all handlers of this
- * type will be removed
- */
- function _fnEventRemove( sType, x, y, fn )
- {
- var iCorrector = 0;
-
- for ( var i=0, iLen=_oaoEvents[sType].length ; i<iLen-iCorrector ; i++ )
- {
- if ( typeof fn != 'undefined' )
- {
- if ( _oaoEvents[sType][i-iCorrector].x == x &&
- _oaoEvents[sType][i-iCorrector].y == y &&
- _oaoEvents[sType][i-iCorrector].fn == fn )
- {
- _oaoEvents[sType].splice( i-iCorrector, 1 );
- iCorrector++;
- }
- }
- else
- {
- if ( _oaoEvents[sType][i-iCorrector].x == x &&
- _oaoEvents[sType][i-iCorrector].y == y )
- {
- _oaoEvents[sType].splice( i, 1 );
- return 1;
- }
- }
- }
- return iCorrector;
- }
-
-
- /*
- * Function: _fnEventFire
- * Purpose: Look thought the events cache and fire off the event of interest
- * Returns: int:iFired - number of events fired
- * Inputs: string:sType - type of event to look for
- * int:x - x coord of cell
- * int:y - y coord of ell
- * Notes: It might be more efficient to return after the first event has been tirggered,
- * but that would mean that only one function of a particular type can be
- * subscribed to a particular node.
- */
- function _fnEventFire ( sType, x, y )
- {
- var iFired = 0;
- var aEvents = _oaoEvents[sType];
- for ( var i=0 ; i<aEvents.length ; i++ )
- {
- if ( (aEvents[i].x == x && aEvents[i].y == y ) ||
- (aEvents[i].x === null && aEvents[i].y == y ) ||
- (aEvents[i].x == x && aEvents[i].y === null ) ||
- (aEvents[i].x === null && aEvents[i].y === null )
- )
- {
- aEvents[i].fn( _fnCellFromCoords(x,y), x, y );
- iFired++;
- }
- }
- return iFired;
- }
-
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Focus functions
- */
-
- /*
- * Function: _fnSetFocus
- * Purpose: Set focus on a node, and remove from an old node if needed
- * Returns: -
- * Inputs: node:nTarget - node we want to focus on
- * bool:bAutoScroll - optional - should we scroll the view port to the display
- */
- function _fnSetFocus( nTarget, bAutoScroll )
- {
- /* If node already has focus, just ignore this call */
- if ( _nOldFocus == nTarget )
- {
- return;
- }
-
- if ( typeof bAutoScroll == 'undefined' )
- {
- bAutoScroll = true;
- }
-
- /* Remove old focus (with blur event if needed) */
- if ( _nOldFocus !== null )
- {
- _fnRemoveFocus( _nOldFocus );
- }
-
- /* Add the new class to highlight the focused cell */
- jQuery(nTarget).addClass( _sFocusClass );
- jQuery(nTarget).parent().addClass( _sFocusClass );
-
- /* If it's a DataTable then we need to jump the paging to the relevant page */
- var oSettings;
- if ( _oDatatable )
- {
- oSettings = _oDatatable.fnSettings();
- var cell = _fnFindDtCell( nTarget );
- if (cell === null) {
- return;
- }
- var iRow = cell[1];
- var bKeyCaptureCache = _bKeyCapture;
-
- /* Page forwards */
- while ( iRow >= oSettings.fnDisplayEnd() )
- {
- if ( oSettings._iDisplayLength >= 0 )
- {
- /* Make sure we are not over running the display array */
- if ( oSettings._iDisplayStart + oSettings._iDisplayLength < oSettings.fnRecordsDisplay() )
- {
- oSettings._iDisplayStart += oSettings._iDisplayLength;
- }
- }
- else
- {
- oSettings._iDisplayStart = 0;
- }
- _oDatatable.oApi._fnCalculateEnd( oSettings );
- }
-
- /* Page backwards */
- while ( iRow < oSettings._iDisplayStart )
- {
- oSettings._iDisplayStart = oSettings._iDisplayLength>=0 ?
- oSettings._iDisplayStart - oSettings._iDisplayLength :
- 0;
-
- if ( oSettings._iDisplayStart < 0 )
- {
- oSettings._iDisplayStart = 0;
- }
- _oDatatable.oApi._fnCalculateEnd( oSettings );
- }
-
- /* Re-draw the table */
- _oDatatable.oApi._fnDraw( oSettings );
-
- /* Restore the key capture */
- _bKeyCapture = bKeyCaptureCache;
- }
-
- /* Cache the information that we are interested in */
- var aNewPos = _fnCoordsFromCell( nTarget );
- _nOldFocus = nTarget;
- _iOldX = aNewPos[0];
- _iOldY = aNewPos[1];
-
- var iViewportHeight, iViewportWidth, iScrollTop, iScrollLeft, iHeight, iWidth, aiPos;
- if ( bAutoScroll )
- {
- /* Scroll the viewport such that the new cell is fully visible in the rendered window */
- iViewportHeight = document.documentElement.clientHeight;
- iViewportWidth = document.documentElement.clientWidth;
- iScrollTop = document.body.scrollTop || document.documentElement.scrollTop;
- iScrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
- iHeight = nTarget.offsetHeight;
- iWidth = nTarget.offsetWidth;
- aiPos = _fnGetPos( nTarget );
-
- /* Take account of scrolling in DataTables 1.7 - remove scrolling since that would add to
- * the positioning calculation
- */
- if ( _oDatatable && typeof oSettings.oScroll != 'undefined' &&
- (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") )
- {
- aiPos[1] -= $(oSettings.nTable.parentNode).scrollTop();
- aiPos[0] -= $(oSettings.nTable.parentNode).scrollLeft();
- }
-
- /* Correct viewport positioning for vertical scrolling */
- if ( aiPos[1]+iHeight > iScrollTop+iViewportHeight )
- {
- /* Displayed element if off the bottom of the viewport */
- _fnSetScrollTop( aiPos[1]+iHeight - iViewportHeight );
- }
- else if ( aiPos[1] < iScrollTop )
- {
- /* Displayed element if off the top of the viewport */
- _fnSetScrollTop( aiPos[1] );
- }
-
- /* Correct viewport positioning for horizontal scrolling */
- if ( aiPos[0]+iWidth > iScrollLeft+iViewportWidth )
- {
- /* Displayed element is off the bottom of the viewport */
- _fnSetScrollLeft( aiPos[0]+iWidth - iViewportWidth );
- }
- else if ( aiPos[0] < iScrollLeft )
- {
- /* Displayed element if off the Left of the viewport */
- _fnSetScrollLeft( aiPos[0] );
- }
- }
-
- /* Take account of scrolling in DataTables 1.7 */
- if ( _oDatatable && typeof oSettings.oScroll != 'undefined' &&
- (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") )
- {
- var dtScrollBody = oSettings.nTable.parentNode;
- iViewportHeight = dtScrollBody.clientHeight;
- iViewportWidth = dtScrollBody.clientWidth;
- iScrollTop = dtScrollBody.scrollTop;
- iScrollLeft = dtScrollBody.scrollLeft;
- iHeight = nTarget.offsetHeight;
- iWidth = nTarget.offsetWidth;
-
- /* Correct for vertical scrolling */
- if ( nTarget.offsetTop + iHeight > iViewportHeight+iScrollTop )
- {
- dtScrollBody.scrollTop = (nTarget.offsetTop + iHeight) - iViewportHeight;
- }
- else if ( nTarget.offsetTop < iScrollTop )
- {
- dtScrollBody.scrollTop = nTarget.offsetTop;
- }
-
- /* Correct for horizontal scrolling */
- if ( nTarget.offsetLeft + iWidth > iViewportWidth+iScrollLeft )
- {
- dtScrollBody.scrollLeft = (nTarget.offsetLeft + iWidth) - iViewportWidth;
- }
- else if ( nTarget.offsetLeft < iScrollLeft )
- {
- dtScrollBody.scrollLeft = nTarget.offsetLeft;
- }
- }
-
- /* Focused - so we want to capture the keys */
- _fnCaptureKeys();
-
- /* Fire of the focus event if there is one */
- _fnEventFire( "focus", _iOldX, _iOldY );
- }
-
-
- /*
- * Function: _fnBlur
- * Purpose: Blur focus from the whole table
- * Returns: -
- * Inputs: -
- */
- function _fnBlur()
- {
- _fnRemoveFocus( _nOldFocus );
- _iOldX = null;
- _iOldY = null;
- _nOldFocus = null;
- _fnReleaseKeys();
- }
-
-
- /*
- * Function: _fnRemoveFocus
- * Purpose: Remove focus from a cell and fire any blur events which are attached
- * Returns: -
- * Inputs: node:nTarget - cell of interest
- */
- function _fnRemoveFocus( nTarget )
- {
- jQuery(nTarget).removeClass( _sFocusClass );
- jQuery(nTarget).parent().removeClass( _sFocusClass );
- _fnEventFire( "blur", _iOldX, _iOldY );
- }
-
-
- /*
- * Function: _fnClick
- * Purpose: Focus on the element that has been clicked on by the user
- * Returns: -
- * Inputs: event:e - click event
- */
- function _fnClick ( e )
- {
- var nTarget = this;
- while ( nTarget.nodeName != "TD" )
- {
- nTarget = nTarget.parentNode;
- }
-
- _fnSetFocus( nTarget );
- _fnCaptureKeys();
- }
-
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Key events
- */
-
- /*
- * Function: _fnKey
- * Purpose: Deal with a key events, be it moving the focus or return etc.
- * Returns: bool: - allow browser default action
- * Inputs: event:e - key event
- */
- function _fnKey ( e )
- {
- /* If user or system has blocked KeyTable from doing anything, just ignore this event */
- if ( _that.block || !_bKeyCapture )
- {
- return true;
- }
-
- /* If a modifier key is pressed (exapct shift), ignore the event */
- if ( e.metaKey || e.altKey || e.ctrlKey )
- {
- return true;
- }
- var
- x, y,
- iTableWidth = _nBody.getElementsByTagName('tr')[0].getElementsByTagName('td').length,
- iTableHeight;
-
- /* Get table height and width - done here so as to be dynamic (if table is updated) */
- if ( _oDatatable )
- {
- /*
- * Locate the current node in the DataTable overriding the old positions - the reason for
- * is is that there might have been some DataTables interaction between the last focus and
- * now
- */
- var oSettings = _oDatatable.fnSettings();
- iTableHeight = oSettings.aiDisplay.length;
-
- var aDtPos = _fnFindDtCell( _nOldFocus );
- if ( aDtPos === null )
- {
- /* If the table has been updated such that the focused cell can't be seen - do nothing */
- return;
- }
- _iOldX = aDtPos[ 0 ];
- _iOldY = aDtPos[ 1 ];
- }
- else
- {
- iTableHeight = _nBody.getElementsByTagName('tr').length;
- }
-
- /* Capture shift+tab to match the left arrow key */
- var iKey = (e.keyCode == 9 && e.shiftKey) ? -1 : e.keyCode;
-
- switch( iKey )
- {
- case 13: /* return */
- e.preventDefault();
- e.stopPropagation();
- _fnEventFire( "action", _iOldX, _iOldY );
- return true;
-
- case 27: /* esc */
- if ( !_fnEventFire( "esc", _iOldX, _iOldY ) )
- {
- /* Only lose focus if there isn't an escape handler on the cell */
- _fnBlur();
- return;
- }
- x = _iOldX;
- y = _iOldY;
- break;
-
- case -1:
- case 37: /* left arrow */
- if ( _iOldX > 0 ) {
- x = _iOldX - 1;
- y = _iOldY;
- } else if ( _iOldY > 0 ) {
- x = iTableWidth-1;
- y = _iOldY - 1;
- } else {
- /* at start of table */
- if ( iKey == -1 && _bForm )
- {
- /* If we are in a form, return focus to the 'input' element such that tabbing will
- * follow correctly in the browser
- */
- _bInputFocused = true;
- _nInput.focus();
-
- /* This timeout is a little nasty - but IE appears to have some asyhnc behaviour for
- * focus
- */
- setTimeout( function(){ _bInputFocused = false; }, 0 );
- _bKeyCapture = false;
- _fnBlur();
- return true;
- }
- else
- {
- return false;
- }
- }
- break;
-
- case 38: /* up arrow */
- if ( _iOldY > 0 ) {
- x = _iOldX;
- y = _iOldY - 1;
- } else {
- return false;
- }
- break;
-
- case 9: /* tab */
- case 39: /* right arrow */
- if ( _iOldX < iTableWidth-1 ) {
- x = _iOldX + 1;
- y = _iOldY;
- } else if ( _iOldY < iTableHeight-1 ) {
- x = 0;
- y = _iOldY + 1;
- } else {
- /* at end of table */
- if ( iKey == 9 && _bForm )
- {
- /* If we are in a form, return focus to the 'input' element such that tabbing will
- * follow correctly in the browser
- */
- _bInputFocused = true;
- _nInput.focus();
-
- /* This timeout is a little nasty - but IE appears to have some asyhnc behaviour for
- * focus
- */
- setTimeout( function(){ _bInputFocused = false; }, 0 );
- _bKeyCapture = false;
- _fnBlur();
- return true;
- }
- else
- {
- return false;
- }
- }
- break;
-
- case 40: /* down arrow */
- if ( _iOldY < iTableHeight-1 ) {
- x = _iOldX;
- y = _iOldY + 1;
- } else {
- return false;
- }
- break;
-
- default: /* Nothing we are interested in */
- return true;
- }
-
- _fnSetFocus( _fnCellFromCoords(x, y) );
- return false;
- }
-
-
- /*
- * Function: _fnCaptureKeys
- * Purpose: Start capturing key events for this table
- * Returns: -
- * Inputs: -
- */
- function _fnCaptureKeys( )
- {
- if ( !_bKeyCapture )
- {
- _bKeyCapture = true;
- }
- }
-
-
- /*
- * Function: _fnReleaseKeys
- * Purpose: Stop capturing key events for this table
- * Returns: -
- * Inputs: -
- */
- function _fnReleaseKeys( )
- {
- _bKeyCapture = false;
- }
-
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Support functions
- */
-
- /*
- * Function: _fnCellFromCoords
- * Purpose: Calulate the target TD cell from x and y coordinates
- * Returns: node: - TD target
- * Inputs: int:x - x coordinate
- * int:y - y coordinate
- */
- function _fnCellFromCoords( x, y )
- {
- if ( _oDatatable )
- {
- var oSettings = _oDatatable.fnSettings();
- if ( typeof oSettings.aoData[ oSettings.aiDisplay[ y ] ] != 'undefined' )
- {
- return oSettings.aoData[ oSettings.aiDisplay[ y ] ].nTr.getElementsByTagName('td')[x];
- }
- else
- {
- return null;
- }
- }
- else
- {
- return jQuery('tr:eq('+y+')>td:eq('+x+')', _nBody )[0];
- }
- }
-
-
- /*
- * Function: _fnCoordsFromCell
- * Purpose: Calculate the x and y position in a table from a TD cell
- * Returns: array[2] int: [x, y]
- * Inputs: node:n - TD cell of interest
- * Notes: Not actually interested in this for DataTables since it might go out of date
- */
- function _fnCoordsFromCell( n )
- {
- if ( _oDatatable )
- {
- var oSettings = _oDatatable.fnSettings();
- return [
- jQuery('td', n.parentNode).index(n),
- jQuery('tr', n.parentNode.parentNode).index(n.parentNode) + oSettings._iDisplayStart
- ];
- }
- else
- {
- return [
- jQuery('td', n.parentNode).index(n),
- jQuery('tr', n.parentNode.parentNode).index(n.parentNode)
- ];
- }
- }
-
-
- /*
- * Function: _fnSetScrollTop
- * Purpose: Set the vertical scrolling position
- * Returns: -
- * Inputs: int:iPos - scrolltop
- * Notes: This is so nasty, but without browser detection you can't tell which you should set
- * So on browsers that support both, the scroll top will be set twice. I can live with
- * that :-)
- */
- function _fnSetScrollTop( iPos )
- {
- document.documentElement.scrollTop = iPos;
- document.body.scrollTop = iPos;
- }
-
-
- /*
- * Function: _fnSetScrollLeft
- * Purpose: Set the horizontal scrolling position
- * Returns: -
- * Inputs: int:iPos - scrollleft
- */
- function _fnSetScrollLeft( iPos )
- {
- document.documentElement.scrollLeft = iPos;
- document.body.scrollLeft = iPos;
- }
-
-
- /*
- * Function: _fnGetPos
- * Purpose: Get the position of an object on the rendered page
- * Returns: array[2] int: [left, right]
- * Inputs: node:obj - element of interest
- */
- function _fnGetPos ( obj )
- {
- var iLeft = 0;
- var iTop = 0;
-
- if (obj.offsetParent)
- {
- iLeft = obj.offsetLeft;
- iTop = obj.offsetTop;
- obj = obj.offsetParent;
- while (obj)
- {
- iLeft += obj.offsetLeft;
- iTop += obj.offsetTop;
- obj = obj.offsetParent;
- }
- }
- return [iLeft,iTop];
- }
-
-
- /*
- * Function: _fnFindDtCell
- * Purpose: Get the coords. of a cell from the DataTables internal information
- * Returns: array[2] int: [x, y] coords. or null if not found
- * Inputs: node:nTarget - the node of interest
- */
- function _fnFindDtCell( nTarget )
- {
- var oSettings = _oDatatable.fnSettings();
- for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ )
- {
- var nTr = oSettings.aoData[ oSettings.aiDisplay[i] ].nTr;
- var nTds = nTr.getElementsByTagName('td');
- for ( var j=0, jLen=nTds.length ; j<jLen ; j++ )
- {
- if ( nTds[j] == nTarget )
- {
- return [ j, i ];
- }
- }
- }
- return null;
- }
-
-
-
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Initialisation
- */
-
- /*
- * Function: _fnInit
- * Purpose: Initialise the KeyTable
- * Returns: -
- * Inputs: object:oInit - optional - Initalisation object with the following parameters:
- * array[2] int:focus - x and y coordinates of the initial target
- * or
- * node:focus - the node to set initial focus on
- * node:table - the table to use, if not given, first table with class 'KeyTable' will be used
- * string:focusClass - focusing class to give to table elements
- * object:that - focus
- * bool:initScroll - scroll the view port on load, default true
- * int:tabIndex - the tab index to give the hidden input element
- */
- function _fnInit( oInit, that )
- {
- /* Save scope */
- _that = that;
-
- /* Capture undefined initialisation and apply the defaults */
- if ( typeof oInit == 'undefined' ) {
- oInit = {};
- }
-
- if ( typeof oInit.focus == 'undefined' ) {
- oInit.focus = [0,0];
- }
-
- if ( typeof oInit.table == 'undefined' ) {
- oInit.table = jQuery('table.KeyTable')[0];
- } else {
- $(oInit.table).addClass('KeyTable');
- }
-
- if ( typeof oInit.focusClass != 'undefined' ) {
- _sFocusClass = oInit.focusClass;
- }
-
- if ( typeof oInit.datatable != 'undefined' ) {
- _oDatatable = oInit.datatable;
- }
-
- if ( typeof oInit.initScroll == 'undefined' ) {
- oInit.initScroll = true;
- }
-
- if ( typeof oInit.form == 'undefined' ) {
- oInit.form = false;
- }
- _bForm = oInit.form;
-
- /* Cache the tbody node of interest */
- _nBody = oInit.table.getElementsByTagName('tbody')[0];
-
- /* If the table is inside a form, then we need a hidden input box which can be used by the
- * browser to catch the browser tabbing for our table
- */
- if ( _bForm )
- {
- var nDiv = document.createElement('div');
- _nInput = document.createElement('input');
- nDiv.style.height = "1px"; /* Opera requires a little something */
- nDiv.style.width = "0px";
- nDiv.style.overflow = "hidden";
- if ( typeof oInit.tabIndex != 'undefined' )
- {
- _nInput.tabIndex = oInit.tabIndex;
- }
- nDiv.appendChild(_nInput);
- oInit.table.parentNode.insertBefore( nDiv, oInit.table.nextSibling );
-
- jQuery(_nInput).focus( function () {
- /* See if we want to 'tab into' the table or out */
- if ( !_bInputFocused )
- {
- _bKeyCapture = true;
- _bInputFocused = false;
- if ( typeof oInit.focus.nodeName != "undefined" )
- {
- _fnSetFocus( oInit.focus, oInit.initScroll );
- }
- else
- {
- _fnSetFocus( _fnCellFromCoords( oInit.focus[0], oInit.focus[1]), oInit.initScroll );
- }
-
- /* Need to interup the thread for this to work */
- setTimeout( function() { _nInput.blur(); }, 0 );
- }
- } );
- _bKeyCapture = false;
- }
- else
- {
- /* Set the initial focus on the table */
- if ( typeof oInit.focus.nodeName != "undefined" )
- {
- _fnSetFocus( oInit.focus, oInit.initScroll );
- }
- else
- {
- _fnSetFocus( _fnCellFromCoords( oInit.focus[0], oInit.focus[1]), oInit.initScroll );
- }
- _fnCaptureKeys();
- }
-
- /*
- * Add event listeners
- * Well - I hate myself for doing this, but it would appear that key events in browsers are
- * a complete mess, particulay when you consider arrow keys, which of course are one of the
- * main areas of interest here. So basically for arrow keys, there is no keypress event in
- * Safari and IE, while there is in Firefox and Opera. But Firefox and Opera don't repeat the
- * keydown event for an arrow key. OUCH. See the following two articles for more:
- * http://www.quirksmode.org/dom/events/keys.html
- * https://lists.webkit.org/pipermail/webkit-dev/2007-December/002992.html
- * http://unixpapa.com/js/key.html
- * PPK considers the IE / Safari method correct (good enough for me!) so we (urgh) detect
- * Mozilla and Opera and apply keypress for them, while everything else gets keydown. If
- * Mozilla or Opera change their implemention in future, this will need to be updated...
- * although at the time of writing (14th March 2009) Minefield still uses the 3.0 behaviour.
- */
- if ( jQuery.browser.mozilla || jQuery.browser.opera )
- {
- jQuery(document).bind( "keypress", _fnKey );
- }
- else
- {
- jQuery(document).bind( "keydown", _fnKey );
- }
-
- if ( _oDatatable )
- {
- jQuery('tbody td', _oDatatable.fnSettings().nTable).live( 'click', _fnClick );
- }
- else
- {
- jQuery('td', _nBody).live( 'click', _fnClick );
- }
-
- /* Loose table focus when click outside the table */
- jQuery(document).click( function(e) {
- var nTarget = e.target;
- var bTableClick = false;
- while ( nTarget )
- {
- if ( nTarget == oInit.table )
- {
- bTableClick = true;
- break;
- }
- nTarget = nTarget.parentNode;
- }
- if ( !bTableClick )
- {
- _fnBlur();
- }
- } );
- }
-
- /* Initialise our new object */
- _fnInit( oInit, this );
-}
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/e5a144ce/console/lib/KeyTable.min.js
----------------------------------------------------------------------
diff --git a/console/lib/KeyTable.min.js b/console/lib/KeyTable.min.js
deleted file mode 100644
index 6a9c8f4..0000000
--- a/console/lib/KeyTable.min.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * File: KeyTable.min.js
- * Version: 1.1.7
- * Author: Allan Jardine (www.sprymedia.co.uk)
- *
- * Copyright 2009-2011 Allan Jardine, all rights reserved.
- *
- * This source file is free software, under either the GPL v2 license or a
- * BSD (3 point) style license, as supplied with this software.
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- */
-function KeyTable(n){function G(a){return function(d,c,j){(null===d||"number"==typeof d)&&(null===c||"number"==typeof c)&&"function"==typeof j?i[a].push({x:d,y:c,fn:j}):"object"==typeof d&&"function"==typeof c?(d=A(d),i[a].push({x:d[0],y:d[1],fn:c})):alert("Unhandable event type was added: x"+d+" y:"+c+" z:"+j)}}function H(a){return function(d,c,j){(null===d||"number"==typeof d)&&(null===c||"number"==typeof c)?"function"==typeof j?w(a,d,c,j):w(a,d,c):"object"==typeof d?(d=A(d),"function"==typeof c?
-w(a,d[0],d[1],c):w(a,d[0],d[1])):alert("Unhandable event type was removed: x"+d+" y:"+c+" z:"+j)}}function w(a,d,c,j){for(var b=0,e=0,g=i[a].length;e<g-b;e++)if("undefined"!=typeof j)i[a][e-b].x==d&&(i[a][e-b].y==c&&i[a][e-b].fn==j)&&(i[a].splice(e-b,1),b++);else if(i[a][e-b].x==d&&i[a][e-b].y==c)return i[a].splice(e,1),1;return b}function x(a,d,c){for(var b=0,a=i[a],h=0;h<a.length;h++)if(a[h].x==d&&a[h].y==c||null===a[h].x&&a[h].y==c||a[h].x==d&&null===a[h].y||null===a[h].x&&null===a[h].y)a[h].fn(t(d,
-c),d,c),b++;return b}function l(a,d){if(r!=a){"undefined"==typeof d&&(d=!0);null!==r&&B(r);jQuery(a).addClass(u);jQuery(a).parent().addClass(u);var c;if(k){c=k.fnSettings();for(var b=C(a)[1],h=o;b>=c.fnDisplayEnd();)0<=c._iDisplayLength?c._iDisplayStart+c._iDisplayLength<c.fnRecordsDisplay()&&(c._iDisplayStart+=c._iDisplayLength):c._iDisplayStart=0,k.oApi._fnCalculateEnd(c);for(;b<c._iDisplayStart;)c._iDisplayStart=0<=c._iDisplayLength?c._iDisplayStart-c._iDisplayLength:0,0>c._iDisplayStart&&(c._iDisplayStart=
-0),k.oApi._fnCalculateEnd(c);k.oApi._fnDraw(c);o=h}b=A(a);r=a;m=b[0];g=b[1];var e,i,l,n,f;if(d){e=document.documentElement.clientHeight;b=document.documentElement.clientWidth;i=document.body.scrollTop||document.documentElement.scrollTop;h=document.body.scrollLeft||document.documentElement.scrollLeft;l=a.offsetHeight;n=a.offsetWidth;f=a;var p=0,q=0;if(f.offsetParent){p=f.offsetLeft;q=f.offsetTop;for(f=f.offsetParent;f;)p+=f.offsetLeft,q+=f.offsetTop,f=f.offsetParent}f=[p,q];if(k&&"undefined"!=typeof c.oScroll&&
-(""!==c.oScroll.sX||""!==c.oScroll.sY))f[1]-=$(c.nTable.parentNode).scrollTop(),f[0]-=$(c.nTable.parentNode).scrollLeft();f[1]+l>i+e?(e=f[1]+l-e,document.documentElement.scrollTop=e,document.body.scrollTop=e):f[1]<i&&(e=f[1],document.documentElement.scrollTop=e,document.body.scrollTop=e);f[0]+n>h+b?(b=f[0]+n-b,document.documentElement.scrollLeft=b,document.body.scrollLeft=b):f[0]<h&&(b=f[0],document.documentElement.scrollLeft=b,document.body.scrollLeft=b)}if(k&&"undefined"!=typeof c.oScroll&&(""!==
-c.oScroll.sX||""!==c.oScroll.sY))(c=c.nTable.parentNode,e=c.clientHeight,b=c.clientWidth,i=c.scrollTop,h=c.scrollLeft,l=a.offsetHeight,n=a.offsetWidth,a.offsetTop+l>e+i?c.scrollTop=a.offsetTop+l-e:a.offsetTop<i&&(c.scrollTop=a.offsetTop),a.offsetLeft+n>b+h)?c.scrollLeft=a.offsetLeft+n-b:a.offsetLeft<h&&(c.scrollLeft=a.offsetLeft);o||(o=!0);x("focus",m,g)}}function y(){B(r);r=g=m=null;o=!1}function B(a){jQuery(a).removeClass(u);jQuery(a).parent().removeClass(u);x("blur",m,g)}function D(){for(var a=
-this;"TD"!=a.nodeName;)a=a.parentNode;l(a);o||(o=!0)}function E(a){if(F.block||!o||a.metaKey||a.altKey||a.ctrlKey)return!0;var b;b=v.getElementsByTagName("tr")[0].getElementsByTagName("td").length;var c;if(k){c=k.fnSettings().aiDisplay.length;var j=C(r);if(null===j)return;m=j[0];g=j[1]}else c=v.getElementsByTagName("tr").length;j=9==a.keyCode&&a.shiftKey?-1:a.keyCode;switch(j){case 13:return a.preventDefault(),a.stopPropagation(),x("action",m,g),!0;case 27:if(!x("esc",m,g)){y();return}a=m;b=g;break;
-case -1:case 37:if(0<m)a=m-1,b=g;else if(0<g)a=b-1,b=g-1;else return-1==j&&z?(q=!0,p.focus(),setTimeout(function(){q=!1},0),o=!1,y(),!0):!1;break;case 38:if(0<g)a=m,b=g-1;else return!1;break;case 9:case 39:if(m<b-1)a=m+1,b=g;else if(g<c-1)a=0,b=g+1;else return 9==j&&z?(q=!0,p.focus(),setTimeout(function(){q=!1},0),o=!1,y(),!0):!1;break;case 40:if(g<c-1)a=m,b=g+1;else return!1;break;default:return!0}l(t(a,b));return!1}function t(a,b){if(k){var c=k.fnSettings();return"undefined"!=typeof c.aoData[c.aiDisplay[b]]?
-c.aoData[c.aiDisplay[b]].nTr.getElementsByTagName("td")[a]:null}return jQuery("tr:eq("+b+")>td:eq("+a+")",v)[0]}function A(a){if(k){var b=k.fnSettings();return[jQuery("td",a.parentNode).index(a),jQuery("tr",a.parentNode.parentNode).index(a.parentNode)+b._iDisplayStart]}return[jQuery("td",a.parentNode).index(a),jQuery("tr",a.parentNode.parentNode).index(a.parentNode)]}function C(a){for(var b=k.fnSettings(),c=0,g=b.aiDisplay.length;c<g;c++)for(var h=b.aoData[b.aiDisplay[c]].nTr.getElementsByTagName("td"),
-e=0,i=h.length;e<i;e++)if(h[e]==a)return[e,c];return null}this.block=!1;this.event={remove:{}};this.fnGetCurrentPosition=function(){return[m,g]};this.fnGetCurrentData=function(){return r.innerHTML};this.fnGetCurrentTD=function(){return r};this.fnSetPosition=function(a,b){"object"==typeof a&&a.nodeName?l(a):l(t(a,b))};var v=null,r=null,m=null,g=null,F=null,u="focus",o=!1,i={action:[],esc:[],focus:[],blur:[]},k=null,z,p,q=!1,s;for(s in i)s&&(this.event[s]=G(s),this.event.remove[s]=H(s));var b=n,F=this;
-"undefined"==typeof b&&(b={});"undefined"==typeof b.focus&&(b.focus=[0,0]);"undefined"==typeof b.table?b.table=jQuery("table.KeyTable")[0]:$(b.table).addClass("KeyTable");"undefined"!=typeof b.focusClass&&(u=b.focusClass);"undefined"!=typeof b.datatable&&(k=b.datatable);"undefined"==typeof b.initScroll&&(b.initScroll=!0);"undefined"==typeof b.form&&(b.form=!1);z=b.form;v=b.table.getElementsByTagName("tbody")[0];z?(n=document.createElement("div"),p=document.createElement("input"),n.style.height="1px",
-n.style.width="0px",n.style.overflow="hidden","undefined"!=typeof b.tabIndex&&(p.tabIndex=b.tabIndex),n.appendChild(p),b.table.parentNode.insertBefore(n,b.table.nextSibling),jQuery(p).focus(function(){if(!q){o=true;q=false;typeof b.focus.nodeName!="undefined"?l(b.focus,b.initScroll):l(t(b.focus[0],b.focus[1]),b.initScroll);setTimeout(function(){p.blur()},0)}}),o=!1):("undefined"!=typeof b.focus.nodeName?l(b.focus,b.initScroll):l(t(b.focus[0],b.focus[1]),b.initScroll),o||(o=!0));jQuery.browser.mozilla||
-jQuery.browser.opera?jQuery(document).bind("keypress",E):jQuery(document).bind("keydown",E);k?jQuery("tbody td",k.fnSettings().nTable).live("click",D):jQuery("td",v).live("click",D);jQuery(document).click(function(a){for(var a=a.target,d=false;a;){if(a==b.table){d=true;break}a=a.parentNode}d||y()})};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org