[src:feat] add WikiRank binding
This commit is contained in:
parent
029869f8a0
commit
25b44e8f5c
11
actions.js
11
actions.js
|
@ -704,6 +704,17 @@ actions.wp.toggleSimple = () => {
|
||||||
actions.openLink(u.href)()
|
actions.openLink(u.href)()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actions.wp.viewWikiRank = () => {
|
||||||
|
const h = document.location.hostname.split(".")
|
||||||
|
const lang = h.length > 2 && h[0] !== "www" ? h[0] : "en"
|
||||||
|
const p = document.location.pathname.split("/")
|
||||||
|
if (p.length < 3 || p[1] !== "wiki") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const article = p.slice(2).join("/")
|
||||||
|
actions.openLink(`https://wikirank.net/${lang}/${article}`, { newTab: true })()
|
||||||
|
}
|
||||||
|
|
||||||
// Nest Thermostat Controller
|
// Nest Thermostat Controller
|
||||||
// --------------------------
|
// --------------------------
|
||||||
actions.nt = {}
|
actions.nt = {}
|
||||||
|
|
5
keys.js
5
keys.js
|
@ -733,6 +733,11 @@ const maps = {
|
||||||
description: "View external link",
|
description: "View external link",
|
||||||
callback: actions.createHint("a[rel=nofollow]"),
|
callback: actions.createHint("a[rel=nofollow]"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
alias: "R",
|
||||||
|
description: "View WikiRank for current article",
|
||||||
|
callback: actions.wp.viewWikiRank,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
"craigslist.org": [
|
"craigslist.org": [
|
||||||
|
|
Loading…
Reference in New Issue