Merge branch 'opac-tt-poc' of git+ssh://yeti.esilibrary.com/home/evergreen/evergreen...
authorberick <berick@esilibrary.com>
Wed, 13 Apr 2011 14:46:38 +0000 (10:46 -0400)
committerberick <berick@esilibrary.com>
Wed, 13 Apr 2011 14:46:38 +0000 (10:46 -0400)
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Open-ILS/web/js/ui/default/opac/simple.js
Open-ILS/web/js/ui/default/opac/staff.js [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/base.tt2
Open-ILS/web/templates/default/opac/parts/footer.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/js.tt2 [new file with mode: 0644]
Open-ILS/web/templates/default/opac/parts/topnav.tt2

index 0290d88..f636744 100644 (file)
@@ -131,7 +131,7 @@ sub mk_marc_html {
     # could be optimized considerably by performing the xslt on the already fetched record
     return $U->simplereq(
         'open-ils.search', 
-        'open-ils.search.biblio.record.html', $rec_id);
+        'open-ils.search.biblio.record.html', $rec_id, 1);
 }
 
 1;
index 7124d03..776dfef 100644 (file)
@@ -1,4 +1,4 @@
-/* Keep this dead simple. No dojo. Call nothing via onload. */
+/* Keep this dead simple. No dojo. */
 function $(s) { return document.getElementById(s); }
 function removeClass(node, cls) {
     if (!node || !node.className) return;
diff --git a/Open-ILS/web/js/ui/default/opac/staff.js b/Open-ILS/web/js/ui/default/opac/staff.js
new file mode 100644 (file)
index 0000000..abb8ce8
--- /dev/null
@@ -0,0 +1,22 @@
+/* staff client integration functions */
+function debug(msg){dump(msg+'\n')}
+var eventCache={};
+function attachEvt(scope, name, action) {
+    if(!eventCache[scope]) eventCache[scope] = {};
+    if(!eventCache[scope][name]) eventCache[scope][name] = [];
+    eventCache[scope][name].push(action);
+}
+function runEvt(scope, name) {
+    debug('running event '+scope+':'+name);
+    var args = Array.prototype.slice.call(arguments).slice(2);
+    if(eventCache[scope]) {
+        var evt = eventCache[scope][name];
+        for(var i in evt) {evt[i].apply(evt[i], args);}
+    } 
+}
+window.onload = function() {
+    // record details page events
+    var rec = location.href.match(/\/opac\/record\/(\d+)/);
+    if(rec && rec[1]) { runEvt('rdetail', 'recordRetrieved', rec[1]); }
+    // fire other events the staff client is expecting...
+}
index 488c21d..d54a7e0 100644 (file)
@@ -5,42 +5,14 @@
         [% IF ctx.authtime %]
         <meta http-equiv="refresh" content="[% ctx.authtime %];[% ctx.logout_page %]">
         [% END %]
-        <link rel="stylesheet" type="text/css"
-            href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css" />
-        <link rel="stylesheet" type="text/css"
-            href="[% ctx.media_prefix %]/css/skin/default/opac/style.css" />
-        <title>[% l('Catalog - King County Library - [_1]', ctx.page_title) %]</title>
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css" />
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/style.css" />
+        <title>[% l('Catalog - [_1]', ctx.page_title) %]</title>
         <link rel="unapi-server" type="application/xml" title="unAPI" href="/opac/extras/unapi" />
-        [% BLOCK html_head; END; # provide a default that can be overridden -%]
-        [%- PROCESS html_head -%]
     </head>
     <body>
         [% content %] 
-        <div id="footer">
-            <a href="http://www.kcls.org/usingthelibrary/request/">[% l('Request a Purchase') %]</a> &nbsp;|&nbsp;
-            <a href="http://www.kcls.org/usingthelibrary/request/">[% l('Interlibrary Loan') %]</a> &nbsp;|&nbsp;
-            <a href="http://www.kcls.org/about/contact/">[% l('Contact Us') %]</a> &nbsp;|&nbsp;
-            <a href="http://www.kcls.org/usingthelibrary/catalog_help/">[% l('Site Help') %]</a> &nbsp;|&nbsp;
-            <a href="http://www.kcls.org/usingthelibrary/policies/privacy.cfm">[% l('Privacy Statement') %]</a> &nbsp;|&nbsp;
-            <a href="http://www.kcls.org/about/support/">[% l('Support KCLS') %]</a> &nbsp;|&nbsp;
-            <a href="http://www.kcls.org/employment/">[% l('Employment') %]</a> 
-        </div>
-        <script type="text/javascript"
-            src="[% ctx.media_prefix %]/js/ui/default/opac/simple.js"></script>
-        <!-- Google Analytics -->
-        <script type="text/javascript">
-        /* uncomment when ready */ /*
-          var _gaq = _gaq || [];
-          _gaq.push(['_setAccount', 'UA-3018520-10']);
-          _gaq.push(['_trackPageview']);
-
-          (function() {
-            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-          })();
-        */
-        </script>
-        <!-- End Google Analytics -->
+        [% INCLUDE 'default/opac/parts/footer.tt2' %]
+        [% INCLUDE 'default/opac/parts/js.tt2' %]
     </body>
 </html>
diff --git a/Open-ILS/web/templates/default/opac/parts/footer.tt2 b/Open-ILS/web/templates/default/opac/parts/footer.tt2
new file mode 100644 (file)
index 0000000..9ab3ace
--- /dev/null
@@ -0,0 +1,10 @@
+<div id="footer">
+    <a href="http://www.kcls.org/usingthelibrary/request/">[% l('Request a Purchase') %]</a> &nbsp;|&nbsp;
+    <a href="http://www.kcls.org/usingthelibrary/request/">[% l('Interlibrary Loan') %]</a> &nbsp;|&nbsp;
+    <a href="http://www.kcls.org/about/contact/">[% l('Contact Us') %]</a> &nbsp;|&nbsp;
+    <a href="http://www.kcls.org/usingthelibrary/catalog_help/">[% l('Site Help') %]</a> &nbsp;|&nbsp;
+    <a href="http://www.kcls.org/usingthelibrary/policies/privacy.cfm">[% l('Privacy Statement') %]</a> &nbsp;|&nbsp;
+    <a href="http://www.kcls.org/about/support/">[% l('Support KCLS') %]</a> &nbsp;|&nbsp;
+    <a href="http://www.kcls.org/employment/">[% l('Employment') %]</a> 
+</div>
+
diff --git a/Open-ILS/web/templates/default/opac/parts/js.tt2 b/Open-ILS/web/templates/default/opac/parts/js.tt2
new file mode 100644 (file)
index 0000000..4f7771d
--- /dev/null
@@ -0,0 +1,24 @@
+<!-- JS imports, etc.  -->
+
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/simple.js"></script>
+
+[% IF ctx.is_staff %]
+<script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/opac/staff.js"></script>
+[% END %]
+
+<!-- Google Analytics -->
+<script type="text/javascript">
+/* uncomment when ready */ /*
+  var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-3018520-10']);
+  _gaq.push(['_trackPageview']);
+
+  (function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+*/
+</script>
+<!-- End Google Analytics -->
+
index 15a98af..ab467c8 100644 (file)
@@ -1,3 +1,4 @@
+[% IF !ctx.is_staff %]
 <div id="header">
     <div class="float-left">
         <a href="http://www.kcls.org"><img alt="[% l('KCLS Logo') %]" 
     </div>
     <div class="common-no-pad"></div>
 </div>
+[% END %]
 <div id="gold-links-holder">
     <div id="gold-links">
         <div id="header-links">