Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Monk Links - Copy Perlmonks-links to the clipboard in on-site-format

by bart (Canon)
on Oct 27, 2006 at 23:48 UTC ( #581043=note: print w/ replies, xml ) Need Help??


in reply to Re: Monk Links - Copy Perlmonks-links to the clipboard in on-site-format
in thread Monk Links - Copy Perlmonks-links to the clipboard in on-site-format

Apart from the bugs that you have tried to patch up earlier, kwaping found another link that didn't work well in your current FF extension: Voting/Experience System. So I took the plunge and looked at how it all ticked...

I found out you were using the wrong function, you shouldn't have used decodeURI(), but unescape()!

There still is a bug in FF though, because when testing Javascript using alert(), both in the extension and from the Javascript Console command line, I found that it was partially decoding the string, and thus, what alert() showed wasn't the original string, but a partly decoded variation of it.

Anyway, unescape() fixed it, and I could just completely remove your kludge.

Get the patched version at http://users.pandora.be/bartl/monklinks/. There are two archives: the patched XPI file, and a ZIP archive containing the same files but unpacked, ready for editing, plus a little Windows batch script (just run it by doubleclicking) to wrap up the files, possibly after editing, back into a new XPI file. You need an Info-ZIP compatible command line ZIP, which comes with UnxUtils, for example.

BTW people, if you're having trouble installing the XPI file directly from the site, just save it to disk and drop it on Firefox, either on a window, or on its program icon.

Ah, another feature I added was support for plain links, which get turned into the [http://...|link text] format, taking care to remove any "[", "]" and "|" characters from the text.

Oh, and I moved its position in the popupmenu to a more appropriate place, right under the "Copy Link Location" item.

I've got a few more ideas still, like adding support for other types of PM links, such as to http://perldoc.org/, as well as copying the URL and title (or perhaps selected text) of the current page in case you rightclicked on something other than a link — thus, something like Copy URL + does. The latter seems like a big change to me, so it will be for another day. Ideally, it should still work after you submitted a POST, so, in that case, it should scan for the node id in the current page.

I left your copyright and author notices completely unaltered, I just bumped the version number from 0.3 to 0.3.1. It's still your baby.

p.s. I don't have Firefox 2 as yet, so it's not compatible with it yet. Feel free to try if it could still work, by editing install.rdf in the root dir, and bumping up the <em:maxVersion> value, and repackage.

p.p.s. I started out from the version you put up on planetscape's site. You say here it's version 0.5, though internally, everything said 0.3. Oh well.

Update Now version 0.3.2, supports more link styles: module:// and dist:// for CPAN, doc:// for perldoc.perl.org, href:// for odd links on this site, and plain http:// for anything else. It'll try to uyse the actual link text for the less normalized URLs (the latter two). And I've upped the maxVersion to 2.0, though I haven't tried it, I have the impression not much has changed in the Firefox Extension API. Here's for hoping.

Same URL for the directory listing.


Comment on Re^2: Monk Links - Copy Perlmonks-links to the clipboard in on-site-format
Select or Download Code
Re^3: Monk Links - Copy Perlmonks-links to the clipboard in on-site-format
by blazar (Canon) on Nov 11, 2006 at 22:50 UTC
    Update Now version 0.3.2, supports more link styles: module:// and dist:// for CPAN, doc:// for perldoc.perl.org, href:// for odd links on this site, and plain http:// for anything else. It'll try to uyse the actual link text for the less normalized URLs (the latter two). And I've upped the maxVersion to 2.0, though I haven't tried it, I have the impression not much has changed in the Firefox Extension API. Here's for hoping.

    Tested for some time now on 2.0 and seems to work like a charm. Thank you!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://581043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2014-04-21 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (490 votes), past polls