Skip to content

Instantly share code, notes, and snippets.

@nrn
Created September 7, 2012 21:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nrn/3669857 to your computer and use it in GitHub Desktop.
Save nrn/3669857 to your computer and use it in GitHub Desktop.
Smallest Federated Wiki bookmarklet
javascript:
(function (main) {
var host = document.location.host
, home = window.prompt('Open these pages from what origin server:', main)
;
if (!home) return;
document.location = 'http://' + home + document.location.pathname.split('/').map(
function (i) {
if (i === 'view') return host;
if (i === home) return 'view';
return i;
}
).join('/');
})('fed.wiki.org');
@nrn
Copy link
Author

nrn commented Sep 7, 2012

To use this just set the target of a bookmark to the script. If you want a different default server, replace 'fed.wiki.org' at the end with the server you most often rebase to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment