Skip to content

Commit 49d8204

Browse files
authored
Revert "fix: change extra places where spellchecker language not defaulting t…" (#545)
This reverts commit 34e2c7f.
1 parent 00c9908 commit 49d8204

File tree

2 files changed

+48
-45
lines changed

2 files changed

+48
-45
lines changed

app/cdn/assets/_js/components/wysiwyg.js

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,82 +7,85 @@ var OLCS = OLCS || {};
77
* formatting/code it spews out
88
*/
99

10-
OLCS.wysiwyg = (function (document, $, undefined) {
11-
"use strict";
10+
OLCS.wysiwyg = (function(document, $, undefined) {
11+
12+
'use strict';
1213

1314
return function init() {
14-
OLCS.eventEmitter.on("render", function () {
15-
if (typeof tinymce === "undefined") {
15+
16+
OLCS.eventEmitter.on('render', function() {
17+
18+
if (typeof(tinymce) === 'undefined') {
1619
return;
1720
}
1821

19-
$(".tinymce").each(function () {
22+
$('.tinymce').each(function() {
2023
$(this).tinymce({
21-
menubar: false,
22-
statusbar: false,
23-
document_base_url: "../tinymce/",
24-
spellchecker_languages: "+English=en_GB",
25-
spellchecker_language: "en_GB",
26-
spellchecker_rpc_url: "index.php",
27-
spellchecker_report_misspellings: true,
24+
menubar : false,
25+
statusbar : false,
26+
document_base_url: '../tinymce/',
27+
spellchecker_languages : '+English=en',
28+
spellchecker_language : 'en',
29+
spellchecker_rpc_url: 'index.php',
30+
spellchecker_report_misspellings : true,
2831
forced_root_blocks: false,
29-
height: 260,
30-
content_css: "../tinymce/skins/lightgray/custom.css",
32+
height : 260,
33+
content_css : '../tinymce/skins/lightgray/custom.css',
3134
style_formats: [
32-
{ title: "Header 1", format: "h1" },
33-
{ title: "Header 2", format: "h2" },
34-
{ title: "Header 3", format: "h3" },
35+
{title: 'Header 1', format: 'h1'},
36+
{title: 'Header 2', format: 'h2'},
37+
{title: 'Header 3', format: 'h3'}
38+
],
39+
plugins: [
40+
'lists charmap',
41+
'searchreplace',
42+
'paste spellchecker'
3543
],
36-
plugins: ["lists charmap", "searchreplace", "paste spellchecker"],
37-
paste_postprocess: function (plugin, args) {
38-
var elements = args.node.getElementsByTagName("*");
39-
for (var i = 0; i < elements.length; i++) {
40-
elements[i].className = "";
44+
paste_postprocess: function(plugin, args){
45+
var elements = args.node.getElementsByTagName('*');
46+
for(var i = 0; i < elements.length; i ++){
47+
elements[i].className = '';
4148
}
4249
},
4350
paste_as_text: false,
44-
toolbar: "styleselect | bold italic underline | bullist numlist | indent outdent | spellchecker",
45-
init_instance_callback: function () {
51+
toolbar: 'styleselect | bold italic underline | bullist numlist | indent outdent | spellchecker',
52+
init_instance_callback: function() {
4653
lockActions();
4754
},
48-
setup: function (editor) {
49-
editor.on("keyup", function () {
50-
if (tinymce.activeEditor.getContent()) {
51-
// jshint ignore:line
55+
setup: function(editor) {
56+
editor.on('keyup', function() {
57+
if (tinymce.activeEditor.getContent()) {// jshint ignore:line
5258
unlockActions();
5359
} else {
5460
lockActions();
5561
}
5662
});
57-
},
63+
}
5864
});
5965

6066
// If the editor was initialised in a modal, we need to remove it
6167
// when the modal closes
62-
OLCS.eventEmitter.on("hide:modal", function () {
68+
OLCS.eventEmitter.on('hide:modal', function() {
6369
tinymce.EditorManager.editors = []; // jshint ignore:line
6470
});
6571
});
6672

6773
// Upon init, we need to lock submit buttons until something actually
6874
// gets written into tinymce editor, to prevent issues with validation
6975
function lockActions() {
70-
$(".modal")
71-
.find(".govuk-button-group")
72-
.children()
73-
.first() // the save/submit button
74-
.addClass("govuk-button--disabled")
75-
.prop("disabled", true);
76+
$('.modal').find('.govuk-button-group')
77+
.children().first() // the save/submit button
78+
.addClass('govuk-button--disabled').prop('disabled', true);
7679
}
7780

7881
function unlockActions() {
79-
$(".modal")
80-
.find(".govuk-button-group")
81-
.children()
82-
.first() // the save/submit button
83-
.removeClass("govuk-button--disabled")
84-
.prop("disabled", false);
82+
$('.modal').find('.govuk-button-group')
83+
.children().first() // the save/submit button
84+
.removeClass('govuk-button--disabled').prop('disabled', false);
8585
}
86+
8687
});
88+
8789
};
88-
})(document, window.jQuery);
90+
91+
}(document, window.jQuery));

app/cdn/public/tinymce/plugins/spellchecker/includes/Engine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function processRequest($tinymceSpellcheckerConfig) {
7474
header("Pragma: no-cache");
7575

7676
$method = self::getParam("method", "spellcheck");
77-
$lang = self::getParam("lang", "en_GB");
77+
$lang = self::getParam("lang", "en_US");
7878
$text = self::getParam("text");
7979

8080
if ($method == "spellcheck") {
@@ -165,4 +165,4 @@ public static function getWords($text) {
165165
}
166166
}
167167

168-
?>
168+
?>

0 commit comments

Comments
 (0)