SUGGESTIONS
![]() ![]() |
Suggestions a.k.a. Feedback which includes new additions or alternate coding styles for this script go here as usual :) Current TODO list:
|
![]() ![]() |
Add the end of the script I added:
if (window.location.hash.indexOf('#bookmark-') == 0)
window.location.href = window.location.href;
Which sends the user to the correct anchor if they follow a link there. After you make my change follow this example link. |
![]() ![]() |
sizzlemctwizzle wrote:I hope this works... I did some quick testing with something similar last night under Nix and it didn't seem to want to do anything... but I'll give your snippet a shot. Thanks :) Test link QSP... COOL it works! :) Thanks sizzlemctwizzle... I was trying just changing the hash and it didn't occur to me to redirect the whole uri. :) |
![]() ![]() |
My code doesn't work in Safari, but this does:
var hash = window.location.hash;
if (hash.indexOf('#bookmark-') == 0)
document.getElementById(hash.substr(1, hash.length-1)).scrollIntoView(true);
You should make the ids unique. Just stash them in an object while you're adding them and tack a number on the end if you encounter multiples. |
![]() ![]() |
sizzlemctwizzle wrote:The reason why I said contemplate is that mediawiki and the general coding ethic out there in the past has been defying unique id's and names in their software... Not sure I want to go against the norm even though id/names should be unique. I'll try out your "move" routine and see if it works everywhere else... bunch of code just to support Safari though... almost as bad as the "proper" way to use rex ;)... I did find out that IE doesn't support XPATH natively and I'm not sure I want to support IE or not... the equivalent getElementById wouldn't be as simple (and probably wouldn't work on null ids) as the XPATH equivalent... so I think IE is out of the loop for now. Well scrollIntoView doesn't position the browser anywhere near to the element properly if userscripts.org alternate CSS occurs after uso - Anchor Bookmarks in this Firefox browser... hmm.
Thanks for your suggestions and debug help. Works in Mac Safari, Opera and Goo too... but remember to execute this script after userscripts.org alternate CSS if you are using it. |
![]() ![]() |
sizzlemctwizzle wrote:It's actually a bit more complicated than just this process. 0.0.11 is up... All other supported browsers that I have check out. I've modified most of my scripts summary information to include relevant anchored bookmarks :) |



