### Eclipse Workspace Patch 1.0 #P xwiki-skin-colibri Index: src/main/resources/colibri/edit.vm =================================================================== --- src/main/resources/colibri/edit.vm (revision 29617) +++ src/main/resources/colibri/edit.vm (working copy) @@ -101,6 +101,23 @@ document.forms.${formname}.submit(); Event.stop(event); }); + + #if($xwiki.getXWikiPreference('documentTitleMandatory') == 1) + $xwiki.get('jsfx').use('uicomponents/widgets/validation/livevalidation_prototype.js')## + $xwiki.get('ssfx').use('uicomponents/widgets/validation/livevalidation.css')## + XWiki.editvalidation = { + init : function() { + #if($editor == 'wiki' || $editor == 'wysiwyg') + var titleValidator = new LiveValidation('xwikidoctitleinput', { validMessage: "" }); + titleValidator.add(Validate.Presence, { + failureMessage: "$msg.get('core.editors.validation.mandatoryField')" + }); + titleValidator.validate(); + #end + } + } + Event.observe(document, 'xwiki:dom:loaded', XWiki.editvalidation.init); + #end //]]> ## mainEditArea #P xwiki-web-standard Index: src/main/webapp/templates/edit.vm =================================================================== --- src/main/webapp/templates/edit.vm (revision 29617) +++ src/main/webapp/templates/edit.vm (working copy) @@ -76,6 +76,26 @@ #end #template("editmodes.vm") #template("edit${editor}.vm") + ## alleditcontent ## editcolumn
#P xwiki-core Index: src/main/java/com/xpn/xwiki/XWiki.java =================================================================== --- src/main/java/com/xpn/xwiki/XWiki.java (revision 29617) +++ src/main/java/com/xpn/xwiki/XWiki.java (working copy) @@ -3179,8 +3179,9 @@ needsUpdate |= bclass.addNumberField("upload_maxsize", "Maximum Upload Size", 5, "long"); - // Syntax + // Document editing needsUpdate |= bclass.addTextField("core.defaultDocumentSyntax", "Default document syntax", 60); + needsUpdate |= bclass.addBooleanField("documentTitleMandatory", "Make document title field mandatory", "yesno"); // for tags needsUpdate |= bclass.addBooleanField("tags", "Activate the tagging", "yesno"); Index: src/main/resources/ApplicationResources.properties =================================================================== --- src/main/resources/ApplicationResources.properties (revision 29617) +++ src/main/resources/ApplicationResources.properties (working copy) @@ -901,6 +901,8 @@ core.editors.object.delete.done=Object deleted core.editors.object.delete.failed=Failed to delete object: +core.editors.validation.mandatoryField=This field is mandatory + core.widgets.confirmationBox.defaultQuestion=Are you sure? core.widgets.confirmationBox.button.yes=Yes core.widgets.confirmationBox.button.no=No @@ -2435,7 +2437,7 @@ xe.templateprovider.name.example=Example: My Template Provider xe.templateprovider.templatename=Template Name xe.templateprovider.templatename.example=Example: My Template -xe.templateprovider.template=Template to use +xe.templateprovider.template=Template Document xe.templateprovider.template.example=Example: XWiki.MyTemplate xe.templateprovider.spaces=List of spaces where the template must be available xe.templateprovider.spaces.info=If no space is selected the template will be available in any space @@ -2620,6 +2622,7 @@ XWiki.XWikiPreferences_parent=Parent space XWiki.XWikiPreferences_documentBundles=Internationalization Document Bundles XWiki.XWikiPreferences_upload_maxsize=Maximum Upload Size +XWiki.XWikiPreferences_documentTitleMandatory=Make document title field mandatory # XWiki.XWikiRights (core) XWiki.XWikiRights_allow=Allow/Deny #P xwiki-application-administration Index: src/main/resources/XWiki/AdminGeneralSheet.xml =================================================================== --- src/main/resources/XWiki/AdminGeneralSheet.xml (revision 29617) +++ src/main/resources/XWiki/AdminGeneralSheet.xml (working copy) @@ -27,7 +27,7 @@ #set($legend = ['language', 'editor', 'admin', 'smtp']) #set($params = $util.hashMap) #set($params.language = ['multilingual', 'languages' , 'default_language', 'dateformat']) -#set($params.editor = ['editor', 'core.defaultDocumentSyntax']) +#set($params.editor = ['editor', 'core.defaultDocumentSyntax', 'documentTitleMandatory']) #set($params.admin = ['admin_email']) #set($params.smtp = ['smtp_server', 'smtp_port', 'smtp_server_username', 'smtp_server_password', 'javamail_extra_props']) #includeForm('XWiki.AdminFieldsDisplaySheet')