From ea945cc4b7a7361dad5177572b3aee53aac2b122 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 1 Jan 2012 04:19:21 +0100 Subject: [PATCH 1/2] Whoa, what? Fix mime-type acceptance. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c01bdd971..979700ab4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1497,7 +1497,7 @@ $.on($('#recaptcha_challenge_field_holder'), 'DOMNodeInserted', qr.captchaNode); qr.captchaTime = Date.now(); qr.spoiler = $('.postarea label') ? '' : ''; - qr.acceptFiles = $('.rules').textContent.match(/: (.+) /)[1].replace(/\w+/g, function(type) { + qr.acceptFiles = $('.rules').textContent.match(/: (.+)/)[1].replace(/\w+/g, function(type) { switch (type) { case 'JPG': return 'image/JPEG'; diff --git a/script.coffee b/script.coffee index 637ad3bd8..7632d65c1 100644 --- a/script.coffee +++ b/script.coffee @@ -1123,7 +1123,7 @@ qr = qr.captchaTime = Date.now() qr.spoiler = if $('.postarea label') then '' else '' - qr.acceptFiles = $('.rules').textContent.match(/: (.+) /)[1].replace /\w+/g, (type) -> + qr.acceptFiles = $('.rules').textContent.match(/: (.+)/)[1].replace /\w+/g, (type) -> switch type when 'JPG' 'image/JPEG' From c490bc616e1e2433389e02ad9cdcecd333d933b9 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 1 Jan 2012 15:23:46 +0100 Subject: [PATCH 2/2] Keybind to open the options: ctrl+o. Close #86 --- 4chan_x.user.js | 7 ++++++- changelog | 1 + script.coffee | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 979700ab4..d8f980701 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -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 @@
Keybinds are disabled.
\ \ \ + \ \ \ \ diff --git a/changelog b/changelog index 42e956a24..f3b39266d 100644 --- a/changelog +++ b/changelog @@ -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=) diff --git a/script.coffee b/script.coffee index 7632d65c1..2175ab9c1 100644 --- a/script.coffee +++ b/script.coffee @@ -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 =
Keybinds are disabled.
ActionsKeybinds
Open Options
Close Options or QR
Quick spoiler
Open QR with post number inserted
+
ActionsKeybinds
Open Options
Close Options or QR
Quick spoiler
Open QR with post number inserted