add some JSDoc so Eclipse shows an outline: @memberOf and @augments (not yet understood by Eclipse), also fixed many warnings (mostly missing semicolons)

This commit is contained in:
Ralf Becker 2013-04-13 19:00:13 +00:00
parent 0802a28242
commit e64c4fbd04
68 changed files with 1105 additions and 445 deletions

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS DOM Widget class
* EGroupware eTemplate2 - JS DOM Widget class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -22,9 +22,11 @@
* Abstract widget class which can be inserted into the DOM. All widget classes
* deriving from this class have to care about implementing the "getDOMNode"
* function which has to return the DOM-Node.
*
* @augments et2_widget
*/
var et2_DOMWidget = et2_widget.extend(et2_IDOMNode, {
var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
{
attributes: {
"disabled": {
"name": "Disabled",
@ -73,6 +75,8 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode, {
/**
* When the DOMWidget is initialized, it grabs the DOM-Node of the parent
* object (if available) and passes it to its own "createDOMNode" function
*
* @memberOf et2_DOMWidget
*/
init: function() {
// Call the inherited constructor
@ -452,9 +456,17 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode, {
/**
* The surroundings manager class allows to append or prepend elements around
* an widget node.
*
* @augments Class
*/
var et2_surroundingsMgr = Class.extend({
var et2_surroundingsMgr = Class.extend(
{
/**
* Constructor
*
* @memberOf et2_surroundingsMgr
* @param _widget
*/
init: function(_widget) {
this.widget = _widget;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS content array manager
* EGroupware eTemplate2 - JS content array manager
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -18,10 +18,20 @@
et2_core_phpExpressionCompiler;
*/
var et2_arrayMgr = Class.extend({
/**
* @augments Class
*/
var et2_arrayMgr = Class.extend(
{
splitIds: true,
/**
* Constructor
*
* @memberOf et2_arrayMgr
* @param _data
* @param _parentMgr
*/
init: function(_data, _parentMgr) {
if (typeof _parentMgr == "undefined")
{
@ -73,7 +83,7 @@ var et2_arrayMgr = Class.extend({
"owner": null,
"key": null,
"row": null
}
};
},
/**
@ -350,10 +360,20 @@ var et2_arrayMgr = Class.extend({
});
var et2_readonlysArrayMgr = et2_arrayMgr.extend({
/**
* @augments et2_arrayMgr
*/
var et2_readonlysArrayMgr = et2_arrayMgr.extend(
{
splitIds: false,
/**
* @memberOf et2_readonlysArrayMgr
* @param _id
* @param _attr
* @param _parent
* @returns
*/
isReadOnly: function(_id, _attr, _parent) {
var entry = null;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Widget base class
* EGroupware eTemplate2 - JS Widget base class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -22,9 +22,11 @@
* Class which manages the DOM node itself. The simpleWidget class is derrived
* from et2_DOMWidget and implements the getDOMNode function. A setDOMNode
* function is provided, which attatches the given node to the DOM if possible.
*
* @augments et2_DOMWidget
*/
var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned, {
var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned,
{
attributes: {
"statustext": {
"name": "Tooltip",
@ -44,7 +46,12 @@ var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned, {
"description": "JS code which is executed when the element is clicked."
}
},
/**
* Constructor
*
* @memberOf et2BaseWidget
*/
init: function() {
this.align = "left";
@ -81,7 +88,7 @@ var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned, {
// Preset the parameters
if (typeof _type == "undefined")
{
_type = "hint"
_type = "hint";
}
if (typeof _floating == "undefined")
@ -155,7 +162,7 @@ var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned, {
{
surr.update();
}
}
};
// Either fade out or directly call the function which removes the div
if (_fade)
@ -280,9 +287,16 @@ var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned, {
/**
* Simple container object
*
* @augments et2_baseWidget
*/
var et2_container = et2_baseWidget.extend({
var et2_container = et2_baseWidget.extend(
{
/**
* Constructor
*
* @memberOf et2_container
*/
init: function() {
this._super.apply(this, arguments);
@ -314,9 +328,16 @@ var et2_container = et2_baseWidget.extend({
/**
* Container object for not-yet supported widgets
*
* @augments et2_baseWidget
*/
var et2_placeholder = et2_baseWidget.extend([et2_IDetachedDOM],{
var et2_placeholder = et2_baseWidget.extend([et2_IDetachedDOM],
{
/**
* Constructor
*
* @memberOf et2_placeholder
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Widget base class
* EGroupware eTemplate2 - JS Widget base class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -231,7 +231,7 @@ function et2_validateAttrib(_id, _attrib)
// Default ignore to false.
if (typeof _attrib["ignore"] == "undefined")
{
_attrib["ignore"] = false
_attrib["ignore"] = false;
}
// Break if "ignore" is set to true.
@ -625,7 +625,7 @@ function et2_range(_top, _height)
return {
"top": _top,
"bottom": _top + _height
}
};
}
/**
@ -636,7 +636,7 @@ function et2_bounds(_top, _bottom)
return {
"top": _top,
"bottom": _bottom
}
};
}
/**

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS code for implementing inheritance
* EGroupware eTemplate2 - JS code for implementing inheritance
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Widget base class
* EGroupware eTemplate2 - JS Widget base class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -22,9 +22,11 @@
* et2_inputWidget derrives from et2_simpleWidget and implements the IInput
* interface. When derriving from this class, call setDOMNode with an input
* DOMNode.
*
* @augments et2_valueWidget
*/
var et2_inputWidget = et2_valueWidget.extend(et2_IInput, {
var et2_inputWidget = et2_valueWidget.extend(et2_IInput,
{
attributes: {
"required": {
"name": "Required",
@ -58,6 +60,11 @@ var et2_inputWidget = et2_valueWidget.extend(et2_IInput, {
}
},
/**
* Constructor
*
* @memberOf et2_inputWidget
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - File which contains all interfaces
* EGroupware eTemplate2 - File which contains all interfaces
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -10,7 +10,7 @@
* @version $Id$
*/
"use strict"
"use strict";
/*egw:uses
et2_core_inheritance;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Execution layer for legacy event code
* EGroupware eTemplate2 - Execution layer for legacy event code
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -127,7 +127,7 @@
var func = new Function('egw', 'widget', 'window', 'document', _code);
} catch(e) {
_widget.egw().debug('error', 'Error while compiling JS code ', _code);
return (function() {return false});
return (function() {return false;});
}
// Execute the code and return its results, pass the egw instance and
@ -142,8 +142,8 @@
// Return the result of the called function
return func.call(context, egw, _widget, egw.window,
egw.window.document);
}
}
};
};
}).call(window);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - A simple PHP expression parser written in JS
* EGroupware eTemplate2 - A simple PHP expression parser written in JS
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -415,7 +415,7 @@
// Create the function and return it
return (Function.apply(Function, attrs));
}
};
}).call(window);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS widget class with value attribute and auto loading
* EGroupware eTemplate2 - JS widget class with value attribute and auto loading
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -21,9 +21,11 @@
* et2_valueWidget is the base class for et2_inputWidget - valueWidget introduces
* the "value" attribute and automatically loads it from the "content" array
* after loading from XML.
*
* @augments et2_baseWidget
*/
var et2_valueWidget = et2_baseWidget.extend({
var et2_valueWidget = et2_baseWidget.extend(
{
attributes: {
"label": {
"name": "Label",
@ -40,6 +42,12 @@ var et2_valueWidget = et2_baseWidget.extend({
}
},
/**
*
*
* @memberOf et2_valueWidget
* @param _attrs
*/
transformAttributes: function(_attrs) {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Widget base class
* EGroupware eTemplate2 - JS Widget base class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -98,9 +98,11 @@ function et2_createWidget(_name, _attrs, _parent)
/**
* The et2 widget base class.
*
* @augments Class
*/
var et2_widget = Class.extend({
var et2_widget = Class.extend(
{
attributes: {
"id": {
"name": "ID",
@ -161,6 +163,7 @@ var et2_widget = Class.extend({
* object. The default constructor always adds the new instance to the
* children list of the given parent object. _parent may be NULL.
* @param _attrs is an associative array of attributes.
* @memberOf et2_widget
*/
init: function(_parent, _attrs) {
@ -640,7 +643,7 @@ var et2_widget = Class.extend({
}
if(entry && entry.type)
{
_nodeName = attributes["type"] = entry.type
_nodeName = attributes["type"] = entry.type;
}
entry = null;
}

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS XML Code
* EGroupware eTemplate2 - JS XML Code
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - dataview code
* EGroupware eTemplate2 - dataview code
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -10,7 +10,7 @@
* @version $Id$
*/
"use strict"
"use strict";
/*egw:uses
jquery.jquery;
@ -28,6 +28,8 @@
* header, etc.) and contains the root container: an instance of
* et2_dataview_view_grid, which can be accessed using the "grid" property of
* this object.
*
* @augments Class
*/
var et2_dataview = Class.extend({
@ -54,6 +56,7 @@ var et2_dataview = Class.extend({
/**
* Constructor for the grid container
* @param object _parentNode is the DOM-Node into which the grid view will be inserted
* @memberOf et2_dataview
*/
init: function(_parentNode, _egw) {
@ -362,7 +365,7 @@ var et2_dataview = Class.extend({
_buildHeader: function() {
var self = this;
var handler = function(event) {
}
};
for (var i = 0; i < this.columns.length; i++)
{
var col = this.columns[i];
@ -402,14 +405,14 @@ var et2_dataview = Class.extend({
_buildSelectCol: function() {
// Build the "select columns" icon
this.selectColIcon = $j(document.createElement("span"))
.addClass("selectcols")
.addClass("selectcols");
// Build the option column
this.selectCol = $j(document.createElement("th"))
.addClass("optcol")
.append(this.selectColIcon)
// Toggle display of option popup
.click(this, function(e) {if(e.data.selectColumnsClick) e.data.selectColumnsClick(e)})
.click(this, function(e) {if(e.data.selectColumnsClick) e.data.selectColumnsClick(e);})
.appendTo(this.headTr);
this.selectCol.css("width", this.scrollbarWidth - this.selectCol.outerWidth()

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2
* EGroupware eTemplate2
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2
* EGroupware eTemplate2
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -24,9 +24,22 @@
* manage an external action object interface for each visible row and proxy all
* state changes between an dummy action object, that does no selection handling,
* and the external action object interface.
*
* @augments Class
*/
var et2_dataview_selectionManager = Class.extend({
var et2_dataview_selectionManager = Class.extend(
{
/**
* Constructor
*
* @param _parent
* @param _indexMap
* @param _actionObjectManager
* @param _queryRangeCallback
* @param _makeVisibleCallback
* @param _context
* @memberOf et2_dataview_selectionManager
*/
init: function (_parent, _indexMap, _actionObjectManager,
_queryRangeCallback, _makeVisibleCallback, _context) {
@ -103,7 +116,7 @@ var et2_dataview_selectionManager = Class.extend({
if (!entry.tr && _links)
{
this._attachActionObjectInterface(entry, _tr, _uid);
this._attachActionObject(entry, _tr, _uid, _links, _idx)
this._attachActionObject(entry, _tr, _uid, _links, _idx);
}
// Update the entry
@ -215,7 +228,7 @@ var et2_dataview_selectionManager = Class.extend({
return {
"inverted": this._invertSelection,
"ids": ids
}
};
},
@ -263,7 +276,7 @@ var et2_dataview_selectionManager = Class.extend({
// controller
dummyAOI.doMakeVisible = function () {
self._makeVisibleCallback.call(self._context, _idx);
}
};
// Connect the the two AOIs
dummyAOI.doTriggerEvent = _entry.aoi.doTriggerEvent;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Contains interfaces used inside the dataview
* EGroupware eTemplate2 - Contains interfaces used inside the dataview
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -10,7 +10,7 @@
* @version $Id$
*/
"use strict"
"use strict";
/*egw:uses
et2_core_inheritance;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Class which contains a the columns model
* EGroupware eTemplate2 - Class which contains a the columns model
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -10,7 +10,7 @@
* @version $Id$
*/
"use strict"
"use strict";
/*egw:uses
et2_inheritance;
@ -26,6 +26,8 @@ var ET2_COL_VISIBILITY_ALWAYS_NOSELECT = 3;
/**
* Class which stores the data of a single column.
*
* @augments Class
*/
var et2_dataview_column = Class.extend({
@ -68,6 +70,12 @@ var et2_dataview_column = Class.extend({
}
},
/**
* Constructor
*
* @param _attrs
* @memberOf et2_dataview_column
*/
init: function(_attrs) {
this.fixedWidth = false;
this.relativeWidth = false;
@ -291,7 +299,7 @@ var et2_dataview_columns = Class.extend({
// Calculate how many space is - relatively - not occupied with columns with
// relative or fixed width
var remRelWidth = 1;
var noWidthCount = 0
var noWidthCount = 0;
for (var i = 0; i < this.columns.length; i++)
{

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Contains interfaces used inside the dataview
* EGroupware eTemplate2 - Contains interfaces used inside the dataview
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -42,13 +42,17 @@ function et2_dataview_rowAOI(_node)
// Rows without a checkbox OR an id set are unselectable
aoi.doGetDOMNode = function() {
return aoi.node;
}
};
// Prevent the browser from selecting the content of the element, when
// a special key is pressed.
$j(_node).mousedown(egwPreventSelect);
// Now append some action code to the node
/**
* Now append some action code to the node
*
* @memberOf et2_dataview_rowAOI
*/
var selectHandler = function(e) {
// Reset the focus so that keyboard navigation will work properly
// after the element has been clicked
@ -100,7 +104,7 @@ function et2_dataview_rowAOI(_node)
egwBitIsSet(_state, EGW_AO_STATE_FOCUSED));
$j(this.node).toggleClass('selected',
selected);
}
};
return aoi;
}

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - dataview code
* EGroupware eTemplate2 - dataview code
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -30,14 +30,17 @@
* A container does not know where it resides inside the grid, or whether it is
* currently visible or not -- this information is efficiently managed by the
* et2_dataview_grid container.
*
* @augments Class
*/
var et2_dataview_container = Class.extend(et2_dataview_IInvalidatable, {
var et2_dataview_container = Class.extend(et2_dataview_IInvalidatable,
{
/**
* Initializes the container object.
*
* @param _parent is an object which implements the IInvalidatable
* interface. _parent may not be null.
* @memberOf et2_dataview_container
*/
init: function(_parent) {
// Copy the given invalidation element
@ -253,7 +256,7 @@ var et2_dataview_container = Class.extend(et2_dataview_IInvalidatable, {
return {
"avgHeight": this.getHeight(),
"avgCount": 1
}
};
},
/**
@ -392,6 +395,6 @@ else
et2_dataview_container.prototype._nodeHeight = function(_node)
{
return _node.offsetHeight;
}
};
//}

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Class which contains the "grid" base class
* EGroupware eTemplate2 - Class which contains the "grid" base class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -42,9 +42,11 @@ var ET2_GRID_INVALIDATE_TIMEOUT = 25;
* range until they get removed.
*/
var ET2_GRID_HOLD_COUNT = 50;
var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, {
/**
* @augments et2_dataview_container
*/
var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange,
{
/**
* Creates the grid.
*
@ -52,6 +54,7 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, {
* is the outer grid which manages the scrollarea. If not null, all other
* parameters are ignored and copied from the given grid instance.
* @param _avgHeight is the starting average height of the column rows.
* @memberOf et2_dataview_grid
*/
init: function (_parent, _parentGrid, _egw, _rowProvider, _avgHeight) {
@ -433,7 +436,7 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, {
return {
"avgCount": this._avgCount,
"avgHeight": this._avgHeight
}
};
}
// Otherwise return the parent average height
@ -448,12 +451,9 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, {
return {
"avgCount": 1,
"avgHeight": this._orgAvgHeight
}
}
else
{
return null;
};
}
return null;
},
/**

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Functions which allow resizing of table headers
* EGroupware eTemplate2 - Functions which allow resizing of table headers
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -43,7 +43,7 @@
// Prevent text selection
_elem[0].onselectstart = function() {
return false;
}
};
// Reset the "didResize" flag
didResize = false;
@ -121,12 +121,12 @@
}
});
}
};
this.et2_dataview_resetResizeable = function(_elem)
{
// Remove all events in the ".resize" namespace from the element
_elem.unbind(".resize");
}
};
}).call(window);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - dataview
* EGroupware eTemplate2 - dataview
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -18,13 +18,17 @@
et2_dataview_view_container;
*/
var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange, {
/**
* @augments et2_dataview_container
*/
var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange,
{
/**
* Creates the row container. Use the "setRow" function to load the actual
* row content.
*
* @param _parent is the row parent container.
* @memberOf et2_dataview_row
*/
init: function(_parent) {
// Call the inherited constructor
@ -125,13 +129,13 @@ var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange, {
getAvgHeightData: function() {
// Only take the height of the own tr into account
var oldVisible = this.expansionVisible;
//var oldVisible = this.expansionVisible;
this.expansionVisible = false;
var res = {
"avgHeight": this.getHeight(),
"avgCount": 1
}
};
this.expansionVisible = true;
@ -179,7 +183,7 @@ var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange, {
&& this.expansionContainer.implements(et2_dataview_IViewRange))
{
// Substract the height of the own row from the container
var oh = $j(this._nodes[0]).height()
var oh = $j(this._nodes[0]).height();
_range.top -= oh;
// Proxy the setViewRange call to the expansion container

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Class which contains a factory method for rows
* EGroupware eTemplate2 - Class which contains a factory method for rows
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -21,9 +21,17 @@
/**
* The row provider contains prototypes (full clonable dom-trees)
* for all registered row types.
*
* @augments Class
*/
var et2_dataview_rowProvider = Class.extend({
var et2_dataview_rowProvider = Class.extend(
{
/**
*
* @param _outerId
* @param _columnIds
* @memberOf et2_dataview_rowProvider
*/
init: function(_outerId, _columnIds) {
// Copy the given parameters
this._outerId = _outerId;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Class which contains the spacer container
* EGroupware eTemplate2 - Class which contains the spacer container
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -17,8 +17,18 @@
et2_dataview_view_container;
*/
var et2_dataview_spacer = et2_dataview_container.extend({
/**
* @augments et2_dataview_container
*/
var et2_dataview_spacer = et2_dataview_container.extend(
{
/**
* Constructor
*
* @param _parent
* @param _rowProvider
* @memberOf et2_dataview_spacer
*/
init: function (_parent, _rowProvider) {
// Call the inherited container constructor
this._super(_parent);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Custom fields object
* EGroupware eTemplate2 - JS Custom fields object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -20,8 +20,11 @@
et2_core_inputWidget;
*/
var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput], {
/**
* @augments et2_dataview
*/
var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput],
{
attributes: {
'customfields': {
'name': 'Custom fields',
@ -52,6 +55,11 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
DEFAULT_ID: "custom_fields",
/**
* Constructor
*
* @memberOf et2_customfields_list
*/
init: function() {
// Some apps (infolog edit) don't give ID, so assign one to get settings
if(!arguments[1].id) arguments[1].id = this.DEFAULT_ID;

View File

@ -1,3 +1,20 @@
/**
* EGroupware eTemplate2 - JS Itempicker object
* derived from et2_link_entry widget @copyright 2011 Nathan Gray
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @subpackage api
* @link http://www.egroupware.org
* @author Christian Binder
* @author Nathan Gray
* @copyright 2012 Christian Binder
* @copyright 2011 Nathan Gray
* @version $Id: et2_widget_itempicker.js 38623 2012-03-26 23:27:53Z jaytraxx $
*/
"use strict";
function itempickerDocumentAction(context, data) {
var formid = "itempicker_action_form";
var form = "<form id='" + formid + "' action='index.php?menuaction=" + data.app + "." + data.app + "_merge.download_by_request' method='POST'>"
@ -7,4 +24,4 @@ function itempickerDocumentAction(context, data) {
+ "</form>";
$j("body").append(form);
$j("#" + formid).submit().remove();
}
}

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Nextmatch object
* EGroupware eTemplate2 - JS Nextmatch object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -66,9 +66,11 @@ var et2_INextmatchSortable = new Interface({
/**
* Class which implements the "nextmatch" XET-Tag
*
* @augments et2_DOMWidget
*/
var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput],
{
attributes: {
"template": {
"name": "Template",
@ -111,6 +113,11 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
columns: [],
/**
* Constructor
*
* @memberOf et2_nextmatch
*/
init: function() {
this._super.apply(this, arguments);
@ -124,7 +131,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
{
if(prefs.visible[i].indexOf(et2_nextmatch_customfields.prototype.prefix) == 0)
{
cfs[prefs.visible[i].substr(1)] = !prefs.negated
cfs[prefs.visible[i].substr(1)] = !prefs.negated;
}
}
var global_data = this.getArrayMgr("modifications").getRoot().getEntry('~custom_fields~');
@ -256,7 +263,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
this.activeFilters["sort"] = {
"id": _id,
"asc": _asc
}
};
// Set the sortmode display
this.iterateOver(function(_widget) {
@ -596,7 +603,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
* for next time
*/
_updateUserPreferences: function() {
var colMgr = this.dataview.getColumnMgr()
var colMgr = this.dataview.getColumnMgr();
if(!this.options.settings.columnselection_pref) {
this.options.settings.columnselection_pref = this.options.template;
}
@ -982,7 +989,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
cancelButton.set_label(this.egw().lang("cancel"));
cancelButton.onclick = function() {
self.selectPopup.toggle();
}
};
this.selectPopup = jQuery(document.createElement("div"))
.addClass("colselection ui-dialog ui-widget-content")
@ -998,7 +1005,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
var apps = this.egw().user('apps');
if(apps['admin'])
{
this.selectPopup.append(defaultCheck.getSurroundings().getDOMNode(defaultCheck.getDOMNode()))
this.selectPopup.append(defaultCheck.getSurroundings().getDOMNode(defaultCheck.getDOMNode()));
}
}
else
@ -1150,7 +1157,6 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], {
resetDirty: function() {},
isDirty: function() { return false;}
});
et2_register_widget(et2_nextmatch, ["nextmatch"]);
/**
@ -1158,8 +1164,10 @@ et2_register_widget(et2_nextmatch, ["nextmatch"]);
*
* Unable to use an existing template for this because parent (nm) doesn't, and template widget doesn't
* actually load templates from the server.
* @augments et2_DOMWidget
*/
var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
{
attributes: {
"filter_label": {
"name": "Filter label",
@ -1191,6 +1199,13 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
headers: [],
header_div: [],
/**
* Constructor
*
* @param nextmatch
* @param nm_div
* @memberOf et2_nextmatch_header_bar
*/
init: function(nextmatch, nm_div) {
this._super.apply(this, [nextmatch,nextmatch.options.settings]);
this.nextmatch = nextmatch;
@ -1309,7 +1324,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
this.search_button = et2_createWidget("button", {"label":">"}, this);
this.search_button.onclick = function(event) {
self.nextmatch.activeFilters.search = self.search.getValue()
self.nextmatch.activeFilters.search = self.search.getValue();
self.nextmatch.applyFilters();
};
@ -1388,7 +1403,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
// Filter now
self.nextmatch.applyFilters();
}
}
};
// Set activeFilters to current value
self.nextmatch.activeFilters[_widget.id] = _widget.getValue();
@ -1473,7 +1488,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
});
// Get the onchange function string
var onchange = this.nextmatch.options.settings[name+"_onchange"]
var onchange = this.nextmatch.options.settings[name+"_onchange"];
// Real submits cause all sorts of problems
if(onchange.match(/this\.form\.submit/))
@ -1551,7 +1566,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, {
$j(filters.searchletter ? "td#"+filters.searchletter : "td.lettersearch[id='']").addClass("lettersearch_active");
// Set activeFilters to current value
filters.searchletter = $j("td.lettersearch_active").attr("id")
filters.searchletter = $j("td.lettersearch_active").attr("id");
}
},
@ -1580,9 +1595,11 @@ et2_register_widget(et2_nextmatch_header_bar, ["nextmatch_header_bar"]);
/**
* Classes for the nextmatch sortheaders etc.
*
* @augments et2_baseWidget
*/
var et2_nextmatch_header = et2_baseWidget.extend(et2_INextmatchHeader, {
var et2_nextmatch_header = et2_baseWidget.extend(et2_INextmatchHeader,
{
attributes: {
"label": {
"name": "Caption",
@ -1597,6 +1614,11 @@ var et2_nextmatch_header = et2_baseWidget.extend(et2_INextmatchHeader, {
}
},
/**
* Constructor
*
* @memberOf et2_nextmatch_header
*/
init: function() {
this._super.apply(this, arguments);
@ -1629,8 +1651,11 @@ et2_register_widget(et2_nextmatch_header, ['nextmatch-header']);
/**
* Extend header to process customfields
*
* @augments et2_customfields_list
*/
var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHeader, {
var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHeader,
{
attributes: {
'customfields': {
'name': 'Custom fields',
@ -1642,6 +1667,11 @@ var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHead
}
},
/**
* Constructor
*
* @memberOf et2_nextmatch_customfields
*/
init: function() {
this.nextmatch = null;
this._super.apply(this, arguments);
@ -1827,8 +1857,16 @@ var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHead
});
et2_register_widget(et2_nextmatch_customfields, ['nextmatch-customfields']);
var et2_nextmatch_sortheader = et2_nextmatch_header.extend(et2_INextmatchSortable, {
/**
* @augments et2_nextmatch_header
*/
var et2_nextmatch_sortheader = et2_nextmatch_header.extend(et2_INextmatchSortable,
{
/**
* Constructor
*
* @memberOf et2_nextmatch_sortheader
*/
init: function() {
this._super.apply(this, arguments);
@ -1859,14 +1897,17 @@ var et2_nextmatch_sortheader = et2_nextmatch_header.extend(et2_INextmatchSortabl
}
});
et2_register_widget(et2_nextmatch_sortheader, ['nextmatch-sortheader']);
var et2_nextmatch_filterheader = et2_selectbox.extend([et2_INextmatchHeader, et2_IResizeable], {
/**
* @augments et2_selectbox
*/
var et2_nextmatch_filterheader = et2_selectbox.extend([et2_INextmatchHeader, et2_IResizeable],
{
/**
* Override to add change handler
*
* @memberOf et2_nextmatch_filterheader
*/
createInputWidget: function() {
// Make sure there's an option for all
@ -1886,7 +1927,7 @@ var et2_nextmatch_filterheader = et2_selectbox.extend([et2_INextmatchHeader, et2
event.data.nextmatch.activeFilters.col_filter = {};
if(event.data.input.val())
{
event.data.nextmatch.activeFilters["col_filter"][event.data.id] = event.data.input.val()
event.data.nextmatch.activeFilters["col_filter"][event.data.id] = event.data.input.val();
}
else
{
@ -1923,13 +1964,17 @@ var et2_nextmatch_filterheader = et2_selectbox.extend([et2_INextmatchHeader, et2
}
});
et2_register_widget(et2_nextmatch_filterheader, ['nextmatch-filterheader']);
var et2_nextmatch_accountfilterheader = et2_selectAccount.extend([et2_INextmatchHeader, et2_IResizeable], {
/**
* @augments et2_selectAccount
*/
var et2_nextmatch_accountfilterheader = et2_selectAccount.extend([et2_INextmatchHeader, et2_IResizeable],
{
/**
* Override to add change handler
*
* @memberOf et2_nextmatch_accountfilterheader
*/
createInputWidget: function() {
// Make sure there's an option for all
@ -1997,10 +2042,15 @@ var et2_nextmatch_accountfilterheader = et2_selectAccount.extend([et2_INextmatch
});
et2_register_widget(et2_nextmatch_accountfilterheader, ['nextmatch-accountfilter']);
var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader, {
/**
* @augments et2_link_entry
*/
var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader,
{
/**
* Override to add change handler
*
* @memberOf et2_link_entry
*/
select: function(event, selected) {
this._super.apply(this, arguments);
@ -2035,7 +2085,7 @@ var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader, {
if(!value.app || !value.id) return null;
value = value.app +":"+value.id;
}
return value
return value;
},
/**
@ -2061,8 +2111,11 @@ var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader, {
});
et2_register_widget(et2_nextmatch_entryheader, ['nextmatch-entryheader']);
var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend({
/**
* @augments et2_nextmatch_filterheader
*/
var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend(
{
attributes: {
"widget_type": {
"name": "Actual type",
@ -2080,6 +2133,13 @@ var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend({
real_node: null,
/**
* Constructor
*
* @param _parent
* @param _attrs
* @memberOf et2_nextmatch_customfilter
*/
init: function(_parent, _attrs) {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Nextmatch object
* EGroupware eTemplate2 - JS Nextmatch object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -30,14 +30,14 @@ function nm_action(_action, _senders, _target, _ids)
// Get IDs from nextmatch - nextmatch is in the top of the action tree
// @see et2_extension_nextmatch_controller._initActions()
var nm = null;
var action = _action
var action = _action;
while(nm == null && action != null)
{
if(action.data != null && action.data.nextmatch)
{
nm = action.data.nextmatch;
}
action = action.parent
action = action.parent;
}
if(nm)
{

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Class which contains a the data model for nextmatch widgets
* EGroupware eTemplate2 - Class which contains a the data model for nextmatch widgets
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -25,9 +25,11 @@
egw_data;
*/
var et2_nextmatch_controller = et2_dataview_controller.extend(
et2_IDataProvider, {
/**
* @augments et2_dataview_controller
*/
var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
{
/**
* Initializes the nextmatch controller.
*
@ -42,6 +44,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(
* @param _actionLinks contains the action links
* @param _actions contains the actions, may be null if an object manager
* is given.
* @memberOf et2_nextmatch_controller
*/
init: function (_parentController, _egw, _execId, _widget, _parentId,
_grid, _rowProvider, _actionLinks, _objectManager, _actions) {
@ -55,7 +58,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(
// Initialize the action and the object manager
if (!_objectManager)
{
this._initActions(_actions)
this._initActions(_actions);
}
else
{
@ -71,7 +74,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(
this._linkCallback, this, this._objectManager);
// Copy the given parameters
this._actionLinks = _actionLinks
this._actionLinks = _actionLinks;
this._execId = _execId;
this._widgetId = _widget.id;
this._parentId = _parentId;
@ -253,7 +256,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(
else
{
var mgr = nm.getArrayMgr('content');
mgr.data[i] = _response.rows[i]
mgr.data[i] = _response.rows[i];
}
}

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Dynheight object
* EGroupware eTemplate2 - JS Dynheight object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -10,7 +10,7 @@
* @version $Id$
*/
"use strict"
"use strict";
/*egw:use
jquery.jquery;
@ -21,9 +21,11 @@
* Object which resizes an inner node to the maximum extend of an outer node
* (without creating a scrollbar) - it achieves that by performing some very
* nasty and time consuming calculations.
*
* @augments Class
*/
var et2_dynheight = Class.extend({
var et2_dynheight = Class.extend(
{
/**
* Constructor for the dynheight object
*
@ -33,6 +35,7 @@ var et2_dynheight = Class.extend({
* @param _innerNode is the node which should be scaled. Call update to
* scale the node.
* @param _minHeight is the minimum height the inner node should have
* @memberOf et2_dynheight
*/
init: function(_outerNode, _innerNode, _minHeight) {
this.outerNode = $j(_outerNode);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Class which contains a factory method for rows
* EGroupware eTemplate2 - Class which contains a factory method for rows
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -21,11 +21,15 @@
/**
* The row provider contains prototypes (full clonable dom-trees)
* for all registered row types.
*
* @augments Class
*/
var et2_nextmatch_rowProvider = Class.extend({
var et2_nextmatch_rowProvider = Class.extend(
{
/**
* Creates the nextmatch row provider.
*
* @memberOf et2_nextmatch_rowProvider
*/
init: function (_rowProvider, _subgridCallback, _context) {
// Copy the arguments
@ -165,7 +169,7 @@ var et2_nextmatch_rowProvider = Class.extend({
tr.appendChild(row);
// Make the row expandable
if (typeof _data.content["is_parent"] !== "undefined"
if (typeof _data.content["is_parent"] !== "undefined"
&& _data.content["is_parent"])
{
_row.makeExpandable(true, function () {
@ -194,7 +198,7 @@ var et2_nextmatch_rowProvider = Class.extend({
var placeholder = $j(document.createElement("td"))
.attr("colspan",this._rowProvider.getColumnCount())
.css("height","19px")
.text(typeof label != "undefined" && label ? label : egw().lang("No matches found"))
.text(typeof label != "undefined" && label ? label : egw().lang("No matches found"));
this._rowProvider._prototypes["empty"] = $j(document.createElement("tr"))
.addClass("egwGridView_empty")
.append(placeholder);
@ -510,8 +514,18 @@ var et2_nextmatch_rowProvider = Class.extend({
});
var et2_nextmatch_rowWidget = et2_widget.extend(et2_IDOMNode, {
/**
* @augments et2_widget
*/
var et2_nextmatch_rowWidget = et2_widget.extend(et2_IDOMNode,
{
/**
* Constructor
*
* @param _mgrs
* @param _row
* @memberOf et2_nextmatch_rowWidget
*/
init: function(_mgrs, _row) {
// Call the parent constructor with some dummy attributes
this._super(null, {"id": "", "type": "rowWidget"});
@ -560,8 +574,18 @@ var et2_nextmatch_rowWidget = et2_widget.extend(et2_IDOMNode, {
});
var et2_nextmatch_rowTemplateWidget = et2_widget.extend(et2_IDOMNode, {
/**
* @augments et2_widget
*/
var et2_nextmatch_rowTemplateWidget = et2_widget.extend(et2_IDOMNode,
{
/**
* Constructor
*
* @param _root
* @param _row
* @memberOf et2_nextmatch_rowTemplateWidget
*/
init: function(_root, _row) {
// Call the parent constructor with some dummy attributes
this._super(null, {"id": "", "type": "rowTemplateWidget"});
@ -613,4 +637,3 @@ var et2_nextmatch_rowTemplateWidget = et2_widget.extend(et2_IDOMNode, {
});

View File

@ -1,5 +1,6 @@
/**
* eGroupWare eTemplate2 - JS Ajax select / auto complete object
* EGroupware eTemplate2 - JS Ajax select / auto complete object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -26,9 +27,10 @@
* n is the maximum number of results set in the user's preferences.
* The user is restricted to selecting values in the list.
* This widget can get data from any function that can provide data to a nextmatch widget.
* @augments et2_inputWidget
*/
var et2_ajaxSelect = et2_inputWidget.extend({
var et2_ajaxSelect = et2_inputWidget.extend(
{
attributes: {
'get_rows': {
"name": "Data source",
@ -79,8 +81,8 @@ var et2_ajaxSelect = et2_inputWidget.extend({
"description": "Prevent all from looking the same. Use an icon."
},
// Pass by code only
'values': {
// Pass by code only
'values': {
"name": "Values",
"type": "any",
"default": {},
@ -88,6 +90,11 @@ var et2_ajaxSelect = et2_inputWidget.extend({
}
},
/**
* Constructor
*
* @memberOf et2_ajaxSelect
*/
init: function() {
this._super.apply(this, arguments);
@ -127,14 +134,14 @@ var et2_ajaxSelect = et2_inputWidget.extend({
}
}
});
et2_register_widget(et2_ajaxSelect, ["ajax_select"]);
/**
* et2_textbox_ro is the dummy readonly implementation of the textbox.
* @augments et2_valueWidget
*/
var et2_ajaxSelect_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_ajaxSelect_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Ignore all more advanced attributes.
*/
@ -144,6 +151,11 @@ var et2_ajaxSelect_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
}
},
/**
* Constructor
*
* @memberOf et2_ajaxSelect_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -181,6 +193,5 @@ var et2_ajaxSelect_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
}
}
});
et2_register_widget(et2_ajaxSelect_ro, ["ajax_select_ro"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Box object
* EGroupware eTemplate2 - JS Box object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -19,9 +19,10 @@
/**
* Class which implements the hbox and vbox tag
* @augments et2_baseWidget
*/
var et2_box = et2_baseWidget.extend([et2_IDetachedDOM], {
var et2_box = et2_baseWidget.extend([et2_IDetachedDOM],
{
attributes: {
// Not needed
"rows": {"ignore": true},
@ -30,6 +31,11 @@ var et2_box = et2_baseWidget.extend([et2_IDetachedDOM], {
createNamespace: true,
/**
* Constructor
*
* @memberOf et2_box
*/
init: function() {
this._super.apply(this, arguments);
@ -59,6 +65,5 @@ var et2_box = et2_baseWidget.extend([et2_IDetachedDOM], {
}
});
et2_register_widget(et2_box, ["vbox", "box"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Button object
* EGroupware eTemplate2 - JS Button object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -20,9 +20,10 @@
/**
* Class which implements the "button" XET-Tag
* @augments et2_baseWidget
*/
var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM],
{
attributes: {
"label": {
"name": "caption",
@ -65,6 +66,11 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
legacyOptions: ["image", "ro_image"],
/**
* Constructor
*
* @memberOf et2_button
*/
init: function() {
this._super.apply(this, arguments);
@ -293,7 +299,7 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
{
this.options.onclick = _values["onclick"];
}
var type = this._type
var type = this._type;
var attrs = jQuery.extend(_values, this.options);
var parent = this._parent;
jQuery(this.getDOMNode()).bind("click.et2_baseWidget", this, function(e) {
@ -302,9 +308,7 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM], {
e.data.set_id(_values["id"]);
return e.data.click.call(e.data,e);
});
}
});
et2_register_widget(et2_button, ["button", "buttononly"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Checkbox object
* EGroupware eTemplate2 - JS Checkbox object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -20,9 +20,11 @@
/**
* Class which implements the "checkbox" XET-Tag
*
* @augments et2_inputWidget
*/
var et2_checkbox = et2_inputWidget.extend({
var et2_checkbox = et2_inputWidget.extend(
{
attributes: {
"selected_value": {
"name": "Set value",
@ -56,6 +58,11 @@ var et2_checkbox = et2_inputWidget.extend({
legacyOptions: ["selected_value", "unselected_value", "ro_true", "ro_false"],
/**
* Constructor
*
* @memberOf et2_checkbox
*/
init: function() {
this._super.apply(this, arguments);
@ -99,14 +106,14 @@ var et2_checkbox = et2_inputWidget.extend({
}
}
});
et2_register_widget(et2_checkbox, ["checkbox"]);
/**
* et2_checkbox_ro is the dummy readonly implementation of the checkbox
* @augments et2_checkbox
*/
var et2_checkbox_ro = et2_checkbox.extend({
var et2_checkbox_ro = et2_checkbox.extend(
{
/**
* Ignore unset value
*/
@ -116,6 +123,11 @@ var et2_checkbox_ro = et2_checkbox.extend({
}
},
/**
* Constructor
*
* @memberOf et2_checkbox_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -134,7 +146,5 @@ var et2_checkbox_ro = et2_checkbox.extend({
this.span.text(this.options.ro_false);
}
}
});
et2_register_widget(et2_checkbox_ro, ["checkbox_ro"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Color picker object
* EGroupware eTemplate2 - JS Color picker object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -21,9 +21,11 @@
/**
* Class which implements the "colorpicker" XET-Tag
*
* @augments et2_inputWidget
*/
var et2_color = et2_inputWidget.extend({
var et2_color = et2_inputWidget.extend(
{
attributes: {
"alphaSupport": {
"name": "Transparancy",
@ -48,6 +50,11 @@ var et2_color = et2_inputWidget.extend({
}
},
/**
* Constructor
*
* @memberOf et2_color
*/
init: function() {
this._super.apply(this, arguments);
@ -116,7 +123,7 @@ var et2_color = et2_inputWidget.extend({
function(color) {
jQuery("table.jPicker").dialog("close");
}
)
);
jQuery.jPicker.List[list_id].id = this.id + "_jPicker";
// Make it look better - plugin defers initialization, so we have to also
@ -183,14 +190,19 @@ var et2_color = et2_inputWidget.extend({
}
}
});
et2_register_widget(et2_color, ["colorpicker"]);
/**
* et2_textbox_ro is the dummy readonly implementation of the textbox.
* @augments et2_valueWidget
*/
var et2_color_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_color_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Constructor
*
* @memberOf et2_color_ro
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Date object
* EGroupware eTemplate2 - JS Date object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -22,9 +22,11 @@
/**
* Class which implements the "date" XET-Tag
*
* @augments et2_inputWidget
*/
var et2_date = et2_inputWidget.extend({
var et2_date = et2_inputWidget.extend(
{
attributes: {
"value": {
"type": "any"
@ -40,6 +42,11 @@ var et2_date = et2_inputWidget.extend({
legacyOptions: ["data_format"],
/**
* Constructor
*
* @memberOf et2_date
*/
init: function() {
this._super.apply(this, arguments);
@ -47,7 +54,6 @@ var et2_date = et2_inputWidget.extend({
this.date.setHours(0);
this.date.setMinutes(0);
this.date.setSeconds(0);
this.date
this.input = null;
this.createInputWidget();
@ -203,10 +209,13 @@ var et2_date = et2_inputWidget.extend({
}
}
});
et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]);
var et2_date_duration = et2_date.extend({
/**
* @augments et2_date
*/
var et2_date_duration = et2_date.extend(
{
attributes: {
"data_format": {
"name": "Data format",
@ -250,6 +259,11 @@ var et2_date_duration = et2_date.extend({
time_formats: {"d":"d","h":"h","m":"m"},
/**
* Constructor
*
* @memberOf et2_date_duration
*/
init: function() {
this._super.apply(this, arguments);
@ -448,8 +462,14 @@ var et2_date_duration = et2_date.extend({
});
et2_register_widget(et2_date_duration, ["date-duration"]);
var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],{
/**
* @augments et2_date_duration
*/
var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
{
/**
* @memberOf et2_date_duration_ro
*/
createInputWidget: function() {
this.node = $j(document.createElement("span"));
@ -515,9 +535,10 @@ et2_register_widget(et2_date_duration_ro, ["date-duration_ro"]);
/**
* et2_date_ro is the readonly implementation of some date widget.
* @augments et2_valueWidget
*/
var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Ignore all more advanced attributes.
*/
@ -541,6 +562,11 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
*/
date: new Date(),
/**
* Constructor
*
* @memberOf et2_date_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -630,7 +656,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
break;
}
}
break
break;
}
this.span.attr("datetime", date("Y-m-d H:i:s",this.date)).text(display);
},
@ -671,20 +697,25 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
this.span.addClass(_values["class"]);
}
}
});
et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date-time_today"]);
var et2_date_timeonly_ro = et2_date_ro.extend({
/**
* @augments et2_date_ro
*/
var et2_date_timeonly_ro = et2_date_ro.extend(
{
attributes: {
"value": {
"type": "string"
}
},
/**
* Construtor
*
* @param _value
* @memberOf et2_date_timeonly_ro
*/
set_value: function(_value) {
if(this.egw().preference("timeformat") == "12" && _value.indexOf(":") > 0) {
var parts = _value.split(":");

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Description object
* EGroupware eTemplate2 - JS Description object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -19,9 +19,11 @@
/**
* Class which implements the "description" XET-Tag
*
* @augments et2_baseWidget
*/
var et2_description = et2_baseWidget.extend([et2_IDetachedDOM], {
var et2_description = et2_baseWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
"name": "Value",
@ -79,6 +81,11 @@ var et2_description = et2_baseWidget.extend([et2_IDetachedDOM], {
legacyOptions: ["font_style", "href", "activate_links", "for",
"extra_link_target", "extra_link_popup", "extra_link_title"],
/**
* Constructor
*
* @memberOf et2_description
*/
init: function() {
this._super.apply(this, arguments);
@ -204,7 +211,5 @@ var et2_description = et2_baseWidget.extend([et2_IDetachedDOM], {
}
}
});
et2_register_widget(et2_description, ["description", "label"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Diff object
* EGroupware eTemplate2 - JS Diff object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -22,14 +22,22 @@
/**
* Class that displays the diff between two [text] values
*
* @augments et2_valueWidget
*/
var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
"type": "any"
}
},
/**
* Constructor
*
* @memberOf et2_diff
*/
init: function() {
this._super.apply(this, arguments);
this.mini = true;

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Dropdown Button object
* EGroupware eTemplate2 - JS Dropdown Button object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -29,9 +29,11 @@
*
* Menu options are passed via the select_options. They are normally ID => Title pairs,
* as for a select box, but the title can also be full HTML if needed.
*
* @augments et2_inputWidget
*/
var et2_dropdown_button = et2_inputWidget.extend({
var et2_dropdown_button = et2_inputWidget.extend(
{
attributes: {
"label": {
"name": "caption",
@ -111,6 +113,11 @@ var et2_dropdown_button = et2_inputWidget.extend({
<li id="opt_1.5"><a href="javascript:void(0);">Option-1.5</a></li>\
</ul>',
/**
* Constructor
*
* @memberOf et2_dropdown_button
*/
init: function() {
this._super.apply(this, arguments);
@ -179,7 +186,7 @@ var et2_dropdown_button = et2_inputWidget.extend({
);
// Icon
this.image = jQuery(document.createElement("img"))
this.image = jQuery(document.createElement("img"));
this.setDOMNode(this.div[0]);
},
@ -361,6 +368,5 @@ var et2_dropdown_button = et2_inputWidget.extend({
return this.value;
}
});
et2_register_widget(et2_dropdown_button, ["dropdown_button"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Favorite widget
* EGroupware eTemplate2 - JS Favorite widget
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -41,9 +41,11 @@
* Favorites are implemented by saving the values for [column] filters. Filters are stored
* in preferences, with the name favorite_<name>. The favorite favorite used for clicking on
* the filter button is stored in nextmatch-<columnselection_pref>-favorite.
*
* @augments et2_dropdown_button
*/
var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],{
var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
{
attributes: {
"default_pref": {
"name": "Default preference key",
@ -70,7 +72,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],{
// These are particular to favorites
id: {"default": "favorite"},
label: {"default": ""},
label_updates: { default: false},
label_updates: { "default": false},
image: {"default": "etemplate/fav_filter"},
tooltip: {"default": "Favorite queries", "type": "string"}
},
@ -83,6 +85,11 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],{
// If filter was set server side, we need to remember it until nm is created
nm_filter: false,
/**
* Constructor
*
* @memberOf et2_favorites
*/
init: function() {
this._super.apply(this, arguments);
this.sidebox_target = $j("#"+this.options.sidebox_target);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Number object
* EGroupware eTemplate2 - JS Number object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -19,9 +19,11 @@
/**
* Class which implements file upload
*
* @augments et2_inputWidget
*/
var et2_file = et2_inputWidget.extend({
var et2_file = et2_inputWidget.extend(
{
attributes: {
"multiple": {
"name": "Multiple files",
@ -42,10 +44,10 @@ var et2_file = et2_inputWidget.extend({
"description": "Mime type (eg: image/png) or regex (eg: /^text\//i) for allowed file types"
},
"blur": {
"name": "Placeholder",
"type": "string",
"default": "",
"description": "This text get displayed if an input-field is empty and does not have the input-focus (blur). It can be used to show a default value or a kind of help-text."
"name": "Placeholder",
"type": "string",
"default": "",
"description": "This text get displayed if an input-field is empty and does not have the input-focus (blur). It can be used to show a default value or a kind of help-text."
},
"progress": {
"name": "Progress node",
@ -69,8 +71,13 @@ var et2_file = et2_inputWidget.extend({
asyncOptions: {},
/**
* Constructor
*
* @memberOf et2_file
*/
init: function() {
this._super.apply(this, arguments)
this._super.apply(this, arguments);
this.node = null;
this.input = null;
@ -197,7 +204,7 @@ var et2_file = et2_inputWidget.extend({
else
{
// Convert into a js regex
var parts = mime.substr(1).match(/(.*)\/([igm]?)$/)
var parts = mime.substr(1).match(/(.*)\/([igm]?)$/);
this.options.mime = new RegExp(parts[1],parts.length > 2 ? parts[2] : "");
}
},

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Grid object
* EGroupware eTemplate2 - JS Grid object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -23,9 +23,11 @@
*
* This also includes repeating the last row in the grid and filling
* it with content data
*
* @augments et2_DOMWidget
*/
var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], {
var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned],
{
createNamespace: true,
attributes: {
@ -46,6 +48,12 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], {
"ignore": true
}
},
/**
* Constructor
*
* @memberOf et2_grid
*/
init: function() {
// Create the table body and the table
this.tbody = $j(document.createElement("tbody"));
@ -351,7 +359,7 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], {
"defined for cell (" + x + "," + y + ")!");
}
}
}
};
// If the node is a row, create the widgets which belong into
// the row
@ -631,32 +639,27 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned], {
},
set_align: function(_value) {
this.align = _value;
},
this.align = _value;
},
get_align: function(_value) {
return this.align;
},
get_align: function(_value) {
return this.align;
},
/**
* Code for implementing et2_IDetachedDOM
* Code for implementing et2_IDetachedDOM
* This doesn't need to be implemented.
* Individual widgets are detected and handled by the grid, but the interface is needed for this to happen
*/
getDetachedAttributes: function(_attrs)
{
},
*/
getDetachedAttributes: function(_attrs) {
},
getDetachedNodes: function()
{
return [this.getDOMNode()];
},
getDetachedNodes: function() {
return [this.getDOMNode()];
},
setDetachedAttributes: function(_nodes, _values)
{
}
setDetachedAttributes: function(_nodes, _values) {
}
});
et2_register_widget(et2_grid, ["grid"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Groupbox object
* EGroupware eTemplate2 - JS Groupbox object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -17,29 +17,44 @@
*/
/**
* Class which implements the hrule tag
* Class which implements the groupbox tag
*
* @augments et2_baseWidget
*/
var et2_groupbox = et2_baseWidget.extend({
var et2_groupbox = et2_baseWidget.extend(
{
/**
* Constructor
*
* @memberOf et2_groupbox
*/
init: function() {
this._super.apply(this, arguments);
this.setDOMNode(document.createElement("fieldset"));
}
});
et2_register_widget(et2_groupbox, ["groupbox"]);
var et2_groupbox_legend = et2_baseWidget.extend({
/**
* @augments et2_baseWidget
*/
var et2_groupbox_legend = et2_baseWidget.extend(
{
attributes: {
"label": {
"name": "Label",
"type": "string",
"default": "",
"description": "Label for group box"
}
"name": "Label",
"type": "string",
"default": "",
"description": "Label for group box"
}
},
/**
* Constructor
*
* @memberOf et2_groupbox_legend
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Box object
* EGroupware eTemplate2 - JS Box object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -19,11 +19,18 @@
/**
* Class which implements the hbox and vbox tag
*
* @augments et2_baseWidget
*/
var et2_hbox = et2_baseWidget.extend({
var et2_hbox = et2_baseWidget.extend(
{
createNamespace: true,
/**
* Constructor
*
* @memberOf et2_hbox
*/
init: function() {
this._super.apply(this, arguments);
@ -174,6 +181,5 @@ var et2_hbox = et2_baseWidget.extend({
}
}
});
et2_register_widget(et2_hbox, ["hbox"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS History log
* EGroupware eTemplate2 - JS History log
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -28,9 +28,11 @@
*
* 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],{
var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],
{
attributes: {
"value": {
"type": "any"
@ -52,6 +54,11 @@ 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() {
this._super.apply(this, arguments);
this.div = $j(document.createElement("div"))
@ -431,7 +438,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider],{
this.egw().debug("warning", "Crazy diff value", value);
return false;
}
return columnName == 'note' || columnName == 'description' || (value && (value.length > 50 || value.match(/\n/g)))
return columnName == 'note' || columnName == 'description' || (value && (value.length > 50 || value.match(/\n/g)));
},
});
et2_register_widget(et2_historylog, ['historylog']);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS HRule object
* EGroupware eTemplate2 - JS HRule object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -18,16 +18,21 @@
/**
* Class which implements the hrule tag
*
* @augments et2_baseWidget
*/
var et2_hrule = et2_baseWidget.extend({
var et2_hrule = et2_baseWidget.extend(
{
/**
* Constructor
*
* @memberOf et2_hrule
*/
init: function() {
this._super.apply(this, arguments);
this.setDOMNode(document.createElement("hr"));
}
});
et2_register_widget(et2_hrule, ["hrule"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS widget class containing raw HTML
* EGroupware eTemplate2 - JS widget class containing raw HTML
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -18,11 +18,14 @@
et2_core_baseWidget;
*/
var et2_html = et2_valueWidget.extend([et2_IDetachedDOM], {
/**
* @augments et2_valueWidget
*/
var et2_html = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
'label': {
default: "",
'default': "",
description: "The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",
ignore: false,
name: "Label",
@ -33,6 +36,12 @@ var et2_html = et2_valueWidget.extend([et2_IDetachedDOM], {
"ignore": true
}
},
/**
* Constructor
*
* @memberOf et2_html
*/
init: function() {
this._super.apply(this, arguments);
@ -92,7 +101,5 @@ var et2_html = et2_valueWidget.extend([et2_IDetachedDOM], {
}
});
et2_register_widget(et2_html, ["html","htmlarea_ro"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS widget for HTML editing
* EGroupware eTemplate2 - JS widget for HTML editing
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -21,8 +21,11 @@
et2_core_baseWidget;
*/
var et2_htmlarea = et2_inputWidget.extend({
/**
* @augments et2_inputWidget
*/
var et2_htmlarea = et2_inputWidget.extend(
{
attributes: {
'mode': {
'name': 'Mode',
@ -60,6 +63,13 @@ var et2_htmlarea = et2_inputWidget.extend({
legacyOptions: ['mode','height','width','expand_toolbar','base_href'],
/**
* Constructor
*
* @param _parent
* @param _attrs
* @memberOf et2_htmlarea
*/
init: function(_parent, _attrs) {
// _super.apply is responsible for the actual setting of the params (some magic)
this._super.apply(this, arguments);
@ -138,7 +148,5 @@ var et2_htmlarea = et2_inputWidget.extend({
}
}
});
et2_register_widget(et2_htmlarea, ["htmlarea"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS widget class for an iframe
* EGroupware eTemplate2 - JS widget class for an iframe
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -16,11 +16,14 @@
et2_core_valueWidget;
*/
var et2_iframe = et2_valueWidget.extend({
/**
* @augments et2_valueWidget
*/
var et2_iframe = et2_valueWidget.extend(
{
attributes: {
'label': {
default: "",
'default': "",
description: "The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",
ignore: false,
name: "Label",
@ -32,13 +35,18 @@ var et2_iframe = et2_valueWidget.extend({
},
"seamless": {
name: "Seamless",
default: true,
'default': true,
description: "Specifies that the iframe should be rendered in a manner that makes it appear to be part of the containing document",
translate: false,
type: "boolean"
},
},
/**
* Constructor
*
* @memberOf et2_iframe
*/
init: function() {
this._super.apply(this, arguments);
@ -59,7 +67,7 @@ var et2_iframe = et2_valueWidget.extend({
* @param _seamless boolean
*/
set_seamless: function(_seamless) {
this.options.seamless = _seamless
this.options.seamless = _seamless;
this.htmlNode.attr("seamless", _seamless);
},

View File

@ -20,9 +20,11 @@
/**
* Class which implements the "image" XET-Tag
*
* @augments et2_baseWidget
*/
var et2_image = et2_baseWidget.extend([et2_IDetachedDOM], {
var et2_image = et2_baseWidget.extend([et2_IDetachedDOM],
{
attributes: {
"src": {
"name": "Image",
@ -58,6 +60,11 @@ var et2_image = et2_baseWidget.extend([et2_IDetachedDOM], {
},
legacyOptions: ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"],
/**
* Constructor
*
* @memberOf et2_image
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Itempicker object
* EGroupware eTemplate2 - JS Itempicker object
* derived from et2_link_entry widget @copyright 2011 Nathan Gray
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
@ -25,9 +25,11 @@
/**
* Class which implements the "itempicker" XET-Tag
*
* @augments et2_inputWidget
*/
var et2_itempicker = et2_inputWidget.extend({
var et2_itempicker = et2_inputWidget.extend(
{
attributes: {
"action": {
"name": "Action callback",
@ -74,6 +76,11 @@ var et2_itempicker = et2_inputWidget.extend({
action: null, // Action function for button
current_app: "", // Remember currently chosen application
/**
* Constructor
*
* @memberOf et2_itempicker
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Link object
* EGroupware eTemplate2 - JS Link object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -19,14 +19,16 @@
et2_core_valueWidget;
// Include menu system for list context menu
egw_action.egw_menu_dhtmlx;
egw_action.egw_menu_dhtmlx;
*/
/**
* UI widgets for Egroupware linking system
*
* @augments et2_inputWidget
*/
var et2_link_to = et2_inputWidget.extend({
var et2_link_to = et2_inputWidget.extend(
{
attributes: {
"only_app": {
"name": "Application",
@ -73,6 +75,11 @@ var et2_link_to = et2_inputWidget.extend({
search_timeout: 200, //ms after change to send query
minimum_characters: 2, // Don't send query unless there's at least this many chars
/**
* Constructor
*
* @memberOf et2_link_to
*/
init: function() {
this._super.apply(this, arguments);
@ -171,7 +178,7 @@ var et2_link_to = et2_inputWidget.extend({
}
},
self, et2_link_list
)
);
self.egw().window.clearInterval(poll);
}
},1000);
@ -198,7 +205,7 @@ var et2_link_to = et2_inputWidget.extend({
blur: this.options.search_label ? this.options.search_label : this.egw().lang('Search...'),
query: function() { self.link_button.hide(); self.comment.hide(); return true;},
select: function() {self.link_button.show(); self.comment.show(); return true;}
}
};
this.link_entry = et2_createWidget("link-entry", link_entry_attrs,this);
// File upload
@ -303,7 +310,11 @@ var et2_link_to = et2_inputWidget.extend({
});
et2_register_widget(et2_link_to, ["link-to"]);
var et2_link_apps = et2_selectbox.extend({
/**
* @augments et2_selectbox
*/
var et2_link_apps = et2_selectbox.extend(
{
attributes: {
"only_app": {
"name": "Application",
@ -319,6 +330,11 @@ var et2_link_apps = et2_selectbox.extend({
}
},
/**
* Constructor
*
* @memberOf et2_link_apps
*/
init: function() {
this._super.apply(this, arguments);
@ -335,7 +351,7 @@ var et2_link_apps = et2_selectbox.extend({
if (select_options == null)
{
select_options = this.getArrayMgr('content')
.getEntry("options-" + this.id)
.getEntry("options-" + this.id);
}
// Default to an empty object
@ -349,8 +365,11 @@ var et2_link_apps = et2_selectbox.extend({
});
et2_register_widget(et2_link_apps, ["link-apps"]);
var et2_link_entry = et2_inputWidget.extend({
/**
* @augments et2_inputWidget
*/
var et2_link_entry = et2_inputWidget.extend(
{
attributes: {
"value": {
"type": "any",
@ -392,6 +411,11 @@ var et2_link_entry = et2_inputWidget.extend({
search_timeout: 200, //ms after change to send query
minimum_characters: 2, // Don't send query unless there's at least this many chars
/**
* Constructor
*
* @memberOf et2_link_entry
*/
init: function() {
this._super.apply(this, arguments);
@ -570,7 +594,7 @@ var et2_link_entry = et2_inputWidget.extend({
if (_attrs["select_options"] == null)
{
_attrs["select_options"] = this.getArrayMgr('content')
.getEntry("options-" + this.id)
.getEntry("options-" + this.id);
}
// Default to an empty object
@ -794,8 +818,11 @@ et2_register_widget(et2_link_entry, ["link-entry"]);
/**
* UI widget for a single (read-only) link
*
* @augments et2_valueWidget
*/
var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_link = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"application": {
"name": "Application",
@ -812,6 +839,12 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM], {
}
},
legacyOptions: ["application"],
/**
* Constructor
*
* @memberOf et2_link
*/
init: function() {
this._super.apply(this, arguments);
@ -935,8 +968,11 @@ et2_register_widget(et2_link, ["link", "link-entry_ro"]);
/**
* UI widget for one or more links, comma separated
*
* @augments et2_valueWidget
*/
var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"application": {
"name": "Application",
@ -961,6 +997,12 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], {
"description": "Sub-type key to list only entries of that type"
}
},
/**
* Constructor
*
* @memberOf et2_link_string
*/
init: function() {
this._super.apply(this, arguments);
@ -1085,8 +1127,11 @@ et2_register_widget(et2_link_string, ["link-string"]);
/**
* UI widget for one or more links in a list (table)
*
* @augments et2_link_string
*/
var et2_link_list = et2_link_string.extend({
var et2_link_list = et2_link_string.extend(
{
attributes: {
"show_deleted": {
"name": "Show deleted",
@ -1095,6 +1140,12 @@ var et2_link_list = et2_link_string.extend({
"description": "Show links that are marked as deleted, being held for purge"
}
},
/**
* Constructor
*
* @memberOf et2_link_list
*/
init: function() {
this._super.apply(this, arguments);
@ -1152,7 +1203,7 @@ var et2_link_list = et2_link_string.extend({
_add_link: function(_link_data) {
var row = $j(document.createElement("tr"))
.attr("id", "link_"+_link_data.link_id)
.appendTo(this.list)
.appendTo(this.list);
// Icon
var icon = $j(document.createElement("td"))
@ -1200,7 +1251,7 @@ var et2_link_list = et2_link_string.extend({
// Delete
var delete_button = $j(document.createElement("td"))
.appendTo(row)
.appendTo(row);
$j("<div />")
.appendTo(delete_button)
// We don't use ui-icon because it assigns a bg image
@ -1231,9 +1282,11 @@ et2_register_widget(et2_link_list, ["link-list"]);
/**
* UI widget for one or more links in a list (table)
*
* @augments et2_inputWidget
*/
var et2_link_add = et2_inputWidget.extend({
var et2_link_add = et2_inputWidget.extend(
{
attributes: {
"application": {
"name": "Application",
@ -1242,6 +1295,11 @@ var et2_link_add = et2_inputWidget.extend({
"description": "Limit to the listed application or applications (comma seperated)"
}
},
/**
* Constructor
*
* @memberOf et2_link_add
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Number object
* EGroupware eTemplate2 - JS Number object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -18,9 +18,11 @@
/**
* Class which implements the "int" and textbox type=float XET-Tags
*
* @augments et2_textbox
*/
var et2_number = et2_textbox.extend({
var et2_number = et2_textbox.extend(
{
attributes: {
"value": {
"type": "float"
@ -51,6 +53,11 @@ var et2_number = et2_textbox.extend({
}
},
/**
* Constructor
*
* @memberOf et2_number
*/
init: function() {
this._super.apply(this, arguments);
},
@ -80,14 +87,16 @@ var et2_number = et2_textbox.extend({
}
}
});
et2_register_widget(et2_number, ["int", "integer", "float"]);
/**
* Extend read-only to tell it to ignore special attributes, which
* would cause warnings otherwise
* @augments et2_textbox_ro
* @class
*/
var et2_number_ro = et2_textbox_ro.extend({
var et2_number_ro = et2_textbox_ro.extend(
{
attributes: {
"min": {"ignore": true},
"max": {"ignore": true},

View File

@ -18,7 +18,9 @@
*/
/**
* Class which implements the "image" XET-Tag
* Class which implements the "progress" XET-Tag
*
* @augments et2_valueWidget
*/
var et2_progress = et2_valueWidget.extend([et2_IDetachedDOM],
{
@ -54,6 +56,11 @@ var et2_progress = et2_valueWidget.extend([et2_IDetachedDOM],
},
legacyOptions: ["href", "extra_link_target", "imagemap", "extra_link_popup", "id"],
/**
* Constructor
*
* @memberOf et2_progress
*/
init: function()
{
this._super.apply(this, arguments);
@ -131,5 +138,4 @@ var et2_progress = et2_valueWidget.extend([et2_IDetachedDOM],
}
}
});
et2_register_widget(et2_progress, ["progress"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Radiobox object
* EGroupware eTemplate2 - JS Radiobox object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -19,9 +19,11 @@
/**
* Class which implements the "radiobox" XET-Tag
*
* @augments et2_inputWidget
*/
var et2_radiobox = et2_inputWidget.extend({
var et2_radiobox = et2_inputWidget.extend(
{
attributes: {
"set_value": {
"name": "Set value",
@ -45,6 +47,11 @@ var et2_radiobox = et2_inputWidget.extend({
legacyOptions: ["set_value", "ro_true", "ro_false"],
/**
* Constructor
*
* @memberOf et2_radiobox
*/
init: function() {
this._super.apply(this, arguments);
@ -94,11 +101,13 @@ var et2_radiobox = et2_inputWidget.extend({
return null;
}
});
et2_register_widget(et2_radiobox, ["radio"]);
var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
/**
* @augments et2_valueWidget
*/
var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"set_value": {
"name": "Set value",
@ -124,6 +133,12 @@ var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
"type": "string",
}
},
/**
* Constructor
*
* @memberOf et2_radiobox_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -165,15 +180,16 @@ var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
this.set_value(_values["value"]);
}
});
et2_register_widget(et2_radiobox_ro, ["radio_ro"]);
/**
* A group of radio buttons
*
* @augments et2_box
*/
var et2_radioGroup = et2_box.extend({
var et2_radioGroup = et2_box.extend(
{
attributes: {
"value": {
"name": "Value",
@ -203,6 +219,13 @@ var et2_radioGroup = et2_box.extend({
createNamespace: false,
/**
* Constructor
*
* @param parent
* @param attrs
* @memberOf et2_radioGroup
*/
init: function(parent, attrs) {
attrs.type = "vbox";
this._super.apply(this, arguments);
@ -232,7 +255,7 @@ var et2_radioGroup = et2_box.extend({
ro_true: this.options.ro_true,
ro_false: this.options.ro_false,
readonly: this.options.readonly
}
};
var radio = et2_createWidget("radio", attrs, this);
// radio.set_name(this.id);
}

View File

@ -29,9 +29,11 @@
* - 'popup' => No selectbox, just search. No popup, the search replaces the selectbox
*
* Only primary_group and popup need anything different from a normal selectbox
*
* @augments et2_selectbox
*/
var et2_selectAccount = et2_selectbox.extend({
var et2_selectAccount = et2_selectbox.extend(
{
attributes: {
'account_type': {
'name': 'Account type',
@ -45,15 +47,23 @@ var et2_selectAccount = et2_selectbox.extend({
account_types: ['accounts','groups','both','owngroups'],
/**
* Constructor
*
* @param _parent
* @param _attrs
* @memberOf et2_selectAccount
* @returns
*/
init: function(_parent, _attrs) {
// Type in rows or somewhere else?
if(jQuery.inArray(_attrs['empty_label'], this.account_types) > 0 && (
jQuery.inArray(_attrs['account_type'], this.account_types) < 0 ||
_attrs['account_type'] == this.attributes.account_type.default)
_attrs['account_type'] == this.attributes.account_type['default'])
)
{
_attrs['account_type'] = _attrs['empty_label']
_attrs['account_type'] = _attrs['empty_label'];
_attrs['empty_label'] = '';
}
if(jQuery.inArray(_attrs['account_type'], this.account_types) < 0)
@ -89,7 +99,7 @@ var et2_selectAccount = et2_selectbox.extend({
var button = jQuery(document.createElement("span"))
.addClass("et2_clickable")
.click(this, this._open_search)
.append('<span class="ui-icon ui-icon-search" style="display:inline-block"/>')
.append('<span class="ui-icon ui-icon-search" style="display:inline-block"/>');
this.getSurroundings().insertDOMNode(button[0]);
}
@ -109,7 +119,7 @@ var et2_selectAccount = et2_selectbox.extend({
this.set_value = function(_value) {
this.value = _value;
this.search_widget.set_value(_value);
}
};
this.search_widget.search.change(this, function(event) {
var value = event.data.search_widget.getValue();
event.data.value = typeof value == 'object' && value ? value.id : value;
@ -350,7 +360,7 @@ var et2_selectAccount = et2_selectbox.extend({
jQuery.each(items, function (index, item) {
self._add_search_result(results, item);
});
}
};
return search;
},
@ -447,10 +457,10 @@ var et2_selectAccount = et2_selectbox.extend({
.addClass("loading")
.appendTo(node);
this.egw().link_title('home-accounts', item.value, function(name) {
label.text(name).removeClass("loading")
label.text(name).removeClass("loading");
}, label);
node.appendTo(list)
node.appendTo(list);
},
_create_selected: function() {
@ -518,19 +528,20 @@ var et2_selectAccount = et2_selectbox.extend({
var label = jQuery(document.createElement('label'))
.addClass("loading")
.appendTo(option);
this.egw().link_title('home-accounts', value, function(name) {this.text(name).removeClass("loading")}, label);
this.egw().link_title('home-accounts', value, function(name) {this.text(name).removeClass("loading");}, label);
}
});
et2_register_widget(et2_selectAccount, ["select-account"]);
/**
* et2_selectAccount_ro is the readonly implementation of select account
* It extends et2_link to avoid needing the whole user list on the client.
* Instead, it just asks for the names of the ones needed, as needed.
*
* @augments et2_link_string
*/
var et2_selectAccount_ro = et2_link_string.extend([et2_IDetachedDOM], {
var et2_selectAccount_ro = et2_link_string.extend([et2_IDetachedDOM],
{
attributes: {
"empty_label": {
"name": "Empty label",
@ -542,6 +553,13 @@ var et2_selectAccount_ro = et2_link_string.extend([et2_IDetachedDOM], {
legacyOptions: ["empty_label"],
/**
* Constructor
*
* @param _parent
* @param options
* @memberOf et2_selectAccount_ro
*/
init: function(_parent, options) {
/**
Resolve some circular dependency problems here

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Selectbox object
* EGroupware eTemplate2 - JS Selectbox object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -21,8 +21,11 @@
et2_core_inputWidget;
*/
var et2_selectbox = et2_inputWidget.extend({
/**
* @augments et2_inputWidget
*/
var et2_selectbox = et2_inputWidget.extend(
{
attributes: {
"multiple": {
"name": "multiple",
@ -82,6 +85,11 @@ var et2_selectbox = et2_inputWidget.extend({
legacyOptions: ["rows","other"], // Other is sub-type specific
/**
* Construtor
*
* @memberOf et2_selectbox
*/
init: function() {
this._super.apply(this, arguments);
@ -210,7 +218,7 @@ var et2_selectbox = et2_inputWidget.extend({
var content_options = this.getArrayMgr('content').getRoot().getEntry(name_parts[name_parts.length-1]);
// If that didn't work, check according to ID
_attrs["select_options"] = content_options ? content_options : this.getArrayMgr('content')
.getEntry("options-" + this.id)
.getEntry("options-" + this.id);
}
// Default to an empty object
@ -270,8 +278,8 @@ var et2_selectbox = et2_inputWidget.extend({
var label = jQuery(document.createElement("label"))
.attr("for", opt_id)
.hover(
function() {jQuery(this).addClass("ui-state-hover")},
function() {jQuery(this).removeClass("ui-state-hover")}
function() {jQuery(this).addClass("ui-state-hover");},
function() {jQuery(this).removeClass("ui-state-hover");}
);
var option = jQuery(document.createElement("input"))
.attr("type", "checkbox")
@ -298,7 +306,7 @@ var et2_selectbox = et2_inputWidget.extend({
label.css("background-color",option_data.color);
}
}
label.append(jQuery("<span>"+_label+"</span>"))
label.append(jQuery("<span>"+_label+"</span>"));
var li = jQuery(document.createElement("li")).append(label);
li.appendTo(this.multiOptions);
@ -375,7 +383,7 @@ var et2_selectbox = et2_inputWidget.extend({
jQuery("input",e.data).attr("checked", false);
}
}
}
};
for(var key in header_controls)
{
jQuery(document.createElement("li"))
@ -596,7 +604,6 @@ var et2_selectbox = et2_inputWidget.extend({
return this.value;
}
});
et2_register_widget(et2_selectbox, ["menupopup", "listbox", "select", "select-cat",
"select-percent", 'select-priority', 'select-access',
'select-country', 'select-state', 'select-year', 'select-month',
@ -605,9 +612,16 @@ et2_register_widget(et2_selectbox, ["menupopup", "listbox", "select", "select-ca
/**
* et2_selectbox_ro is the readonly implementation of the selectbox.
*
* @augments et2_selectbox
*/
var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
{
/**
* Constructor
*
* @memberOf et2_selectbox_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -638,10 +652,10 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
for (var i = 0; i < options.length; i++)
{
this.optionValues[et2_readAttrWithDefault(options[i], "value", 0)] =
{
"label": options[i].textContent,
"title": et2_readAttrWithDefault(options[i], "title", "")
}
{
"label": options[i].textContent,
"title": et2_readAttrWithDefault(options[i], "title", "")
};
}
},
@ -738,7 +752,6 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM], {
this.set_value(_values["value"]);
}
});
et2_register_widget(et2_selectbox_ro, ["menupopup_ro", "listbox_ro", "select_ro", "select-cat_ro",
"select-percent_ro", 'select-priority_ro', 'select-access_ro',
'select-country_ro', 'select-state_ro', 'select-year_ro', 'select-month_ro',
@ -814,9 +827,16 @@ et2_register_widget(et2_selectbox_ro, ["menupopup_ro", "listbox_ro", "select_ro"
/**
* Class which just implements the menulist container
*
* @augments et2_DOMWidget
*/
var et2_menulist = et2_DOMWidget.extend({
var et2_menulist = et2_DOMWidget.extend(
{
/**
* Construtor
*
* @memberOf et2_menulist
*/
init: function() {
this._super.apply(this, arguments);
@ -839,7 +859,5 @@ var et2_menulist = et2_DOMWidget.extend({
}
});
et2_register_widget(et2_menulist, ["menulist"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - Split panel
* EGroupware eTemplate2 - Split panel
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -26,9 +26,10 @@
* turn on double-click docking to minimize one of the children.
*
* @see http://methvin.com/splitter/ Uses Splitter
* @augments et2_DOMWidget
*/
var et2_split = et2_DOMWidget.extend([et2_IResizeable], {
var et2_split = et2_DOMWidget.extend([et2_IResizeable],
{
attributes: {
"orientation": {
"name": "Orientation",
@ -58,6 +59,11 @@ var et2_split = et2_DOMWidget.extend([et2_IResizeable], {
"cols": {"ignore": true}
},
/**
* Constructor
*
* @memberOf et2_split
*/
init: function() {
this._super.apply(this, arguments);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS widget class containing styles
* EGroupware eTemplate2 - JS widget class containing styles
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -23,9 +23,16 @@
* TODO: The style data could be parsed for rules and appended using the JS
* stylesheet interface, allowing the style only to modifiy nodes of the current
* template.
*
* @augments et2_widget
*/
var et2_styles = et2_widget.extend({
var et2_styles = et2_widget.extend(
{
/**
* Constructor
*
* @memberOf et2_styles
*/
init: function() {
this._super.apply(this, arguments);
@ -60,6 +67,5 @@ var et2_styles = et2_widget.extend({
}
});
et2_register_widget(et2_styles, ["styles"]);

View File

@ -20,9 +20,11 @@
/**
* Class which implements the tabbox-tag
*
* @augments et2_DOMWidget
*/
var et2_tabbox = et2_DOMWidget.extend({
var et2_tabbox = et2_DOMWidget.extend(
{
attributes: {
'tabs': {
'name': 'Tabs',
@ -35,6 +37,12 @@ var et2_tabbox = et2_DOMWidget.extend({
* Currently selected tab
*/
selected_index: 0,
/**
* Construtor
*
* @memberOf et2_tabbox
*/
init: function() {
// Create the outer tabbox container
this.container = $j(document.createElement("div"))
@ -176,7 +184,7 @@ var et2_tabbox = et2_DOMWidget.extend({
}
// Create the tab DOM-Nodes
this.createTabs(tabData)
this.createTabs(tabData);
}
else
{
@ -270,5 +278,4 @@ var et2_tabbox = et2_DOMWidget.extend({
}
});
et2_register_widget(et2_tabbox, ["tabbox"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Template base class
* EGroupware eTemplate2 - JS Template base class
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -24,9 +24,11 @@
* inserted in place of this template.
*
* TODO: Check whether this widget behaves as it should.
*
* @augments et2_DOMWidget
*/
var et2_template = et2_DOMWidget.extend({
var et2_template = et2_DOMWidget.extend(
{
attributes: {
"template": {
"name": "Template",
@ -60,6 +62,8 @@ var et2_template = et2_DOMWidget.extend({
/**
* Initializes this template widget as a simple container.
*
* @memberOf et2_template
*/
init: function(_parent, _attrs) {
// Set this early, so it's available for creating namespace
@ -156,7 +160,5 @@ var et2_template = et2_DOMWidget.extend({
return this.div;
}
});
et2_register_widget(et2_template, ["template"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS Textbox object
* EGroupware eTemplate2 - JS Textbox object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -20,9 +20,11 @@
/**
* Class which implements the "textbox" XET-Tag
*
* @augments et2_inputWidget
*/
var et2_textbox = et2_inputWidget.extend({
var et2_textbox = et2_inputWidget.extend(
{
attributes: {
"multiline": {
"name": "multiline",
@ -65,6 +67,11 @@ var et2_textbox = et2_inputWidget.extend({
legacyOptions: ["size", "maxlength"],
/**
* Constructor
*
* @memberOf et2_textbox
*/
init: function() {
this._super.apply(this, arguments);
@ -170,14 +177,15 @@ var et2_textbox = et2_inputWidget.extend({
}
}
});
et2_register_widget(et2_textbox, ["textbox", "passwd"]);
/**
* et2_textbox_ro is the dummy readonly implementation of the textbox.
*
* @augments et2_valueWidget
*/
var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Ignore all more advanced attributes.
*/
@ -205,6 +213,11 @@ var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
}
},
/**
* Constructor
*
* @memberOf et2_textbox_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -243,6 +256,5 @@ var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM], {
}
}
});
et2_register_widget(et2_textbox_ro, ["textbox_ro"]);

View File

@ -24,8 +24,13 @@
// /phpgwapi/js/dhtmlxtree/dhtmlxTree/sources/ext/dhtmlxtree_start.js;
*/
var et2_tree = et2_inputWidget.extend({
/**
* Tree widget
*
* @augments et2_inputWidget
*/
var et2_tree = et2_inputWidget.extend(
{
attributes: {
"multiple": {
"name": "multiple",
@ -82,6 +87,11 @@ var et2_tree = et2_inputWidget.extend({
}
},
/**
* Constructor
*
* @memberOf et2_tree
*/
init: function() {
this._super.apply(this, arguments);
@ -138,7 +148,7 @@ var et2_tree = et2_inputWidget.extend({
var content_options = this.getArrayMgr('content').getRoot().getEntry(name_parts[name_parts.length-1]);
// If that didn't work, check according to ID
_attrs["select_options"] = content_options ? content_options : this.getArrayMgr('content')
.getEntry("options-" + this.id)
.getEntry("options-" + this.id);
}
// Default to an empty object
@ -251,7 +261,7 @@ var et2_tree = et2_inputWidget.extend({
f(data.item[j],f);
}
}
}
};
f(data,f);
options = data;
}
@ -428,15 +438,15 @@ var et2_tree = et2_inputWidget.extend({
var rv;
var returnValue = [_nodeID];
var modetorun = "none";
if (mode) { modetorun = mode }
PoS = this.input.getOpenState(_nodeID)
if (mode) { modetorun = mode; }
PoS = this.input.getOpenState(_nodeID);
if (modetorun == "forced") PoS = 1;
if (PoS == 1) {
for(var i=0;i<z.length;i++) {
oS = this.input.getOpenState(z[i])
oS = this.input.getOpenState(z[i]);
//alert(z[i]+' OpenState:'+oS);
if (oS == -1) { returnValue.push(z[i]) }
if (oS == 0) { returnValue.push(z[i]) }
if (oS == -1) { returnValue.push(z[i]); }
if (oS == 0) { returnValue.push(z[i]); }
if (oS == 1) {
//alert("got here")
rv = this.getTreeNodeOpenItems(z[i]);
@ -446,7 +456,7 @@ var et2_tree = et2_inputWidget.extend({
}
}
//alert(returnValue.join('#,#'));
return returnValue
return returnValue;
}
});
et2_register_widget(et2_tree, ["tree","tree-cat"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS URL object
* EGroupware eTemplate2 - JS URL object
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -20,15 +20,20 @@
/**
* Class which implements the "url" XET-Tag, which covers URLs, email & phone
*
* @augments et2_textbox
*/
var et2_url = et2_textbox.extend({
var et2_url = et2_textbox.extend(
{
attributes: {
"multiline": {
"ignore": true
}
},
/**
* @memberOf et2_url
*/
createInputWidget: function() {
this.input = $j(document.createElement("input"))
.blur(this,this.validate)
@ -191,15 +196,21 @@ var et2_url = et2_textbox.extend({
}
}
});
et2_register_widget(et2_url, ["url", "url-email", "url-phone"]);
/**
* et2_url_ro is the readonly implementation of the url, email & phone.
* It renders things as links, when possible
*
* @augments et2_valueWidget
*/
var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],{
var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Constructor
*
* @memberOf et2_url_ro
*/
init: function() {
this._super.apply(this, arguments);
@ -284,6 +295,5 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],{
}
}
});
et2_register_widget(et2_url_ro, ["url_ro", "url-email_ro", "url-phone_ro"]);

View File

@ -1,5 +1,5 @@
/**
* eGroupWare eTemplate2 - JS VFS widgets
* EGroupware eTemplate2 - JS VFS widgets
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -22,9 +22,11 @@
/**
* Class which implements the "vfs" XET-Tag
*
* @augments et2_valueWidget
*/
var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
"type": "any", // Object
@ -37,6 +39,11 @@ var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM], {
*/
DIR_MIME_TYPE: 'httpd/unix-directory',
/**
* Constructor
*
* @memberOf et2_vfs
*/
init: function() {
this._super.apply(this, arguments);
@ -147,8 +154,16 @@ et2_register_widget(et2_vfs, ["vfs"]);
/**
* vfs-name
* filename automatically urlencoded on return (urldecoded on display to user)
*
* @augments et2_textbox
*/
var et2_vfsName = et2_textbox.extend({
var et2_vfsName = et2_textbox.extend(
{
/**
* Constructor
*
* @memberOf et2_vfsName
*/
init: function() {
this._super.apply(this, arguments);
this.input.addClass("et2_vfs");
@ -170,8 +185,16 @@ et2_register_widget(et2_vfsName, ["vfs-name"]);
/**
* vfs-name
* filename automatically urlencoded on return (urldecoded on display to user)
*
* @augments et2_textbox_ro
*/
var et2_vfsName_ro = et2_textbox_ro.extend({
var et2_vfsName_ro = et2_textbox_ro.extend(
{
/**
* Constructor
*
* @memberOf et2_vfsName_ro
*/
init: function() {
this._super.apply(this, arguments);
},
@ -192,8 +215,11 @@ et2_register_widget(et2_vfsName_ro, ["vfs-name_ro"]);
/**
* vfs-mime
* Icon for mimetype of file, or thumbnail
*
* @augments et2_valueWidget
*/
var et2_vfsMime = et2_valueWidget.extend([et2_IDetachedDOM], {
var et2_vfsMime = et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
"type": "any", // Object
@ -208,6 +234,11 @@ var et2_vfsMime = et2_valueWidget.extend([et2_IDetachedDOM], {
legacyOptions:["size"],
/**
* Constructor
*
* @memberOf et2_vfsMime
*/
init: function() {
this._super.apply(this, arguments);
this.image = jQuery(document.createElement("img"));
@ -261,6 +292,8 @@ et2_register_widget(et2_vfsMime, ["vfs-mime"]);
/**
* vfs-size
* Human readable file sizes
*
* @augments et2_description
*/
var et2_vfsSize = et2_description.extend({
attributes: {
@ -268,6 +301,11 @@ var et2_vfsSize = et2_description.extend({
"type": "integer",
}
},
/**
* Constructor
*
* @memberOf et2_vfsSize
*/
init: function() {
this._super.apply(this, arguments);
this.span.addClass("et2_vfs");
@ -311,8 +349,9 @@ et2_register_widget(et2_vfsSize, ["vfs-size"]);
/**
* vfs-mode
* Textual representation of permissions + extra bits
* vfs-mode: textual representation of permissions + extra bits
*
* @augments et2_description
*/
var et2_vfsMode = et2_description.extend({
// Masks for file types
@ -336,6 +375,12 @@ var et2_vfsMode = et2_description.extend({
'w': 0x2, // Write
'r': 0x4 // Read
},
/**
* Constructor
*
* @memberOf et2_vfsMode
*/
init: function() {
this._super.apply(this, arguments);
this.span.addClass("et2_vfs");
@ -416,11 +461,18 @@ et2_register_widget(et2_vfsMode, ["vfs-mode"]);
/**
* vfs-uid / vfs-gid
* Displays the name for an ID.
* vfs-uid / vfs-gid: Displays the name for an ID.
* Same as read-only selectAccount, except if there's no user it shows "root"
*
* @augments et2_selectAccount_ro
*/
var et2_vfsUid = et2_selectAccount_ro.extend({
var et2_vfsUid = et2_selectAccount_ro.extend(
{
/**
* @memberOf et2_vfsUid
* @param _node
* @param _value
*/
set_title: function(_node, _value) {
if(_value == "")
{
@ -438,15 +490,24 @@ et2_register_widget(et2_vfsUid, ["vfs-uid","vfs-gid"]);
* and calling app is responsible to move content of that dir to entry directory, after entry is saved
* + option: required mimetype or regular expression for mimetype to match, eg. '/^text\//i' for all text files
* + if path ends in a slash, multiple files can be uploaded, their original filename is kept then
*
* @augments et2_file
*/
var et2_vfsUpload = et2_file.extend({
var et2_vfsUpload = et2_file.extend(
{
legacyOptions: ["mime"],
asyncOptions: {
url: egw_json_request.prototype._assembleAjaxUrl("etemplate_widget_vfs::ajax_upload::etemplate")
},
/**
* Constructor
*
* @param _parent
* @param attrs
* @memberof et2_vfsUpload
*/
init: function(_parent, attrs) {
this._super.apply(this, arguments);
this.input.addClass("et2_vfs");

View File

@ -88,7 +88,7 @@ function etemplate2(_container, _menuaction)
this.templates = {};
// Connect to the window resize event
$j(window).resize(this, function(e) {e.data.resize()});
$j(window).resize(this, function(e) {e.data.resize();});
}
/**
@ -104,7 +104,7 @@ etemplate2.prototype.resize = function()
_widget.resize();
}, this, et2_IResizeable);
}
}
};
/**
* Clears the current instance.
@ -131,7 +131,7 @@ etemplate2.prototype.clear = function()
}
}
this.templates = {};
}
};
/**
* Creates an associative array containing the data array managers for each part
@ -176,7 +176,7 @@ etemplate2.prototype._createArrayManagers = function(_data)
}
return result;
}
};
/**
* Loads the template from the given URL and sets the data object
@ -253,7 +253,7 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback)
// Split the given data into array manager objects and pass those to the
// widget container
this.widgetContainer.setArrayMgrs(this._createArrayManagers(_data));
}
};
etemplate2.prototype.submit = function(button)
{
@ -285,7 +285,7 @@ etemplate2.prototype.submit = function(button)
// I'm just not sure how.
if(button && !values.button)
{
values.button = button.id
values.button = button.id;
var path = button.getPath();
var target = values;
for(var i = 0; i < path.length; i++)
@ -328,7 +328,7 @@ etemplate2.prototype.submit = function(button)
egw.debug("info", "Form got submitted with values: ", values);
}
}
}
};
/**
* Does a full form post submit.
@ -366,7 +366,7 @@ etemplate2.prototype.postSubmit = function()
form.append(input);
form.appendTo(jQuery('body')).submit();
}
}
};
/**
* Fetches all input element values and returns them in an associative
@ -459,7 +459,7 @@ etemplate2.prototype.getValues = function(_root)
else if (jQuery.isEmptyObject(_target))
{
// Avoid sending back empty sub-arrays
_target = result
_target = result;
for (var i = 0; i < path.length-1; i++)
{
_target = _target[path[i]];
@ -472,7 +472,7 @@ etemplate2.prototype.getValues = function(_root)
egw().debug("info", "Value", result);
return result;
}
};
/**
@ -508,8 +508,7 @@ etemplate2.prototype.refresh = function(msg, app, id, type)
// Trigger refresh
_widget.refresh(id,type);
}, this, et2_nextmatch);
}
};
// Some static things to make getting into widget context a little easier //
@ -559,7 +558,7 @@ etemplate2.getByApplication = function(app)
}
}
return list;
}
};
function etemplate2_handle_load(_type, _response)
{

View File

@ -23,7 +23,7 @@ function widget_browser(list_div, widget_div)
this.et2 = new etemplate2(widget_div, "etemplate::ajax_process_content");
// Normally this would be passed from app
var _data = {}
var _data = {};
// Create the basic widget container and attach it to the DOM
// Not really needed, but let's be consitent with et2
@ -74,7 +74,7 @@ widget_browser.prototype._init_list = function()
.attr('id', 'widget_attributes')
.append(attribute_table)
);
}
};
/**
* User selected a widget from the list
@ -122,9 +122,7 @@ widget_browser.prototype.select_widget = function(e,f)
.appendTo(this.attribute_list);
}
}
}
};
/**
@ -184,7 +182,7 @@ widget_browser.prototype.create_attribute = function(name, settings)
value.text(this.widget.options[name]);
return row;
}
input.appendTo(value)
input.appendTo(value);
return row;
}
};