Skip to content

Commit

Permalink
Merge pull request openwrt#6587 from stokito/typos
Browse files Browse the repository at this point in the history
luci-base: Fix typos in JsDocs
  • Loading branch information
jow- committed Sep 26, 2023
2 parents 0c3f396 + 7744ad0 commit 957a631
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 165 deletions.
7 changes: 1 addition & 6 deletions modules/luci-base/htdocs/luci-static/resources/cbi.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,7 @@ function cbi_validate_form(form, errmsg)
function cbi_validate_named_section_add(input)
{
var button = input.parentNode.parentNode.querySelector('.cbi-button-add');
if (input.value !== '') {
button.disabled = false;
}
else {
button.disabled = true;
}
button.disabled = input.value === '';
}

function cbi_validate_reset(form)
Expand Down
68 changes: 34 additions & 34 deletions modules/luci-base/htdocs/luci-static/resources/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var CBIAbstractElement = baseclass.extend(/** @lends LuCI.form.AbstractElement.p
/**
* Add another form element as children to this element.
*
* @param {AbstractElement} element
* @param {AbstractElement} obj
* The form element to add.
*/
append: function(obj) {
Expand All @@ -217,7 +217,7 @@ var CBIAbstractElement = baseclass.extend(/** @lends LuCI.form.AbstractElement.p
* The `parse()` function recursively walks the form element tree and
* triggers input value reading and validation for each encountered element.
*
* Elements which are hidden due to unsatisified dependencies are skipped.
* Elements which are hidden due to unsatisfied dependencies are skipped.
*
* @returns {Promise<void>}
* Returns a promise resolving once this element's value and the values of
Expand Down Expand Up @@ -277,7 +277,7 @@ var CBIAbstractElement = baseclass.extend(/** @lends LuCI.form.AbstractElement.p
/**
* Strip any HTML tags from the given input string.
*
* @param {string} input
* @param {string} s
* The input string to clean.
*
* @returns {string}
Expand Down Expand Up @@ -348,7 +348,7 @@ var CBIAbstractElement = baseclass.extend(/** @lends LuCI.form.AbstractElement.p
* @classdesc
*
* The `Map` class represents one complete form. A form usually maps one UCI
* configuraton file and is divided into multiple sections containing multiple
* configuration file and is divided into multiple sections containing multiple
* fields each.
*
* It serves as main entry point into the `LuCI.form` for typical view code.
Expand All @@ -364,7 +364,7 @@ var CBIAbstractElement = baseclass.extend(/** @lends LuCI.form.AbstractElement.p
*
* @param {string} [description]
* The description text of the form which is usually rendered as text
* paragraph below the form title and before the actual form conents.
* paragraph below the form title and before the actual form contents.
* If omitted, the corresponding paragraph element will not be rendered.
*/
var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
Expand Down Expand Up @@ -502,11 +502,11 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
* @param {LuCI.form.AbstractSection} sectionclass
* The section class to use for rendering the configuration section.
* Note that this value must be the class itself, not a class instance
* obtained from calling `new`. It must also be a class dervied from
* obtained from calling `new`. It must also be a class derived from
* `LuCI.form.AbstractSection`.
*
* @param {...string} classargs
* Additional arguments which are passed as-is to the contructor of the
* Additional arguments which are passed as-is to the constructor of the
* given section class. Refer to the class specific constructor
* documentation for details.
*
Expand Down Expand Up @@ -558,7 +558,7 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
* The `parse()` function recursively walks the form element tree and
* triggers input value reading and validation for each child element.
*
* Elements which are hidden due to unsatisified dependencies are skipped.
* Elements which are hidden due to unsatisfied dependencies are skipped.
*
* @returns {Promise<void>}
* Returns a promise resolving once the entire form completed parsing all
Expand Down Expand Up @@ -588,7 +588,7 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
*
* @param {boolean} [silent=false]
* If set to `true`, trigger an alert message to the user in case saving
* the form data failes. Otherwise fail silently.
* the form data failures. Otherwise fail silently.
*
* @returns {Promise<void>}
* Returns a promise resolving once the entire save operation is complete.
Expand Down Expand Up @@ -688,15 +688,15 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
/**
* Find a form option element instance.
*
* @param {string} name_or_id
* @param {string} name
* The name or the full ID of the option element to look up.
*
* @param {string} [section_id]
* The ID of the UCI section containing the option to look up. May be
* omitted if a full ID is passed as first argument.
*
* @param {string} [config]
* The name of the UCI configuration the option instance is belonging to.
* @param {string} [config_name]
* The name of the UCI configuration the option instance belongs to.
* Defaults to the main UCI configuration of the map if omitted.
*
* @returns {Array<LuCI.form.AbstractValue,string>|null}
Expand Down Expand Up @@ -797,7 +797,7 @@ var CBIMap = CBIAbstractElement.extend(/** @lends LuCI.form.Map.prototype */ {
*
* @param {string} [description]
* The description text of the form which is usually rendered as text
* paragraph below the form title and before the actual form conents.
* paragraph below the form title and before the actual form contents.
* If omitted, the corresponding paragraph element will not be rendered.
*/
var CBIJSONMap = CBIMap.extend(/** @lends LuCI.form.JSONMap.prototype */ {
Expand Down Expand Up @@ -921,7 +921,7 @@ var CBIAbstractSection = CBIAbstractElement.extend(/** @lends LuCI.form.Abstract
* triggers input value reading and validation for each encountered child
* option element.
*
* Options which are hidden due to unsatisified dependencies are skipped.
* Options which are hidden due to unsatisfied dependencies are skipped.
*
* @returns {Promise<void>}
* Returns a promise resolving once the values of all child elements have
Expand Down Expand Up @@ -967,7 +967,7 @@ var CBIAbstractSection = CBIAbstractElement.extend(/** @lends LuCI.form.Abstract
* contents. If omitted, no description will be rendered.
*
* @throws {Error}
* Throws an exeption if a tab with the same `name` already exists.
* Throws an exception if a tab with the same `name` already exists.
*/
tab: function(name, title, description) {
if (this.tabs && this.tabs[name])
Expand Down Expand Up @@ -997,11 +997,11 @@ var CBIAbstractSection = CBIAbstractElement.extend(/** @lends LuCI.form.Abstract
* @param {LuCI.form.AbstractValue} optionclass
* The option class to use for rendering the configuration option. Note
* that this value must be the class itself, not a class instance obtained
* from calling `new`. It must also be a class dervied from
* from calling `new`. It must also be a class derived from
* [LuCI.form.AbstractSection]{@link LuCI.form.AbstractSection}.
*
* @param {...*} classargs
* Additional arguments which are passed as-is to the contructor of the
* Additional arguments which are passed as-is to the constructor of the
* given option class. Refer to the class specific constructor
* documentation for details.
*
Expand All @@ -1024,17 +1024,17 @@ var CBIAbstractSection = CBIAbstractElement.extend(/** @lends LuCI.form.Abstract
/**
* Add a configuration option widget to a tab of the section.
*
* @param {string} tabname
* @param {string} tabName
* The name of the section tab to add the option element to.
*
* @param {LuCI.form.AbstractValue} optionclass
* The option class to use for rendering the configuration option. Note
* that this value must be the class itself, not a class instance obtained
* from calling `new`. It must also be a class dervied from
* from calling `new`. It must also be a class derived from
* [LuCI.form.AbstractSection]{@link LuCI.form.AbstractSection}.
*
* @param {...*} classargs
* Additional arguments which are passed as-is to the contructor of the
* Additional arguments which are passed as-is to the constructor of the
* given option class. Refer to the class specific constructor
* documentation for details.
*
Expand Down Expand Up @@ -1377,7 +1377,7 @@ var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractVa

/**
* If set to `true`, the underlying ui input widget value is not cleared
* from the configuration on unsatisfied depedencies. The default behavior
* from the configuration on unsatisfied dependencies. The default behavior
* is to remove the values of all options whose dependencies are not
* fulfilled.
*
Expand Down Expand Up @@ -1539,10 +1539,10 @@ var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractVa
*/

/**
* Add a dependency contraint to the option.
* Add a dependency constraint to the option.
*
* Dependency constraints allow making the presence of option elements
* dependant on the current values of certain other options within the
* dependent on the current values of certain other options within the
* same form. An option element with unsatisfied dependencies will be
* hidden from the view and its current value is omitted when saving.
*
Expand All @@ -1554,7 +1554,7 @@ var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractVa
* a logical "and" expression.
*
* Option names may be given in "dot notation" which allows to reference
* option elements outside of the current form section. If a name without
* option elements outside the current form section. If a name without
* dot is specified, it refers to an option within the same configuration
* section. If specified as <code>configname.sectionid.optionname</code>,
* options anywhere within the same form may be specified.
Expand Down Expand Up @@ -1620,11 +1620,11 @@ var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractVa
* </li>
* </ul>
*
* @param {string|Object<string, string|RegExp>} optionname_or_depends
* @param {string|Object<string, string|RegExp>} field
* The name of the option to depend on or an object describing multiple
* dependencies which must be satified (a logical "and" expression).
* dependencies which must be satisfied (a logical "and" expression).
*
* @param {string} optionvalue|RegExp
* @param {string|RegExp} value
* When invoked with a plain option name as first argument, this parameter
* specifies the expected value. In case an object is passed as first
* argument, this parameter is ignored.
Expand Down Expand Up @@ -3126,7 +3126,7 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
* @returns {*|Promise<*>}
* Return values of this function are ignored but if a promise is returned,
* it is run to completion before the rendering is continued, allowing
* custom logic to perform asynchroneous work before the modal dialog
* custom logic to perform asynchronous work before the modal dialog
* is shown.
*/
addModalOptions: function(modalSection, section_id, ev) {
Expand Down Expand Up @@ -3298,7 +3298,7 @@ var CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection.p
*
* Another important difference is that the table cells show a readonly text
* preview of the corresponding option elements by default, unless the child
* option element is explicitely made writable by setting the `editable`
* option element is explicitly made writable by setting the `editable`
* property to `true`.
*
* Additionally, the grid section honours a `modalonly` property of child
Expand Down Expand Up @@ -3347,7 +3347,7 @@ var CBIGridSection = CBITableSection.extend(/** @lends LuCI.form.GridSection.pro
* contents. If omitted, no description will be rendered.
*
* @throws {Error}
* Throws an exeption if a tab with the same `name` already exists.
* Throws an exception if a tab with the same `name` already exists.
*/
tab: function(name, title, description) {
CBIAbstractSection.prototype.tab.call(this, name, title, description);
Expand Down Expand Up @@ -3665,7 +3665,7 @@ var CBIValue = CBIAbstractValue.extend(/** @lends LuCI.form.Value.prototype */ {
* @param {string} key
* The choice value to add.
*
* @param {Node|string} value
* @param {Node|string} val
* The caption for the choice value. May be a DOM node, a document fragment
* or a plain text string. If omitted, the `key` value is used as caption.
*/
Expand Down Expand Up @@ -3877,7 +3877,7 @@ var CBIDynamicList = CBIValue.extend(/** @lends LuCI.form.DynamicList.prototype
* @classdesc
*
* The `ListValue` class implements a simple static HTML select element
* allowing the user to chose a single value from a set of predefined choices.
* allowing the user chose a single value from a set of predefined choices.
* It builds upon the {@link LuCI.ui.Select} widget.
*
* @param {LuCI.form.Map|LuCI.form.JSONMap} form
Expand Down Expand Up @@ -4326,7 +4326,7 @@ var CBIDummyValue = CBIValue.extend(/** @lends LuCI.form.DummyValue.prototype */
__name__: 'CBI.DummyValue',

/**
* Set an URL which is opened when clicking on the dummy value text.
* Set a URL which is opened when clicking on the dummy value text.
*
* By setting this property, the dummy value text is wrapped in an `<a>`
* element with the property value used as `href` attribute.
Expand Down Expand Up @@ -4799,7 +4799,7 @@ var CBISectionValue = CBIValue.extend(/** @lends LuCI.form.SectionValue.prototyp
* @hideconstructor
* @classdesc
*
* The LuCI form class provides high level abstractions for creating creating
* The LuCI form class provides high level abstractions for creating
* UCI- or JSON backed configurations forms.
*
* To import the class in views, use `'require form'`, to import it in
Expand Down
6 changes: 3 additions & 3 deletions modules/luci-base/htdocs/luci-static/resources/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ var FileSystem = baseclass.extend(/** @lends LuCI.fs.prototype */ {
/**
* Unlink the given file.
*
* @param {string}
* @param {string} path
* The file path to remove.
*
* @returns {Promise<number>}
Expand Down Expand Up @@ -345,7 +345,7 @@ var FileSystem = baseclass.extend(/** @lends LuCI.fs.prototype */ {
* @param {string} path
* The file path to read.
*
* @param {string} [type=text]
* @param {"blob"|"text"|"blob"} [type=text]
* The expected type of read file contents. Valid values are `text` to
* interpret the contents as string, `json` to parse the contents as JSON
* or `blob` to return the contents as Blob instance.
Expand Down Expand Up @@ -387,7 +387,7 @@ var FileSystem = baseclass.extend(/** @lends LuCI.fs.prototype */ {
* @param {string[]} [params]
* The arguments to pass to the command.
*
* @param {string} [type=text]
* @param {"blob"|"text"|"blob"} [type=text]
* The expected output type of the invoked program. Valid values are
* `text` to interpret the output as string, `json` to parse the output
* as JSON or `blob` to return the output as Blob instance.
Expand Down
Loading

0 comments on commit 957a631

Please sign in to comment.