Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
media
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
media
Commits
91311eb6
Commit
91311eb6
authored
Aug 17, 2017
by
Deciphered
Committed by
joseph.olstad
Aug 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2355961
by Deciphered, joseph.olstad: Use selected editor text as media file link text
parent
a10ef32f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
modules/media_wysiwyg/js/wysiwyg-media.js
modules/media_wysiwyg/js/wysiwyg-media.js
+10
-1
No files found.
modules/media_wysiwyg/js/wysiwyg-media.js
View file @
91311eb6
...
...
@@ -13,6 +13,11 @@ Drupal.media = Drupal.media || {};
*/
Drupal
.
wysiwyg
.
plugins
.
media
=
{
/**
* The selected text string.
*/
selectedText
:
null
,
/**
* Determine whether a DOM element belongs to this plugin.
*
...
...
@@ -51,6 +56,9 @@ Drupal.wysiwyg.plugins.media = {
insert
.
onSelect
([
media_file
]);
}
else
{
// Store currently selected text.
this
.
selectedText
=
data
.
content
;
// Insert new media.
insert
.
prompt
(
settings
.
global
);
}
...
...
@@ -118,7 +126,8 @@ InsertMedia.prototype = {
fid
:
this
.
mediaFile
.
fid
,
view_mode
:
formatted_media
.
type
,
attributes
:
this
.
mediaFile
.
attributes
,
fields
:
formatted_media
.
options
fields
:
formatted_media
.
options
,
link_text
:
Drupal
.
wysiwyg
.
plugins
.
media
.
selectedText
});
// Get the markup and register it for the macro / placeholder handling.
var
markup
=
Drupal
.
media
.
filter
.
getWysiwygHTML
(
element
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment