cke plugin 5.7.0

This will try to internally downgrade to 4.5.7.0 to follow versioning of CKEditor, which gets relevant with upcoming major upgrades.
This commit is contained in:
Ian 2016-03-12 17:01:36 +01:00
parent 182bee9d85
commit 8bef0db972
11 changed files with 85 additions and 93 deletions

View file

@ -1,3 +1,13 @@
5.7.0:
-----
* Allow the font awesome i(con) tag markup which also needed a little more
care in procurator (plugin) to prevent kursive replacements.
* Some minor internal cleanup and modernising.
* The Plugin versioning will change to 4.5.7.0 to follow ckeditor versioning
with next update!!
* Upgrade to CKEDITOR 4.5. Series, update 7 (http://ckeditor.com/whatsnew).
5.6.1: 5.6.1:
----- -----
* Allow the Serendipity 2.0+ autosave(r) to work with this plugin textarea instances, * Allow the Serendipity 2.0+ autosave(r) to work with this plugin textarea instances,

View file

@ -1,7 +1,7 @@
<?php <?php
/** /**
* @file UTF-8/lang_de.inc.php 1.4.12 2015-01-30 Ian * @file UTF-8/lang_de.inc.php 1.4.13 2016-02-06 Ian
* @version 1.4.12 * @version 1.4.12
* @author Translator Name <yourmail@example.com> * @author Translator Name <yourmail@example.com>
* DE-Revision: Revision of UTF-8/lang_de.inc.php * DE-Revision: Revision of UTF-8/lang_de.inc.php
@ -12,7 +12,7 @@
@define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>Das Plugin enthält:</h3>'); @define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>Das Plugin enthält:</h3>');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2> @define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2>
<p class="msg_notice"> <p class="msg_notice">
<span class="icon-attention"></span> <strong>Abhängigkeiten:</strong> Deaktiviere body, extended und nugget parsing global im <strong>NL2BR</strong> Plugin, <strong>oder</strong> per entry über das entryproperties event plugin <strong>und/oder</strong> für statische Seiten über die Entry "Textformatierungs" Option! <span class="icon-attention"></span> <strong>Abhängigkeiten:</strong> Deaktiviere body, extended und nugget parsing global im <strong>NL2BR</strong> Plugin, <strong>oder</strong> per entry über das entryproperties event plugin <strong>und/oder</strong> für statische Seiten über die Entry "Textformatierungs" Option! Seit Serendipity 2.0-rc1 sollte entryproperties den CKEditor diesbezüglich automatisch erkennen.
</p> </p>
<ol style="line-height: 1.6"> <ol style="line-height: 1.6">
<li>Um anderen Plugins Zugriff auf das Plugin oder dessen Hook zu gewähren, plaziere das (CKEditor) Plugin nahe dem Ende deiner Pluginliste.</li> <li>Um anderen Plugins Zugriff auf das Plugin oder dessen Hook zu gewähren, plaziere das (CKEditor) Plugin nahe dem Ende deiner Pluginliste.</li>

View file

@ -1,4 +1,6 @@
/* CKE plugin backend styles start */
.icon-ok:before{content:'\2714'} .icon-ok:before{content:'\2714'}
.icon-error:before{content:'\26a0';} .icon-error:before{content:'\26a0';}
.icon-attention:before{content:'\2757';} .icon-attention:before{content:'\2757';}
@ -40,3 +42,5 @@
height: 0px; height: 0px;
width: 0px; width: 0px;
} }
/* CKE plugin backend styles end */

View file

@ -3,7 +3,7 @@
*/ */
/** /**
* @fileOverview A Serendipity serendipity_event_ckeditor CKEDITOR custom config file: cke_config.js, v. 2.4, 2015-08-14 * @fileOverview A Serendipity serendipity_event_ckeditor CKEDITOR custom config file: cke_config.js, v. 2.5, 2016-01-01
*/ */
/** /**
@ -42,8 +42,11 @@ CKEDITOR.editorConfig = function( config ) {
*/ */
if (CKECONFIG_ACF_OFF === true) { if (CKECONFIG_ACF_OFF === true) {
config.allowedContent = CKECONFIG_ACF_OFF; config.allowedContent = CKECONFIG_ACF_OFF;
// <i (awesome icon tags) need a special care for emptyness!
CKEDITOR.dtd.$removeEmpty['i'] = false; // dtd seems to have NO effect and is not in need, when using config.allowedContent, config.protectedSource.push and config.extraAllowedContent !
} else { // this is ACF ON by default } else { // this is ACF ON by default
//CKEDITOR.dtd.$removeEmpty['i'] = false; // special case, since <i> is internally as well recognized as italic and parsed to <em> tag if not excluded in procurator !
/** List of regular expressions to be executed on ***input HTML***, indicating HTML source code, that, when matched, must not be available in the WYSIWYG mode for editing. */ /** List of regular expressions to be executed on ***input HTML***, indicating HTML source code, that, when matched, must not be available in the WYSIWYG mode for editing. */
// allow <script> tags // allow <script> tags
@ -54,6 +57,8 @@ CKEDITOR.editorConfig = function( config ) {
//config.protectedSource.push( /\{[a-zA-Z\$].*?\}/gi ); // Smarty markup protection disabled, since now being usable w/o setting ACF OFF //config.protectedSource.push( /\{[a-zA-Z\$].*?\}/gi ); // Smarty markup protection disabled, since now being usable w/o setting ACF OFF
// allow WP like [[mytag]] [[{$mytag}]] widget tags with >= 4.4.1 for an imaginable markup replacements S9y plugin // allow WP like [[mytag]] [[{$mytag}]] widget tags with >= 4.4.1 for an imaginable markup replacements S9y plugin
//config.protectedSource.push(/\[\[([^\[\]])+\]\]/g); // WP-Smarty like markup protection disabled, since now being usable w/o setting ACF OFF //config.protectedSource.push(/\[\[([^\[\]])+\]\]/g); // WP-Smarty like markup protection disabled, since now being usable w/o setting ACF OFF
// allow font awesome <i></i> tags to be protected against ACF by switching mode !
config.protectedSource.push( /<i[^>]*><\/i>/g );
/** /**
CKEDITOR.protectedSource patterns used regex Escape sequences CKEDITOR.protectedSource patterns used regex Escape sequences
@ -76,7 +81,8 @@ CKEDITOR.editorConfig = function( config ) {
- Allow <pre[*attributes](*classes)> for custom attributes/classes in codesnippet code blocks - Allow <pre[*attributes](*classes)> for custom attributes/classes in codesnippet code blocks
*/ */
// protect tags // protect tags
config.extraAllowedContent = 'mediainsert[*]{*}(*);gallery[*]{*}(*);media[*]{*}(*);script[*]{*}(*);audio[*]{*}(*);video[*];source[*];div[*]{*}(*);span[*]{*}(*);img[height,width];pre[*](*);'; config.extraAllowedContent = 'mediainsert[*]{*}(*);gallery[*]{*}(*);media[*]{*}(*);script[*]{*}(*);audio[*]{*}(*);video[*];source[*];div[*]{*}(*);span[*]{*}(*);img[height,width];pre[*](*);i(*);';
// do not use auto paragraphs added to these allowed tags. // do not use auto paragraphs added to these allowed tags.
config.autoParagraph = false; config.autoParagraph = false;
} }

View file

@ -1,4 +1,6 @@
/* CKE plugin backend old styles start */
.msg_error, .msg_error,
.msg_success, .msg_success,
.msg_notice, .msg_notice,
@ -31,3 +33,5 @@
border: 1px solid #aaa; border: 1px solid #aaa;
color: #777; color: #777;
} }
/* CKE plugin backend old styles end */

View file

@ -22,98 +22,74 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
padding: 0.5em; padding: 0.5em;
color: #333; color: #333;
background: #f8f8f8; background: #f8f8f8;
-webkit-text-size-adjust: none;
} }
.hljs-comment, .hljs-comment,
.diff .hljs-header { .hljs-quote {
color: #998; color: #998;
font-style: italic; font-style: italic;
} }
.hljs-keyword, .hljs-keyword,
.css .rule .hljs-keyword, .hljs-selector-tag,
.hljs-winutils, .hljs-subst {
.nginx .hljs-title,
.hljs-subst,
.hljs-request,
.hljs-status {
color: #333; color: #333;
font-weight: bold; font-weight: bold;
} }
.hljs-number, .hljs-number,
.hljs-hexcolor, .hljs-literal,
.ruby .hljs-constant { .hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080; color: #008080;
} }
.hljs-string, .hljs-string,
.hljs-tag .hljs-value, .hljs-doctag {
.hljs-doctag,
.tex .hljs-formula {
color: #d14; color: #d14;
} }
.hljs-title, .hljs-title,
.hljs-id, .hljs-section,
.scss .hljs-preprocessor { .hljs-selector-id {
color: #900; color: #900;
font-weight: bold; font-weight: bold;
} }
.hljs-list .hljs-keyword,
.hljs-subst { .hljs-subst {
font-weight: normal; font-weight: normal;
} }
.hljs-class .hljs-title,
.hljs-type, .hljs-type,
.vhdl .hljs-literal, .hljs-class .hljs-title {
.tex .hljs-command {
color: #458; color: #458;
font-weight: bold; font-weight: bold;
} }
.hljs-tag, .hljs-tag,
.hljs-tag .hljs-title, .hljs-name,
.hljs-rule .hljs-property, .hljs-attribute {
.django .hljs-tag .hljs-keyword {
color: #000080; color: #000080;
font-weight: normal; font-weight: normal;
} }
.hljs-attribute, .hljs-regexp,
.hljs-variable, .hljs-link {
.lisp .hljs-body,
.hljs-name {
color: #008080;
}
.hljs-regexp {
color: #009926; color: #009926;
} }
.hljs-symbol, .hljs-symbol,
.ruby .hljs-symbol .hljs-string, .hljs-bullet {
.lisp .hljs-keyword,
.clojure .hljs-keyword,
.scheme .hljs-keyword,
.tex .hljs-special,
.hljs-prompt {
color: #990073; color: #990073;
} }
.hljs-built_in { .hljs-built_in,
.hljs-builtin-name {
color: #0086b3; color: #0086b3;
} }
.hljs-preprocessor, .hljs-meta {
.hljs-pragma,
.hljs-pi,
.hljs-doctype,
.hljs-shebang,
.hljs-cdata {
color: #999; color: #999;
font-weight: bold; font-weight: bold;
} }
@ -126,10 +102,10 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
background: #dfd; background: #dfd;
} }
.diff .hljs-change { .hljs-emphasis {
background: #0086b3; font-style: italic;
} }
.hljs-chunk { .hljs-strong {
color: #aaa; font-weight: bold;
} }

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
<?php <?php
/** /**
* @file lang_de.inc.php 1.4.12 2015-01-30 Ian * @file lang_de.inc.php 1.4.13 2016-02-06 Ian
* @version 1.4.12 * @version 1.4.12
* @author Translator Name <yourmail@example.com> * @author Translator Name <yourmail@example.com>
* DE-Revision: Revision of lang_de.inc.php * DE-Revision: Revision of lang_de.inc.php
@ -12,7 +12,7 @@
@define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>Das Plugin enthält:</h3>'); @define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>Das Plugin enthält:</h3>');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2> @define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2>
<p class="msg_notice"> <p class="msg_notice">
<span class="icon-attention"></span> <strong>Abhängigkeiten:</strong> Deaktiviere body, extended und nugget global im <strong>NL2BR</strong> Plugin, <strong>oder</strong> per entry über das entryproperties event plugin <strong>und/oder</strong> für statische Seiten über die Entry "Textformatierungs" Option! <span class="icon-attention"></span> <strong>Abhängigkeiten:</strong> Deaktiviere body, extended und nugget global im <strong>NL2BR</strong> Plugin, <strong>oder</strong> per entry über das entryproperties event plugin <strong>und/oder</strong> für statische Seiten über die Entry "Textformatierungs" Option! Seit Serendipity 2.0-rc1 sollte entryproperties den CKEditor diesbezüglich automatisch erkennen.
</p> </p>
<ol style="line-height: 1.6"> <ol style="line-height: 1.6">
<li>Um anderen Plugins Zugriff auf das Plugin oder dessen Hook zu gewähren, plaziere das (CKEditor) Plugin nahe dem Ende deiner Pluginliste.</li> <li>Um anderen Plugins Zugriff auf das Plugin oder dessen Hook zu gewähren, plaziere das (CKEditor) Plugin nahe dem Ende deiner Pluginliste.</li>

View file

@ -1,7 +1,7 @@
<?php <?php
/** /**
* @file lang_en.inc.php 1.4.12 2015-01-30 Ian * @file lang_en.inc.php 1.4.13 2016-02-06 Ian
* @version 1.4.12 * @version 1.4.12
* @author Translator Name <yourmail@example.com> * @author Translator Name <yourmail@example.com>
* EN-Revision: Revision of lang_en.inc.php * EN-Revision: Revision of lang_en.inc.php
@ -12,7 +12,7 @@
@define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>This Plugin includes:</h3>'); @define('PLUGIN_EVENT_CKEDITOR_REVISION_TITLE', '<h3>This Plugin includes:</h3>');
@define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2> @define('PLUGIN_EVENT_CKEDITOR_INSTALL', '<h2>Installation</h2>
<p class="msg_notice"> <p class="msg_notice">
<span class="icon-attention"></span> <strong>Dependencies:</strong> Disable global body, extended and nugget parsing in the <strong>NL2BR</strong> plugin, <strong>OR</strong> by entry with entryproperties event plugin <strong>and/or</strong> for staticpages by entry "Perform Markup Transformations" option! <span class="icon-attention"></span> <strong>Dependencies:</strong> Disable global body, extended and nugget parsing in the <strong>NL2BR</strong> plugin, <strong>OR</strong> by entry with entryproperties event plugin <strong>and/or</strong> for staticpages by entry "Perform Markup Transformations" option! Since Serendipity 2.0-rc1 the entryproperties plugin should detect CKEditor automatically as to that.
</p> </p>
<ol style="line-height: 1.6"> <ol style="line-height: 1.6">
<li>To allow other plugins to use or hook into the editor, place this (CKEditor) plugin near the end of your plugin list.</li> <li>To allow other plugins to use or hook into the editor, place this (CKEditor) plugin near the end of your plugin list.</li>

View file

@ -4,13 +4,7 @@ if (IN_serendipity !== true) {
die ("Don't hack!"); die ("Don't hack!");
} }
// Probe for a language include with constants. Still include defines later on, if some constants were missing @serendipity_plugin_api::load_language(dirname(__FILE__));
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include_once dirname(__FILE__) . '/lang_en.inc.php';
/** /**
* Class member instance attribute values * Class member instance attribute values
@ -55,28 +49,28 @@ class serendipity_event_ckeditor extends serendipity_event
* @access protected * @access protected
* @var string * @var string
*/ */
protected $cke_zipfile = 'ckeditor_4.5.6.0-plus.zip'; protected $cke_zipfile = 'ckeditor_4.5.7.0-plus.zip';
/** /**
* Access property checkUpdateVersion * Access property checkUpdateVersion
* Verify release package versions - do update on upgrades! * Verify release package versions - do update on upgrades!
* @var array * @var array
*/ */
protected $checkUpdateVersion = array('ckeditor:4.5.6.0'); protected $checkUpdateVersion = array('ckeditor:4.5.7.0');
/** /**
* Access property revisionPackage * Access property revisionPackage
* Note revisions of ckeditor and plugin additions to lang files * Note revisions of ckeditor and plugin additions to lang files
* @var array * @var array
*/ */
protected $revisionPackage = array('CKEditor 4.5.6 (revision 91e81fe, full package, 2015-12-11)', protected $revisionPackage = array('CKEditor 4.5.7 (revision e98277f, full package, 2016-03-12)',
'CKEditor-Plugin: mediaembed, v. 0.6+ (https://github.com/frozeman/MediaEmbed, 2014-03-13)', 'CKEditor-Plugin: mediaembed, v. 0.6+ (https://github.com/frozeman/MediaEmbed, 2014-03-13)',
'CKEditor-Plugin: manually added codesnippet, fakeobjects, lineutils and widget plugins, 2015-12-11)', 'CKEditor-Plugin: manually added codesnippet, fakeobjects, lineutils and widget plugins, 2016-03-12)',
'CKEditor-Plugin: procurator, v. 1.5 (Serendipity placeholder Plugin, 2014-10-10)', 'CKEditor-Plugin: procurator, v. 1.6 (Serendipity placeholder Plugin, 2016-01-01)',
'CKEditor-Plugin: cheatsheet, v. 1.2 (Serendipity CKE-Cheatsheet Plugin, 2014-09-02)', 'CKEditor-Plugin: cheatsheet, v. 1.2 (Serendipity CKE-Cheatsheet Plugin, 2015-01-28)',
'CKEditor-S9yCustomConfig, cke_config.js, v. 2.3, 2015-01-28', 'CKEditor-S9yCustomConfig, cke_config.js, v. 2.5, 2016-01-01',
'CKEditor-S9yCustomPlugins, cke_plugin.js, v. 1.9, 2015-01-01', 'CKEditor-S9yCustomPlugins, cke_plugin.js, v. 1.10, 2015-12-19',
'CKEditor-S9yAddOn, fresh highlight.pack.js file v.8.8 and github styles in highlight.css, (https://highlightjs.org/) 2015-09-06', 'CKEditor-S9yAddOn, fresh highlight.pack.js file v. 9.2.0 and github styles in highlight.css, (https://highlightjs.org/) 2016-03-12',
'Prettify: JS & CSS files, v. "current", (http://code.google.com/p/google-code-prettify/, 2013-03-04)'); 'Prettify: JS & CSS files, v. "current", (http://code.google.com/p/google-code-prettify/, 2013-03-04)');
@ -182,7 +176,7 @@ class serendipity_event_ckeditor extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_CKEDITOR_DESC); $propbag->add('description', PLUGIN_EVENT_CKEDITOR_DESC);
$propbag->add('stackable', false); $propbag->add('stackable', false);
$propbag->add('author', 'Rustam Abdullaev, Ian'); $propbag->add('author', 'Rustam Abdullaev, Ian');
$propbag->add('version', '5.6.1'); // is CKEDITOR Series 4 (hidden) - revision .5.6 - and appended plugin revision .1 $propbag->add('version', '5.7.0'); // is CKEDITOR Series 4 (hidden) - revision .5.6 - and appended plugin revision .1 // this will change to 4.5.7.0 to follow ckeditor versioning with next update!!
$propbag->add('copyright', 'GPL or LGPL License'); $propbag->add('copyright', 'GPL or LGPL License');
$propbag->add('requirements', array( $propbag->add('requirements', array(
'serendipity' => '1.7', 'serendipity' => '1.7',
@ -348,6 +342,7 @@ class serendipity_event_ckeditor extends serendipity_event
* @access private * @access private
*/ */
private function updateTableZip() { private function updateTableZip() {
if ($this->get_config('version') == '5.7.0') $this->set_config('version', '4.5.7.0'); // temporary downgrade of version to keep track with CKE versioning for next major upgrade!
foreach(array_values($this->checkUpdateVersion) AS $package) { foreach(array_values($this->checkUpdateVersion) AS $package) {
$match = explode(':', $package); $match = explode(':', $package);
$this->set_config('last_'.$match[0].'_version', $match[1]); $this->set_config('last_'.$match[0].'_version', $match[1]);
@ -360,6 +355,7 @@ class serendipity_event_ckeditor extends serendipity_event
* @return boolean * @return boolean
*/ */
private function checkUpdate() { private function checkUpdate() {
if ($this->get_config('version') == '5.7.0') $this->set_config('version', '4.5.7.0'); // temporary downgrade of version to keep track with CKE versioning for next major upgrade!
$doupdate = false; $doupdate = false;
foreach(array_values($this->checkUpdateVersion) AS $package) { foreach(array_values($this->checkUpdateVersion) AS $package) {
$match = explode(':', $package); $match = explode(':', $package);
@ -400,12 +396,14 @@ class serendipity_event_ckeditor extends serendipity_event
@rmdir(dir); @rmdir(dir);
} }
function event_hook($event, &$bag, &$eventData, $addData = null) { function event_hook($event, &$bag, &$eventData, $addData = null)
{
global $serendipity; global $serendipity;
$hooks = &$bag->get('event_hooks'); $hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) { if (isset($hooks[$event])) {
switch($event) { switch($event) {
case 'frontend_header': case 'frontend_header':
@ -566,29 +564,21 @@ ol.linenums li {
$ckeplugin_frontpage_css = ob_get_contents(); $ckeplugin_frontpage_css = ob_get_contents();
ob_end_clean(); ob_end_clean();
$eventData = $eventData . $ckeplugin_frontpage_css; // append CSS $eventData .= $ckeplugin_frontpage_css; // append CSS
} }
} }
break; break;
case 'css_backend': case 'css_backend':
?>
/* CKE styles start ----------------------------------------------------------------- */
<?php
// do not use in 2.0 versions // do not use in 2.0 versions
if ($serendipity['version'][0] < 2) { if ($serendipity['version'][0] < 2) {
echo file_get_contents(dirname(__FILE__) . '/cke_olds9y.css'); $eventData .= @file_get_contents(dirname(__FILE__) . '/cke_olds9y.css');
} }
if (!strpos($eventData, '.cke_config_block')) { if (strpos($eventData, '.cke_config_block') === false) {
echo file_get_contents(dirname(__FILE__) . '/cke_backend.css'); $eventData .= @file_get_contents(dirname(__FILE__) . '/cke_backend.css');
} }
?>
/* CKE styles end ----------------------------------------------------------------- */
<?php
break; break;
@ -637,7 +627,7 @@ ol.linenums li {
$jebtnarr = (isset($eventData['buttons']) && (is_array($eventData['buttons']) && !empty($eventData['buttons']))) ? json_encode($eventData['buttons']) : 'null'; $jebtnarr = (isset($eventData['buttons']) && (is_array($eventData['buttons']) && !empty($eventData['buttons']))) ? json_encode($eventData['buttons']) : 'null';
?> ?>
<script type="text/javascript"> <script type="text/javascript">
s9ypluginbuttons.push("<?php echo $addB; ?>"); if (typeof s9ypluginbuttons !== 'undefined') s9ypluginbuttons.push("<?php echo $addB; ?>");
if (window.Spawnnuggets) Spawnnuggets('<?php echo $eventData['item']; ?>', 'entryforms<?php echo $eventData['jsname']; ?>', <?php echo $jebtnarr; ?>); if (window.Spawnnuggets) Spawnnuggets('<?php echo $eventData['item']; ?>', 'entryforms<?php echo $eventData['jsname']; ?>', <?php echo $jebtnarr; ?>);
</script> </script>
<?php <?php
@ -659,18 +649,19 @@ ol.linenums li {
</script> </script>
<?php <?php
} }
} // end isset $eventData['item'] }
break; break;
default: default:
return false; return false;
}
}
return true;
} else { } else {
return false; return false;
} }
} }
} }
?> ?>