JavaScript parsing library
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. See ResourceLoader/Core modules#mediawiki.jqueryMsg |
JavaScript parsing library
A JavaScript library for parsing wikitext.
|
Feature justification
editUser requirements
editSpecification
editSoftware design document
editExample 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>.'
Test plan
editDocumentation plan
editUser interface design docs
editSchedule
editTask management
edit(e.g. link to relevant Bugzilla queries)