forked from extern/egroupware
fix invalid debug-level "warning", has to be "warn"
This commit is contained in:
parent
dbb6adf806
commit
3a140463e8
@ -77,7 +77,7 @@ function et2_createWidget(_name, _attrs, _parent)
|
||||
// Parse the "readonly" and "type" flag for this element here, as they
|
||||
// determine which constructor is used
|
||||
var nodeName = _attrs["type"] = _name;
|
||||
var readonly = _attrs["readonly"] =
|
||||
var readonly = _attrs["readonly"] =
|
||||
typeof _attrs["readonly"] == "undefined" ? false : _attrs["readonly"];
|
||||
|
||||
// Get the constructor - if the widget is readonly, use the special "_ro"
|
||||
@ -98,7 +98,7 @@ function et2_createWidget(_name, _attrs, _parent)
|
||||
|
||||
/**
|
||||
* The et2 widget base class.
|
||||
*
|
||||
*
|
||||
* @augments Class
|
||||
*/
|
||||
var et2_widget = Class.extend(
|
||||
@ -158,7 +158,7 @@ var et2_widget = Class.extend(
|
||||
* The init function is the constructor of the widget. When deriving new
|
||||
* classes from the widget base class, always call this constructor unless
|
||||
* you know what you're doing.
|
||||
*
|
||||
*
|
||||
* @param _parent is the parent object from the XML tree which contains this
|
||||
* object. The default constructor always adds the new instance to the
|
||||
* children list of the given parent object. _parent may be NULL.
|
||||
@ -317,7 +317,7 @@ var et2_widget = Class.extend(
|
||||
|
||||
/**
|
||||
* Inserts an child at the end of the list.
|
||||
*
|
||||
*
|
||||
* @param _node is the node which should be added. It has to be an instance
|
||||
* of et2_widget
|
||||
*/
|
||||
@ -327,7 +327,7 @@ var et2_widget = Class.extend(
|
||||
|
||||
/**
|
||||
* Inserts a child at the given index.
|
||||
*
|
||||
*
|
||||
* @param _node is the node which should be added. It has to be an instance
|
||||
* of et2_widget
|
||||
* @param _idx is the position at which the element should be added.
|
||||
@ -344,14 +344,14 @@ var et2_widget = Class.extend(
|
||||
|
||||
_node._parent = this;
|
||||
this._children.splice(_idx, 0, _node);
|
||||
|
||||
|
||||
if(_node.implements(et2_IDOMNode) && this.implements(et2_IDOMNode) && _node.parentNode)
|
||||
{
|
||||
_node.detachFromDOM();
|
||||
_node.parentNode = this.getDOMNode(_node);
|
||||
_node.attachToDOM();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -378,7 +378,7 @@ var et2_widget = Class.extend(
|
||||
|
||||
/**
|
||||
* Searches an element by id in the tree, descending into the child levels.
|
||||
*
|
||||
*
|
||||
* @param _id is the id you're searching for
|
||||
*/
|
||||
getWidgetById: function(_id) {
|
||||
@ -429,7 +429,7 @@ var et2_widget = Class.extend(
|
||||
* Returns true if the widget currently resides in the visible part of the
|
||||
* widget tree. E.g. Templates which have been cloned are not in the visible
|
||||
* part of the widget tree.
|
||||
*
|
||||
*
|
||||
* @param _vis can be used by widgets overwriting this function - simply
|
||||
* write
|
||||
* return this._super(inTree);
|
||||
@ -521,7 +521,7 @@ var et2_widget = Class.extend(
|
||||
{
|
||||
attrValue = splitted.slice(j);
|
||||
}
|
||||
|
||||
|
||||
var attr = _proto.attributes[_proto.legacyOptions[j]];
|
||||
|
||||
// If the attribute is marked as boolean, parse the
|
||||
@ -600,7 +600,7 @@ var et2_widget = Class.extend(
|
||||
{
|
||||
if (_attrs[key] && typeof this.attributes[key] != "undefined")
|
||||
{
|
||||
if (this.attributes[key].translate === true ||
|
||||
if (this.attributes[key].translate === true ||
|
||||
(this.attributes[key].translate === "!no_lang" && !_attrs["no_lang"]))
|
||||
{
|
||||
_attrs[key] = this.egw().lang(_attrs[key]);
|
||||
@ -615,7 +615,7 @@ var et2_widget = Class.extend(
|
||||
* First the type and attributes are read from the node. Then the readonly & modifications
|
||||
* arrays are checked for changes specific to the loaded data. Then the appropriate
|
||||
* constructor is called. After the constructor returns, the widget has a chance to
|
||||
* further initialize itself from the XML node when the widget's loadFromXML() method
|
||||
* further initialize itself from the XML node when the widget's loadFromXML() method
|
||||
* is called with the node.
|
||||
*
|
||||
* @param _node XML node to read
|
||||
@ -671,7 +671,7 @@ var et2_widget = Class.extend(
|
||||
|
||||
// Parse the attributes from the given XML attributes object
|
||||
this.parseXMLAttrs(_node.attributes, attributes, constructor.prototype);
|
||||
|
||||
|
||||
// check if parseXMLAttrs gives a different type attribute eg. type="@${row}[type]"
|
||||
if (attributes.type && attributes.type != _nodeName)
|
||||
{
|
||||
@ -682,7 +682,7 @@ var et2_widget = Class.extend(
|
||||
if (readonly && typeof et2_registry[_nodeName + "_ro"] != "undefined")
|
||||
{
|
||||
constructor = et2_registry[_nodeName + "_ro"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do an sanity check for the attributes
|
||||
@ -739,7 +739,7 @@ var et2_widget = Class.extend(
|
||||
* recursively called for all child elements. Do not directly override this
|
||||
* function but the doLoadingFinished function which is executed before
|
||||
* descending deeper into the DOM-Tree.
|
||||
*
|
||||
*
|
||||
* Some widgets (template) do not load immediately because they request
|
||||
* additional resources via AJAX. They will return a Deferred Promise object.
|
||||
* If you call loadingFinished(promises) after creating such a widget
|
||||
@ -751,14 +751,14 @@ var et2_widget = Class.extend(
|
||||
* jQuery.when.apply(null, promises).done( doneCallback );
|
||||
* </code>
|
||||
* @see {@link http://api.jquery.com/category/deferred-object/|jQuery Deferred}
|
||||
*
|
||||
*
|
||||
* @param {Promise[]} promises List of promises from widgets that are not done. Pass an empty array, it will be filled if needed.
|
||||
*/
|
||||
loadingFinished: function(promises) {
|
||||
// Call all availble setters
|
||||
this.initAttributes(this.options);
|
||||
|
||||
// Make sure promises is defined to avoid errors.
|
||||
|
||||
// Make sure promises is defined to avoid errors.
|
||||
// We'll warn (below) if programmer should have passed it.
|
||||
if(typeof promises == "undefined")
|
||||
{
|
||||
@ -781,7 +781,7 @@ var et2_widget = Class.extend(
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var result = this.doLoadingFinished();
|
||||
if(typeof result == "boolean" && result)
|
||||
{
|
||||
@ -794,7 +794,7 @@ var et2_widget = Class.extend(
|
||||
if(warn_if_deferred)
|
||||
{
|
||||
// Might not be a problem, but if you need the widget to be really loaded, it could be
|
||||
egw.debug("warning", "Loading was deferred for widget %o, but creator is not checking. Pass a list to loadingFinished().");
|
||||
egw.debug("warn", "Loading was deferred for widget %o, but creator is not checking. Pass a list to loadingFinished().", this);
|
||||
}
|
||||
// Widget is waiting. Add to the list
|
||||
promises.push(result);
|
||||
@ -802,13 +802,13 @@ var et2_widget = Class.extend(
|
||||
result.done(jQuery.proxy(loadChildren, this));
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* The initAttributes function sets the attributes to their default
|
||||
* values. The attributes are not overwritten, which means, that the
|
||||
* default is only set, if either a setter exists or this[propName] does
|
||||
* not exist yet.
|
||||
*
|
||||
*
|
||||
* Overwritten here to compile legacy JS code in attributes of type "js"
|
||||
*/
|
||||
initAttributes: function(_attrs) {
|
||||
@ -820,8 +820,8 @@ var et2_widget = Class.extend(
|
||||
// compile string values of attribute type "js" to functions
|
||||
if (this.attributes[key].type == 'js' && typeof _attrs[key] == 'string')
|
||||
{
|
||||
val = et2_compileLegacyJS(val, this,
|
||||
this.instanceOf(et2_inputWidget) ? this.getInputNode() :
|
||||
val = et2_compileLegacyJS(val, this,
|
||||
this.instanceOf(et2_inputWidget) ? this.getInputNode() :
|
||||
(this.implements(et2_IDOMNode) ? this.getDOMNode() : null));
|
||||
}
|
||||
this.setAttribute(key, val, false);
|
||||
@ -832,10 +832,10 @@ var et2_widget = Class.extend(
|
||||
/**
|
||||
* Does specific post-processing after the widget is loaded. Most widgets should not
|
||||
* need to do anything here, it should all be done before.
|
||||
*
|
||||
*
|
||||
* @return {boolean|Promise} True if the widget is fully loaded, false to avoid procesing children,
|
||||
* or a Promise if loading is not actually finished (eg. waiting for AJAX)
|
||||
*
|
||||
*
|
||||
* @see {@link http://api.jquery.com/deferred.promise/|jQuery Promise}
|
||||
*/
|
||||
doLoadingFinished: function() {
|
||||
@ -848,7 +848,7 @@ var et2_widget = Class.extend(
|
||||
* widget using the setApiInstance function.
|
||||
*/
|
||||
egw: function() {
|
||||
// The _egw property is not set
|
||||
// The _egw property is not set
|
||||
if (typeof this._egw === 'undefined')
|
||||
{
|
||||
if (this._parent != null)
|
||||
|
@ -23,12 +23,12 @@
|
||||
|
||||
/**
|
||||
* eTemplate history log widget displays a list of changes to the current record.
|
||||
* The widget is encapsulated, and only needs the record's ID, and a map of
|
||||
* The widget is encapsulated, and only needs the record's ID, and a map of
|
||||
* fields:widgets for display.
|
||||
*
|
||||
* It defers its initialization until the tab that it's on is selected, to avoid
|
||||
* wasting time if the user never looks at it.
|
||||
*
|
||||
*
|
||||
* @augments et2_valueWidget
|
||||
*/
|
||||
var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
@ -57,10 +57,10 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
],
|
||||
|
||||
TIMESTAMP: 0, OWNER: 1, FIELD: 2, NEW_VALUE: 3, OLD_VALUE: 4,
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @memberOf et2_historylog
|
||||
*/
|
||||
init: function() {
|
||||
@ -170,7 +170,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroys all
|
||||
* Destroys all
|
||||
*/
|
||||
destroy: function() {
|
||||
// Unbind, if bound
|
||||
@ -178,7 +178,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
{
|
||||
$j(window).off('.' +this.options.value.app + this.options.value.id);
|
||||
}
|
||||
|
||||
|
||||
// Free the widgets
|
||||
for(var i = 0; i < this.columns.length; i++)
|
||||
{
|
||||
@ -189,7 +189,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
this.fields[key].widget.destroy();
|
||||
}
|
||||
if(this.diff) this.diff.widget.destroy();
|
||||
|
||||
|
||||
// Free the grid components
|
||||
if(this.dataview) this.dataview.free();
|
||||
if(this.rowProvider) this.rowProvider.free();
|
||||
@ -260,7 +260,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
{
|
||||
if(nodes[i] == null) nodes.splice(i,1);
|
||||
}
|
||||
|
||||
|
||||
// Save to use for each row
|
||||
this.fields[cf_widget.prefix + key] = {
|
||||
attrs: cf_widget.widgets[key].options,
|
||||
@ -288,7 +288,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
var options = field.split(':');
|
||||
field = options.shift();
|
||||
}
|
||||
|
||||
|
||||
var widget = et2_createWidget(typeof field == 'string' ? field : 'select', attrs, this);
|
||||
|
||||
// Parse / set legacy options
|
||||
@ -363,7 +363,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
dataFetch: function (_queriedRange, _callback, _context) {
|
||||
// Skip getting data if there's no ID
|
||||
if(!this.value.id) return;
|
||||
|
||||
|
||||
// Pass the fetch call to the API
|
||||
this.egw().dataFetch(
|
||||
this.getInstanceManager().etemplate_exec_id,
|
||||
@ -458,7 +458,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
|
||||
_needsDiffWidget: function(columnName, value) {
|
||||
if(typeof value !== "string")
|
||||
{
|
||||
this.egw().debug("warning", "Crazy diff value", value);
|
||||
this.egw().debug("warn", "Crazy diff value", value);
|
||||
return false;
|
||||
}
|
||||
return columnName == 'note' || columnName == 'description' || (value && (value.length > 50 || value.match(/\n/g)));
|
||||
|
@ -563,7 +563,7 @@ var et2_selectbox = et2_inputWidget.extend(
|
||||
{
|
||||
if(jQuery("input[value='"+_value+"']", this.multiOptions).prop("checked", true).length == 0)
|
||||
{
|
||||
this.egw().debug("warning", "Tried to set value that isn't an option", this, _value);
|
||||
this.egw().debug("warn", "Tried to set value that isn't an option", this, _value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user