Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tinymce4_rte
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TYPO3
tinymce4_rte
Commits
6562983f
Commit
6562983f
authored
10 years ago
by
Stefan Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] Respect the additional attribute values while creating links
parent
9c5e65a2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Resources/Public/Plugins/Typo3FileManager/typo3filemanager.js
+8
-1
8 additions, 1 deletion
...urces/Public/Plugins/Typo3FileManager/typo3filemanager.js
Resources/Public/Plugins/Typo3FileManager/typo3filemanager.min.js
+1
-9
1 addition, 9 deletions
...s/Public/Plugins/Typo3FileManager/typo3filemanager.min.js
with
9 additions
and
10 deletions
Resources/Public/Plugins/Typo3FileManager/typo3filemanager.js
+
8
−
1
View file @
6562983f
...
...
@@ -165,9 +165,16 @@ plugin.createLink = function(href, target, cssClass, title, additionalValues) {
href
:
href
,
target
:
target
?
target
:
null
,
class
:
cssClass
?
cssClass
:
null
,
title
:
title
?
title
:
null
title
:
title
?
title
:
null
,
'
data-htmlarea-external
'
:
null
};
for
(
var
index
in
additionalValues
)
{
if
(
additionalValues
.
hasOwnProperty
(
index
))
{
linkAttrs
[
index
]
=
additionalValues
[
index
];
}
}
var
selectedElement
=
tinymce
.
activeEditor
.
selection
.
getNode
();
var
element
=
tinymce
.
activeEditor
.
dom
.
getParent
(
selectedElement
,
'
a[href]
'
);
if
(
element
)
{
...
...
This diff is collapsed.
Click to expand it.
Resources/Public/Plugins/Typo3FileManager/typo3filemanager.min.js
+
1
−
9
View file @
6562983f
tinymce
.
PluginManager
.
requireLangPack
(
"
typo3filemanager
"
,
"
en_GB,de
"
)
var
plugin
=
tinymce
.
PluginManager
.
add
(
"
typo3filemanager
"
,
function
(
t
){
var
e
=
function
(
e
,
n
){
var
i
=
t
.
id
return
e
+
(
-
1
===
e
.
indexOf
(
"
?
"
)?
"
?
"
:
"
&
"
)
+
"
&RTEtsConfigParams=
"
+
RTE
[
i
].
rteConfiguration
+
"
&sys_language_content=
"
+
RTE
[
i
].
sys_language_content
+
"
&contentTypo3Language=
"
+
RTE
[
i
].
typo3ContentLanguage
+
(
n
?
n
:
""
)},
n
=
function
(){
var
n
=
t
.
selection
.
getNode
(),
i
=
t
.
dom
.
getParent
(
n
,
"
img[src]
"
),
o
=
""
i
&&
(
o
=
"
&act=image
"
),
t
.
windowManager
.
open
({
title
:
"
TYPO3 Image
"
,
url
:
e
(
RTE
.
linkToImageModule
,
o
),
width
:
800
,
height
:
600
,
buttons
:[{
text
:
"
Close
"
,
onclick
:
"
close
"
}]})},
i
=
function
(){
var
n
=
t
.
selection
.
getNode
(),
i
=
t
.
dom
.
getParent
(
n
,
"
a[href]
"
),
o
=
""
i
&&
(
o
=
"
&curUrl[href]=
"
+
encodeURIComponent
(
i
.
href
),
i
.
target
&&
(
o
+=
"
&curUrl[target]=
"
+
encodeURIComponent
(
i
.
target
)),
i
.
className
&&
(
o
+=
"
&curUrl[class]=
"
+
encodeURIComponent
(
i
.
className
)),
i
.
title
&&
(
o
+=
"
&curUrl[title]=
"
+
encodeURIComponent
(
i
.
title
))),
t
.
windowManager
.
open
({
title
:
"
TYPO3 Link
"
,
url
:
e
(
RTE
.
linkToLinkModule
,
o
),
width
:
800
,
height
:
600
,
buttons
:[{
text
:
"
Close
"
,
onclick
:
"
close
"
}]})}
t
.
addButton
(
"
typo3link
"
,{
title
:
"
TYPO3 Link
"
,
icon
:
"
link
"
,
shortcut
:
"
Ctrl+K
"
,
onclick
:
i
}),
t
.
addButton
(
"
typo3image
"
,{
title
:
"
TYPO3 Image
"
,
icon
:
"
image
"
,
shortcut
:
"
Ctrl+L
"
,
onclick
:
n
}),
t
.
addMenuItem
(
"
typo3link
"
,{
text
:
"
TYPO3 Link
"
,
context
:
"
insert
"
,
prependToContext
:
!
0
,
shortcut
:
"
Ctrl+K
"
,
icon
:
"
link
"
,
onclick
:
i
}),
t
.
addMenuItem
(
"
typo3image
"
,{
text
:
"
TYPO3 Image
"
,
context
:
"
insert
"
,
prependToContext
:
!
0
,
shortcut
:
"
Ctrl+L
"
,
icon
:
"
image
"
,
onclick
:
n
}),
t
.
addShortcut
(
"
Ctrl+K
"
,
""
,
i
),
t
.
addShortcut
(
"
Ctrl+L
"
,
""
,
n
)})
plugin
.
createLink
=
function
(
t
,
e
,
n
,
i
){
var
o
=
{
href
:
t
,
target
:
e
?
e
:
null
,
"
class
"
:
n
?
n
:
null
,
title
:
i
?
i
:
null
},
c
=
tinymce
.
activeEditor
.
selection
.
getNode
(),
a
=
tinymce
.
activeEditor
.
dom
.
getParent
(
c
,
"
a[href]
"
)
a
?(
tinymce
.
activeEditor
.
focus
(),
tinymce
.
activeEditor
.
dom
.
setAttribs
(
a
,
o
),
tinymce
.
activeEditor
.
selection
.
select
(
a
),
tinymce
.
activeEditor
.
undoManager
.
add
()):
tinymce
.
activeEditor
.
execCommand
(
"
mceInsertLink
"
,
!
1
,
o
),
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()},
plugin
.
unLink
=
function
(){
tinymce
.
activeEditor
.
execCommand
(
"
unlink
"
),
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()},
plugin
.
insertImage
=
function
(
t
){
tinymce
.
activeEditor
.
focus
(),
tinymce
.
activeEditor
.
selection
.
setContent
(
t
),
tinymce
.
activeEditor
.
undoManager
.
add
(),
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()},
plugin
.
getButton
=
function
(){
return
null
},
plugin
.
getSelectedImage
=
function
(){
var
t
=
tinymce
.
activeEditor
.
$
(
tinymce
.
activeEditor
.
selection
.
getNode
())
return
t
.
length
?
t
.
closest
(
"
img[src]
"
):{}},
plugin
.
close
=
function
(){
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()}
\ No newline at end of file
tinymce
.
PluginManager
.
requireLangPack
(
"
typo3filemanager
"
,
"
en_GB,de
"
);
var
plugin
=
tinymce
.
PluginManager
.
add
(
"
typo3filemanager
"
,
function
(
t
){
var
e
=
function
(
e
,
n
){
var
i
=
t
.
id
;
return
e
+
(
-
1
===
e
.
indexOf
(
"
?
"
)?
"
?
"
:
"
&
"
)
+
"
&RTEtsConfigParams=
"
+
RTE
[
i
].
rteConfiguration
+
"
&sys_language_content=
"
+
RTE
[
i
].
sys_language_content
+
"
&contentTypo3Language=
"
+
RTE
[
i
].
typo3ContentLanguage
+
(
n
?
n
:
""
)},
n
=
function
(){
var
n
=
t
.
selection
.
getNode
(),
i
=
t
.
dom
.
getParent
(
n
,
"
img[src]
"
),
o
=
""
;
i
&&
(
o
=
"
&act=image
"
),
t
.
windowManager
.
open
({
title
:
"
TYPO3 Image
"
,
url
:
e
(
RTE
.
linkToImageModule
,
o
),
width
:
800
,
height
:
600
,
buttons
:[{
text
:
"
Close
"
,
onclick
:
"
close
"
}]})},
i
=
function
(){
var
n
=
t
.
selection
.
getNode
(),
i
=
t
.
dom
.
getParent
(
n
,
"
a[href]
"
),
o
=
""
;
i
&&
(
o
=
"
&curUrl[href]=
"
+
encodeURIComponent
(
i
.
href
),
i
.
target
&&
(
o
+=
"
&curUrl[target]=
"
+
encodeURIComponent
(
i
.
target
)),
i
.
className
&&
(
o
+=
"
&curUrl[class]=
"
+
encodeURIComponent
(
i
.
className
)),
i
.
title
&&
(
o
+=
"
&curUrl[title]=
"
+
encodeURIComponent
(
i
.
title
))),
t
.
windowManager
.
open
({
title
:
"
TYPO3 Link
"
,
url
:
e
(
RTE
.
linkToLinkModule
,
o
),
width
:
800
,
height
:
600
,
buttons
:[{
text
:
"
Close
"
,
onclick
:
"
close
"
}]})};
t
.
addButton
(
"
typo3link
"
,{
title
:
"
TYPO3 Link
"
,
icon
:
"
link
"
,
shortcut
:
"
Ctrl+K
"
,
onclick
:
i
}),
t
.
addButton
(
"
typo3image
"
,{
title
:
"
TYPO3 Image
"
,
icon
:
"
image
"
,
shortcut
:
"
Ctrl+L
"
,
onclick
:
n
}),
t
.
addMenuItem
(
"
typo3link
"
,{
text
:
"
TYPO3 Link
"
,
context
:
"
insert
"
,
prependToContext
:
!
0
,
shortcut
:
"
Ctrl+K
"
,
icon
:
"
link
"
,
onclick
:
i
}),
t
.
addMenuItem
(
"
typo3image
"
,{
text
:
"
TYPO3 Image
"
,
context
:
"
insert
"
,
prependToContext
:
!
0
,
shortcut
:
"
Ctrl+L
"
,
icon
:
"
image
"
,
onclick
:
n
}),
t
.
addShortcut
(
"
Ctrl+K
"
,
""
,
i
),
t
.
addShortcut
(
"
Ctrl+L
"
,
""
,
n
)});
plugin
.
createLink
=
function
(
t
,
e
,
n
,
i
,
o
){
var
c
=
{
href
:
t
,
target
:
e
?
e
:
null
,
"
class
"
:
n
?
n
:
null
,
title
:
i
?
i
:
null
,
"
data-htmlarea-external
"
:
null
};
for
(
var
a
in
o
)
o
.
hasOwnProperty
(
a
)
&&
(
c
[
a
]
=
o
[
a
]);
var
r
=
tinymce
.
activeEditor
.
selection
.
getNode
(),
l
=
tinymce
.
activeEditor
.
dom
.
getParent
(
r
,
"
a[href]
"
);
l
?(
tinymce
.
activeEditor
.
focus
(),
tinymce
.
activeEditor
.
dom
.
setAttribs
(
l
,
c
),
tinymce
.
activeEditor
.
selection
.
select
(
l
),
tinymce
.
activeEditor
.
undoManager
.
add
()):
tinymce
.
activeEditor
.
execCommand
(
"
mceInsertLink
"
,
!
1
,
c
),
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()},
plugin
.
unLink
=
function
(){
tinymce
.
activeEditor
.
execCommand
(
"
unlink
"
),
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()},
plugin
.
insertImage
=
function
(
t
){
tinymce
.
activeEditor
.
focus
(),
tinymce
.
activeEditor
.
selection
.
setContent
(
t
),
tinymce
.
activeEditor
.
undoManager
.
add
(),
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()},
plugin
.
getButton
=
function
(){
return
null
},
plugin
.
getSelectedImage
=
function
(){
var
t
=
tinymce
.
activeEditor
.
$
(
tinymce
.
activeEditor
.
selection
.
getNode
());
return
t
.
length
?
t
.
closest
(
"
img[src]
"
):{}},
plugin
.
close
=
function
(){
tinymce
.
activeEditor
.
windowManager
.
getWindows
()[
0
].
close
()};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment