Skip to content

Commit

Permalink
CKEditor 1.4.7 (2024.11.07)
Browse files Browse the repository at this point in the history
==
- Old HTML elements replaced to actual by default in new (and only new) pasted or typed content.
- • <strong> replaced to <b> tag (thanks @dimasites)
- • <em> replaced to <i> tag
- Improved MODX3 support: fixed search by pagetitle in "paste link" dialog
  • Loading branch information
dimasites committed Nov 7, 2024
1 parent 03f27b0 commit 38840e8
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 26 deletions.
3 changes: 2 additions & 1 deletion _build/ckeditor/build.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
define('PKG_NAME_LOWER', strtolower(PKG_NAME));

define('PKG_NAMESPACE','ckeditor');
define('PKG_VERSION','1.4.6');
define('PKG_VERSION','1.4.7');
//TODO remove system settings when package removed or ask user for full replace
define('PKG_RELEASE','pl');
if (isset($_SERVER['MODX_BASE_PATH'])) {
define('MODX_BASE_PATH', $_SERVER['MODX_BASE_PATH']);
Expand Down
27 changes: 19 additions & 8 deletions _build/ckeditor/build.transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
$sources = array(
'root' => $root,
'build' => $root . '_build/'. PKG_NAME_LOWER .'/',
'data' => $root . '_build/'. PKG_NAME_LOWER .'/data/',
'processors' => $root . 'core/model/modx/processors/resource/',
'data' => $root . '_build/'. PKG_NAME_LOWER .'/data/other/',
'resolvers' => $root . '_build/'. PKG_NAME_LOWER .'/data/resolvers/',
'processors' => $root . '_build/'. PKG_NAME_LOWER .'/data/processors/resource/',//last folder from here will be created in file structure, cant target to root ./processors/ dir. TODO find reason and fix it.
'lexicon' => $root . 'core/components/'.PKG_NAMESPACE.'/lexicon/',
'documents' => $root.'core/components/'.PKG_NAMESPACE.'/documents/',
'elements' => $root.'core/components/'.PKG_NAMESPACE.'/elements/',
Expand All @@ -33,6 +34,12 @@
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); flush();

$modx_version = $modx->getVersionData();
$modx3 = false;
if ($modx_version['version'] == 3) {
$modx3 = true;
}

$modx->loadClass('transport.modPackageBuilder','',false, true);
$builder = new modPackageBuilder($modx);
$builder->createPackage(PKG_NAMESPACE,PKG_VERSION,PKG_RELEASE);
Expand Down Expand Up @@ -83,22 +90,26 @@
'target' => "return MODX_MANAGER_PATH . 'assets/components/';",
));

$vehicle->resolve('file',array(
'source' => $sources['processors'],
'target' => "return MODX_CORE_PATH . 'model/modx/processors/ckeditor/';",
));
if (!$modx3){
$vehicle->resolve('file',array(
'source' => $sources['processors'],
'target' => "return MODX_CORE_PATH . 'model/modx/processors/ckeditor/';",
));
//TODO clean folder model/modx/processors/ckeditor/ on MODX3 because wrong installer in 1.4.6 and prev versions.
//May be needed only when uninstall or update package...
}

$vehicle->resolve('file',array(
'source' => $sources['source_core'],
'target' => "return MODX_CORE_PATH . 'components/';",
));
$vehicle->resolve('php',array(
'source' => $sources['data'].'transport.resolver.php',
'source' => $sources['resolvers'].'transport.resolver.php',
'name' => 'resolve',
'type' => 'php'
));
$vehicle->resolve('php',array(
'source' => $sources['data'].'modappstat.resolver.php',
'source' => $sources['resolvers'].'modappstat.resolver.php',
'name' => 'modappstat',
'type' => 'php'
));
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions core/components/ckeditor/documents/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Changelog for CKEditor integration into MODx Revolution.

CKEditor 1.4.7 (draft)
CKEditor 1.4.7 (2024.11.07)
====================================
- Old HTML elements replaced to actual by default in new (and only new) pasted or typed content.
- - <strong> replaced to <b> tag (thanks @dimasites)
- - <em> replaced to <i> tag
- • <strong> replaced to <b> tag (thanks @dimasites)
- • <em> replaced to <i> tag
- Improved MODX3 support: fixed search by pagetitle in "paste link" dialog

CKEditor 1.4.6 (2024.07.03)
====================================
Expand Down
6 changes: 3 additions & 3 deletions manager/assets/components/ckeditor/ckeditor/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For licensing, see LICENSE.md or http://ckeditor.com/license
if (window.CKEDITOR && window.CKEDITOR.dom) return;
window.CKEDITOR || (window.CKEDITOR = function () {
var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i, d = {
timestamp: "1.4.6-pl",
timestamp: "1.4.7-pl",
version: "4.8.0",
revision: "230f715",
rnd: Math.floor(900 * Math.random()) + 100,
Expand Down Expand Up @@ -12124,8 +12124,8 @@ For licensing, see LICENSE.md or http://ckeditor.com/license
c.setKeystroke([[CKEDITOR.CTRL + 66, "bold"], [CKEDITOR.CTRL + 73, "italic"], [CKEDITOR.CTRL + 85, "underline"]])
}
});
CKEDITOR.config.coreStyles_bold = {element: "b", overrides: "strong"};
CKEDITOR.config.coreStyles_italic = {element: "i", overrides: "em"};
CKEDITOR.config.coreStyles_bold = {element: "b"};
CKEDITOR.config.coreStyles_italic = {element: "i"};
CKEDITOR.config.coreStyles_underline = {element: "u"};
CKEDITOR.config.coreStyles_strike = {element: "s", overrides: "strike"};
CKEDITOR.config.coreStyles_subscript = {element: "sub"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ let link_div,
a.url.url = a.url.url.replace(/\[\[~|\]\]/gi, '')
if (f['0'] == '[[~') {
_act = false
}
}

} else {
a.url && this.setValue(a.url.protocol || "")
Expand Down Expand Up @@ -221,20 +221,26 @@ let link_div,
setup: function() {
this.getDialog().getContentElement("info", "linkType") || this.getElement().show()
}
},
},
{
type: "vbox",
id: "find_res_line",
children: [
],
setup: function(a) {
if (link_div != null) {
link_div.destroy()

link_div.destroy();
}
let _parent = document.getElementById(this.domId)
_parent.classList.add('res-list')

let _parent = document.getElementById(this.domId);
_parent.classList.add('res-list');
link_input.render = this.domId;

let editorSearchProcessor = 'ckeditor/resource/editorsearch';//for MODX2
if (MODx.config.version.startsWith('3.')){
editorSearchProcessor = 'Resource/GetList';
}

Ext.onReady(
function() {

Expand All @@ -253,14 +259,16 @@ let link_div,
,layout: 'anchor'
,listEmptyText: ''
,width: '100%'
//TODO size attr change from 24 to 65 or add style width:100% for best UX and fix crop long pagetitle in search input
,allowBlank : false
,typeAhead: true
,editable: true
,minChars: 0
,baseParams: {
action: 'ckeditor/resource/editorsearch',
action: editorSearchProcessor,
parent: config.parent,
type: 'list',
//limit: 0,
}
,mode: 'remote'
,displayField: 'pagetitle'
Expand Down Expand Up @@ -296,7 +304,7 @@ let link_div,
};
Ext.extend(MODx.ux.CKEditor.FindRes, MODx.combo.ComboBox);
Ext.reg('doodle-combo-res', MODx.ux.CKEditor.FindRes);

link_div = MODx.load({ xtype: "doodle-combo-res"});
link_div.show();
}
Expand Down Expand Up @@ -328,7 +336,7 @@ let link_div,
label: g.browseServer
}
],
},
},
]
}, {
type: "vbox",
Expand Down Expand Up @@ -821,7 +829,7 @@ let link_div,
if (a.url.protocol == '[[~') {
g.set.href = g.set.href +']]';
g.set['data-cke-saved-href'] = g.set['data-cke-saved-href'] +']]';
}
}
h.setAttributes(g.set);
h.removeAttributes(g.removed);
if (a.linkText && q != a.linkText) e = a.linkText;
Expand Down Expand Up @@ -876,4 +884,4 @@ function lazyVal(_val) {
link_div.setValue(_val)
let fres = document.getElementById('input-res_id');
fres.focus()
}
}

0 comments on commit 38840e8

Please sign in to comment.