Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
extlink-3172378
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Show more breadcrumbs
Issue forks
extlink-3172378
Commits
eb96140d
Commit
eb96140d
authored
6 years ago
by
Lachlan Ennis
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2153201
by PieterDC, Dave Bagler, elachlan: Add Font Awesome and Glyphicon Support
parent
b9789c18
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
extlink.css
+5
-0
5 additions, 0 deletions
extlink.css
extlink.install
+1
-0
1 addition, 0 deletions
extlink.install
extlink.js
+13
-5
13 additions, 5 deletions
extlink.js
extlink.module
+9
-0
9 additions, 0 deletions
extlink.module
with
28 additions
and
5 deletions
extlink.css
+
5
−
0
View file @
eb96140d
...
...
@@ -21,3 +21,8 @@ span.mailto {
padding
:
0
;
}
}
/* Put some whitespace between the link and its Font Awesome suffix. */
span
.extlink
i
{
padding-left
:
0.2em
;
}
This diff is collapsed.
Click to expand it.
extlink.install
+
1
−
0
View file @
eb96140d
...
...
@@ -34,6 +34,7 @@ function extlink_uninstall() {
variable_del
(
'extlink_mailto_label'
);
variable_del
(
'extlink_subdomains'
);
variable_del
(
'extlink_target'
);
variable_del
(
'extlink_use_font_awesome'
);
cache_clear_all
(
'variables'
,
'cache'
);
}
...
...
This diff is collapsed.
Click to expand it.
extlink.js
+
13
−
5
View file @
eb96140d
...
...
@@ -179,11 +179,19 @@
for
(
i
=
0
;
i
<
length
;
i
++
)
{
var
$link
=
$
(
$links_to_process
[
i
]);
if
(
$link
.
css
(
'
display
'
)
===
'
inline
'
||
$link
.
css
(
'
display
'
)
===
'
inline-block
'
)
{
if
(
class_name
===
Drupal
.
settings
.
extlink
.
mailtoClass
)
{
$link
[
icon_placement
](
'
<span class="
'
+
class_name
+
'
" aria-label="
'
+
Drupal
.
settings
.
extlink
.
mailtoLabel
+
'
"></span>
'
);
}
else
{
$link
[
icon_placement
](
'
<span class="
'
+
class_name
+
'
" aria-label="
'
+
Drupal
.
settings
.
extlink
.
extLabel
+
'
"></span>
'
);
if
(
Drupal
.
settings
.
extlink
.
extUseFontAwesome
)
{
if
(
class_name
===
Drupal
.
settings
.
extlink
.
mailtoClass
)
{
$link
[
icon_placement
](
'
<span class="fa-
'
+
class_name
+
'
extlink"><i class="fa fa-envelope-o" title="
'
+
Drupal
.
settings
.
extlink
.
mailtoLabel
+
'
"></i></span>
'
);
}
else
{
$link
[
icon_placement
](
'
<span class="fa-
'
+
class_name
+
'
extlink"><i class="fa fa-external-link" title="
'
+
Drupal
.
settings
.
extlink
.
extLabel
+
'
"></i></span>
'
);
}
}
else
{
if
(
class_name
===
Drupal
.
settings
.
extlink
.
mailtoClass
)
{
$link
[
icon_placement
](
'
<span class="
'
+
class_name
+
'
" aria-label="
'
+
Drupal
.
settings
.
extlink
.
mailtoLabel
+
'
"></span>
'
);
}
else
{
$link
[
icon_placement
](
'
<span class="
'
+
class_name
+
'
" aria-label="
'
+
Drupal
.
settings
.
extlink
.
extLabel
+
'
"></span>
'
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
extlink.module
+
9
−
0
View file @
eb96140d
...
...
@@ -55,6 +55,7 @@ function extlink_page_build() {
'extAlertText'
=>
variable_get
(
'extlink_alert_text'
,
'This link will take you to an external web site. We are not responsible for their content.'
),
'mailtoClass'
=>
variable_get
(
'extlink_mailto_class'
,
'mailto'
),
'mailtoLabel'
=>
check_plain
(
variable_get
(
'extlink_mailto_label'
,
t
(
'(link sends e-mail)'
))),
'extUseFontAwesome'
=>
variable_get
(
'extlink_use_font_awesome'
,
FALSE
),
),
),
'setting'
);
}
...
...
@@ -105,6 +106,14 @@ function extlink_admin_settings() {
'#description'
=>
t
(
'If checked, images wrapped in an anchor tag will be treated as external links.'
),
);
$form
[
'extlink_use_font_awesome'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Use Font Awesome icons instead of images.'
),
'#return_value'
=>
TRUE
,
'#default_value'
=>
variable_get
(
'extlink_use_font_awesome'
,
FALSE
),
'#description'
=>
t
(
'Add Font Awesome classes to the link as well as an i tag rather than images.'
),
);
$form
[
'extlink_icon_placement'
]
=
array
(
'#type'
=>
'checkbox'
,
'#title'
=>
t
(
'Add icon in front of any processed link'
),
...
...
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