Expand all

License

Class for storing license information about an image. For available fields, see TemplateParser::$licenseFieldClasses in the CommonsMetadata extension.

Constructor

new License(shortName, [internalName], [longName], [deedUrl], [attributionRequired], [nonFree]) #

Parameters:

Name Type Attributes Description
shortName string

see #shortName

internalName string optional

see #internalName

longName string optional

see #longName

deedUrl string optional

see #deedUrl

attributionRequired boolean optional

see #attributionRequired

nonFree boolean optional

see #nonFree

Source:

Properties

attributionRequired #

Properties:

Name Type Description
attributionRequired boolean

does the author need to be attributed on reuse?

Source:

deedUrl #

Properties:

Name Type Description
deedUrl string

URL to the description of the license (e.g. the CC deed)

Source:

internalName #

Properties:

Name Type Description
internalName string

internal name of the license, used for localization (e.g. cc-by-sa )

Source:

longName #

Properties:

Name Type Description
longName string

full name of the license (e.g. Creative Commons etc. etc.)

Source:

nonFree #

Properties:

Name Type Description
nonFree boolean

is this a non-free license?

Source:

shortName #

Properties:

Name Type Description
shortName string

short (abbreviated) name of the license (e.g. CC-BY-SA-3.0)

Source:

Methods

Returns a short HTML representation of the license.

getShortName() → {string} #

Returns the short name of the license:

  • if we have interface messages for this license (basically just CC and PD), use those
  • otherwise use the short name from the license template (might or might not be translated still, depending on how the template is set up)

Returns:

FIXME a model should not depend on an i18n class. We should probably use view models.

Type
string
Source:

Returns the short name of the license:

  • if we have interface messages for this license (basically just CC and PD), use those
  • otherwise use the short name from the license template (might or might not be translated still, depending on how the template is set up)

isCc() → {boolean} #

Check whether this is a Creative Commons license.

Returns:

Type
boolean
Source:
Check whether this is a Creative Commons license.

isFree() → {boolean} #

Check whether this is a free license.

Returns:

Type
boolean
Source:
Check whether this is a free license.

isPd() → {boolean} #

Check whether this is a public domain "license".

Returns:

Type
boolean
Source:
Check whether this is a public domain "license".

needsAttribution() → {boolean} #

Check whether reusers need to attribute the author

Returns:

Type
boolean
Source:
Check whether reusers need to attribute the author