forked from extern/egroupware
docu update to fix ide warnings and indention
This commit is contained in:
parent
0cab4a7837
commit
9e29d8b282
@ -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]];
|
||||||
|
@ -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
|
||||||
@ -877,35 +889,39 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
|
|||||||
* Functions for et2_IDetachedDOM
|
* Functions for 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.
|
||||||
*/
|
*
|
||||||
getDetachedAttributes: function(_attrs) {
|
* @param {array} _attrs array to add further attributes to
|
||||||
_attrs.push("value");
|
*/
|
||||||
},
|
getDetachedAttributes: function(_attrs) {
|
||||||
|
_attrs.push("value");
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
*/
|
*
|
||||||
getDetachedNodes: function() {
|
* @return {array}
|
||||||
return [this.span[0]];
|
*/
|
||||||
},
|
getDetachedNodes: function() {
|
||||||
|
return [this.span[0]];
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the given associative attribute->value array and applies the
|
* Sets the given associative attribute->value array and applies the
|
||||||
* attributes to the given DOM-Node.
|
* attributes to the given DOM-Node.
|
||||||
*
|
*
|
||||||
* @param _nodes is an array of nodes which have to be in the same order as
|
* @param _nodes is an array of nodes which have to be in the same order as
|
||||||
* the nodes returned by "getDetachedNodes"
|
* the nodes returned by "getDetachedNodes"
|
||||||
* @param _values is an associative array which contains a subset of attributes
|
* @param _values is an associative array which contains a subset of attributes
|
||||||
* returned by the "getDetachedAttributes" function and sets them to the
|
* returned by the "getDetachedAttributes" function and sets them to the
|
||||||
* given values.
|
* given values.
|
||||||
*/
|
*/
|
||||||
setDetachedAttributes: function(_nodes, _values) {
|
setDetachedAttributes: function(_nodes, _values) {
|
||||||
this.span = jQuery(_nodes[0]);
|
this.span = jQuery(_nodes[0]);
|
||||||
this.set_value(_values["value"]);
|
this.set_value(_values["value"]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
et2_register_widget(et2_selectbox_ro, ["menupopup_ro", "listbox_ro", "select_ro", "select-cat_ro",
|
et2_register_widget(et2_selectbox_ro, ["menupopup_ro", "listbox_ro", "select_ro", "select-cat_ro",
|
||||||
|
Loading…
Reference in New Issue
Block a user