Many random tweaks to get IE to behave
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 1 Feb 2006 23:15:17 +0000 (23:15 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 1 Feb 2006 23:15:17 +0000 (23:15 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2932 dcc99617-32d9-48b4-a31d-7c20da2025e4

13 files changed:
Open-ILS/web/opac/common/js/init.js
Open-ILS/web/opac/common/js/utils.js
Open-ILS/web/opac/skin/default/js/depth_selector.js
Open-ILS/web/opac/skin/default/js/myopac.js
Open-ILS/web/opac/skin/default/js/rdetail.js
Open-ILS/web/opac/skin/default/xml/common/css_common.xml
Open-ILS/web/opac/skin/default/xml/common/js_common.xml
Open-ILS/web/opac/skin/default/xml/common/logo.xml
Open-ILS/web/opac/skin/default/xml/home/homesearch.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_bookbags.xml
Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml
Open-ILS/web/opac/skin/default/xml/page_myopac.xml
Open-ILS/web/opac/skin/default/xml/setenv.xml

index 39ceb8e..8004f1f 100644 (file)
@@ -6,7 +6,6 @@ window.onunload = windowUnload;
 attachEvt("common", "init", loadUIObjects);
 attachEvt("common", "init", initParams);
 attachEvt("common", "init", initCookies);
-//attachEvt("common", "init", drawOrgTree); 
 
 attachEvt("common", "unload", _tree_killer);
 try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){}
@@ -14,8 +13,11 @@ try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){}
 function init() {
        runEvt('common','init');
        if( getOrigLocation() == 0 ) ORIGLOC = LOCATION;
-//     try { if(!isFrontPage) grabUser(); }catch(e){}
-       grabUser();
+
+       var cgi = new CGI();
+       if( grabUser() && cgi.param(PARAM_LOCATION) == null ) 
+               LOCATION = G.user.home_ou();
+
        runEvt("common", "run");
        //checkUserSkin();
        G.ui.common.now_searching.appendChild(text(findOrgUnit(getLocation()).name()));
index 4a060ce..214cfc4 100644 (file)
@@ -164,6 +164,8 @@ function setSelector( sel, value ) {
                for( var i = 0; i!= sel.options.length; i++ ) { 
                        if( sel.options[i] ) {
                                var val = sel.options[i].value;
+                               if( val == null || val == "" ) /* for IE */
+                                       val = sel.options[i].innerHTML;
                                value += ""; /* in case of number */ 
                                if( val && val.toLowerCase() == value.toLowerCase() ) {
                                        sel.selectedIndex = i;
@@ -176,16 +178,41 @@ function setSelector( sel, value ) {
 
 function getSelectorVal( sel ) {
        if(!sel) return null;
-       return sel.options[sel.selectedIndex].value;
+       var o = sel.options[sel.selectedIndex];
+       var v = o.value; 
+       if(v == null || v == "") v = o.innerHTML;
+       return v;
+}
+
+function debugSelector(sel) {
+       var s = 'Selector\n';
+       for( var i = 0; i != sel.options.length; i++ ) {
+               var o = sel.options[i];
+               s += "\t" + o.innerHTML + "\n";
+       }
+       return s;
+}
+
+function doSelectorActions(sel) {
+       if(IE && sel) { 
+               sel.onchange = function() {
+                       var o = sel.options[sel.selectedIndex];
+                       if(o && o.onclick) o.onclick()
+               }
+       }
 }
 
 /* if index < 0, the item is pushed onto the end */
 function insertSelectorVal( selector, index, name, value, action, indent ) {
        if( index < 0 ) index = selector.options.length;
-       for( var i = selector.options.length; i != index; i-- ) {
-               selector.options[i] = selector.options[i-1].cloneNode(true);
-       }
+       var a = [];
+       for( var i = selector.options.length; i != index; i-- ) 
+               a[i] = selector.options[i-1];
+
        setSelectorVal( selector, index, name, value, action, indent );
+
+       for( var i = index + 1; i != a.length; i++ ) 
+               selector.options[i] = a[i];
 }
 
 function setSelectorVal( selector, index, name, value, action, indent ) {
@@ -196,20 +223,22 @@ function setSelectorVal( selector, index, name, value, action, indent ) {
        if(IE) {
                var pre = elem("pre");
                for( var i = 0; i != indent; i++ )
-                       pre.appendChild(text(" "));
+                       pre.appendChild(text("   "));
 
                pre.appendChild(text(name));
                option = new Option("", value);
                selector.options[index] = option;
-               select.appendChild(pre);
+               option.appendChild(pre);
        
        } else {
                indent = indent * 14;
                option= new Option(name, value);
                option.setAttribute("style", "padding-left: "+indent+'px;');
                selector.options[index] = option;
+               if(action) option.onclick = action;
        }
-       if(action) option.onclick = action;
+
+       option.onclick = action;
 }
 
 
index 895c862..2403de1 100644 (file)
@@ -84,6 +84,8 @@ function buildLocationSelector(newLoc) {
        selector.appendChild(node);
 }
 
+function getNewSearchDepth() { return newSearchDepth; }
+function getNewSearchLocation() { return _newlocation; }
 function depthSelGetNewLoc() { return _newlocation; }
 
 function updateLoc(location, depth) {
index 78f804c..5fd1dc8 100644 (file)
@@ -2,6 +2,8 @@
 attachEvt("common", "run", myOPACInit );
 attachEvt("common", "loggedIn", myOPACInit );
 
+attachEvt('common','locationUpdated', myopacReload );
+
 var fleshedUser = null;
 var fleshedContainers = {};
 
@@ -18,6 +20,15 @@ function myOPACInit() {
        else myOPACChangePage( "summary" );
 }
 
+function myopacReload() {
+       swapCanvas($('myopac_reloading'));
+       //alert($('myopac_reloading').className);
+       var a = {};
+       a[PARAM_LOCATION] = getNewSearchLocation();
+       a[PARAM_DEPTH] = getNewSearchDepth();
+       goTo(buildOPACLink(a, true));
+}
+
 
 function myOPACChangePage( page ) {
        
@@ -550,7 +561,7 @@ function myOPACShowBookbags(force) {
                myOPACFetchBBItems( cont.id(), row );
                dlink.setAttribute('href', 'javascript:myOPACDeleteBookbag("'+cont.id()+'");');
 
-               if( cont.public() ) {
+               if( cont.pub() ) {
                        unHideMe($n(row, 'myopac_bb_published_yes'));
                        var link = $n(row, 'myopac_bb_published_view');
                        link.setAttribute('href', buildExtrasLink( 'bbags.xml?bb='+cont.id(), false));  
index 86865d5..69786a8 100644 (file)
@@ -126,18 +126,20 @@ function rdetailAddBookbags(r) {
        var selector = $('rdetail_more_actions_selector');
        var found = false;
        var index = 3;
+       doSelectorActions(selector);
 
        for( var i = 0; i != containers.length; i++ ) {
                found = true;
                var container = containers[i];
                insertSelectorVal( selector, index++, container.name(), 
-                       "container_" + container.id(), rdetailAddToBookbag, 1 );
+                       "container_" + container.id(), rdetailAddToBookbag,  1 );
        }
 
        nextContainerIndex = index;
        if(!found) insertSelectorVal( selector, 3, "name", "value", 1 );
 }
 
+var _actions = {};
 function rdetailNewBookbag() {
        var name = prompt($('rdetail_bb_new').innerHTML,"");
        if(!name) return;
@@ -146,9 +148,9 @@ function rdetailNewBookbag() {
        if( id = containerCreate( name ) ) {
                alert($('rdetail_bb_success').innerHTML);
                var selector = $('rdetail_more_actions_selector');
-               setSelector( selector, 'start' );
                insertSelectorVal( selector, nextContainerIndex++, name, 
                        "container_" + id, rdetailAddToBookbag, 1 );
+               setSelector( selector, 'start' );
        }
 }
 
@@ -231,9 +233,9 @@ function rdetailBuildCNList() {
        for( var i in arr ) {
                var cn = arr[i];
                var opt = new Option(cn);
-               opt.onclick = rdetailGatherCN;
                select.options[index++] = opt;
        }
+       select.onchange = rdetailGatherCN;
 }
 
 function rdetailGatherCN() {
index 7edcbee..a7286be 100644 (file)
@@ -1,7 +1,7 @@
 
 <!-- CSS shared across pages goes here --> 
 
-<link type='text/css' rel='stylesheet' href='../css/layout.css'/>
+<link type='text/css' rel='stylesheet' href="<!--#echo var='OILS_SKIN_BASE'-->/default/css/layout.css"/>
 
 <!-- Our font CSS's -->
 <link type='text/css' rel='stylesheet'                                 
index d7a07c2..832a23d 100644 (file)
@@ -8,7 +8,7 @@
        <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/Cookies.js'> </script>
        <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/md5.js'> </script>
 
-       <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->//slimtree.js'> </script>
+       <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/slimtree.js'> </script>
 
        <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/JSON.js'> </script>
        <script language='javascript' src='<!--#echo var="OILS_JS_BASE"-->/fmcore.js'> </script>
index 268a297..7970a18 100644 (file)
@@ -1,4 +1,4 @@
 <div id='logo_div'>
        <script language='javascript'>config.ids.common.top_logo = "top_left_logo";</script>
-       <img src='../../../../images/small_logo.jpg' id='top_left_logo' border='0' class='logo'> </img>
+       <img src='<!--#echo var="OILS_BASE"-->/images/small_logo.jpg' id='top_left_logo' border='0' class='logo'> </img>
 </div>
index a1151c6..464fca6 100644 (file)
@@ -4,8 +4,10 @@
        xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
 
        <!-- load my js -->
-       <script language='javascript' src='../js/depth_selector.js'> </script>
-       <script language='javascript' src='../js/search_bar.js'> </script>
+       <script language='javascript' 
+               src="<!--#echo var='OILS_SKIN_BASE'-->/default/js/depth_selector.js"> </script>
+       <script language='javascript' 
+               src="<!--#echo var='OILS_SKIN_BASE'-->/default/js/search_bar.js"> </script>
 
        <script language='javascript'>
                config.ids.searchbar = {};
@@ -26,7 +28,7 @@
 
 
        <div style='width: 100%; text-align: center'>
-               <img src='../../../../images/main_logo.jpg' />
+               <img src='<!--#echo var="OILS_BASE"-->/images/main_logo.jpg' />
        </div>
 
 
index cf40f2b..06d04da 100644 (file)
@@ -24,7 +24,7 @@
                                <td>
                                        <a href='javascript:void(0);' class='classic_link' name='myopac_expand_bookbag'> </a>
                                </td>
-                               <td><span name='myopac_bookbag_item_count'> </span> <span>Items</span></td>
+                               <td><span name='myopac_bookbag_item_count'> </span> <span> Items</span></td>
                                <td>
                                        <span name='myopac_bb_published_no' class='hide_me'>No</span>
                                        <span name='myopac_bb_published_yes' class='hide_me'>Yes</span>
index fd67694..f2c7466 100644 (file)
@@ -11,7 +11,7 @@
                        <tr>
                                <td width='50%'>Title</td>
                                <td width='20%'>Author</td>
-                               <td width='10%' nowrap='nowrap' align='center'>Due Data</td>
+                               <td width='10%' nowrap='nowrap' align='center'>Due Date</td>
                                <td width='10%' nowrap='nowrap' align='center'>Renewals Remaining</td>
                                <td width='10%' nowrap='nowrap' align='center'>Renew</td>
                        </tr>
index 560f231..3a8502b 100644 (file)
@@ -6,6 +6,9 @@
        <script language='javascript' src='../../../../common/js/fmextcore.js'> </script>
        <script language='javascript' src='../../../../common/js/fmgen.js'> </script>
 
+       <script> config.ids.altcanvas.myopac_reload = 'myopac_reloading'; </script>
+       <div id='myopac_reloading' class='hide_me non_canvas'> Loading... </div>
+
        <script language='javascript'>
                config.ids.myopac = {};
                config.css.myopac = {};
index a1feed1..d41ad16 100644 (file)
@@ -28,6 +28,7 @@
 <!--#set var="OILS_JS_BASE" value="${OILS_BASE}/common/js"-->
 <!--#set var="OILS_CSS_BASE" value="${OILS_BASE}/common/css"--> 
 <!--#set var="OILS_THEME_BASE" value="${OILS_BASE}/theme"--> 
+<!--#set var="OILS_SKIN_BASE" value="${OILS_BASE}/skin"--> 
 
 <!--#if expr="!$locale || $locale=''"-->
        <!--#set var="locale" value="en-US"-->