Make SITENAME with value mw.config.get( 'wgSiteName' ) available in parser without...
authorSanthosh Thottingal <santhosh.thottingal@gmail.com>
Mon, 2 Apr 2012 11:35:36 +0000 (17:05 +0530)
committerSanthosh Thottingal <santhosh.thottingal@gmail.com>
Fri, 6 Apr 2012 04:19:54 +0000 (09:49 +0530)
- Refer Bug 33658
- Merging the jsgrammar branch of svn.

Change-Id: Iacdf02122f396ac90678241775eb8e079ff6369a

resources/mediawiki/mediawiki.jqueryMsg.js

index a8d4a3a..3e33bde 100644 (file)
        };
 
        var parserDefaults = { 
-               'magic' : {},
+               'magic' : {
+                       'SITENAME' : mw.config.get( 'wgSiteName' )
+               },
                'messages' : mw.messages,
                'language' : mw.language
        };
 
        };
 
-       // TODO figure out a way to make magic work with common globals like wgSiteName, without requiring init from library users...
-       // var options = { magic: { 'SITENAME' : mw.config.get( 'wgSiteName' ) } };
-
        // deprecated! don't rely on gM existing.
        // the window.gM ought not to be required - or if required, not required here. But moving it to extensions breaks it (?!)
        // Need to fix plugin so it could do attributes as well, then will be okay to remove this.