1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Fixes #1155 - TinyMce not saving changes. Rolled back TinyMce to v4.0 before issue began.

This commit is contained in:
Cameron
2015-08-20 14:58:50 -07:00
parent 215b539675
commit 0176b3e3fd
4 changed files with 37 additions and 22 deletions

View File

@@ -19,7 +19,7 @@ if((e107::wysiwyg() === true && check_class($pref['post_html'])) || strpos(e_SEL
//e107::js('tinymce','tiny_mce.js','jquery');
//e107::js('tinymce','wysiwyg.php','jquery',5);
e107::js('footer', "https://tinymce.cachefly.net/4.2/tinymce.min.js");
e107::js('footer', "https://tinymce.cachefly.net/4.0/tinymce.min.js"); // 4.1 and 4.2 have issues with saving under Firefox. http://www.tinymce.com/develop/bugtracker_view.php?id=7655
e107::js('footer',e_PLUGIN.'tinymce4/wysiwyg.php','jquery',5);
// Add to e107_config.php to view hidden content when TinyMce not saving correctly

View File

@@ -12,12 +12,9 @@
(function() {
tinymce.create('tinymce.plugins.e107Plugin', {
init : function(ed,url) {
var t = this, dialect = ed.getParam('bbcode_dialect', 'e107').toLowerCase();
@@ -27,11 +24,10 @@
ed.on('postProcess', function(e) {
// console.log(e);
// alert(e.content); // remove comment to test Firefox issue: http://www.tinymce.com/develop/bugtracker_view.php?id=7655
// console.log(e);
// alert(e.content); // remove comment to test Firefox issue: http://www.tinymce.com/develop/bugtracker_view.php?id=7655
if (e.set) {
e.content = t['_' + dialect + '_bbcode2html'](e.content, url);

View File

@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<tinymce name="Main Admin" version="4">
<plugins>advlist autolink autosave lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualblocks visualchars code fullscreen
insertdatetime media nonbreaking save table contextmenu directionality emoticons template paste textcolor emoticons </plugins>
<plugins>advlist autolink autosave lists link image charmap print preview hr anchor pagebreak searchreplace wordcount visualchars code fullscreen
insertdatetime media nonbreaking table contextmenu directionality emoticons template paste textcolor </plugins>
<menubar>edit view format insert table tools</menubar>
<toolbar1>undo redo | removeformat | styleselect | bold italic underline forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image template | e107-image e107-video e107-bbcode smileys | preview</toolbar1>
<external_plugins>e107 example compat3x</external_plugins>
<external_plugins>e107 compat3x</external_plugins>
<image_advtab>true</image_advtab>
<extended_valid_elements>i[*], object[*],embed[*],bbcode[*]</extended_valid_elements>
<templates>[

View File

@@ -112,6 +112,8 @@ $wy = new wysiwyg();
$gen = $wy->renderConfig();
define('USE_GZIP', true);
if(ADMIN && e_QUERY == 'debug')
{
@@ -131,11 +133,8 @@ if(ADMIN && e_QUERY == 'debug')
require_once(FOOTERF);
}
else
elseif(USE_GZIP === true)
{
//ob_start();
//ob_implicit_flush(0);
//header("last-modified: " . gmdate("D, d M Y H:i:s",mktime(0,0,0,15,2,2004)) . " GMT");
header('Content-type: text/javascript', TRUE);
header('Content-Encoding: gzip');
@@ -145,7 +144,13 @@ else
header('Content-Length: '.strlen($gzipoutput));
echo $gzipoutput;
}
else
{
ob_start();
ob_implicit_flush(0);
header('Content-type: text/javascript', TRUE);
echo $gen;
}
exit;
@@ -331,16 +336,24 @@ class wysiwyg
$ret = array(
'selector' => '.e-wysiwyg',
// 'editor_selector' => 'advancedEditor',
'plugins' => $this->filter_plugins($config['tinymce_plugins']),
'language' => $this->tinymce_lang()
);
// Loop thru XML parms.
foreach($config as $k=>$xml)
{
$ret[$k] = $xml;
if($k == 'plugins')
{
$ret[$k] = $this->filter_plugins($xml);
}
else
{
$ret[$k] = $xml;
}
}
$tPref = e107::pref('tinymce4');
@@ -770,7 +783,7 @@ class wysiwyg
$admin_only = array("ibrowser");
$plug_array = explode(",",$plugs);
$plug_array = explode(" ",$plugs);
$tinymce_plugins = array();
@@ -786,18 +799,24 @@ class wysiwyg
continue;
}
$tinymce_plugins[] = $val;
if(!empty($val))
{
$tinymce_plugins[$val] = trim($val);
}
}
$tPref = e107::pref('tinymce4');
if(!empty($tPref['visualblocks']))
{
$tinymce_plugins[] = 'visualblocks';
$tinymce_plugins['visualblocks'] = 'visualblocks';
}
return $tinymce_plugins;
// print_a($tinymce_plugins);
return implode(" ",$tinymce_plugins);
}