commit
1145eb3478
15 changed files with 167 additions and 71 deletions
@ -0,0 +1,39 @@ |
|||||||
|
export default `{
|
||||||
|
"keymaps": { |
||||||
|
"0": { "type": "scroll.home" }, |
||||||
|
":": { "type": "command.show" }, |
||||||
|
"o": { "type": "command.show.open", "alter": false }, |
||||||
|
"O": { "type": "command.show.open", "alter": true }, |
||||||
|
"t": { "type": "command.show.tabopen", "alter": false }, |
||||||
|
"T": { "type": "command.show.tabopen", "alter": true }, |
||||||
|
"b": { "type": "command.show.buffer" }, |
||||||
|
"k": { "type": "scroll.lines", "count": -1 }, |
||||||
|
"j": { "type": "scroll.lines", "count": 1 }, |
||||||
|
"<C-E>": { "type": "scroll.lines", "count": -1 }, |
||||||
|
"<C-Y>": { "type": "scroll.lines", "count": 1 }, |
||||||
|
"<C-U>": { "type": "scroll.pages", "count": -0.5 }, |
||||||
|
"<C-D>": { "type": "scroll.pages", "count": 0.5 }, |
||||||
|
"<C-B>": { "type": "scroll.pages", "count": -1 }, |
||||||
|
"<C-F>": { "type": "scroll.pages", "count": 1 }, |
||||||
|
"gg": { "type": "scroll.top" }, |
||||||
|
"G": { "type": "scroll.bottom" }, |
||||||
|
"$": { "type": "scroll.end" }, |
||||||
|
"d": { "type": "tabs.close" }, |
||||||
|
"u": { "type": "tabs.reopen" }, |
||||||
|
"h": { "type": "tabs.prev", "count": 1 }, |
||||||
|
"l": { "type": "tabs.next", "count": 1 }, |
||||||
|
"r": { "type": "tabs.reload", "cache": false }, |
||||||
|
"R": { "type": "tabs.reload", "cache": true }, |
||||||
|
"zi": { "type": "zoom.in" }, |
||||||
|
"zo": { "type": "zoom.out" }, |
||||||
|
"zz": { "type": "zoom.neutral" }, |
||||||
|
"f": { "type": "follow.start", "newTab": false }, |
||||||
|
"F": { "type": "follow.start", "newTab": true }, |
||||||
|
"H": { "type": "navigate.history.prev" }, |
||||||
|
"L": { "type": "navigate.history.next" }, |
||||||
|
"[[": { "type": "navigate.link.prev" }, |
||||||
|
"]]": { "type": "navigate.link.next" }, |
||||||
|
"gu": { "type": "navigate.parent" }, |
||||||
|
"gU": { "type": "navigate.root" } |
||||||
|
} |
||||||
|
}`;
|
@ -0,0 +1,22 @@ |
|||||||
|
import './settings.scss'; |
||||||
|
import messages from '../messages'; |
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', () => { |
||||||
|
let form = document.getElementById('vimvixen-settings-form'); |
||||||
|
form.addEventListener('submit', (e) => { |
||||||
|
e.preventDefault(); |
||||||
|
browser.storage.local.set({ |
||||||
|
settings: { |
||||||
|
json: e.target.elements['plain-json'].value |
||||||
|
} |
||||||
|
}).then(() => { |
||||||
|
return browser.runtime.sendMessage({ |
||||||
|
type: messages.SETTINGS_RELOAD |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
browser.storage.local.get('settings').then((value) => { |
||||||
|
form.elements['plain-json'].value = value.settings.json; |
||||||
|
}, console.error); |
||||||
|
}); |
@ -0,0 +1,18 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html> |
||||||
|
<head> |
||||||
|
<meta charset='utf-8'> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<h1>Configure</h1> |
||||||
|
|
||||||
|
<h2>Home page</h2> |
||||||
|
<form id='vimvixen-settings-form' class='vimvixen-settings-form'> |
||||||
|
<label for='load-from-json'>Load from JSON:</label> |
||||||
|
<textarea name='plain-json' spellcheck='false'></textarea> |
||||||
|
|
||||||
|
<button type='submit'>Save</button> |
||||||
|
</form> |
||||||
|
<script src='settings.js'></script> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,8 @@ |
|||||||
|
.vimvixen-settings-form { |
||||||
|
textarea[name=plain-json] { |
||||||
|
font-family: monospace; |
||||||
|
width: 100%; |
||||||
|
min-height: 64ex; |
||||||
|
resize: vertical; |
||||||
|
} |
||||||
|
} |
Reference in new issue