[Slashhack-cvs] slashhack/resources/js slashhack.js,1.1.1.1,1.2
Brought to you by:
fletch
|
From: Dave F. <fl...@us...> - 2004-10-20 03:59:21
|
Update of /cvsroot/slashhack/slashhack/resources/js In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29911/resources/js Modified Files: slashhack.js Log Message: Task #106510 (Tab titles / focus) implemented. Index: slashhack.js =================================================================== RCS file: /cvsroot/slashhack/slashhack/resources/js/slashhack.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** slashhack.js 18 Oct 2004 20:25:08 -0000 1.1.1.1 --- slashhack.js 20 Oct 2004 03:59:11 -0000 1.2 *************** *** 125,143 **** } function launchie(url) { ! var t = window.document.createElement('tab'); ! t.setAttribute('label', url); ! t.setAttribute('maxwidth', '120'); ! t.setAttribute('crop', 'end'); ! var p = window.document.createElement('tabpanel'); ! var i = window.document.createElement('iframe'); ! i.setAttribute('src', url); ! p.setAttribute('flex', '1'); ! i.setAttribute('flex', '1'); ! p.appendChild(i); ! var slashdot_tabs = window.document.getElementById('slashdot-tabs'); ! var slashdot_tabpanels = window.document.getElementById('slashdot-tabpanels'); ! slashdot_tabs.appendChild(t); ! slashdot_tabpanels.appendChild(p); } --- 125,167 ---- } + + var __launchie_cache = []; function launchie(url) { ! if (__launchie_cache[url]) { ! var o = __launchie_cache[url]; ! o[2].contentDocument.location.reload(); ! } ! else { ! var t = window.document.createElement('tab'); ! t.setAttribute('label', url); ! t.setAttribute('maxwidth', '120'); ! t.setAttribute('crop', 'end'); ! var p = window.document.createElement('tabpanel'); ! var i = window.document.createElement('iframe'); ! i.setAttribute('src', url); ! p.setAttribute('flex', '1'); ! i.setAttribute('flex', '1'); ! p.appendChild(i); ! window.addEventListener( ! 'load', ! function(evt) { ! //alert('evt.target' + evt.target); ! //alert('i.contentDocument' + i.contentDocument); ! if (evt.target == i.contentDocument) { ! t.label = evt.target.title; ! } ! }, ! true ! ); ! var slashdot_tabs = window.document.getElementById('slashdot-tabs'); ! slashdot_tabs.appendChild(t); ! var slashdot_tabpanels = window.document.getElementById('slashdot-tabpanels'); ! slashdot_tabpanels.appendChild(p); ! var o = [ t, p, i ]; ! __launchie_cache[url] = o; ! } ! var slashdot_tabbox = window.document.getElementById('slashdot-tabbox'); ! slashdot_tabbox.selectedTab = o[0]; ! slashdot_tabbox.selectedPanel = o[1]; } |