Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4062131
mw.widgets.MediaResourceQueue.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
mw.widgets.MediaResourceQueue.js
View Options
/*!
* MediaWiki Widgets - MediaResourceQueue class.
*
* @copyright 2011-2016 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
(
function
()
{
/**
* @classdesc Media resource queue.
*
* @class
* @extends mw.widgets.APIResultsQueue
*
* @constructor
* @description Create an instance of `mw.widgets.MediaResourceQueue`.
* @param {Object} [config] Configuration options
* @param {number} config.maxHeight The maximum height of the media, used in the
* search call to the API.
*/
mw
.
widgets
.
MediaResourceQueue
=
function
MwWidgetsMediaResourceQueue
(
config
)
{
config
=
config
||
{};
// Parent constructor
mw
.
widgets
.
MediaResourceQueue
.
super
.
call
(
this
,
config
);
this
.
maxHeight
=
config
.
maxHeight
||
200
;
};
/* Inheritance */
OO
.
inheritClass
(
mw
.
widgets
.
MediaResourceQueue
,
mw
.
widgets
.
APIResultsQueue
);
/**
* Fetch the file repos.
*
* @return {jQuery.Promise} Promise that resolves when the resources are set up
*/
mw
.
widgets
.
MediaResourceQueue
.
prototype
.
getFileRepos
=
function
()
{
const
defaultSource
=
[
{
url
:
mw
.
util
.
wikiScript
(
'api'
),
local
:
''
}
];
if
(
!
this
.
fileRepoPromise
)
{
this
.
fileRepoPromise
=
new
mw
.
Api
().
get
(
{
action
:
'query'
,
meta
:
'filerepoinfo'
}
).
then
(
(
resp
)
=>
resp
.
query
&&
resp
.
query
.
repos
||
defaultSource
,
()
=>
$
.
Deferred
().
resolve
(
defaultSource
)
);
}
return
this
.
fileRepoPromise
;
};
/**
* Get image maximum height.
*
* @return {string} Image max height
*/
mw
.
widgets
.
MediaResourceQueue
.
prototype
.
getMaxHeight
=
function
()
{
return
this
.
maxHeight
;
};
}()
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 16 2026, 10:08 (12 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
38/8c/2f55af9bd785c102b350ad7b8990
Default Alt Text
mw.widgets.MediaResourceQueue.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment