diff --git a/app/cdn/assets/_js/components/wysiwyg.js b/app/cdn/assets/_js/components/wysiwyg.js index 8849c24b15..775cf8562d 100644 --- a/app/cdn/assets/_js/components/wysiwyg.js +++ b/app/cdn/assets/_js/components/wysiwyg.js @@ -7,65 +7,59 @@ var OLCS = OLCS || {}; * formatting/code it spews out */ -OLCS.wysiwyg = (function(document, $, undefined) { - - 'use strict'; +OLCS.wysiwyg = (function (document, $, undefined) { + "use strict"; return function init() { - - OLCS.eventEmitter.on('render', function() { - - if (typeof(tinymce) === 'undefined') { + OLCS.eventEmitter.on("render", function () { + if (typeof tinymce === "undefined") { return; } - $('.tinymce').each(function() { + $(".tinymce").each(function () { $(this).tinymce({ - menubar : false, - statusbar : false, - document_base_url: '../tinymce/', - spellchecker_languages : '+English=en', - spellchecker_language : 'en', - spellchecker_rpc_url: 'index.php', - spellchecker_report_misspellings : true, + menubar: false, + statusbar: false, + document_base_url: "../tinymce/", + spellchecker_languages: "+English=en_GB", + spellchecker_language: "en_GB", + spellchecker_rpc_url: "index.php", + spellchecker_report_misspellings: true, forced_root_blocks: false, - height : 260, - content_css : '../tinymce/skins/lightgray/custom.css', + height: 260, + content_css: "../tinymce/skins/lightgray/custom.css", style_formats: [ - {title: 'Header 1', format: 'h1'}, - {title: 'Header 2', format: 'h2'}, - {title: 'Header 3', format: 'h3'} - ], - plugins: [ - 'lists charmap', - 'searchreplace', - 'paste spellchecker' + { title: "Header 1", format: "h1" }, + { title: "Header 2", format: "h2" }, + { title: "Header 3", format: "h3" }, ], - paste_postprocess: function(plugin, args){ - var elements = args.node.getElementsByTagName('*'); - for(var i = 0; i < elements.length; i ++){ - elements[i].className = ''; + plugins: ["lists charmap", "searchreplace", "paste spellchecker"], + paste_postprocess: function (plugin, args) { + var elements = args.node.getElementsByTagName("*"); + for (var i = 0; i < elements.length; i++) { + elements[i].className = ""; } }, paste_as_text: false, - toolbar: 'styleselect | bold italic underline | bullist numlist | indent outdent | spellchecker', - init_instance_callback: function() { + toolbar: "styleselect | bold italic underline | bullist numlist | indent outdent | spellchecker", + init_instance_callback: function () { lockActions(); }, - setup: function(editor) { - editor.on('keyup', function() { - if (tinymce.activeEditor.getContent()) {// jshint ignore:line + setup: function (editor) { + editor.on("keyup", function () { + if (tinymce.activeEditor.getContent()) { + // jshint ignore:line unlockActions(); } else { lockActions(); } }); - } + }, }); // If the editor was initialised in a modal, we need to remove it // when the modal closes - OLCS.eventEmitter.on('hide:modal', function() { + OLCS.eventEmitter.on("hide:modal", function () { tinymce.EditorManager.editors = []; // jshint ignore:line }); }); @@ -73,19 +67,22 @@ OLCS.wysiwyg = (function(document, $, undefined) { // Upon init, we need to lock submit buttons until something actually // gets written into tinymce editor, to prevent issues with validation function lockActions() { - $('.modal').find('.govuk-button-group') - .children().first() // the save/submit button - .addClass('govuk-button--disabled').prop('disabled', true); + $(".modal") + .find(".govuk-button-group") + .children() + .first() // the save/submit button + .addClass("govuk-button--disabled") + .prop("disabled", true); } function unlockActions() { - $('.modal').find('.govuk-button-group') - .children().first() // the save/submit button - .removeClass('govuk-button--disabled').prop('disabled', false); + $(".modal") + .find(".govuk-button-group") + .children() + .first() // the save/submit button + .removeClass("govuk-button--disabled") + .prop("disabled", false); } - }); - }; - -}(document, window.jQuery)); +})(document, window.jQuery); diff --git a/app/cdn/public/tinymce/plugins/spellchecker/includes/Engine.php b/app/cdn/public/tinymce/plugins/spellchecker/includes/Engine.php index ecfb6867ac..94546bd955 100644 --- a/app/cdn/public/tinymce/plugins/spellchecker/includes/Engine.php +++ b/app/cdn/public/tinymce/plugins/spellchecker/includes/Engine.php @@ -74,7 +74,7 @@ public static function processRequest($tinymceSpellcheckerConfig) { header("Pragma: no-cache"); $method = self::getParam("method", "spellcheck"); - $lang = self::getParam("lang", "en_US"); + $lang = self::getParam("lang", "en_GB"); $text = self::getParam("text"); if ($method == "spellcheck") { @@ -165,4 +165,4 @@ public static function getWords($text) { } } -?> \ No newline at end of file +?>