Allow the OPAC to autoload IDL classes instead of either pulling in a long class...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 31 Aug 2010 03:31:09 +0000 (03:31 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 31 Aug 2010 03:31:09 +0000 (03:31 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17396 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/fieldmapper/IDL.js
Open-ILS/web/js/dojo/fieldmapper/dojoData.js
Open-ILS/web/opac/skin/default/xml/common/js_common.xml

index 3e1fe35..2c3f1ba 100644 (file)
@@ -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);
     }
index 472b5ae..9b0cddd 100644 (file)
@@ -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';
index 70a67b6..952d1d2 100644 (file)
@@ -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'>
                        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);