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

Talk about stuff specific to the site -- bugs, suggestions, and of course praise welcome.
Locked
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

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

Post 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¢.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post 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.

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post 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.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post by Zoolcar9 »


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

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post by old FatJohn »

Is it? Now, both are enabled for guests, right?
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Post 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
User avatar
Alice
Posts: 2628
Joined: April 23rd, 2003, 11:47 am

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

Post 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¢ :)
Alice Wyman
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

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

Post 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:

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
old FatJohn
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post 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... :)
User avatar
Alice
Posts: 2628
Joined: April 23rd, 2003, 11:47 am

Post 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.
Alice Wyman
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Post 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.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Post 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
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
DN123ABC
Posts: 695
Joined: January 9th, 2017, 10:10 am

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

Post 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.
Locked