[open-ils-commits] r17396 - in trunk/Open-ILS/web: js/dojo/fieldmapper opac/skin/default/xml/common (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 30 23:31:12 EDT 2010
Author: miker
Date: 2010-08-30 23:31:09 -0400 (Mon, 30 Aug 2010)
New Revision: 17396
Modified:
trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js
trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js
trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml
Log:
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.
Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js 2010-08-31 03:20:28 UTC (rev 17395)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/IDL.js 2010-08-31 03:31:09 UTC (rev 17396)
@@ -197,7 +197,7 @@
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);
}
Modified: trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js 2010-08-31 03:20:28 UTC (rev 17395)
+++ trunk/Open-ILS/web/js/dojo/fieldmapper/dojoData.js 2010-08-31 03:31:09 UTC (rev 17396)
@@ -92,15 +92,18 @@
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;
+ 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;
+ }
- fieldmapper.aou.prototype._ignore_fields = ['children'];
- fieldmapper.aout.prototype._ignore_fields = ['children'];
- fieldmapper.pgt.prototype._ignore_fields = ['children'];
+ 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';
Modified: trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml
===================================================================
--- trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml 2010-08-31 03:20:28 UTC (rev 17395)
+++ trunk/Open-ILS/web/opac/skin/default/xml/common/js_common.xml 2010-08-31 03:31:09 UTC (rev 17396)
@@ -7,16 +7,6 @@
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/slimtree.js' type='text/javascript'></script>
<script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/JSON_v1.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/fmcore.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/fmgen.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/opac_utils.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/<!--#echo var="locale"-->/OrgTree.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/<!--#echo var="locale"-->/FacetDefs.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/OrgLasso.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/org_utils.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/RemoteRequest.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/init.js' type='text/javascript'></script>
- <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/added_content.js' type='text/javascript'></script>
<!-- Some global js -->
<script language='javascript' type='text/javascript'>
@@ -42,27 +32,40 @@
getId("home_myopac_link").setAttribute("href", buildOPACLink({page:MYOPAC}, false, true));
}
- <!--#if expr="$OILS_OPAC_FORCE_LOGIN_SSL"-->
- forceLoginSSL = true;
- <!--#endif -->
+ <!--#if expr="$OILS_OPAC_FORCE_LOGIN_SSL"-->
+ forceLoginSSL = true;
+ <!--#endif -->
</script>
<!-- enable Dojo date picker -->
<script language='javascript' type="text/javascript">
- var djConfig = {parseOnLoad: true, isDebug: false}, lang, bidi;
-
var locale = location.href.replace( /.+opac\/([^\/]+)\/skin.+/, '$1' );
if (!locale) locale = '<!--#echo var="locale"-->';
- djConfig.locale = locale.toLowerCase();
+ var djConfig = {
+ locale: locale.toLowerCase(),
+ AutoIDL: ['aou','aout','pgt','lasso'],
+ parseOnLoad: true,
+ isDebug: false
+ }, lang, bidi;
</script>
<script type="text/javascript" src='/js/dojo/dojo/dojo.js'></script>
<script type="text/javascript" src='/js/dojo/dojo/openils_dojo.js'></script>
- <script type="text/javascript" src='/js/dojo/opensrf/opensrf.js'></script>
+ <script type="text/javascript" src='/js/dojo/opensrf/opensrf.js'></script>
+ <script type="text/javascript" src='/js/dojo/fieldmapper/AutoIDL.js'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/opac_utils.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/<!--#echo var="locale"-->/OrgTree.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/<!--#echo var="locale"-->/FacetDefs.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/OrgLasso.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/org_utils.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/RemoteRequest.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/init.js' type='text/javascript'></script>
+ <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/added_content.js' type='text/javascript'></script>
+
<script language="javascript" type="text/javascript">
dojo.addOnLoad(init);
dojo.require("dijit._Calendar");
More information about the open-ils-commits
mailing list