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
72bc527d
Commit
72bc527d
authored
8 years ago
by
Lachlan Ennis
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2748635
by aburke626, reevo: Code Standards Cleanup
parent
17f5f5cf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
extlink.js
+10
-8
10 additions, 8 deletions
extlink.js
with
10 additions
and
8 deletions
extlink.js
+
10
−
8
View file @
72bc527d
/**
* @file
*/
(
function
(
$
)
{
'
use strict
'
;
Drupal
.
extlink
=
Drupal
.
extlink
||
{};
Drupal
.
extlink
.
attach
=
function
(
context
,
settings
)
{
...
...
@@ -76,7 +78,7 @@ Drupal.extlink.attach = function (context, settings) {
else
if
(
typeof
this
.
href
==
'
object
'
)
{
url
=
this
.
href
.
baseVal
;
}
if
(
url
.
indexOf
(
'
http
'
)
==
0
if
(
url
.
indexOf
(
'
http
'
)
==
=
0
&&
((
!
url
.
match
(
internal_link
)
&&
!
(
extExclude
&&
url
.
match
(
extExclude
)))
||
(
extInclude
&&
url
.
match
(
extInclude
)))
&&
!
(
extCssExclude
&&
$
(
this
).
parents
(
extCssExclude
).
length
>
0
)
&&
!
(
extCssExplicit
&&
$
(
this
).
parents
(
extCssExplicit
).
length
<
1
))
{
...
...
@@ -84,8 +86,8 @@ Drupal.extlink.attach = function (context, settings) {
}
// Do not include area tags with begin with mailto: (this prohibits
// icons from being added to image-maps).
else
if
(
this
.
tagName
!=
'
AREA
'
&&
url
.
indexOf
(
'
mailto:
'
)
==
0
else
if
(
this
.
tagName
!=
=
'
AREA
'
&&
url
.
indexOf
(
'
mailto:
'
)
==
=
0
&&
!
(
extCssExclude
&&
$
(
this
).
parents
(
extCssExclude
).
length
>
0
)
&&
!
(
extCssExplicit
&&
$
(
this
).
parents
(
extCssExplicit
).
length
<
1
))
{
mailto_links
.
push
(
this
);
...
...
@@ -113,15 +115,15 @@ Drupal.extlink.attach = function (context, settings) {
// Add rel attributes noopener and noreferrer.
$
(
external_links
).
attr
(
'
rel
'
,
function
(
i
,
val
)
{
// If no rel attribute is present, create one with the values noopener and noreferrer.
if
(
val
==
null
)
{
if
(
val
==
null
)
{
return
'
noopener nofererer
'
;
}
// Check to see if rel contains noopener or noreferrer. Add what doesn't exist.
if
(
val
.
indexOf
(
'
noopener
'
)
>
-
1
||
val
.
indexOf
(
'
noreferrer
'
)
>
-
1
)
{
if
(
val
.
indexOf
(
'
noopener
'
)
==
-
1
)
{
if
(
val
.
indexOf
(
'
noopener
'
)
==
=
-
1
)
{
return
val
+
'
noopener
'
;
}
if
(
val
.
indexOf
(
'
noreferrer
'
)
==
-
1
)
{
if
(
val
.
indexOf
(
'
noreferrer
'
)
==
=
-
1
)
{
return
val
+
'
noreferrer
'
;
}
// Both noopener and noreferrer exist. Nothing needs to be added.
...
...
@@ -144,7 +146,7 @@ Drupal.extlink.attach = function (context, settings) {
if
(
settings
.
extlink
.
extAlert
)
{
return
confirm
(
settings
.
extlink
.
extAlertText
);
}
}
}
;
$
(
external_links
).
click
(
function
(
e
)
{
return
Drupal
.
extlink
.
popupClickHandler
(
e
,
this
);
...
...
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