Wijzigen voor document AdminWikiDescriptorSheet
Laatst gewijzigd door admin op 08-02-2022
Opmerking bij wijziging:
Install extension [org.xwiki.platform:xwiki-platform-wiki-ui-common/13.10.2]
Samenvatting
-
Paginaeigenschappen (1 gewijzigd, 0 toegevoegd, 0 verwijderd)
-
Objecten (2 gewijzigd, 0 toegevoegd, 0 verwijderd)
Details
- Paginaeigenschappen
-
- Inhoud
-
... ... @@ -46,6 +46,9 @@ 46 46 ## Display the UI. 47 47 ## 48 48 #set ($discard = $xwiki.jsfx.use('js/xwiki/actionbuttons/actionButtons.js', true)) 49 + ## In case of conflict issue we want to display the diff properly 50 + #set ($discard = $xwiki.ssfx.use('uicomponents/viewers/diff.css', true)) 51 + #set ($discard = $xwiki.jsfx.use('uicomponents/viewers/diff.js')) 49 49 #if ($doc.documentReference.name != $sheetDocName) 50 50 #set ($discard = $xwiki.jsx.use($sheetDocFullName)) 51 51 #set ($discard = $xwiki.ssx.use($sheetDocFullName)) ... ... @@ -83,7 +83,12 @@ 83 83 #else 84 84 #set ($homepage = '') 85 85 #end 86 - <input id='homepage' name='homepage' type='text' size='30' class='suggestDocuments' value="$!{escapetool.xml($homepage)}" /> 89 + #set ($pagePickerParams = { 90 + 'id': 'homepage', 91 + 'name': 'homepage', 92 + 'value': $homepage 93 + }) 94 + #pagePicker($pagePickerParams) 87 87 </dd> 88 88 89 89 ## Only show the owner change form element if the current user is the current owner or a global admin (has edit on the wiki's descriptor document).
- XWiki.ConfigurableClass[0]
-
- Scope
-
... ... @@ -1,0 +1,1 @@ 1 +WIKI - configureGlobally
-
... ... @@ -1,1 +1,0 @@ 1 -1
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -1,37 +1,32 @@ 1 -(function() { 2 -var init = function() { 3 - // We only need this behavior in the admin (administration) and view modes. 4 - if (XWiki.contextaction != 'admin' && XWiki.contextaction != 'view') { 5 - return; 6 - } 1 +require(['jquery', 'xwiki-events-bridge'], function($) { 2 + 'use strict'; 7 7 8 - // Listen for the save & continue event (that we reuse with our button). 9 - document.observe("xwiki:actions:save", function(event) { 10 - // Rename the save button so that XWiki's action filter does not get in our way and send our request somewhere else 11 - // rather than the form's action. 12 - if ($$("input[name='action_saveandcontinue']")[0]) { 13 - $$("input[name='action_saveandcontinue']")[0].name = 'xaction_saveandcontinue'; 14 - } 4 + var init = function() { 5 + $('input[name="action_saveandcontinue"]').on('xwiki:actions:beforeSave', function(event) { 6 + // Rename the save button so that XWiki's action filter does not get in our way and send our request somewhere 7 + // else rather than the form's action. 8 + $(this).attr('name', 'xaction_saveandcontinue'); 15 15 16 - // Ask for confirmation when the new owner does not exist and is entered by hand. 17 - if ($$("input[name='owner']")[0] && !$$("input[name='owner'][type='hidden']")[0]) { 18 - // We do it like this because we want to wait for the reply while blocking (window.confirm) the save event 19 - // handler so that we can eventually stop the event itself instead of having to re-submit the form in an asynch 20 - // callback (Confirm Widget). 21 - var confirmed = window.confirm("$services.localization.render('platform.wiki.admin.wiki.ownerProblemConfirmation')"); 22 - if (!confirmed) { 23 - event.stop(); 24 - if (event.memo) { 25 - event.memo.originalEvent.stop(); 10 + // Ask for confirmation when the new owner does not exist and is entered by hand. 11 + var ownerSelectize = $('#owner')[0]?.selectize; 12 + var ownerDoesNotExist = ownerSelectize && ownerSelectize.items.some(function(ownerId) { 13 + var owner = ownerSelectize.options[ownerId]; 14 + return !owner.icon && owner.label === owner.value; 15 + }); 16 + if (ownerDoesNotExist) { 17 + // We do it like this because we want to wait for the reply while blocking (window.confirm) the save event 18 + // handler so that we can eventually stop the event itself instead of having to re-submit the form in an asynch 19 + // callback (Confirm Widget). 20 + if (!window.confirm($jsontool.serialize($services.localization.render( 21 + 'platform.wiki.admin.wiki.ownerProblemConfirmation')))) { 22 + event.preventDefault(); 26 26 } 27 27 } 28 - } 29 - }); 30 -}; 25 + }); 26 + }; 31 31 32 -// Register on xwiki:dom:loading because we want to register a handler for xwiki:actions:save before the default 33 -// handler gets registered, otherwise our handler will be called after the default, thus after the AJAX request 34 -// is sent, and we don`t want that. 35 -(XWiki && XWiki.domIsLoaded && init()) || document.observe('xwiki:dom:loading', init); 36 - 37 -})(); 28 + // We only need this behavior in the administration and view modes. 29 + if (XWiki.contextaction === 'admin' || XWiki.contextaction === 'view') { 30 + $(init); 31 + } 32 +});