27 'https://mediawiki.org/wiki/Special:MyLanguage/Extension:Media_Viewer/About';
31 'https://mediawiki.org/wiki/Special:MyLanguage/Extension_talk:Media_Viewer/About';
35 'https://mediawiki.org/wiki/Special:MyLanguage/Help:Extension:Media_Viewer';
41 $defaultOptions[
'multimediaviewer-enable'] = 1;
59 'MediaViewer' => 10867062,
60 'MultimediaViewerNetworkPerformance' => 15573630,
61 'MultimediaViewerDuration' => 10427980,
62 'MultimediaViewerAttribution' => 9758179,
63 'MultimediaViewerDimensions' => 10014238,
77 return BetaFeatures::isFeatureEnabled( $user,
'multimedia-viewer' );
86 if ( !$user->isLoggedIn() ) {
87 return (
bool)$enableByDefaultForAnons;
89 return (
bool)$user->getOption(
'multimediaviewer-enable' );
100 $out->addModules( [
'mmv.head',
'mmv.bootstrap.autostart' ] );
114 $pageHasThumbnails = count(
$out->getFileSearchOptions() ) > 0;
115 $pageIsFilePage =
$out->getTitle()->inNamespace(
NS_FILE );
116 $fileRelatedSpecialPages = [
'NewFiles',
'ListFiles',
'MostLinkedFiles',
117 'MostGloballyLinkedFiles',
'UncategorizedFiles',
'UnusedFiles',
'Search' ];
118 $pageIsFileRelatedSpecialPage =
$out->getTitle()->inNamespace(
NS_SPECIAL )
119 && in_array(
$out->getTitle()->getText(), $fileRelatedSpecialPages );
121 if ( $pageHasThumbnails || $pageIsFilePage || $pageIsFileRelatedSpecialPage ) {
135 $title = $catPage->getTitle();
136 $cat = Category::newFromTitle( $title );
137 if ( $cat->getFileCount() > 0 ) {
138 $out = $catPage->getContext()->getOutput();
158 $prefs[
'multimedia-viewer'] = [
159 'label-message' =>
'multimediaviewer-pref',
160 'desc-message' =>
'multimediaviewer-pref-desc',
165 'ltr' =>
"$wgExtensionAssetsPath/MultimediaViewer/viewer-ltr.svg",
166 'rtl' =>
"$wgExtensionAssetsPath/MultimediaViewer/viewer-rtl.svg",
183 $prefs[
'multimediaviewer-enable'] = [
185 'label-message' =>
'multimediaviewer-optin-pref',
186 'section' =>
'rendering/files',
208 $vars[
'wgMultimediaViewer'] = [
221 'tooltipDelay' => 1000,
222 'extensions' => $wgMediaViewerExtensions,
224 $vars[
'wgMediaViewer'] =
true;
238 $user =
$out->getUser();
241 $vars[
'wgMediaViewerEnabledByDefault'] =
242 !empty( $defaultUserOptions[
'multimediaviewer-enable'] );
252 $testModules[
'qunit'][
'mmv.tests'] = [
254 'tests/qunit/mmv/mmv.bootstrap.test.js',
255 'tests/qunit/mmv/mmv.test.js',
256 'tests/qunit/mmv/mmv.lightboxinterface.test.js',
257 'tests/qunit/mmv/mmv.lightboximage.test.js',
258 'tests/qunit/mmv/mmv.ThumbnailWidthCalculator.test.js',
259 'tests/qunit/mmv/mmv.EmbedFileFormatter.test.js',
260 'tests/qunit/mmv/mmv.Config.test.js',
261 'tests/qunit/mmv/mmv.HtmlUtils.test.js',
262 'tests/qunit/mmv/logging/mmv.logging.DurationLogger.test.js',
263 'tests/qunit/mmv/logging/mmv.logging.PerformanceLogger.test.js',
264 'tests/qunit/mmv/logging/mmv.logging.ActionLogger.test.js',
265 'tests/qunit/mmv/logging/mmv.logging.AttributionLogger.test.js',
266 'tests/qunit/mmv/logging/mmv.logging.DimensionLogger.test.js',
267 'tests/qunit/mmv/logging/mmv.logging.ViewLogger.test.js',
268 'tests/qunit/mmv/model/mmv.model.test.js',
269 'tests/qunit/mmv/model/mmv.model.IwTitle.test.js',
270 'tests/qunit/mmv/model/mmv.model.TaskQueue.test.js',
271 'tests/qunit/mmv/model/mmv.model.License.test.js',
272 'tests/qunit/mmv/model/mmv.model.Image.test.js',
273 'tests/qunit/mmv/model/mmv.model.Repo.test.js',
274 'tests/qunit/mmv/model/mmv.model.EmbedFileInfo.test.js',
275 'tests/qunit/mmv/provider/mmv.provider.Api.test.js',
276 'tests/qunit/mmv/provider/mmv.provider.ImageInfo.test.js',
277 'tests/qunit/mmv/provider/mmv.provider.FileRepoInfo.test.js',
278 'tests/qunit/mmv/provider/mmv.provider.ThumbnailInfo.test.js',
279 'tests/qunit/mmv/provider/mmv.provider.GuessedThumbnailInfo.test.js',
280 'tests/qunit/mmv/provider/mmv.provider.Image.test.js',
281 'tests/qunit/mmv/routing/mmv.routing.MainFileRoute.test.js',
282 'tests/qunit/mmv/routing/mmv.routing.ThumbnailRoute.test.js',
283 'tests/qunit/mmv/routing/mmv.routing.Router.test.js',
284 'tests/qunit/mmv/ui/mmv.ui.test.js',
285 'tests/qunit/mmv/ui/mmv.ui.canvas.test.js',
286 'tests/qunit/mmv/ui/mmv.ui.canvasButtons.test.js',
287 'tests/qunit/mmv/ui/mmv.ui.description.test.js',
288 'tests/qunit/mmv/ui/mmv.ui.download.pane.test.js',
289 'tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js',
290 'tests/qunit/mmv/ui/mmv.ui.metadataPanelScroller.test.js',
291 'tests/qunit/mmv/ui/mmv.ui.progressBar.test.js',
292 'tests/qunit/mmv/ui/mmv.ui.permission.test.js',
293 'tests/qunit/mmv/ui/mmv.ui.stripeButtons.test.js',
294 'tests/qunit/mmv/ui/mmv.ui.reuse.dialog.test.js',
295 'tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js',
296 'tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js',
297 'tests/qunit/mmv/ui/mmv.ui.reuse.tab.test.js',
298 'tests/qunit/mmv/ui/mmv.ui.reuse.utils.test.js',
299 'tests/qunit/mmv/ui/mmv.ui.tipsyDialog.test.js',
300 'tests/qunit/mmv/ui/mmv.ui.truncatableTextField.test.js',
301 'tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js',
302 'tests/qunit/mmv/mmv.testhelpers.js',
308 'mmv.ui.ondemandshareddependencies',
309 'mmv.ui.reuse.shareembed',
310 'mmv.ui.download.pane',
311 'mmv.ui.tipsyDialog',
314 'localBasePath' => dirname( __DIR__ ),
315 'remoteExtPath' =>
'MultimediaViewer',
331 $file = $thumbnail->getFile();
338 if ( method_exists( $file,
'getWidth' ) ) {
339 $attribs[
'data-file-width'] = $file->getWidth();
342 if ( method_exists( $file,
'getHeight' ) ) {
343 $attribs[
'data-file-height'] = $file->getHeight();
$wgExtensionAssetsPath
The URL path of the extensions directory.
$wgResourceModules['ext.ReplaceText']
This class should be covered by a general architecture document which does not exist as of January 20...
Dynamic JavaScript and CSS resource loading system.
Media transform output for images.
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
static configuration should be added through ResourceLoaderGetConfigVars instead & $vars
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext such as when responding to a resource loader request or generating HTML output & $resourceLoader