From ee21d32b25fe5de19364d678317475d44b1d5e29 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 31 May 2005 03:37:01 +0000 Subject: r7134: a number of small changes to make the pages HTML compliant. The builtin web validator in firefox sure is useful! (This used to be commit aa43111aa5f9a183395ebd840d8f77867730ab23) --- swat/docs/menu.js | 4 ++-- swat/esptest/include.esp | 8 ++++---- swat/esptest/session.esp | 2 +- swat/esptest/showvars.esp | 2 -- swat/login.esp | 2 +- swat/scripting/common.js | 37 ++++++++++++++++++++++++++++++------- swat/scripting/test.ejs | 2 +- 7 files changed, 39 insertions(+), 18 deletions(-) (limited to 'swat') diff --git a/swat/docs/menu.js b/swat/docs/menu.js index b57b454a32..5dfc69f992 100644 --- a/swat/docs/menu.js +++ b/swat/docs/menu.js @@ -4,9 +4,9 @@ var m = MenuObj("Samba Information", 8); m.element[0].label = "Samba4 development"; m.element[0].link = "http://devel.samba.org/"; m.element[1].label = "Recent Checkins"; -m.element[1].link = "http://build.samba.org/?tree=samba4&function=Recent+Checkins"; +m.element[1].link = "http://build.samba.org/?tree=samba4;function=Recent+Checkins"; m.element[2].label = "Recent Builds"; -m.element[2].link = "http://build.samba.org/?tree=samba4&function=Recent+Builds"; +m.element[2].link = "http://build.samba.org/?tree=samba4;function=Recent+Builds"; m.element[3].label = "EJS Information"; m.element[3].link = "http://www.appwebserver.org/products/ejs/ejs.html"; m.element[4].label = "ESP Information"; diff --git a/swat/esptest/include.esp b/swat/esptest/include.esp index 37772fd03f..96afead1f9 100644 --- a/swat/esptest/include.esp +++ b/swat/esptest/include.esp @@ -1,13 +1,13 @@ <% page_header("columns", "ESP Include Test"); %> -including /scripting/test.ejs

+including /scripting/test.ejs

<% include("/scripting/test.ejs"); %> -calling a function from test.ejs ...

+calling a function from test.ejs ...

<% showArray("request", request); %> -including /scripting/test.esp

+including /scripting/test.esp

<% include /scripting/test.esp %> -calling a function from test.esp ...

+calling a function from test.esp ...

<% res = testfn('foo'); %> result is: @@res diff --git a/swat/esptest/session.esp b/swat/esptest/session.esp index 309505bae3..4fb4ee7bb4 100644 --- a/swat/esptest/session.esp +++ b/swat/esptest/session.esp @@ -45,7 +45,7 @@ if (request['REQUEST_METHOD'] == "POST") { } simple_table(session); -write("SessionId=" + request['SESSION_ID'] + "
\n"); +write("SessionId=" + request['SESSION_ID'] + "
\n"); %> <% page_footer(); %> diff --git a/swat/esptest/showvars.esp b/swat/esptest/showvars.esp index 40008a0d7d..38904edcc5 100644 --- a/swat/esptest/showvars.esp +++ b/swat/esptest/showvars.esp @@ -21,6 +21,4 @@ showArray("session", session); %> - - <% page_footer(); %> diff --git a/swat/login.esp b/swat/login.esp index f662492511..873ff2f6a6 100644 --- a/swat/login.esp +++ b/swat/login.esp @@ -3,7 +3,7 @@ <% if (request['SESSION_EXPIRED'] == "True") { - write("Your session has expired - please authenticate again
\n"); + write("Your session has expired - please authenticate again
\n"); } var f = FormObj("login", 2, 1); diff --git a/swat/scripting/common.js b/swat/scripting/common.js index d087f0d2a6..d7252b3bf9 100644 --- a/swat/scripting/common.js +++ b/swat/scripting/common.js @@ -129,10 +129,25 @@ function table_element(i, o) { } write("\n"); } + +/* + return the number of elements in an object +*/ +function elcount(o) { + var count = 0; + for (i in o) { + count++; + } + return count; +} + /* display a ejs object as a table. The header is optional */ function simple_table(v) { + if (elcount(v) == 0) { + return; + } write("\n"); for (r in v) { table_element(r, v); @@ -145,10 +160,13 @@ function simple_table(v) { attribute */ function multi_table(array, header) { + if (elcount(v) == 0) { + return; + } write("
\n"); for (i in array) { var v = array[i]; - write("\n"); + write('\n"); for (r in v) { if (r != header) { table_element(r, v); @@ -168,7 +186,7 @@ function FormObj(name, num_elements, num_submits) f.element = new Array(num_elements); f.submit = new Array(num_submits); f.action = session_uri(request.REQUEST_URI); - f.class = "form"; + f.class = "defaultform"; for (i in f.element) { f.element[i] = new Object(); f.element[i].type = "text"; @@ -193,14 +211,16 @@ function display_form(f) { write('\n'); - write("
" + v[header] + "
' + v[header] + "
\n"); + if (f.element.length > 0) { + write("
\n"); + } for (i in f.element) { var e = f.element[i]; if (e.name == undefined) { e.name = e.label; } if (e.value == undefined) { - e.value = '""'; + e.value = ""; } write(""); write(""); @@ -216,12 +236,15 @@ function display_form(f) { write('\n'); } else { write('\n'); + e.type + '" value="' + e.value + '" />\n'); } + write(""); + } + if (f.element.length > 0) { + write("
" + e.label + "
\n"); } - write("\n"); for (i in f.submit) { - write('\n'); + write('\n'); } write("\n"); } diff --git a/swat/scripting/test.ejs b/swat/scripting/test.ejs index e69df9230f..8e7047f51c 100644 --- a/swat/scripting/test.ejs +++ b/swat/scripting/test.ejs @@ -5,6 +5,6 @@ function showArray(name, array) { write("

Array: " + name + "

\n"); for (v in array) { - write(name + "[" + v + "]=" + array[v] + "
\n"); + write(name + "[" + v + "]=" + array[v] + "
\n"); } } -- cgit