Maintenance for Math extension.

* Replace deprecated wfMsg* calls with alternatives.
* Add FIXME for occurrence I don't know how to replace.
* Update some docs.
* Sprinkle a few semi-colons over the JavaScript.

Change-Id: I755a95f8bba48a23ef8c432e232adfaef4caae70
This commit is contained in:
Siebrand Mazeland 2012-08-31 01:25:48 +02:00
parent ae9e0d989b
commit 7b2b7301e0
3 changed files with 8 additions and 6 deletions

View File

@ -243,8 +243,8 @@ class MathRenderer {
}
function _error( $msg, $append = '' ) {
$mf = htmlspecialchars( wfMsg( 'math_failure' ) );
$errmsg = htmlspecialchars( wfMsg( $msg ) );
$mf = wfMessage( 'math_failure' )->escaped();
$errmsg = wfMessage( $msg )->escaped();
$source = htmlspecialchars( str_replace( "\n", ' ', $this->tex ) );
return "<strong class='error'>$mf ($errmsg$append): $source</strong>\n";
}

View File

@ -39,7 +39,7 @@ class MathHooks {
* @param $content
* @param $attributes
* @param $parser Parser
* @return
* @return string
*/
static function mathTagHook( $content, $attributes, $parser ) {
global $wgContLang, $wgUseMathJax;
@ -63,6 +63,7 @@ class MathHooks {
* @return Boolean: true
*/
static function onGetPreferences( $user, &$defaultPreferences ) {
// @todo FIXME: Replace wfMsgHtml with wfMessage equivalent.
$defaultPreferences['math'] = array(
'type' => 'radio',
'options' => array_flip( array_map( 'wfMsgHtml', self::getMathNames() ) ),
@ -110,6 +111,7 @@ class MathHooks {
* LoadExtensionSchemaUpdates handler; set up math table on install/upgrade.
*
* @param $updater DatabaseUpdater
* @throws MWException
* @return bool
*/
static function onLoadExtensionSchemaUpdates( $updater = null ) {

View File

@ -19,7 +19,7 @@ mathJax.Config = function() {
"HTML-CSS": { imageFont: null, availableFonts: ["TeX"] }
});
MathJax.OutputJax.fontDir = mathJax.fontDir = mediaWiki.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax/fonts';
}
};
mathJax.Load = function(element) {
if (this.loaded)
@ -38,7 +38,7 @@ mathJax.Load = function(element) {
this.loaded = true;
return false;
}
};
mathJax.Init = function() {
this.Load( document.getElementById("bodyContent") || document.body );
@ -55,7 +55,7 @@ mathJax.Init = function() {
if ( typeof(mathJax.oldAjaxPreviewExec) !== "undefined" ) mathJax.oldAjaxPreviewExec(previewArea);
if ( mathJax.Load(previewArea) ) MathJax.Hub.Queue( ["Typeset", MathJax.Hub, previewArea] );
}
}
};
jQuery( document ).ready( function() {
mathJax.Init();