Commit 36003586 authored by Rafael Ostertag's avatar Rafael Ostertag
Browse files

tinyMCE.js: Fixed handling of JavaScript/JSON data in `data-config` attribute.

Gruntfile.js: Copy tinyMCE plugins.
parent 6f241f2d
......@@ -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
}
]
......
......@@ -43,12 +43,11 @@ QfqNS.Helper = QfqNS.Helper || {};
var configData = $this.data('config');
if (configData) {
try {
config = JSON.parse(configData);
} catch (e) {
QfqNS.Log.error("Exception while parsing JSON: " + configData);
QfqNS.Log.error(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);
}
}
......
......@@ -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="{ &quot;plugins&quot;: &quot;advlist autolink link image lists charmap print preview&quot;}">Input
</textarea>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment