Expand all

mw.widgets.MediaUserUploadsQueue

Media resource queue.

Extends

Constructor

new mw.widgets.MediaUserUploadsQueue([config]) #

Create an instance of mw.widgets.MediaUserUploadsQueue.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Description
maxHeight number

The maximum height of the media, used in the search call to the API.

Source:

Methods

addProvider(provider) #

Add a provider to the group.

Parameters:

Name Type Description
provider mw.widgets.APIResultsProvider

A provider object

Inherited from:
Source:
Add a provider to the group.

get([howMany]) → {jQuery.Promise} #

Get items from the queue.

Parameters:

Name Type Attributes Description
howMany number optional

How many items to retrieve. Defaults to the default limit supplied on initialization.

Inherited from:
Source:

Returns:

Promise that resolves into an array of items.

Type
jQuery.Promise
Get items from the queue.

getFileRepos() → {jQuery.Promise} #

Fetch the file repos.

Inherited from:
Source:

Returns:

Promise that resolves when the resources are set up

Type
jQuery.Promise
Fetch the file repos.

getLang() → {string|undefined} #

Get language for the query results.

Inherited from:
Source:

Returns:

lang Language

Type
string | undefined
Get language for the query results.

getMaxHeight() → {string} #

Get image maximum height.

Inherited from:
Source:

Returns:

Image max height

Type
string
Get image maximum height.

getParams() → {Object} #

Get the data parameters sent to the API.

Inherited from:
Source:

Returns:

params API search parameters

Type
Object
Get the data parameters sent to the API.

getProviders() → {Array.<mw.widgets.APIResultsProvider>} #

Set the providers.

Inherited from:
Source:

Returns:

providers An array of providers

Type
Array.<mw.widgets.APIResultsProvider>
Set the providers.

getQueueSize() → {number} #

Get the queue size.

Inherited from:
Source:

Returns:

Queue size

Type
number
Get the queue size.

getThreshold() → {number} #

Get queue threshold.

Inherited from:
Source:

Returns:

threshold Queue threshold, below which we will request more items

Type
number
Get queue threshold.

getUser() → {string} #

Get the user name.

Source:

Returns:

API search query

Type
string
Get the user name.

queryProviders([howMany]) → {jQuery.Promise} #

Get results from all providers.

Parameters:

Name Type Attributes Description
howMany number optional

How many items to retrieve. Defaults to the default limit supplied on initialization.

Inherited from:
Source:

Returns:

Promise that is resolved into an array of fetched items. Note: The promise must have an .abort() functionality.

Type
jQuery.Promise
Get results from all providers.

reset() #

Reset the queue and all its providers.

Inherited from:
Source:
Reset the queue and all its providers.

setLang(lang) #

Set language for the query results.

Parameters:

Name Type Description
lang string | undefined

Language

Inherited from:
Source:
Set language for the query results.

setParams(params) #

Set the search query for all the providers.

This also makes sure to abort any previous promises.

Parameters:

Name Type Description
params Object

API search parameters

Inherited from:
Source:
Set the search query for all the providers.

setProviders(providers) #

Set the providers.

Parameters:

Name Type Description
providers Array.<mw.widgets.APIResultsProvider>

An array of providers

Inherited from:
Source:
Set the providers.

setThreshold(threshold) #

Set queue threshold.

Parameters:

Name Type Description
threshold number

Queue threshold, below which we will request more items

Inherited from:
Source:
Set queue threshold.

setUser(user) #

Set the user name.

Parameters:

Name Type Description
user string

User name

Source:
Set the user name.

setup() → {jQuery.Promise} #

Override parent method to set up the providers according to the file repos.

Overrides:
Source:

Returns:

Promise that resolves when the resources are set up

Type
jQuery.Promise

Override parent method to set up the providers according to the file repos.