mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Merge branch 'master' of github.com:cmcaine/tridactyl into glacambre-impl_#309
This commit is contained in:
commit
a0e465c7b0
9 changed files with 50 additions and 39 deletions
|
@ -10,6 +10,7 @@
|
||||||
"@types/node": "^8.0.46",
|
"@types/node": "^8.0.46",
|
||||||
"awesome-typescript-loader": "^3.2.3",
|
"awesome-typescript-loader": "^3.2.3",
|
||||||
"chokidar-cli": "^1.2.0",
|
"chokidar-cli": "^1.2.0",
|
||||||
|
"cleanslate": "^0.10.1",
|
||||||
"copy-webpack-plugin": "^4.2.0",
|
"copy-webpack-plugin": "^4.2.0",
|
||||||
"jest": "^21.2.1",
|
"jest": "^21.2.1",
|
||||||
"shared-git-hooks": "^1.2.1",
|
"shared-git-hooks": "^1.2.1",
|
||||||
|
|
|
@ -4,6 +4,7 @@ set -e
|
||||||
|
|
||||||
PATH=$(npm bin):"$PATH"
|
PATH=$(npm bin):"$PATH"
|
||||||
export PATH
|
export PATH
|
||||||
|
CLEANSLATE="node_modules/cleanslate/docs/files/cleanslate.css"
|
||||||
|
|
||||||
mkdir -p generated/static
|
mkdir -p generated/static
|
||||||
scripts/excmds_macros.py
|
scripts/excmds_macros.py
|
||||||
|
@ -13,3 +14,9 @@ scripts/make_docs.sh &
|
||||||
(webpack --display errors-only && scripts/git_version.sh)&
|
(webpack --display errors-only && scripts/git_version.sh)&
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|
||||||
|
if [ -e "$CLEANSLATE" ] ; then
|
||||||
|
cp "$CLEANSLATE" build/static/cleanslate.css
|
||||||
|
else
|
||||||
|
echo "Couldn't find cleanslate.css. Try running 'npm install'"
|
||||||
|
fi
|
||||||
|
|
|
@ -20,6 +20,7 @@ function init(){
|
||||||
if (cmdline_iframe === undefined) {
|
if (cmdline_iframe === undefined) {
|
||||||
try {
|
try {
|
||||||
cmdline_iframe = window.document.createElement("iframe")
|
cmdline_iframe = window.document.createElement("iframe")
|
||||||
|
cmdline_iframe.className = "cleanslate"
|
||||||
cmdline_iframe.setAttribute("src", browser.extension.getURL("static/commandline.html"))
|
cmdline_iframe.setAttribute("src", browser.extension.getURL("static/commandline.html"))
|
||||||
cmdline_iframe.setAttribute("id", "cmdline_iframe")
|
cmdline_iframe.setAttribute("id", "cmdline_iframe")
|
||||||
hide()
|
hide()
|
||||||
|
@ -36,11 +37,11 @@ init()
|
||||||
|
|
||||||
export function show(){
|
export function show(){
|
||||||
const height = cmdline_iframe.contentWindow.document.body.offsetHeight + 'px'
|
const height = cmdline_iframe.contentWindow.document.body.offsetHeight + 'px'
|
||||||
cmdline_iframe.setAttribute("style", `height: ${height};`)
|
cmdline_iframe.setAttribute("style", `height: ${height} !important;`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hide(){
|
export function hide(){
|
||||||
cmdline_iframe.setAttribute("style", "height: 0px;")
|
cmdline_iframe.setAttribute("style", "height: 0px !important;")
|
||||||
}
|
}
|
||||||
|
|
||||||
export function focus(){
|
export function focus(){
|
||||||
|
|
|
@ -1381,7 +1381,7 @@ export function set(key: string, ...values: string[]) {
|
||||||
|
|
||||||
if (Array.isArray(currentValue)) {
|
if (Array.isArray(currentValue)) {
|
||||||
config.set(...target, values)
|
config.set(...target, values)
|
||||||
} else if (typeof currentValue === "string") {
|
} else if (currentValue === undefined || typeof currentValue === "string") {
|
||||||
config.set(...target, values.join(' '))
|
config.set(...target, values.join(' '))
|
||||||
} else {
|
} else {
|
||||||
throw "Unsupported setting type!"
|
throw "Unsupported setting type!"
|
||||||
|
|
|
@ -25,7 +25,7 @@ const logger = new Logger('hinting')
|
||||||
/** Simple container for the state of a single frame's hints. */
|
/** Simple container for the state of a single frame's hints. */
|
||||||
class HintState {
|
class HintState {
|
||||||
public focusedHint: Hint
|
public focusedHint: Hint
|
||||||
readonly hintHost = html`<div class="TridactylHintHost">`
|
readonly hintHost = html`<div class="TridactylHintHost cleanslate">`
|
||||||
readonly hints: Hint[] = []
|
readonly hints: Hint[] = []
|
||||||
public filter = ''
|
public filter = ''
|
||||||
public hintchars = ''
|
public hintchars = ''
|
||||||
|
@ -167,8 +167,8 @@ class Hint {
|
||||||
/* left: ${rect.left}px; */
|
/* left: ${rect.left}px; */
|
||||||
/* ` */
|
/* ` */
|
||||||
this.flag.style.cssText = `
|
this.flag.style.cssText = `
|
||||||
top: ${window.scrollY + rect.top}px;
|
top: ${window.scrollY + rect.top}px !important;
|
||||||
left: ${window.scrollX + rect.left}px;
|
left: ${window.scrollX + rect.left}px !important;
|
||||||
`
|
`
|
||||||
modeState.hintHost.appendChild(this.flag)
|
modeState.hintHost.appendChild(this.flag)
|
||||||
target.classList.add('TridactylHintElem')
|
target.classList.add('TridactylHintElem')
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"content.js"
|
"content.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
|
"static/cleanslate.css",
|
||||||
"static/content.css",
|
"static/content.css",
|
||||||
"static/hint.css"
|
"static/hint.css"
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
<link rel="stylesheet" href="cleanslate.css">
|
||||||
<link rel="stylesheet" href="commandline.css">
|
<link rel="stylesheet" href="commandline.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#cmdline_iframe {
|
#cmdline_iframe {
|
||||||
position: fixed;
|
position: fixed !important;
|
||||||
bottom: 0;
|
bottom: 0 !important;
|
||||||
left: 0;
|
left: 0 !important;
|
||||||
z-index: 2147483647;
|
z-index: 2147483647 !important;
|
||||||
width: 100%;
|
width: 100% !important;
|
||||||
height: 0;
|
height: 0 !important;
|
||||||
border: 0;
|
border: 0 !important;
|
||||||
padding: 0;
|
padding: 0 !important;
|
||||||
margin: 0;
|
margin: 0 !important;
|
||||||
min-height: 0;
|
min-height: 0 !important;
|
||||||
max-height: none;
|
max-height: none !important;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,36 @@
|
||||||
span.TridactylHint {
|
span.TridactylHint {
|
||||||
position: absolute;
|
position: absolute !important;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif !important;
|
||||||
font-size: 12px;
|
font-size: 12px !important;
|
||||||
font-weight: bold;
|
font-weight: bold !important;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase !important;
|
||||||
color: white;
|
color: white !important;
|
||||||
background-color: red;
|
background-color: red !important;
|
||||||
border-color: ButtonShadow;
|
border-color: ButtonShadow !important;
|
||||||
border-width: 0px;
|
border-width: 0px !important;
|
||||||
min-width: .75em;
|
min-width: .75em !important;
|
||||||
border-style: solid;
|
border-style: solid !important;
|
||||||
padding: 0 1pt;
|
padding: 0 1pt !important;
|
||||||
text-align: center;
|
text-align: center !important;
|
||||||
z-index: 2147483647;
|
z-index: 2147483647 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TridactylHintElem, .TridactylHintActive {
|
.TridactylHintElem, .TridactylHintActive {
|
||||||
color: black !important;
|
color: black !important !important;
|
||||||
animation: none;
|
animation: none !important;
|
||||||
transition: unset;
|
transition: unset !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TridactylHintElem {
|
.TridactylHintElem {
|
||||||
background-color: rgba(255, 255, 0, 0.25);
|
background-color: rgba(255, 255, 0, 0.25) !important;
|
||||||
outline: 1px solid #8F5902;
|
outline: 1px solid #8F5902 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TridactylHintActive {
|
.TridactylHintActive {
|
||||||
background-color: #88FF00;
|
background-color: #88FF00 !important;
|
||||||
outline: 1px solid #CC0000;
|
outline: 1px solid #CC0000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.TridactylHintHost {
|
div.TridactylHintHost {
|
||||||
position: static !important;
|
position: static !important !important;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue