Skip to content

Commit

Permalink
Merge branch '1' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jan 25, 2024
2 parents 493909d + 6749a84 commit bcd15c1
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 44 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-email.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-external.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 13 additions & 12 deletions client/src/legacy/TinyMCE_sslink-email.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global tinymce, editorIdentifier, window */
/* global tinymce, window */
import i18n from 'i18n';
import TinyMCEActionRegistrar from 'lib/TinyMCEActionRegistrar';
import React from 'react';
Expand All @@ -9,19 +9,20 @@ import { loadComponent } from 'lib/Injector';

const commandName = 'sslinkemail';

// Link to email address
TinyMCEActionRegistrar.addAction(
'sslink',
{
text: i18n._t('Admin.LINKLABEL_EMAIL', 'Link to email address'),
onclick: (editorInst) => editorInst.execCommand(commandName),
priority: 51,
},
editorIdentifier,
).addCommandWithUrlTest(commandName, /^mailto:/);

const plugin = {
init(editor) {
// Add "Link to email address" to link menu for this editor
TinyMCEActionRegistrar.addAction(
'sslink',
{
text: i18n._t('Admin.LINKLABEL_EMAIL', 'Link to email address'),
onAction: (editorInst) => editorInst.execCommand(commandName),
priority: 51,
},
editor.getParam('editorIdentifier'),
).addCommandWithUrlTest(commandName, /^mailto:/);

// Add a command that corresponds with the above menu item
editor.addCommand(commandName, () => {
const field = window.jQuery(`#${editor.id}`).entwine('ss');

Expand Down
18 changes: 9 additions & 9 deletions client/src/legacy/TinyMCE_sslink-external.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global tinymce, editorIdentifier, window */
/* global tinymce, window */
import i18n from 'i18n';
import TinyMCEActionRegistrar from 'lib/TinyMCEActionRegistrar';
import React from 'react';
Expand All @@ -7,16 +7,16 @@ import jQuery from 'jquery';
import { createInsertLinkModal } from 'containers/InsertLinkModal/InsertLinkModal';
import { loadComponent } from 'lib/Injector';

// Link to external url
TinyMCEActionRegistrar.addAction('sslink', {
text: i18n._t('Admin.LINKLABEL_EXTERNALURL', 'Link to external URL'),
// eslint-disable-next-line no-console
onAction: (editor) => editor.execCommand('sslinkexternal'),
priority: 70,
}, editorIdentifier);

const plugin = {
init(editor) {
// Add "Link to external url" to link menu for this editor
TinyMCEActionRegistrar.addAction('sslink', {
text: i18n._t('Admin.LINKLABEL_EXTERNALURL', 'Link to external URL'),
onAction: (editorInst) => editorInst.execCommand('sslinkexternal'),
priority: 70,
}, editor.getParam('editorIdentifier'));

// Add a command that corresponds with the above menu item
editor.addCommand('sslinkexternal', () => {
const field = window.jQuery(`#${editor.id}`).entwine('ss');

Expand Down
Loading

0 comments on commit bcd15c1

Please sign in to comment.