Commit 4b9d4f3d authored by Fabian Galinski's avatar Fabian Galinski

[FEATURE] Update this extension for TYPO3 7 LTS

parent 04671208
......@@ -35,12 +35,13 @@ use TYPO3\CMS\Lang\LanguageService;
/**
* tinyMCE initialisation class
*
* Usage:
* $tinyMceLoader = GeneralUtility::makeInstance('\SGalinski\Tinymce\Loader');
* $tinyMceLoader->loadConfiguration($configurationFile);
* $javascript = $tinyMceLoader->loadJsViaPageRenderer();
* Usage: *
* // @var Loader $tinyMceLoader
* $tinyMceLoader = GeneralUtility::makeInstance('SGalinski\Tinymce\Loader');
* $tinyMceLoader->loadConfiguration($configurationFile)
* $tinyMceLoader->loadJsViaPageRenderer($GLOBALS['TSFE']->getPageRenderer());
*
* Basic Configuration:
* Basic Configuration: (= content of $configurationFile)
*
* tinymce.init({
* selector: 'textarea'
......@@ -93,7 +94,7 @@ class Loader {
// language conversion from TLD to iso631
/** @var $locales \TYPO3\CMS\Core\Localization\Locales */
$locales = GeneralUtility::makeInstance('\TYPO3\CMS\Core\Localization\Locales');
$locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales');
$locales->initialize();
$isoArray = (array) $locales->getIsoMapping();
......
......@@ -3,7 +3,7 @@
1. Download the latest version from "http://www.tinymce.com/download/download.php"
2. Download the latest language pack from "http://www.tinymce.com/i18n/index.php".
You can simplify the selection by using the following command in your developer tools console.
Deselect "ru@petr1708" afterwards, because this language doesn't exists and leads to errors.
Deselect "ru@petr1708" and "zh_CN.GB2312" afterwards, because this language doesn't exists and leads to errors.
$('input[type=checkbox]').attr('checked', 1)
......
......@@ -154,31 +154,49 @@ SG.TinyMceLoader.prototype = {
setupTinymce: function(element) {
var hasMatches = false;
this.tinyMceOptions.selector = '';
var elements = element.querySelectorAll(this.selector);
for (var index = 0; index < elements.length; ++index) {
var node = elements[index];
if (!node.dataset) {
node.dataset = {};
}
if (this.selector !== '') {
var elements = element.querySelectorAll(this.selector);
for (var index = 0; index < elements.length; ++index) {
var node = elements[index];
if (node.dataset.isTinyMCE) {
continue;
}
if (!node.dataset) {
node.dataset = {};
}
// add tinyMCE to node
if (!node.id) {
node.id = new Date().getUTCMilliseconds();
}
if (node.dataset.isTinyMCE) {
continue;
}
// add tinyMCE to node
if (!node.id) {
node.id = new Date().getUTCMilliseconds();
}
node.dataset.isTinyMCE = true;
this.tinyMceOptions.selector += ',#' + node.id;
hasMatches = true;
node.dataset.isTinyMCE = true;
this.tinyMceOptions.selector += ',#' + node.id;
hasMatches = true;
}
}
if (hasMatches) {
this.tinyMceOptions.selector = this.tinyMceOptions.selector.slice(1);
this.originalInit.call(tinymce, this.tinyMceOptions);
this.originalInit.call(tinymce, this.getTinyMceOptionsAsNewObject());
}
},
/**
* Converts this tinyMceOptions object into a fresh instance of an object.
*
* @return {string}
*/
getTinyMceOptionsAsNewObject: function() {
var newObject = {};
for (var key in this.tinyMceOptions) {
newObject[key] = this.tinyMceOptions[key];
}
return newObject;
}
};
\ No newline at end of file
### Used Versions
- TinyMCE - 4.2.5
- Languages - 03.09.2015
\ No newline at end of file
- TinyMCE - 4.2.8
- Languages - 20.11.2015
\ No newline at end of file
{
"name": "sgalinski/tinymce",
"type": "typo3-cms-extension",
"description": "TinyMCE sources including a small PHP API",
"homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0+"],
"version": "4.2.8",
"support": {
"issues": "https://forge.typo3.org/projects/extension-tinymce"
},
"require": {
"typo3/cms-core": "*"
},
"replace": {
"tinymce": "*"
},
"autoload": {
"psr-4": {
"SGalinski\\Tinymce\\": "Classes/"
}
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@ $EM_CONF[$_EXTKEY] = array (
'title' => 'tinyMCE',
'description' => 'TinyMCE sources including a small PHP API',
'category' => 'misc',
'version' => '4.2.5',
'version' => '4.2.8',
'state' => 'stable',
'uploadfolder' => false,
'createDirs' => '',
......@@ -17,7 +17,7 @@ $EM_CONF[$_EXTKEY] = array (
'depends' =>
array (
'php' => '5.3.0-5.6.99',
'typo3' => '6.2.0-6.2.99',
'typo3' => '6.2.0-7.6.99',
),
'conflicts' =>
array (
......
Markdown is supported
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