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; return _val;
} }
// Handle some less common possibilities
// Maybe a split on an empty string
if(typeof _val == "object" && jQuery.isEmptyObject(_val)) return "";
return _err(); return _err();
} }

View File

@ -49,6 +49,12 @@ var et2_inputWidget = et2_valueWidget.extend(et2_IInput, {
"type": "string", "type": "string",
"default": et2_no_init, "default": et2_no_init,
"description": "Used internally to store the validation error that came from the server." "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() { getInputNode: function() {
return this.node; return this.node;
}, },

View File

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

View File

@ -1706,6 +1706,8 @@ var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend({
default: default:
_attrs.type = _attrs.widget_type; _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); 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", "type": "string",
"description": "JS code which gets executed when the button is clicked" "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 // No such thing as a required button
"needed": { "needed": {
"ignore": true, "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) { set_ro_image: function(_image) {
if(this.options.readonly) 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 * 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) { readRowNode = function _readRowNode(node, nodeName) {
if (x >= w) if (x >= w)
{ {
this.egw().debug("warn", "Skipped grid cell in row, '" + if(nodeName != "description")
nodeName + "'"); {
// Only notify it skipping other than description,
// description used to pad
this.egw().debug("warn", "Skipped grid cell in row, '" +
nodeName + "'");
}
return; return;
} }

View File

@ -31,6 +31,12 @@
*/ */
var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],{ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],{
attributes: {
"value": {
"type": "any"
}
},
columns: [ columns: [
{'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time'}, {'id': 'user_ts', caption: 'Date', 'width': '120px', widget_type: 'date-time'},
{'id': 'owner', caption: 'User', 'width': '150px', widget_type: 'select-account'}, {'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", name: "Label",
translate: true, translate: true,
type: "string", type: "string",
},
"needed": {
"ignore": true
} }
}, },
init: function() { init: function() {

View File

@ -57,6 +57,10 @@ var et2_link_to = et2_inputWidget.extend({
"type": "string", "type": "string",
"default": "Link", "default": "Link",
"description": "Label for the link button" "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": { "multiline": {
"ignore": true "ignore": true
}, },
"maxlength": {
"igore": true
},
"onchange": {
"ignore": true
},
"rows": { "rows": {
"ignore": true "ignore": true
}, },
"cols": {
"ignore": true
},
"size": { "size": {
"ignore": true "ignore": true
}, },