diff --git a/wagtail/admin/static_src/wagtailadmin/js/blocks/sequence.js b/wagtail/admin/static_src/wagtailadmin/js/blocks/sequence.js index 2dcbd57e9..32c09892a 100644 --- a/wagtail/admin/static_src/wagtailadmin/js/blocks/sequence.js +++ b/wagtail/admin/static_src/wagtailadmin/js/blocks/sequence.js @@ -53,7 +53,7 @@ CODE FOR SETTING UP SPECIFIC UI WIDGETS, SUCH AS DELETE BUTTONS OR MENUS, DOES N // focus first suitable input found var timeout = setTimeout(function() { - $('.input input,.input textarea,.input .richtext', self.container).first().trigger('focus'); + $('.input input,.input textarea,.input .halloeditor', self.container).first().trigger('focus'); }, 250); }; diff --git a/wagtail/admin/static_src/wagtailadmin/js/hallo-bootstrap.js b/wagtail/admin/static_src/wagtailadmin/js/hallo-bootstrap.js index ede718c9a..3139a9e3e 100644 --- a/wagtail/admin/static_src/wagtailadmin/js/hallo-bootstrap.js +++ b/wagtail/admin/static_src/wagtailadmin/js/hallo-bootstrap.js @@ -2,8 +2,8 @@ function makeHalloRichTextEditable(id, plugins) { var input = $('#' + id); - var richText = $('
').html(input.val()); - richText.insertBefore(input); + var editor = $('').html(input.val()); + editor.insertBefore(input); input.hide(); var removeStylingPending = false; @@ -12,7 +12,7 @@ function makeHalloRichTextEditable(id, plugins) { (we don't remove the span entirely as that messes with the cursor position, and spans will be removed anyway by our whitelisting) */ - $('span[style]', richText).filter(function() { + $('span[style]', editor).filter(function() { return this.attributes.length === 1; }).removeAttr('style'); removeStylingPending = false; @@ -20,7 +20,7 @@ function makeHalloRichTextEditable(id, plugins) { /* Workaround for faulty change-detection in hallo */ function setModified() { - var hallo = richText.data('IKS-hallo'); + var hallo = editor.data('IKS-hallo'); if (hallo) { hallo.setModified(); } @@ -29,7 +29,7 @@ function makeHalloRichTextEditable(id, plugins) { var closestObj = input.closest('.object'); var isRoot = input.closest('.struct-block').length == 0; - richText.hallo({ + editor.hallo({ toolbar: 'halloToolbarFixed', toolbarCssClass: (closestObj.hasClass('full')) ? 'full' : (closestObj.hasClass('stream-field') && isRoot) ? 'stream-field' : '', /* use the passed-in plugins arg */ @@ -59,7 +59,7 @@ function makeHalloRichTextEditable(id, plugins) { }); }); - setupLinkTooltips(richText); + setupLinkTooltips(editor); } function setupLinkTooltips(elem) { @@ -76,9 +76,9 @@ function setupLinkTooltips(elem) { function insertRichTextDeleteControl(elem) { var a = $('Delete'); - $(elem).addClass('rich-text-deletable').prepend(a); + $(elem).addClass('halloeditor-deletable').prepend(a); a.on('click', function() { - var widget = $(elem).parent('.richtext').data('IKS-hallo'); + var widget = $(elem).parent('.halloeditor').data('IKS-hallo'); $(elem).fadeOut(function() { $(elem).remove(); if (widget != undefined && widget.options.editable) { @@ -89,7 +89,7 @@ function insertRichTextDeleteControl(elem) { } $(function() { - $('.richtext [contenteditable="false"]').each(function() { + $('.halloeditor [contenteditable="false"]').each(function() { insertRichTextDeleteControl(this); }); }) diff --git a/wagtail/admin/static_src/wagtailadmin/scss/components/_forms.scss b/wagtail/admin/static_src/wagtailadmin/scss/components/_forms.scss index cf5b5f3ea..290719ee1 100644 --- a/wagtail/admin/static_src/wagtailadmin/scss/components/_forms.scss +++ b/wagtail/admin/static_src/wagtailadmin/scss/components/_forms.scss @@ -53,7 +53,7 @@ label, input, textarea, select, -.richtext, +.halloeditor, .tagit { box-sizing: border-box; border-radius: 6px; @@ -896,7 +896,7 @@ li.focused > .help { input, textarea, select, - .richtext, + .halloeditor, .tagit { border-radius: 3px; padding: 0.4em 1em; diff --git a/wagtail/admin/static_src/wagtailadmin/scss/components/_streamfield.scss b/wagtail/admin/static_src/wagtailadmin/scss/components/_streamfield.scss index 094fcdca0..5b94745b0 100644 --- a/wagtail/admin/static_src/wagtailadmin/scss/components/_streamfield.scss +++ b/wagtail/admin/static_src/wagtailadmin/scss/components/_streamfield.scss @@ -135,7 +135,7 @@ li.sequence-member { // that are direct children of highest level sequence should be borderless and full-width .block_field > .field-content > .input > .sequence-container > .sequence-container-inner > .sequence > .sequence-member > .sequence-member-inner { > .widget-text_input input, - > .widget-hallo_rich_text_area .richtext, + > .widget-hallo_rich_text_area .halloeditor, > .widget-textarea textarea { border: 0; padding: 0; diff --git a/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss b/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss index 12536063b..a624c6342 100644 --- a/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss +++ b/wagtail/admin/static_src/wagtailadmin/scss/layouts/page-editor.scss @@ -143,7 +143,7 @@ } } - .richtext { + .halloeditor { padding-top: 1em; // to provide space for editor buttons padding-bottom: 1em; @@ -181,7 +181,7 @@ padding: 0; } - .richtext { + .halloeditor { padding-top: 3em; // to provide space for editor buttons padding-bottom: 3em; @@ -199,7 +199,7 @@ .error, .error input, .error textarea, - .error .richtext { + .error .halloeditor { background-color: $color-input-error-bg; } } @@ -332,7 +332,7 @@ // Custom styles that make some fields look more important .full input, .full textarea, -.full .richtext { +.full .halloeditor { @include nice-padding(); border-radius: 0; padding-top: 2em; @@ -343,7 +343,7 @@ .title input, .title textarea, -.title .richtext { +.title .halloeditor { font-size: 2em; font-family: $font-serif; } @@ -447,7 +447,7 @@ footer .preview { input, textarea, - .richtext { + .halloeditor { border-width: 0 1px; } diff --git a/wagtail/admin/static_src/wagtailadmin/scss/panels/rich-text.scss b/wagtail/admin/static_src/wagtailadmin/scss/panels/rich-text.scss index 63aa43593..af16a75b4 100644 --- a/wagtail/admin/static_src/wagtailadmin/scss/panels/rich-text.scss +++ b/wagtail/admin/static_src/wagtailadmin/scss/panels/rich-text.scss @@ -34,7 +34,7 @@ height: 2.4em; } -.richtext { +.halloeditor { font-family: $font-serif; padding-top: 4em; min-height: 50px; @@ -80,7 +80,7 @@ } // Delete controls on embedded blocks with contenteditable='false' - .rich-text-deletable { + .halloeditor-deletable { position: relative; a.delete-control { @@ -100,7 +100,7 @@ } &.inEditMode { - .rich-text-deletable a.delete-control { + .halloeditor-deletable a.delete-control { display: block; } } diff --git a/wagtail/embeds/static_src/wagtailembeds/js/hallo-plugins/hallo-wagtailembeds.js b/wagtail/embeds/static_src/wagtailembeds/js/hallo-plugins/hallo-wagtailembeds.js index 48a49373c..3e378d87c 100644 --- a/wagtail/embeds/static_src/wagtailembeds/js/hallo-plugins/hallo-wagtailembeds.js +++ b/wagtail/embeds/static_src/wagtailembeds/js/hallo-plugins/hallo-wagtailembeds.js @@ -25,7 +25,7 @@ var insertionPoint, lastSelection; lastSelection = widget.options.editable.getSelection(); - insertionPoint = $(lastSelection.endContainer).parentsUntil('.richtext').last(); + insertionPoint = $(lastSelection.endContainer).parentsUntil('.halloeditor').last(); return ModalWorkflow({ url: window.chooserUrls.embedsChooser, diff --git a/wagtail/images/static_src/wagtailimages/js/hallo-plugins/hallo-wagtailimage.js b/wagtail/images/static_src/wagtailimages/js/hallo-plugins/hallo-wagtailimage.js index 33a912694..72f3c00fa 100644 --- a/wagtail/images/static_src/wagtailimages/js/hallo-plugins/hallo-wagtailimage.js +++ b/wagtail/images/static_src/wagtailimages/js/hallo-plugins/hallo-wagtailimage.js @@ -23,7 +23,7 @@ var insertionPoint, lastSelection; lastSelection = widget.options.editable.getSelection(); - insertionPoint = $(lastSelection.endContainer).parentsUntil('.richtext').last(); + insertionPoint = $(lastSelection.endContainer).parentsUntil('.halloeditor').last(); return ModalWorkflow({ url: window.chooserUrls.imageChooser + '?select_format=true', responses: {