change url to self build site, use querySelector instead of getElementsbyClassName
This commit is contained in:
parent
0d25d99755
commit
54bdcca2e0
@ -10,14 +10,14 @@
|
|||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
var navi = document.getElementsByClassName('file-navigation')
|
var navi = document.querySelectorAll('.file-navigation')
|
||||||
console.log(navi)
|
console.log(navi)
|
||||||
if (navi.length > 0) {
|
if (navi.length > 0) {
|
||||||
navi = navi[0]
|
navi = navi[0]
|
||||||
var node = document.createElement('a')
|
var node = document.createElement('a')
|
||||||
node.className = 'btn btn-primary'
|
node.className = 'btn btn-primary'
|
||||||
node.style = 'margin-left: 0.5rem'
|
node.style = 'margin-left: 0.5rem'
|
||||||
node.href = "https://github1s.com" + window.location.pathname
|
node.href = "https://githubvsc.zmy.pub" + window.location.pathname
|
||||||
node.innerHTML = "View Code"
|
node.innerHTML = "View Code"
|
||||||
node.target = "_blank"
|
node.target = "_blank"
|
||||||
// var sep = navi.getElementsByClassName('flex-auto')[0]
|
// var sep = navi.getElementsByClassName('flex-auto')[0]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user