Keybind to open the options: ctrl+o. Close #86

This commit is contained in:
Nicolas Stepien 2012-01-01 15:23:46 +01:00
parent ea945cc4b7
commit c490bc616e
3 changed files with 12 additions and 2 deletions

View File

@ -139,6 +139,7 @@
backlink: '>>%id',
favicon: 'ferongr',
hotkeys: {
openOptions: 'ctrl+o',
close: 'Esc',
spoiler: 'ctrl+s',
openQR: 'i',
@ -893,8 +894,11 @@
if (!(key = keybinds.keyCode(e))) return;
thread = nav.getThread();
switch (key) {
case conf.openOptions:
if (!$.id('overlay')) options.dialog();
break;
case conf.close:
if (o = $('#overlay')) {
if (o = $.id('overlay')) {
$.rm(o);
} else if (qr.el) {
qr.close();
@ -1305,6 +1309,7 @@
<div class=error><code>Keybinds</code> are disabled.</div>\
<table><tbody>\
<tr><th>Actions</th><th>Keybinds</th></tr>\
<tr><td>Open Options</td><td><input name=openOptions></td></tr>\
<tr><td>Close Options or QR</td><td><input name=close></td></tr>\
<tr><td>Quick spoiler</td><td><input name=spoiler></td></tr>\
<tr><td>Open QR with post number inserted</td><td><input name=openQR></td></tr>\

View File

@ -1,6 +1,7 @@
master
- mayhem
redirect 404'd pictures to archives when possible
new keybind to open the options: ctrl+o
the unread count will decrease when inlining quotes of unread posts
the report button can open multiple popups again
add omploader to the list of optional flavors (http://ompldr.org/upload?url1=)

View File

@ -70,6 +70,7 @@ config =
backlink: '>>%id'
favicon: 'ferongr'
hotkeys:
openOptions: 'ctrl+o'
close: 'Esc'
spoiler: 'ctrl+s'
openQR: 'i'
@ -649,8 +650,10 @@ keybinds =
thread = nav.getThread()
switch key
when conf.openOptions
options.dialog() unless $.id 'overlay'
when conf.close
if o = $ '#overlay'
if o = $.id 'overlay'
$.rm o
else if qr.el
qr.close()
@ -966,6 +969,7 @@ options =
<div class=error><code>Keybinds</code> are disabled.</div>
<table><tbody>
<tr><th>Actions</th><th>Keybinds</th></tr>
<tr><td>Open Options</td><td><input name=openOptions></td></tr>
<tr><td>Close Options or QR</td><td><input name=close></td></tr>
<tr><td>Quick spoiler</td><td><input name=spoiler></td></tr>
<tr><td>Open QR with post number inserted</td><td><input name=openQR></td></tr>