From b4915d6b150d9c47588f028724dd12b6cd634308 Mon Sep 17 00:00:00 2001 From: James Campos Date: Thu, 23 Jun 2011 13:22:41 -0700 Subject: [PATCH 1/2] not plural --- 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 7d53d2dda..b5f076fca 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -989,7 +989,7 @@ var arr, checked, description, dialog, hiddenNum, hiddenThreads, html, input, key, li, link, main, obj, overlay, ul, _i, _j, _k, _len, _len2, _len3, _ref, _ref2, _ref3, _ref4; hiddenThreads = $.getValue("hiddenThreads/" + g.BOARD + "/", {}); hiddenNum = Object.keys(g.hiddenReplies).length + Object.keys(hiddenThreads).length; - html = "

"; + html = "

"; dialog = $.el('div', { id: 'options', innerHTML: html diff --git a/script.coffee b/script.coffee index c91071dc0..f13baa895 100644 --- a/script.coffee +++ b/script.coffee @@ -800,7 +800,7 @@ options = Expand thread Watch thread Hide thread - Expand selected images + Expand selected image Expand all images Update now From 7748f18b965ad98a7303e40a14e1ba8282fa8594 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 23 Jun 2011 22:28:49 +0200 Subject: [PATCH 2/2] Alt & spoiler --- 4chan_x.user.js | 12 ++++++++++-- script.coffee | 8 ++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 7d53d2dda..de712ffb3 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -694,6 +694,7 @@ init: function() { var key; keybinds.close = (key = $.getValue('key/close')) ? key : ''; + keybinds.spoiler = (key = $.getValue('key/spoiler')) ? key : '^s'; keybinds.zero = (key = $.getValue('key/zero')) ? key : '0'; keybinds.openQR = (key = $.getValue('key/openQR')) ? key : 'i'; keybinds.openEmptyQR = (key = $.getValue('key/openEmptyQR')) ? key : 'I'; @@ -729,6 +730,9 @@ if (e.ctrlKey) { key = '^' + key; } + if (e.altKey) { + key = 'alt+' + key; + } } else { if (kc === 27) { key = ''; @@ -748,9 +752,9 @@ case keybinds.close: e.preventDefault(); return $.rm($('#qr')); - case '^s': + case keybinds.spoiler: ta = d.activeElement; - if (ta.nodeName !== 'TEXTAREA') { + if (d.activeElement.nodeName !== 'TEXTAREA') { return; } e.preventDefault(); @@ -770,6 +774,7 @@ thread = nav.getThread(); switch (keybinds.key) { case keybinds.close: + e.preventDefault(); if (o = $('#overlay')) { return $.rm(o); } @@ -1090,6 +1095,9 @@ if (e.ctrlKey) { key = '^' + key; } + if (e.altKey) { + key = 'alt+' + key; + } } else { if (kc === 27) { key = ''; diff --git a/script.coffee b/script.coffee index c91071dc0..a6a156ff2 100644 --- a/script.coffee +++ b/script.coffee @@ -490,6 +490,7 @@ replyHiding = keybinds = init: -> keybinds.close = if key = $.getValue 'key/close' then key else '' + keybinds.spoiler = if key = $.getValue 'key/spoiler' then key else '^s' keybinds.zero = if key = $.getValue 'key/zero' then key else '0' keybinds.openQR = if key = $.getValue 'key/openQR' then key else 'i' keybinds.openEmptyQR = if key = $.getValue 'key/openEmptyQR' then key else 'I' @@ -522,6 +523,7 @@ keybinds = if !e.shiftKey key = key.toLowerCase() if e.ctrlKey then key = '^' + key + if e.altKey then key = 'alt+' + key else if kc is 27 key = '' @@ -537,9 +539,9 @@ keybinds = when keybinds.close e.preventDefault() $.rm $ '#qr' - when '^s' + when keybinds.spoiler ta = d.activeElement - return unless ta.nodeName is 'TEXTAREA' + return unless d.activeElement.nodeName is 'TEXTAREA' e.preventDefault() @@ -559,6 +561,7 @@ keybinds = thread = nav.getThread() switch keybinds.key when keybinds.close + e.preventDefault() $.rm o if o = $ '#overlay' when keybinds.zero window.location = "/#{g.BOARD}/0#0" @@ -880,6 +883,7 @@ options = if !e.shiftKey key = key.toLowerCase() if e.ctrlKey then key = '^' + key + if e.altKey then key = 'alt+' + key else if kc is 27 key = ''