Fix JS comments

This commit is contained in:
Clemens Schwaighofer
2019-10-04 18:56:23 +09:00
parent 723b6345bb
commit 18bf829c6b
2 changed files with 91 additions and 91 deletions

View File

@@ -14,9 +14,9 @@ if (!DEBUG) {
/** /**
* opens a popup window with winName and given features (string) * opens a popup window with winName and given features (string)
* @param {String} theURL the url * @param {String} theURL the url
* @param {String} winName window name * @param {String} winName window name
* @param {Object} features popup features * @param {Object} features popup features
*/ */
function pop(theURL, winName, features) { function pop(theURL, winName, features) {
winName = window.open(theURL, winName, features); winName = window.open(theURL, winName, features);
@@ -25,7 +25,7 @@ function pop(theURL, winName, features) {
/** /**
* automatically resize a text area based on the amount of lines in it * automatically resize a text area based on the amount of lines in it
* @param {[string} ta_id element id * @param {[string} ta_id element id
*/ */
function expandTA(ta_id) { function expandTA(ta_id) {
var ta; var ta;
@@ -114,8 +114,8 @@ function setCenter(id, left, top)
/** /**
* goes to an element id position * goes to an element id position
* @param {String} element element id to move to * @param {String} element element id to move to
* @param {Number} offset offset from top, default is 0 (px) * @param {Number} [offset=0] offset from top, default is 0 (px)
*/ */
function goToPos(element, offset = 0) function goToPos(element, offset = 0)
{ {
@@ -351,7 +351,7 @@ function formatBytes(bytes)
/** /**
* prints out error messages based on data available from the browser * prints out error messages based on data available from the browser
* @param {Object} err error from try/catch block * @param {Object} err error from try/catch block
*/ */
function errorCatch(err) function errorCatch(err)
{ {
@@ -380,7 +380,7 @@ function errorCatch(err)
/** /**
* show or hide the "do" overlay * show or hide the "do" overlay
* @param {String} loc location name for action indicator, default empty. for console.log * @param {String} [loc=''] location name for action indicator, default empty. for console.log
*/ */
function actionIndicator(loc = '') function actionIndicator(loc = '')
{ {
@@ -394,7 +394,7 @@ function actionIndicator(loc = '')
/** /**
* explicit show for action Indicator * explicit show for action Indicator
* instead of automatically show or hide, do on command show * instead of automatically show or hide, do on command show
* @param {String} loc optional location name, empty if not set. for console.log * @param {String} [loc=''] optional location name, empty if not set. for console.log
*/ */
function actionIndicatorShow(loc = '') function actionIndicatorShow(loc = '')
{ {
@@ -408,7 +408,7 @@ function actionIndicatorShow(loc = '')
/** /**
* explicit hide for action Indicator * explicit hide for action Indicator
* instead of automatically show or hide, do on command hide * instead of automatically show or hide, do on command hide
* @param {String} loc optional location name, empty if not set. for console.log * @param {String} [loc=''] optional location name, empty if not set. for console.log
*/ */
function actionIndicatorHide(loc = '') function actionIndicatorHide(loc = '')
{ {
@@ -470,12 +470,12 @@ function ClearCall()
// *** DOM MANAGEMENT FUNCTIONS // *** DOM MANAGEMENT FUNCTIONS
/** /**
* reates object for DOM element creation flow * reates object for DOM element creation flow
* @param {String} tag must set tag (div, span, etc) * @param {String} tag must set tag (div, span, etc)
* @param {String} id optional set for id, if input, select will be used for name * @param {String} [id=''] optional set for id, if input, select will be used for name
* @param {String} content text content inside, is skipped if sub elements exist * @param {String} [content=''] text content inside, is skipped if sub elements exist
* @param {Array} css array for css tags * @param {Array} [css=[]] array for css tags
* @param {Object} options anything else (value, placeholder, OnClick, style) * @param {Object} [options={}] anything else (value, placeholder, OnClick, style)
* @return {Object} created element as an object * @return {Object} created element as an object
*/ */
const cel = (tag, id = '', content = '', css = [], options = {}) => const cel = (tag, id = '', content = '', css = [], options = {}) =>
_element = { _element = {
@@ -490,10 +490,10 @@ const cel = (tag, id = '', content = '', css = [], options = {}) =>
/** /**
* attach a cel created object to another to create a basic DOM tree * attach a cel created object to another to create a basic DOM tree
* @param {Object} base object where to attach/search * @param {Object} base object where to attach/search
* @param {Object} attach the object to be attached * @param {Object} attach the object to be attached
* @param {String} id optional id, if given search in base for this id and attach there * @param {String} [id=''] optional id, if given search in base for this id and attach there
* @return {Object} "none", technically there is no return needed as it is global attach * @return {Object} "none", technically there is no return needed as it is global attach
*/ */
function ael(base, attach, id = '') function ael(base, attach, id = '')
{ {
@@ -658,14 +658,14 @@ function phfo(tree)
* creates an select/options drop down block. * creates an select/options drop down block.
* the array needs to be key -> value format. * the array needs to be key -> value format.
* key is for the option id and value is for the data output * key is for the option id and value is for the data output
* @param {String} name name/id * @param {String} name name/id
* @param {Object} data array for the options * @param {Object} data array for the options
* @param {String} selected selected item uid * @param {String} [selected=''] selected item uid
* @param {Boolean} options_only [def false] if this is true, it will not print the select part * @param {Boolean} [options_only=false] if this is true, it will not print the select part
* @param {Boolean} return_string [def false]: return as string and not as element * @param {Boolean} [return_string=false] return as string and not as element
* @param {String} sort [def '']: if empty as is, else allowed 'keys', * @param {String} [sort=''] if empty as is, else allowed 'keys',
* 'values' all others are ignored * 'values' all others are ignored
* @return {String} html with build options block * @return {String} html with build options block
*/ */
function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '') function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '')
{ {
@@ -678,18 +678,18 @@ function html_options(name, data, selected = '', options_only = false, return_st
* creates an select/options drop down block. * creates an select/options drop down block.
* the array needs to be key -> value format. * the array needs to be key -> value format.
* key is for the option id and value is for the data output * key is for the option id and value is for the data output
* @param {String} name name/id * @param {String} name name/id
* @param {Object} data array for the options * @param {Object} data array for the options
* @param {String} selected selected item uid * @param {String} [selected=''] selected item uid
* @param {Number} multiple [def 0] if this is 1 or larger, the drop down * @param {Number} [multiple=0] if this is 1 or larger, the drop down
* will be turned into multiple select * will be turned into multiple select
* the number sets the size value unless it is 1, * the number sets the size value unless it is 1,
* then it is default * then it is default
* @param {Boolean} options_only [def false] if this is true, it will not print the select part * @param {Boolean} [options_only=false] if this is true, it will not print the select part
* @param {Boolean} return_string [def false]: return as string and not as element * @param {Boolean} [return_string=false] return as string and not as element
* @param {String} sort [def '']: if empty as is, else allowed 'keys', 'values' * @param {String} [sort=''] if empty as is, else allowed 'keys',
* all others are ignored * 'values' all others are ignored
* @return {String} html with build options block * @return {String} html with build options block
*/ */
function html_options_block(name, data, selected = '', multiple = 0, options_only = false, return_string = false, sort = '') function html_options_block(name, data, selected = '', multiple = 0, options_only = false, return_string = false, sort = '')
{ {
@@ -763,10 +763,10 @@ function html_options_block(name, data, selected = '', multiple = 0, options_onl
/** /**
* refills a select box with options and keeps the selected * refills a select box with options and keeps the selected
* @param {String} name name/id * @param {String} name name/id
* @param {Object} data array of options * @param {Object} data array of options
* @param {String} sort [def '']: if empty as is, else allowed 'keys', 'values' * @param {String} [sort=''] if empty as is, else allowed 'keys', 'values'
* all others are ignored * all others are ignored
*/ */
function html_options_refill(name, data, sort = '') function html_options_refill(name, data, sort = '')
{ {

View File

@@ -14,9 +14,9 @@ if (!DEBUG) {
/** /**
* opens a popup window with winName and given features (string) * opens a popup window with winName and given features (string)
* @param {String} theURL the url * @param {String} theURL the url
* @param {String} winName window name * @param {String} winName window name
* @param {Object} features popup features * @param {Object} features popup features
*/ */
function pop(theURL, winName, features) { function pop(theURL, winName, features) {
winName = window.open(theURL, winName, features); winName = window.open(theURL, winName, features);
@@ -25,7 +25,7 @@ function pop(theURL, winName, features) {
/** /**
* automatically resize a text area based on the amount of lines in it * automatically resize a text area based on the amount of lines in it
* @param {[string} ta_id element id * @param {[string} ta_id element id
*/ */
function expandTA(ta_id) { function expandTA(ta_id) {
var ta; var ta;
@@ -71,8 +71,8 @@ function ShowHideMenu(status, id)
/** /**
* used in old templates * used in old templates
* move element action * move element action
* @param {String} id element id to move * @param {String} id element id to move
* @param {String} direction move direction * @param {String} direction move direction
*/ */
function mv(id, direction) function mv(id, direction)
{ {
@@ -85,7 +85,7 @@ function mv(id, direction)
/** /**
* used in old templates * used in old templates
* load element action * load element action
* @param {String} id the element id to load * @param {String} id the element id to load
*/ */
function le(id) function le(id)
{ {
@@ -195,8 +195,8 @@ function setCenter(id, left, top)
/** /**
* goes to an element id position * goes to an element id position
* @param {String} element element id to move to * @param {String} element element id to move to
* @param {Number} offset offset from top, default is 0 (px) * @param {Number} [offset=0] offset from top, default is 0 (px)
*/ */
function goToPos(element, offset = 0) function goToPos(element, offset = 0)
{ {
@@ -438,7 +438,7 @@ function formatBytes(bytes)
/** /**
* prints out error messages based on data available from the browser * prints out error messages based on data available from the browser
* @param {Object} err error from try/catch block * @param {Object} err error from try/catch block
*/ */
function errorCatch(err) function errorCatch(err)
{ {
@@ -467,7 +467,7 @@ function errorCatch(err)
/** /**
* show or hide the "do" overlay * show or hide the "do" overlay
* @param {String} loc location name for action indicator, default empty. for console.log * @param {String} [loc=''] location name for action indicator, default empty. for console.log
*/ */
function actionIndicator(loc = '') function actionIndicator(loc = '')
{ {
@@ -481,7 +481,7 @@ function actionIndicator(loc = '')
/** /**
* explicit show for action Indicator * explicit show for action Indicator
* instead of automatically show or hide, do on command show * instead of automatically show or hide, do on command show
* @param {String} loc optional location name, empty if not set. for console.log * @param {String} [loc=''] optional location name, empty if not set. for console.log
*/ */
function actionIndicatorShow(loc = '') function actionIndicatorShow(loc = '')
{ {
@@ -495,7 +495,7 @@ function actionIndicatorShow(loc = '')
/** /**
* explicit hide for action Indicator * explicit hide for action Indicator
* instead of automatically show or hide, do on command hide * instead of automatically show or hide, do on command hide
* @param {String} loc optional location name, empty if not set. for console.log * @param {String} [loc=''] optional location name, empty if not set. for console.log
*/ */
function actionIndicatorHide(loc = '') function actionIndicatorHide(loc = '')
{ {
@@ -557,12 +557,12 @@ function ClearCall()
// *** DOM MANAGEMENT FUNCTIONS // *** DOM MANAGEMENT FUNCTIONS
/** /**
* reates object for DOM element creation flow * reates object for DOM element creation flow
* @param {String} tag must set tag (div, span, etc) * @param {String} tag must set tag (div, span, etc)
* @param {String} id optional set for id, if input, select will be used for name * @param {String} [id=''] optional set for id, if input, select will be used for name
* @param {String} content text content inside, is skipped if sub elements exist * @param {String} [content=''] text content inside, is skipped if sub elements exist
* @param {Array} css array for css tags * @param {Array} [css=[]] array for css tags
* @param {Object} options anything else (value, placeholder, OnClick, style) * @param {Object} [options={}] anything else (value, placeholder, OnClick, style)
* @return {Object} created element as an object * @return {Object} created element as an object
*/ */
const cel = (tag, id = '', content = '', css = [], options = {}) => const cel = (tag, id = '', content = '', css = [], options = {}) =>
_element = { _element = {
@@ -577,10 +577,10 @@ const cel = (tag, id = '', content = '', css = [], options = {}) =>
/** /**
* attach a cel created object to another to create a basic DOM tree * attach a cel created object to another to create a basic DOM tree
* @param {Object} base object where to attach/search * @param {Object} base object where to attach/search
* @param {Object} attach the object to be attached * @param {Object} attach the object to be attached
* @param {String} id optional id, if given search in base for this id and attach there * @param {String} [id=''] optional id, if given search in base for this id and attach there
* @return {Object} "none", technically there is no return needed as it is global attach * @return {Object} "none", technically there is no return needed as it is global attach
*/ */
function ael(base, attach, id = '') function ael(base, attach, id = '')
{ {
@@ -745,14 +745,14 @@ function phfo(tree)
* creates an select/options drop down block. * creates an select/options drop down block.
* the array needs to be key -> value format. * the array needs to be key -> value format.
* key is for the option id and value is for the data output * key is for the option id and value is for the data output
* @param {String} name name/id * @param {String} name name/id
* @param {Object} data array for the options * @param {Object} data array for the options
* @param {String} selected selected item uid * @param {String} [selected=''] selected item uid
* @param {Boolean} options_only [def false] if this is true, it will not print the select part * @param {Boolean} [options_only=false] if this is true, it will not print the select part
* @param {Boolean} return_string [def false]: return as string and not as element * @param {Boolean} [return_string=false] return as string and not as element
* @param {String} sort [def '']: if empty as is, else allowed 'keys', * @param {String} [sort=''] if empty as is, else allowed 'keys',
* 'values' all others are ignored * 'values' all others are ignored
* @return {String} html with build options block * @return {String} html with build options block
*/ */
function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '') function html_options(name, data, selected = '', options_only = false, return_string = false, sort = '')
{ {
@@ -765,18 +765,18 @@ function html_options(name, data, selected = '', options_only = false, return_st
* creates an select/options drop down block. * creates an select/options drop down block.
* the array needs to be key -> value format. * the array needs to be key -> value format.
* key is for the option id and value is for the data output * key is for the option id and value is for the data output
* @param {String} name name/id * @param {String} name name/id
* @param {Object} data array for the options * @param {Object} data array for the options
* @param {String} selected selected item uid * @param {String} [selected=''] selected item uid
* @param {Number} multiple [def 0] if this is 1 or larger, the drop down * @param {Number} [multiple=0] if this is 1 or larger, the drop down
* will be turned into multiple select * will be turned into multiple select
* the number sets the size value unless it is 1, * the number sets the size value unless it is 1,
* then it is default * then it is default
* @param {Boolean} options_only [def false] if this is true, it will not print the select part * @param {Boolean} [options_only=false] if this is true, it will not print the select part
* @param {Boolean} return_string [def false]: return as string and not as element * @param {Boolean} [return_string=false] return as string and not as element
* @param {String} sort [def '']: if empty as is, else allowed 'keys', 'values' * @param {String} [sort=''] if empty as is, else allowed 'keys',
* all others are ignored * 'values' all others are ignored
* @return {String} html with build options block * @return {String} html with build options block
*/ */
function html_options_block(name, data, selected = '', multiple = 0, options_only = false, return_string = false, sort = '') function html_options_block(name, data, selected = '', multiple = 0, options_only = false, return_string = false, sort = '')
{ {
@@ -850,10 +850,10 @@ function html_options_block(name, data, selected = '', multiple = 0, options_onl
/** /**
* refills a select box with options and keeps the selected * refills a select box with options and keeps the selected
* @param {String} name name/id * @param {String} name name/id
* @param {Object} data array of options * @param {Object} data array of options
* @param {String} sort [def '']: if empty as is, else allowed 'keys', 'values' * @param {String} [sort=''] if empty as is, else allowed 'keys', 'values'
* all others are ignored * all others are ignored
*/ */
function html_options_refill(name, data, sort = '') function html_options_refill(name, data, sort = '')
{ {