svn commit: samba r6183 - in trunk/swat: include js
deryck at samba.org
deryck at samba.org
Sun Apr 3 04:00:39 GMT 2005
Author: deryck
Date: 2005-04-03 04:00:38 +0000 (Sun, 03 Apr 2005)
New Revision: 6183
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6183
Log:
More SWAT work -- this provides a simpler, better
way for handling page flicker caused by alternate
styles on help and vieconfig pages.
--deryck
Modified:
trunk/swat/include/header.html
trunk/swat/js/ui.js
Changeset:
Modified: trunk/swat/include/header.html
===================================================================
--- trunk/swat/include/header.html 2005-04-03 03:58:45 UTC (rev 6182)
+++ trunk/swat/include/header.html 2005-04-03 04:00:38 UTC (rev 6183)
@@ -12,6 +12,7 @@
<link rel="stylesheet" href="/swat/include/common.css" type="text/css" media="screen" title="SWAT style" />
<link rel="stylesheet" href="/swat/include/main.css" type="text/css" media="screen" title="SWAT style" />
+
<script src="/swat/js/navOvers.js" type="text/javascript"></script>
<script src="/swat/js/ui.js" type="text/javascript"></script>
<script src="/swat/js/domPipe.js" type="text/javascript"></script>
@@ -20,6 +21,16 @@
<body>
+<!-- Help avoid flicker when loading styles -->
+<script type="text/javascript">
+<!-- Hide from old browsers
+ if ( location.href.indexOf('viewconfig') > -1 || location.href.indexOf('help') > -1 ) {
+ thisPage = document.getElementsByTagName('body')[0]
+ thisPage.style.visibility = 'hidden';
+ }
+// end hide -->
+</script>
+
<div id="gui">
<div id="banner">
Modified: trunk/swat/js/ui.js
===================================================================
--- trunk/swat/js/ui.js 2005-04-03 03:58:45 UTC (rev 6182)
+++ trunk/swat/js/ui.js 2005-04-03 04:00:38 UTC (rev 6183)
@@ -18,7 +18,6 @@
*/
-var page = document.getElementsByTagName('body')[0];
function openHelp(url)
{
@@ -60,53 +59,23 @@
head.appendChild(altLink);
}
-function hidePage(page, state)
-{
- if (state == 'on') {
- page.style.visibility = 'hidden';
- } else if (state == 'off') {
- page.style.visibility = 'visible';
- }
-}
-
-function catchHardReload(event)
-{
- if (event.ctrlKey && event.which == 82) {
- setCookie();
- }
-}
-
-function setCookie()
-{
- document.cookie = "SWATHardReload=TRUE";
-}
-
-function deleteCookie()
-{
- document.cookie = document.cookie + ";expires=Thu, 24-Jan-1972 00:00:01 GMT";
-}
-
-
/*********************************************************************
Initialize each page.
*********************************************************************/
-window.onload = function initPage(e)
+window.onload = function initPage()
{
- window.captureEvents(Event.KEYPRESS);
- window.onkeypress = catchHardReload;
-
- if (location.href.indexOf('help') > -1 || location.href.indexOf('viewconfig') > -1) {
+ var page = document.getElementsByTagName('body')[0];
+
+ if (location.href.indexOf('viewconfig') > -1) {
+ formatHelp();
+ page.style.visibility = 'visible';
+ }
+
+ if (location.href.indexOf('help') > -1 ) {
// Init iframe for file loads
setStage();
-
- if (document.cookie != '') {
- hidePage(page, 'on');
- setTimeout('formatHelp()', 100);
- setTimeout('hidePage(page, "off")', 150);
- deleteCookie();
- } else {
- formatHelp();
- }
+ formatHelp();
+ page.style.visibility = 'visible';
}
}
More information about the samba-cvs
mailing list