|
From: Jon O. <jon...@us...> - 2007-08-06 13:23:49
|
Update of /cvsroot/mxbb/mx_bugsbt/bugsbt/includes/js In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8046/bugsbt/includes/js Modified Files: init_main.js Log Message: Fix for updating the Ajax API from plain url. Didn't fix the script for updating the products tree. Not needed atm. Index: init_main.js =================================================================== RCS file: /cvsroot/mxbb/mx_bugsbt/bugsbt/includes/js/init_main.js,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** init_main.js 28 Apr 2007 19:45:17 -0000 1.2 --- init_main.js 6 Aug 2007 13:22:59 -0000 1.3 *************** *** 9,48 **** window.onload = initialize; ! /* tree.textClickListener.add(function() { ! if (document.getElementById("tree-insert-form").style.display == "block") { ! treeInsert(); ! } ! }); ! */ ! tree.textClickListener.add(function() { ! if (!tree.getActiveNode().isDocument()) { ! if (tree.getActiveNode().childNodes) { ! for (var i = 0; i < tree.getActiveNode().childNodes.length; i++) { ! if (tree.getActiveNode().childNodes[i].isDocument()) { ! //queryPath = tree.getActiveNode().childNodes[i].id; ! //tree.queryPath = queryPath.replace('tree-', ""); ! //tree.active = queryPath; ! //tree.loadState(); ! //tree.updateHtml(); ! //break; ! } ! } ! } } }); tree.textClickListener.add(function() { - //if (tree.getActiveNode().isDocument()) { - // if (getCookie('openEditBug')) editBug(); - // else viewBugs(); viewBugs(); document.title = el(tree.active+"-text").innerHTML; - //} - //else - //{ - // clearTabs(); - //} }); --- 9,36 ---- window.onload = initialize; ! // This updates docs whenever a node is clicked OR updateUI() is called tree.textClickListener.add(function() { ! /* ! if (tree.getActiveNode().isDocument()) { ! dhtmlHistory.add( treeGetId(), el(tree.active+"-text").innerHTML ); ! queryPath = tree.getActiveNode().id; ! tree.queryPath = queryPath.replace('tree-', ""); ! tree.active = queryPath; ! tree.loadState(); ! tree.updateHtml(); ! document.title = el(tree.active+"-text").innerHTML; } + else + { + el('tabs-data').innerHTML = ""; + } + */ }); + // Activate first doc in the clicked folder tree.textClickListener.add(function() { viewBugs(); document.title = el(tree.active+"-text").innerHTML; }); *************** *** 59,68 **** var initialLocation = dhtmlHistory.getCurrentLocation(); // if no location specified, use the default ! if ((initialLocation == '' || initialLocation == null) && tree.allNodes[0]) { if (tree.allNodes[0].childNodes) { // First set default, then loop to find real document queryPath = tree.allNodes[0].id; for (var i = 0; i < tree.allNodes[0].childNodes.length; i++) { if (tree.allNodes[0].childNodes[i].isDocument()) { --- 47,65 ---- var initialLocation = dhtmlHistory.getCurrentLocation(); + // The App has received a standard GET url + if (bugPath != '') + { + initialLocation = bugPath; + current_bug_id = bugPath; + viewBug(bugPath); + } + // if no location specified, use the default ! else if ((initialLocation == '' || initialLocation == null) && tree.allNodes[0]) { if (tree.allNodes[0].childNodes) { // First set default, then loop to find real document queryPath = tree.allNodes[0].id; + for (var i = 0; i < tree.allNodes[0].childNodes.length; i++) { if (tree.allNodes[0].childNodes[i].isDocument()) { |