{"id":700,"date":"2016-05-16T15:25:55","date_gmt":"2016-05-16T14:25:55","guid":{"rendered":"https:\/\/hoover.gplrank.de\/?p=700"},"modified":"2016-05-16T15:30:23","modified_gmt":"2016-05-16T14:30:23","slug":"vbulletin-keyboard-navigation-a-bit-half-but-works","status":"publish","type":"post","link":"https:\/\/hoover.gplrank.de\/?p=700","title":{"rendered":"VBulletin keyboard navigation (a bit half-****, but works)"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.vbulletin.com\/magento\/skin\/frontend\/vbulletin\/default\/images\/logo.gif\" width=\"151\" height=\"37\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>I really don&#8217;t like web forums all that much, I think they all suck in one way or another and I really yearn for the good old USENET days when everybody was free to use their reader of choice&#8230; well, those were the days.<\/p>\n<p>&nbsp;<\/p>\n<p>With &#8220;vBulletin&#8221; being a vey prolific and widespread software for many forums \/ fora \/ forae I visit regularly, I wanted to bring some comfort back to browsing them by adding some simple keyboard navigation using some javascript I freely &#8220;borrowed&#8221; from the web sites out there.<\/p>\n<p>&nbsp;<\/p>\n<p>Here&#8217;s the result:<\/p>\n<p>&nbsp;<\/p>\n<p>&#8220;n&#8221; &#8211; Search for new posts<\/p>\n<p>&#8220;g&#8221; &#8211; go to the first post in the list of new posts<\/p>\n<p>&#8220;j\/k&#8221; &#8211; navigate forward \/ backward in the pages of a thread and \/ or search results<\/p>\n<p>Cut &amp; Paste the script below and save it to a location of your choice, then you can use the \u00a0&#8220;<a href=\"http:\/\/tampermonkey.net\/\">tampermonkey<\/a>&#8221; extension for Chrome and other browsers to enable these features (chrome stopped accepting non-store based extensions a year ago for whatever reasons they saw fit, tampermonkey helps to get chrome back under the user&#8217;s control)<\/p>\n<p>Add the URLs of your favourite forums to the script and import it into tampermonkey (some niftier form of configuration may be on the cards, but I&#8217;m lazy so feel free to add it yourself if you want to).<\/p>\n<p>I hope you find this script useful, enjoy keyboard navigation in vB! \ud83d\ude09<\/p>\n<p><a href=\"https:\/\/hoover.gplrank.de\/wp-content\/uploads\/2016\/05\/vbbi_whatsnew.user_.js\">VBB &#8220;What&#8217;s new&#8221; user Script<\/a><\/p>\n<pre>\/\/ ==UserScript==\r\n\/\/ @name VBB Show new posts\r\n\/\/ @namespace http:\/\/www.schuerkamp.de\/greasemonkeyhacks\/\r\n\/\/ @description Adds a \"whats new\" search link and some shortcuts to vbb forum pages\r\n\/\/ @description Download URL: http:\/\/dl.dropbox.com\/u\/1983539\/isi_whatsnew.user.js\r\n\/\/ ##### ADD THE URL of your vB forums below ##################\r\n\/\/ @include http*:\/\/*isiforums.net\/*\r\n\/\/ @include http*:\/\/*www.bmsforum.org\/*\r\n\/\/ \r\n\/\/ ==\/UserScript==\r\n\r\nvar EuropeanDateFormat=1; \r\nvar newlink = document.createElement('a');\r\nvar todays_posts = document.createElement('a');\r\nnewlink.href = 'search.php?do=getnew&amp;contenttype=vBForum_Post';\r\ntodays_posts.href = 'search.php?do=getdaily&amp;contenttype=vBForum_Post';\r\ntn = document.createTextNode(' Show new posts ');\r\nnewlink.appendChild(tn);\r\ntn2 = document.createTextNode(' Show todays posts');\r\ntodays_posts.appendChild(tn2);\r\n\r\nvar footer = document.getElementById('footer_links');\r\n\r\nif (footer) {\r\n footer.appendChild(newlink);\r\n footer.appendChild(todays_posts); \r\n}\r\n\r\n\/\/ quick hack to set a default email address\r\nfrom = document.getElementById('it_from_3');\r\nif (from) {\r\n from.value=\"beta-applications@imagespaceinc.com\"; \r\n}\r\n\r\nif (EuropeanDateFormat == 1) {\r\n var dates = document.getElementsByClassName('date');\r\n for (var i = 0 ; i &lt; dates.length ; i++) {\r\n var post_date = dates[i].innerText;\r\n \/\/ check if there's a year string in the -2012 notation (will stop working in 2100 ;-) \r\n if (post_date.indexOf(\"-20\") != -1 ) {\r\n year = post_date.substring(6, 10);\r\n month = post_date.substring(0, 2);\r\n day = post_date.substring(3, 5);\r\n var new_date = \"\"; \r\n dates[i].innerText = year + \"\/\" + month + \"\/\" + day; \r\n }\r\n } \r\n}\r\n\r\n\/\/ stolen shamelessly from userscript.org's facebook key navigation\r\n\/\/ Thanks to Droll Troll\r\n\r\nfunction OnKeyUp(e)\r\n{\r\n var anchors = document.getElementsByTagName('a');\r\n for (var i = 0 ; i &lt; anchors.length ; i++) {\r\n var href = anchors[i].getAttribute('href'); \r\n if (href) {\r\n if(href.match(\/goto=newpost\/)) {\r\n break ; \r\n }\r\n }\r\n } \r\n\r\n \/\/ do a search if we cannot find the \"next page\" link\r\n next_page_or_new =\"search.php?do=getnew&amp;contenttype=vBForum_Post\"\r\n for (var i = 0 ; i &lt; anchors.length ; i++) {\r\n var next_page_href = anchors[i].getAttribute('href'); \r\n var title01 = anchors[i].getAttribute('title'); \r\n if (title01) {\r\n if(title01.match(\/Next Page\/)) {\r\n next_page_or_new = next_page_href\r\n break ; \r\n }\r\n }\r\n } \r\n\r\n prev_page_or_new =\"search.php?do=getnew&amp;contenttype=vBForum_Post\"\r\n for (var i = 0 ; i &lt; anchors.length ; i++) {\r\n var prev_page_href = anchors[i].getAttribute('href'); \r\n var title01 = anchors[i].getAttribute('title'); \r\n if (title01) {\r\n if(title01.match(\/Prev Page\/)) {\r\n prev_page_or_new = prev_page_href\r\n break ; \r\n }\r\n }\r\n } \r\n\r\n key_map = {\r\n \"N\" : \"search.php?do=getnew&amp;contenttype=vBForum_Post\",\r\n \"G\" : href,\r\n \"K\" : next_page_or_new, \r\n \"J\" : prev_page_or_new, \r\n \"T\" : 'search.php?do=getdaily&amp;contenttype=vBForum_Post'\r\n }\r\n\r\n if (String.fromCharCode(e.keyCode) in key_map &amp;&amp; \r\n (typeof e.target.type == \"undefined\" || (e.target.type != \"text\" &amp;&amp; e.target.type != \"textarea\")) &amp;&amp; \r\n !e.altKey &amp;&amp; !e.ctrlKey &amp;&amp; e.keyCode &lt;= 90)\r\n {\r\n window.location.replace(key_map[String.fromCharCode(e.keyCode)])\r\n }\r\n}\r\n\r\nwindow.addEventListener(\"keyup\",function(event) { OnKeyUp(event); },false)\r\n\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; I really don&#8217;t like web forums all that much, I think they all suck in one way or another and I really yearn for the good old USENET days when everybody was free to use their reader of choice&#8230; well, those were the days. &nbsp; With &#8220;vBulletin&#8221; being a vey prolific and widespread software [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-700","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=700"}],"version-history":[{"count":2,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/700\/revisions"}],"predecessor-version":[{"id":703,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=\/wp\/v2\/posts\/700\/revisions\/703"}],"wp:attachment":[{"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hoover.gplrank.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}