pmtarantino/wikiUp — pull request #1 by tomasdev (2012-11-30 04:01:44+00:00)
Title: Huge refactor + 1 fix

* Refactored code leaving your algorythm logic, but implementing JS
best practices
* Fixed anchor href's error if the link was external

List of changes:
- Closure!
- Prevent failure if jQuery not defined
- Use strict mode
- Change tabs to 4 spaces
- Removed useless code (such as misusing `var` statement, or empty
if…else conditions)
- Use of cached jQuery object instead of multiple $(this);
- Proper use of jQuery data-attributes
- Store id of wiki text container within `data-wikiUp`
- Use of jQuery plugin implemented, with defaults available to override
(inline data-lang has more priority than plugin initialization object
value, e.g.: `{ lang: 'en' }`)
- Improve selectors for a better performance (e.g.: `.find('span')` to
`.children('.tooltip')`)
- Take advantage of jQuery chainability.
- Pluginize it + initialize on document ready for a default element
selector: `data[data-wiki]`