Changes for page EditSheet

Last modified by teamwire005 on 2025/05/06 08:20

From version 1.1
edited by teamwire001
on 2021/06/11 07:39
Change comment: Install extension [org.xwiki.contrib:application-ckeditor-ui/1.53.2]
To version 2.1
edited by teamwire004
on 2024/01/16 09:21
Change comment: Install extension [org.xwiki.contrib:application-ckeditor-ui/1.48]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.teamwire001
1 +XWiki.teamwire004
XWiki.JavaScriptExtension[0]
Code
... ... @@ -110,8 +110,7 @@
110 110   styles: '*',
111 111   classes: '*'
112 112   }
113 - },
114 - 'plain/1.0': ';'
113 + }
115 115   };
116 116   allowedContentBySyntax['xwiki/2.0'] = allowedContentBySyntax['xwiki/2.1'];
117 117   // This is a hack, increasing the technical debt since the CKEditor module should not know about the Markdown
... ... @@ -144,7 +144,6 @@
144 144   sourceDocument.syntax = $(element).attr('data-sourceDocumentSyntax');
145 145   var config = {
146 146   allowedContent: allowedContentBySyntax[sourceDocument.syntax],
147 - editorplaceholder: $jsontool.serialize($services.localization.render('ckeditor.content.placeholder')),
148 148   filebrowserUploadUrl: getUploadURL(sourceDocument, 'filebrowser'),
149 149   // This is used in CKEditor.FileUploader so we must keep them in sync.
150 150   fileTools_defaultFileName: '__fileCreatedFromDataURI__',
... ... @@ -170,6 +170,10 @@
170 170   htmlConverter: sourceDocument.getURL('get', $.param({
171 171   sheet: 'CKEditor.HTMLConverter',
172 172   outputSyntax: 'plain',
171 + // Make sure we use the syntax specified when the editor was loaded. This is especially important when the
172 + // edited document is new (unsaved) because we want the converter to use the syntax specified by the template
173 + // rather than the default wiki syntax.
174 + sourceSyntax: sourceDocument.syntax,
173 173   language: currentLocale
174 174   }))
175 175   },
XWiki.JavaScriptExtension[2]
Code
... ... @@ -1,30 +1,19 @@
1 1  require(['jquery', 'xwiki-ckeditor', 'xwiki-events-bridge'], function($, ckeditorPromise) {
2 - var createEditors = function(ckeditor, container) {
3 - container.find('.ckeditor-textarea').each(function() {
4 - // Wrap in try/catch so that a failure to load one editor doesn't affect the other editors.
5 - try {
6 - createEditor(ckeditor, this);
7 - } catch(e) {
8 - console.log(e);
9 - }
10 - });
11 - };
12 -
13 - var createEditor = function(ckeditor, textArea, instanceConfig) {
14 - var deferred = $.Deferred();
15 - var editor = ckeditor.replace(textArea, instanceConfig);
16 - editor.once('instanceReady', $.proxy(deferred, 'resolve', editor));
17 - editor.once('reload', function(event) {
18 - event.data.promise = event.data.promise.then($.proxy(createEditor, null, ckeditor, textArea));
19 - });
20 - return deferred.promise();
21 - };
22 -
23 23   ckeditorPromise.done(function(ckeditor) {
24 - createEditors(ckeditor, $(body));
3 + var createEditors = function(container) {
4 + container.find('.ckeditor-textarea').each(function() {
5 + // Wrap in try/catch so that a failure to load one editor doesn't affect the other editors.
6 + try {
7 + ckeditor.replace(this);
8 + } catch(e) {
9 + console.log(e);
10 + }
11 + });
12 + };
13 + createEditors($(body));
25 25   // Make sure we don't register the event listener multiple times (in case this code is loaded multiple times).
26 26   $(document).off('xwiki:dom:updated.ckeditor').on('xwiki:dom:updated.ckeditor', function(event, data) {
27 - createEditors(ckeditor, $(data.elements));
16 + createEditors($(data.elements));
28 28   });
29 29   });
30 30  });
XWiki.StyleSheetExtension[0]
Code
... ... @@ -71,7 +71,7 @@
71 71  }
72 72  
73 73  /**
74 - * Full-screen styles (for the standalone / classic editor).
74 + * Full-screen styles.
75 75   */
76 76  
77 77  .fullScreenEditLinkContainer {
... ... @@ -84,7 +84,7 @@
84 84   padding: .5em;
85 85  }
86 86  
87 -/* The 'skin-flamingo' class name is removed from the body element in full-screen mode so we need to fix the auto-save
87 +/* The 'skin-flamingo' class name is removed from the body element in full-screen mode so we need to fix the auto-save
88 88   styles. */
89 89  .cke_maximized #autosaveControl input.autosave-frequency {
90 90   width: 3em;
... ... @@ -309,11 +309,6 @@
309 309   max-width: 14px;
310 310   vertical-align: text-top;
311 311  }
312 -/* The image still takes some space in IE11 even if there's no source specified. Let's make sure it's hidden.
313 - See CKEDITOR-389: Missing space in the suggestions that appear while using the autocomplete function on IE 11 */
314 -.ckeditor-autocomplete-item-icon-wrapper img[src=""] {
315 - display: none;
316 -}
317 317  .ckeditor-autocomplete-item-hint {
318 318   color: $theme.textSecondaryColor;
319 319   font-size: smaller;
XWiki.StyleSheetExtension[1]
Code
... ... @@ -18,7 +18,9 @@
18 18   margin-top: -1px;
19 19   margin-left: -1px;
20 20  
21 - .form-control-focus();
21 + &:focus {
22 + .form-control-focus();
23 + }
22 22  }
23 23  
24 24  .cke_contents.fake {
... ... @@ -33,65 +33,3 @@
33 33   margin-left: -@grid-gutter-width / 2 - 1px;
34 34   margin-right: -@grid-gutter-width / 2 - 1px;
35 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 -}
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.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.contrib:application-ckeditor-ui', "wiki:$xcontext.database").version.value}))