Merge "Fix not parsed message on Special:Import"
[lhc/web/wiklou.git] / resources / src / oojs-ui-local.js
index 84ec92d..dffa863 100644 (file)
@@ -1,5 +1,17 @@
-// Connect OOjs UI to MediaWiki's localisation system
 ( function ( mw ) {
+       var isMobile;
+       // Connect OOjs UI to MediaWiki's localisation system
        OO.ui.getUserLanguages = mw.language.getFallbackLanguageChain;
        OO.ui.msg = mw.msg;
+       // Connect OOjs UI's deprecation warnings to MediaWiki's logging system
+       OO.ui.warnDeprecation = function ( message ) {
+               mw.track( 'mw.deprecate', 'oojs-ui' );
+               mw.log.warn( message );
+       };
+       OO.ui.isMobile = function () {
+               if ( isMobile === undefined ) {
+                       isMobile = !!mw.config.get( 'wgMFMode' );
+               }
+               return isMobile;
+       };
 }( mediaWiki ) );