Edit style: add Ctrl-S hotkey to save the style

This commit is contained in:
9adefaf01e5bf6426d838cd20eae582d2b6ba647 2015-03-02 01:36:21 +03:00
parent b4173d68f6
commit e8c5c6dfd4
2 changed files with 2 additions and 1 deletions

View File

@ -152,7 +152,7 @@
<div><label for="enabled" id="enabled-label"></label><input type="checkbox" id="enabled"></div> <div><label for="enabled" id="enabled-label"></label><input type="checkbox" id="enabled"></div>
</section> </section>
<button id="to-mozilla"></button><img id="to-mozilla-help" src="help.png"><br><br> <button id="to-mozilla"></button><img id="to-mozilla-help" src="help.png"><br><br>
<button id="save-button"></button> <button id="save-button" title="Ctrl-S"></button>
<a href="manage.html"><button id="cancel-button"></button></a> <a href="manage.html"><button id="cancel-button"></button></a>
<div id="options"> <div id="options">
<h2 id="options-heading"></h2> <h2 id="options-heading"></h2>

View File

@ -15,6 +15,7 @@ sectionTemplate.innerHTML = '<label>' + t('sectionCode') + '</label><textarea cl
var editors = [] // array of all CodeMirror instances var editors = [] // array of all CodeMirror instances
// replace given textarea with the CodeMirror editor // replace given textarea with the CodeMirror editor
function setupCodeMirror(textarea) { function setupCodeMirror(textarea) {
CodeMirror.commands.save = function(cm) { save() }
var cm = CodeMirror.fromTextArea(textarea, { var cm = CodeMirror.fromTextArea(textarea, {
mode: 'css', mode: 'css',
lineNumbers: true, lineNumbers: true,