Changes for page EditSheet

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

From version 1.1
edited by Thomas Coelho (local)
on 2022/04/20 16:09
Change comment: Install extension [org.xwiki.contrib:application-ckeditor-ui/1.61]
To version 7.1
edited by Thomas Coelho (local)
on 2023/07/26 11:23
Change comment: Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/15.5]

Summary

Details

XWiki.JavaScriptExtension[0]
Code
... ... @@ -1,35 +1,6 @@
1 -/*
2 -#set ($ckeditorPath = $services.webjars.url('org.xwiki.contrib:application-ckeditor-webjar', 'ckeditor'))
3 -#set ($ckeditorBasePath = $stringtool.removeEnd($stringtool.removeEnd($ckeditorPath, '.js'), 'ckeditor'))
4 -#set ($resourcePickerBundlePath = "${ckeditorBasePath}plugins/xwiki-resource/resourcePicker.bundle.min")
5 -#set ($macroWizardBundlePath = "${ckeditorBasePath}plugins/xwiki-macro/macroWizard.bundle.min")
6 -#set ($modalPath = "${ckeditorBasePath}plugins/xwiki-dialog/modal.min")
7 -#set ($l10nPath = "${ckeditorBasePath}plugins/xwiki-localization/l10n.min")
8 -*/
1 +XWiki.locale = document.documentElement.getAttribute('lang') || '';
2 +
9 9  require.config({
10 - paths: {
11 - ckeditor: '$!ckeditorPath',
12 - resourcePickerBundle: '$!resourcePickerBundlePath',
13 - modal: '$!modalPath',
14 - l10n: '$!l10nPath',
15 - macroWizard: '$!macroWizardBundlePath',
16 - // This is used by the resource suggest picker on the link modal.
17 - 'bootstrap3-typeahead': $jsontool.serialize($services.webjars.url('org.webjars.npm:bootstrap-3-typeahead',
18 - 'bootstrap3-typeahead.min')),
19 - // This is used to preserve the selection when switching between WYSIWYG and Source modes.
20 - 'fast-diff': $jsontool.serialize($services.webjars.url('org.webjars.npm:fast-diff', 'diff'))
21 - },
22 - bundles: {
23 - 'resourcePickerBundle': ['resource', 'resourcePicker', 'entityResourcePicker', 'entityResourceSuggester',
24 - 'entityResourceDisplayer']
25 - },
26 - shim: {
27 - ckeditor: {
28 - exports: 'CKEDITOR',
29 - // This includes dependencies of the plugins bundled with the CKEditor code.
30 - deps: ['jquery', 'resource', 'resourcePicker', 'macroWizard']
31 - }
32 - },
33 33   config: {
34 34   l10n: {
35 35   // We need to specify the language because this URL can be used after the page is loaded and thus after the
... ... @@ -37,77 +37,24 @@
37 37   // a different language specified). We take the current language from the page HTML, rather than using Velocity,
38 38   // in order to avoid having the current language cached.
39 39   url: new XWiki.Document('Translator', 'CKEditor').getURL('get', 'outputSyntax=plain&language=' +
40 - encodeURIComponent(document.documentElement.getAttribute('lang') || ''))
11 + encodeURIComponent(XWiki.locale))
41 41   }
42 42   }
43 43  });
44 44  
45 -window.CKEDITOR_BASEPATH = "$!ckeditorBasePath";
46 -
47 47  define('xwiki-ckeditor', [
48 48   'jquery',
18 + // The CKEditor standard API.
49 49   'ckeditor',
50 50   // Used to access the form token required by the upload URL.
51 51   'xwiki-meta',
22 + // CKEditor plugins specific to XWiki.
23 + 'xwiki-ckeditor-plugins',
52 52   // Used to catch form action events fired from Prototype.js code (actionButtons.js).
53 53   'xwiki-events-bridge',
54 - // Configures the path to the tree widget module and its dependencies which are used by the page and attachment
55 - // pickers on the link, image and macro dialogs to select pages and attachments.
56 - "$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'require-config.min.js', {'evaluate': true})"
26 + // Load the translations for our custom CKEditor plugins.
27 + new XWiki.Document('Translations', 'CKEditor').getURL('jsx', 'language=' + encodeURIComponent(XWiki.locale))
57 57  ], function($, ckeditor, xwikiMeta) {
58 - var deferred = $.Deferred();
59 -
60 - var loadJavaScriptSkinExtensions = $jsontool.serialize($xwiki.getDocument('CKEditor.Config'
61 - ).getValue('loadJavaScriptSkinExtensions')) === 1;
62 -
63 - // See http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
64 - var allowedContentBySyntax = {
65 - 'xwiki/2.1': {
66 - '$1': {
67 - elements: {
68 - // Elements required because the editor input is a full HTML page.
69 - html: true, head: true, link: true, script: loadJavaScriptSkinExtensions, body: true,
70 - // Headings
71 - h1: true, h2: true, h3: true, h4: true, h5: true, h6: true,
72 - // Lists
73 - dl: true, ol: true, ul: true,
74 - // Tables
75 - table: true, tr: true, th: true, td: true,
76 - // Formatting
77 - span: true, strong: true, em: true, ins: true, del: true, sub: true, sup: true, tt: true, pre: true,
78 - // Others
79 - div: true, hr: true, p: true, a: true, img: true, blockquote: true, figure: true
80 - },
81 - // The elements above can have any attribute, through the parameter (%%) syntax.
82 - attributes: '*',
83 - styles: '*',
84 - classes: '*'
85 - },
86 - '$2': {
87 - // The XWiki syntax doesn't support parameters for the following elements.
88 - elements: {br: true, dd: true, dt: true, li: true, tbody: true, figcaption: true}
89 - },
90 - '$3': {
91 - // Wiki syntax macros can output any HTML.
92 - match: CKEDITOR.plugins.xwikiMacro.isMacroOutput,
93 - attributes: '*',
94 - styles: '*',
95 - classes: '*'
96 - }
97 - },
98 - 'plain/1.0': ';'
99 - };
100 - allowedContentBySyntax['xwiki/2.0'] = allowedContentBySyntax['xwiki/2.1'];
101 - // This is a hack, increasing the technical debt since the CKEditor module should not know about the Markdown
102 - // syntax. Actually it should not know either about the xwiki/2.0 and xwiki/2.1 syntaxes ;)
103 - // This should be fixed by implementing https://jira.xwiki.org/browse/CKEDITOR-319
104 - allowedContentBySyntax['markdown/1.2'] = $.extend(true, {}, allowedContentBySyntax['xwiki/2.1']);
105 - // Markdown doesn't allow figures at the moment.
106 - delete allowedContentBySyntax['markdown/1.2']['$1'].elements.figure;
107 - delete allowedContentBySyntax['markdown/1.2']['$2'].elements.figcaption;
108 -
109 - var currentLocale = $('html').attr('lang') || '';
110 -
111 111   // We have to pass the plugin that makes the request (the initiator) because the expected response can be different
112 112   // (e.g. between the filebrowser and filetools plugins).
113 113   var getUploadURL = function(document, initiator) {
... ... @@ -114,8 +114,9 @@
114 114   return document.getURL('get', $.param({
115 115   sheet: 'CKEditor.FileUploader',
116 116   outputSyntax: 'plain',
35 + // The syntax and language are important especially when the upload request creates a new document.
117 117   syntax: document.syntax,
118 - language: currentLocale,
37 + language: XWiki.locale,
119 119   form_token: xwikiMeta.form_token,
120 120   initiator: initiator
121 121   }));
... ... @@ -123,70 +123,30 @@
123 123  
124 124   // Extend the default CKEditor configuration with settings that depend on the source document.
125 125   var getConfig = function(element) {
45 + var sourceSyntax = $(element).attr('data-syntax');
126 126   var sourceDocument = XWiki.currentDocument;
127 - var sourceDocumentReference = $(element).attr('data-sourceDocumentReference');
128 - if (sourceDocumentReference) {
129 - sourceDocument = new XWiki.Document(XWiki.Model.resolve(sourceDocumentReference, XWiki.EntityType.DOCUMENT));
47 + sourceDocument.syntax = XWiki.docsyntax;
48 + var sourceDocumentReference = XWiki.Model.resolve($(element).attr('data-sourceDocumentReference'),
49 + XWiki.EntityType.DOCUMENT, XWiki.currentDocument.documentReference);
50 + if (!XWiki.currentDocument.documentReference.equals(sourceDocumentReference)) {
51 + sourceDocument = new XWiki.Document(sourceDocumentReference);
52 + // We assume the syntax of the source document is the same as the syntax of the edited content.
53 + sourceDocument.syntax = sourceSyntax;
130 130   }
131 - sourceDocument.syntax = $(element).attr('data-sourceDocumentSyntax');
132 - var isHTML5 = $(element).data('syntax') !== 'annotatedxhtml/1.0';
133 133  
134 - var allowedContent;
135 - var allowedContentWithoutFigure;
136 - if (sourceDocument.syntax in allowedContentBySyntax) {
137 - allowedContent = allowedContentBySyntax[sourceDocument.syntax];
138 - // Try removing the figure/figcaption tags for caption content to forbid nested figures.
139 - allowedContentWithoutFigure = $.extend(true, {}, allowedContent);
140 - delete allowedContentWithoutFigure['$1']?.elements?.figure;
141 - delete allowedContentWithoutFigure['$2']?.elements?.figcaption;
56 + var uploadDisabled = element.hasAttribute('data-upload-disabled');
142 142  
143 - // Disable figure support if the syntax isn't HTML 5.
144 - if (!isHTML5) {
145 - allowedContent = allowedContentWithoutFigure;
146 - }
147 - }
148 -
149 149   var config = {
150 - allowedContent: allowedContent,
151 - editorplaceholder: $jsontool.serialize($services.localization.render('ckeditor.content.placeholder')),
152 - filebrowserUploadUrl: getUploadURL(sourceDocument, 'filebrowser'),
153 - // This is used in CKEditor.FileUploader so we must keep them in sync.
154 - fileTools_defaultFileName: '__fileCreatedFromDataURI__',
59 + filebrowserUploadUrl: uploadDisabled ? '' : getUploadURL(sourceDocument, 'filebrowser'),
155 155   height: $(element).height(),
156 - // CKEditor uses '-' (dash) as locale separator (between the language code and the country code).
157 - language: currentLocale.toLowerCase().replace('_', '-'),
158 - uploadUrl: getUploadURL(sourceDocument, 'filetools'),
159 - stylesSet: isHTML5 ? 'html5' : 'html4',
160 - 'xwiki-image' : {
161 - captionAllowedContent: allowedContentWithoutFigure
162 - },
163 - 'xwiki-link': {
164 - labelGenerator: sourceDocument.getURL('get', $.param({
165 - sheet: 'CKEditor.LinkLabelGenerator',
166 - outputSyntax: 'plain',
167 - language: currentLocale
168 - }))
169 - },
170 - 'xwiki-resource': {
171 - dispatcher: sourceDocument.getURL('get', $.param({
172 - sheet: 'CKEditor.ResourceDispatcher',
173 - outputSyntax: 'plain',
174 - language: currentLocale
175 - }))
176 - },
177 - 'xwiki-source': {
178 - htmlConverter: sourceDocument.getURL('get', $.param({
179 - sheet: 'CKEditor.HTMLConverter',
180 - outputSyntax: 'plain',
181 - language: currentLocale
182 - }))
183 - },
184 184   mentions: [
185 185   {
63 + // We use the source document to compute the feed URL because we want the suggested link references to be
64 + // relative to the edited document (we want the editor to output relative references as much as possible).
186 186   feed: sourceDocument.getURL('get', $.param({
187 187   sheet: 'CKEditor.LinkSuggestions',
188 188   outputSyntax: 'plain',
189 - language: currentLocale
68 + language: XWiki.locale
190 190   // Prevent the curly brackets from being URL encoded because they mark a placeholder that will be replaced
191 191   // with the text typed by the user (and CKEditor takes care of URL encoding it).
192 192   }) + '&input={encodedQuery}'),
... ... @@ -202,21 +202,29 @@
202 202   '</div>',
203 203   '<div class="ckeditor-autocomplete-item-hint">{hint}</div>',
204 204   '</li>'].join(''),
205 - outputTemplate: '<a href="{url}" data-reference="{typed}|-|{type}|-|{reference}">{label}</a><span>&nbsp;</span>',
84 + outputTemplate: '<a href="{url}" data-reference="{typed}|-|{type}|-|{reference}">{label}</a>',
85 + followingSpace: true,
206 206   marker: '[',
207 207   minChars: 0,
208 208   itemsLimit: 6
209 209   }
210 - ]
211 - };
212 - if ($(element).attr('data-officeImporterSupported') === 'true') {
213 - config['xwiki-office'] = {
214 - importer: sourceDocument.getURL('get', $.param({
215 - sheet: 'CKEditor.OfficeImporter',
216 - language: currentLocale
90 + ],
91 + // Used to resolve and serialize relative references. Also used to make HTTP requests with the right context.
92 + sourceDocument: sourceDocument,
93 + // The syntax of the edited content is not always the same as the syntax of the source document (which applies to
94 + // the source document content, but we might be editing something else, like an object property).
95 + sourceSyntax: sourceSyntax,
96 + uploadUrl: uploadDisabled ? '' : getUploadURL(sourceDocument, 'filetools'),
97 + 'xwiki-link': {
98 + // We use the source document to compute the link label generator URL because we want the link references to be
99 + // resolved relative to the edited document (as they were inserted).
100 + labelGenerator: sourceDocument.getURL('get', $.param({
101 + sheet: 'CKEditor.LinkLabelGenerator',
102 + outputSyntax: 'plain',
103 + language: XWiki.locale
217 217   }))
218 - };
219 - }
105 + }
106 + };
220 220   return config;
221 221   };
222 222  
... ... @@ -270,18 +270,5 @@
270 270   object[key] = newValue;
271 271   };
272 272  
273 - require([
274 - // We cannot add these modules to the list of dependencies because they need the tree module to be configured first.
275 - 'entityResourcePicker', 'entityResourceSuggester', 'entityResourceDisplayer',
276 - // Load the translations for our custom CKEditor plugins. We didn't add this as a dependency to the xwiki-ckeditor
277 - // module because some of our plugins load their dependencies with RequireJS and thus they are loaded with a small
278 - // delay. The plugin needs to be defined before calling CKEDITOR.plugins.setLang().
279 - new XWiki.Document('Translations', 'CKEditor').getURL('jsx', $.param({
280 - language: currentLocale
281 - }))
282 - ], function() {
283 - deferred.resolve(ckeditor);
284 - });
285 -
286 - return deferred.promise();
160 + return $.Deferred().resolve(ckeditor).promise();
287 287  });
Parse content
... ... @@ -1,1 +1,1 @@
1 -Yes
1 +No
XWiki.JavaScriptExtension[1]
Caching policy
... ... @@ -1,1 +1,0 @@
1 -long
Code
... ... @@ -1,165 +1,0 @@
1 -// Fix CKEDITOR.tools.escapeCss() for browsers that don't support CSS.escape()
2 -// See https://github.com/ckeditor/ckeditor4/issues/681
3 -require(['jquery', 'ckeditor'], function($, ckeditor) {
4 - // Test if CKEDITOR.tools.escapeCss() works as expected.
5 - if (ckeditor.tools.escapeCss('.') === '.') {
6 - // Special CSS characters were not escaped so we need to fix this.
7 - // Use jQuery's escapeSelector() if available (only since jQuery 3.0), otherwise use some naive implementation.
8 - ckeditor.tools.escapeCss = $.escapeSelector || function(selector) {
9 - if (typeof selector === 'string') {
10 - // Simple implementation.
11 - // See https://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/
12 - return selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1');
13 - } else {
14 - return selector;
15 - }
16 - };
17 - }
18 -});
19 -
20 -// Fix the path to the arrow icon that indicates the presence of a sub-menu in the context menu.
21 -if (CKEDITOR_BASEPATH.indexOf('?') >= 0) {
22 - // The WebJar resource path was specified in the query string before 7.1M1 which prevented the browser from resolving
23 - // relative paths. See XWIKI-10880 (A CSS file inside a webjar cannot use a resource from that webjar).
24 - require(['ckeditor'], function(ckeditor) {
25 - ckeditor.on('instanceReady', function(event) {
26 - if (event.editor.contextMenu) {
27 - event.editor.contextMenu._.panelDefinition.css.push(
28 - '.cke_menuarrow {' +
29 - 'background-image: url("' + CKEDITOR_BASEPATH + 'skins/moono-lisa/images/arrow.png") !important;' +
30 - '}'
31 - );
32 - }
33 - });
34 - });
35 -}
36 -
37 -// Polyfill for the xwiki:actions:beforeSave and xwiki:actions:beforePreview events (available since 7.4.1)
38 -// We have to use Prototype.js because it is loaded before jQuery and we need to register our save and preview listeners
39 -// before the actionButtons.js does it, as otherwise the CKEditor doesn't get the chance to update the text area before
40 -// the form is submitted.
41 -(function() {
42 - var submitActions = ['save', 'preview'];
43 - var beforeSubmitWasTriggered = false;
44 - var onBeforeSubmit = function(event) {
45 - beforeSubmitWasTriggered = true;
46 - if (!(event.memo || {}).polyfill) {
47 - removeListeners();
48 - }
49 - };
50 - var onSubmit = function(event) {
51 - if (!beforeSubmitWasTriggered && jQuery) {
52 - // Our CKEditor plugins use jQuery to listen to events.
53 - var parts = event.eventName.split(':');
54 - var data = event.memo || {};
55 - data.polyfill = true;
56 - jQuery(document).triggerHandler(getBeforeEventName(parts[parts.length - 1]), data);
57 - }
58 - beforeSubmitWasTriggered = false;
59 - };
60 - var getBeforeEventName = function(action) {
61 - return 'xwiki:actions:before' + action.substr(0, 1).toUpperCase() + action.substr(1);
62 - };
63 - var removeListeners = function() {
64 - submitActions.forEach(function(action) {
65 - document.stopObserving(getBeforeEventName(action), onBeforeSubmit);
66 - document.stopObserving('xwiki:actions:' + action, onSubmit);
67 - });
68 - };
69 - if (typeof document.observe == 'function') {
70 - submitActions.forEach(function(action) {
71 - document.observe(getBeforeEventName(action), onBeforeSubmit);
72 - document.observe('xwiki:actions:' + action, onSubmit);
73 - });
74 - }
75 -})();
76 -
77 -// Make sure the "Back To Edit" button from the Preview mode works as expected on XWiki versions older than 8.2 (where
78 -// CKEditor is not the default editor).
79 -require(['jquery'], function($) {
80 - if (/&sheet=CKEditor.EditSheet\b/.test(window.location.href)) {
81 - // Make sure the CKEditor.EditSheet is preserved when coming back from Preview mode.
82 - $('form#inline').find('input[name="xcontinue"]').val(function(index, oldValue) {
83 - return oldValue + '&sheet=CKEditor.EditSheet';
84 - });
85 - }
86 -});
87 -
88 -// Polyfill for entityReference.js
89 -require(['jquery'], function($) {
90 - if (typeof XWiki.EntityType.byName !== 'function') {
91 - // Before 6.4.1
92 - var entityTypeByName = {
93 - wiki: XWiki.EntityType.WIKI,
94 - space: XWiki.EntityType.SPACE,
95 - document: XWiki.EntityType.DOCUMENT,
96 - attachment: XWiki.EntityType.ATTACHMENT
97 - };
98 - XWiki.EntityType.byName = function(name) {
99 - return entityTypeByName[name];
100 - };
101 - }
102 -
103 - if (typeof XWiki.EntityType.getName !== 'function') {
104 - // Before 6.4.1
105 - var entityTypes = ['wiki', 'space', 'document', 'attachment'];
106 - XWiki.EntityType.getName = function(entityType) {
107 - return entityTypes[entityType];
108 - }
109 - }
110 -
111 - if (typeof XWiki.EntityReference.prototype.getReversedReferenceChain !== 'function') {
112 - // Before 7.2M2
113 - XWiki.EntityReference.prototype.getReversedReferenceChain = function() {
114 - return this._extractComponents().reverse();
115 - };
116 - }
117 -
118 - if (typeof XWiki.currentDocument.getDocumentReference !== 'function') {
119 - // Before 7.2M3
120 - // Take the current document full name.
121 - var currentDocumentReference = $('meta[name="document"]').attr('content');
122 - // Resolve the local reference.
123 - currentDocumentReference = XWiki.Model.resolve(currentDocumentReference, XWiki.EntityType.DOCUMENT);
124 - // Add the wiki component.
125 - currentDocumentReference.getReversedReferenceChain()[0].parent = new XWiki.WikiReference(XWiki.currentWiki);
126 - XWiki.currentDocument.getDocumentReference = function() {
127 - return currentDocumentReference;
128 - };
129 - }
130 -
131 - var reference = XWiki.Model.resolve('S', XWiki.EntityType.SPACE, new XWiki.WikiReference('W'));
132 - if (!reference.parent) {
133 - // The resolve method did not support a default value provider before 7.2M1.
134 - var oldResolve = XWiki.Model.resolve;
135 - XWiki.Model.resolve = function(representation, entityType, defaultValueProvider) {
136 - var reference = oldResolve.apply(this, arguments);
137 - if (reference && defaultValueProvider && typeof defaultValueProvider.extractReference === 'function') {
138 - // The given default value provider is an entity reference (normally a document reference).
139 - var root = reference.getReversedReferenceChain()[0];
140 - // We cover the document and attachment references mainly,
141 - var defaultRoot = defaultValueProvider.extractReference(root.type) || {parent: defaultValueProvider};
142 - // Nested spaces were introduced in 7.2M1 so we can safely assume that the given default value provider has only
143 - // one space reference component.
144 - root.parent = defaultRoot.parent;
145 - }
146 - return reference;
147 - };
148 - }
149 -});
150 -
151 -// Fix the layout to be consistent with the Wiki edit mode (tested with the Flamingo Skin).
152 -require(['jquery'], function($) {
153 - var ckeEditMeta = $('.cke-editMeta');
154 - if (ckeEditMeta.length != 1) {
155 - // Fix the layout only when the CKEditor.EditSheet is applied.
156 - return;
157 - }
158 - // Hide the page title because the edit form has an input field to edit the title. This is consistent with the Wiki
159 - // edit mode. Remove the 'editMeta' id because the edit sheet adds an element with the same id.
160 - // NOTE: In order to rely on Chrome's Back-Forward cache we must not remove or move form elements. We can only hide.
161 - $('#document-title').parent('#editMeta').removeAttr('id').parent('.row').hide();
162 - // Move the content menu before the editMeta element so that they are displayed on the same row.
163 - ckeEditMeta.attr('id', 'editMeta').addClass('col-md-pull-5')
164 - .before($('#contentmenu').parent('.col-md-5').addClass('col-md-push-7'));
165 -});
Name
... ... @@ -1,1 +1,0 @@
1 -Various fixes and polyfills
Parse content
... ... @@ -1,1 +1,0 @@
1 -Yes
Use this extension
... ... @@ -1,1 +1,0 @@
1 -onDemand
XWiki.JavaScriptExtension[2]
Parse content
... ... @@ -1,1 +1,1 @@
1 -Yes
1 +No
XWiki.StyleSheetExtension[0]
Code
... ... @@ -1,50 +46,5 @@
1 -#template('colorThemeInit.vm')
2 -
3 -/*
4 -#set ($ckeditorSkinPath = $services.webjars.url('org.xwiki.contrib:application-ckeditor-webjar', 'skins/moono-lisa'))
5 -#if ($ckeditorSkinPath.indexOf('?') >= 0)
6 - ## The WebJar resource path was specified in the query string before 7.1M1 which prevented the browser from resolving
7 - ## relative paths. See XWIKI-10880 (A CSS file inside a webjar cannot use a resource from that webjar).
8 - */
9 - a.cke_button > span.cke_button_icon {
10 - background-image: url("$ckeditorSkinPath/icons.png") !important;
11 - }
12 - .cke_hidpi a.cke_button > span.cke_button_icon {
13 - background-image: url("$ckeditorSkinPath/icons_hidpi.png") !important;
14 - }
15 - .cke_notification_close, a.cke_dialog_close_button {
16 - background-image: url("$ckeditorSkinPath/images/close.png") !important;
17 - }
18 - .cke_hidpi .cke_dialog_close_button {
19 - background-image: url("$ckeditorSkinPath/images/hidpi/close.png") !important;
20 - }
21 - .cke_dialog a.cke_btn_reset {
22 - background-image: url("$ckeditorSkinPath/images/refresh.png") !important;
23 - }
24 - .cke_hidpi .cke_dialog a.cke_btn_reset {
25 - background-image: url("$ckeditorSkinPath/images/hidpi/refresh.png") !important;
26 - }
27 - .cke_dialog a.cke_btn_locked {
28 - background-image: url("$ckeditorSkinPath/images/lock.png") !important;
29 - }
30 - .cke_hidpi .cke_dialog a.cke_btn_locked {
31 - background-image: url("$ckeditorSkinPath/images/hidpi/lock.png") !important;
32 - }
33 - .cke_dialog a.cke_btn_unlocked {
34 - background-image: url("$ckeditorSkinPath/images/lock-open.png") !important;
35 - }
36 - .cke_hidpi .cke_dialog a.cke_btn_unlocked {
37 - background-image: url("$ckeditorSkinPath/images/hidpi/lock-open.png") !important;
38 - }
39 - .cke_menuarrow {
40 - background-image: url("$ckeditorSkinPath/images/arrow.png") !important;
41 - }
42 - /*
43 -#end
44 -*/
45 -
46 46  a.cke_button_disabled > span.cke_button_icon.loading {
47 - background-image: url("$xwiki.getSkinFile('icons/xwiki/spinner.gif')") !important;
2 + background-image: url(@xwiki-icon-spinner) !important;
48 48   background-position: 0 0 !important;
49 49  }
50 50  
... ... @@ -80,7 +80,7 @@
80 80  }
81 81  
82 82  .cke_maximized .buttons {
83 - background-color: $theme.backgroundSecondaryColor;
38 + background-color: @well-bg;
84 84   padding: .5em;
85 85  }
86 86  
... ... @@ -188,7 +188,7 @@
188 188   box-sizing: border-box;
189 189  }
190 190  .resourcePicker .resourceDisplay.loading {
191 - background-image: url("$xwiki.getSkinFile('icons/xwiki/spinner.gif')");
146 + background-image: url(@xwiki-icon-spinner);
192 192   background-repeat: no-repeat;
193 193  }
194 194  
... ... @@ -212,7 +212,7 @@
212 212   * tree finder = 48px
213 213   * footer = 69px
214 214   */
215 - max-height: calc(100vh - 268px);
170 + max-height: calc(~"100vh - 268px");
216 216   overflow-y: auto;
217 217  }
218 218  
... ... @@ -286,20 +286,49 @@
286 286   font: inherit;
287 287   padding: 5px 0;
288 288   width: auto;
289 - max-width: 100%;
244 + max-width: 324px;
290 290   min-width: 200px;
291 291  }
247 +.cke_autocomplete_panel > li.ckeditor-autocomplete-group,
292 292  .cke_autocomplete_panel > li.ckeditor-autocomplete-item {
293 - padding: 3px 12px;
249 + padding: 5px 20px;
294 294  }
295 -.cke_autocomplete_panel > li.ckeditor-autocomplete-item > div {
251 +.cke_autocomplete_panel > li.ckeditor-autocomplete-group {
252 + border-top: 1px solid @xwiki-border-color;
253 + color: @text-muted;
254 + font-size: smaller;
255 + margin-top: 9px;
256 + padding-top: 14px;
257 +}
258 +.cke_autocomplete_panel > li.ckeditor-autocomplete-group h6 {
259 + font-size: inherit;
260 + margin: 0;
261 +}
262 +.cke_autocomplete_panel > li.ckeditor-autocomplete-group:first-child {
263 + border-top: 0 none;
264 + margin-top: 0;
265 + padding-top: 5px;
266 +}
267 +.cke_autocomplete_panel > li.ckeditor-autocomplete-group:hover {
268 + background-color: transparent;
269 + cursor: inherit;
270 +}
271 +.ckeditor-autocomplete-group h6,
272 +.ckeditor-autocomplete-item-label,
273 +.ckeditor-autocomplete-item-shortcut {
274 + overflow: hidden;
275 + text-overflow: ellipsis;
296 296   white-space: nowrap;
297 297  }
278 +.ckeditor-autocomplete-item-head {
279 + display: flex;
280 + align-items: center;
281 +}
298 298  .ckeditor-autocomplete-item-icon-wrapper {
299 299   display: inline-block;
300 300   height: 14px;
301 301   line-height: 14px;
302 - margin-right: .3em;
286 + margin-right: .5em;
303 303   text-align: center;
304 304   width: 14px;
305 305  }
... ... @@ -314,10 +314,133 @@
314 314  .ckeditor-autocomplete-item-icon-wrapper img[src=""] {
315 315   display: none;
316 316  }
301 +.ckeditor-autocomplete-item-label {
302 + /* Push the shortcut to the right edge of the item. */
303 + flex-grow: 1;
304 +}
305 +.ckeditor-autocomplete-item-shortcut:not(:empty) {
306 + background-color: @xwiki-border-color;
307 + border-radius: @border-radius-base;
308 + padding: 2px 5px;
309 + margin-left: .5em;
310 +}
311 +.ckeditor-autocomplete-item-shortcut,
312 +.ckeditor-autocomplete-item-badge,
317 317  .ckeditor-autocomplete-item-hint {
318 - color: $theme.textSecondaryColor;
314 + color: @text-muted;
319 319   font-size: smaller;
320 320  }
317 +.ckeditor-autocomplete-item-badge {
318 + background-color: @xwiki-border-color;
319 + font-weight: normal;
320 +}
321 +.ckeditor-autocomplete-item-hint {
322 + /* Limit to 3 lines of text (based on line height). */
323 + max-height: calc(3 * 20em / 14);
324 + overflow: hidden;
325 + /* Put the ellipsis at the end of the last line when the text is cut. */
326 + display: -webkit-box;
327 + -webkit-box-orient: vertical;
328 + -webkit-line-clamp: 3;
329 +}
321 321  .ckeditor-autocomplete-item-hint:empty {
322 322   margin-top: 0;
323 323  }
333 +
334 +/**
335 + * Source mode
336 + */
337 +
338 +.cke_contents > textarea.cke_source {
339 + box-sizing: border-box;
340 + color: @text-color;
341 + font-family: @font-family-monospace;
342 + font-size: inherit;
343 + /* Same padding as on the page content. */
344 + padding: @grid-gutter-width / 2;
345 +}
346 +
347 +.cke_contents > textarea.cke_source.cke_editable_inline {
348 + border: 1px solid transparent;
349 + border-radius: 0;
350 + box-shadow: none;
351 + margin-top: -1px;
352 + margin-left: -1px;
353 +
354 + .form-control-focus();
355 +}
356 +
357 +.cke_contents.fake {
358 + /* We need this to have the box shadow visible when the source area is focused. */
359 + overflow: visible;
360 +}
361 +
362 +#xwikicontent + .cke_contents > textarea.cke_source.cke_editable_inline {
363 + /* Don't take the padding and the margin into account when computing the 100% width. */
364 + box-sizing: content-box;
365 + /* Make sure the Source area has the same width as the WYSIWYG area. */
366 + margin-left: -@grid-gutter-width / 2 - 1px;
367 + margin-right: -@grid-gutter-width / 2 - 1px;
368 +}
369 +
370 +/**
371 + * Full-screen styles for the in-line editor
372 + */
373 +body[data-maximized="true"] {
374 + overflow: hidden;
375 +
376 + .cke_maximize_backdrop,
377 + .cke_toolBar_active,
378 + .cke_editable_active,
379 + .cke_actionBar_active {
380 + position: fixed !important;
381 + right: 0 !important;
382 + left: 0 !important;
383 + }
384 +
385 + /*
386 + * The tool bar
387 + */
388 + .cke_toolBar_active {
389 + /* We have to use !important in order to overwrite the in-line styles. */
390 + display: block !important;
391 + top: 0 !important;
392 + }
393 +
394 + /*
395 + * The editing area
396 + */
397 + .cke_maximize_backdrop,
398 + .cke_editable_active {
399 + background-color: @xwiki-page-content-bg;
400 + }
401 + .cke_editable_active {
402 + box-sizing: border-box !important;
403 + margin: 0 !important;
404 + overflow-y: auto !important;
405 + z-index: 9995;
406 +
407 + &:focus {
408 + /* Remove the focus border. */
409 + border-color: transparent !important;
410 + box-shadow: none !important;
411 + }
412 + }
413 + .cke_maximize_backdrop {
414 + top: 0;
415 + bottom: 0;
416 + z-index: 99;
417 + }
418 +
419 + /*
420 + * The action buttons
421 + */
422 + .cke_actionBar_active {
423 + background-color: @xwiki-background-secondary-color;
424 + border: 1px solid @xwiki-border-color;
425 + bottom: 0;
426 + /* Reduce a bit the padding. */
427 + padding: .5em;
428 + z-index: 9995;
429 + }
430 +}
Content Type
... ... @@ -1,1 +1,1 @@
1 -CSS
1 +LESS
Name
... ... @@ -1,1 +1,0 @@
1 -CKEditor Skin Fix
Parse content
... ... @@ -1,1 +1,1 @@
1 -Yes
1 +No
XWiki.StyleSheetExtension[1]
Caching policy
... ... @@ -1,1 +1,0 @@
1 -long
Code
... ... @@ -1,97 +1,0 @@
1 -/**
2 - * Source mode
3 - */
4 -
5 -.cke_contents > textarea.cke_source {
6 - box-sizing: border-box;
7 - color: @text-color;
8 - font-family: @font-family-monospace;
9 - font-size: inherit;
10 - /* Same padding as on the page content. */
11 - padding: @grid-gutter-width / 2;
12 -}
13 -
14 -.cke_contents > textarea.cke_source.cke_editable_inline {
15 - border: 1px solid transparent;
16 - border-radius: 0;
17 - box-shadow: none;
18 - margin-top: -1px;
19 - margin-left: -1px;
20 -
21 - .form-control-focus();
22 -}
23 -
24 -.cke_contents.fake {
25 - /* We need this to have the box shadow visible when the source area is focused. */
26 - overflow: visible;
27 -}
28 -
29 -#xwikicontent + .cke_contents > textarea.cke_source.cke_editable_inline {
30 - /* Don't take the padding and the margin into account when computing the 100% width. */
31 - box-sizing: content-box;
32 - /* Make sure the Source area has the same width as the WYSIWYG area. */
33 - margin-left: -@grid-gutter-width / 2 - 1px;
34 - margin-right: -@grid-gutter-width / 2 - 1px;
35 -}
36 -
37 -/**
38 - * Full-screen styles for the in-line editor
39 - */
40 -body[data-maximized="true"] {
41 - overflow: hidden;
42 -
43 - .cke_maximize_backdrop,
44 - .cke_toolBar_active,
45 - .cke_editable_active,
46 - .cke_actionBar_active {
47 - position: fixed !important;
48 - right: 0 !important;
49 - left: 0 !important;
50 - }
51 -
52 - /*
53 - * The tool bar
54 - */
55 - .cke_toolBar_active {
56 - /* We have to use !important in order to overwrite the in-line styles. */
57 - display: block !important;
58 - top: 0 !important;
59 - }
60 -
61 - /*
62 - * The editing area
63 - */
64 - .cke_maximize_backdrop,
65 - .cke_editable_active {
66 - background-color: @xwiki-page-content-bg;
67 - }
68 - .cke_editable_active {
69 - box-sizing: border-box !important;
70 - margin: 0 !important;
71 - overflow-y: auto !important;
72 - z-index: 9995;
73 -
74 - &:focus {
75 - /* Remove the focus border. */
76 - border-color: transparent !important;
77 - box-shadow: none !important;
78 - }
79 - }
80 - .cke_maximize_backdrop {
81 - top: 0;
82 - bottom: 0;
83 - z-index: 99;
84 - }
85 -
86 - /*
87 - * The action buttons
88 - */
89 - .cke_actionBar_active {
90 - background-color: @xwiki-background-secondary-color;
91 - border: 1px solid @xwiki-border-color;
92 - bottom: 0;
93 - /* Reduce a bit the padding. */
94 - padding: .5em;
95 - z-index: 9995;
96 - }
97 -}
Content Type
... ... @@ -1,1 +1,0 @@
1 -LESS
Name
... ... @@ -1,1 +1,0 @@
1 -LESS
Parse content
... ... @@ -1,1 +1,0 @@
1 -No
Use this extension
... ... @@ -1,1 +1,0 @@
1 -onDemand
XWiki.UIExtensionClass[0]
Extension ID
... ... @@ -1,1 +1,1 @@
1 -org.xwiki.platform.requirejs.module.ckeditor
1 +org.xwiki.platform.requirejs.module.xwiki-ckeditor
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.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}))
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}))
XWiki.UIExtensionClass[1]
Cached
... ... @@ -1,0 +1,1 @@
1 +No
Asynchronous rendering
... ... @@ -1,0 +1,1 @@
1 +No
Extension Point ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module
Extension ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module.fusejs
Extension Parameters
... ... @@ -1,0 +1,2 @@
1 +id=fuse
2 +path=$services.webjars.url('org.webjars.npm:fuse.js', 'dist/fuse.basic.min.js')
Extension Scope
... ... @@ -1,0 +1,1 @@
1 +wiki
XWiki.UIExtensionClass[2]
Cached
... ... @@ -1,0 +1,1 @@
1 +No
Asynchronous rendering
... ... @@ -1,0 +1,1 @@
1 +No
Extension Point ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module
Extension ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module.bootstrap3-typeahead
Extension Parameters
... ... @@ -1,0 +1,2 @@
1 +id=bootstrap3-typeahead
2 +path=$services.webjars.url('org.webjars.npm:bootstrap-3-typeahead', 'bootstrap3-typeahead.min')
Extension Scope
... ... @@ -1,0 +1,1 @@
1 +wiki
XWiki.UIExtensionClass[3]
Cached
... ... @@ -1,0 +1,1 @@
1 +No
Asynchronous rendering
... ... @@ -1,0 +1,1 @@
1 +No
Extension Point ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module
Extension ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module.fast-diff
Extension Parameters
... ... @@ -1,0 +1,2 @@
1 +id=fast-diff
2 +path=$services.webjars.url('org.webjars.npm:fast-diff', 'diff')
Extension Scope
... ... @@ -1,0 +1,1 @@
1 +wiki
XWiki.UIExtensionClass[4]
Cached
... ... @@ -1,0 +1,1 @@
1 +No
Asynchronous rendering
... ... @@ -1,0 +1,1 @@
1 +No
Extension Point ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module
Extension ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module.ckeditor
Extension Parameters
... ... @@ -1,0 +1,3 @@
1 +id=ckeditor
2 +path=$services.webjars.url('org.xwiki.platform:xwiki-platform-ckeditor-webjar', 'ckeditor')
3 +exports=CKEDITOR
Extension Scope
... ... @@ -1,0 +1,1 @@
1 +wiki
XWiki.UIExtensionClass[5]
Cached
... ... @@ -1,0 +1,1 @@
1 +No
Asynchronous rendering
... ... @@ -1,0 +1,1 @@
1 +No
Extension Point ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module
Extension ID
... ... @@ -1,0 +1,1 @@
1 +org.xwiki.platform.requirejs.module.xwiki-ckeditor-plugins
Extension Parameters
... ... @@ -1,0 +1,4 @@
1 +id=xwiki-ckeditor-plugins
2 +path=$services.webjars.url('org.xwiki.platform:xwiki-platform-ckeditor-plugins', 'webjar.bundle.min')
3 +bundles=resource, resourcePicker, entityResourcePicker, entityResourceSuggester, entityResourceDisplayer, modal, l10n, macroWizard, imageWizard
4 +deps=jquery, ckeditor
Extension Scope
... ... @@ -1,0 +1,1 @@
1 +wiki