forked from mirrors/bookwyrm
[assets] Tweak JSDoc.
This commit is contained in:
parent
fb45df0f99
commit
54805afb51
3 changed files with 19 additions and 23 deletions
|
@ -57,7 +57,6 @@ let BookWyrm = new class {
|
||||||
* Go back in browser history.
|
* Go back in browser history.
|
||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
back(event) {
|
back(event) {
|
||||||
|
@ -67,10 +66,10 @@ let BookWyrm = new class {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a counter with recurring requests to the API
|
* Update a counter with recurring requests to the API
|
||||||
|
* The delay is slightly randomized and increased on each cycle.
|
||||||
*
|
*
|
||||||
* @param {Object} counter - DOM node
|
* @param {Object} counter - DOM node
|
||||||
* @param {int} delay - frequency for polling in ms
|
* @param {int} delay - frequency for polling in ms
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
polling(counter, delay) {
|
polling(counter, delay) {
|
||||||
|
@ -93,7 +92,6 @@ let BookWyrm = new class {
|
||||||
*
|
*
|
||||||
* @param {object} counter - DOM node
|
* @param {object} counter - DOM node
|
||||||
* @param {object} data - json formatted response from a fetch
|
* @param {object} data - json formatted response from a fetch
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
updateCountElement(counter, data) {
|
updateCountElement(counter, data) {
|
||||||
|
@ -110,7 +108,6 @@ let BookWyrm = new class {
|
||||||
* Toggle form.
|
* Toggle form.
|
||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
revealForm(event) {
|
revealForm(event) {
|
||||||
|
@ -124,7 +121,6 @@ let BookWyrm = new class {
|
||||||
* Execute actions on targets based on triggers.
|
* Execute actions on targets based on triggers.
|
||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
toggleAction(event) {
|
toggleAction(event) {
|
||||||
|
@ -178,7 +174,6 @@ let BookWyrm = new class {
|
||||||
* Show or hide menus.
|
* Show or hide menus.
|
||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
toggleMenu(trigger, targetId) {
|
toggleMenu(trigger, targetId) {
|
||||||
|
@ -198,7 +193,6 @@ let BookWyrm = new class {
|
||||||
*
|
*
|
||||||
* @param {object} container - DOM node
|
* @param {object} container - DOM node
|
||||||
* @param {boolean} pressed - Is the trigger pressed?
|
* @param {boolean} pressed - Is the trigger pressed?
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
toggleContainer(container, pressed) {
|
toggleContainer(container, pressed) {
|
||||||
|
@ -210,7 +204,6 @@ let BookWyrm = new class {
|
||||||
*
|
*
|
||||||
* @param {object} checkbox - DOM node
|
* @param {object} checkbox - DOM node
|
||||||
* @param {boolean} pressed - Is the trigger pressed?
|
* @param {boolean} pressed - Is the trigger pressed?
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
toggleCheckbox(checkbox, pressed) {
|
toggleCheckbox(checkbox, pressed) {
|
||||||
|
@ -219,12 +212,9 @@ let BookWyrm = new class {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Give the focus to an element.
|
* Give the focus to an element.
|
||||||
*
|
* Only move the focus based on user interactions.
|
||||||
* This is useful with modals: the focus needs to go back to the element that
|
|
||||||
* was focused before opening the modal.
|
|
||||||
*
|
*
|
||||||
* @param {string} nodeId - ID of the DOM node to focus (button, link…)
|
* @param {string} nodeId - ID of the DOM node to focus (button, link…)
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
toggleFocus(nodeId) {
|
toggleFocus(nodeId) {
|
||||||
|
@ -242,7 +232,6 @@ let BookWyrm = new class {
|
||||||
* This function is used for boosts and favourites.
|
* This function is used for boosts and favourites.
|
||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
interact(event) {
|
interact(event) {
|
||||||
|
@ -292,7 +281,6 @@ let BookWyrm = new class {
|
||||||
* Submit a form using POST.
|
* Submit a form using POST.
|
||||||
*
|
*
|
||||||
* @param {object} form - Form to be submitted
|
* @param {object} form - Form to be submitted
|
||||||
*
|
|
||||||
* @return {Promise}
|
* @return {Promise}
|
||||||
*/
|
*/
|
||||||
ajaxPost(form) {
|
ajaxPost(form) {
|
||||||
|
|
|
@ -1,13 +1,23 @@
|
||||||
/**
|
|
||||||
* Toggle all descendant checkboxes of a target.
|
|
||||||
*
|
|
||||||
* Use `data-target="ID_OF_TARGET"` on the node on which the event is listened
|
|
||||||
* to (checkbox, button, link…), where_ID_OF_TARGET_ should be the ID of an
|
|
||||||
* ancestor for the checkboxes.
|
|
||||||
*/
|
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle all descendant checkboxes of a target.
|
||||||
|
*
|
||||||
|
* Use `data-target="ID_OF_TARGET"` on the node on which the event is listened
|
||||||
|
* to (checkbox, button, link…), where_ID_OF_TARGET_ should be the ID of an
|
||||||
|
* ancestor for the checkboxes.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* <input
|
||||||
|
* type="checkbox"
|
||||||
|
* data-action="toggle-all"
|
||||||
|
* data-target="failed-imports"
|
||||||
|
* >
|
||||||
|
* @param {Event} event
|
||||||
|
* @return {undefined}
|
||||||
|
*/
|
||||||
function toggleAllCheckboxes(event) {
|
function toggleAllCheckboxes(event) {
|
||||||
const mainCheckbox = event.target;
|
const mainCheckbox = event.target;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ let LocalStorageTools = new class {
|
||||||
* Update localStorage, then display content based on keys in localStorage.
|
* Update localStorage, then display content based on keys in localStorage.
|
||||||
*
|
*
|
||||||
* @param {Event} event
|
* @param {Event} event
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
updateDisplay(event) {
|
updateDisplay(event) {
|
||||||
|
@ -32,7 +31,6 @@ let LocalStorageTools = new class {
|
||||||
* Toggle display of a DOM node based on its value in the localStorage.
|
* Toggle display of a DOM node based on its value in the localStorage.
|
||||||
*
|
*
|
||||||
* @param {object} node - DOM node to toggle.
|
* @param {object} node - DOM node to toggle.
|
||||||
*
|
|
||||||
* @return {undefined}
|
* @return {undefined}
|
||||||
*/
|
*/
|
||||||
setDisplay(node) {
|
setDisplay(node) {
|
||||||
|
|
Loading…
Reference in a new issue