Hi everyone, I browse TA on my iPhone a lot and I find the page navigation of the forum to be a little small for my fingers to press. The "First", "Prev" and "Next" links are a little bigger but it can still be a little difficult to press sometimes. So what I did was to make some bookmarklets to help page navigation for "First Page", "Previous Page", and "Next Page". These bookmarklets would work on navigating pages of a forum as well as pages of a thread. With these bookmarklets, for example: instead of clicking on the small "next" link on the page, you can just open the "Next Page" bookmarklet and it will correctly take you there. I thought I'd share the bookmarklets here: First Page bookmarklet: HTML: javascript:if(document.location.href.indexOf("&page=")!=-1)%7BpageNumber=parseInt(document.location.href.match(/\d+$/));if(pageNumber>1)%7BpageNumber=1;document.location=document.location.href.replace(/\d+$/,pageNumber);%7D%7Dvoid(0) Previous Page bookmarklet: HTML: javascript:if(document.location.href.indexOf("&page=")!=-1)%7BpageNumber=parseInt(document.location.href.match(/\d+$/));if(pageNumber>1)%7BpageNumber=pageNumber-1;document.location=document.location.href.replace(/\d+$/,pageNumber);%7D%7Dvoid(0) Next Page bookmarklet: HTML: javascript:if(document.location.href.indexOf("&page=")==-1)%7Bif(document.location.href.indexOf("showthread")==-1)%7Bdocument.location=document.location.href+"&order=desc&page=2";%7Delse%7Bdocument.location=document.location.href+"&page=2";%7D%7Delse%7BpageNumber=parseInt(document.location.href.match(/\d+$/))+1;document.location=document.location.href.replace(/\d+$/,pageNumber);%7Dvoid(0) If you already know how to install / use these bookmarklets, you may skip the rest of my post. I hope they are useful for you. PM me if you find any bugs Thanks! To install the above bookmarklets from your iPod Touch / iPhone, do the following steps for each bookmarklet separately: Copy the code of the bookmarklet you would like to add (you will need OS 3.0 for this step to be convenient). The code is the long text that starts with "javascript" and ends with "void(0)". Tap the "+" button from the bottom bar of Safari, and select "Add Bookmark" to bookmark the current page. You will be able to edit the name of the bookmark (Enter the name of the bookmarklet, e.g. "Previous Page") and also select where to save the bookmark. The location of the bookmark is not editable (and will point to the current page: "http://forums.toucharcade.com/....". This is fine. We will change it in the next step. Tap save to save the bookmark. Tap the book icon from the bottom bar of Safari to bring up the list of bookmarks. Navigate to where you chose to save the bookmark from the step above and then tap the Edit button (bottom left corner of the screen). Then tap on the bookmark you created earlier. You will be brought to an edit screen but this time, the location of the bookmark is editable (see image below). Delete the location of the bookmark ("http://forums.toucharcade.com/....") and replace it with the code you copied in the first step ("javascript...void(0)"). Tap Done to exit the edit screen, tap Done again to exit editing the bookmarks, and tap Done again to go back to the browser. You are done Do these 4 steps for each of the bookmarklets that you would like to install. I hope its useful. Cheers, Prab PS: In case any of you would like to check the code, here it is in full form: HTML: /* First Page Bookmarklet */ if (document.location.href.indexOf("&page=") != -1) { // if not at the first page pageNumber = parseInt(document.location.href.match(/\d+$/)); if (pageNumber > 1) { // if not at the first page, set the page number to 1 pageNumber = 1; document.location = document.location.href.replace(/\d+$/,pageNumber); } } void(0) /* Previous Page Bookmarklet */ if (document.location.href.indexOf("&page=") != -1) { // if not at the first page pageNumber = parseInt(document.location.href.match(/\d+$/)); if (pageNumber > 1) { // if not at the first page, decrease the page number pageNumber = pageNumber - 1; document.location = document.location.href.replace(/\d+$/,pageNumber); } } void(0) /* Next Page Bookmarklet */ if (document.location.href.indexOf("&page=") == -1) { // if at the first page if (document.location.href.indexOf("showthread") == -1) { // if its a forum page document.location = document.location.href + "&order=desc&page=2"; } else { // else a thread page document.location = document.location.href + "&page=2"; } } else { // else just increase the page number pageNumber = parseInt(document.location.href.match(/\d+$/)) + 1; document.location = document.location.href.replace(/\d+$/,pageNumber); } void(0)
whoa. Thats way too much of code for someone like me. Anyways let me give it a try. May be it`ll be easier than what it looks. Now where is that iPhone...
Tried the next command. It worked like a charm Are there more such bookmarklets? I think I did read about them some where else too. It was quite a while back and it was supposed to bring find, copy, translate etc. I never really tried it back then as it looked too complicated. Do you also have one which allows you to scroll to the bottom of the page? Anyways, great job done buddy, Thanx a lot.
Scroll to the bottom of the page? How about this: HTML: javascript:window.scrollBy(0,100000); Its actually a hack but it should work for virtually all pages
Okay I just found a bug. The bookmarklets don't work for TA pages with anchors (eg when you click on the little blue checkbox on the left of a thread title). I'll fix this when I have time or if there's any interest.
Sure No problem. Let me know if you need a bookmarklet that does anything else (hopefully not too complicated) lol
This is cool. Didn't see this thread first time around. I'll definitely be using these. How about a "last button"? When in threads with a lot of pages it will say "1, 2, 3, 10, 20, Last" There's even a Last button when inside each sub-forum, although I don't use it very much View attachment 7330
New bookmarklet for Searching in thread titles (all forums) from any sub FORUM in TA This wont work if you are viewing a thread or a list of sub forums. The bookmarklet: HTML: javascript:function%20m(n,v)%20%7Bvar%20i=document.createElement('INPUT');i.setAttribute('type','hidden');i.setAttribute('name',n);i.setAttribute('value',v);return%20i;%20%7Dfunction%20s(q,t)%20%7Bvar%20f=document.createElement('FORM');f.setAttribute('action','search.php?do=process');f.setAttribute('method','post');f.setAttribute('name','pbsc');var%20i1=m('securitytoken',t);var%20i2=m('do','process');var%20i3=m('query',q);var%20i4=m('titleonly','1');var%20i5=m('searchdate','0');var%20i6=m('sortby','lastpost');var%20i7=m('order','descending');var%20i8=m('showposts','0');var%20i9=m('forumchoice[]','0');var%20i10=m('childforums','1');var%20i11=m('dosearch','Search%20Now');f.appendChild(i1);f.appendChild(i2);f.appendChild(i3);f.appendChild(i4);f.appendChild(i5);f.appendChild(i6);f.appendChild(i7);f.appendChild(i8);f.appendChild(i9);f.appendChild(i10);f.appendChild(i11);document.body.appendChild(f);document.forms["pbsc"].submit();%20%7D%20function%20s2()%7Bvar%20q=prompt("Search%20Titles:","");if%20(q!=null%20&%20q!="")%20%7Bs(q,document.getElementById("forumsearch_menu").childNodes[1].securitytoken.value);%7D%20%7Ds2(); Unobfuscated: HTML: function m(n,v) { var i=document.createElement('INPUT'); i.setAttribute('type','hidden'); i.setAttribute('name',n); i.setAttribute('value',v); return i; } function s(q,t) { var f=document.createElement('FORM'); f.setAttribute('action','search.php?do=process'); f.setAttribute('method','post'); f.setAttribute('name','pbsc'); var i1=m('securitytoken',t); var i2=m('do','process'); var i3=m('query',q); var i4=m('titleonly','1'); var i5=m('searchdate','0'); var i6=m('sortby','lastpost'); var i7=m('order','descending'); var i8=m('showposts','0'); var i9=m('forumchoice[]','0'); var i10=m('childforums','1'); var i11=m('dosearch','Search Now'); f.appendChild(i1); f.appendChild(i2); f.appendChild(i3); f.appendChild(i4); f.appendChild(i5); f.appendChild(i6); f.appendChild(i7); f.appendChild(i8); f.appendChild(i9); f.appendChild(i10); f.appendChild(i11); document.body.appendChild(f); document.forms["pbsc"].submit(); } function s2(){ var q=prompt("Search Titles:",""); if (q!=null & q!="") { s(q,document.getElementById("forumsearch_menu").childNodes[1].securitytoken.value); } } s2();
Stumbled on this today. Have to say, great job! I ALWAYS press the wrong links when I browse TA on iPhone, these bookmarklets are going to save me so much trouble.
Thanks I'm doing this in my spare time so it'll be awhile before there's a bookmarklet for everything. Lol I plan to make the search work on all pages of the forum and also, a bookmarklet to go to the last page of a thread, go to page XX of a thread. If there are any other ideas, just post them here
Another bookmarklet to mark a subforum (list of thread) as read: You need to be in the actual subforum (that lists the threads) Bookmarklet: HTML: javascript:function%20pbrd()%7Bif(document.location.href.indexOf("forumdisplay.php?")!=-1)%7Bfid=parseInt(document.location.href.match(/(\?|&)f=(\d+)($|&)/)[2]);mark_forum_read(fid);return;%7D%7Dpbrd(); Unobfuscated: HTML: function pbrd() { if(document.location.href.indexOf("forumdisplay.php?")!=-1) { fid=parseInt(document.location.href.match(/(\?|&)f=(\d+)($|&)/)[2]); mark_forum_read(fid); return; } } pbrd();
Sweet. Now we just need a "Ban user X for all eternity" bookmarklet and we're ready to go! Actually I'm concerned Hodapp may already have one of those...