Jump to content

Module:Sandbox/Mr. Stradivarius/sandbox3/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 12:18, 4 September 2013 (add more quality grades and quality grade triggers). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Class definitions

The main class for WikiProject banners. Defines the wikitext for the banner box, specifies the project name, the main image, and other things relevant to the banner as a whole.

Initiated with: banner:new()

Methods:

banner:setImage( s )

Sets the main image for the banner. Input type: string

banner:getImage()

Gets the main image for the banner.

banner:addCategory( s )

Adds one category to the banner object. Input type: string (no double brackets and no "Category:" text)

banner:addCategories( t )

Adds multiple categories to the banner object. Input type: array of strings

banner:getCategories()

Gets an array containing the category names for the banner object.

banner:exportCategories()

Returns a string containing all the banner's categories ready for output on a wiki page.

banner:addRow( rowObject )

Adds a row object to the banner. Input type: Row object.

banner:addRows( t )

Adds an array of row objects to the banner object. Input type: array of row objects.

banner:export()

Exports the banner to wikitext ready for display on wiki pages.

row class

The row class defines one row to add to the banner object. Rows can be things like task forces, notes, assessments, etc.

Initiated with:

row:new()

Methods:

row:addCategory( s )

Adds a category to the row object. Input type: string (no double brackets and no "Category:" text)

row:addCategories( t )

Adds multiple categories to the row object. Input type: array of strings

row:getCategories()

Gets an array containing the category names for the row object.

row:export()

Exports the row object to wikitext to be passed to the banner object's export method.

assessmentScale class

The assessmentScale class provides the infrastructure for quality scales and importance scales.

Initiated with:

assessmentScale:new()

Methods:

assessmentScale:setCategoryFamily( s )

Sets the name of the category family. For example, for a quality scale with categories such as and the category family name would be "tulips articles". Input type: string

assessmentScale:getCategoryFamily()

Gets the category family name.

assessmentScale:addGrade( assessmentGradeObject )

Adds an assessmentGrade object to the assessment scale (usually this will be a qualityGrade or an importanceGrade object). The assessmentGrade objects added to an assessmentScale object determine the grades on its assessment scale. If the assessmentGrade object is already present in the assessment scale, an error will be raised. Input type: assessmentGrade object

assessmentScale:addGrades( t )

Adds an array of multiple assessmentGrade objects to the assessmentScale object. Input type: array of assessmentGrade objects

assessmentScale:removeGrade( s )

Removes one grade from the assessment scale. Input type: string

assessmentScale:removeGrades( t )

Removes multiple grades from the assessment scale. Input type: array of strings

assessmentScale:getGrades()

Returns the table containing the assessmentGrade objects.

qualityScale class

This class defines a quality scale.

Initiated with:

qualityScale:new()

Methods:

qualityScale:setFaGrade()

Sets an FA grade with the default settings. The grade name is set to "fa", there is one trigger of "fa", the color is "#6699ff", and the icon is "Featured article star.svg".

qualityScale:setFlGrade()

Sets an FL grade with the default settings. The grade name is set to "fl", there is one trigger of "fl", the color is "#6699ff", and the icon is "Featured article star.svg".

qualityScale:setAGrade()

Sets an A grade with the default settings. The grade name is set to "a", there is one trigger of "a", the color is "#66ffff", and the icon is "Symbol a class.svg.svg".

qualityScale:setGaGrade()

Sets a GA grade with the default settings. The grade name is set to "ga", there is one trigger of "ga", the color is "#66ff66", and the icon is "Symbol support vote.svg".

qualityScale:setBGrade()

Sets a B grade with the default settings. The grade name is set to "b", there is one trigger of "b", and the color is "#b2ff66".

qualityScale:setCGrade()

Sets a C grade with the default settings. The grade name is set to "c", there is one trigger of "c", and the color is "#ffff66".

qualityScale:setStartGrade()

Sets a Start grade with the default settings. The grade name is set to "start", there is one trigger of "start", and the color is "#ffaa66".

qualityScale:setStubGrade()

Sets a Stub grade with the default settings. The grade name is set to "stub", there is one trigger of "stub", and the color is "#ff6666".

qualityScale:setFlGrade()

Sets an FL grade with the default settings. The grade name is set to "fl", there is one trigger of "fl", the color is "#6699ff", and the icon is "Featured article star.svg".

qualityScale:setListGrade()

Sets a List grade with the default settings. The grade name is set to "list", there is one trigger of "list", and the color is "#aa88ff".

qualityScale:setNaGrade()

Sets a NA (not applicable) grade with the default settings. The grade name is set to "na", there are two triggers of "na" and "n/a", and the color is "#f5f5f5".

qualityScale:setCategoryGrade()

Sets a Category grade with the default settings. The grade name is set to "category", there are three triggers of "category", "cat" and "categ", and the color is "#ffdb58".

qualityScale:setDisambigGrade()

Sets a Disambig (disambiguation) grade with the default settings. The grade name is set to "disambig", there are four triggers of "disambiguation", "disambig", "disamb" and "dab", and the color is "#00fa9a".

qualityScale:setFileGrade()

Sets a File grade with the default settings. The grade name is set to "file", there are three triggers of "file", "img" and "image", and the color is "#ddccff".

qualityScale:setPortalGrade()

Sets a Portal grade with the default settings. The grade name is set to "portal", there is one trigger of "portal", and the color is "#cc8899".

qualityScale:setProjectGrade()

Sets a Project grade with the default settings. The grade name is set to "project", there are three triggers of "project", "proj" and "prj", and the color is "#c0c090".

qualityScale:setTemplateGrade()

Sets a Template grade with the default settings. The grade name is set to "template", there are five triggers of "template", "temp", "tpl", "tmp" and "templ", and the color is "#fbceb1".

qualityScale:setRedirectGrade()

Sets a Redirect grade with the default settings. The grade name is set to "redirect", there are three triggers of "redirect", "red" and "redir", and the color is "#c0c0c0".

qualityScale:setFmGrade()

Sets an FM (Featured Media) grade with the default settings. The grade name is set to "fm", there is one trigger of "fm", the color is "#6699ff", and the icon is "Featured article star.svg".

qualityScale:setStandardQualityScale()

Sets the standard quality scale, with grades of FA, A, GA, B, C, Start, Stub, FL, List and NA. All the grades have the default values.

qualityScale:setExtendedQualityScale()

Sets the extended quality scale, with the grades in the standard quality scale plus grades of Category, Disambig, File, Portal, Project, and Template. All the grades have the default values.

assessmentGrade class

The assessmentGrade class defines one grade on an assessment scale (e.g. an FA-class grade on a quality scale, or a top-importance grade on an importance scale).

Initiated with:

assessmentGrade:new()

Methods:

assessmentGrade:setGradeName( s )

Sets the name of the assessment grade. For example, for a C-class quality grade, the grade name would be "c". Input type: string

assessmentGrade:getGradeName()

Gets the name of the assessment grade.

assessmentGrade:addTrigger( s )

Adds a trigger for the assessment grade. For example, if you want the grade to be triggered by the code "|class=foo", then the trigger would be "foo". Input type: string

assessmentGrade:addTriggers( t )

Adds multiple triggers for the assessment grade. Input type: array of strings

assessmentGrade:getTriggers()

Gets the array of triggers for the assessment grade.

assessmentGrade:setCategory( s )

Sets the category used by the assessment grade. This should only be used if the category does not follow the default naming system. Normally categories are set by assessmentScale objects or banner objects.

assessmentGrade:getCategory()

Gets the category for the assessment grade, if one was set with assessmentGrade:setCategory.

assessmentGrade:setColor( s )

Sets the color used for icon boxes etc. used by the assessment grade. Input type: string (should be a valid css color value, e.g. '#gg99ff')

assessmentGrade:getColor()

Gets the assessment grade color.

assessmentGrade:setIcon( s )

Sets the icon for the assessment grade, e.g. the featured article star for featured articles. This is optional - not every assessmentGrade object needs an icon. If specified, it should be a valid file name, without the "File:" prefix. Input type: string

assessmentGrade:getIcon()

Gets the icon file name.

qualityGrade class

The quality grade class defines quality grades on a quality scale. It inherits methods from the assessmentGrade class.

Methods:

All methods from the assessmentGrade class