docu update to fix ide warnings and indention

This commit is contained in:
Ralf Becker 2014-01-29 18:55:24 +00:00
parent 0cab4a7837
commit 9e29d8b282
2 changed files with 58 additions and 32 deletions

View File

@ -328,6 +328,8 @@ var et2_date_duration = et2_date.extend(
/** /**
* Use id on node, same as DOMWidget * Use id on node, same as DOMWidget
*
* @param {string} _value id to set
*/ */
set_id: function(_value) { set_id: function(_value) {
this.id = _value; this.id = _value;
@ -412,9 +414,9 @@ var et2_date_duration = et2_date.extend(
if(_value === '') _unit = ''; if(_value === '') _unit = '';
// use decimal separator from user prefs // use decimal separator from user prefs
var sep = '.';
var format = this.egw().preference('number_format'); var format = this.egw().preference('number_format');
if (typeof _value == 'string' && format && (sep = format[0]) && sep != '.') var sep = format ? format[0] : '.';
if (typeof _value == 'string' && format && sep && sep != '.')
{ {
_value = _value.replace('.',sep); _value = _value.replace('.',sep);
} }
@ -480,6 +482,8 @@ var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
* Build a list of attributes which can be set when working in the * Build a list of attributes which can be set when working in the
* "detached" mode in the _attrs array which is provided * "detached" mode in the _attrs array which is provided
* by the calling code. * by the calling code.
*
* @param {array} _attrs array to add further attributes to
*/ */
getDetachedAttributes: function(_attrs) { getDetachedAttributes: function(_attrs) {
_attrs.push("value"); _attrs.push("value");
@ -488,6 +492,8 @@ var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
/** /**
* Returns an array of DOM nodes. The (relativly) same DOM-Nodes have to be * Returns an array of DOM nodes. The (relativly) same DOM-Nodes have to be
* passed to the "setDetachedAttributes" function in the same order. * passed to the "setDetachedAttributes" function in the same order.
*
* @return {array}
*/ */
getDetachedNodes: function() { getDetachedNodes: function() {
return [this.duration[0], this.format[0]]; return [this.duration[0], this.format[0]];
@ -658,6 +664,8 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
* Creates a list of attributes which can be set when working in the * Creates a list of attributes which can be set when working in the
* "detached" mode. The result is stored in the _attrs array which is provided * "detached" mode. The result is stored in the _attrs array which is provided
* by the calling code. * by the calling code.
*
* @param {array} _attrs array to add further attributes to
*/ */
getDetachedAttributes: function(_attrs) { getDetachedAttributes: function(_attrs) {
_attrs.push("value", "class"); _attrs.push("value", "class");
@ -666,6 +674,8 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
/** /**
* Returns an array of DOM nodes. The (relatively) same DOM-Nodes have to be * Returns an array of DOM nodes. The (relatively) same DOM-Nodes have to be
* passed to the "setDetachedAttributes" function in the same order. * passed to the "setDetachedAttributes" function in the same order.
*
* @return {array}
*/ */
getDetachedNodes: function() { getDetachedNodes: function() {
return [this.span[0]]; return [this.span[0]];

View File

@ -284,6 +284,11 @@ var et2_selectbox = et2_inputWidget.extend(
/** /**
* Add an option to regular drop-down select * Add an option to regular drop-down select
*
* @param {string} _value value attribute of option
* @param {string} _label label of option
* @param {string} _title title attribute of option
* @param {node} dom_element parent of new option
*/ */
_appendOptionElement: function(_value, _label, _title, dom_element) { _appendOptionElement: function(_value, _label, _title, dom_element) {
if(_value == "" && (_label == null || _label == "")) { if(_value == "" && (_label == null || _label == "")) {
@ -316,6 +321,11 @@ var et2_selectbox = et2_inputWidget.extend(
/** /**
* Append a value to multi-select * Append a value to multi-select
*
* @param {string} _value value attribute of option
* @param {string} _label label of option
* @param {string} _title title attribute of option
* @param {node} dom_element parent of new option
*/ */
_appendMultiOption: function(_value, _label, _title, dom_element) { _appendMultiOption: function(_value, _label, _title, dom_element) {
var option_data = null; var option_data = null;
@ -429,7 +439,7 @@ var et2_selectbox = et2_inputWidget.extend(
var all_set = jQuery("input[type='checkbox']",e.data).prop("checked"); var all_set = jQuery("input[type='checkbox']",e.data).prop("checked");
jQuery("input[type='checkbox']",e.data).prop("checked", !all_set); jQuery("input[type='checkbox']",e.data).prop("checked", !all_set);
} }
}, }
}; };
for(var key in header_controls) for(var key in header_controls)
{ {
@ -456,8 +466,8 @@ var et2_selectbox = et2_inputWidget.extend(
loadFromXML: function(_node) { loadFromXML: function(_node) {
// Handle special case where legacy option for empty label is used (conflicts with rows), and rows is set as an attribute // Handle special case where legacy option for empty label is used (conflicts with rows), and rows is set as an attribute
var legacy; var legacy = _node.getAttribute("options");
if(legacy = _node.getAttribute("options")) if(legacy)
{ {
var legacy = legacy.split(","); var legacy = legacy.split(",");
if(legacy.length && isNaN(legacy[0])) if(legacy.length && isNaN(legacy[0]))
@ -623,6 +633,8 @@ var et2_selectbox = et2_inputWidget.extend(
/** /**
* The set_select_options function is added, as the select options have to be * The set_select_options function is added, as the select options have to be
* added after the "option"-widgets were added to selectbox. * added after the "option"-widgets were added to selectbox.
*
* @param {(array|object)} _options array or object with options
*/ */
set_select_options: function(_options) { set_select_options: function(_options) {
// Empty current options // Empty current options
@ -880,6 +892,8 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
* Creates a list of attributes which can be set when working in the * Creates a list of attributes which can be set when working in the
* "detached" mode. The result is stored in the _attrs array which is provided * "detached" mode. The result is stored in the _attrs array which is provided
* by the calling code. * by the calling code.
*
* @param {array} _attrs array to add further attributes to
*/ */
getDetachedAttributes: function(_attrs) { getDetachedAttributes: function(_attrs) {
_attrs.push("value"); _attrs.push("value");
@ -888,6 +902,8 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
/** /**
* Returns an array of DOM nodes. The (relatively) same DOM-Nodes have to be * Returns an array of DOM nodes. The (relatively) same DOM-Nodes have to be
* passed to the "setDetachedAttributes" function in the same order. * passed to the "setDetachedAttributes" function in the same order.
*
* @return {array}
*/ */
getDetachedNodes: function() { getDetachedNodes: function() {
return [this.span[0]]; return [this.span[0]];