Tell me more ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

Update:

This script was previously called "Insert APT Link" but has now been renamed. As such, you need to uninstall any previous versions before installing the new one.

Screenshot / Code Snippet

About

This UserScript adds some buttons to the editing toolbar that allow the following to easily be inserted:

This UserScript is fully compatible with inline editing and the toolbar buttons should show up anywhere there is a WMD editor.

License

MIT License

Download

You can install the script by clicking the link below:
http://files.quickmediasolutions.com/userscripts/au_toolbar.user.js

Platform

Tested on Firefox 11 (and reported to work on Chrome too).

Contact

I can be reached at admin@quickmediasolutions.com

Code

Written in JavaScript using jQuery.

share|improve this question
Can this be made into an addon? Greasemonkey doesn't work with nightlies :/ – RolandiXor Jul 7 '11 at 20:23
@Roland: Really? (Shame on GreaseMonkey!) Actually, I'm afraid I have never written a Firefox addon. Ever. :( – Nathan Osman Jul 7 '11 at 20:25
I guess this is time for me to brush up on javascript and write a jetpack :). – RolandiXor Jul 7 '11 at 22:26
Guess who got greasemonkey working since the latest update :D... – RolandiXor Jul 28 '11 at 4:54
@Roland: Hooray! So what Firefox version are we working with now? :) – Nathan Osman Jul 28 '11 at 4:56
Firefox 8 still, 9 is on the way but hasn't landed yet :) – RolandiXor Jul 28 '11 at 5:20
Can this be updated to insert this new awesome button? meta.askubuntu.com/a/395/235 – Jorge Castro Apr 24 '12 at 22:32
@JorgeCastro: Sure - that button looks awesome. – Nathan Osman Apr 25 '12 at 5:56
It looks like apps.ubuntu.com is the preferred way to install now, see here: meta.askubuntu.com/a/395/235 – Jorge Castro Apr 25 '12 at 16:20

1 Answer

I've made some improvements:

  • [bugfix] At some pages, the button would not be added: Tag wiki and pressing "Add another answer"
  • [feature] selected text will now immediately be converted to an APT link
  • [feature] URLs like http://packages.ubuntu.com/package will now be converted to package (technically, it takes the part after the last /)
  • Code cleanup: stripping http:// made no sense and was possibly a leftover from copying code directly

Download:

Changelog:

  • 1.0.0.2 (13 June 2011): Release
  • 1.0.0.3 (7 July 2011): [bugfix] the editors textareas for posts seems to have a numeric ID part now.
  • 1.0.0.4 (7 July 2011): [bugfix] Edit Posts works now properly again
share|improve this answer
Thanks! Do you mind if I credit you and update the original? – Nathan Osman Jun 13 '11 at 16:55
1  
@GeorgeEdison: No problem, you may remove the download link from my answer after updating, keeping multiple (out-dated) copies is not a good idea. Could you add an link to this page in the userscript for future reference? E.g. @website http://stackapps.com/q/2405 – Lekensteyn Jun 13 '11 at 18:22
Chrome is giving me errors when I try to use the button when editing answers: Uncaught SyntaxError: Unexpected token ILLEGAL edit:13 // Uncaught TypeError: Object [object Object] has no method 'selection' – Nathan Osman Jun 15 '11 at 6:44
I found the issue: I wrongly assumed that the selection method was something from jQuery (it's part of cdn.sstatic.net/Js/tageditor.js). I've also found an issue at the tag editing page which is now fixed. The download link has not changed, do not forget to clear your cache. – Lekensteyn Jun 15 '11 at 8:22
@GeorgeEdison: Updated! – Lekensteyn Jul 7 '11 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged