File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,25 @@ var vpos = 'bottom:' + (Math.floor(Math.random() * 80) + 10) + '%;';
24
24
var img = document . createElement ( "img" ) ;
25
25
26
26
current_path = document . location ;
27
-
28
- if ( ( document . location . pathname . split ( '/' ) ) . includes ( "rst" ) ) {
29
- img . src = "../../_images/plankton-only.svg" ;
30
- }
31
- else if ( ( document . location . pathname . split ( '/' ) ) . slice ( - 1 ) == "" ) {
32
- img . src = "./_images/plankton-only.svg" ;
27
+ if ( document . location . origin == "null" ) { //local file
28
+ if ( ( document . location . pathname . split ( '/' ) ) . includes ( "rst" ) ) {
29
+ img . src = "../_images/plankton-only.svg" ;
30
+ }
31
+ else {
32
+ img . src = "../_images/plankton-only.svg" ;
33
+ }
33
34
}
34
- else {
35
- img . src = "../_images/plankton-only.svg" ;
35
+ else {
36
+ img . src = document . location . pathname . split ( '/' ) . slice ( 0 , 3 ) . join ( "/" ) + "_images/plankton-only.svg" ;
37
+ // if ((document.location.pathname.split('/')).includes("rst")) {
38
+ // img.src = "../../_images/plankton-only.svg";
39
+ // }
40
+ // else if ((document.location.pathname.split('/')).slice(-1) == "") {
41
+ // img.src = "./_images/plankton-only.svg";
42
+ // }
43
+ // else {
44
+ // img.src = "../_images/plankton-only.svg";
45
+ // }
36
46
}
37
47
38
48
img . id = "pop-plankton" ;
You can’t perform that action at this time.
0 commit comments