Skip to content

Commit

Permalink
Merge branch '2.1' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jan 31, 2024
2 parents badbc4f + 8607246 commit f8c0909
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-file.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions client/src/entwine/TinyMCE_sslink-file.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global tinymce, editorIdentifier, ss */
/* global tinymce, ss */
import i18n from 'i18n';
import TinyMCEActionRegistrar from 'lib/TinyMCEActionRegistrar';
import React from 'react';
Expand All @@ -11,20 +11,21 @@ import * as modalActions from 'state/modal/ModalActions';

const commandName = 'sslinkfile';

// Link to external url
TinyMCEActionRegistrar.addAction(
'sslink',
{
text: i18n._t('AssetAdmin.LINKLABEL_FILE', 'Link to a file'),
// eslint-disable-next-line no-console
onAction: (activeEditor) => activeEditor.execCommand(commandName),
priority: 80
},
editorIdentifier,
).addCommandWithUrlTest(commandName, /^\[file_link/);

const plugin = {
init(editor) {
// Add "Link to external url" to link menu for this editor
TinyMCEActionRegistrar.addAction(
'sslink',
{
text: i18n._t('AssetAdmin.LINKLABEL_FILE', 'Link to a file'),
// eslint-disable-next-line no-console
onAction: (activeEditor) => activeEditor.execCommand(commandName),
priority: 80
},
editor.getParam('editorIdentifier'),
).addCommandWithUrlTest(commandName, /^\[file_link/);

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

Expand Down
4 changes: 2 additions & 2 deletions client/src/entwine/TinyMCE_ssmedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ jQuery.entwine('ss', ($) => {
properties: { id: data.ID },
}, true);

const selectionContent = this.getElement().getSelection();
const selectionContent = editor.getSelection();
let linkText = selectionContent || data.Text || data.filename;

// if link was highlighted, then we don't want to place more text inside that text
Expand Down Expand Up @@ -553,7 +553,7 @@ jQuery.entwine('ss', ($) => {
*/
statusMessage(text, type) {
const content = $('<div/>').text(text).html(); // Escape HTML entities in text
$.noticeAdd({
jQuery.noticeAdd({
text: content,
type,
stayTime: 5000,
Expand Down

0 comments on commit f8c0909

Please sign in to comment.