Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Free Nodelet Hack: "No-LogOut-Links" - Fix links to other PM-domains

by LanX (Cardinal)
on Jan 20, 2013 at 13:45 UTC ( #1014289=monkdiscuss: print w/replies, xml ) Need Help??

Dear fellow monks,

(in continuation of Re: Perlmonks 'Not logged in Error' - Proposal for fix and Re^2: Perlmonks 'Not logged in Error' - Proposal for fix (autocorrect perlmonks linking shortcuts in preview ))

If you bother about people posting hardcoded links to other PM-domains which result in "logging you out", you can fix that with this nodelet hack:

<!-- sample hard-link to be fixed, only for testing --> [|] <script><!-- /* No Log-Out Links Redirect links to other perlmonk domains to current one */ (function (do_log,do_test){ var log = function (html){ if (do_log) document.writeln(html); }; var fixes=''; if (do_test){ document.links[3].hostname=''; document.links[4].hostname=''; document.links[5].hostname=''; } var doc_host=document.location.hostname; for (var i in document.links) { var link_host = document.links[i].hostname; if ( link_host && link_host != doc_host && link_host.match(/^(www\.)?perlmonks.(org|net|com)$/) ) { fixes += '<li> #'+i+' was '+link_host+'</li>\n'; document.links[i].hostname = doc_host; } } if (fixes) { log('<h5>Fixing hostnames of PM links</h5><small><ol>'); log(fixes); log('</ol></small>'); } })(true,false); --></script>

Paste the above code into Free Nodelet Settings and submit it.

You need to activate the Free Nodelet in Nodelet Settings and don't forget other Nodelets you still need.

Only tested with Firefox so far, please report for other browsers.

Cheers Rolf


fixed indentation

  • Comment on Free Nodelet Hack: "No-LogOut-Links" - Fix links to other PM-domains
  • Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://1014289]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2021-05-15 02:05 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (150 votes). Check out past polls.