JavaScript parsing library
From MediaWiki.org
| Wikimedia Foundation Project: JavaScript parsing library | |
|---|---|
| A JavaScript library for parsing wikitext. | |
| Team members: | Neil Kandalgaonkar (developer), Alolita Sharma (EPM) |
| Links to and reports on this project | |
Contents |
[edit] Feature justification
[edit] User requirements
[edit] Specification
[edit] Software design document
Example 1:
// set the message string...
'foundResults' => 'You found [$3 {{PLURAL:$1|one file|$1 files}}] in [$4 {{PLURAL:$2|one directory|$2 directories}}].'
// later, create some complex behaviour out of a message string and put it on the page...
var filesJqueryLink = $('a').click( function() { alert( "you clicked on this!" ) }; );
var directoryLinkUrl = 'http://something/directories=' + directories;
$('#result').msg( 'foundResults', numFiles, numDirectories, filesJqueryLink, directoryLinkUrl );
Example 2:
// create an <A> which, when clicked, pops up an alert.
var link = $('<a></a>').click( function(){ alert("you clicked on this link"); } );
// find a paragraph on the page, and fill it with a particular MediaWiki string which has a link in
// it, and then apply the above link's behavior to that link!
// Imagine that "myMessageThatHasALink" looks like "This message has [$1 a link]."
$('#someId').msg( 'myMessageThatHasALink', link );
// Result: HTML that behaves as if you wrote this
// 'This message has <a href="#" onClick='alert("you clicked on this link")'>a link</a>.'
[edit] Test plan
[edit] Documentation plan
[edit] User interface design docs
[edit] Schedule
[edit] Task management
(e.g. link to relevant Bugzilla queries)