From 7c28e466886b478df5a349075e2f44e40a3ade7c Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sat, 5 Feb 2005 13:53:29 +0000 Subject: [PATCH] added JavaScript check for empty password to remove_orphaned_pages action --- app/views/admin/edit_web.rhtml | 17 +++++++++++------ public/javascripts/edit_web.js | 11 +++++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/views/admin/edit_web.rhtml b/app/views/admin/edit_web.rhtml index 86382a18..37b35a1d 100644 --- a/app/views/admin/edit_web.rhtml +++ b/app/views/admin/edit_web.rhtml @@ -1,6 +1,7 @@ <% @title = "Edit Web" %> -
+

Name and address

The name of the web is included in the title on all pages. @@ -57,7 +58,8 @@

- + Stylesheet tweaks >> - add or change styles used by this web; styles defined here take precedence over @@ -90,13 +92,15 @@ The published version is accessible through URLs like /wiki/published/HomePage.
- /> Publish this web + /> + Publish this web

Enter system password - + and

@@ -109,11 +113,12 @@

Other administrative tasks

- +

Clean up by entering system password - + and diff --git a/public/javascripts/edit_web.js b/public/javascripts/edit_web.js index a81abf59..0dc48dcf 100644 --- a/public/javascripts/edit_web.js +++ b/public/javascripts/edit_web.js @@ -8,11 +8,18 @@ function cleanAddress() { document.getElementById('address').value.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(); } -function validateSetup() { - if (document.getElementById('system_password').value == "") { +function checkSystemPassword(password) { + if (password == "") { alert("You must enter the system password"); return false; } +} + +function validateEditWebForm() { + + if (!checkSystemPassword(document.getElementById('system_password').value)) + return false + end if (document.getElementById('name').value == "") { alert("You must pick a name for the web");