Fix getURLPath/copyURLPath
- getURLPath should no longer return a function, just the value - copyURLPath should use Clipboard.write instead of Front.writeClipboard - Add Clipboard to eslintrc list of allowed globals
This commit is contained in:
parent
eaf74cc4f1
commit
a4443a6af8
|
@ -3,6 +3,7 @@ module.exports = {
|
|||
globals: {
|
||||
Omnibar: false,
|
||||
Front: false,
|
||||
Clipboard: false,
|
||||
runtime: false,
|
||||
chrome: false,
|
||||
tabOpenLink: false,
|
||||
|
|
18
conf.js
18
conf.js
|
@ -160,20 +160,18 @@ function togglePdfViewer() {
|
|||
}
|
||||
|
||||
function getURLPath(count, domain) {
|
||||
return () => {
|
||||
let path = window.location.pathname.slice(1)
|
||||
if (count) {
|
||||
path = path.split("/").slice(0, count).join("/")
|
||||
}
|
||||
if (domain) {
|
||||
path = `${window.location.hostname}/${path}`
|
||||
}
|
||||
return path
|
||||
let path = window.location.pathname.slice(1)
|
||||
if (count) {
|
||||
path = path.split("/").slice(0, count).join("/")
|
||||
}
|
||||
if (domain) {
|
||||
path = `${window.location.hostname}/${path}`
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
function copyURLPath(count, domain) {
|
||||
return () => Front.writeClipboard(getURLPath(count, domain))
|
||||
return () => Clipboard.write(getURLPath(count, domain))
|
||||
}
|
||||
|
||||
function viewGodoc() {
|
||||
|
|
Loading…
Reference in New Issue