Silence some warnings, mostly about attributes

This commit is contained in:
Nathan Gray 2012-07-23 23:54:16 +00:00
parent 0fa5e2ee49
commit fa69637b82
10 changed files with 72 additions and 4 deletions

View File

@ -137,6 +137,10 @@ function et2_checkType(_val, _type, _attr, _cname)
return _val;
}
// Handle some less common possibilities
// Maybe a split on an empty string
if(typeof _val == "object" && jQuery.isEmptyObject(_val)) return "";
return _err();
}

View File

@ -49,6 +49,12 @@ var et2_inputWidget = et2_valueWidget.extend(et2_IInput, {
"type": "string",
"default": et2_no_init,
"description": "Used internally to store the validation error that came from the server."
},
"tabindex": {
"name": "Tab index",
"type": "integer",
"default": et2_no_init,
"description": "Specifies the tab order of a widget when the 'tab' button is used for navigating."
}
},
@ -235,6 +241,13 @@ var et2_inputWidget = et2_valueWidget.extend(et2_IInput, {
}
},
/**
* Set tab index
*/
set_tabindex: function(index) {
jQuery(this.getInputNode()).attr("tabindex", index);
},
getInputNode: function() {
return this.node;
},

View File

@ -34,12 +34,13 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
},
'value': {
'name': 'Custom fields',
'description': 'Auto filled'
'description': 'Auto filled',
'type': "any"
},
'type_filter': {
'name': 'Field filter',
"default": "",
"type": "string",
"type": "any", // String or array
"description": "Filter displayed custom fields by their 'type2' attribute"
}
},

View File

@ -1706,6 +1706,8 @@ var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend({
default:
_attrs.type = _attrs.widget_type;
}
// Avoid warning about non-existant attribute
delete(_attrs.widget_type);
this.real_node = et2_createWidget(_attrs.type, _attrs, this._parent);
},

View File

@ -45,6 +45,18 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
"type": "string",
"description": "JS code which gets executed when the button is clicked"
},
"accesskey": {
"name": "Access Key",
"type": "string",
"default": et2_no_init,
"description": "Alt + <key> activates widget"
},
"tabindex": {
"name": "Tab index",
"type": "integer",
"default": et2_no_init,
"description": "Specifies the tab order of a widget when the 'tab' button is used for navigating."
},
// No such thing as a required button
"needed": {
"ignore": true,
@ -76,6 +88,9 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
}
},
set_accesskey: function(key) {
jQuery(this.node).attr("accesskey", key);
},
set_ro_image: function(_image) {
if(this.options.readonly)
{
@ -161,6 +176,12 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
}
},
/**
* Set tab index
*/
set_tabindex: function(index) {
jQuery(this.btn).attr("tabindex", index);
},
/**
* Implementation of the et2_IInput interface

View File

@ -297,8 +297,13 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], {
readRowNode = function _readRowNode(node, nodeName) {
if (x >= w)
{
if(nodeName != "description")
{
// Only notify it skipping other than description,
// description used to pad
this.egw().debug("warn", "Skipped grid cell in row, '" +
nodeName + "'");
}
return;
}

View File

@ -31,6 +31,12 @@
*/
var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],{
attributes: {
"value": {
"type": "any"
}
},
columns: [
{'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time'},
{'id': 'owner', caption: 'User', 'width': '150px', widget_type: 'select-account'},

View File

@ -28,6 +28,9 @@ var et2_html = et2_valueWidget.extend([et2_IDetachedDOM], {
name: "Label",
translate: true,
type: "string",
},
"needed": {
"ignore": true
}
},
init: function() {

View File

@ -57,6 +57,10 @@ var et2_link_to = et2_inputWidget.extend({
"type": "string",
"default": "Link",
"description": "Label for the link button"
},
"value": {
// Could be string or int if application is provided, or an Object
"type": "any"
}
},

View File

@ -170,9 +170,18 @@ var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
"multiline": {
"ignore": true
},
"maxlength": {
"igore": true
},
"onchange": {
"ignore": true
},
"rows": {
"ignore": true
},
"cols": {
"ignore": true
},
"size": {
"ignore": true
},