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:
Maddison Hellstrom 2018-08-17 21:46:34 -07:00
parent eaf74cc4f1
commit a4443a6af8
2 changed files with 9 additions and 10 deletions

View File

@ -3,6 +3,7 @@ module.exports = {
globals: {
Omnibar: false,
Front: false,
Clipboard: false,
runtime: false,
chrome: false,
tabOpenLink: false,

18
conf.js
View File

@ -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() {