"Krinkle" posted a comment on MediaWiki.r113644.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/113644#c32088

Commit summary for MediaWiki.r113644:

add locale global for handling languages and message function

for the benefit of the phonegap app

Krinkle's comment:

<pre>
                                var title = "{$this->data['htmlTitle']}";
                                var scriptPath = 
"{$this->data['wgScriptPath']}";
-                               var showText = "{$buttonShowText}";
-                               var hideText = "{$buttonHideText}";
+                               var locale = {
+                                       "expand-section": "{$buttonShowText}",
+                                       "collapse-section": "{$buttonHideText}"
+                               };
                        </script>
</pre>

These generic (global!) variables are becoming an issue. More then just a 
maintainability problem but a practical one as well. The browser has many 
default variables in the global 'window' object by default. One of the things 
many browsers put as alias into the window object are unique DOM element IDs.

So if any wiki or skin content would have <code><nowiki><span id="locale"> .. 
</span></nowiki></code> or  <code><nowiki><span id="title"> .. 
</span></nowiki></code>, then this code is broken (some browsers allow 
overriding of those properties, some don't).

Code like this is asking to get broken.

My advice would be to either drop all front-end development temporarily and 
port to ResourceLoader asap, or spend more time on this.

_______________________________________________
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to