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 709e525 + c14c5d7 commit 03f7fd2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-file.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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"php": "^8.1",
"silverstripe/framework": "^5.1",
"silverstripe/admin": "^2",
"silverstripe/admin": "^2.1.11",
"silverstripe/graphql": "^5"
},
"require-dev": {
Expand Down

0 comments on commit 03f7fd2

Please sign in to comment.