no longer using dtree
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 14 Nov 2005 17:03:36 +0000 (17:03 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 14 Nov 2005 17:03:36 +0000 (17:03 +0000)
offloading the org tree building until user elects to change locations (built dynamically)
added helpful note to org tree selecter page

git-svn-id: svn://svn.open-ils.org/ILS/trunk@2020 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/init.js
Open-ILS/web/opac/common/js/opac_utils.js
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/opac/skin/default/js/result_common.js
Open-ILS/web/opac/skin/default/js/search_bar.js
Open-ILS/web/opac/skin/default/js/sidebar.js
Open-ILS/web/opac/skin/default/xml/index.xml
Open-ILS/web/opac/skin/default/xml/js_common.xml
Open-ILS/web/opac/skin/default/xml/orgtree.xml
Open-ILS/web/opac/skin/default/xml/result_common.xml

index 3be3658..0c3055a 100644 (file)
@@ -6,7 +6,7 @@ window.onunload = windowUnload;
 attachEvt("common", "init", loadUIObjects);
 attachEvt("common", "init", initParams);
 attachEvt("common", "init", initCookies);
-attachEvt("common", "init", drawOrgTree); 
+//attachEvt("common", "init", drawOrgTree); 
 
 attachEvt("common", "unload", _tree_killer);
 try{ attachEvt("common", "unload", cleanRemoteRequests);} catch(e){}
index 8c823d0..629c69e 100644 (file)
@@ -416,7 +416,8 @@ function unHideMe(obj) { removeCSSClass(obj, config.css.hide_me); }
 /* ----------------------------------------------------------------------- */
 function drawOrgTree() {
        //G.ui.common.org_tree.innerHTML = buildOrgSelector().toString();
-       buildOrgSelector(G.ui.common.org_tree, orgTreeSelector);
+       //buildOrgSelector(G.ui.common.org_tree, orgTreeSelector);
+       setTimeout( 'buildOrgSelector(G.ui.common.org_tree, orgTreeSelector);', 10 );
 }
        
 var orgTreeSelector;
@@ -435,6 +436,8 @@ function buildOrgSelector(node) {
                                "javascript:orgSelect(" + node.id() + ");", node.name());
                }
        }
+       hideMe($('org_loading_div'));
+       unHideMe($('org_selector_tip'));
        return tree;
 }
 
index 56d91e1..d38ad8b 100644 (file)
 <!ENTITY common.tips.tip1 "Click on a folder icon in the sidebar to access related quick searches">
 <!ENTITY common.tips.tip2 "If you don't find what you want try expanding your search using the range selector at the right of the search bar">
 
+<!ENTITY common.org.openAll "Expand All">
+<!ENTITY common.org.closeAll "Close All">
+<!ENTITY common.org.cancel "Cancel">
+<!ENTITY common.org.loading "Loading library selector...">
+<!ENTITY common.org.note "Tip:">
+<!ENTITY common.org.notetext "Click on a location's name to select it.  Click on the folder icons to expand a region.">
 
 <!-- Sidebar Header Labels -->
 <!ENTITY sidebar.relevantSubjects.headerLabel "Relevant Subjects">
index 6eea11d..2c65519 100644 (file)
@@ -157,7 +157,9 @@ function resultDisplayRecord(rec, pos, is_mr) {
 
        if(resultPageIsDone())  {
                /* hide the 'now loading...' message */
+               /*
                hideMe(G.ui.common.loading);
+               */
                runEvt('result', 'allRecordsReceived', recordsCache);
        }
 }
index 4dfd061..6533496 100644 (file)
@@ -45,12 +45,20 @@ function searchBarInit() {
 
 }
 
+var orgTreeIsBuilt = false;
 function _opacHandleLocationTagClick() {
        /*
        orgTreeSelector.openTo(  
                (newSearchLocation != null) ? parseInt(newSearchLocation) : getLocation(), true );
                */
        swapCanvas(G.ui.common.org_container);
+
+       if(!orgTreeIsBuilt) {
+               drawOrgTree();
+               orgTreeIsBuilt = true;
+               //hideMe($('org_loading_div'));
+       }
+
 }
 
 function depthSelectorChanged() {
@@ -78,7 +86,8 @@ function buildLocationSelector(newLoc) {
 
        var selector = G.ui.searchbar.depth_selector
        if(!chooseAnotherNode) 
-               chooseAnotherNode = selector.removeChild(selector.getElementsByTagName("option")[0]);
+               chooseAnotherNode = selector.removeChild(
+                       selector.getElementsByTagName("option")[0]);
        var node = chooseAnotherNode;
        removeChildren(selector);
        
index dcb99aa..3011a95 100644 (file)
@@ -4,6 +4,8 @@
 attachEvt("common", "init", initSideBar);
 attachEvt("common", "init", setSidebarLinks);
 
+attachEvt("common", "unload", sidebarTreesFree );
+
 function initSideBar() {
        var page = findCurrentPage();
 
@@ -78,4 +80,12 @@ function setSidebarLinks() {
        G.ui.sidebar.myopac_link.setAttribute("href", buildOPACLink({page:MYOPAC}, false, true));
 }
 
+function sidebarTreesFree() {
+       removeChildren($(subjectSidebarTree.rootid));
+       removeChildren($(authorSidebarTree.rootid));
+       removeChildren($(seriesSidebarTree.rootid));
+       subjectSidebarTree = null;
+       authorSidebarTree = null;
+       seriesSidebarTree = null;
+}
 
index 80a8e55..a2846cd 100644 (file)
@@ -12,7 +12,6 @@
                <script language='javascript' src='../../../common/js/Cookie.js'> </script>
 
                <script language='javascript' src='../../../common/js/slimtree.js'> </script>
-               <script language='javascript' src='../../../common/js/dtree.js'> </script>
                <script language='javascript' src='../../../common/js/JSON.js'> </script>
                <script language='javascript' src='../../../common/js/fmcore.js'> </script>
                <script language='javascript' src='../../../common/js/fmgen.js'> </script>
index 15f99e9..db440de 100644 (file)
@@ -11,7 +11,6 @@
        <script language='javascript' src='../../../common/js/md5.js'> </script>
 
        <script language='javascript' src='../../../common/js/slimtree.js'> </script>
-       <script language='javascript' src='../../../common/js/dtree.js'> </script>
 
        <script language='javascript' src='../../../common/js/JSON.js'> </script>
        <script language='javascript' src='../../../common/js/fmcore.js'> </script>
index fc4e2cc..251d820 100644 (file)
@@ -2,11 +2,27 @@
 
 <!-- the org tree -->
 <div id='org_container' class='hide_me non_canvas'>
+
        <div id='org_link_container' class='color_1'>
-               <span class='org_link'><a onclick='orgTreeSelector.openAll();' href='javascript:void(0);'>Expand All</a></span>
-               <span class='org_link'><a onclick='orgTreeSelector.closeAll();' href='javascript:void(0);'>Collapse All</a></span>
-               <span class='org_link'><a onclick='showCanvas();' href='javascript:void(0);'> Cancel </a></span>
+               <span class='org_link'>
+                       <a onclick='orgTreeSelector.expandAll();' 
+                               href='javascript:void(0);'>&common.org.openAll;</a>
+               </span>
+               <span class='org_link'>
+                       <a onclick='orgTreeSelector.closeAll();' 
+                               href='javascript:void(0);'>&common.org.closeAll;</a>
+               </span>
+               <span class='org_link'>
+                       <a onclick='showCanvas();' href='javascript:void(0);'>&common.org.cancel;</a>
+               </span>
        </div>
+
+       <div id='org_loading_div'><br/><span>&common.org.loading;</span></div>
+       <br/>
+       <div id='org_selector_tip' class='tips hide_me'><b>&common.org.note;</b>
+               <span>&common.org.notetext;</span>
+       </div>
+       <br/>
        <div id='org_tree' class='org_tree'> </div>
        <br/>
 </div>
index 944c32a..4b80fed 100644 (file)
@@ -29,7 +29,9 @@
                config.names.result.count_cell  = "copy_count_cell";
        </script>
 
+       <!--
        <div id='loading_div' class='color_1'> Loading Results... </div>
+       -->
        <xi:include href="result_table.xml"/>
 </div>