r977 - in xwiki/trunk/src/main: resources web/templates
Phung Hai Nam
namphunghai at users.forge.objectweb.org
Tue Mar 21 10:35:22 CET 2006
Author: namphunghai
Date: 2006-03-21 10:35:22 +0100 (Tue, 21 Mar 2006)
New Revision: 977
Modified:
xwiki/trunk/src/main/resources/ApplicationResources.properties
xwiki/trunk/src/main/web/templates/editactions.vm
Log:
Fixed the bug #XWIKI-162 in JIRA
Add javavascript control to check if the content fields is empty
Modified: xwiki/trunk/src/main/resources/ApplicationResources.properties
===================================================================
--- xwiki/trunk/src/main/resources/ApplicationResources.properties 2006-03-21 08:49:52 UTC (rev 976)
+++ xwiki/trunk/src/main/resources/ApplicationResources.properties 2006-03-21 09:35:22 UTC (rev 977)
@@ -340,4 +340,5 @@
tdwnexttilte=Go to next wizard page
tdwnext=Next
tdwfinishtitle=Use the defined data source in the chart and close this wizard
-tdwfinish=Finish
\ No newline at end of file
+tdwfinish=Finish
+wikicontentcannotbeempty= The content of a wiki page is not allowed to empty completely !
\ No newline at end of file
Modified: xwiki/trunk/src/main/web/templates/editactions.vm
===================================================================
--- xwiki/trunk/src/main/web/templates/editactions.vm 2006-03-21 08:49:52 UTC (rev 976)
+++ xwiki/trunk/src/main/web/templates/editactions.vm 2006-03-21 09:35:22 UTC (rev 977)
@@ -1,7 +1,17 @@
+<script type="text/javascript">
+ function checkDocumentContent() {
+ var content = document.forms.edit.content.value;
+ if (content == null || content == "") {
+ alert("$msg.get('wikicontentcannotbeempty')");
+ return false ;
+ }
+ return true;
+ }
+</script>
#if ($showactions == 1)
<a href="$doc.getURL("cancel")" onclick="document.forms.edit.action=this.href; if (document.forms.edit.onsubmit) document.forms.edit.onsubmit(); document.forms.edit.submit(); return false;" >$msg.get("cancel")</a>
<span> | </span>
-<a href="$doc.getURL("preview")" onclick="document.forms.edit.action=this.href; if (document.forms.edit.onsubmit) document.forms.edit.onsubmit(); document.forms.edit.submit(); return false;">$msg.get("preview")</a>
+<a href="$doc.getURL("preview")" onclick="document.forms.edit.action=this.href; if (document.forms.edit.onsubmit) document.forms.edit.onsubmit();if (checkDocumentContent()) document.forms.edit.submit(); return false;">$msg.get("preview")</a>
<span> | </span>
-<a href="$doc.getURL("save")" onclick="document.forms.edit.action=this.href; if (document.forms.edit.onsubmit) document.forms.edit.onsubmit(); document.forms.edit.submit(); return false;" >$msg.get("save")</a>
+<a href="$doc.getURL("save")" onclick="document.forms.edit.action=this.href; if (document.forms.edit.onsubmit) document.forms.edit.onsubmit();if (checkDocumentContent()) document.forms.edit.submit(); return false;" >$msg.get("save")</a>
#end
\ No newline at end of file
More information about the Xwiki-notifications
mailing list