Changes for page EditSheet

Last modified by teamwire004 on 2026/01/13 09:12

From version 10.1
edited by teamwire004
on 2026/01/13 09:12
Change comment: Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/17.10.2]
To version 7.1
edited by teamwire005
on 2025/05/06 08:20
Change comment: Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/16.10.6]

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.teamwire004
1 +XWiki.teamwire005
Content
... ... @@ -1,0 +1,38 @@
1 +{{include reference="CKEditor.VelocityMacros"/}}
2 +
3 +{{velocity}}
4 +#if ($doc.fullName == 'CKEditor.EditSheet')
5 + This is a sheet for editing the document content using [[CKEditor>>http://ckeditor.com/]].
6 +#else
7 + {{html clean="false"}}
8 + ## Include the auto-save styles.
9 + #set ($discard = $xwiki.ssfx.use('js/xwiki/editors/autosave.css', true))
10 + #if ("$!request.section" != '')
11 + <div class="hidden">
12 + <input type="hidden" name="section" value="$!escapetool.xml($request.section)"/>
13 + </div>
14 + #end
15 + <div class="row">
16 + <div class="cke-editMeta col-xs-12 col-md-7">
17 + ## Add support for editing the page title (which is not available by default in Inline Form edit mode).
18 + #set ($editor = 'wiki')
19 + #template('editmeta.vm')
20 + #set ($editor = 'inline')
21 + </div>
22 + </div>
23 + ## The xwikieditcontent id is needed for the auto-save feature.
24 + <div id="xwikieditcontent" data-autosave="true">
25 + #set ($parameters = {
26 + 'content': $tdoc.content,
27 + 'attributes': {
28 + 'id': 'content',
29 + 'name': 'content',
30 + 'rows': 25,
31 + 'cols': 80
32 + }
33 + })
34 + #ckeditor($parameters)
35 + </div>
36 + {{/html}}
37 +#end
38 +{{/velocity}}
XWiki.JavaScriptExtension[2]
Code
... ... @@ -10,9 +10,7 @@
10 10   container.find('.ckeditor-textarea').each(function() {
11 11   // Wrap in try/catch so that a failure to load one editor doesn't affect the other editors.
12 12   try {
13 - createEditor(ckeditor, this).then(() => {
14 - this.classList.remove('loading');
15 - });
13 + createEditor(ckeditor, this);
16 16   } catch(e) {
17 17   console.log(e);
18 18   }
XWiki.StyleSheetExtension[0]
Code
... ... @@ -12,13 +12,6 @@
12 12   resize: none;
13 13  }
14 14  
15 -/* Hide the form action bar while the editor is loading in order to avoid UI flickering (because the editor may enhance
16 - or replace the form action bar). */
17 -main > div:has(.ckeditor-textarea.loading) ~ .bottom-editor,
18 -#xwikicontent.loading ~ form#inplace-editing {
19 - visibility: hidden;
20 -}
21 -
22 22  /* Show the modal above the CKEditor dialogs */
23 23  body > .modal-backdrop {
24 24   z-index: 10040;
... ... @@ -179,25 +179,6 @@
179 179  }
180 180  
181 181  /**
182 - * Handle the layout and display of the warning message for headerless tables.
183 - * This message is added by the xwiki-table plugin.
184 - * Some of the default styles are just overridden by the CKEditor reset.
185 - */
186 -.cke_dialog_container span.box.warningmessage {
187 - .alert-warning;
188 - /* Default warning boxes are not meant to be used in a strict layout like the one of this table dialog.
189 - * We need an extra customization to avoid breaking this layout. */
190 - white-space: break-spaces;
191 - /* By default, the warning is not shown. */
192 - display: none;
193 -}
194 -
195 -/* When the value of the previous field is the one we want to avoid, we show the warning. */
196 -.cke_dialog_container tr:has(select [value=""]:checked) + tr span.box.warningmessage {
197 - display: unset;
198 -}
199 -
200 -/**
201 201   * Link Options Toggle
202 202   */
203 203  
... ... @@ -230,6 +230,8 @@
230 230  a.cke_button.cke_button__xwiki-macro-edit > span.cke_button_icon.cke_button__xwiki-macro-edit_icon,
231 231  a.cke_button.cke_button__xwiki-link-open > span.cke_button_icon.cke_button__xwiki-link-open_icon,
232 232  a.cke_button.cke_button__insert > span.cke_button_icon.cke_button__insert_icon {
207 + /* This is needed for XWiki versions older than 7.1M1 where we overwrite the icons path (see above). */
208 + background-image: none !important;
233 233   font-family: 'Glyphicons Halflings';
234 234   position: relative;
235 235   top: 1px;
... ... @@ -336,7 +336,7 @@
336 336   max-width: 64px;
337 337   vertical-align: text-top;
338 338  }
339 -/* The image still takes some space in all browsers even if there's no source specified. Let's make sure it's hidden.
315 +/* The image still takes some space in IE11 even if there's no source specified. Let's make sure it's hidden.
340 340   See CKEDITOR-389: Missing space in the suggestions that appear while using the autocomplete function on IE 11 */
341 341  .ckeditor-autocomplete-item-preview-wrapper img[src=""],
342 342  .ckeditor-autocomplete-item-icon-wrapper img[src=""] {
... ... @@ -389,15 +389,26 @@
389 389  }
390 390  
391 391  .cke_contents > textarea.cke_source.cke_editable_inline {
368 + border: 1px solid transparent;
369 + border-radius: 0;
392 392   box-shadow: none;
371 + margin-top: -1px;
372 + margin-left: -1px;
373 +
374 + .form-control-focus();
393 393  }
394 394  
377 +.cke_contents.fake {
378 + /* We need this to have the box shadow visible when the source area is focused. */
379 + overflow: visible;
380 +}
381 +
395 395  #xwikicontent + .cke_contents > textarea.cke_source.cke_editable_inline {
396 396   /* Don't take the padding and the margin into account when computing the 100% width. */
397 397   box-sizing: content-box;
398 398   /* Make sure the Source area has the same width as the WYSIWYG area. */
399 - margin-left: -@grid-gutter-width / 2;
400 - margin-right: -@grid-gutter-width / 2;
386 + margin-left: -@grid-gutter-width / 2 - 1px;
387 + margin-right: -@grid-gutter-width / 2 - 1px;
401 401  }
402 402  
403 403  /**