WebExtension: Added shortcut.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
cd5a4ecf31
commit
42fbf0a55d
|
@ -49,13 +49,13 @@
|
|||
|
||||
"commands":
|
||||
{
|
||||
"open_popup":
|
||||
"_execute_browser_action":
|
||||
{
|
||||
"suggested_key":
|
||||
{
|
||||
"default": "Ctrl+Shift+S"
|
||||
},
|
||||
"description": "Add URI to remwharead."
|
||||
"description": "Open “Add URI”-popup."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
<label for="archive">Use archive.org to archive URIs:</label>
|
||||
<input type="checkbox" id="archive" value="archive" checked/>
|
||||
</form>
|
||||
<p id="shortcuts">You can edit shortcuts using the gear icon at the top right.</p>
|
||||
|
||||
<script src="options.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -16,5 +16,25 @@ function restore_options()
|
|||
});
|
||||
}
|
||||
|
||||
function info_commands(commands)
|
||||
{
|
||||
commands.forEach(
|
||||
function(command)
|
||||
{
|
||||
var element = document.querySelector("#shortcuts");
|
||||
var para = document.createElement("p");
|
||||
|
||||
var text = document.createElement("strong");
|
||||
text.appendChild(document.createTextNode(command.shortcut + ": "));
|
||||
para.appendChild(text);
|
||||
para.appendChild(document.createTextNode(command.description));
|
||||
|
||||
element.appendChild(para);
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', restore_options);
|
||||
document.querySelector("#archive").addEventListener("change", save_options);
|
||||
|
||||
var get_commands = browser.commands.getAll();
|
||||
get_commands.then(info_commands);
|
||||
|
|
Loading…
Reference in New Issue