[open-ils-commits] r14677 - trunk/Open-ILS/web/js/dojo/fieldmapper (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 29 11:43:27 EDT 2009
Author: miker
Date: 2009-10-29 11:43:25 -0400 (Thu, 29 Oct 2009)
New Revision: 14677
Modified:
trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js
Log:
revert the dojo-ification from yesterday
Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js 2009-10-29 15:29:35 UTC (rev 14676)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js 2009-10-29 15:43:25 UTC (rev 14677)
@@ -1,5 +1,4 @@
if(!dojo._hasResource["fieldmapper.IDL"]) {
- dojo.require('dojox.data.dom');
dojo.provide("fieldmapper.IDL");
dojo.declare('fieldmapper.IDL', null, {
@@ -34,14 +33,16 @@
},
_parse : function(xmlNode, callback) {
+ var classes = xmlNode.getElementsByTagName('class');
var idl = fieldmapper.IDL.fmclasses = {};
-
- dojo.forEach( dojo.query('class', xmlNode), function (node) {
+
+ for(var i = 0; i < classes.length; i++) {
+ var node = classes[i];
var id = node.getAttribute('id');
- var fields = dojo.query('fields', node)[0];
+ var fields = node.getElementsByTagName('fields')[0];
window.fmclasses[id] = [];
- var fieldData = this._parseFields( node, id );
+ var fieldData = this._parseFields(node, id);
var obj = {
fields : fieldData.list,
@@ -85,9 +86,10 @@
obj.core = (obj.core == 'true');
obj.label = (obj.label) ? obj.label : obj.name;
idl[id] = obj;
- });
+ }
- if(callback) callback();
+ if(callback)
+ callback();
},
/* parses the links and fields portion of the IDL */
@@ -95,15 +97,21 @@
var data = [];
var map = {};
- var links = dojo.query('links', node);
+ var fields = node.getElementsByTagName('fields')[0];
+ fields = fields.getElementsByTagName('field');
+ var links = node.getElementsByTagName('links')[0];
+ if( links ) links = links.getElementsByTagName('link');
+ else links = [];
+
+
var position = 0;
- dojo.forEach(dojo.query('fields field', node), function (field) {
+ for(var i = 0; i < fields.length; i++) {
+ var field = fields[i];
var name = field.getAttribute('name');
if(name == 'isnew' || name == 'ischanged' || name == 'isdeleted')
- return;
-
+ continue;
var obj = {
field : field,
@@ -114,7 +122,7 @@
selector : field.getAttributeNS(this.NS_REPORTS,'selector'),
array_position : position++,
type : 'field',
- virtual : (field.getAttributeNS(this.NS_PERSIST, 'virtual') == 'true')
+ virtual : (fields[i].getAttributeNS(this.NS_PERSIST, 'virtual') == 'true')
};
obj.label = obj.label || obj.name;
@@ -122,7 +130,14 @@
window.fmclasses[classname].push(obj.name);
- var link = dojo.query('links link[field=' + name + ']', node)[0];
+ var link = null;
+ for(var l = 0; l < links.length; l++) {
+ if(links[l].getAttribute('field') == name) {
+ link = links[l];
+ break;
+ }
+ }
+
if(link) {
obj.type = 'link';
obj.key = link.getAttribute('key');
@@ -132,7 +147,7 @@
data.push(obj);
map[obj.name] = obj;
- });
+ }
dojo.forEach(['isnew', 'ischanged', 'isdeleted'],
function(name) {
More information about the open-ils-commits
mailing list