From 40b475d6fb3697ad4815fd238adf31d85fba494f Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Sat, 14 Feb 2015 01:13:07 -0600 Subject: [PATCH 1/7] add new options --- background.js | 1 + core.js | 18 ++++++ manifest.json | 6 +- options.html | 19 ++++++ options.js | 20 ++++++ shortcuts.js | 166 +++++++++++++++++++++++++++++--------------------- 6 files changed, 158 insertions(+), 72 deletions(-) create mode 100644 options.html create mode 100644 options.js diff --git a/background.js b/background.js index 973c32d..2464655 100644 --- a/background.js +++ b/background.js @@ -14,4 +14,5 @@ chrome.webNavigation.onCompleted.addListener(function (details) { ITCheck.getUnreadThreadCount(null); },{url: [{hostSuffix: 'ivorytower.com', pathPrefix: '/IvoryTower/ForumThread.aspx'}]}); +}); })(window); \ No newline at end of file diff --git a/core.js b/core.js index adcc38a..0f655c1 100644 --- a/core.js +++ b/core.js @@ -57,9 +57,27 @@ chrome.browserAction.setTitle({ title: newTitle}); } + function storageGet(key, callback){ + var k = key; + chrome.storage.sync.get(k, function(storageObj){ + callback(storageObj[k]); + }) + } + + function storageSet(key, val){ + var pair = {}; + pair[key] = val; + chrome.storage.sync.set(pair, function(done){ + console.log(done); + }); + } + + // core exports window.ITCheck.getUnreadThreadCount = getUnreadThreadCount; window.ITCheck.shouldSkipRequest = shouldSkipRequest; window.ITCheck.updateBadge = updateBadge; window.ITCheck.setTitle = setTitle; window.ITCheck.baseUrl = baseUrl; + window.ITCheck.storageGet = storageGet; + window.ITCheck.storageSet = storageSet; })(window); \ No newline at end of file diff --git a/manifest.json b/manifest.json index eec3d1a..4050605 100644 --- a/manifest.json +++ b/manifest.json @@ -16,8 +16,10 @@ "permissions": [ "alarms", "webNavigation", - "http://ivorytower.com/" + "http://ivorytower.com/", + "storage" ], + "options_page": "options.html", "background": { "scripts": ["jquery-2.1.3.min.js", "core.js", "background.js"], "persistent": false @@ -25,7 +27,7 @@ "content_scripts": [ { "matches": ["http://*.ivorytower.com/*"], - "js": ["jquery-2.1.3.min.js", "core.js", "cohort-year-adder.js", "shortcuts.js"] + "js": ["jquery-2.1.3.min.js", "cohort-year-adder.js", "shortcuts.js"] } ], "manifest_version": 2 diff --git a/options.html b/options.html new file mode 100644 index 0000000..7e64f6b --- /dev/null +++ b/options.html @@ -0,0 +1,19 @@ + + + + + + + +

IvoryTower Checker

+
+

Options

+
+ + +
+ + +
+ + \ No newline at end of file diff --git a/options.js b/options.js new file mode 100644 index 0000000..aef8519 --- /dev/null +++ b/options.js @@ -0,0 +1,20 @@ +$(function(){ + window.ITCheck = window.ITCheck || {}; + + window.addEventListener('load', function() { + ITCheck.storageGet('showCohorts', function(val){ + options.showCohorts.checked = val; + }); + ITCheck.storageGet('shortcuts', function(val){ + options.shortcuts.checked = val; + }); + }); + + options.showCohorts.onchange = function() { + ITCheck.storageSet('showCohorts', options.showCohorts.checked); + }; + + options.shortcuts.onchange = function() { + ITCheck.storageSet('shortcuts', options.shortcuts.checked); + }; +}); \ No newline at end of file diff --git a/shortcuts.js b/shortcuts.js index 9400583..82c30ea 100644 --- a/shortcuts.js +++ b/shortcuts.js @@ -1,78 +1,104 @@ (function(win, $){ - function doNextUnreadThread(){ - var masterLink = $('#Master_ctl08 a[href*="ForumThread.aspx"]'); - if(masterLink.length > 0){ - console.log('moving to next unread thread'); - masterLink[0].click(); - }else{ - console.log('no unread threads'); - } - }; - - function jumpToNextPost(){ - if( $("#Post" + (currentPostNumber + 1)).length > 0 ){ - $("#Post" + currentPostNumber).css({"border-left-width": 1, "padding-left": 11}); - currentPostNumber++; - location.hash = 'Post'+currentPostNumber; - $("#Post" + currentPostNumber).css({"border-left-width": 3, "padding-left": 10}); - } - }; - - function jumpToPreviousPost(){ - if( $("#Post" + (currentPostNumber - 1)).length > 0 ){ - $("#Post" + currentPostNumber).css({"border-left-width": 1, "padding-left": 11}); - currentPostNumber--; - location.hash = 'Post'+currentPostNumber; - $("#Post" + currentPostNumber).css({"border-left-width": 3, "padding-left": 10}); - } - } - function ratePost(up){ - var postIdSelector = '#Post' + currentPostNumber; - var rateLinks = $(postIdSelector + ' span.Button a'); - if(up){ - rateLinks[0].click(); - }else{ - rateLinks[1].click(); + function runShortcuts(val){ + if(!val){ + return; } - } - - function showHiddenPosts(){ - $('.Clipped a')[0].click(); - } - - window.onkeypress = function(e){ - var tagKeyedIn = e.target.tagName.toLowerCase(); - if(tagKeyedIn !== 'input' && tagKeyedIn !== 'textarea'){ - if(e.which === 106){ - // j for next post - jumpToNextPost(); - }else if(e.which === 107){ - // k for previous post - jumpToPreviousPost(); - }else if(e.which === 117){ - // u for next unread thread - doNextUnreadThread(); - }else if(e.which === 97){ - // a for rate up - ratePost(true); - }else if(e.which === 102){ - // f for rate down - ratePost(false); - }else if(e.which === 104){ - // h for hidden - showHiddenPosts(); + + function doNextUnreadThread(){ + var masterLink = $('#Master_ctl08 a[href*="ForumThread.aspx"]'); + if(masterLink.length > 0){ + console.log('moving to next unread thread'); + masterLink[0].click(); + }else{ + console.log('no unread threads'); + } + }; + + function jumpToNextPost(){ + var nextEl = $("#Post" + (parseInt(currentPostNumber) + 1)); + if(nextEl.length){ + var currentEl = $("#Post" + currentPostNumber); + currentEl.css({"border-left-width": 1, "padding-left": 11}); + currentPostNumber++; + location.hash = 'Post'+currentPostNumber; + nextEl.css({"border-left-width": 3, "padding-left": 10}); + } + }; + + function jumpToPreviousPost(){ + var previousEl = $("#Post" + (parseInt(currentPostNumber) - 1)); + if(previousEl.length){ + var currentEl = $("#Post" + currentPostNumber); + currentEl.css({"border-left-width": 1, "padding-left": 11}); + currentPostNumber--; + location.hash = 'Post'+currentPostNumber; + previousEl.css({"border-left-width": 3, "padding-left": 10}); } } - }; - - //determine current post number - var firstNewPostId = $('span#New').parent().id; - if(!firstNewPostId || firstNewPostId.indexOf('Post') !== 0){ - firstNewPostId = $('.ForumThread td').last()[0].id + + function ratePost(up){ + var postIdSelector = '#Post' + currentPostNumber; + var rateLinks = $(postIdSelector + ' span.Button a'); + if(up){ + rateLinks[0].click(); + }else{ + rateLinks[1].click(); + } + } + + function showHiddenPosts(){ + $('.Clipped a')[0].click(); + } + + win.onkeypress = function(e){ + var tagKeyedIn = e.target.tagName.toLowerCase(); + if(tagKeyedIn !== 'input' && tagKeyedIn !== 'textarea'){ + if(e.which === 106){ + // j for next post + jumpToNextPost(); + }else if(e.which === 107){ + // k for previous post + jumpToPreviousPost(); + }else if(e.which === 117){ + // u for next unread thread + doNextUnreadThread(); + }else if(e.which === 97){ + // a for rate up + ratePost(true); + }else if(e.which === 102){ + // f for rate down + ratePost(false); + }else if(e.which === 104){ + // h for hidden + showHiddenPosts(); + } + } + }; + + //determine current post number + var firstNewPostId = $('span#New').parent().id; + if(!firstNewPostId || firstNewPostId.indexOf('Post') !== 0){ + var threadTds = $('.ForumThread td'); + if(threadTds.length){ + firstNewPostId = threadTds.last()[0].id + } + } + if(location.hash && location.hash.indexOf('Post') === 1){ + firstNewPostId = location.hash.substring(1); + } + if(firstNewPostId){ + var currentPostNumber = firstNewPostId.substring(4); + location.hash = 'Post'+currentPostNumber; + $("#Post" + currentPostNumber).css({"border-left-width": 3, "padding-left": 10}); + } } - if(location.hash && location.hash.indexOf('Post') === 1){ - firstNewPostId = location.hash.substring(1); + + function storageGet(key, callback){ + var k = key; + chrome.storage.sync.get(k, function(storageObj){ + callback(storageObj[k]); + }); } - var currentPostNumber = firstNewPostId.substring(4); + storageGet('shortcuts', runShortcuts); }(window, jQuery)) \ No newline at end of file From 2102713eb7fec1758c3b5ad0c7c7b64e466dc157 Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Sat, 14 Feb 2015 01:19:44 -0600 Subject: [PATCH 2/7] Cleanup of options --- background.js | 1 - cohort-year-adder.js | 37 +++++++++++++++++++++++++------------ core.js | 4 +--- options.html | 2 ++ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/background.js b/background.js index 2464655..973c32d 100644 --- a/background.js +++ b/background.js @@ -14,5 +14,4 @@ chrome.webNavigation.onCompleted.addListener(function (details) { ITCheck.getUnreadThreadCount(null); },{url: [{hostSuffix: 'ivorytower.com', pathPrefix: '/IvoryTower/ForumThread.aspx'}]}); -}); })(window); \ No newline at end of file diff --git a/cohort-year-adder.js b/cohort-year-adder.js index 3bb946f..6867e34 100644 --- a/cohort-year-adder.js +++ b/cohort-year-adder.js @@ -6,16 +6,29 @@ // @include http://ivorytower.dyndns.org/* // @include http://ivorytower.go.dyndns.org/* // ==/UserScript== +(function(){ + var years = { + // Sanitized for GitHub. Added back on building. + }; -var years = { - // Sanitized for GitHub. Added back on building. -}; - -var elements = document.evaluate("//a[starts-with(@href,'ProfileShow.aspx')]", - document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); -for(var i = 0; i < elements.snapshotLength; i++) { - var cur = elements.snapshotItem(i); - var name = cur.getAttribute('href').split('=')[1]; - var year = document.createTextNode(" (" + years[name] + ")"); - cur.appendChild(year); -} \ No newline at end of file + function runadder(showCohorts){ + if(showCohorts){ + var elements = document.evaluate("//a[starts-with(@href,'ProfileShow.aspx')]", + document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); + for(var i = 0; i < elements.snapshotLength; i++) { + var cur = elements.snapshotItem(i); + var name = cur.getAttribute('href').split('=')[1]; + var year = document.createTextNode(" (" + years[name] + ")"); + cur.appendChild(year); + } + } + } + + function storageGet(key, callback){ + var k = key; + chrome.storage.sync.get(k, function(storageObj){ + callback(storageObj[k]); + }); + } + storageGet('showCohorts', runadder); +})(); \ No newline at end of file diff --git a/core.js b/core.js index 0f655c1..2c1f3e5 100644 --- a/core.js +++ b/core.js @@ -67,9 +67,7 @@ function storageSet(key, val){ var pair = {}; pair[key] = val; - chrome.storage.sync.set(pair, function(done){ - console.log(done); - }); + chrome.storage.sync.set(pair); } // core exports diff --git a/options.html b/options.html index 7e64f6b..6f01267 100644 --- a/options.html +++ b/options.html @@ -14,6 +14,8 @@

Options


+
+

TODO: custom shortcut keys

\ No newline at end of file From 3449d48b1c5f57868f2db50e3cd3dc311095da92 Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Mon, 16 Feb 2015 00:12:00 -0600 Subject: [PATCH 3/7] Updated options to add customizable shortcuts --- cohort-year-adder.js | 2 +- core.js | 5 ++++ manifest.json | 6 ++--- options.html | 60 +++++++++++++++++++++++++++++++++----------- options.js | 37 +++++++++++++++++++++------ popup.html | 3 +++ popup.js | 2 +- shortcuts.js | 57 +++++++++++++++++++++++------------------ style.css | 45 ++++++++++++++++++++++++++++++++- 9 files changed, 164 insertions(+), 53 deletions(-) diff --git a/cohort-year-adder.js b/cohort-year-adder.js index 6867e34..73dd9b0 100644 --- a/cohort-year-adder.js +++ b/cohort-year-adder.js @@ -30,5 +30,5 @@ callback(storageObj[k]); }); } - storageGet('showCohorts', runadder); + storageGet('ITCheck.showCohorts', runadder); })(); \ No newline at end of file diff --git a/core.js b/core.js index 2c1f3e5..c4af4e9 100644 --- a/core.js +++ b/core.js @@ -70,6 +70,9 @@ chrome.storage.sync.set(pair); } + var shortcutKeys = ["nextPost","previousPost","unreadThread","rateUp","rateDown","showHidden"]; + storageSet("ITCheck.shortcutKeys", shortcutKeys); + // core exports window.ITCheck.getUnreadThreadCount = getUnreadThreadCount; window.ITCheck.shouldSkipRequest = shouldSkipRequest; @@ -78,4 +81,6 @@ window.ITCheck.baseUrl = baseUrl; window.ITCheck.storageGet = storageGet; window.ITCheck.storageSet = storageSet; + //window.ITCheck.shortcutKeys = shortcutKeys; + })(window); \ No newline at end of file diff --git a/manifest.json b/manifest.json index 4050605..ec5677d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { "name": "IvoryTower Checker", "short_name": "IT Check", - "author": "Cody Jung", - "version": "1.3.0", - "description": "Checks IvoryTower for unread threads", + "author": "Cody Jung, Eric Clymer", + "version": "1.4.0", + "description": "Checks IvoryTower for unread threads, adds misc other functionality.", "icons": { "48": "icon48.png", "128": "icon128.png" diff --git a/options.html b/options.html index 6f01267..d2ecb53 100644 --- a/options.html +++ b/options.html @@ -1,21 +1,53 @@ - - + -

IvoryTower Checker

-
-

Options

-
- - -
- - -
-

TODO: custom shortcut keys

-
+

IvoryTower Checker

+
+

Options

+
+
+
+ + +
+
+ + +
+
+
+

Customize Shortcut Keys

+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + \ No newline at end of file diff --git a/options.js b/options.js index aef8519..3f0e5e2 100644 --- a/options.js +++ b/options.js @@ -1,20 +1,41 @@ -$(function(){ +(function(window, $){ window.ITCheck = window.ITCheck || {}; - - window.addEventListener('load', function() { - ITCheck.storageGet('showCohorts', function(val){ + + ITCheck.storageGet("ITCheck.shortcutKeys", function(shortcutKeys){ + ITCheck.storageGet('ITCheck.showCohorts', function(val){ options.showCohorts.checked = val; }); - ITCheck.storageGet('shortcuts', function(val){ + ITCheck.storageGet('ITCheck.shortcuts', function(val){ options.shortcuts.checked = val; }); + for(var i = 0; i < shortcutKeys.length; i++){ + var shortcutKey = shortcutKeys[i]; + populateShortcutKey(shortcutKey); + } + for(var i = 0; i < shortcutKeys.length; i++){ + var shortcutKey = shortcutKeys[i]; + options[shortcutKey].onchange = function(e, shortcutKey){ + var target = e.target; + ITCheck.storageSet('ITCheck.shortcutKey.'+target.name, target.value); + } + } }); + + function populateShortcutKey(shortcutKey){ + ITCheck.storageGet('ITCheck.shortcutKey.'+shortcutKey, function(val){ + if(val){ + options[shortcutKey].value = val; + } + }); + } + var options = $('#options')[0]; options.showCohorts.onchange = function() { - ITCheck.storageSet('showCohorts', options.showCohorts.checked); + ITCheck.storageSet('ITCheck.showCohorts', options.showCohorts.checked); }; options.shortcuts.onchange = function() { - ITCheck.storageSet('shortcuts', options.shortcuts.checked); + ITCheck.storageSet('ITCheck.shortcuts', options.shortcuts.checked); + $('#shortcutSection').toggle(options.shortcuts.checked); }; -}); \ No newline at end of file +})(window, jQuery); \ No newline at end of file diff --git a/popup.html b/popup.html index 118f135..fd1b623 100644 --- a/popup.html +++ b/popup.html @@ -8,5 +8,8 @@
Loading...
+
+ Options +
\ No newline at end of file diff --git a/popup.js b/popup.js index 35cb89a..4494661 100644 --- a/popup.js +++ b/popup.js @@ -43,7 +43,7 @@ } else { // Or set it to blank ITCheck.updateBadge(""); - updatePopup("No unread threads.
Go to IvoryTower Today"); + updatePopup("No unread threads.
Go to IvoryTower Today
"); $("#ITToday").click(function() { openIvoryTowerToday(); diff --git a/shortcuts.js b/shortcuts.js index 82c30ea..345fb6a 100644 --- a/shortcuts.js +++ b/shortcuts.js @@ -51,31 +51,38 @@ $('.Clipped a')[0].click(); } - win.onkeypress = function(e){ - var tagKeyedIn = e.target.tagName.toLowerCase(); - if(tagKeyedIn !== 'input' && tagKeyedIn !== 'textarea'){ - if(e.which === 106){ - // j for next post - jumpToNextPost(); - }else if(e.which === 107){ - // k for previous post - jumpToPreviousPost(); - }else if(e.which === 117){ - // u for next unread thread - doNextUnreadThread(); - }else if(e.which === 97){ - // a for rate up - ratePost(true); - }else if(e.which === 102){ - // f for rate down - ratePost(false); - }else if(e.which === 104){ - // h for hidden - showHiddenPosts(); - } + storageGet("ITCheck.shortcutKeys", function(shortcutKeys){ + var shortcutCodes = {}; + + function initializeShortcutKeyCode(shortcutKey){ + storageGet('ITCheck.shortcutKey.'+shortcutKey, function(val){ + shortcutCodes[shortcutKey] = val.charCodeAt(0); + }); } - }; - + + for(var i = 0; i < shortcutKeys.length; i++){ + initializeShortcutKeyCode(shortcutKeys[i]); + } + + win.onkeypress = function(e){ + var tagKeyedIn = e.target.tagName.toLowerCase(); + if(tagKeyedIn !== 'input' && tagKeyedIn !== 'textarea'){ + if(e.which === shortcutCodes["nextPost"]){ + jumpToNextPost(); + }else if(e.which === shortcutCodes["previousPost"]){ + jumpToPreviousPost(); + }else if(e.which === shortcutCodes["unreadThread"]){ + doNextUnreadThread(); + }else if(e.which === shortcutCodes["rateUp"]){ + ratePost(true); + }else if(e.which === shortcutCodes["rateDown"]){ + ratePost(false); + }else if(e.which === shortcutCodes["showHidden"]){ + showHiddenPosts(); + } + } + }; + }); //determine current post number var firstNewPostId = $('span#New').parent().id; if(!firstNewPostId || firstNewPostId.indexOf('Post') !== 0){ @@ -100,5 +107,5 @@ callback(storageObj[k]); }); } - storageGet('shortcuts', runShortcuts); + storageGet('ITCheck.shortcuts', runShortcuts); }(window, jQuery)) \ No newline at end of file diff --git a/style.css b/style.css index 8f37459..13b09d4 100644 --- a/style.css +++ b/style.css @@ -2,12 +2,17 @@ body{ color:#333; font-family:Arial, Helevetica, sans-serif; font-size:10pt; + text-align:center; +} + +div{ + margin-top:10px; + margin-bottom:10px; } #result{ width:350px; margin:0px auto; - text-align:center; } #empty{ @@ -18,4 +23,42 @@ body{ font-style:italic; cursor:pointer; color:#CCC; +} + +#shortcutSection{ + text-align:left; + width:300px; + margin:auto; + height:300px; +} + +.shortcutKey{ + height:20px; +} + +.shortcutKey label{ + float: left; +} + +.shortcutKey input{ + float: right; +} + +#topLevelSettings{ + text-align:left; + width:300px; + margin:auto; + height:70px; +} + +.topLevelSetting{ + height:20px; +} + +.topLevelSetting label{ + float: left; +} + +.topLevelSetting input{ + float: right; } \ No newline at end of file From 025cbc0b6dcc7e26ab987fa0d85261a46e5e0d04 Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Mon, 16 Feb 2015 20:42:03 -0600 Subject: [PATCH 4/7] Options page on install. Defaults --- background.js | 3 ++- options.js | 12 ++++++++++-- popup.html | 3 --- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/background.js b/background.js index 973c32d..9d00402 100644 --- a/background.js +++ b/background.js @@ -8,10 +8,11 @@ }); chrome.runtime.onInstalled.addListener(function(details) { chrome.alarms.create("updater", { "periodInMinutes": 1 }); + chrome.tabs.create({url: "options.html"}, function (tab) {}); }); // Update number on navigate to a new thread chrome.webNavigation.onCompleted.addListener(function (details) { ITCheck.getUnreadThreadCount(null); },{url: [{hostSuffix: 'ivorytower.com', pathPrefix: '/IvoryTower/ForumThread.aspx'}]}); -})(window); \ No newline at end of file +})(window); \ No newline at end of file diff --git a/options.js b/options.js index 3f0e5e2..7adace2 100644 --- a/options.js +++ b/options.js @@ -3,10 +3,18 @@ ITCheck.storageGet("ITCheck.shortcutKeys", function(shortcutKeys){ ITCheck.storageGet('ITCheck.showCohorts', function(val){ - options.showCohorts.checked = val; + if(val){ + options.showCohorts.checked = val; + }else{ + ITCheck.storageSet('ITCheck.showCohorts', true); + } }); ITCheck.storageGet('ITCheck.shortcuts', function(val){ - options.shortcuts.checked = val; + if(val){ + options.shortcuts.checked = val; + }else{ + ITCheck.storageSet('ITCheck.shortcuts', true); + } }); for(var i = 0; i < shortcutKeys.length; i++){ var shortcutKey = shortcutKeys[i]; diff --git a/popup.html b/popup.html index fd1b623..118f135 100644 --- a/popup.html +++ b/popup.html @@ -8,8 +8,5 @@
Loading...
-
- Options -
\ No newline at end of file From f6cde3c1653b9898588e6bd3eb0bfd95b2595b6a Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Mon, 16 Feb 2015 20:46:46 -0600 Subject: [PATCH 5/7] Reflect default --- options.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/options.js b/options.js index 7adace2..487f7a3 100644 --- a/options.js +++ b/options.js @@ -7,14 +7,18 @@ options.showCohorts.checked = val; }else{ ITCheck.storageSet('ITCheck.showCohorts', true); + val = true; } + options.showCohorts.checked = val; }); ITCheck.storageGet('ITCheck.shortcuts', function(val){ if(val){ options.shortcuts.checked = val; }else{ ITCheck.storageSet('ITCheck.shortcuts', true); + val = true; } + options.shortcuts.checked = val; }); for(var i = 0; i < shortcutKeys.length; i++){ var shortcutKey = shortcutKeys[i]; From 2051904dc1b5be8ea569424774fc4b9db5f10097 Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Mon, 16 Feb 2015 21:15:49 -0600 Subject: [PATCH 6/7] Default shortcut keys --- shortcuts.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shortcuts.js b/shortcuts.js index 345fb6a..e2ddf22 100644 --- a/shortcuts.js +++ b/shortcuts.js @@ -67,17 +67,17 @@ win.onkeypress = function(e){ var tagKeyedIn = e.target.tagName.toLowerCase(); if(tagKeyedIn !== 'input' && tagKeyedIn !== 'textarea'){ - if(e.which === shortcutCodes["nextPost"]){ + if(e.which === (shortcutCodes["nextPost"] || 106)){ jumpToNextPost(); - }else if(e.which === shortcutCodes["previousPost"]){ + }else if(e.which === (shortcutCodes["previousPost"] || 107)){ jumpToPreviousPost(); - }else if(e.which === shortcutCodes["unreadThread"]){ + }else if(e.which === (shortcutCodes["unreadThread"] || 110)){ doNextUnreadThread(); - }else if(e.which === shortcutCodes["rateUp"]){ + }else if(e.which === (shortcutCodes["rateUp"] || 117)){ ratePost(true); - }else if(e.which === shortcutCodes["rateDown"]){ + }else if(e.which === (shortcutCodes["rateDown"] || 100)){ ratePost(false); - }else if(e.which === shortcutCodes["showHidden"]){ + }else if(e.which === (shortcutCodes["showHidden"] || 104)){ showHiddenPosts(); } } From acaad172015f4a1945e160f64dffe17868c0ab7c Mon Sep 17 00:00:00 2001 From: Eric Clymer Date: Mon, 16 Feb 2015 21:29:05 -0600 Subject: [PATCH 7/7] Chnge plceholders --- options.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/options.html b/options.html index d2ecb53..0feee51 100644 --- a/options.html +++ b/options.html @@ -30,15 +30,15 @@

Customize Shortcut Keys

- +
- +
- +