Fehérke's GitHub Site == glue between Fehérke's GitHub hosted projects

TipMaster - markItUp! Setting

Improves the TipMaster’s forums, Tek-Tips and Eng-Tips, by improving the markItUp! editor’s settings used in the post forms.

The markItUp! universal markup jQuery editor is very customizable. It keeps all its setting in the global mySettings JavaScript variable, so is enough to change that one.

Included modifications :

Screenshot

sample rendering without TipMaster - markItUp! Setting

screenshot before applying the script

sample rendering with TipMaster - markItUp! Setting 0.7 (!)

screenshot after applying the script

Usage

See markItUp!’s own documentation.

Key

Transforms a space separated list of key names into a key combination markup.

Example :
Alt Ctrl Del ➜ Alt-Ctrl-Del

If there is selected text, uses it as input, otherwise prompt()s the user for key list.

Fake TGML

Encloses a piece of text between a TGML-looking pair of text.

The toolbar button itself does nothing, the drop-down list’s buttons insert the text their names say. This is kind of joke, use it sparsely.

Warning !
Off topic and flame messages are not welcome on TipMaster forums. Using these fake TGML tags or not, you post will still be subject of edition or deletion.

Example :
text ➜ [off-topic]text[/off-topic]

If there is selected text, encloses it, otherwise uses the fake tag name as placeholder.

Documentation

Generates a link to the documentation of a given term.

Example :
print() ➜ print()

If there is selected text, uses it as input, otherwise prompt()s the user for documentation term.

Generates a link to a web search for a given term.

The toolbar button itself generates link to the current TipMaster site’s own search engine, the drop-down list’s buttons does similar work but for the web search engines I use most frequently.

Example :
term ➜ search Tek-Tips for “term”

If there is selected text, uses it as input, otherwise prompt()s the user for search term.

Canned Response

Manages a collection of predefined text snippets.

The toolbar button itself saves the current post content as canned response. The response’s title is requested from the user through a prompt(). If a response with the given title exists, its content is replaced with the new one, otherwise a new response is created.

The drop down buttons enumerate the available response titles. Clicking on any of them inserts the clicked one’s content into the post. Ctrl-clicking on any of them removes the clicked one after the user’s confirm(). Shift-clicking on any of them saves over the clicked response, after user’s confirm().

Responses may contain {{text}} placeholders, which will be replaced with the current selection, if exists, otherwise with nothing.

The responses are stored using the Greasemonkey script’s API, but that is not accessible after the script execution terminated. So adding, modifying and removing responses can not be performed directly. The changes first are stored in the sessionStorage and get finalized on the next page load. So after a response manipulation is requested, the user is alert()ed to reload the page. The drop-down list’s content reflects the finalized manipulations.

Warning : There is a problem with marItUp!’s key detection, sometimes ( mostly on the first action after page load ) the Ctrl and Shift key’s states are detected erroneously. Watch the confirmation dialogs carefully to avoid data loss. If you accidentally prepare a modification operation you can still cancel it by removing the corresponding sessionStorage entry before reloading the page.

Configuration

See markItUp!’s own documentation.

Documentation

If you add more entries to the Documentation button’s drop-down list you have to also add an entry to the documentation object’s url property. The key must be identical with button name. The value will be the URL to link to, it should contain a {{text}} placeholder, which will be replaced with the term to document.

This is expected to change radically in the future, though not guaranteed to be in the near future…

TipMaster Search

If you add more entries to the TipMaster Search button’s drop-down list you have to also add an entry to the websearch object’s url property. The key must be identical with button name, eventually without the “Search” word spaces surrounding it. The value will be the URL to link to, it should contain a {{text}} placeholder, which will be replaced with the term to search.

Versions

Plans

Download

You can find the related files on GitHub in my Greasemonkey-script repository’s tipmaster-markitup-setting directory :