JS stubbed out, mostly. See longer commit msg.
authorsenator <lebbeous@esilibrary.com>
Thu, 3 Feb 2011 20:34:19 +0000 (15:34 -0500)
committersenator <lebbeous@esilibrary.com>
Thu, 3 Feb 2011 20:34:19 +0000 (15:34 -0500)
Here's the deal with JS so far.

A few instances of onfocus, onblur, onmouseout, and onmouseover have been
left alone, as they're doing simple cosmetic things.

A lot of instances of onclick remain, and a couple onchange, but these
now either a) just do cosmetic things (hide/unhide) or b) call stubbed
out functions prepared in misc.js

That doesn't mean we won't still totally rip out lots of this JS, but
it leaves us a hint as to what is supposed to happen where.  I can
easily see us losing track of that later.  So anyway, many of the
stubbed functions will probably be replaced with purely server side
functionality later, but until then, they can serve as a kind of
documentation.

Open-ILS/web/opac/skin/kcls-wire/js/misc.js
Open-ILS/web/templates/default/kcls-wire/advanced.tt2
Open-ILS/web/templates/default/kcls-wire/parts/base.tt2
Open-ILS/web/templates/default/kcls-wire/parts/record/body.tt2
Open-ILS/web/templates/default/kcls-wire/parts/record/cn_details.tt2
Open-ILS/web/templates/default/kcls-wire/record.tt2

index 2d809bf..31165ed 100644 (file)
@@ -1,5 +1,7 @@
 /* Some really basic utils copied mostly from old opac js:
  * opac_utils.js, utils.js, misc.js (kcls). */
+function _stub() { alert("XXX disconnected"); } /* for in progress work */
+
 function $(id) { return document.getElementById(id); }
 function $n(root, nodeName, attr) {
     return findNodeByName(root, nodeName, attr);
@@ -95,24 +97,6 @@ function swapTabs(el) {
     }
 }
 
-function sortHolds() {
-    alert("FIXME disconnected");
-    /* XXX TODO There was a method for sorting loaded holds in the DOM
-     * without reloading the page, but it was reliant on fieldmapper
-     * and some stock dojo libraries.  Could be reimplemented without
-     * deps if deemed worth it.
-     */
-}
-
-function showDetailedResults(/* Boolean */ detailed) {
-    alert("FIXME disconnected");
-    /* XXX TODO this stands in for an old onchange handler that toggled
-     * between simple and detailed results in the rresults page.
-     * Don't know if we want to keep this around or not (I'm guessing not,
-     * and that we'll do this with two different server-side pages now,
-     * but leaving this stub here for now).
-     */
-}
 
 /* Returns the character code pressed that caused the event. */
 function grabCharCode(evt) {
@@ -145,9 +129,41 @@ function advAddGblRow() {
     tbody.insertBefore(newrow, $("adv_global_addrow"));
     var input = $n(newrow, "term");
     input.value = "";
-    setEnterFunc(input, function() {
-        alert("XXX enter");
-        /* XXX TODO make a real form and get rid of this? */
-    });
+    setEnterFunc(input, _stub); /* XXX TODO make a real form and get rid of this? */
     $n(newrow, 'type').focus();
 }
+
+var rdetailNewBookbag = _stub; /* XXX TODO reimplement without JS? */
+var addMyList = _stub; /* XXX TODO we probably still need this one */
+var listSaveAction = _stub; /* XXX TODO we probably still need this one */
+var expandBoxes = _stub; /* XXX TODO possibly reimplement or replace */
+var iForgotMyPassword = _stub; /* XXX TODO possibly reimplement or replace */
+var switchSubPage = _stub;
+var myOPACRenewSelected = _stub;
+var myOPACCreateBookbag = _stub;
+var myOPACSavePrefs = _stub;
+var myOPACUpdatePhone = _stub;  /* XXX TODOD myOPACUpdate*() and the buttons where
+                                   the handlers are used should probably go
+                                   away completely */
+var myOPACUpdateUsername = _stub;
+var myOPACUpdatePassword = _stub;
+var myOPACUpdateEmail = _stub;
+var myOPACUpdateHomeOU = _stub;
+var myopacDoHoldAction = _stub;
+var myopacApplyThawDate = _stub;
+var showCachedList = _stub;
+var searchBarSubmit = _stub;
+var sortHolds = _stub; /* XXX TODO There was a method for sorting loaded holds
+                          in the DOM without reloading the page, but it was
+                          reliant on fieldmapper and some stock dojo
+                          libraries.  Could be reimplemented without deps
+                          if deemed worthwhile. */
+var showDetailedResults = _stub; /* XXX TODO for an old onchange handler that
+                                toggled between simple and detailed results
+                                in the rresults page.  */
+var checkAll = _stub;
+var sortChecked = _stub;
+var sortCheckedHist = _stub;
+var showPaymentForm = _stub;
+var showFinesDiv = _stub;
+var fadeOut = _stub;    /* XXX TODO what the heck? not seen anywhere */
index 5c9eca7..46d3a98 100644 (file)
@@ -2,7 +2,6 @@
     INCLUDE "default/kcls-wire/parts/topnav.tt2";
     ctx.page_title = "Advanced Search" %]
 [% BLOCK html_head -%]
-<script type="text/javascript" src="/opac/skin/kcls-wire/js/misc.js"></script>
 <style type='text/css'>
     .advanced_div { padding-top: 15px; }
     #adv_global_search select { width: 13em; }
index a4a23b6..cd2ea84 100644 (file)
@@ -7,6 +7,10 @@
         <title>Catalog - King County Library - [% ctx.page_title %]</title>
         <link rel="unapi-server" type="application/xml" title="unAPI"
             href="/opac/extras/unapi" />
+        [%- UNLESS skip_js %]
+        <script type="text/javascript"
+            src="/opac/skin/kcls-wire/js/misc.js"></script>
+        [%- END -%]
         [% BLOCK html_head; END; # provide a default that can be overridden %]
         [% PROCESS html_head %]
     </head>
index 905e91d..d016b3c 100644 (file)
@@ -81,7 +81,7 @@
         </tbody>
     </table>
 
-    <div style='font-weight: bold; padding: 5px; margin: 5px; width: 100%;' 
+    <div style='font-weight: bold; padding: 5px; margin: 5px; width: 100%;'
         class='hide_me color_4' id='rdetail_deleted_exp'>
         &rdetail.record.deleted;
     </div>
index b0c26ef..fb39934 100644 (file)
@@ -45,7 +45,7 @@
                                     <table width='100%' class='data_grid'>
                                         <tbody name='extras_tbody'>
                                             <tr name='extras_row' class='hide_me'>
-                                                <td name='type' width='20%'> 
+                                                <td name='type' width='20%'>
                                                     <span name='note' class='hide_me'>
                                                         <b>&rdetail.cn.note;</b>
                                                     </span>
@@ -77,7 +77,7 @@
         <div style='width:100%; border: 2px solid #E0F0E0; margin-bottom: 20px;'>
             <input type='submit' value='&rdetail.cn.print;' onclick='window.print();' />
         </div>
-        <div name='body'> 
+        <div name='body'>
             <table>
                 <tbody name='tbody'>
                     <tr><td>&common.library;</td><td colspan='2' name='lib'></td></tr>
index db3196c..eba9017 100644 (file)
@@ -1,12 +1,12 @@
 [%  WRAPPER "default/kcls-wire/parts/base.tt2";
     INCLUDE "default/kcls-wire/parts/topnav.tt2";
     ctx.page_title = "Record Detail" %]
-[% BLOCK html_head -%]
+[% BLOCK html_head %]
 <style type="text/css">
     #rdetail_copy_info_table { font-size: 8pt; }
     #rdetail_copy_info_table td { padding: 3px; }
 </style>
-[%- END %]
+[% END %]
     <div id="search-wrapper">
         [% INCLUDE "default/kcls-wire/parts/utils.tt2" %]
         [% INCLUDE "default/kcls-wire/parts/searchbar.tt2" %]