diff -r de56132c008d -r bdac73ed481e includes/clientside/static/admin-menu.js --- a/includes/clientside/static/admin-menu.js Sun Mar 28 21:49:26 2010 -0400 +++ b/includes/clientside/static/admin-menu.js Sun Mar 28 23:10:46 2010 -0400 @@ -24,20 +24,20 @@ if ( /admin_menu_state=/.test(document.cookie) ) { - var ck = (String(document.cookie).match(/admin_menu_state=([0-9]+)/))[1]; - if(ck) - { - ck = parseInt(ck); - } - else - { - ck = 0; - } - ck = ( isNaN(ck) ) ? 0 : ck; + var ck = (String(document.cookie).match(/admin_menu_state=([0-9]+)/))[1]; + if(ck) + { + ck = parseInt(ck); + } + else + { + ck = 0; + } + ck = ( isNaN(ck) ) ? 0 : ck; } else { - var ck = 0; + var ck = 0; } function tree (a_items, a_template, s_target) { @@ -63,26 +63,26 @@ } this.toggle = function (n_id,co) { var o_item = this.a_index[n_id]; o_item.open(o_item.b_opened,co); }; - this.open = function (n_id,co) { var o_item = this.a_index[n_id]; o_item.open(false,co); }; + this.open = function (n_id,co) { var o_item = this.a_index[n_id]; o_item.open(false,co); }; this.select = function (n_id) { return this.a_index[n_id].select(); }; this.mout = function (n_id) { this.a_index[n_id].upstatus(true) }; this.mover = function (n_id) { this.a_index[n_id].upstatus() }; this.a_children = []; for (var i = 0; i < a_items.length; i++) - { + { new tree_item(this, i); - } + } this.n_id = trees.length; trees[this.n_id] = this; for (var i = 0; i < this.a_children.length; i++) - { - if ( s_target ) - document.getElementById(s_target).innerHTML += this.a_children[i].init(); - else - document.write(this.a_children[i].init()); + { + if ( s_target ) + document.getElementById(s_target).innerHTML += this.a_children[i].init(); + else + document.write(this.a_children[i].init()); this.a_children[i].open(false, true); } } @@ -103,57 +103,57 @@ this.a_children = []; for (var i = 0; i < this.a_config.length - 2; i++) - { + { new tree_item(this, i); - } - + } + this.get_icon = item_get_icon; this.open = item_open; this.select = item_select; this.init = item_init; this.upstatus = item_upstatus; this.is_last = function () { return this.n_order == this.o_parent.a_children.length - 1 }; - - // CODE MODIFICATION - // added: - // Do we need to open the branch? - n = Math.pow(2, this.n_id); - var disp = ( ck & n ) ? true : false; - s = ( disp ) ? 'open' : 'closed'; - //if(s=='open') alert(this.n_id + ': ' + s); - if(disp) setTimeout('trees['+trees.length+'].open('+this.n_id+', true);', 10); - // END MODIFICATIONS + + // CODE MODIFICATION + // added: + // Do we need to open the branch? + n = Math.pow(2, this.n_id); + var disp = ( ck & n ) ? true : false; + s = ( disp ) ? 'open' : 'closed'; + //if(s=='open') alert(this.n_id + ': ' + s); + if(disp) setTimeout('trees['+trees.length+'].open('+this.n_id+', true);', 10); + // END MODIFICATIONS } function item_open (b_close, nocookie) { - //alert('item_open('+this.n_id+');'); + //alert('item_open('+this.n_id+');'); var o_idiv = get_element('i_div' + this.o_root.n_id + '_' + this.n_id); if (!o_idiv) return; if (!o_idiv.innerHTML) { var a_children = []; for (var i = 0; i < this.a_children.length; i++) - { + { a_children[i]= this.a_children[i].init(); - } + } o_idiv.innerHTML = a_children.join(''); } o_idiv.style.display = (b_close ? 'none' : 'block'); - - // CODE MODIFICATION - // added: - if(!nocookie) - { - // The idea here is to use a bitwise field. Nice 'n simple, right? Object of the game is to assemble - // a binary number that depicts the open/closed state of the entire menu in one cookie. - n = Math.pow(2, this.n_id); - ck = ( b_close ) ? ck-n : ck+n; - //alert('open(): doing the cookie routine for id '+this.n_id+"\nResult for bitwise op: "+ck); - createCookie('admin_menu_state', ck, 365); - } else { - //alert('open(): NOT doing the cookie routine for id '+this.n_id); - } - // END MODIFICATIONS + + // CODE MODIFICATION + // added: + if(!nocookie) + { + // The idea here is to use a bitwise field. Nice 'n simple, right? Object of the game is to assemble + // a binary number that depicts the open/closed state of the entire menu in one cookie. + n = Math.pow(2, this.n_id); + ck = ( b_close ) ? ck-n : ck+n; + //alert('open(): doing the cookie routine for id '+this.n_id+"\nResult for bitwise op: "+ck); + createCookie('admin_menu_state', ck, 365); + } else { + //alert('open(): NOT doing the cookie routine for id '+this.n_id); + } + // END MODIFICATIONS this.b_opened = !b_close; var o_jicon = document.images['j_img' + this.o_root.n_id + '_' + this.n_id], @@ -191,14 +191,14 @@ return '
' + (this.n_depth ? a_offset.join('') + (this.a_children.length ? '' : '') : '') - // CODE MODIFICATION - // [7/20/08: removed ondblclick property (unneeded)] - // removed: + // CODE MODIFICATION + // [7/20/08: removed ondblclick property (unneeded)] + // removed: // + '' + this.a_config[0] + ' |