From 4d01f1d038029cf3630a267042bae59b808eee78 Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 25 Apr 2021 18:43:50 +0100 Subject: [PATCH 1/2] fix: classic editor button --- src/class/wysiwyg.php | 2 +- src/js/wysiwyg-editor.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/class/wysiwyg.php b/src/class/wysiwyg.php index f68ea8c..35e8613 100644 --- a/src/class/wysiwyg.php +++ b/src/class/wysiwyg.php @@ -74,7 +74,7 @@ class Footnotes_WYSIWYG { * @return array */ public static function include_scripts( $p_arr_plugins ) { - $p_arr_plugins[ Footnotes_Config::C_STR_PLUGIN_NAME ] = plugins_url( '/../js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', __FILE__ ); + $p_arr_plugins[ Footnotes_Config::C_STR_PLUGIN_NAME ] = plugins_url( 'js/wysiwyg-editor' . ( ( PRODUCTION_ENV ) ? '.min' : '' ) . '.js', dirname(__FILE__) ); return $p_arr_plugins; } diff --git a/src/js/wysiwyg-editor.js b/src/js/wysiwyg-editor.js index 5371271..6fa6b8a 100644 --- a/src/js/wysiwyg-editor.js +++ b/src/js/wysiwyg-editor.js @@ -31,7 +31,7 @@ success: function (data, textStatus, XMLHttpRequest) { var tags = JSON.parse(data); var returnText = tags.start + ed.selection.getContent() + tags.end; - ed.execCommand('insertHTML', true, returnText); + ed.insertContent(returnText); }, error: function (MLHttpRequest, textStatus, errorThrown) { console.log('Error: ' + errorThrown); From 85ba60f4a17a827b4509cb1543d62ffab9e420dd Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 25 Apr 2021 18:44:23 +0100 Subject: [PATCH 2/2] fix: call correct jQuery Tools file in dev env --- src/class/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/class/init.php b/src/class/init.php index 57f9f71..1179f3d 100644 --- a/src/class/init.php +++ b/src/class/init.php @@ -246,7 +246,7 @@ class Footnotes { */ wp_enqueue_script( 'mci-footnotes-jquery-tools', - plugins_url( 'footnotes/js/jquery.tools.min.js' ), + plugins_url( 'footnotes/js/jquery.tools' . ( (PRODUCTION_ENV) ? '.min' : '' ) . '.js' ), array(), '1.2.7.redacted.2', false