Page 1 of 1

"Make link" bookmarklet, MZ regulars, read this! ;

Posted: March 8th, 2006, 8:20 pm
by old FatJohn
Hiya guys! This is a bit offtopic I guess, but since the MozillaZine regulars are likely(?) to read this forum, I'm posting it here. So, let's cut to the chase:

Which link makes more sense to you?
http://www.extensionsmirror.nl/index.php?showtopic=4768
or
<a href="http://www.extensionsmirror.nl/index.php?showtopic=4768">View Source in Tab 0.2.1 - The Extensions Mirror</a>

Yeah, the latter! That's where the make link bookmarklet comes in handy. Be sure to check out the rest of them too. I've got that bookmarklet assigned to a mouse gesture. Extremely handy. Love it.

My 2¢.

Posted: March 13th, 2006, 1:40 pm
by Zoolcar9

Remember, not everyone use Always allow HTML option.
If you turn off Always allow HTML option. from Edit your profile,
you'll get <a href="http://www.extensionsmirror.nl/index.php?showtopic=4768">View Source in Tab 0.2.1 - The Extensions Mirror</a> instead of View Source in Tab 0.2.1 - The Extensions Mirror

So, use the BBCode instead of HTML

I modified the Jesse's bookmarklet to create BBCode link

Code: Select all

javascript:function htmlEscape(s){s=s.replace(/&/g,'&amp;');s=s.replace(/>/g,'&gt;');s=s.replace(/</g,'&lt;');return s;} function linkEscape(s){s=s.replace(/&/g,'&amp;');s=s.replace(/"/,'&quot;');return s} h = '[url=' + linkEscape(location.href) + ']' + htmlEscape(document.title) + '[/url]'; with(window.open().document){write(h+'<form name=f><textarea  name=a rows=5 cols=80 wrap=hard>'+htmlEscape(h)+'</textarea></form>'); close(); f.a.select(); } void 0


If you have keyconfig or Customizable Toolbar Buttons, you can add this code

Code: Select all

var clipb = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
            .getService(Components.interfaces.nsIClipboardHelper);
var bbLink = '[url=' + content.location.href + ']' + content.document.title + '[/url]';
clipb.copyString(bbLink);

It will copy the page link in BBCode format to clipboard.


Posted: March 13th, 2006, 11:58 pm
by old FatJohn
Zoolcar9 wrote:Remember, not everyone use Always allow HTML option.
So, use the BBCode instead of HTML
I modified the Jesse's bookmarklet to create BBCode link


Nice job. Allthough BBCode can be disabled in the profile too.

Posted: March 14th, 2006, 12:41 am
by Zoolcar9

Yes, but, AFAIK, HTML is disabled and BBCode is enabled by default on MZF.


Posted: March 14th, 2006, 12:56 am
by old FatJohn
Is it? Now, both are enabled for guests, right?

Posted: March 14th, 2006, 3:49 am
by dickvl
How about adding [u] [/u] tags to make the text look like a link (sometimes hard to notice).

Code: Select all

javascript:function htmlEscape(s){s=s.replace(/&/g,'&amp;');s=s.replace(/>/g,'&gt;');s=s.replace(/</g,'&lt;');return s;} function linkEscape(s){s=s.replace(/&/g,'&amp;');s=s.replace(/"/,'&quot;');return s} h = '[url=' + linkEscape(location.href) + '][u]' + htmlEscape(document.title) + '[/u][/url]'; with(window.open().document){write(h+'<form name=f><textarea  name=a rows=5 cols=80 wrap=hard>'+htmlEscape(h)+'</textarea></form>'); close(); f.a.select(); } void 0
"Make link" bookmarklet, MZ regulars, read this! ; - MozillaZine Forums

Re: "Make link" bookmarklet, MZ regulars, read thi

Posted: March 14th, 2006, 10:44 am
by Alice
FatJohn wrote:Hiya guys! This is a bit offtopic I guess, but since the MozillaZine regulars are likely(?) to read this forum, I'm posting it here. So, let's cut to the chase:

Which link makes more sense to you?
http://www.extensionsmirror.nl/index.php?showtopic=4768
or
<a href="http://www.extensionsmirror.nl/index.php?showtopic=4768">View Source in Tab 0.2.1 - The Extensions Mirror</a>

I have the BBCode extension installed (version 0.4.1.3 from author's site). It lets you create hyperlinks or add other formatting in message board posts using either BBcode or html. Once you have the URL in the clipboard, it's easy to select the text, right-click, select BBCode from the menu and then pick "BBCode > Clipboard > Make Selection URL" to create a hyperlink. I usually create my links by hand, though.

Other times, I just use a visible URL with a description, when I'm linking to a webpage and want to show the web site location, like this:
BBCode - Firefox Extension: https://addons.mozilla.org/extensions/m ... php?id=128
Direct link to BBCode 0.4.1.3 (right-click and save): http://jedbrown.net/dev/Mozilla/bbcode.xpi

My 2¢ :)

Re: "Make link" bookmarklet, MZ regulars, read thi

Posted: March 14th, 2006, 11:38 am
by Zoolcar9
FatJohn wrote:Is it? Now, both are enabled for guests, right?

You're right. I didn't notice.


Alice wrote:I have the BBCode extension installed (version 0.4.1.3 from author's site). It lets you create hyperlinks or add other formatting in message board posts using either BBcode or html. Once you have the URL in the clipboard, it's easy to select the text, right-click, select BBCode from the menu and then pick "BBCode > Clipboard > Make Selection URL" to create a hyperlink. I usually create my links by hand, though.

Other times, I just use a visible URL with a description, when I'm linking to a webpage and want to show the web site location, like this:
BBCode - Firefox Extension: https://addons.mozilla.org/extensions/m ... php?id=128
Direct link to BBCode 0.4.1.3 (right-click and save): http://jedbrown.net/dev/Mozilla/bbcode.xpi

My 2¢ :)


Or you can use jqp's BBCode Helper GM script (see screenshot)
Sometimes I forgot that it's a GM script :mrgreen:


Posted: March 14th, 2006, 1:46 pm
by old FatJohn
I also find useful these text inserting bookmarklets, such as this one for setting default browser. Note, it only works in this quick reply boxie...

Code: Select all

javascript:self.focus(); document.post.input.value = document.post.input.value+('http://kb.mozillazine.org/Setting_Your_Default_Browser');void 0

I've got those for the real FAQ entries. Typed them enough many times... :)

Posted: March 14th, 2006, 2:09 pm
by Alice
FatJohn
I just tried out your suggestion (using an updated version of your sample link)

Code: Select all

javascript:self.focus(); document.post.input.value = document.post.input.value+('http://kb.mozillazine.org/Default_browser');void 0

Thanks. I usually just copy/paste the links from these two pages, which I have linked from my toolbar:
http://kb.mozillazine.org/Firefox_FAQs
http://kb.mozillazine.org/Issues_with_Firefox

Zoolcar9 wrote:So, use the BBCode instead of HTML

I modified the Jesse's bookmarklet to create BBCode link

Code: Select all

javascript:function htmlEscape(s){s=s.replace(/&/g,'&amp;');s=s.replace(/>/g,'&gt;');s=s.replace(/</g,'&lt;');return s;} function linkEscape(s){s=s.replace(/&/g,'&amp;');s=s.replace(/"/,'&quot;');return s} h = '[url=' + linkEscape(location.href) + ']' + htmlEscape(document.title) + '[/url]'; with(window.open().document){write(h+'<form name=f><textarea  name=a rows=5 cols=80 wrap=hard>'+htmlEscape(h)+'</textarea></form>'); close(); f.a.select(); } void 0


Thanks for that, too.
I added another bookmarklet using the above code, for when I'm on a specific page and want to create a BBcode link using the page title and URL.

Posted: March 14th, 2006, 4:31 pm
by dickvl
The main problem is with long links: you must avoid that horizontal scrollbars appear, because that's annoying and in that case you have to use a description/title. I have the links I use most in a text file in a tab (some also with [url] tags and title to speed things up) and copy/paste from there.

Posted: March 14th, 2006, 7:01 pm
by Zoolcar9
dickvl wrote:The main problem is with long links: you must avoid that horizontal scrollbars appear, because that's annoying and in that case you have to use a description/title. I have the links I use most in a text file in a tab (some also with [url] tags and title to speed things up) and copy/paste from there.

That's another reason to use BBCode for links.

Rather than just insert

Code: Select all

http://www.loooooooooong.com/


you could type

Code: Select all

[url=http://www.loooooooooong.com/]http://www.looooo
ooooong.com/[/url]


Example:

[url=http://developer.mozilla.org/en/docs/Special:Search?ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1&redirs=1&search=how+to+make+a+baby&searchx=Search]http://developer.mozilla.org/en/docs/Special:Search?
ns0=1&ns1=1&ns2=1&ns3=1&ns4=1&ns5=1&ns6=1&ns7=1&ns8=1
&ns9=1&ns10=1&ns11=1&ns12=1&ns13=1&ns14=1&ns15=1
&redirs=1&search=how+to+make+a+baby&searchx=Search[/url]

or you can use MRTech LinkWrapper

Re: "Make link" bookmarklet, MZ regulars, read this! ;

Posted: September 27th, 2017, 5:23 pm
by DN123ABC
Anybody know if this "bookmarklet" works in version 57?

I somehow got my home system onto version 57, and "Make Link" is one of my more used extensions, which not only stopped working, it is just plain GONE.

Thanks.