diff --git a/Gruntfile.js b/Gruntfile.js index 4eebc3e6cba7a48a93a7adf2d55da9c8cb6a9a1b..332d0474a865dbe0ff55fa0ae7991501e8f1ee58 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -249,21 +249,12 @@ module.exports = function (grunt) { { cwd: 'bower_components/tinymce/', src: [ - 'themes/*/theme.min.js' - ], - dest: typo3_js, - expand: true, - // Tiny MCE expects the theme js files in ./themes. - flatten: false - }, - { - cwd: 'bower_components/tinymce/', - src: [ + 'themes/*/theme.min.js', + 'plugins/*/plugin.min.js', 'skins/**' ], dest: typo3_js, expand: true, - // Tiny MCE expects the theme js files in ./themes. flatten: false } ] @@ -282,21 +273,12 @@ module.exports = function (grunt) { { cwd: 'bower_components/tinymce/', src: [ - 'themes/*/theme.min.js' - ], - dest: 'js/', - expand: true, - // Tiny MCE expects the theme js files in ./themes. - flatten: false - }, - { - cwd: 'bower_components/tinymce/', - src: [ + 'themes/*/theme.min.js', + 'plugins/*/plugin.min.js', 'skins/**' ], dest: 'js/', expand: true, - // Tiny MCE expects the theme js files in ./themes. flatten: false } ] diff --git a/javascript/src/Helper/tinyMCE.js b/javascript/src/Helper/tinyMCE.js index 32b3271416eb803ce48987f9780075b0d424e243..c819bce29bc6a53ca4e493ca7432da0825708bd4 100644 --- a/javascript/src/Helper/tinyMCE.js +++ b/javascript/src/Helper/tinyMCE.js @@ -43,19 +43,18 @@ QfqNS.Helper = QfqNS.Helper || {}; var configData = $this.data('config'); if (configData) { - try { - config = JSON.parse(configData); - } catch (e) { - QfqNS.Log("Exception while parsing JSON: " + configData); - QfqNS.Log(e); - return; + if (configData instanceof Object) { + // jQuery takes care of decoding data-config to JavaScript object. + config = configData; + } else { + QfqNS.Log.warning("'data-config' is invalid: " + configData); } } config.selector = "#" + tinyMCEId; config.setup = function (editor) { editor.on('Change', function (e) { - console.log('Editor was changed'); + QfqNS.Log.debug('Editor was changed'); var eventTarget = e.target; var $parentForm = $(eventTarget.formElement); $parentForm.trigger("change"); diff --git a/mockup/richtexteditor.html b/mockup/richtexteditor.html index 1642383ec4b4fe29f65807213cf7cbb36db69df5..873622fec399738e7ff264d3a76e28961cba7c32 100644 --- a/mockup/richtexteditor.html +++ b/mockup/richtexteditor.html @@ -73,7 +73,8 @@ </div> <div class="col-md-6"> - <textarea id="text2" class="qfq-tinymce" name="rte">Input + <textarea id="text2" class="qfq-tinymce" name="rte" + data-config="{ "plugins": "advlist autolink link image lists charmap print preview"}">Input </textarea> </div>