From fbfcd501a81abdf30a30671bff964e82cb9e08a1 Mon Sep 17 00:00:00 2001 From: Dimasites Date: Thu, 7 Nov 2024 03:36:52 +0300 Subject: [PATCH] CKEditor 1.4.7 (draft) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit == - Old HTML elements replaced to actual by default in new (and only new) pasted or typed content. - • replaced to tag (thanks @dimasites) - • replaced to tag - Improved MODX3 support: fixed search by pagetitle in "paste link" dialog --- _build/ckeditor/build.config.php | 6 ++-- _build/ckeditor/build.transport.php | 27 ++++++++++++----- .../{ => other}/transport.plugin.events.php | 0 .../data/{ => other}/transport.settings.php | 0 .../transport.settings_install.php | 0 .../{ => other}/transport.settings_update.php | 0 .../resource/editorsearch.class.php | 0 .../{ => resolvers}/modappstat.resolver.php | 0 .../{ => resolvers}/transport.resolver.php | 0 .../ckeditor/documents/changelog.txt | 7 +++-- .../components/ckeditor/ckeditor/ckeditor.js | 6 ++-- .../ckeditor/plugins/link/dialogs/link.js | 30 ++++++++++++------- 12 files changed, 49 insertions(+), 27 deletions(-) rename _build/ckeditor/data/{ => other}/transport.plugin.events.php (100%) rename _build/ckeditor/data/{ => other}/transport.settings.php (100%) rename _build/ckeditor/data/{ => other}/transport.settings_install.php (100%) rename _build/ckeditor/data/{ => other}/transport.settings_update.php (100%) rename {core/model/modx => _build/ckeditor/data}/processors/resource/editorsearch.class.php (100%) rename _build/ckeditor/data/{ => resolvers}/modappstat.resolver.php (100%) rename _build/ckeditor/data/{ => resolvers}/transport.resolver.php (100%) diff --git a/_build/ckeditor/build.config.php b/_build/ckeditor/build.config.php index 8d04de4..e58b94d 100644 --- a/_build/ckeditor/build.config.php +++ b/_build/ckeditor/build.config.php @@ -4,8 +4,10 @@ define('PKG_NAME_LOWER', strtolower(PKG_NAME)); define('PKG_NAMESPACE','ckeditor'); -define('PKG_VERSION','1.4.6'); -define('PKG_RELEASE','pl'); +define('PKG_VERSION','1.4.7'); +//TODO remove system settings when package removed or ask user for full replace +//TODO check b and em tag replacement! +define('PKG_RELEASE','dev16'); if (isset($_SERVER['MODX_BASE_PATH'])) { define('MODX_BASE_PATH', $_SERVER['MODX_BASE_PATH']); } elseif (file_exists(dirname(__FILE__ ,3) . '/core')) { diff --git a/_build/ckeditor/build.transport.php b/_build/ckeditor/build.transport.php index 60ebb0b..a624bab 100644 --- a/_build/ckeditor/build.transport.php +++ b/_build/ckeditor/build.transport.php @@ -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/', @@ -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); @@ -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' )); diff --git a/_build/ckeditor/data/transport.plugin.events.php b/_build/ckeditor/data/other/transport.plugin.events.php similarity index 100% rename from _build/ckeditor/data/transport.plugin.events.php rename to _build/ckeditor/data/other/transport.plugin.events.php diff --git a/_build/ckeditor/data/transport.settings.php b/_build/ckeditor/data/other/transport.settings.php similarity index 100% rename from _build/ckeditor/data/transport.settings.php rename to _build/ckeditor/data/other/transport.settings.php diff --git a/_build/ckeditor/data/transport.settings_install.php b/_build/ckeditor/data/other/transport.settings_install.php similarity index 100% rename from _build/ckeditor/data/transport.settings_install.php rename to _build/ckeditor/data/other/transport.settings_install.php diff --git a/_build/ckeditor/data/transport.settings_update.php b/_build/ckeditor/data/other/transport.settings_update.php similarity index 100% rename from _build/ckeditor/data/transport.settings_update.php rename to _build/ckeditor/data/other/transport.settings_update.php diff --git a/core/model/modx/processors/resource/editorsearch.class.php b/_build/ckeditor/data/processors/resource/editorsearch.class.php similarity index 100% rename from core/model/modx/processors/resource/editorsearch.class.php rename to _build/ckeditor/data/processors/resource/editorsearch.class.php diff --git a/_build/ckeditor/data/modappstat.resolver.php b/_build/ckeditor/data/resolvers/modappstat.resolver.php similarity index 100% rename from _build/ckeditor/data/modappstat.resolver.php rename to _build/ckeditor/data/resolvers/modappstat.resolver.php diff --git a/_build/ckeditor/data/transport.resolver.php b/_build/ckeditor/data/resolvers/transport.resolver.php similarity index 100% rename from _build/ckeditor/data/transport.resolver.php rename to _build/ckeditor/data/resolvers/transport.resolver.php diff --git a/core/components/ckeditor/documents/changelog.txt b/core/components/ckeditor/documents/changelog.txt index b8337a9..036ae5a 100644 --- a/core/components/ckeditor/documents/changelog.txt +++ b/core/components/ckeditor/documents/changelog.txt @@ -1,10 +1,11 @@ Changelog for CKEditor integration into MODx Revolution. -CKEditor 1.4.7 (draft) +CKEditor 1.4.7 (draft 2024.11.07) ==================================== - Old HTML elements replaced to actual by default in new (and only new) pasted or typed content. -- - replaced to tag (thanks @dimasites) -- - replaced to tag +- • replaced to tag (thanks @dimasites) +- • replaced to tag +- Improved MODX3 support: fixed search by pagetitle in "paste link" dialog CKEditor 1.4.6 (2024.07.03) ==================================== diff --git a/manager/assets/components/ckeditor/ckeditor/ckeditor.js b/manager/assets/components/ckeditor/ckeditor/ckeditor.js index a785d61..ec48315 100644 --- a/manager/assets/components/ckeditor/ckeditor/ckeditor.js +++ b/manager/assets/components/ckeditor/ckeditor/ckeditor.js @@ -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, @@ -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"}; diff --git a/manager/assets/components/ckeditor/ckeditor/plugins/link/dialogs/link.js b/manager/assets/components/ckeditor/ckeditor/plugins/link/dialogs/link.js index 93c59a0..c07ccb2 100644 --- a/manager/assets/components/ckeditor/ckeditor/plugins/link/dialogs/link.js +++ b/manager/assets/components/ckeditor/ckeditor/plugins/link/dialogs/link.js @@ -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 || "") @@ -221,7 +221,7 @@ let link_div, setup: function() { this.getDialog().getContentElement("info", "linkType") || this.getElement().show() } - }, + }, { type: "vbox", id: "find_res_line", @@ -229,12 +229,18 @@ let link_div, ], 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() { @@ -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' @@ -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(); } @@ -328,7 +336,7 @@ let link_div, label: g.browseServer } ], - }, + }, ] }, { type: "vbox", @@ -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; @@ -876,4 +884,4 @@ function lazyVal(_val) { link_div.setValue(_val) let fres = document.getElementById('input-res_id'); fres.focus() -} \ No newline at end of file +}