Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: 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 --> [http://www.perlmonks.com|www.perlmonks.com] <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='www.perlmonks.com'; document.links[4].hostname='www.perlmonks.org'; document.links[5].hostname='perlmonks.net'; } 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

UPDATE

fixed indentation


In reply to Free Nodelet Hack: "No-LogOut-Links" - Fix links to other PM-domains by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (16)
    As of 2014-04-17 20:29 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (455 votes), past polls