rdetail page at least mostly working
authorsenator <lebbeous@esilibrary.com>
Mon, 13 Dec 2010 18:42:03 +0000 (13:42 -0500)
committersenator <lebbeous@esilibrary.com>
Mon, 13 Dec 2010 18:42:03 +0000 (13:42 -0500)
added cdata tags to js_common_postbody, and a couple other little things

Open-ILS/web/opac/skin/default/xml/common/js_common_postbody.xml
Open-ILS/web/opac/skin/default/xml/result/result_table.xml

index 1eba732..68e4789 100644 (file)
@@ -1,4 +1,4 @@
-<script type="text/javascript">
+<script type="text/javascript"><![CDATA[
     dojo.require('openils.Util');
 
     var idlPath = '/IDL2js?mvr,bre,aou,aout,pgt,lasso,cmf,cmc,cmsa,cam,cifm,clfm,citm,cblvl,ccs';
         <!--#if expr="$OILS_OPAC_COMBINED_JS"-->
         openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/combined.js')
         <!--#else -->
-        <!--
+        /*
             When combined JS is enabled in the Apache config, the block
             below defines which files are added to the final combined JS file.
             Currently, only files in $OPAC/common/js/ are eligible for automatic combination.
-        -->
-        <!--START COMPRESSION-->
+        */
+        /* START COMPRESSION */
         openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/utils.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/config.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/CGI.js');
@@ -57,7 +57,7 @@
         openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/RemoteRequest.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/init.js');
         openils.Util.requireLegacy('<!--#echo var="OILS_JS_BASE"-->/added_content.js');
-        <!--END COMPRESSION-->
+        /* END COMPRESSION */
         <!--#endif -->
 
         console.log('middle of main script');
         config.names.rdetail.cp_count_cell  = "rdetail_copy_count_cell";
         config.names.rdetail.cp_status      = 'rdetail_status_cell';
 
-        var here = findOrgUnit(getLocation());
-        if (getDepth() > 0 || getDepth === 0 ) {
-            while (getDepth() < findOrgDepth(here))
-                here = findOrgUnit( here.parent_ou() );
-        }
+        attachEvt("common", "init", function() {
+            var here = findOrgUnit(getLocation());
+            if (getDepth() > 0 || getDepth === 0 ) {
+                while (getDepth() < findOrgDepth(here))
+                    here = findOrgUnit( here.parent_ou() );
+            }
 
-        dojo.require('openils.BibTemplate');
-        new openils.BibTemplate(
-            { record : new CGI().param('r'), org_unit : here.shortname() }
-        ).render();
+            dojo.require('openils.BibTemplate');
+            new openils.BibTemplate(
+                { record : new CGI().param('r'), org_unit : here.shortname() }
+            ).render();
+        });
 
         var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
         if (chilifresh == '(none)') { chilifresh = false; }
         var novelist = '<!--#echo var="OILS_NOVELIST_URL"-->';
         if (novelist == '(none)') { novelist = false; }
 
-        <!--if expr="${OILS_CHILIFRESH_ACCOUNT} && ${OILS_CHILIFRESH_ACCOUNT}!='(none)'"-->
+        <!--#if expr="${OILS_CHILIFRESH_ACCOUNT} && ${OILS_CHILIFRESH_ACCOUNT}!='(none)'"-->
         openils.Util.requireLegacy('<!--#echo var='OILS_CHILIFRESH_URL'-->');
         <!--#endif-->
 
-        <!--if expr="${OILS_NOVELIST_URL} && ${OILS_NOVELIST_URL}!='(none)'"-->
+        <!--#if expr="${OILS_NOVELIST_URL} && ${OILS_NOVELIST_URL}!='(none)'"-->
         openils.Util.requireLegacy('<!--#echo var='OILS_NOVELIST_URL'-->');
-        <!--endif-->
+        <!--#endif-->
 
 
 
-        <!--#endif--><!-- (rdetail) -->
+        <!--#endif-->
 
         <!--#if expr="$OILS_PAGE='advanced.xml'"-->
         openils.Util.requireLegacy('<!--#echo var="OILS_OPAC_JS_HOST"-->/skin/default/js/advanced.js');
     dojo.addOnLoad(
 
         function() {
-
             skin_init();
 
             <!--#if expr="$OILS_PAGE='index.xml'"-->
             <!--#endif-->
         }
     );
-</script>
+]]></script>
index f625395..38391be 100644 (file)
    <!-- ====================== -->
 
 
-    <!--
-       <script language='javascript' type='text/javascript'>
-               config.names.result.format_cell = 'result_table_format_cell';
-               config.names.result.format_link = 'resource_link'
-               config.names.result.format_pic = 'format_pic'
-       </script>
-    -->
-
     <!-- ChiliFresh setup -->
-    <script language='javascript' type='text/javascript'>
-        var chilifresh = '<!--#echo var="OILS_CHILIFRESH_ACCOUNT"-->';
-        if (chilifresh=='(none)') { chilifresh = false; }
-    </script>
     <!--if expr="${OILS_CHILIFRESH_ACCOUNT} && ${OILS_CHILIFRESH_ACCOUNT}!='(none)'"-->
         <input type="hidden" id="chilifresh_account" name="chilifresh_account"
             value="<!--#echo var='OILS_CHILIFRESH_ACCOUNT'-->" />