On 02/25/2010 03:44 AM, cjdelisle (SVN) wrote:
Author: cjdelisle
Date: 2010-02-25 03:44:04 +0100 (Thu, 25 Feb 2010)
New Revision: 27275
Modified:
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml
Log:
XAADMINISTRATION-112: Allow applications to bring configuration forms into the
administration app without modifying it - Fixed save buttons so they use ajax save and
continue if available
Modified:
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml
===================================================================
---
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml 2010-02-24
18:50:50 UTC (rev 27274)
+++
platform/xwiki-applications/trunk/administration/src/main/resources/XWiki/Configurable.xml 2010-02-25
02:44:04 UTC (rev 27275)
@@ -388,12 +388,11 @@
<p class="admin-buttons">
<span class="buttonwrapper">
## Ajax form submission Javascript.
We don't allow onclick to be used.
- #set($onclick =
"document.forms.update.action='" + $xwiki.getURL($app.getFullName(),
'saveandcontinue') + "'; "
- + "if (document.forms.update.onsubmit)
document.forms.update.onsubmit();"
- + "if (checkDocumentContent())
document.forms.update.submit(); return false;")
+ #set($onclick = "(" + $xwiki.getURL($app.getFullName(),
'saveandcontinue') + "'; return false;")
## Text to display on the button
#set($buttonText = "$msg.get('admin.save')
$escapedAppName")
-<input class="button" type="submit"
name="formactionsac" value="$buttonText" onclick="$onclick"
/>
+ $xwiki.jsfx.use('js/xwiki/actionbuttons/actionButtons.js',
true)
+<input class="button" type="submit"
name="action_saveandcontinue" value="$buttonText"
onclick="$onclick" />
</span>
</p>
</div> ## bottombuttons
@@ -406,9 +405,18 @@
#end## If app author has permission to edit admin page
#end## If the current user has permission to edit the configurable application.
#end## Foreach document name in names to configure
+ {{html clean=false wiki=false}}
+<script type="text/javascript">
+ /*<![CDATA[ */
+ ## Alt+Shift+S presses the first saveAndContinue button it finds, not what we want so
we will disable edit shortcuts.
+ XWiki.actionButtons.EditActions = Object.extend(XWiki.actionButtons.EditActions,
{addShortcuts : function() { }});
##
## TODO: cancel and "submit all" buttons.
+ //]]>
+</script>
+ {{/html}}
##
+ ##
#else
##
##------------------------------------------------------------------------------------------------------------
--
Sergiu Dumitriu
http://purl.org/net/sergiu/