Skip to content

Commit 5569c19

Browse files
committed
AC-229: Upgrade and remove tinymce4
- Fix static tests
1 parent bc9b279 commit 5569c19

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentovariable/editor_plugin.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ define([
1919
* Initialize editor plugin.
2020
*
2121
* @param {tinymce.editor} editor - Editor instance that the plugin is initialized in.
22-
* @param {String} url - Absolute URL to where the plugin is located.
2322
*/
24-
init: function (editor, url) {
23+
init: function (editor) {
2524
var self = this;
2625

2726
/**
@@ -47,7 +46,15 @@ define([
4746
* Add button to the editor toolbar.
4847
*/
4948
editor.ui.registry.addIcon('magentovariable',
50-
'<svg width="24" height="24" viewBox="0 0 32.000000 32.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,32.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M68 250 c-56 -44 -75 -136 -37 -184 27 -34 42 -33 23 2 -26 50 -9 129 38 179 26 28 10 30 -24 3z"/> <path d="M266 253 c5 -10 9 -41 9 -70 0 -42 -6 -60 -32 -97 -36 -51 -35 -56 7 -26 54 39 78 139 44 188 -18 26 -40 30 -28 5z"/> <path d="M128 223 c-15 -4 -15 -6 0 -33 16 -28 16 -30 -11 -58 -30 -31 -34 -42 -13 -42 8 0 17 11 20 25 4 14 11 25 16 25 5 0 12 -11 16 -25 6 -25 37 -35 49 -15 3 5 2 10 -3 10 -23 0 -20 44 5 76 25 34 25 34 4 34 -12 0 -20 -4 -17 -8 2 -4 0 -14 -5 -22 -7 -10 -12 -11 -15 -4 -10 25 -30 40 -46 37z"/> </g> </svg>');
49+
'<svg width="24" height="24" viewBox="0 0 32.000000 32.000000" ' +
50+
'preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,32.000000) ' +
51+
'scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M68 250 c-56 -44 -75 -136 ' +
52+
'-37 -184 27 -34 42 -33 23 2 -26 50 -9 129 38 179 26 28 10 30 -24 3z"/> <path d="M266 253 c5 -10' +
53+
'9 -41 9 -70 0 -42 -6 -60 -32 -97 -36 -51 -35 -56 7 -26 54 39 78 139 44 188 -18 26 -40 30 ' +
54+
'-28 5z"/> <path d="M128 223 c-15 -4 -15 -6 0 -33 16 -28 16 -30 -11 -58 -30 -31 -34 -42 -13 ' +
55+
'-42 8 0 17 11 20 25 4 14 11 25 16 25 5 0 12 -11 16 -25 6 -25 37 -35 49 -15 3 5 2 10 -3 10 -23 0 ' +
56+
'-20 44 5 76 25 34 25 34 4 34 -12 0 -20 -4 -17 -8 2 -4 0 -14 -5 -22 -7 -10 -12 -11 -15 -4 -10 25' +
57+
' -30 40 -46 37z"/> </g> </svg>');
5158
editor.ui.registry.addToggleButton('magentovariable', {
5259
icon: 'magentovariable',
5360
tooltip: jQuery.mage.__('Insert Variable'),

lib/web/mage/adminhtml/wysiwyg/tiny_mce/plugins/magentowidget/editor_plugin.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,16 @@ define([
3535

3636
// Register Widget plugin button
3737
editor.ui.registry.addIcon('magentowidget',
38-
'<svg width="24" height="24" viewBox="0 0 32.000000 32.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,32.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M130 290 c0 -5 13 -10 30 -10 22 0 28 -4 24 -15 -5 -11 2 -15 26 -15 21 0 30 -4 28 -12 -7 -20 -40 -22 -50 -4 -5 9 -14 16 -20 16 -6 0 -19 7 -28 15 -9 8 -25 12 -38 8 -33 -8 -27 -26 8 -21 34 5 40 -6 12 -21 -14 -7 -25 -6 -40 5 -12 8 -23 10 -27 5 -5 -8 88 -71 105 -71 3 0 29 14 58 31 l53 30 -23 18 c-13 10 -31 20 -40 24 -10 3 -18 11 -18 17 0 5 -13 10 -30 10 -16 0 -30 -4 -30 -10z m58 -82 c-3 -7 -15 -13 -28 -13 -13 0 -25 6 -27 13 -3 8 6 12 27 12 21 0 30 -4 28 -12z"/> <path d="M30 151 l0 -60 61 -36 c33 -19 64 -35 69 -35 5 0 36 16 69 35 l61 36 0 60 0 61 -65 -37 -65 -36 -65 36 -65 37 0 -61z"/> </g> </svg>');
38+
'<svg width="24" height="24" viewBox="0 0 32.000000 32.000000" ' +
39+
'preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,32.000000) ' +
40+
'scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M130 290 c0 -5 13 -10 30 ' +
41+
'-10 22 0 28 -4 24 -15 -5 -11 2 -15 26 -15 21 0 30 -4 28 -12 -7 -20 -40 -22 -50 -4 -5 9 -14 16 ' +
42+
'-20 16 -6 0 -19 7 -28 15 -9 8 -25 12 -38 8 -33 -8 -27 -26 8 -21 34 5 40 -6 12 -21 -14 -7 -25 -6 ' +
43+
'-40 5 -12 8 -23 10 -27 5 -5 -8 88 -71 105 -71 3 0 29 14 58 31 l53 30 -23 18 c-13 10 -31 20 -40 ' +
44+
'24 -10 3 -18 11 -18 17 0 5 -13 10 -30 10 -16 0 -30 -4 -30 -10z m58 -82 c-3 -7 -15 -13 -28 -13 ' +
45+
'-13 0 -25 6 -27 13 -3 8 6 12 27 12 21 0 30 -4 28 -12z"/> <path d="M30 151 l0 -60 61 -36 c33 ' +
46+
'-19 64 -35 69 -35 5 0 36 16 69 35 l61 36 0 60 0 61 -65 -37 -65 -36 -65 36 -65 37 0 -61z"/> </g>' +
47+
'</svg>');
3948
editor.ui.registry.addToggleButton('magentowidget', {
4049
icon: 'magentowidget',
4150
tooltip: jQuery.mage.__('Insert Widget'),
@@ -52,7 +61,10 @@ define([
5261
* @param {ToolbarToggleButtonInstanceApi} api
5362
*/
5463
onSetup: function (api) {
55-
editor.on('NodeChange', (e) => {
64+
/**
65+
* NodeChange handler
66+
*/
67+
editor.on('NodeChange', function (e) {
5668
var placeholder = e.element;
5769

5870
if (self.isWidgetPlaceholderSelected(placeholder)) {

0 commit comments

Comments
 (0)