7

Screenshot

BrickJax in Action

About

We've put together a script that we're hoping to get added to LEGO Answers that will allow users to easily insert images of Bricks, with or without links, and also links to sets on various listings sites via simple tags.

The supported tags are:

  • [part:3700:4]
    Draw a part (Technic Brick 1 x 2 with Hole) in a colour (red).
  • [partlink:3700:4]
    Draw a part (Technic Brick 1 x 2 with Hole) in a colour (red) and link to it on Peeron.com.
  • [set:5590]
    Link to set 5590 on Peeron.
  • [bl:5590]
    Link to set 5590 on BrickLink.
  • [bs:5590]
    Link to set 5590 on BrickSet.

License

The script makes use of the jQuery replaceText script and therefore must be used in a way consistent with that plugin's dual MIT/GPLv2 license.

Download

install / update script | Source - Updated 06/07/18

Examples

The following question and answers has some codes in comments and my answer that will show this in action:

Code to insert parts

Platform

The script should work under all major userscript-supporting browsers, however it's currently only been tested in Chrome with Tampermonkey and Firefox with Greasemonkey. Please file a bug if you encounter any issues.

Contact

Zhaph - Ben Duguid actively maintains this script, with the bulk of the original code developed by Kevin Cathcart.

You can also find us in Chat at Bricks.SE Parts JavaScript Discussion

3
  • Cool! I'm going to try this out right away. Commented Dec 18, 2011 at 0:18
  • Do you have an example question / answer I can test the script with? Commented Dec 18, 2011 at 0:21
  • @GeorgeEdison - Sorry, yep, on our meta: meta.bricks.stackexchange.com/questions/62/code-to-insert-parts There should be at least one in some comments, and a couple in my answer. Commented Dec 18, 2011 at 9:05

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.