Will prevent non-numbers being submitted. Enables autocomplete for this field, based on the suggestns parameter. article - Text input field, no restrictions.This can be used to restrict user input, or change the input field to a different type. The label can contain most normal wikitext: links, images, spans with styles and titles (hover-overs), etc. The default value is the corresponding param#. This is the name of the parameter which will be passed to the template when submitted. If you only define a param1 and a param5, it won't process param5 - you'll need to define 1, 2, 3, 4, and 5. Parameters are processed in numerical order starting at 1, and ending when one cannot be found. However, if a parameter is defined, only param# is required (though some combinations of type#, range#, and default# are invalid). No parameters are required - though a no-parameter form calculator is weird. Things with the same number refer to the same row of the form. These are followed by a number - param1, label1, etc. Each parameter defines a row in the form, and has 5 components: Parameter definitionĪny number of parameters can be defined. The result will appear here when you submit the form. By default this is (borders for clarity): Override the message that appears before the calculator loads. This is a good way of having the form and result horizontally adjacent to each other. horizontaltable - An unstyled table with the result to the right of the form.This is best for small forms and results. verticaltable - A wikitable with the form placed directly above the result, with some generic headers.Most form calculators where the result is a table will use this. basic - A simple output which has the form directly above the result (separated by two line breaks) with no additional formatting.No form/result location is created, so user can define their own. This defines the type of automatically created form/result location is used. A comma-separated list of namespace IDs to use in autocomplete fields. Like form, make sure it is sufficiently unique.įor example, |result = jsCalc-effigies-result. Make sure this is sufficiently descriptive so it cannot clash with general IDs on the page.įor example, |form = jsCalc-effigies-form. Other namespaces are required - mainspace is used by a preceding colon only (i.e. If the template is in the Template: namespace, the Template: prefix can be omitted. |page = name of the page the calculator is on: use. The response to the query comes back and is placed into the result ID, replacing what is there already.Think of this like editing a page with just the template on it, changing the values and pressing preview.The javascript builds and sends a query to the MediaWiki API, which processes the template and returns the HTML.The user inputs their data and presses submit.The javascript generates the form from the config and places it in the location defined by the form ID, replacing what is there already.When the page loads, the javascript detects the config (specifically the jcConfig class) and reads it in.This template adds a usage of each of the IDs, to define where the form and result go (alternatively the editor can do this manually).It also includes the name of a template.This code includes two unique identifiers, one for the form and one for the result.The configuration is defined on the page by an editor either using this template or using plain code.The Swashbuckler is a Mythic All Damage weapon.īelow, it makes more sense to simply link rarity in the paragraph:Ī brief rundown of how form calculators work: This template can be used to link to another relevant article or set of articles when there is no way to fluently link the article in prose. Form calculator invokes Module:Main article using Lua.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |