svn commit: samba r6366 - in trunk: source/web swat/help
swat/include swat/js
deryck at samba.org
deryck at samba.org
Mon Apr 18 05:38:01 GMT 2005
Author: deryck
Date: 2005-04-18 05:38:00 +0000 (Mon, 18 Apr 2005)
New Revision: 6366
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6366
Log:
Final touches on the SWAT redesign I've been slowly working on.
This finishes an aesthetic redesign, with only minor changes
to functionality.
Tomorrow I'll post screen shots to the samba-technical list to
begin getting feedback from others. This should be safe to
use and test now, for those who are interested.
deryck
Added:
trunk/swat/help/welcome_passwd_only.html
Modified:
trunk/source/web/swat.c
trunk/swat/include/footer.html
trunk/swat/include/header.html
trunk/swat/include/help.css
trunk/swat/include/main.css
trunk/swat/js/ui.js
Changeset:
Modified: trunk/source/web/swat.c
===================================================================
--- trunk/source/web/swat.c 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/source/web/swat.c 2005-04-18 05:38:00 UTC (rev 6366)
@@ -564,11 +564,15 @@
}
/****************************************************************************
- display a welcome page
+ display a welcome page (Read-only users under passwd only get a unique welcome)
****************************************************************************/
static void welcome_page(void)
{
- include_html("help/welcome.html");
+ if (passwd_only && !have_write_access) {
+ include_html("help/welcome_passwd_only.html");
+ } else {
+ include_html("help/welcome.html");
+ }
}
/****************************************************************************
@@ -782,7 +786,7 @@
printf("<form method=post action=wizard>\n");
if (have_write_access) {
- printf("%s\n", _("The \"Rewrite smb.conf file\" button will clear the smb.conf file of all default values and of comments."));
+ printf("%s\n", _("The "Rewrite smb.conf file" button will clear the smb.conf file of all default values and of comments."));
printf("%s", _("The same will happen if you press the commit button."));
printf("<br><br>\n");
printf("<center>");
Added: trunk/swat/help/welcome_passwd_only.html
===================================================================
--- trunk/swat/help/welcome_passwd_only.html 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/swat/help/welcome_passwd_only.html 2005-04-18 05:38:00 UTC (rev 6366)
@@ -0,0 +1,6 @@
+
+ <h2>Welcome to SWAT!</h2>
+
+ <p>Your system administrator has set SWAT to be used only for
+ changing user passwords. Follow the tab above to change or set
+ your password.</p>
Modified: trunk/swat/include/footer.html
===================================================================
--- trunk/swat/include/footer.html 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/swat/include/footer.html 2005-04-18 05:38:00 UTC (rev 6366)
@@ -1,6 +1,6 @@
<div id="footer">
- <p>For the latest news and information on Samba, please see
+ <p>Additional help and information is available from
<a href="http://samba.org/">http://samba.org/</a>.
<img src="/swat/images/logo.png" alt="Samba" /></p>
</div>
Modified: trunk/swat/include/header.html
===================================================================
--- trunk/swat/include/header.html 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/swat/include/header.html 2005-04-18 05:38:00 UTC (rev 6366)
@@ -15,7 +15,6 @@
<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>
</head>
@@ -25,8 +24,8 @@
<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';
+ var page = document.getElementsByTagName('body')[0];
+ hidePage(page, 'on');
}
// end hide -->
</script>
Modified: trunk/swat/include/help.css
===================================================================
--- trunk/swat/include/help.css 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/swat/include/help.css 2005-04-18 05:38:00 UTC (rev 6366)
@@ -29,6 +29,7 @@
border-top:1px outset #003062;
width:70%;
height:1px;
+ margin:auto;
color:#FFF;
}
#toc h4 {
Modified: trunk/swat/include/main.css
===================================================================
--- trunk/swat/include/main.css 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/swat/include/main.css 2005-04-18 05:38:00 UTC (rev 6366)
@@ -33,6 +33,10 @@
}
#banner img {
float:right;
+ margin:3px 0 0 0;
+}
+/* Only visible to Mozilla/Firefox */
+#banner:lang(en) img {
margin:-28px 1px 0 0;
}
#nav {
Modified: trunk/swat/js/ui.js
===================================================================
--- trunk/swat/js/ui.js 2005-04-17 07:57:45 UTC (rev 6365)
+++ trunk/swat/js/ui.js 2005-04-18 05:38:00 UTC (rev 6366)
@@ -20,18 +20,27 @@
function openHelp(url)
{
if ( (screen.width - 50) >= (window.screenX + window.outerWidth + 100) ) {
- left = (screenX + outerWidth) - 350;
+ thisLeft = (window.screenX + window.outerWidth) - 350;
} else {
- left = screen.width - 450;
+ thisLeft = screen.width - 450;
}
- if ((screenY - 50) > 0 ) {
- top = screenY - 50;
+ // Konqueror I tested reports screeY so that 0 == 138
+ if (navigator.appName == 'Konqueror') {
+ if ( ((window.screenY - 138) - 50) > 0 ) {
+ thisTop = (window.screenY -138) - 50;
+ } else {
+ thisTop = 0;
+ }
} else {
- top = 0;
+ if ((window.screenY - 50) > 0 ) {
+ thisTop = window.screenY - 50;
+ } else {
+ thisTop = 0;
+ }
}
- helpPop = window.open(url, 'docsWindow', 'menubar=yes, resizeable=yes, scrollbars=yes, width=450px, height=530px, screenX=' + String(left) + ', screenY=' + String(top));
+ helpPop = window.open(url, 'docsWindow', 'menubar=yes, resizeable=yes, scrollbars=yes, width=450, height=530, screenX=' + String(thisLeft) + ', screenY=' + String(thisTop));
helpPop.focus();
}
@@ -61,7 +70,6 @@
function addTocTitle()
{
- var page = document.getElementsByTagName('body')[0];
var tocTitle = document.createElement('div');
tocTitle.setAttribute('id', 'toc');
@@ -78,6 +86,37 @@
page.insertBefore(tocTitle, topPage);
}
+function hidePage(page, state)
+{
+ if (state == 'on') {
+ page.style.visibility = 'hidden';
+ } else if (state == 'off') {
+ page.style.visibility = 'visible';
+ }
+}
+
+function alignPasswdOnly()
+{
+ var navDiv = document.getElementById('nav');
+
+ if (navigator.appName == 'Konqueror') {
+ rhtMargin = '21px';
+ } else {
+ rhtMargin = '26px';
+ }
+
+ if (navDiv.childNodes.length <= 3) {
+ navDiv.style.textAlign = 'right';
+
+ for (i=0; i<=navDiv.childNodes.length; i++) {
+ if ( (navDiv.childNodes[i]) && (navDiv.childNodes[i].nodeName.toLowerCase() == 'img') ) {
+ navDiv.childNodes[i].style.marginRight = rhtMargin;
+ }
+ }
+ }
+}
+
+
/*********************************************************************
Initialize help pages.
*********************************************************************/
@@ -87,13 +126,17 @@
if (location.href.indexOf('viewconfig') > -1) {
formatHelp();
- page.style.visibility = 'visible';
+ // Delay to avoid page flicker
+ setTimeout("hidePage(page, 'off')", 300);
}
if (location.href.indexOf('help') > -1) {
formatHelp();
addTocTitle();
- page.style.visibility = 'visible';
+ // Delay to avoid page flicker
+ setTimeout("hidePage(page, 'off')", 300);
}
+
+ alignPasswdOnly();
}
More information about the samba-cvs
mailing list