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:
-----
* Allow the Serendipity 2.0+ autosave(r) to work with this plugin textarea instances,

View file

@ -1,7 +1,7 @@
<?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
* @author Translator Name <yourmail@example.com>
* 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_INSTALL', '<h2>Installation</h2>
<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>
<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>

View file

@ -1,4 +1,6 @@
/* CKE plugin backend styles start */
.icon-ok:before{content:'\2714'}
.icon-error:before{content:'\26a0';}
.icon-attention:before{content:'\2757';}
@ -40,3 +42,5 @@
height: 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) {
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
//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. */
// 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
// 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
// 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
@ -76,7 +81,8 @@ CKEDITOR.editorConfig = function( config ) {
- Allow <pre[*attributes](*classes)> for custom attributes/classes in codesnippet code blocks
*/
// 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.
config.autoParagraph = false;
}

View file

@ -1,4 +1,6 @@
/* CKE plugin backend old styles start */
.msg_error,
.msg_success,
.msg_notice,
@ -31,3 +33,5 @@
border: 1px solid #aaa;
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;
color: #333;
background: #f8f8f8;
-webkit-text-size-adjust: none;
}
.hljs-comment,
.diff .hljs-header {
.hljs-quote {
color: #998;
font-style: italic;
}
.hljs-keyword,
.css .rule .hljs-keyword,
.hljs-winutils,
.nginx .hljs-title,
.hljs-subst,
.hljs-request,
.hljs-status {
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}
.hljs-number,
.hljs-hexcolor,
.ruby .hljs-constant {
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}
.hljs-string,
.hljs-tag .hljs-value,
.hljs-doctag,
.tex .hljs-formula {
.hljs-doctag {
color: #d14;
}
.hljs-title,
.hljs-id,
.scss .hljs-preprocessor {
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}
.hljs-list .hljs-keyword,
.hljs-subst {
font-weight: normal;
}
.hljs-class .hljs-title,
.hljs-type,
.vhdl .hljs-literal,
.tex .hljs-command {
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}
.hljs-tag,
.hljs-tag .hljs-title,
.hljs-rule .hljs-property,
.django .hljs-tag .hljs-keyword {
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}
.hljs-attribute,
.hljs-variable,
.lisp .hljs-body,
.hljs-name {
color: #008080;
}
.hljs-regexp {
.hljs-regexp,
.hljs-link {
color: #009926;
}
.hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.lisp .hljs-keyword,
.clojure .hljs-keyword,
.scheme .hljs-keyword,
.tex .hljs-special,
.hljs-prompt {
.hljs-bullet {
color: #990073;
}
.hljs-built_in {
.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}
.hljs-preprocessor,
.hljs-pragma,
.hljs-pi,
.hljs-doctype,
.hljs-shebang,
.hljs-cdata {
.hljs-meta {
color: #999;
font-weight: bold;
}
@ -126,10 +102,10 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
background: #dfd;
}
.diff .hljs-change {
background: #0086b3;
.hljs-emphasis {
font-style: italic;
}
.hljs-chunk {
color: #aaa;
.hljs-strong {
font-weight: bold;
}

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
<?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
* @author Translator Name <yourmail@example.com>
* 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_INSTALL', '<h2>Installation</h2>
<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>
<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>

View file

@ -1,7 +1,7 @@
<?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
* @author Translator Name <yourmail@example.com>
* 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_INSTALL', '<h2>Installation</h2>
<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>
<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>

View file

@ -4,13 +4,7 @@ if (IN_serendipity !== true) {
die ("Don't hack!");
}
// Probe for a language include with constants. Still include defines later on, if some constants were missing
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include_once dirname(__FILE__) . '/lang_en.inc.php';
@serendipity_plugin_api::load_language(dirname(__FILE__));
/**
* Class member instance attribute values
@ -55,28 +49,28 @@ class serendipity_event_ckeditor extends serendipity_event
* @access protected
* @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
* Verify release package versions - do update on upgrades!
* @var array
*/
protected $checkUpdateVersion = array('ckeditor:4.5.6.0');
protected $checkUpdateVersion = array('ckeditor:4.5.7.0');
/**
* Access property revisionPackage
* Note revisions of ckeditor and plugin additions to lang files
* @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: manually added codesnippet, fakeobjects, lineutils and widget plugins, 2015-12-11)',
'CKEditor-Plugin: procurator, v. 1.5 (Serendipity placeholder Plugin, 2014-10-10)',
'CKEditor-Plugin: cheatsheet, v. 1.2 (Serendipity CKE-Cheatsheet Plugin, 2014-09-02)',
'CKEditor-S9yCustomConfig, cke_config.js, v. 2.3, 2015-01-28',
'CKEditor-S9yCustomPlugins, cke_plugin.js, v. 1.9, 2015-01-01',
'CKEditor-S9yAddOn, fresh highlight.pack.js file v.8.8 and github styles in highlight.css, (https://highlightjs.org/) 2015-09-06',
'CKEditor-Plugin: manually added codesnippet, fakeobjects, lineutils and widget plugins, 2016-03-12)',
'CKEditor-Plugin: procurator, v. 1.6 (Serendipity placeholder Plugin, 2016-01-01)',
'CKEditor-Plugin: cheatsheet, v. 1.2 (Serendipity CKE-Cheatsheet Plugin, 2015-01-28)',
'CKEditor-S9yCustomConfig, cke_config.js, v. 2.5, 2016-01-01',
'CKEditor-S9yCustomPlugins, cke_plugin.js, v. 1.10, 2015-12-19',
'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)');
@ -182,7 +176,7 @@ class serendipity_event_ckeditor extends serendipity_event
$propbag->add('description', PLUGIN_EVENT_CKEDITOR_DESC);
$propbag->add('stackable', false);
$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('requirements', array(
'serendipity' => '1.7',
@ -348,6 +342,7 @@ class serendipity_event_ckeditor extends serendipity_event
* @access private
*/
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) {
$match = explode(':', $package);
$this->set_config('last_'.$match[0].'_version', $match[1]);
@ -360,6 +355,7 @@ class serendipity_event_ckeditor extends serendipity_event
* @return boolean
*/
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;
foreach(array_values($this->checkUpdateVersion) AS $package) {
$match = explode(':', $package);
@ -400,12 +396,14 @@ class serendipity_event_ckeditor extends serendipity_event
@rmdir(dir);
}
function event_hook($event, &$bag, &$eventData, $addData = null) {
function event_hook($event, &$bag, &$eventData, $addData = null)
{
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
case 'frontend_header':
@ -566,29 +564,21 @@ ol.linenums li {
$ckeplugin_frontpage_css = ob_get_contents();
ob_end_clean();
$eventData = $eventData . $ckeplugin_frontpage_css; // append CSS
$eventData .= $ckeplugin_frontpage_css; // append CSS
}
}
break;
break;
case 'css_backend':
?>
/* CKE styles start ----------------------------------------------------------------- */
<?php
// do not use in 2.0 versions
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')) {
echo file_get_contents(dirname(__FILE__) . '/cke_backend.css');
if (strpos($eventData, '.cke_config_block') === false) {
$eventData .= @file_get_contents(dirname(__FILE__) . '/cke_backend.css');
}
?>
/* CKE styles end ----------------------------------------------------------------- */
<?php
break;
@ -637,7 +627,7 @@ ol.linenums li {
$jebtnarr = (isset($eventData['buttons']) && (is_array($eventData['buttons']) && !empty($eventData['buttons']))) ? json_encode($eventData['buttons']) : 'null';
?>
<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; ?>);
</script>
<?php
@ -659,18 +649,19 @@ ol.linenums li {
</script>
<?php
}
} // end isset $eventData['item']
}
break;
default:
return false;
default:
return false;
}
return true;
} else {
return false;
}
}
}
?>