From: miker Date: Tue, 31 Aug 2010 03:31:09 +0000 (+0000) Subject: Allow the OPAC to autoload IDL classes instead of either pulling in a long class... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b97eb3348b8dd0fa3bcaba57e8a81065b3782f4a;p=evergreen%2Fbjwebb.git Allow the OPAC to autoload IDL classes instead of either pulling in a long class list and evaluating them all, or loading a .5MB+ xml file and parsing the whole thing. 40% speedup in simple tests where cache is bypassed. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17396 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/fieldmapper/IDL.js b/Open-ILS/web/js/dojo/fieldmapper/IDL.js index 3e1fe35db..2c3f1baab 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/IDL.js +++ b/Open-ILS/web/js/dojo/fieldmapper/IDL.js @@ -197,7 +197,7 @@ if(!dojo._hasResource["fieldmapper.IDL"]) { fieldmapper.IDL.loaded = false; JSON2js.fallbackObjectifier = function (arg, key_name, val_name) { - console.log("Firing IDL loader for " + key_name); + console.log("Firing IDL loader for " + arg[key_name]); fieldmapper.IDL.load([arg[key_name]]); return decodeJS(arg); } diff --git a/Open-ILS/web/js/dojo/fieldmapper/dojoData.js b/Open-ILS/web/js/dojo/fieldmapper/dojoData.js index 472b5aefc..9b0cddd3c 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/dojoData.js +++ b/Open-ILS/web/js/dojo/fieldmapper/dojoData.js @@ -92,15 +92,18 @@ if(!dojo._hasResource['fieldmapper.dojoData']){ return data; } - for (var i in fmclasses) fieldmapper[i].prototype.fromStoreItem = _fromStoreItem; - for (var i in fmclasses) fieldmapper[i].toStoreData = _toStoreData; - for (var i in fmclasses) fieldmapper[i].toStoreItem = _toStoreItem; - for (var i in fmclasses) fieldmapper[i].prototype.toStoreItem = function ( args ) { return _toStoreItem(this, args) }; - for (var i in fmclasses) fieldmapper[i].initStoreData = _initStoreData; - - fieldmapper.aou.prototype._ignore_fields = ['children']; - fieldmapper.aout.prototype._ignore_fields = ['children']; - fieldmapper.pgt.prototype._ignore_fields = ['children']; + for (var i in fmclasses) { + fieldmapper[i].prototype.fromStoreItem = _fromStoreItem; + fieldmapper[i].prototype.fromStoreItem = _fromStoreItem; + fieldmapper[i].toStoreData = _toStoreData; + fieldmapper[i].toStoreItem = _toStoreItem; + fieldmapper[i].prototype.toStoreItem = function ( args ) { return _toStoreItem(this, args) }; + fieldmapper[i].initStoreData = _initStoreData; + } + + if (fieldmapper.aou) fieldmapper.aou.prototype._ignore_fields = ['children']; + if (fieldmapper.aout) fieldmapper.aout.prototype._ignore_fields = ['children']; + if (fieldmapper.pgt) fieldmapper.pgt.prototype._ignore_fields = ['children']; fieldmapper.aou.toStoreData = function (list, label) { if (!label) label = 'shortname'; diff --git a/Open-ILS/web/opac/skin/default/xml/common/js_common.xml b/Open-ILS/web/opac/skin/default/xml/common/js_common.xml index 70a67b693..952d1d228 100644 --- a/Open-ILS/web/opac/skin/default/xml/common/js_common.xml +++ b/Open-ILS/web/opac/skin/default/xml/common/js_common.xml @@ -7,16 +7,6 @@ - - - - - - - - - - - + + + + + + + + + + +