Skip to content

Commit

Permalink
XWIKI-14100: Improve the Wiki Administration
Browse files Browse the repository at this point in the history
* Adapt the CKEditor administration section to the new Administration organization.
  • Loading branch information
mflorea committed Mar 22, 2017
1 parent 380858b commit 12bcd27
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ui/src/main/resources/CKEditor/AdminSection.xml
Expand Up @@ -56,7 +56,8 @@
#set ($discard = $xwiki.ssx.use('CKEditor.AdminSection'))
#set ($discard = $xwiki.jsx.use('CKEditor.AdminSection'))
#set ($configDoc = $xwiki.getDocument('CKEditor.Config'))
<form #if ("$!formId" != '')id="$formId"#end method="post" action="$configDoc.getURL('save')" class="xform">
<form id="ckeditorConfig" method="post" action="$configDoc.getURL('save')" class="xform"
data-editorId="ckeditor" data-label="CKEditor">
<fieldset>
#if ($configDoc.isNew())
## Copy the configuration object from the template.
Expand All @@ -82,7 +83,7 @@
'form_token': $services.csrf.token,
'xredirect': "$request.requestURI?$!request.queryString"
})))
<a class="btn btn-danger" href="$resetURL"
<a class="btn btn-default" href="$resetURL"
title="$escapetool.xml($services.localization.render('ckeditor.admin.reset.hint'))"
data-confirmation="$escapetool.xml($services.localization.render('ckeditor.admin.reset.confirmation'))">
$escapetool.xml($services.localization.render('ckeditor.admin.reset'))
Expand Down Expand Up @@ -406,9 +407,10 @@
<code>require(['jquery', 'bootstrap'], function($) {
var adminPageContent = $('#admin-page-content');
var forms = adminPageContent.find('form');
// Check if there are multiple editors to configure.
if (forms.size() &lt; 2) {
// Only one editor is available. Leave the administration page as it is.
// Check if we need to enhance the WYSIWYG administration section with tabs (one tab for each editor).
if (forms.size() &lt; 2 || forms.is('#wysiwyg')) {
// Either there is only one editor available or the WYSIWYG administration section handles the tabs itself
// (XWiki 9.2RC1+). Leave the administration page as it is.
// This JavaScript code is executed after the page has been loaded so in order to avoid flickering UI we hide the
// page content from CSS and restore it back here.
adminPageContent.addClass('visible');
Expand Down Expand Up @@ -560,13 +562,13 @@
<cache>long</cache>
</property>
<property>
<code>/* Hide the page content until the JavaScript code is loaded and executed. Also hide unnecessary headings. */
<code>/* Hide the page content until the JavaScript code is loaded and executed. Also hide unnecessary headings.
This is not needed anymore starting with XWiki 9.2RC1. */
#admin-page-content &gt; form,
#admin-page-content &gt; .codeToExecute,
#admin-page-content &gt; h1.wikigeneratedheader {
display: none;
}

#admin-page-content.visible &gt; form,
#admin-page-content.visible &gt; .codeToExecute {
display: initial;
Expand All @@ -576,7 +578,7 @@
margin-top: 1em;
}

/* Fix the styles that come from the GWT editor section. */
/* Fix the styles that come from the GWT editor section (XWiki &lt;9.2RC1). */
form.xform .ckeditor-config dd input[type="text"] {
width: 100% !important;
}</code>
Expand Down

0 comments on commit 12bcd27

Please sign in to comment.