Changes for page EditSheet

Last modified by superadmin on 2025/02/27 10:46

From version 6.1
edited by Thomas Coelho
on 2023/02/27 12:06
Change comment: Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/15.1]
To version 2.1
edited by Thomas Coelho (local)
on 2022/05/27 15:18
Change comment: Install extension [org.xwiki.contrib:application-ckeditor-ui/1.63.1]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.thw
1 +XWiki.coelho
XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,14 +1,9 @@
1 1  /*
2 -#if ($services.debug.minify)
3 - #set ($jsExtension = '.min')
4 -#else
5 - #set ($jsExtension = '')
6 -#end
7 -#set ($ckeditorPath = $services.webjars.url('org.xwiki.platform:xwiki-platform-ckeditor-webjar', 'ckeditor'))
2 +#set ($ckeditorPath = $services.webjars.url('org.xwiki.contrib:application-ckeditor-webjar', 'ckeditor'))
8 8  #set ($ckeditorBasePath = $stringtool.removeEnd($stringtool.removeEnd($ckeditorPath, '.js'), 'ckeditor'))
9 -#set ($resourcePickerBundlePath = "${ckeditorBasePath}plugins/xwiki-resource/resourcePicker.bundle$jsExtension")
10 -#set ($macroWizardBundlePath = "${ckeditorBasePath}plugins/xwiki-macro/macroWizard.bundle$jsExtension")
11 -#set ($imageWizardBundlePath = "${ckeditorBasePath}plugins/xwiki-image/imageWizard.bundle$jsExtension")
4 +#set ($resourcePickerBundlePath = "${ckeditorBasePath}plugins/xwiki-resource/resourcePicker.bundle.min")
5 +#set ($macroWizardBundlePath = "${ckeditorBasePath}plugins/xwiki-macro/macroWizard.bundle.min")
6 +#set ($imageWizardBundlePath = "${ckeditorBasePath}plugins/xwiki-image/imageWizard.bundle.min")
12 12  #set ($modalPath = "${ckeditorBasePath}plugins/xwiki-dialog/modal.min")
13 13  #set ($l10nPath = "${ckeditorBasePath}plugins/xwiki-localization/l10n.min")
14 14  */
... ... @@ -81,21 +81,15 @@
81 81  
82 82   // Extend the default CKEditor configuration with settings that depend on the source document.
83 83   var getConfig = function(element) {
84 - var sourceSyntax = $(element).attr('data-syntax');
85 85   var sourceDocument = XWiki.currentDocument;
86 - sourceDocument.syntax = XWiki.docsyntax;
87 - var sourceDocumentReference = XWiki.Model.resolve($(element).attr('data-sourceDocumentReference'),
88 - XWiki.EntityType.DOCUMENT, XWiki.currentDocument.documentReference);
89 - if (!XWiki.currentDocument.documentReference.equals(sourceDocumentReference)) {
90 - sourceDocument = new XWiki.Document(sourceDocumentReference);
91 - // We assume the syntax of the source document is the same as the syntax of the edited content.
92 - sourceDocument.syntax = sourceSyntax;
80 + var sourceDocumentReference = $(element).attr('data-sourceDocumentReference');
81 + if (sourceDocumentReference) {
82 + sourceDocument = new XWiki.Document(XWiki.Model.resolve(sourceDocumentReference, XWiki.EntityType.DOCUMENT));
93 93   }
84 + sourceDocument.syntax = $(element).attr('data-sourceDocumentSyntax');
94 94  
95 - var uploadDisabled = element.hasAttribute('data-upload-disabled');
96 -
97 97   var config = {
98 - filebrowserUploadUrl: uploadDisabled ? '' : getUploadURL(sourceDocument, 'filebrowser'),
87 + filebrowserUploadUrl: getUploadURL(sourceDocument, 'filebrowser'),
99 99   height: $(element).height(),
100 100   mentions: [
101 101   {
... ... @@ -120,19 +120,14 @@
120 120   '</div>',
121 121   '<div class="ckeditor-autocomplete-item-hint">{hint}</div>',
122 122   '</li>'].join(''),
123 - outputTemplate: '<a href="{url}" data-reference="{typed}|-|{type}|-|{reference}">{label}</a>',
124 - followingSpace: true,
112 + outputTemplate: '<a href="{url}" data-reference="{typed}|-|{type}|-|{reference}">{label}</a><span>&nbsp;</span>',
125 125   marker: '[',
126 126   minChars: 0,
127 127   itemsLimit: 6
128 128   }
129 129   ],
130 - // Used to resolve and serialize relative references. Also used to make HTTP requests with the right context.
131 131   sourceDocument: sourceDocument,
132 - // The syntax of the edited content is not always the same as the syntax of the source document (which applies to
133 - // the source document content, but we might be editing something else, like an object property).
134 - sourceSyntax: sourceSyntax,
135 - uploadUrl: uploadDisabled ? '' : getUploadURL(sourceDocument, 'filetools'),
119 + uploadUrl: getUploadURL(sourceDocument, 'filetools'),
136 136   'xwiki-link': {
137 137   // We use the source document to compute the link label generator URL because we want the link references to be
138 138   // resolved relative to the edited document (as they were inserted).
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,7 +1,7 @@
1 1  #template('colorThemeInit.vm')
2 2  
3 3  /*
4 -#set ($ckeditorSkinPath = $services.webjars.url('org.xwiki.platform:xwiki-platform-ckeditor-webjar', 'skins/moono-lisa'))
4 +#set ($ckeditorSkinPath = $services.webjars.url('org.xwiki.contrib:application-ckeditor-webjar', 'skins/moono-lisa'))
5 5  #if ($ckeditorSkinPath.indexOf('?') >= 0)
6 6   ## The WebJar resource path was specified in the query string before 7.1M1 which prevented the browser from resolving
7 7   ## relative paths. See XWIKI-10880 (A CSS file inside a webjar cannot use a resource from that webjar).
XWiki.UIExtensionClass[0]
Extension Parameters
... ... @@ -1,2 +1,2 @@
1 1  id=xwiki-ckeditor
2 -path=$xwiki.getURL('CKEditor.EditSheet', 'jsx', $escapetool.url({'v': $services.extension.installed.getInstalledExtension('org.xwiki.platform:xwiki-platform-ckeditor-ui', "wiki:$xcontext.database").version.value, 'xwiki-version': $services.extension.core.getCoreExtension('org.xwiki.platform:xwiki-platform-tree-webjar').version.value, 'fast-diff-version': $services.extension.installed.getInstalledExtension('org.webjars.npm:fast-diff', "wiki:$xcontext.database").version.value, 'bs3typeahead-version': $services.extension.installed.getInstalledExtension('org.webjars.npm:bootstrap-3-typeahead', "wiki:$xcontext.database").version.value}))
2 +path=$xwiki.getURL('CKEditor.EditSheet', 'jsx', $escapetool.url({'v': $services.extension.installed.getInstalledExtension('org.xwiki.contrib:application-ckeditor-ui', "wiki:$xcontext.database").version.value, 'xwiki-version': $services.extension.core.getCoreExtension('org.xwiki.platform:xwiki-platform-tree-webjar').version.value, 'fast-diff-version': $services.extension.installed.getInstalledExtension('org.webjars.npm:fast-diff', "wiki:$xcontext.database").version.value, 'bs3typeahead-version': $services.extension.installed.getInstalledExtension('org.webjars.npm:bootstrap-3-typeahead', "wiki:$xcontext.database").version.value}))