ooui: Fix ButtonWidget jsduck demo

* The button's icon was missing because at some point in the
  past two years, the CSS for this was moved out of the
  main theme CSS files and into its own 'images' theme file,
  which was not yet loaded.

  Fix this by adding a <link> element, and also add the file
  to the whitelist as it was previously also not comitted to
  the repo (because for MW, RL creates this directly based
  on the JSON).

  This aligns closer to VE's /lib/oojs-ui directory.

* Also fix the "require() undefined" warning, although it
  didn't break the demo below it, it is noise.
  This is because mediawiki.base was converted to a packageFiles
  module recently and it now assumes a require() function exists,
  similar to what startup/mediawiki.js would provide during
  debug mode. Mock that as well for consistency.

Bug: T168812
Change-Id: Ide9ef38c38782515becdae5fc40eac4ee9b384fc
This commit is contained in:
Timo Tijhof 2020-04-18 01:33:26 +01:00 committed by Krinkle
parent 005318a87a
commit 567001e169
3 changed files with 3715 additions and 0 deletions

View file

@ -41,6 +41,8 @@
};
// Mock startup.js
window.RLQ = [];
// Mock mw.loader#execute context
function require() {}
</script>
<script src="modules/src/startup/mediawiki.js"></script>
<script src="modules/src/startup/mediawiki.requestIdleCallback.js"></script>
@ -93,6 +95,7 @@
<link rel="stylesheet" href="modules/lib/ooui/oojs-ui-widgets-wikimediaui.css">
<link rel="stylesheet" href="modules/lib/ooui/oojs-ui-toolbars-wikimediaui.css">
<link rel="stylesheet" href="modules/lib/ooui/oojs-ui-windows-wikimediaui.css">
<link rel="stylesheet" href="modules/lib/ooui/oojs-ui-images-wikimediaui.css">
</head>
<body>
<script>

View file

@ -253,6 +253,8 @@ ooui:
package/dist/oojs-ui-{wikimediaui,apex}.js{,.map.json}:
package/dist/i18n:
package/dist/images:
# For jsduck/eg-iframe
package/dist/oojs-ui-images-wikimediaui.css:
# WikimediaUI theme
package/dist/themes/wikimediaui/images/icons/*.{svg,png}: themes/wikimediaui/images/icons
package/dist/themes/wikimediaui/images/indicators/*.{svg,png}: themes/wikimediaui/images/indicators

File diff suppressed because it is too large Load diff