Skip to content

Commit

Permalink
refs #1742 : modified - editor removes CmCaReT span (for cursor anchor
Browse files Browse the repository at this point in the history
	 generated by codemirror plugin)

 -
  • Loading branch information
inureyes committed Jan 12, 2015
1 parent b7d0d00 commit 23f65a1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions plugins/ED_tinyMCE/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function tinyMCE_handleconfig($configVal) {
}

function tinyMCE_editorinit($editor) {
global $configVal, $entry, $pluginURL, $pluginPath;
global $configVal, $pluginURL, $pluginPath;
$context = Model_Context::getInstance();
$blogid = getBlogId();
$config = Setting::fetchConfigVal($configVal);
Expand Down Expand Up @@ -156,7 +156,7 @@ function tinyMCE_adminheader($target, $mother) {
global $suri, $pluginURL;
$context = Model_Context::getInstance();
if ($context->getProperty('editor.key') == 'tinyMCE') {
if ($suri['directive'] == '/owner/entry/post' || $suri['directive'] == '/owner/entry/edit') {
if ($context->getProperty('suri.directive') == '/owner/entry/post' || $suri['directive'] == '/owner/entry/edit') {
$target .= "\t<script type=\"text/javascript\" src=\"$pluginURL/tinymce/tinymce.min.js\"></script>\n";
$target .= "\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"$pluginURL/override.css\" />\n";
}
Expand Down
23 changes: 13 additions & 10 deletions plugins/ED_tinyMCE/tinymce/plugins/TTMLsupport/plugin.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Textcube editor support for tinyMCE 4
* Version 2.1.0.20140313
* Version 2.3.0.20150112
*
* Created : May 30, 2011
* Last modified : Mar 13, 2014
* Last modified : Jan 12, 2015
*
* Copyright 2011, 2014 Jeongkyu Shin <inureyes@gmail.com>
* Copyright 2011, 2015 Jeongkyu Shin <inureyes@gmail.com>
* Released under LGPL License.
*
*/
Expand Down Expand Up @@ -134,11 +134,10 @@ tinymce.create('tinymce.Textcube.TTMLsupport', {
var search = result[0];

var longDesc = ' longdesc="' + t.addQuot(t._htmlspecialchars(result[1])) + '" ';

// Avoid the bug
longDesc = longDesc.replaceAll("&lt;", "&amp;lt;");
longDesc = longDesc.replaceAll("&gt;", "&amp;gt;");

longDesc = longDesc.replaceAll("&lt;span id=&quot;CmCaReT&quot;&gt;&lt;/span&gt;", "");
longDesc = longDesc.replaceAll("&lt;", "&amp;lt;");
longDesc = longDesc.replaceAll("&gt;", "&amp;gt;");
var attributes = result[1].split("|");
var imageType = attributes[0];
if(t._isImageFile(attributes[1])) {
Expand Down Expand Up @@ -175,8 +174,9 @@ tinymce.create('tinymce.Textcube.TTMLsupport', {
var search = result[0];

var longDesc = ' longdesc="iMazing|' + t.addQuot(t._htmlspecialchars(result[1])) + '" ';

// Avoid the bug
longDesc = longDesc.replaceAll("&lt;span id=&quot;CmCaReT&quot;&gt;&lt;/span&gt;", "");

longDesc = longDesc.replaceAll("&lt;", "&amp;lt;");
longDesc = longDesc.replaceAll("&gt;", "&amp;gt;");

Expand All @@ -196,6 +196,8 @@ tinymce.create('tinymce.Textcube.TTMLsupport', {
var longDesc = ' longdesc="Gallery|' + t.addQuot(t._htmlspecialchars(result[1])) + '" ';

// Avoid the bug
longDesc = longDesc.replaceAll("&lt;span id=&quot;CmCaReT&quot;&gt;&lt;/span&gt;", "");

longDesc = longDesc.replaceAll("&lt;", "&amp;lt;");
longDesc = longDesc.replaceAll("&gt;", "&amp;gt;");

Expand All @@ -214,6 +216,7 @@ tinymce.create('tinymce.Textcube.TTMLsupport', {
var longDesc = ' longdesc="Jukebox|' + t.addQuot(t._htmlspecialchars(result[1])) + '" ';

// Avoid the bug
longDesc = longDesc.replaceAll("&lt;span id=&quot;CmCaReT&quot;&gt;&lt;/span&gt;", "");
longDesc = longDesc.replaceAll("&lt;", "&amp;lt;");
longDesc = longDesc.replaceAll("&gt;", "&amp;gt;");

Expand Down Expand Up @@ -1768,8 +1771,8 @@ tinymce.create('tinymce.Textcube.TTMLsupport', {
longname : 'TTML Support',
author : 'Jeongkyu Shin',
authorurl : 'http://www.textcube.org',
infourl : 'http://dev.textcube.org',
version : "2.1"
infourl : 'http://github.com/needlworks/textcube',
version : "2.3"
};
}
});
Expand Down

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion plugins/ED_tinyMCE/tinymce/plugins/codemirror/source.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@
editor.nodeChanged();
} catch (ex) {}
}

// Set cursor:
var el = editor.dom.select('span#CmCaReT')[0];
if (el) {
Expand Down

0 comments on commit 23f65a1

Please # to comment.