From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/grid/_grid/lib.js | 254 ++++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 includes/js/dojox/grid/_grid/lib.js (limited to 'includes/js/dojox/grid/_grid/lib.js') diff --git a/includes/js/dojox/grid/_grid/lib.js b/includes/js/dojox/grid/_grid/lib.js new file mode 100644 index 0000000..3644dbc --- /dev/null +++ b/includes/js/dojox/grid/_grid/lib.js @@ -0,0 +1,254 @@ +if(!dojo._hasResource["dojox.grid._grid.lib"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.grid._grid.lib"] = true; +dojo.provide("dojox.grid._grid.lib"); +// summary: grid utility library +dojo.mixin(dojox.grid,{ + + na: '...', + + nop: function(){ + // summary: a null function? + }, + + getTdIndex: function(td){ + return td.cellIndex >=0 ? td.cellIndex : dojo.indexOf(td.parentNode.cells, td); + }, + + getTrIndex: function(tr){ + return tr.rowIndex >=0 ? tr.rowIndex : dojo.indexOf(tr.parentNode.childNodes, tr); + }, + + getTr: function(rowOwner, index){ + return rowOwner && ((rowOwner.rows||0)[index] || rowOwner.childNodes[index]); + }, + + getTd: function(rowOwner, rowIndex, cellIndex){ + return (dojox.grid.getTr(inTable, rowIndex)||0)[cellIndex]; + }, + + findTable: function(node){ + for (var n=node; n && n.tagName!='TABLE'; n=n.parentNode); + return n; + }, + + ascendDom: function(inNode, inWhile){ + for (var n=inNode; n && inWhile(n); n=n.parentNode); + return n; + }, + + makeNotTagName: function(inTagName){ + var name = inTagName.toUpperCase(); + return function(node){ return node.tagName != name; }; + }, + + fire: function(ob, ev, args){ + var fn = ob && ev && ob[ev]; + return fn && (args ? fn.apply(ob, args) : ob[ev]()); + }, + + // from lib.js + setStyleText: function(inNode, inStyleText){ + if(inNode.style.cssText == undefined){ + inNode.setAttribute("style", inStyleText); + }else{ + inNode.style.cssText = inStyleText; + } + }, + + getStyleText: function(inNode, inStyleText){ + return (inNode.style.cssText == undefined ? inNode.getAttribute("style") : inNode.style.cssText); + }, + + setStyle: function(inElement, inStyle, inValue){ + if(inElement && inElement.style[inStyle] != inValue){ + inElement.style[inStyle] = inValue; + } + }, + + setStyleHeightPx: function(inElement, inHeight){ + if(inHeight >= 0){ + dojox.grid.setStyle(inElement, 'height', inHeight + 'px'); + } + }, + + mouseEvents: [ 'mouseover', 'mouseout', /*'mousemove',*/ 'mousedown', 'mouseup', 'click', 'dblclick', 'contextmenu' ], + + keyEvents: [ 'keyup', 'keydown', 'keypress' ], + + funnelEvents: function(inNode, inObject, inMethod, inEvents){ + var evts = (inEvents ? inEvents : dojox.grid.mouseEvents.concat(dojox.grid.keyEvents)); + for (var i=0, l=evts.length; i