You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// should start with _, otherwise it is specifying a specific frame name
15
-
// _blank = new tab/window, _self = same frame, _parent = parent frame (use for home page from modals), _top = document body, framename = specific frame
16
-
if(target&&!target.startsWith('_')){
17
-
// Thanos uses BODY
18
-
// 'newBody' hard-coded in spaces -> should we keep this logic?
19
-
if(target==='BODY'||target==='newBody'){
20
-
return'_self';
21
-
}
22
-
if(target==='TAB'){
23
-
return'_blank';
24
-
}
25
-
}
26
-
27
-
returntarget||'_self';
28
-
};
29
-
30
-
// takes href and transforms it so that we can compare hostnames and other properties
31
-
constgetLocation=(href)=>{
32
-
constlocation=document.createElement('a');
33
-
location.href=href;
34
-
returnlocation;
35
-
};
36
-
37
-
constsetRel=(url,target,absolute)=>{
38
-
if(target==='_blank'&&absolute){
39
-
constdest=getLocation(url);
40
-
if(dest.hostname!==window.location.hostname){
41
-
// default rel when linking to external destinations for performance and security
/** Function that is called when the element is clicked. The first argument passed to onClick is the event. The second argument is the processed url. */
52
+
onClick: PropTypes.func,
53
+
/** The relationship of the linked URL as space-separated link types. */
/** Return a valid target based on what is passed in */
12
+
exportconstgetTarget=(target)=>{
13
+
// should start with _, otherwise it is specifying a specific frame name
14
+
// _blank = new tab/window, _self = same frame, _parent = parent frame (use for home page from modals), _top = document body, framename = specific frame
15
+
if(target&&!target.startsWith('_')){
16
+
// Thanos uses BODY
17
+
// 'newBody' hard-coded in spaces -> should we keep this logic?
18
+
if(target==='BODY'||target==='newBody'){
19
+
return'_self';
20
+
}
21
+
if(target==='TAB'){
22
+
return'_blank';
23
+
}
24
+
}
25
+
26
+
returntarget||'_self';
27
+
};
28
+
29
+
/** Takes href and transforms it so that we can compare hostnames and other properties */
30
+
exportconstgetLocation=(href)=>{
31
+
constlocation=document.createElement('a');
32
+
location.href=href;
33
+
returnlocation;
34
+
};
35
+
36
+
exportconstgetRel=(url,target,absolute)=>{
37
+
if(target==='_blank'&&absolute){
38
+
constdest=getLocation(url);
39
+
if(dest.hostname!==window.location.hostname){
40
+
// default rel when linking to external destinations for performance and security
0 commit comments