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;
57 return BetaFeatures::isFeatureEnabled( $user,
'multimedia-viewer' );
66 if ( !$user->isLoggedIn() ) {
67 return (
bool)$enableByDefaultForAnons;
69 return (
bool)$user->getOption(
'multimediaviewer-enable' );
80 $out->addModules( [
'mmv.head',
'mmv.bootstrap.autostart' ] );
94 $pageHasThumbnails = count(
$out->getFileSearchOptions() ) > 0;
95 $pageIsFilePage =
$out->getTitle()->inNamespace(
NS_FILE );
96 $fileRelatedSpecialPages = [
'NewFiles',
'ListFiles',
'MostLinkedFiles',
97 'MostGloballyLinkedFiles',
'UncategorizedFiles',
'UnusedFiles',
'Search' ];
98 $pageIsFileRelatedSpecialPage =
$out->getTitle()->inNamespace(
NS_SPECIAL )
99 && in_array(
$out->getTitle()->getText(), $fileRelatedSpecialPages );
101 if ( $pageHasThumbnails || $pageIsFilePage || $pageIsFileRelatedSpecialPage ) {
115 $title = $catPage->getTitle();
116 $cat = Category::newFromTitle( $title );
117 if ( $cat->getFileCount() > 0 ) {
118 $out = $catPage->getContext()->getOutput();
138 $prefs[
'multimedia-viewer'] = [
139 'label-message' =>
'multimediaviewer-pref',
140 'desc-message' =>
'multimediaviewer-pref-desc',
145 'ltr' =>
"$wgExtensionAssetsPath/MultimediaViewer/viewer-ltr.svg",
146 'rtl' =>
"$wgExtensionAssetsPath/MultimediaViewer/viewer-rtl.svg",
163 $prefs[
'multimediaviewer-enable'] = [
165 'label-message' =>
'multimediaviewer-optin-pref',
166 'section' =>
'rendering/files',
188 $vars[
'wgMultimediaViewer'] = [
201 'tooltipDelay' => 1000,
202 'extensions' => $wgMediaViewerExtensions,
204 $vars[
'wgMediaViewer'] =
true;
218 $user =
$out->getUser();
221 $vars[
'wgMediaViewerEnabledByDefault'] =
222 !empty( $defaultUserOptions[
'multimediaviewer-enable'] );
232 $testModules[
'qunit'][
'mmv.tests'] = [
234 'tests/qunit/mmv/mmv.bootstrap.test.js',
235 'tests/qunit/mmv/mmv.test.js',
236 'tests/qunit/mmv/mmv.lightboxinterface.test.js',
237 'tests/qunit/mmv/mmv.lightboximage.test.js',
238 'tests/qunit/mmv/mmv.ThumbnailWidthCalculator.test.js',
239 'tests/qunit/mmv/mmv.EmbedFileFormatter.test.js',
240 'tests/qunit/mmv/mmv.Config.test.js',
241 'tests/qunit/mmv/mmv.HtmlUtils.test.js',
242 'tests/qunit/mmv/logging/mmv.logging.DurationLogger.test.js',
243 'tests/qunit/mmv/logging/mmv.logging.PerformanceLogger.test.js',
244 'tests/qunit/mmv/logging/mmv.logging.ActionLogger.test.js',
245 'tests/qunit/mmv/logging/mmv.logging.AttributionLogger.test.js',
246 'tests/qunit/mmv/logging/mmv.logging.DimensionLogger.test.js',
247 'tests/qunit/mmv/logging/mmv.logging.ViewLogger.test.js',
248 'tests/qunit/mmv/model/mmv.model.test.js',
249 'tests/qunit/mmv/model/mmv.model.IwTitle.test.js',
250 'tests/qunit/mmv/model/mmv.model.TaskQueue.test.js',
251 'tests/qunit/mmv/model/mmv.model.License.test.js',
252 'tests/qunit/mmv/model/mmv.model.Image.test.js',
253 'tests/qunit/mmv/model/mmv.model.Repo.test.js',
254 'tests/qunit/mmv/model/mmv.model.EmbedFileInfo.test.js',
255 'tests/qunit/mmv/provider/mmv.provider.Api.test.js',
256 'tests/qunit/mmv/provider/mmv.provider.ImageInfo.test.js',
257 'tests/qunit/mmv/provider/mmv.provider.FileRepoInfo.test.js',
258 'tests/qunit/mmv/provider/mmv.provider.ThumbnailInfo.test.js',
259 'tests/qunit/mmv/provider/mmv.provider.GuessedThumbnailInfo.test.js',
260 'tests/qunit/mmv/provider/mmv.provider.Image.test.js',
261 'tests/qunit/mmv/routing/mmv.routing.MainFileRoute.test.js',
262 'tests/qunit/mmv/routing/mmv.routing.ThumbnailRoute.test.js',
263 'tests/qunit/mmv/routing/mmv.routing.Router.test.js',
264 'tests/qunit/mmv/ui/mmv.ui.test.js',
265 'tests/qunit/mmv/ui/mmv.ui.canvas.test.js',
266 'tests/qunit/mmv/ui/mmv.ui.canvasButtons.test.js',
267 'tests/qunit/mmv/ui/mmv.ui.description.test.js',
268 'tests/qunit/mmv/ui/mmv.ui.download.pane.test.js',
269 'tests/qunit/mmv/ui/mmv.ui.metadataPanel.test.js',
270 'tests/qunit/mmv/ui/mmv.ui.metadataPanelScroller.test.js',
271 'tests/qunit/mmv/ui/mmv.ui.progressBar.test.js',
272 'tests/qunit/mmv/ui/mmv.ui.permission.test.js',
273 'tests/qunit/mmv/ui/mmv.ui.stripeButtons.test.js',
274 'tests/qunit/mmv/ui/mmv.ui.reuse.dialog.test.js',
275 'tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js',
276 'tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js',
277 'tests/qunit/mmv/ui/mmv.ui.reuse.tab.test.js',
278 'tests/qunit/mmv/ui/mmv.ui.reuse.utils.test.js',
279 'tests/qunit/mmv/ui/mmv.ui.tipsyDialog.test.js',
280 'tests/qunit/mmv/ui/mmv.ui.truncatableTextField.test.js',
281 'tests/qunit/mmv/ui/mmv.ui.viewingOptions.test.js',
282 'tests/qunit/mmv/mmv.testhelpers.js',
288 'mmv.ui.ondemandshareddependencies',
289 'mmv.ui.reuse.shareembed',
290 'mmv.ui.download.pane',
291 'mmv.ui.tipsyDialog',
294 'localBasePath' => dirname( __DIR__ ),
295 'remoteExtPath' =>
'MultimediaViewer',
311 $file = $thumbnail->getFile();
318 if ( method_exists( $file,
'getWidth' ) ) {
319 $attribs[
'data-file-width'] = $file->getWidth();
322 if ( method_exists( $file,
'getHeight' ) ) {
323 $attribs[
'data-file-height'] = $file->getHeight();
$wgExtensionAssetsPath
The URL path of the extensions directory.
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
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))