svn commit: samba r6241 - in trunk/swat: help js
deryck at samba.org
deryck at samba.org
Thu Apr 7 22:01:33 GMT 2005
Author: deryck
Date: 2005-04-07 22:01:33 +0000 (Thu, 07 Apr 2005)
New Revision: 6241
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6241
Log:
More SWAT -- Adds the "return to help" menu when dynamically
loading docs into help menu.
This needs style fixes before it will be useful.
--deryck
Modified:
trunk/swat/help/docs.html
trunk/swat/js/ui.js
Changeset:
Modified: trunk/swat/help/docs.html
===================================================================
--- trunk/swat/help/docs.html 2005-04-07 20:59:37 UTC (rev 6240)
+++ trunk/swat/help/docs.html 2005-04-07 22:01:33 UTC (rev 6241)
@@ -6,7 +6,7 @@
<b>Daemons</b>
<ul>
- <li><a href="/swat/help/smbd.8.html" onclick="loadDoc(this.href, 'controls'); return false">smbd</a> - the SMB daemon</li>
+ <li><a href="/swat/help/smbd.8.html" onclick="addTocNav();loadDoc(this.href, 'controls');return false;">smbd</a> - the SMB daemon</li>
<li><a href="/swat/help/nmbd.8.html" onclick="displayDoc(this.href); return false">nmbd</a> - the NetBIOS nameserver</li>
<li><a href="/swat/help/winbindd.8.html" onclick="displayDoc(this.href); return false">winbindd</a> - the winbind daemon</li>
</ul>
Modified: trunk/swat/js/ui.js
===================================================================
--- trunk/swat/js/ui.js 2005-04-07 20:59:37 UTC (rev 6240)
+++ trunk/swat/js/ui.js 2005-04-07 22:01:33 UTC (rev 6241)
@@ -59,6 +59,32 @@
head.appendChild(altLink);
}
+function addTocNav()
+{
+ var page = document.getElementsByTagName('body')[0];
+ var docList = document.getElementById('controls');
+
+ // Create "back" link on the fly
+ var toc = document.createElement('p');
+ var link = document.createElement('a');
+ link.setAttribute('href', 'help');
+ var linkText = document.createTextNode('Return to Help Menu');
+ link.appendChild(linkText);
+ toc.appendChild(link);
+
+ // Add "back" link to top of the page
+ var pageTop = page.firstChild;
+ page.insertBefore(toc, pageTop);
+
+ // Remove the docs list when done
+ var docListKids = docList.childNodes
+
+ for (i=docListKids.length - 2; i>=0; i--) {
+ docList.removeChild(docListKids[i]);
+ }
+}
+
+
/*********************************************************************
Initialize each page.
*********************************************************************/
More information about the samba-cvs
mailing list