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

View File

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

View File

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