fixing scope of "use strict", so we do not need to remove it when concatinating our scripts like we do now with minjs

This commit is contained in:
Ralf Becker 2016-02-29 20:40:43 +00:00
parent fc7d679fea
commit aa31a8705f
76 changed files with 548 additions and 630 deletions

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_interfaces;
et2_core_widget;
@ -25,7 +23,7 @@
*
* @augments et2_widget
*/
var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
var et2_DOMWidget = (function(){ "use strict"; return et2_widget.extend(et2_IDOMNode,
{
attributes: {
"disabled": {
@ -429,7 +427,7 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
}
}
},
set_background: function(_value)
{
var node = this.getDOMNode(this);
@ -445,7 +443,7 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
});
}
},
/**
* Set Actions on the widget
*
@ -566,8 +564,9 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
// 'allowed' for this widget at this time
var action_links = this._get_action_links(actions);
widget_object.updateActionLinks(action_links);
}
});
}
});}).call(this);
/**
* The surroundings manager class allows to append or prepend elements around
@ -575,7 +574,7 @@ var et2_DOMWidget = et2_widget.extend(et2_IDOMNode,
*
* @augments Class
*/
var et2_surroundingsMgr = ClassWithAttributes.extend(
var et2_surroundingsMgr = (function(){ "use strict"; return ClassWithAttributes.extend(
{
/**
* Constructor
@ -781,7 +780,7 @@ var et2_surroundingsMgr = ClassWithAttributes.extend(
return this._widgetContainer;
}
});
});}).call(this);
/**
* The egw_action system requires an egwActionObjectInterface Interface implementation
@ -801,7 +800,7 @@ function et2_action_object_impl(widget, node)
aoi.getWidget = function() {
return widget;
};
aoi.doGetDOMNode = function() {
return objectNode?objectNode:widget.getDOMNode();
};

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_common;
egw_inheritance;
@ -21,7 +19,7 @@
/**
* @augments Class
*/
var et2_arrayMgr = Class.extend(
var et2_arrayMgr = (function(){ "use strict"; return Class.extend(
{
splitIds: true,
@ -384,12 +382,12 @@ var et2_arrayMgr = Class.extend(
return mgr;
}
});
});}).call(this);
/**
* @augments et2_arrayMgr
*/
var et2_readonlysArrayMgr = et2_arrayMgr.extend(
var et2_readonlysArrayMgr = (function(){ "use strict"; return et2_arrayMgr.extend(
{
/**
@ -455,7 +453,7 @@ var et2_readonlysArrayMgr = et2_arrayMgr.extend(
{
return this.perspectiveData.owner.getArrayMgr('content').expandName(ident);
}
});
});}).call(this);
/**
* Creates a new set of array managers

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
lib/tooltip;
@ -25,7 +23,7 @@
*
* @augments et2_DOMWidget
*/
var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned,
var et2_baseWidget = (function(){ "use strict"; return et2_DOMWidget.extend(et2_IAligned,
{
attributes: {
"statustext": {
@ -291,14 +289,14 @@ var et2_baseWidget = et2_DOMWidget.extend(et2_IAligned,
return this.align;
}
});
});}).call(this);
/**
* Simple container object
*
* @augments et2_baseWidget
*/
var et2_container = et2_baseWidget.extend(
var et2_container = (function(){ "use strict"; return et2_baseWidget.extend(
{
/**
* Constructor
@ -332,14 +330,14 @@ var et2_container = et2_baseWidget.extend(
}
}
}
});
});}).call(this);
/**
* Container object for not-yet supported widgets
*
* @augments et2_baseWidget
*/
var et2_placeholder = et2_baseWidget.extend([et2_IDetachedDOM],
var et2_placeholder = (function(){ "use strict"; return et2_baseWidget.extend([et2_IDetachedDOM],
{
/**
* Constructor
@ -409,5 +407,5 @@ var et2_placeholder = et2_baseWidget.extend([et2_IDetachedDOM],
setDetachedAttributes: function(_nodes, _values) {
this.placeDiv = jQuery(_nodes[0]);
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/**
* IE Fix for array.indexOf
*/

View File

@ -10,14 +10,12 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_common;
egw_inheritance;
*/
var ClassWithAttributes = Class.extend(
var ClassWithAttributes = (function(){ "use strict"; return Class.extend(
{
/**
* Returns the value of the given attribute. If the property does not
@ -157,4 +155,4 @@ var ClassWithAttributes = Class.extend(
et2_validateAttrib(key, attributes[key]);
}
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_interfaces;
@ -25,7 +23,7 @@
*
* @augments et2_valueWidget
*/
var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
var et2_inputWidget = (function(){ "use strict"; return et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
{
attributes: {
"needed": {
@ -320,5 +318,5 @@ var et2_inputWidget = et2_valueWidget.extend([et2_IInput,et2_ISubmitListener],
this.set_validation_error(valid ? false : messages);
return valid;
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_inheritance;
*/

View File

@ -10,14 +10,14 @@
* @version $Id: et2_core_phpExpressionCompiler.js 38256 2012-03-05 13:07:38Z igel457 $
*/
"use strict";
/*egw:uses
et2_interfaces;
et2_core_common;
*/
(function() {
(function()
{
"use strict";
/**
* Resolve javascript pseudo functions in onclick or onchange:

View File

@ -10,13 +10,13 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_common;
*/
(function() {
(function()
{
"use strict";
var STATE_DEFAULT = 0;
var STATE_ESCAPED = 1;

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_baseWidget;
@ -24,7 +22,7 @@
*
* @augments et2_baseWidget
*/
var et2_valueWidget = et2_baseWidget.extend(
var et2_valueWidget = (function(){ "use strict"; return et2_baseWidget.extend(
{
attributes: {
"label": {
@ -127,5 +125,5 @@ var et2_valueWidget = et2_baseWidget.extend(
// Copy the given value
this.label = _value;
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jsapi.egw;
et2_core_xml;
@ -35,6 +33,8 @@ var et2_registry = {};
*/
function et2_register_widget(_constructor, _types)
{
"use strict";
// Iterate over all given types and register those
for (var i = 0; i < _types.length; i++)
{
@ -67,6 +67,8 @@ function et2_register_widget(_constructor, _types)
*/
function et2_createWidget(_name, _attrs, _parent)
{
"use strict";
if (typeof _attrs == "undefined")
{
_attrs = {};
@ -104,7 +106,7 @@ function et2_createWidget(_name, _attrs, _parent)
*
* @augments ClassWithAttributes
*/
var et2_widget = ClassWithAttributes.extend(
var et2_widget = (function(){ "use strict"; return ClassWithAttributes.extend(
{
attributes: {
"id": {
@ -1040,5 +1042,5 @@ var et2_widget = ClassWithAttributes.extend(
return path;
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/**
* Loads the given URL asynchronously from the server
*

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_common;
@ -31,7 +29,7 @@
*
* @augments Class
*/
var et2_dataview = Class.extend({
var et2_dataview = (function(){ "use strict"; return Class.extend({
/**
* Constant which regulates the column padding.
@ -275,7 +273,7 @@ var et2_dataview = Class.extend({
this.egw.css(".egwGridView_grid ." + this.uniqueId + "_div_fullRow");
this.egw.css(".egwGridView_outer ." + this.uniqueId + "_td_fullRow");
this.egw.css(".egwGridView_outer ." + this.uniqueId + "_spacer_fullRow");
// Reset the headerColumns array and empty the table row
this.columnNodes = [];
this.columns = [];
@ -404,7 +402,7 @@ var et2_dataview = Class.extend({
.attr("align", "left")
.append(cont)
.appendTo(this.headTr);
if(this.columnMgr && this.columnMgr.columns[i])
{
column.addClass(this.columnMgr.columns[i].fixedWidth ? 'fixedWidth' : 'relativeWidth');
@ -609,6 +607,6 @@ var et2_dataview = Class.extend({
return width;
}
});
});}).call(this);

View File

@ -34,7 +34,7 @@ var ET2_DATAVIEW_STEPSIZE = 50;
* instance and the corresponding data source. It manages updating the grid,
* as well as inserting and deleting rows.
*/
var et2_dataview_controller = Class.extend({
var et2_dataview_controller = (function(){ "use strict"; return Class.extend({
/**
* Constructor of the et2_dataview_controller, connects to the grid
@ -391,7 +391,7 @@ var et2_dataview_controller = Class.extend({
/**
* Create a new row.
*
*
* @param {type} ctx
* @returns {et2_dataview_container}
*/
@ -945,5 +945,5 @@ var et2_dataview_controller = Class.extend({
this._grid.makeIndexVisible(_idx);
}
});
});}).call(this);

View File

@ -27,7 +27,7 @@
*
* @augments Class
*/
var et2_dataview_selectionManager = Class.extend(
var et2_dataview_selectionManager = (function(){ "use strict"; return Class.extend(
{
/**
* Constructor
@ -539,5 +539,5 @@ var et2_dataview_selectionManager = Class.extend(
}
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_inheritance;
*/
@ -20,7 +18,7 @@ var et2_dataview_IInvalidatable = new Interface({
invalidate: function() {}
});
});
var et2_dataview_IViewRange = new Interface({
@ -76,7 +74,7 @@ var et2_IDataProvider = new Interface({
*
* @param _uid is the uid for which the callback should be registered.
* @param _callback is the callback which should get called.
* @param _context is an optional parameter which can
* @param _context is an optional parameter which can
*/
dataRegisterUID: function (_uid, _callback, _context) {},

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_inheritance;
*/
@ -29,7 +27,7 @@ var ET2_COL_VISIBILITY_ALWAYS_NOSELECT = 3;
*
* @augments Class
*/
var et2_dataview_column = ClassWithAttributes.extend({
var et2_dataview_column = (function(){ "use strict"; return ClassWithAttributes.extend({
attributes: {
"id": {
@ -146,7 +144,7 @@ var et2_dataview_column = ClassWithAttributes.extend({
this.egw().debug("warn", "Invalid visibility option for column: ", _value);
}
}
});
});}).call(this);
/**
* Contains logic for the columns class. The columns class represents the unique set
@ -154,7 +152,7 @@ var et2_dataview_column = ClassWithAttributes.extend({
* do normaly not change.
*/
var et2_dataview_columns = Class.extend({
var et2_dataview_columns = (function(){ "use strict"; return Class.extend({
init: function(_columnData) {
// Initialize some variables
@ -431,5 +429,5 @@ var et2_dataview_columns = Class.extend({
}
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
egw_action.egw_action_common;
egw_action.egw_action;
@ -27,11 +25,15 @@ var EGW_SELECTMODE_DEFAULT = 0;
var EGW_SELECTMODE_TOGGLE = 1;
/**
* An action object interface for each nextmatch widget row - "inherits" from
* An action object interface for each nextmatch widget row - "inherits" from
* egwActionObjectInterface
*
* @param {DOMNode} _node
*/
function et2_dataview_rowAOI(_node)
{
"use strict";
var aoi = new egwActionObjectInterface();
aoi.node = _node;
@ -51,8 +53,10 @@ function et2_dataview_rowAOI(_node)
/**
* Now append some action code to the node
*
*
* @memberOf et2_dataview_rowAOI
* @param {DOMEvent} e
* @param {object} _params
*/
var selectHandler = function(e, _params) {
// Reset the focus so that keyboard navigation will work properly
@ -62,12 +66,12 @@ function et2_dataview_rowAOI(_node)
// Reset the prevent selection code (in order to allow wanted
// selection of text)
_node.onselectstart = null;
if (e.target != aoi.checkBox)
{
var selected = egwBitIsSet(aoi.getState(), EGW_AO_STATE_SELECTED);
var state = egwGetShiftState(e);
if (_params)
{
if (egwIsMobile())
@ -112,7 +116,7 @@ function et2_dataview_rowAOI(_node)
{
selectHandler(event);
}
});
} else {
$j(_node).click(selectHandler);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_dataview_interfaces;
@ -33,7 +31,7 @@
*
* @augments Class
*/
var et2_dataview_container = Class.extend(et2_dataview_IInvalidatable,
var et2_dataview_container = (function(){ "use strict"; return Class.extend(et2_dataview_IInvalidatable,
{
/**
* Initializes the container object.
@ -376,4 +374,4 @@ var et2_dataview_container = Class.extend(et2_dataview_IInvalidatable,
{
return _node.offsetHeight;
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_common;
@ -45,7 +43,7 @@ var ET2_GRID_HOLD_COUNT = 50;
/**
* @augments et2_dataview_container
*/
var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange,
var et2_dataview_grid = (function(){ "use strict"; return et2_dataview_container.extend(et2_dataview_IViewRange,
{
/**
* Creates the grid.
@ -1387,5 +1385,5 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange,
this.appendNode($j(this.tr[0]));
}
});
});}).call(this);

View File

@ -10,13 +10,13 @@
* @version $Id$
*/
"use strict";
/**
* This set of functions is currently only supporting resizing in ew-direction
*/
(function() {
(function()
{
"use strict";
// Define some constants
var RESIZE_BORDER = 12;

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
egw_action.egw_action;
@ -21,7 +19,7 @@
/**
* @augments et2_dataview_container
*/
var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange,
var et2_dataview_row = (function(){ "use strict"; return et2_dataview_container.extend(et2_dataview_IViewRange,
{
/**
* Creates the row container. Use the "setRow" function to load the actual
@ -193,5 +191,5 @@ var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IViewRange,
}
}
});
});}).call(this);

View File

@ -24,7 +24,7 @@
*
* @augments Class
*/
var et2_dataview_rowProvider = Class.extend(
var et2_dataview_rowProvider = (function(){ "use strict"; return Class.extend(
{
/**
*
@ -125,5 +125,5 @@ var et2_dataview_rowProvider = Class.extend(
this._prototypes["loading"] = fullRow;
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_dataview_view_container;
@ -20,11 +18,11 @@
/**
* @augments et2_dataview_container
*/
var et2_dataview_spacer = et2_dataview_container.extend(
var et2_dataview_spacer = (function(){ "use strict"; return et2_dataview_container.extend(
{
/**
* Constructor
*
*
* @param _parent
* @param _rowProvider
* @memberOf et2_dataview_spacer
@ -103,5 +101,5 @@ var et2_dataview_spacer = et2_dataview_container.extend(
return tr;
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id: et2_dataview_view_container_1.js 46338 2014-03-20 09:40:37Z ralfbecker $
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_dataview_interfaces;
@ -25,7 +23,7 @@
*
* @augments et2_dataview_container
*/
var et2_dataview_tile = et2_dataview_row.extend([],
var et2_dataview_tile = (function(){ "use strict"; return et2_dataview_row.extend([],
{
columns: 4,
@ -47,7 +45,7 @@ var et2_dataview_tile = et2_dataview_row.extend([],
makeExpandable: function (_expandable, _callback, _context) {
// Nope. It mostly works, it's just weird.
},
getAvgHeightData: function() {
var res = {
"avgHeight": this.getHeight() / this.columns,
@ -103,4 +101,4 @@ var et2_dataview_tile = et2_dataview_row.extend([],
this.columns = Math.max(1,parseInt(this.tr.parent().innerWidth() / this.tr.outerWidth(true)));
}
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
lib/tooltip;
jquery.jquery;
@ -23,7 +21,7 @@
/**
* @augments et2_dataview
*/
var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput],
var et2_customfields_list = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput],
{
attributes: {
'customfields': {
@ -476,7 +474,7 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
attrs.empty_label = egw.lang('Select');
return this._setup_select(field_name, field, attrs);
},
_setup_date: function(field_name, field, attrs) {
attrs.data_format = 'Y-m-d';
return true;
@ -622,7 +620,7 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
// This controls where the widget is placed in the DOM
this.rows[attrs.id] = cf[0];
$j(widget.getDOMNode(widget)).css('vertical-align','top');
// Add a link to existing VFS file
var select_attrs = jQuery.extend({},
attrs,
@ -640,7 +638,7 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
// Do not store in the widgets list, one name for multiple widgets would cause problems
widget = et2_createWidget(select_attrs.type, select_attrs, this);
$j(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
$j(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
}
return false;
},
@ -694,7 +692,7 @@ var et2_customfields_list = et2_valueWidget.extend([et2_IDetachedDOM, et2_IInput
$j(_nodes[i]).toggle(_values.fields[key] && _values.value[this.prefix + key]?true:false);
}
}
});
});}).call(this);
et2_register_widget(et2_customfields_list, ["customfields", "customfields-list"]);

View File

@ -13,9 +13,10 @@
* @version $Id: et2_widget_itempicker.js 38623 2012-03-26 23:27:53Z jaytraxx $
*/
"use strict";
function itempickerDocumentAction(context, data)
{
"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'>"
+ "<input type='hidden' name='data_document_name' value='" + data.value.name + "' />"

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
// Include the action system
@ -82,7 +80,7 @@ var et2_INextmatchSortable = new Interface({
* +--------------+-----------+-------+
* @augments et2_DOMWidget
*/
var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrint],
var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrint],
{
attributes: {
// These normally set in settings, but broken out into attributes to allow run-time changes
@ -2172,7 +2170,7 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput, et2_IPrin
this.dynheight.outerNode.css('max-width','inherit');
this.resize();
}
});
});}).call(this);
et2_register_widget(et2_nextmatch, ["nextmatch"]);
/**
@ -2182,7 +2180,7 @@ et2_register_widget(et2_nextmatch, ["nextmatch"]);
* actually load templates from the server.
* @augments et2_DOMWidget
*/
var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
var et2_nextmatch_header_bar = (function(){ "use strict"; return et2_DOMWidget.extend(et2_INextmatchHeader,
{
attributes: {
"filter_label": {
@ -2811,7 +2809,7 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
jQuery.extend(true, this.nextmatch.activeFilters,mgr.data);
}, this, et2_inputWidget);
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_header_bar, ["nextmatch_header_bar"]);
/**
@ -2819,7 +2817,7 @@ et2_register_widget(et2_nextmatch_header_bar, ["nextmatch_header_bar"]);
*
* @augments et2_baseWidget
*/
var et2_nextmatch_header = et2_baseWidget.extend(et2_INextmatchHeader,
var et2_nextmatch_header = (function(){ "use strict"; return et2_baseWidget.extend(et2_INextmatchHeader,
{
attributes: {
"label": {
@ -2864,7 +2862,7 @@ var et2_nextmatch_header = et2_baseWidget.extend(et2_INextmatchHeader,
this.labelNode.text(_value);
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_header, ['nextmatch-header']);
/**
@ -2872,7 +2870,7 @@ et2_register_widget(et2_nextmatch_header, ['nextmatch-header']);
*
* @augments et2_customfields_list
*/
var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHeader,
var et2_nextmatch_customfields = (function(){ "use strict"; return et2_customfields_list.extend(et2_INextmatchHeader,
{
attributes: {
'customfields': {
@ -3088,13 +3086,13 @@ var et2_nextmatch_customfields = et2_customfields_list.extend(et2_INextmatchHead
}
return name;
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_customfields, ['nextmatch-customfields']);
/**
* @augments et2_nextmatch_header
*/
var et2_nextmatch_sortheader = et2_nextmatch_header.extend(et2_INextmatchSortable,
var et2_nextmatch_sortheader = (function(){ "use strict"; return et2_nextmatch_header.extend(et2_INextmatchSortable,
{
attributes: {
"sortmode": {
@ -3156,13 +3154,13 @@ var et2_nextmatch_sortheader = et2_nextmatch_header.extend(et2_INextmatchSortabl
this.sortmode = _mode;
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_sortheader, ['nextmatch-sortheader']);
/**
* @augments et2_selectbox
*/
var et2_nextmatch_filterheader = et2_selectbox.extend([et2_INextmatchHeader, et2_IResizeable],
var et2_nextmatch_filterheader = (function(){ "use strict"; return et2_selectbox.extend([et2_INextmatchHeader, et2_IResizeable],
{
/**
* Override to add change handler
@ -3217,13 +3215,13 @@ var et2_nextmatch_filterheader = et2_selectbox.extend([et2_INextmatchHeader, et2
this.input.css("max-width",jQuery(this.parentNode).innerWidth() + "px");
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_filterheader, ['nextmatch-filterheader']);
/**
* @augments et2_selectAccount
*/
var et2_nextmatch_accountfilterheader = et2_selectAccount.extend([et2_INextmatchHeader, et2_IResizeable],
var et2_nextmatch_accountfilterheader = (function(){ "use strict"; return et2_selectAccount.extend([et2_INextmatchHeader, et2_IResizeable],
{
/**
* Override to add change handler
@ -3277,13 +3275,13 @@ var et2_nextmatch_accountfilterheader = et2_selectAccount.extend([et2_INextmatch
this.input.css("max-width",max + "px");
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_accountfilterheader, ['nextmatch-accountfilter']);
/**
* @augments et2_link_entry
*/
var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader,
var et2_nextmatch_entryheader = (function(){ "use strict"; return et2_link_entry.extend(et2_INextmatchHeader,
{
/**
* Override to add change handler
@ -3364,13 +3362,13 @@ var et2_nextmatch_entryheader = et2_link_entry.extend(et2_INextmatchHeader,
var self = this;
// Fire on lost focus, clear filter if user emptied box
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_entryheader, ['nextmatch-entryheader']);
/**
* @augments et2_nextmatch_filterheader
*/
var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend(
var et2_nextmatch_customfilter = (function(){ "use strict"; return et2_nextmatch_filterheader.extend(
{
attributes: {
"widget_type": {
@ -3447,5 +3445,5 @@ var et2_nextmatch_customfilter = et2_nextmatch_filterheader.extend(
return this.real_node.setNextmatch(_nextmatch);
}
}
});
});}).call(this);
et2_register_widget(et2_nextmatch_customfilter, ['nextmatch-customfilter']);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_common;
et2_core_inheritance;
@ -29,7 +27,7 @@
/**
* @augments et2_dataview_controller
*/
var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
var et2_nextmatch_controller = (function(){ "use strict"; return et2_dataview_controller.extend(et2_IDataProvider,
{
// Display constants
VIEW_ROW: 'row',
@ -301,7 +299,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
}
return egwActionObject.prototype.handleKeyPress.call(this, _keyCode,_shift,_ctrl,_alt);
}
}
this._objectManager.flags = this._objectManager.flags
| EGW_AO_FLAG_DEFAULT_FOCUS | EGW_AO_FLAG_IS_CONTAINER;
@ -333,12 +331,12 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
var drop_action = mgr.getActionById('egw_link_drop');
var drag_action = mgr.getActionById('egw_link_drag');
var drop_cancel = mgr.getActionById('egw_cancel_drop');
if(!this._actionLinks)
{
this._actionLinks = [];
}
if (!drop_cancel)
{
// Create a generic cancel action in order to cancel drop action
@ -348,7 +346,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
drop_cancel.acceptedTypes = drop_cancel.acceptedTypes.concat(Object.keys(egw.user('apps')).concat(['link', 'file']));
this._actionLinks.push (drop_cancel.id);
}
// Check if this app supports linking
if(!egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'query') ||
egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'title'))
@ -683,6 +681,6 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
// Overwritten in the constructor
}
});
});}).call(this);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:use
jquery.jquery;
et2_core_inheritance;
@ -24,7 +22,7 @@
*
* @augments Class
*/
var et2_dynheight = Class.extend(
var et2_dynheight = (function(){ "use strict"; return Class.extend(
{
/**
* Constructor for the dynheight object
@ -192,5 +190,5 @@ var et2_dynheight = Class.extend(
}
}
});
});}).call(this);

View File

@ -24,7 +24,7 @@
*
* @augments Class
*/
var et2_nextmatch_rowProvider = ClassWithAttributes.extend(
var et2_nextmatch_rowProvider = (function(){ "use strict"; return ClassWithAttributes.extend(
{
/**
* Creates the nextmatch row provider.
@ -536,12 +536,12 @@ var et2_nextmatch_rowProvider = ClassWithAttributes.extend(
}
}
});
});}).call(this);
/**
* @augments et2_widget
*/
var et2_nextmatch_rowWidget = et2_widget.extend(et2_IDOMNode,
var et2_nextmatch_rowWidget = (function(){ "use strict"; return et2_widget.extend(et2_IDOMNode,
{
/**
* Constructor
@ -604,12 +604,12 @@ var et2_nextmatch_rowWidget = et2_widget.extend(et2_IDOMNode,
return null;
}
});
});}).call(this);
/**
* @augments et2_widget
*/
var et2_nextmatch_rowTemplateWidget = et2_widget.extend(et2_IDOMNode,
var et2_nextmatch_rowTemplateWidget = (function(){ "use strict"; return et2_widget.extend(et2_IDOMNode,
{
/**
* Constructor
@ -670,5 +670,5 @@ var et2_nextmatch_rowTemplateWidget = et2_widget.extend(et2_IDOMNode,
return null;
}
});
});}).call(this);

View File

@ -11,8 +11,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -28,8 +26,8 @@
* 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 = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
'get_rows': {
@ -86,7 +84,7 @@ var et2_ajaxSelect = et2_inputWidget.extend(
/**
* Constructor
*
*
* @memberOf et2_ajaxSelect
*/
init: function(parent, attrs) {
@ -191,14 +189,14 @@ var et2_ajaxSelect = et2_inputWidget.extend(
this.input.removeAttr("placeholder");
}
}
});
});}).call(this);
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 = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Ignore all more advanced attributes.
@ -211,7 +209,7 @@ var et2_ajaxSelect_ro = et2_valueWidget.extend([et2_IDetachedDOM],
/**
* Constructor
*
*
* @memberOf et2_ajaxSelect_ro
*/
init: function() {
@ -250,6 +248,6 @@ var et2_ajaxSelect_ro = et2_valueWidget.extend([et2_IDetachedDOM],
this.set_value(_values["value"]);
}
}
});
});}).call(this);
et2_register_widget(et2_ajaxSelect_ro, ["ajax_select_ro"]);

View File

@ -10,8 +10,6 @@
* @version $Id:$
*/
"use strict";
/*egw:uses
jquery.jquery;
/phpgwapi/js/jquery/barcode/jquery-barcode.min.js;
@ -46,7 +44,7 @@
*
* @augments et2_baseWidget
*/
var et2_barcode = et2_valueWidget.extend(
var et2_barcode = (function(){ "use strict"; return et2_valueWidget.extend(
{
attributes : {
"code_type": {
@ -130,7 +128,7 @@ var et2_barcode = et2_valueWidget.extend(
{
return this.value;
}
});
});}).call(this);
et2_register_widget(et2_barcode, ["barcode"]);
// Static part of the class

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_baseWidget;
@ -22,7 +20,7 @@
*
* @augments et2_baseWidget
*/
var et2_box = et2_baseWidget.extend([et2_IDetachedDOM],
var et2_box = (function(){ "use strict"; return et2_baseWidget.extend([et2_IDetachedDOM],
{
attributes: {
// Not needed
@ -150,23 +148,23 @@ var et2_box = et2_baseWidget.extend([et2_IDetachedDOM],
}
}
});
});}).call(this);
et2_register_widget(et2_box, ["vbox", "box"]);
/**
* Details widget implementation
* widget name is "details" and can be use as a wrapping container
* in order to make its children collapsible.
*
*
* Note: details widget does not represent html5 "details" tag in DOM
*
*
* <details>
* <widgets>
* ....
* <details/>
*
*
*/
var et2_details = et2_box.extend(
var et2_details = (function(){ "use strict"; return et2_box.extend(
{
attributes:{
"toggle_align": {
@ -182,10 +180,10 @@ var et2_details = et2_box.extend(
default: ""
}
},
init: function() {
this._super.apply(this, arguments);
this.div = jQuery(document.createElement('div')).addClass('et2_details');
this.title = jQuery(document.createElement('span'))
.addClass('et2_label et2_details_title')
@ -196,28 +194,28 @@ var et2_details = et2_box.extend(
this.wrapper = jQuery(document.createElement('div'))
.addClass('et2_details_wrapper')
.appendTo(this.div);
this._createWidget();
},
/**
* Function happens on toggle action
*/
_toggle: function (){
this.div.toggleClass('et2_details_expanded');
},
/**
* Create widget, set contents, and binds handlers
*/
_createWidget: function () {
var self = this;
this.span.on('click', function (e){
self._toggle();
});
//Set header title
if (this.options.title)
{
@ -225,11 +223,11 @@ var et2_details = et2_box.extend(
.click (function(){self._toggle();})
.text(this.options.title);
}
// Align toggle button left/right
if (this.options.toggle_align === "left") this.span.css({float:'left'});
},
getDOMNode: function(_sender) {
if (!_sender || _sender === this)
{
@ -240,5 +238,5 @@ var et2_details = et2_box.extend(
return this.wrapper[0];
}
}
});
});}).call(this);
et2_register_widget(et2_details, ["details"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_interfaces;
@ -22,7 +20,7 @@
* Class which implements the "button" XET-Tag
* @augments et2_baseWidget
*/
var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM],
var et2_button = (function(){ "use strict"; return et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM],
{
attributes: {
"label": {
@ -406,7 +404,7 @@ var et2_button = et2_baseWidget.extend([et2_IInput, et2_IDetachedDOM],
return e.data.click.call(e.data,e);
});
}
});
});}).call(this);
et2_register_widget(et2_button, ["button", "buttononly"]);
// Static class stuff

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_inputWidget;
@ -23,7 +21,7 @@
*
* @augments et2_inputWidget
*/
var et2_checkbox = et2_inputWidget.extend(
var et2_checkbox = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"selected_value": {
@ -86,9 +84,9 @@ var et2_checkbox = et2_inputWidget.extend(
createInputWidget: function() {
this.input = $j(document.createElement("input")).attr("type", "checkbox");
this.input.addClass("et2_checkbox");
if (this.options.toggle_on || this.options.toggle_off)
{
var self = this;
@ -99,7 +97,7 @@ var et2_checkbox = et2_inputWidget.extend(
// update switch status on change
this.input.change(function(){
self.getValue();
return true;
return true;
});
// switch container
var area = jQuery(document.createElement('span')).addClass('slideSwitch_container').appendTo(this.toggle);
@ -109,7 +107,7 @@ var et2_checkbox = et2_inputWidget.extend(
var off = jQuery(document.createElement('span')).addClass('off').appendTo(area);
on.text(this.options.toggle_on);
off.text(this.options.toggle_off);
// handle a tag
var handle = jQuery(document.createElement('a')).appendTo(area);
this.setDOMNode(this.toggle[0]);
@ -118,11 +116,13 @@ var et2_checkbox = et2_inputWidget.extend(
{
this.setDOMNode(this.input[0]);
}
},
/**
* Override default to place checkbox before label, if there is no %s in the label
*
* @param {string} label
*/
set_label: function(label) {
if(label.length && label.indexOf('%s') < 0)
@ -134,6 +134,8 @@ var et2_checkbox = et2_inputWidget.extend(
},
/**
* Override default to match against set/unset value
*
* @param {string|boolean} _value
*/
set_value: function(_value) {
if(_value != this.value) {
@ -171,14 +173,14 @@ var et2_checkbox = et2_inputWidget.extend(
return this.options.unselected_value;
}
}
});
});}).call(this);
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 = (function(){ "use strict"; return et2_checkbox.extend(
{
/**
* Ignore unset value
@ -207,6 +209,8 @@ var et2_checkbox_ro = et2_checkbox.extend(
/**
* note: checkbox is checked if even there is a value but not only if the _value is only "true"
* it's an exceptional validation for cases that we pass non boolean values as checkbox _value
*
* @param {string|boolean} _value
*/
set_value: function(_value) {
if(_value == this.options.selected_value ||_value && this.options.selected_value == this.attributes.selected_value["default"] &&
@ -217,5 +221,5 @@ var et2_checkbox_ro = et2_checkbox.extend(
this.span.text(this.options.ro_false);
}
}
});
});}).call(this);
et2_register_widget(et2_checkbox_ro, ["checkbox_ro"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_inputWidget;
@ -24,7 +22,7 @@
*
* @augments et2_inputWidget
*/
var et2_color = et2_inputWidget.extend(
var et2_color = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"alphaSupport": {
@ -218,14 +216,14 @@ var et2_color = et2_inputWidget.extend(
}
}
}
});
});}).call(this);
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 = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Constructor
@ -271,7 +269,7 @@ var et2_color_ro = et2_valueWidget.extend([et2_IDetachedDOM],
this.set_value(_values["value"]);
}
}
});
});}).call(this);
et2_register_widget(et2_color_ro, ["colorpicker_ro"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -31,7 +29,7 @@
*
* @augments et2_inputWidget
*/
var et2_date = et2_inputWidget.extend(
var et2_date = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"value": {
@ -367,6 +365,8 @@ String: A string in the user\'s date format, or a relative date. Relative dates
/**
* Convert non html5 min or max attributes described above to timestamps
*
* @param {string|Date} _value
*/
_relativeDate: function(_value)
{
@ -594,13 +594,13 @@ String: A string in the user\'s date format, or a relative date. Relative dates
this.date.setSeconds(0,0);
return (this.date && typeof this.date.toJSON != 'undefined' && this.date.toJSON())?this.date.toJSON().replace(/\.\d{3}Z$/, 'Z'):this.date;
}
});
});}).call(this);
et2_register_widget(et2_date, ["date", "date-time", "date-timeonly"]);
/**
* @augments et2_date
*/
var et2_date_duration = et2_date.extend(
var et2_date_duration = (function(){ "use strict"; return et2_date.extend(
{
attributes: {
"data_format": {
@ -853,13 +853,13 @@ var et2_date_duration = et2_date.extend(
}
return value;
}
});
});}).call(this);
et2_register_widget(et2_date_duration, ["date-duration"]);
/**
* @augments et2_date_duration
*/
var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
var et2_date_duration_ro = (function(){ "use strict"; return et2_date_duration.extend([et2_IDetachedDOM],
{
/**
* @memberOf et2_date_duration_ro
@ -926,14 +926,14 @@ var et2_date_duration_ro = et2_date_duration.extend([et2_IDetachedDOM],
}
}
});
});}).call(this);
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 = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Ignore all more advanced attributes.
@ -1146,7 +1146,7 @@ var et2_date_ro = et2_valueWidget.extend([et2_IDetachedDOM],
this.span.addClass(_values["class"]);
}
}
});
});}).call(this);
et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date-time_today", "time_or_date", "date-timeonly_ro"]);
@ -1155,7 +1155,7 @@ et2_register_widget(et2_date_ro, ["date_ro", "date-time_ro", "date-since", "date
*
* @augments et2_inputWidget
*/
var et2_date_range = et2_inputWidget.extend({
var et2_date_range = (function(){ "use strict"; return et2_inputWidget.extend({
attributes: {
value: {
"type": "any",
@ -1189,7 +1189,7 @@ var et2_date_range = et2_inputWidget.extend({
this.setDOMNode(this.div[0]);
this._createWidget();
this.set_relative(this.options.relative || false)
this.set_relative(this.options.relative || false);
},
_createWidget: function createInputWidget() {
@ -1236,7 +1236,7 @@ var et2_date_range = et2_inputWidget.extend({
/**
* Toggles relative or absolute dates
*
*
* @param {boolean} _value
*/
set_relative: function set_relative(_value)
@ -1273,7 +1273,7 @@ var et2_date_range = et2_inputWidget.extend({
value = {
from: value[0],
to: value[1] || new Date().valueOf()/1000
}
};
}
else if (value && value.from && value.to)
{
@ -1286,7 +1286,7 @@ var et2_date_range = et2_inputWidget.extend({
{
return this.options.relative ?
this.select.getValue() :
{ from: this.from.getValue(), to: this.to.getValue() }
{ from: this.from.getValue(), to: this.to.getValue() };
},
_set_relative_value: function(_value)
@ -1319,14 +1319,14 @@ var et2_date_range = et2_inputWidget.extend({
}
if(relative)
{
var dates = ["from","to"]
var dates = ["from","to"];
var value = now.toJSON();
for(var i = 0; i < dates.length; i++)
{
var date = dates[i];
if(typeof relative[date] == "function")
{
value = relative[date](new Date(value))
value = relative[date](new Date(value));
}
else
{
@ -1336,7 +1336,7 @@ var et2_date_range = et2_inputWidget.extend({
}
}
}
});
});}).call(this);
et2_register_widget(et2_date_range, ["date-range"]);
// Static part of the date range class
jQuery.extend(et2_date_range,
@ -1412,7 +1412,7 @@ jQuery.extend(et2_date_range,
to: function(d) {
d.setUTCMonth(11);
d.setUTCDate(31);
return d
return d;
}
},
{
@ -1421,16 +1421,16 @@ jQuery.extend(et2_date_range,
from: function(d) {
d.setUTCMonth(0);
d.setUTCDate(1);
d.setUTCYear(d.getUTCYear() - 1)
d.setUTCYear(d.getUTCYear() - 1);
return d;
},
to: function(d) {
d.setUTCMonth(11);
d.setUTCDate(31);
d.setUTCYear(d.getUTCYear() - 1)
return d
d.setUTCYear(d.getUTCYear() - 1);
return d;
}
},
}
/* Still needed?
'2 years ago' => array(-2,0,0,0, -1,0,0,0),
'3 years ago' => array(-3,0,0,0, -2,0,0,0),

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_baseWidget;
@ -23,7 +21,7 @@
*
* @augments et2_baseWidget
*/
var et2_description = expose(et2_baseWidget.extend([et2_IDetachedDOM],
var et2_description = (function(){ "use strict"; return expose(et2_baseWidget.extend([et2_IDetachedDOM],
{
attributes: {
"label": {
@ -326,6 +324,6 @@ var et2_description = expose(et2_baseWidget.extend([et2_IDetachedDOM],
_nodes[0].setAttribute("class", _values["class"]);
}
}
}));
}));}).call(this);
et2_register_widget(et2_description, ["description", "label"]);

View File

@ -9,8 +9,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_widget;
jquery.jquery-ui;
@ -89,9 +87,8 @@
* @augments et2_widget
* @see http://api.jqueryui.com/dialog/
*/
var et2_dialog = et2_widget.extend({
var et2_dialog = (function(){ "use strict"; return et2_widget.extend(
{
attributes: {
callback: {
name: "Callback",
@ -457,11 +454,11 @@ var et2_dialog = et2_widget.extend({
close: jQuery.proxy(function() {this.destroy();},this)
});
}
});
});}).call(this);
et2_register_widget(et2_dialog, ["dialog"]);
// Static class stuff
jQuery.extend(et2_dialog,
jQuery.extend(et2_dialog, //(function(){ "use strict"; return
/** @lends et2_dialog */
{
// Some class constants //
@ -752,4 +749,5 @@ jQuery.extend(et2_dialog,
return dialog;
}
});
}//;}).call(this)
);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -22,20 +20,20 @@
/**
* Class that displays the diff between two [text] values
*
*
* @augments et2_valueWidget
*/
var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM],
*/
var et2_diff = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
"type": "any"
}
},
/**
* Constructor
*
*
* @memberOf et2_diff
*/
init: function() {
@ -103,7 +101,7 @@ var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM],
set_label: function(_label) {
this.options.label = _label;
},
/**
@ -127,7 +125,7 @@ var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM],
},
/**
* Code for implementing et2_IDetachedDOM
* Code for implementing et2_IDetachedDOM
* Fast-clonable read-only widget that only deals with DOM nodes, not the widget tree
*/
@ -169,5 +167,5 @@ var et2_diff = et2_valueWidget.extend([et2_IDetachedDOM],
this.set_value(_values['value']);
}
}
});
});}).call(this);
et2_register_widget(et2_diff, ["diff"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -32,7 +30,7 @@
*
* @augments et2_inputWidget
*/
var et2_dropdown_button = et2_inputWidget.extend(
var et2_dropdown_button = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"label": {
@ -398,6 +396,6 @@ var et2_dropdown_button = et2_inputWidget.extend(
getValue: function() {
return this.value;
}
});
});}).call(this);
et2_register_widget(et2_dropdown_button, ["dropdown_button"]);

View File

@ -1,4 +1,4 @@
/*
/*
* Egroupware etemplate2 JS Entry widget
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
@ -9,8 +9,6 @@
*/
"use strict";
/*egw:uses
et2_core_valueWidget;
*/
@ -29,7 +27,7 @@
*
* @augments et2_valueWidget
*/
var et2_entry = et2_valueWidget.extend(
var et2_entry = (function(){ "use strict"; return et2_valueWidget.extend(
{
attributes: {
field: {
@ -115,7 +113,7 @@ var et2_entry = et2_valueWidget.extend(
{
jQuery.extend(attrs, modifications.getEntry(attrs.id));
}
// Supress labels on templates
if(attrs.type == 'template' && this.options.label)
{
@ -155,8 +153,8 @@ var et2_entry = et2_valueWidget.extend(
widget.options.value = sum;
}
}
}
});
});}).call(this);
et2_register_widget(et2_entry, ["entry", 'contact-value', 'contact-account', 'contact-template', 'infolog-value','tracker-value','records-value']);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_dropdown_button;
et2_extension_nextmatch;
@ -44,7 +42,7 @@
*
* @augments et2_dropdown_button
*/
var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
var et2_favorites = (function(){ "use strict"; return et2_dropdown_button.extend([et2_INextmatchHeader],
{
attributes: {
"default_pref": {
@ -101,18 +99,18 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
}
// Store array of sorted items
this.favSortedList = ['blank'];
var apps = egw().user('apps');
this.is_admin = (typeof apps['admin'] != "undefined");
this.stored_filters = this.load_favorites(this.options.app);
this.preferred = egw.preference(this.options.default_pref,this.options.app);
if(!this.preferred || typeof this.stored_filters[this.preferred] == "undefined")
{
this.preferred = "blank";
}
// It helps to have the ID properly set before we get too far
this.set_id(this.id);
@ -151,33 +149,33 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
self.button.removeClass("ui-state-active",2000);
});
});
//Sort DomNodes of sidebox fav. menu
var sideBoxDOMNodeSort = function (_favSList) {
var favS = jQuery.isArray(_favSList)?_favSList.slice(0).reverse():[];
for (var i=0; i < favS.length;i++)
{
self.sidebox_target.children().find('[data-id$="' + favS[i] + '"]').prependTo(self.sidebox_target.children());
}
};
//Add Sortable handler to nm fav. menu
$j(this.menu).sortable({
items:'li:not([data-id$="add"])',
placeholder:'ui-fav-sortable-placeholder',
delay: 250, //(millisecond) delay before the sorting should start
update: function (event, ui)
{
self.favSortedList = jQuery(this).sortable('toArray', {attribute:'data-id'});
self.egw().set_preference(self.options.app,'fav_sort_pref',self.favSortedList);
sideBoxDOMNodeSort(self.favSortedList);
}
});
// Add a listener on the delete to remove
this.menu.on("click","div.ui-icon-trash", app[self.options.app], function() {
// App instance might not be ready yet, so don't bind directly
@ -195,7 +193,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
this.init_filters(this);
}
},
/**
* Load favorites from preferences
*
@ -210,7 +208,7 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
state: {}
}
};
// Load saved favorites
var preferences = egw.preference("*",app);
for(var pref_name in preferences)
@ -403,5 +401,5 @@ var et2_favorites = et2_dropdown_button.extend([et2_INextmatchHeader],
// Re-generate filter list so we can add 'Add current'
this.init_filters(this);
}
});
});}).call(this);
et2_register_widget(et2_favorites, ["favorites"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_inputWidget;
phpgwapi.Resumable.resumable;
@ -22,7 +20,7 @@
*
* @augments et2_inputWidget
*/
var et2_file = et2_inputWidget.extend(
var et2_file = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"multiple": {
@ -649,7 +647,7 @@ var et2_file = et2_inputWidget.extend(
target.remove();
$j(e.target).remove();
}
});
});}).call(this);
et2_register_widget(et2_file, ["file"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jsapi.jsapi;
jquery.jquery;
@ -33,7 +31,7 @@
* @see http://docs.dhtmlx.com/gantt/index.html
* @augments et2_valueWidget
*/
var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
var et2_gantt = (function(){ "use strict"; return et2_inputWidget.extend([et2_IResizeable,et2_IInput],
{
// Filters are inside gantt namespace
createNamespace: true,
@ -70,13 +68,13 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
onfocus: {ignore: true},
tabindex: {ignore: true}
},
// Common configuration for Egroupware/eTemplate
gantt_config: {
// Gantt takes a different format of date format, all the placeholders are prefixed with '%'
api_date: '%Y-%n-%d %H:%i:%s',
xml_date: '%Y-%n-%d %H:%i:%s',
// Duration is a unitless field. This is the unit.
duration_unit: 'minute',
duration_step: 1,
@ -98,7 +96,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
scale_unit: 'day',
date_scale: '%d',
subscales: [
{unit:"month", step:1, date:"%F, %Y"},
{unit:"month", step:1, date:"%F, %Y"}
//{unit:"hour", step:1, date:"%G"}
],
columns: [
@ -123,14 +121,14 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
this.htmlNode.prepend(this.filters);
this.htmlNode.append(this.gantt_node);
// Create the dynheight component which dynamically scales the inner
// container.
this.dynheight = new et2_dynheight(
this.getParent().getDOMNode(this.getParent()) || this.getInstanceManager().DOMContainer,
this.gantt_node, 300
);
this.setDOMNode(this.htmlNode[0]);
},
@ -142,12 +140,12 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
this.gantt.detachAllEvents();
this.gantt.clearAll();
this.gantt = null;
// Destroy dynamic full-height
if(this.dynheight) this.dynheight.free();
this._super.apply(this, arguments);}
this.htmlNode.remove();
this.htmlNode = null;
},
@ -181,7 +179,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
{
this.set_zoom(this.options.zoom);
}
if(this.options.value)
{
this.set_value(this.options.value);
@ -190,7 +188,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
{
this.set_columns(this.options.columns);
}
// Update start & end dates with chart values for consistency
if(start_date && this.options.value.data && this.options.value.data.length)
{
@ -261,9 +259,9 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
* Set the columns for the grid (left) portion
*
* @param {Object[]} columns - A list of columns
* @param {string} columns[].name The column's ID
* @param {string} columns[].label The title for the column header
* @param {string} columns[].width Width of the column
* columns[].name The column's ID
* columns[].label The title for the column header
* columns[].width Width of the column
*
* @see http://docs.dhtmlx.com/gantt/api__gantt_columns_config.html for full options
*/
@ -356,6 +354,8 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
* required data.
*
* @see http://docs.dhtmlx.com/gantt/desktop__loading.html
*
* @param {type} value
*/
set_value: function(value) {
if(this.gantt == null) return false;
@ -365,7 +365,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
// Clear previous value
this.gantt.clearAll();
// Clear the end date, or previous end date may break time scale
this.gantt.config.end_date = null;
@ -392,7 +392,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
this.config.start_date = value.start_date || null;
this.config.end_date = value.end_date || null;
this.parse(safe_value);
gantt_widget._apply_sort();
gantt_widget.gantt_loading = false;
// Once we force the start / end date (below), gantt won't recalculate
@ -520,8 +520,8 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
this.gantt.deleteTask(_task_ids[i]);
break;
case "add":
var data = null;
if(data = this.egw().dataGetUIDdata(_task_ids[i]) && data.data)
var data = this.egw().dataGetUIDdata(_task_ids[i]) && data.data;
if(data)
{
this.gantt.parse(data.data);
this._apply_sort();
@ -572,12 +572,14 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
*
* @return {boolean} True if the value is valid (enough), false to fail
*/
isValid: function(messages) {return true},
isValid: function(messages) {return true;},
/**
* Set a URL to fetch the data from the server.
* Data must be in the specified format.
* @see http://docs.dhtmlx.com/gantt/desktop__loading.html
*
* @param {string} url
*/
set_autoload: function(url) {
if(this.gantt == null) return false;
@ -683,7 +685,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
this.gantt.config.min_column_width = min_column_width;
this.options.zoom = level;
this.gantt.refreshData();
return level;
},
@ -735,7 +737,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
var options = {
name: (w.gantt.getTask(w.gantt._order[0]).text||'gantt').replace(/ /g,'_')+'.'+to.toLowerCase(),
header: css + egw.config('site_title','phpgwapi'),
footer: $j('#egw_fw_footer',w.opener).html(),
footer: $j('#egw_fw_footer',w.opener).html()
// Doesn't work, export never happens:
// callback: function() {w.setTimeout(function() {w.close();}, 5000);}
};
@ -782,7 +784,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
gantt_widget.resize();
},100);
});
// Click on scale to zoom - top zooms out, bottom zooms in
this.gantt_node.on('click','.gantt_scale_line', function(e) {
var current_position = e.target.offsetLeft / $j(e.target.parentNode).width();
@ -796,7 +798,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
gantt_widget.gantt.scrollTo(parseInt($j('.gantt_task_scale',gantt_widget.gantt_node).width() *current_position),0);
},100);
});
if(this.parentNode && this.parentNode.firstChild == this && this.parentNode.childElementCount > 1)
{
// Zoom out
@ -831,11 +833,11 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
}
else if (linkId)
{
this._delete_link_handler(linkId,e)
this._delete_link_handler(linkId,e);
e.stopPropagation();
}
return false;
})
});
// Double click
this.gantt.attachEvent("onBeforeLightbox", function(id) {
gantt_widget._link_task(id);
@ -861,7 +863,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
var date_parser = this.date.date_to_str(this.config.api_date);
if(task.start_date) task.start_date = date_parser(task.start_date);
if(task.end_date) task.end_date = date_parser(task.end_date);
var value = gantt_widget.getInstanceManager().getValues(gantt_widget.getInstanceManager().widgetContainer);
var set = true;
@ -1006,6 +1008,8 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
/**
* Start UI for selecting among defined columns
*
* @param {type} e
*/
_column_selection: function(e)
{
@ -1018,7 +1022,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
columns.push({
value: col.name,
label: col.label
})
});
if(!col.hide)
{
columns_selected.push(col.name);
@ -1135,7 +1139,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
* Bind a single task as needed to the action system. This is instead of binding
* every single task at the start.
*
* @param {string} taskId
* @param {string} taskId
*/
_link_task: function(taskId)
{
@ -1146,15 +1150,19 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
{
obj = objectManager.addObject(taskId, this.dhtmlxGanttItemAOI(this.gantt,taskId));
obj.data = this.gantt.getTask(taskId);
obj.updateActionLinks(objectManager.actionLinks)
obj.updateActionLinks(objectManager.actionLinks);
}
objectManager.setAllSelected(false);
obj.setSelected(true);
objectManager.updateSelectedChildren(obj,true)
objectManager.updateSelectedChildren(obj,true);
},
/**
* ActionObjectInterface for gantt chart
*
* @param {type} gantt
* @param {type} task_id
* @returns {egwActionObjectInterface|et2_widget_gantt_L34.et2_widget_ganttAnonym$1.dhtmlxGanttItemAOI.aoi}
*/
dhtmlxGanttItemAOI: function(gantt, task_id)
{
@ -1165,7 +1173,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
aoi.id = task_id;
aoi.doGetDOMNode = function() {
return aoi.node;
}
};
aoi.doTriggerEvent = function(_event) {
if (_event == EGW_AI_DRAG_OVER)
@ -1176,7 +1184,7 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
{
$j(this.node).removeClass("draggedOver");
}
}
};
aoi.doSetState = function(_state) {
if(!gantt || !gantt.isTaskExists(this.id)) return;
@ -1189,12 +1197,12 @@ var et2_gantt = et2_inputWidget.extend([et2_IResizeable,et2_IInput],
{
gantt.unselectTask(this.id);
}
}
};
return aoi;
}
});
});}).call(this);
et2_register_widget(et2_gantt, ["gantt"]);
/**
@ -1203,12 +1211,15 @@ et2_register_widget(et2_gantt, ["gantt"]);
// Localize to user's language - breaks if file is not there
//egw.includeJS("/phpgwapi/js/dhtmlxGantt/codebase/locale/locale_" + egw.preference('lang') + ".js");
$j(function() {
$j(function()
{
"use strict";
// Set icon to match application
gantt.templates.grid_file = function(item) {
if(!item.pe_icon || !egw.image(item.pe_icon)) return "<div class='gantt_tree_icon gantt_file'></div>";
return "<div class='gantt_tree_icon' style='background-image: url(\"" + egw.image(item.pe_icon) + "\");'/></div>";
}
};
// CSS for scale row, turns on clickable
gantt.templates.scale_row_class = function(scale) {
@ -1217,7 +1228,7 @@ $j(function() {
return scale.class || 'et2_clickable';
}
return scale.class;
}
};
// Include progress text in the bar
gantt.templates.progress_text = function(start, end, task) {
@ -1232,7 +1243,7 @@ $j(function() {
};
gantt.templates.task_cell_class = function(item,date){
if(date.getDay()==0||date.getDay()==6){
return "weekend"
return "weekend";
}
};
@ -1272,7 +1283,7 @@ $j(function() {
switch (link.type)
{
case types.finish_to_start:
valid = (source.end_date <= target.start_date)
valid = (source.end_date <= target.start_date);
break;
case types.start_to_start:
valid = (source.start_date <= target.start_date);
@ -1281,12 +1292,12 @@ $j(function() {
valid = (source.end_date >= target.end_date);
break;
case types.start_to_finish:
valid = (source.start_date >= target.end_date)
valid = (source.start_date >= target.end_date);
break;
}
link_class += valid ? '' : 'invalid_constraint';
return link_class;
}
};
});

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_DOMWidget;
@ -26,7 +24,7 @@
*
* @augments et2_DOMWidget
*/
var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned, et2_IResizeable],
var et2_grid = (function(){ "use strict"; return et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned, et2_IResizeable],
{
createNamespace: true,
@ -1070,5 +1068,5 @@ var et2_grid = et2_DOMWidget.extend([et2_IDetachedDOM, et2_IAligned, et2_IResize
}
}
}
});
});}).call(this);
et2_register_widget(et2_grid, ["grid"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_baseWidget;
*/
@ -21,7 +19,7 @@
*
* @augments et2_baseWidget
*/
var et2_groupbox = et2_baseWidget.extend(
var et2_groupbox = (function(){ "use strict"; return et2_baseWidget.extend(
{
/**
* Constructor
@ -33,13 +31,13 @@ var et2_groupbox = et2_baseWidget.extend(
this.setDOMNode(document.createElement("fieldset"));
}
});
});}).call(this);
et2_register_widget(et2_groupbox, ["groupbox"]);
/**
* @augments et2_baseWidget
*/
var et2_groupbox_legend = et2_baseWidget.extend(
var et2_groupbox_legend = (function(){ "use strict"; return et2_baseWidget.extend(
{
attributes: {
"label": {
@ -62,5 +60,5 @@ var et2_groupbox_legend = et2_baseWidget.extend(
var legend = jQuery(document.createElement("legend")).text(this.options.label);
this.setDOMNode(legend[0]);
}
});
});}).call(this);
et2_register_widget(et2_groupbox_legend, ["caption"]);

View File

@ -10,8 +10,6 @@
* @version $Id: et2_box.js 36147 2011-08-16 13:12:39Z igel457 $
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_baseWidget;
@ -22,7 +20,7 @@
*
* @augments et2_baseWidget
*/
var et2_hbox = et2_baseWidget.extend(
var et2_hbox = (function(){ "use strict"; return et2_baseWidget.extend(
{
createNamespace: true,
@ -184,6 +182,6 @@ var et2_hbox = et2_baseWidget.extend(
jQuery(child.getDOMNode(child)).css("display", "inline-table");
}
}
});
});}).call(this);
et2_register_widget(et2_hbox, ["hbox"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -31,7 +29,7 @@
*
* @augments et2_valueWidget
*/
var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable],
var et2_historylog = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable],
{
createNamespace: true,
attributes: {
@ -104,7 +102,7 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable],
e.data.history.dataview.resize(_w, _h);
});
});
if (typeof e.data.history.dataview == "undefined") e.data.history.finishInit();
e.data.history.dynheight.update(function(_w, _h) {
e.data.history.dataview.resize(_w, _h);
@ -449,6 +447,11 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable],
* The row callback gets called by the gridview controller whenever
* the actual DOM-Nodes for a node with the given data have to be
* created.
*
* @param {type} _data
* @param {type} _row
* @param {type} _idx
* @param {type} _entry
*/
rowCallback: function(_data, _row, _idx, _entry) {
var tr = _row.getDOMNode();
@ -546,6 +549,10 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable],
/**
* How to tell if the row needs a diff widget or not
*
* @param {string} columnName
* @param {string} value
* @returns {Boolean}
*/
_needsDiffWidget: function(columnName, value) {
if(typeof value !== "string")
@ -570,12 +577,12 @@ var et2_historylog = et2_valueWidget.extend([et2_IDataProvider,et2_IResizeable],
// then add the default height with excess_height
if (this.div.height() == 0) _height += 250;
this.div.height(this.div.height() + _height);
// trigger the history registered resize
// in order to update the height with new value
this.div.trigger('resize.' +this.options.value.app + this.options.value.id);
}
}
}
});
});}).call(this);
et2_register_widget(et2_historylog, ['historylog']);

View File

@ -10,22 +10,20 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_baseWidget;
*/
/**
* Class which implements the hrule tag
*
*
* @augments et2_baseWidget
*/
var et2_hrule = et2_baseWidget.extend(
*/
var et2_hrule = (function(){ "use strict"; return et2_baseWidget.extend(
{
/**
* Constructor
*
*
* @memberOf et2_hrule
*/
init: function() {
@ -33,6 +31,6 @@ var et2_hrule = et2_baseWidget.extend(
this.setDOMNode(document.createElement("hr"));
}
});
});}).call(this);
et2_register_widget(et2_hrule, ["hrule"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jsapi.jsapi; // Needed for egw_seperateJavaScript
jquery.jquery;
@ -21,7 +19,7 @@
/**
* @augments et2_valueWidget
*/
var et2_html = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_html = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
'label': {
@ -112,6 +110,6 @@ var et2_html = et2_valueWidget.extend([et2_IDetachedDOM],
}
}
});
});}).call(this);
et2_register_widget(et2_html, ["html","htmlarea_ro"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jsapi.jsapi; // Needed for egw_seperateJavaScript
jquery.jquery;
@ -24,7 +22,7 @@
/**
* @augments et2_inputWidget
*/
var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable],
var et2_htmlarea = (function(){ "use strict"; return et2_inputWidget.extend([et2_IResizeable],
{
modes: ['ascii','simple','extended','advanced'],
@ -193,10 +191,10 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable],
editor.document.$.body.innerHTML = replaceImgText(editor.document.$.body.innerHTML);
},200);
}
// Supported file types for dropping on CKEditor imageUpload plugin
var supportedTypesByCKEditor = /image\/(jpeg|png|gif)/;
// Try to pass the image into the first et2_file that will accept it
if(e.data.$.dataTransfer && !CKEDITOR.fileTools.isTypeSupported(e.data.$.dataTransfer.files[0],supportedTypesByCKEditor))
{
@ -311,6 +309,6 @@ var et2_htmlarea = et2_inputWidget.extend([et2_IResizeable],
}
}
}
});
});}).call(this);
et2_register_widget(et2_htmlarea, ["htmlarea"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_valueWidget;
*/
@ -19,7 +17,7 @@
/**
* @augments et2_valueWidget
*/
var et2_iframe = et2_valueWidget.extend(
var et2_iframe = (function(){ "use strict"; return et2_valueWidget.extend(
{
attributes: {
'label': {
@ -56,7 +54,7 @@ var et2_iframe = et2_valueWidget.extend(
/**
* Constructor
*
*
* @memberOf et2_iframe
*/
init: function() {
@ -79,7 +77,7 @@ var et2_iframe = et2_valueWidget.extend(
/**
* Set name of iframe (to be used as target for links)
*
*
* @param _name
*/
set_name: function(_name) {
@ -152,5 +150,5 @@ var et2_iframe = et2_valueWidget.extend(
set_srcdoc: function(_value) {
this.htmlNode.attr("srcdoc", _value);
}
});
});}).call(this);
et2_register_widget(et2_iframe, ["iframe"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_interfaces;
@ -24,7 +22,7 @@
*
* @augments et2_baseWidget
*/
var et2_image = expose(et2_baseWidget.extend([et2_IDetachedDOM],
var et2_image = (function(){ "use strict"; return expose(et2_baseWidget.extend([et2_IDetachedDOM],
{
attributes: {
"src": {
@ -168,7 +166,7 @@ var et2_image = expose(et2_baseWidget.extend([et2_IDetachedDOM],
{
egw.open_link(href,target,popup);
}
e.preventDefault();
return false;
});
@ -217,7 +215,7 @@ var et2_image = expose(et2_baseWidget.extend([et2_IDetachedDOM],
}
return false;
},
/**
* Function to get media content to feed the expose
* @param {type} _value
@ -238,7 +236,7 @@ var et2_image = expose(et2_baseWidget.extend([et2_IDetachedDOM],
}
return mediaContent;
},
/**
* Implementation of "et2_IDetachedDOM" for fast viewing in gridview
*
@ -272,14 +270,14 @@ var et2_image = expose(et2_baseWidget.extend([et2_IDetachedDOM],
this.set_href(_values["href"]);
}
}
}));
}));}).call(this);
et2_register_widget(et2_image, ["image"]);
/**
* Widget displaying an application icon
*/
var et2_appicon = et2_image.extend(
var et2_appicon = (function(){ "use strict"; return et2_image.extend(
{
attributes: {
default_src: {
@ -297,5 +295,5 @@ var et2_appicon = et2_image.extend(
this._super.call(this, _app == 'sitemgr-link' ? 'sitemgr/sitemgr-link' : // got removed from jdots
(this.egw().app(_app, 'icon_app') || _app)+'/'+(this.egw().app(_app, 'icon') || 'navbar'));
}
});
});}).call(this);
et2_register_widget(et2_appicon, ["appicon"]);

View File

@ -13,8 +13,6 @@
* @version $Id: et2_widget_itempicker.js 38623 2012-03-26 23:27:53Z jaytraxx $
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_inputWidget;
@ -25,10 +23,10 @@
/**
* Class which implements the "itempicker" XET-Tag
*
*
* @augments et2_inputWidget
*/
var et2_itempicker = et2_inputWidget.extend(
*/
var et2_itempicker = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"action": {
@ -66,7 +64,7 @@ var et2_itempicker = et2_inputWidget.extend(
"type": "any",
"default": false,
"description": "Callback before query to server. Must return true, or false to abort query."
},
}
},
legacyOptions: ["application"],
@ -78,7 +76,7 @@ var et2_itempicker = et2_inputWidget.extend(
/**
* Constructor
*
*
* @memberOf et2_itempicker
*/
init: function() {
@ -92,7 +90,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.search = null;
this.button_action = null;
this.itemlist = null;
if(this.options.action !== null && typeof this.options.action == "string")
{
this.action = new egwFnct(this, "javaScript:" + this.options.action);
@ -104,7 +102,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.createInputWidget();
},
clearSearchResults: function() {
this.search.val("");
this.itemlist.html("");
@ -114,7 +112,7 @@ var et2_itempicker = et2_inputWidget.extend(
createInputWidget: function() {
var _self = this;
this.div = $j(document.createElement("div"));
this.left = $j(document.createElement("div"));
this.right = $j(document.createElement("div"));
@ -123,13 +121,13 @@ var et2_itempicker = et2_inputWidget.extend(
this.search = $j(document.createElement("input"));
this.clear = $j(document.createElement("span"));
this.itemlist = $j(document.createElement("div"));
// Container elements
this.div.addClass("et2_itempicker");
this.left.addClass("et2_itempicker_left");
this.right.addClass("et2_itempicker_right");
this.right_container.addClass("et2_itempicker_right_container");
// Application select
this.app_select.addClass("et2_itempicker_app_select");
var item_count = 0;
@ -140,7 +138,7 @@ var et2_itempicker = et2_inputWidget.extend(
}
var img = $j(document.createElement("img"));
img.attr("src", img_icon);
var item = $j(document.createElement("li"))
var item = $j(document.createElement("li"));
item.attr("id", key)
.click(function() {
_self.selectApplication($j(this));
@ -152,7 +150,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.app_select.append(item);
item_count++;
}
// Search input field
this.search.addClass("et2_itempicker_search");
this.search.keyup(function() {
@ -161,7 +159,7 @@ var et2_itempicker = et2_inputWidget.extend(
_self.query(request);
});
this.set_blur(this.options.blur, this.search);
// Clear button for search
this.clear
.addClass("et2_itempicker_clear ui-icon ui-icon-close")
@ -169,17 +167,17 @@ var et2_itempicker = et2_inputWidget.extend(
_self.clearSearchResults();
})
.hide();
// Action button
this.button_action = et2_createWidget("button");
$j(this.button_action.getDOMNode()).addClass("et2_itempicker_button_action");
this.button_action.set_label(this.egw().lang(this.options.action_label));
this.button_action.click = function() { _self.doAction(); };
// Itemlist
this.itemlist.attr("id", "itempicker_itemlist");
this.itemlist.addClass("et2_itempicker_itemlist");
// Put everything together
this.left.append(this.app_select);
this.right_container.append(this.search);
@ -187,12 +185,12 @@ var et2_itempicker = et2_inputWidget.extend(
this.right_container.append(this.button_action.getDOMNode());
this.right_container.append(this.itemlist);
this.right.append(this.right_container);
this.div.append(this.right); // right before left to have a natural
this.div.append(this.right); // right before left to have a natural
this.div.append(this.left); // z-index for left div over right div
this.setDOMNode(this.div[0]);
},
doAction: function()
{
if(this.action !== null)
@ -203,19 +201,19 @@ var et2_itempicker = et2_inputWidget.extend(
data.checked = this.getSelectedItems();
return this.action.exec(this, data);
}
return false;
},
getSelectedItems: function()
{
var items = [];
$j(this.itemlist).children("ul").children("li.selected").each(function(index) {
items[index] = $j(this).attr("id");
items[index] = $j(this).attr("id");
});
return items;
},
/**
* Ask server for entries matching selected app/type and filtered by search string
*/
@ -238,13 +236,13 @@ var et2_itempicker = et2_inputWidget.extend(
this.itemlist.addClass("loading");
this.clear.css("display", "inline-block");
egw._json("etemplate_widget_itempicker::ajax_item_search::etemplate",
egw._json("etemplate_widget_itempicker::ajax_item_search::etemplate",
[this.current_app, '', request.term, request.options],
this.queryResults,
this,true,this
).sendRequest();
},
/**
* Server found some results for query
*/
@ -252,7 +250,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.itemlist.removeClass("loading");
this.updateItemList(data);
},
selectApplication: function(app) {
this.clearSearchResults();
$j(".et2_itempicker_app_select li").removeClass("selected");
@ -260,7 +258,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.current_app = app.attr("id");
return true;
},
set_blur: function(_value, input) {
if(typeof input == 'undefined') input = this.search;
@ -282,7 +280,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.search.removeAttr("placeholder");
}
},
transformAttributes: function(_attrs) {
this._super.apply(this, arguments);
@ -305,7 +303,7 @@ var et2_itempicker = 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
@ -314,7 +312,7 @@ var et2_itempicker = et2_inputWidget.extend(
_attrs["select_options"] = {};
}
},
updateItemList: function(data) {
var list = $j(document.createElement("ul"));
var item_count = 0;
@ -363,7 +361,7 @@ var et2_itempicker = et2_inputWidget.extend(
this.itemlist.html(list);
}
});
});}).call(this);
et2_register_widget(et2_itempicker, ["itempicker"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -27,7 +25,7 @@
*
* @augments et2_inputWidget
*/
var et2_link_to = et2_inputWidget.extend(
var et2_link_to = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"only_app": {
@ -422,13 +420,13 @@ var et2_link_to = et2_inputWidget.extend(
}
this.options.no_files = no_files;
}
});
});}).call(this);
et2_register_widget(et2_link_to, ["link-to"]);
/**
* @augments et2_selectbox
*/
var et2_link_apps = et2_selectbox.extend(
var et2_link_apps = (function(){ "use strict"; return et2_selectbox.extend(
{
attributes: {
"only_app": {
@ -492,13 +490,13 @@ var et2_link_apps = et2_selectbox.extend(
_attrs.select_options = select_options;
this._super.apply(this, arguments);
}
});
});}).call(this);
et2_register_widget(et2_link_apps, ["link-apps"]);
/**
* @augments et2_inputWidget
*/
var et2_link_entry = et2_inputWidget.extend(
var et2_link_entry = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"value": {
@ -890,7 +888,7 @@ var et2_link_entry = et2_inputWidget.extend(
/**
* Set the query callback
*
* @param {function} query
* @param {function} f
*/
set_query: function(f)
{
@ -900,7 +898,7 @@ var et2_link_entry = et2_inputWidget.extend(
/**
* Set the select callback
*
* @param {function} query
* @param {function} f
*/
set_select: function(f)
{
@ -1030,7 +1028,7 @@ var et2_link_entry = et2_inputWidget.extend(
if(values.id) {
links.push({
app: values.app,
id: values.id,
id: values.id
});
self.search.val("");
}
@ -1062,7 +1060,7 @@ var et2_link_entry = et2_inputWidget.extend(
delete this.options.value.id;
}
}
});
});}).call(this);
et2_register_widget(et2_link_entry, ["link-entry"]);
/**
@ -1070,7 +1068,7 @@ et2_register_widget(et2_link_entry, ["link-entry"]);
*
* @augments et2_valueWidget
*/
var et2_link = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_link = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"only_app": {
@ -1235,7 +1233,7 @@ var et2_link = et2_valueWidget.extend([et2_IDetachedDOM],
if(typeof _values["value"] !== "undefined") this.set_value(_values["value"]);
}
});
});}).call(this);
et2_register_widget(et2_link, ["link", "link-entry_ro"]);
/**
@ -1243,7 +1241,7 @@ et2_register_widget(et2_link, ["link", "link-entry_ro"]);
*
* @augments et2_valueWidget
*/
var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
var et2_link_string = (function(){ "use strict"; return expose(et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"application": {
@ -1273,7 +1271,7 @@ var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
type: "boolean",
default: true,
description: "Clicking on description with href value would popup an expose view, and will show content referenced by href."
},
}
},
/**
@ -1367,7 +1365,7 @@ var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
type: _value.type,
poster:'', // TODO: Should be changed by correct video thumbnail later
href: base_url + egw().mime_open(_value),
download_href: base_url + egw().mime_open(_value) + '?download',
download_href: base_url + egw().mime_open(_value) + '?download'
}];
}
else if(_value)
@ -1376,7 +1374,7 @@ var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
title: _value.id,
href: base_url + egw().mime_open(_value).url,
download_href: base_url + egw().mime_open(_value).url + '?download',
type: _value.type,
type: _value.type
}];
}
if (mediaContent[0].href && mediaContent[0].href.match(/\/webdav.php/,'ig')) mediaContent[0]["download_href"] = mediaContent[0].href + '?download';
@ -1388,7 +1386,7 @@ var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
.appendTo(this.list)
.addClass("et2_link loading")
.click( function(e){
if (self.options.expose_view && typeof _link_data.type !='undefined'
if (self.options.expose_view && typeof _link_data.type !='undefined'
&& _link_data.type.match(self.mime_regexp,'ig'))
{
self._init_blueimp_gallery(e, _link_data);
@ -1473,7 +1471,7 @@ var et2_link_string = expose(et2_valueWidget.extend([et2_IDetachedDOM],
this._labelContainer.contents().not(this.list).remove();
}
}
}));
}));}).call(this);
et2_register_widget(et2_link_string, ["link-string"]);
/**
@ -1481,7 +1479,7 @@ et2_register_widget(et2_link_string, ["link-string"]);
*
* @augments et2_link_string
*/
var et2_link_list = et2_link_string.extend(
var et2_link_list = (function(){ "use strict"; return et2_link_string.extend(
{
attributes: {
"show_deleted": {
@ -1602,7 +1600,7 @@ var et2_link_list = et2_link_string.extend(
window.location = url+"?download";
return false;
}
// Multiple file download for those that support it
a = $j(a)
.prop('href', url)
@ -1615,7 +1613,7 @@ var et2_link_list = et2_link_string.extend(
a.remove();
return false;
}
self.egw().open(link_data, "", "view",'download',link_data.target ? link_data.target : link_data.app,link_data.app);
});
this.context.addItem("zip", this.egw().lang("Save as Zip"), this.egw().image('save_zip'), function(menu_item) {
@ -1767,7 +1765,7 @@ var et2_link_list = et2_link_string.extend(
{
this._format_vfs($td, dirs, _link_data);
}
//Bind the click handler if there is download_url
//Bind the click handler if there is download_url
if (_link_data && (typeof _link_data.download_url != 'undefined' || _link_data.app !='egw-data'))
{
$td.click( function(){
@ -1781,7 +1779,7 @@ var et2_link_list = et2_link_string.extend(
{
self.egw().open(_link_data, "", "view",null,_link_data.target ? _link_data.target : _link_data.app,_link_data.app);
}
});
});
}
}
@ -1841,7 +1839,7 @@ var et2_link_list = et2_link_string.extend(
self.context.getItem("zip").set_enabled($j('[id^="link_-"]',this.list).length >= 2);
// Show delete item only if the widget is not readonly
self.context.getItem("delete").set_enabled(!self.options.readonly);
self.context.data = _link_data;
self.context.showAt(e.pageX, e.pageY, true);
e.preventDefault();
@ -1899,7 +1897,7 @@ var et2_link_list = et2_link_string.extend(
self.list.append(div);
event.dataTransfer.setDragImage(div.get(0),0,0)
event.dataTransfer.setDragImage(div.get(0),0,0);
})
.on('drag', function() {
$j('#drag_helper',self.list).remove();
@ -2007,7 +2005,7 @@ var et2_link_list = et2_link_string.extend(
$td.html('<span style="display: inline-block; width:'+span_size+'ex;">'+dirs.join('/')+':</span> - ' + filename);
}
}
});
});}).call(this);
et2_register_widget(et2_link_list, ["link-list"]);
@ -2016,7 +2014,7 @@ et2_register_widget(et2_link_list, ["link-list"]);
*
* @augments et2_inputWidget
*/
var et2_link_add = et2_inputWidget.extend(
var et2_link_add = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"value": {
@ -2074,5 +2072,5 @@ var et2_link_add = et2_inputWidget.extend(
getValue: function() {
return null;
}
});
});}).call(this);
et2_register_widget(et2_link_add, ["link-add"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_widget_textbox;
*/
@ -21,7 +19,7 @@
*
* @augments et2_textbox
*/
var et2_number = et2_textbox.extend(
var et2_number = (function(){ "use strict"; return et2_textbox.extend(
{
attributes: {
"value": {
@ -142,7 +140,7 @@ var et2_number = et2_textbox.extend(
this.input.attr("max",this.max);
}
}
});
});}).call(this);
et2_register_widget(et2_number, ["int", "integer", "float"]);
/**
@ -151,7 +149,7 @@ et2_register_widget(et2_number, ["int", "integer", "float"]);
* @augments et2_textbox_ro
* @class
*/
var et2_number_ro = et2_textbox_ro.extend(
var et2_number_ro = (function(){ "use strict"; return et2_textbox_ro.extend(
{
attributes: {
min: { ignore: true},
@ -173,5 +171,5 @@ var et2_number_ro = et2_textbox_ro.extend(
}
this._super.call(this, _value);
}
});
});}).call(this);
et2_register_widget(et2_number_ro, ["int_ro", "integer_ro", "float_ro"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_baseWidget;
@ -22,13 +20,13 @@
*
* This manages the frame and decoration, but also provides the UI for properties.
*
* Portlets are only internal to EGroupware.
* Portlets are only internal to EGroupware.
*
* Home does not fully implement WSRP, but tries not to conflict, ether.
* @link http://docs.oasis-open.org/wsrp/v2/wsrp-2.0-spec-os-01.html
* @augments et2_baseWidget
*/
var et2_portlet = et2_valueWidget.extend(
var et2_portlet = (function(){ "use strict"; return et2_valueWidget.extend(
{
attributes: {
"title": {
@ -100,7 +98,7 @@ var et2_portlet = et2_valueWidget.extend(
/**
* Constructor
*
*
* @memberOf et2_portlet
*/
init: function()
@ -108,7 +106,7 @@ var et2_portlet = et2_valueWidget.extend(
this._super.apply(this, arguments);
var self = this;
// Create DOM nodes
this.div = $j(document.createElement("div"))
.addClass(this.options.class)
@ -203,7 +201,7 @@ var et2_portlet = et2_valueWidget.extend(
*
* @param Object[ {ID: attributes..}+] as for set_actions
*/
_link_actions: function(actions)
_link_actions: function(actions)
{
// Get the top level element
var objectManager = egw_getAppObjectManager(true);
@ -212,7 +210,7 @@ var et2_portlet = et2_valueWidget.extend(
// Add a new container to the object manager which will hold the widget
// objects
widget_object = objectManager.insertObject(false, new egwActionObject(
this.id, objectManager, new et2_action_object_impl(this),
this.id, objectManager, new et2_action_object_impl(this),
this._actionManager || objectManager.manager.getActionById(this.id) || objectManager.manager
));
}
@ -266,7 +264,7 @@ var et2_portlet = et2_valueWidget.extend(
{
if(button_id != et2_dialog.OK_BUTTON) return;
// Save settings - server might reply with new content if the portlet needs an update,
// but ideally it doesn't
this.div.addClass("loading");
@ -372,7 +370,7 @@ var et2_portlet = et2_valueWidget.extend(
/**
* Set the number of grid cells this widget spans
*
*
* @param value int Number of horizontal grid cells
*/
set_width: function(value)
@ -382,10 +380,10 @@ var et2_portlet = et2_valueWidget.extend(
// Clear what's there from jQuery, we get width from CSS according to sizex
this.div.css('width','');
},
/**
* Set the number of vertical grid cells this widget spans
*
*
* @param value int Number of vertical grid cells
*/
set_height: function(value)
@ -395,6 +393,6 @@ var et2_portlet = et2_valueWidget.extend(
// Clear what's there from jQuery, we get width from CSS according to sizey
this.div.css('height','');
}
});
});}).call(this);
et2_register_widget(et2_portlet, ["portlet"]);

View File

@ -9,8 +9,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_interfaces;
@ -22,7 +20,7 @@
*
* @augments et2_valueWidget
*/
var et2_progress = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_progress = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"href": {
@ -181,5 +179,5 @@ var et2_progress = et2_valueWidget.extend([et2_IDetachedDOM],
this.set_href(_values["href"]);
}
}
});
});}).call(this);
et2_register_widget(et2_progress, ["progress"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_inputWidget;
@ -26,7 +24,7 @@
*
* @augments et2_inputWidget
*/
var et2_radiobox = et2_inputWidget.extend(
var et2_radiobox = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"set_value": {
@ -138,6 +136,9 @@ var et2_radiobox = et2_inputWidget.extend(
/**
* Overridden from parent so if it's required, only 1 in a group needs a value
*
* @param {array} messages
* @returns {Boolean}
*/
isValid: function(messages) {
var ok = true;
@ -153,14 +154,14 @@ var et2_radiobox = et2_inputWidget.extend(
}
}
return ok;
},
});
}
});}).call(this);
et2_register_widget(et2_radiobox, ["radio"]);
/**
* @augments et2_valueWidget
*/
var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_radiobox_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"set_value": {
@ -245,7 +246,7 @@ var et2_radiobox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
this.span = jQuery(_nodes[0]);
this.set_value(_values["value"]);
}
});
});}).call(this);
et2_register_widget(et2_radiobox_ro, ["radio_ro"]);
@ -254,7 +255,7 @@ et2_register_widget(et2_radiobox_ro, ["radio_ro"]);
*
* @augments et2_valueWidget
*/
var et2_radioGroup = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_radioGroup = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"label": {
@ -432,6 +433,6 @@ var et2_radioGroup = et2_valueWidget.extend([et2_IDetachedDOM],
{
}
});
});}).call(this);
// No such tag as 'radiogroup', but it needs something
et2_register_widget(et2_radioGroup, ["radiogroup"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_widget;
*/
@ -33,7 +31,7 @@
*
* @augments et2_widget
*/
var et2_script = et2_widget.extend(
var et2_script = (function(){ "use strict"; return et2_widget.extend(
{
/**
* Constructor
@ -65,5 +63,5 @@ var et2_script = et2_widget.extend(
this.egw.debug('error', 'Error while executing script: ',_content,e);
}
}
});
});}).call(this);
et2_register_widget(et2_script, ["script"]);

View File

@ -13,8 +13,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_widget_link;
*/
@ -31,7 +29,7 @@
*
* @augments et2_selectbox
*/
var et2_selectAccount = et2_selectbox.extend(
var et2_selectAccount = (function(){ "use strict"; return et2_selectbox.extend(
{
attributes: {
'account_type': {
@ -738,7 +736,7 @@ var et2_selectAccount = et2_selectbox.extend(
this.set_tags(this.options.tags, this.options.width);
}
}
});
});}).call(this);
et2_register_widget(et2_selectAccount, ["select-account"]);
/**
@ -748,7 +746,7 @@ et2_register_widget(et2_selectAccount, ["select-account"]);
*
* @augments et2_link_string
*/
var et2_selectAccount_ro = et2_link_string.extend([et2_IDetachedDOM],
var et2_selectAccount_ro = (function(){ "use strict"; return et2_link_string.extend([et2_IDetachedDOM],
{
attributes: {
"empty_label": {
@ -882,5 +880,5 @@ var et2_selectAccount_ro = et2_link_string.extend([et2_IDetachedDOM],
}
}
}
});
});}).call(this);
et2_register_widget(et2_selectAccount_ro, ["select-account_ro"]);

View File

@ -11,8 +11,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
/phpgwapi/js/jquery/chosen/chosen.jquery.js;
@ -24,7 +22,7 @@
/**
* @augments et2_inputWidget
*/
var et2_selectbox = et2_inputWidget.extend(
var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"multiple": {
@ -499,7 +497,7 @@ var et2_selectbox = et2_inputWidget.extend(
if(_value && jQuery("option[value='"+_value+"']", this.input).prop("selected", true).length == 0)
{
if(this.options.select_options[_value] ||
this.options.select_options.filter &&
this.options.select_options.filter &&
this.options.select_options.filter(function(value) {return value == _value;}))
{
// Options not set yet? Do that now, which will try again.
@ -770,7 +768,7 @@ var et2_selectbox = et2_inputWidget.extend(
return this._super.apply(this, arguments);
}
}
});
});}).call(this);
et2_register_widget(et2_selectbox, ["menupopup", "listbox", "select", "select-cat",
"select-percent", 'select-priority',
'select-country', 'select-state', 'select-year', 'select-month',
@ -778,7 +776,7 @@ et2_register_widget(et2_selectbox, ["menupopup", "listbox", "select", "select-ca
'select-lang', 'select-bool', 'select-timezone' ]);
// Static class stuff
jQuery.extend(et2_selectbox,
jQuery.extend(et2_selectbox, //(function(){ "use strict"; return
{
type_cache: {},
@ -949,6 +947,8 @@ jQuery.extend(et2_selectbox,
* We still need the same thing on the server side to validate, so they
* have to match. See etemplate_widget_menupopup::typeOptions()
* The type specific legacy options wind up in attrs.other.
*
* @param {type} widget
*/
priority_options: function(widget) {
return [
@ -1142,7 +1142,7 @@ jQuery.extend(et2_selectbox,
else
{
// Check that the value is in there
// Make sure we are not requesting server for an empty value option or
// Make sure we are not requesting server for an empty value option or
// other widgets but select-timezone as server won't find anything and
// it will fall into an infinitive loop, e.g. select-cat widget.
if(attrs.value && attrs.value != "" && attrs.value != "0" && attrs.type == "select-timezone")
@ -1165,14 +1165,15 @@ jQuery.extend(et2_selectbox,
return cache;
}
}
});
}//;}).call(this)
);
/**
* 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 = (function(){ "use strict"; return et2_selectbox.extend([et2_IDetachedDOM],
{
/**
* Constructor
@ -1329,7 +1330,7 @@ var et2_selectbox_ro = et2_selectbox.extend([et2_IDetachedDOM],
this.span = jQuery(_nodes[0]);
this.set_value(_values["value"]);
}
});
});}).call(this);
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',
@ -1408,7 +1409,7 @@ et2_register_widget(et2_selectbox_ro, ["menupopup_ro", "listbox_ro", "select_ro"
*
* @augments et2_DOMWidget
*/
var et2_menulist = et2_DOMWidget.extend(
var et2_menulist = (function(){ "use strict"; return et2_DOMWidget.extend(
{
/**
* Construtor
@ -1436,6 +1437,6 @@ var et2_menulist = et2_DOMWidget.extend(
return this._parent.getChildren();
}
});
});}).call(this);
et2_register_widget(et2_menulist, ["menulist"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.splitter;
@ -28,7 +26,7 @@
* @see http://methvin.com/splitter/ Uses Splitter
* @augments et2_DOMWidget
*/
var et2_split = et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],
var et2_split = (function(){ "use strict"; return et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],
{
attributes: {
"orientation": {
@ -198,7 +196,7 @@ var et2_split = et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],
pix = size * widget.dynheight.outerNode.height() / 100;
}
return pix.toFixed(2);
}
};
//Convert pixel size to percent
var pix2per = function (_size)
@ -213,7 +211,7 @@ var et2_split = et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],
per = _size * 100 / widget.dynheight.outerNode.height();
}
return per.toFixed(2) + "%";
}
};
// Check for position preference, load it in
if(this.id)
@ -308,9 +306,9 @@ var et2_split = et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],
// Extra resize would cause stalling chrome
// as resize might confilict with bottom download bar
// in chrome which does a window resize, so better to not
// trigger second resize and leave that to an application
// trigger second resize and leave that to an application
// if it is neccessary.
// Above forcing is not enough for Firefox, defer
window.setTimeout(jQuery.proxy(function() {this.resize();},widget),200);
},self,et2_IResizeable);
@ -451,6 +449,6 @@ var et2_split = et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],
this.div.removeClass('print');
this.stop_resize = false;
}
});
});}).call(this);
et2_register_widget(et2_split, ["split"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_widget;
*/
@ -26,7 +24,7 @@
*
* @augments et2_widget
*/
var et2_styles = et2_widget.extend(
var et2_styles = (function(){ "use strict"; return et2_widget.extend(
{
/**
* Constructor
@ -90,6 +88,6 @@ var et2_styles = et2_widget.extend(
}
}
}
});
});}).call(this);
et2_register_widget(et2_styles, ["styles"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jsapi.egw;
jquery.jquery;
@ -23,7 +21,7 @@
*
* @augments et2_valueWidget
*/
var et2_tabbox = et2_valueWidget.extend([et2_IInput,et2_IResizeable],
var et2_tabbox = (function(){ "use strict"; return et2_valueWidget.extend([et2_IInput,et2_IResizeable],
{
attributes: {
'tabs': {
@ -505,5 +503,5 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput,et2_IResizeable],
this.set_height(this.tabContainer.height());
}
}
});
});}).call(this);
et2_register_widget(et2_tabbox, ["tabbox"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_inputWidget;
/phpgwapi/js/jquery/magicsuggest/magicsuggest.js;
@ -26,7 +24,7 @@
* @see http://nicolasbize.github.io/magicsuggest/
* @augments et2_selectbox
*/
var et2_taglist = et2_selectbox.extend(
var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend(
{
attributes: {
"empty_label": {
@ -197,12 +195,12 @@ var et2_taglist = et2_selectbox.extend(
highlight: false, // otherwise renderer have to return strings
selectFirst: true
}, this.lib_options);
if(this.options.height) {
this.div.css('height','');
this.taglist_options.maxDropHeight = parseInt(this.options.height);
}
this.taglist = this.taglist.magicSuggest(this.taglist_options);
this.$taglist = $j(this.taglist);
if(this.options.value)
@ -492,7 +490,7 @@ var et2_taglist = et2_selectbox.extend(
jQuery(this.taglist.container).trigger('blur');
return this.taglist.getValue();
}
});
});}).call(this);
et2_register_widget(et2_taglist, ["taglist"]);
/**
@ -500,7 +498,7 @@ et2_register_widget(et2_taglist, ["taglist"]);
* free entries are allowed
*
*/
var et2_taglist_account = et2_taglist.extend(
var et2_taglist_account = (function(){ "use strict"; return et2_taglist.extend(
{
attributes: {
"autocomplete_url": {
@ -660,7 +658,7 @@ var et2_taglist_account = et2_taglist.extend(
this._super.call(this, values);
}
}
});
});}).call(this);
et2_register_widget(et2_taglist_account, ["taglist-account"]);
/**
@ -670,7 +668,7 @@ et2_register_widget(et2_taglist_account, ["taglist-account"]);
*
* @augments et2_taglist
*/
var et2_taglist_email = et2_taglist.extend(
var et2_taglist_email = (function(){ "use strict"; return et2_taglist.extend(
{
attributes: {
"autocomplete_url": {
@ -788,18 +786,18 @@ var et2_taglist_email = et2_taglist.extend(
return label;
}
});
});}).call(this);
et2_register_widget(et2_taglist_email, ["taglist-email"]);
/**
* Taglist customized specifically for categories, with colors
*
*
* Free entries are not allowed.
*
* @augments et2_taglist
*/
var et2_taglist_category = et2_taglist.extend(
var et2_taglist_category = (function(){ "use strict"; return et2_taglist.extend(
{
attributes: {
"autocomplete_url": {
@ -864,7 +862,7 @@ var et2_taglist_category = et2_taglist.extend(
selectionRenderer: function(item)
{
var label = jQuery('<span>').text(item.label);
if (item.class) label.addClass(item.class);
jQuery('<span class="cat_'+item.id+'"/>').prependTo(label);
if (typeof item.title != 'undefined') label.attr('title', item.title);
@ -872,7 +870,7 @@ var et2_taglist_category = et2_taglist.extend(
return label;
}
});
});}).call(this);
et2_register_widget(et2_taglist_category, ["taglist-cat"]);
@ -881,7 +879,7 @@ et2_register_widget(et2_taglist_category, ["taglist-cat"]);
*
* @augments et2_selectbox
*/
var et2_taglist_ro = et2_selectbox_ro.extend(
var et2_taglist_ro = (function(){ "use strict"; return et2_selectbox_ro.extend(
{
/**
* Constructor
@ -901,7 +899,7 @@ var et2_taglist_ro = et2_selectbox_ro.extend(
this._super.apply(this, arguments);
$j('li',this.span).addClass('ms-sel-item');
}
});
});}).call(this);
et2_register_widget(et2_taglist_ro, ["taglist_ro","taglist_email_ro", "taglist_account_ro" ]);
// Require css

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_xml;
et2_core_DOMWidget;
@ -25,7 +23,7 @@
*
* @augments et2_DOMWidget
*/
var et2_template = et2_DOMWidget.extend(
var et2_template = (function(){ "use strict"; return et2_DOMWidget.extend(
{
attributes: {
"template": {
@ -194,6 +192,6 @@ var et2_template = et2_DOMWidget.extend(
// Not done yet, but widget will let you know
return this.loading.promise();
}
});
});}).call(this);
et2_register_widget(et2_template, ["template"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_inputWidget;
@ -23,7 +21,7 @@
*
* @augments et2_inputWidget
*/
var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
var et2_textbox = (function(){ "use strict"; return et2_inputWidget.extend([et2_IResizeable],
{
attributes: {
"multiline": {
@ -291,7 +289,7 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable],
}
}
}
});
});}).call(this);
et2_register_widget(et2_textbox, ["textbox", "passwd", "hidden"]);
/**
@ -299,7 +297,7 @@ et2_register_widget(et2_textbox, ["textbox", "passwd", "hidden"]);
*
* @augments et2_valueWidget
*/
var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_textbox_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
/**
* Ignore all more advanced attributes.
@ -403,7 +401,7 @@ var et2_textbox_ro = et2_valueWidget.extend([et2_IDetachedDOM],
this.set_value(_values["value"]);
}
}
});
});}).call(this);
et2_register_widget(et2_textbox_ro, ["textbox_ro"]);
/**
@ -412,7 +410,7 @@ et2_register_widget(et2_textbox_ro, ["textbox_ro"]);
*
* @type type
*/
var et2_searchbox = et2_textbox.extend(
var et2_searchbox = (function(){ "use strict"; return et2_textbox.extend(
{
/**
* Advanced attributes
@ -492,7 +490,7 @@ var et2_searchbox = et2_textbox.extend(
},
blur: function(event){
if (!event.relatedTarget || !jQuery(event.relatedTarget.parentNode).hasClass('et2_searchbox'))
if (!event.relatedTarget || !jQuery(event.relatedTarget.parentNode).hasClass('et2_searchbox'))
{
self._show_hide((!self.options.overlay && self.get_value()));
}
@ -537,11 +535,11 @@ var et2_searchbox = et2_textbox.extend(
{
// Not applied for fix option
if (this.options.fix) return;
jQuery(this.flex).toggleClass('hide',!_stat);
jQuery(this.getDOMNode()).toggleClass('expanded', _stat);
},
/**
* toggle search button status based on value
*/
@ -549,7 +547,7 @@ var et2_searchbox = et2_textbox.extend(
{
// Not applied for fix option
if (this.options.fix) return;
if (!this.get_value())
{
jQuery(this.button.getDOMNode()).removeClass('toolbar_toggled');
@ -576,7 +574,7 @@ var et2_searchbox = et2_textbox.extend(
get_value:function(){
return this.search.input.val();
},
set_value: function (_value){
this._super.apply(this,arguments);
if (this.search) this.search.input.val(_value);
@ -596,7 +594,7 @@ var et2_searchbox = et2_textbox.extend(
this._searchToggleState();
}
},
/**
* Overrride attachToDOM in order to unbind change handler
*/
@ -608,5 +606,5 @@ var et2_searchbox = et2_textbox.extend(
$j(node).off('.et2_inputWidget');
}
},
});
});}).call(this);
et2_register_widget(et2_searchbox, ["searchbox"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
jquery.jquery-ui;
@ -23,7 +21,7 @@
*
* @augments et2_valueWidget
*/
var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
var et2_toolbar = (function(){ "use strict"; return et2_DOMWidget.extend([et2_IInput],
{
attributes: {
"view_range": {
@ -63,10 +61,10 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
this._super.apply(this, arguments);
this.div = $j(document.createElement('div'))
.addClass('et2_toolbar ui-widget-header ui-corner-all');
// Set proper id and dom_id for the widget
this.set_id(this.id);
//actionbox is the div for stored actions
this.actionbox = $j(document.createElement('div'))
.addClass("et2_toolbar_more")
@ -79,7 +77,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
this.countActions = 0;
this.dropdowns = {};
this.preference = {};
this._build_menu(this.default_toolbar, true);
},
@ -94,7 +92,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
this.actionbox.empty().remove();
this.actionlist.empty().remove();
},
/**
* Fix function in order to fix toolbar preferences with the new preference structure
* @param {action object} _action
@ -102,7 +100,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
*/
_fix_preference: function (_action)
{
// ** IMPORTANT TODO: This switch case should be removed for new release **
// This is an ugly hack but we need to add this switch becuase to update and fix
// current users toolbar preferences with the new structure which is:
@ -122,7 +120,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
case 'label2':
case 'label3':
case 'label4':
case 'label5':
case 'label5':
this.set_prefered(_action.id, !_action.toolbarDefault);
break;
default:
@ -139,7 +137,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
this.set_prefered(_action.id, false/*!toolbarDefault*/);
}
},
/**
* Go through actions and build buttons for the toolbar
*
@ -157,10 +155,10 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
this.actionbox.append('<h class="ui-toolbar-menulistHeader">'+egw.lang('more')+' ...'+'</h>');
this.actionbox.append('<div id="' + this.id + '-menulist' +'" class="ui-toolbar-menulist" ></div>');
var that = this;
var pref = (!egwIsMobile())? egw.preference(this.dom_id,this.egw().getAppName()): undefined;
if (pref && !jQuery.isArray(pref)) this.preference = pref;
//Set the default actions for the first time
if (typeof pref === 'undefined' && !isDefault)
{
@ -226,7 +224,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
{
if (this.preference[key]) menuLen++;
}
this.countActions = countActions(actions) - menuLen;
var last_group = false;
@ -323,7 +321,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
dropdown.set_label(action.children[child].caption);
}
}
}
}
dropdown.set_image (action.iconUrl||'');
dropdown.onchange = jQuery.proxy(function(selected, dropdown)
{
@ -396,7 +394,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
stop: function()
{
jQuery(that.actionlist).removeClass('et2_toolbarDropArea');
},
}
});
toolbox.children().droppable({
accept:toolbar,
@ -476,7 +474,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
.attr('title', (action.hint ? action.hint : action.caption))
.attr('type', 'button')
.appendTo(this.preference[action.id]?this.actionbox.children()[1]:$j('[data-group='+action.group+']',this.actionlist));
if (action && action.checkbox)
{
if (action.data.toggle_on || action.data.toggle_off)
@ -510,7 +508,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
if ((this.countActions <= parseInt(this.options.view_range) ||
this.preference[action.id] || !action.iconUrl) &&
typeof button[0] !== 'undefined' &&
!(action.checkbox && action.data && (action.data.toggle_on || action.data.toggle_off))) // no caption for slideswitch checkboxes
!(action.checkbox && action.data && (action.data.toggle_on || action.data.toggle_off))) // no caption for slideswitch checkboxes
{
button.addClass(action.iconUrl?'et2_toolbar_hasCaption':'et2_toolbar_onlyCaption');
button[0].textContent = action.caption;
@ -553,14 +551,14 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
{
this._build_menu(actions);
},
/**
* Set/Get the checkbox toolbar action
*
*
* @param {string} _action action name of the selected toolbar
* @param {boolean} _value value that needs to be set for the action true|false
* - if no value means checkbox value returns the current value
*
*
* @returns {boolean} returns boolean result of get checkbox value
* or returns undefined as Set result or failure
*/
@ -591,7 +589,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
return undefined;
}
},
getDOMNode: function(asker)
{
return this.div[0];
@ -640,7 +638,7 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
{
return true;
},
/**
* Attach the container node of the widget to DOM-Tree
* @returns {Boolean}
@ -650,5 +648,5 @@ var et2_toolbar = et2_DOMWidget.extend([et2_IInput],
this._super.apply(this, arguments);
return false;
}
});
});}).call(this);
et2_register_widget(et2_toolbar, ["toolbar"]);

View File

@ -12,8 +12,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_core_inputWidget;
/phpgwapi/js/egw_action/egw_dragdrop_dhtmlx_tree.js;
@ -31,7 +29,7 @@
*
* @augments et2_inputWidget
*/
var et2_tree = et2_inputWidget.extend(
var et2_tree = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
"multiple": {
@ -930,6 +928,6 @@ var et2_tree = et2_inputWidget.extend(
}
return url_parts.join('/');
}
});
});}).call(this);
et2_register_widget(et2_tree, ["tree","tree-cat"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
et2_textbox;
et2_valueWidget;
@ -23,7 +21,7 @@
*
* @augments et2_textbox
*/
var et2_url = et2_textbox.extend(
var et2_url = (function(){ "use strict"; return et2_textbox.extend(
{
attributes: {
"multiline": {
@ -229,7 +227,7 @@ var et2_url = et2_textbox.extend(
if (this.input[0].parentNode) jQuery(this.input[0].parentNode).addClass('et2_url_span');
}
});
});}).call(this);
et2_register_widget(et2_url, ["url", "url-email", "url-phone"]);
/**
@ -238,7 +236,7 @@ et2_register_widget(et2_url, ["url", "url-email", "url-phone"]);
*
* @augments et2_valueWidget
*/
var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_url_ro = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"contact_plus": {
@ -315,15 +313,15 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
{
var val = this.span.text().split("<");
val = val[0] != ""? val[0]: val[2];
// need to preserve the original value somehow
// as it's been used for add contact plus feature
this.span.attr('title',_value);
this.span.text(val.replace(/"/g,''));
}
// Add contact_plus button
if (this.options.contact_plus)
{
@ -403,5 +401,5 @@ var et2_url_ro = et2_valueWidget.extend([et2_IDetachedDOM],
}
}
});
et2_register_widget(et2_url_ro, ["url_ro", "url-email_ro", "url-phone_ro"]);
});}).call(this);
et2_register_widget(et2_url_ro, ["url_ro", "url-email_ro", "url-phone_ro"]);

View File

@ -10,8 +10,6 @@
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_inputWidget;
@ -26,7 +24,7 @@
*
* @augments et2_valueWidget
*/
var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM],
var et2_vfs = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
@ -170,7 +168,7 @@ var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM],
}
});
});}).call(this);
et2_register_widget(et2_vfs, ["vfs"]);
/**
@ -179,7 +177,7 @@ et2_register_widget(et2_vfs, ["vfs"]);
*
* @augments et2_textbox
*/
var et2_vfsName = et2_textbox.extend(
var et2_vfsName = (function(){ "use strict"; return et2_textbox.extend(
{
/**
* Constructor
@ -201,7 +199,7 @@ var et2_vfsName = et2_textbox.extend(
getValue: function() {
return egw.encodePath(this._super.apply(this)||'');
}
});
});}).call(this);
et2_register_widget(et2_vfsName, ["vfs-name"]);
/**
@ -210,7 +208,7 @@ et2_register_widget(et2_vfsName, ["vfs-name"]);
*
* @augments et2_textbox_ro
*/
var et2_vfsName_ro = et2_textbox_ro.extend(
var et2_vfsName_ro = (function(){ "use strict"; return et2_textbox_ro.extend(
{
/**
* Constructor
@ -231,7 +229,7 @@ var et2_vfsName_ro = et2_textbox_ro.extend(
getValue: function() {
return egw.encodePath(this._super.apply(this));
}
});
});}).call(this);
et2_register_widget(et2_vfsName_ro, ["vfs-name_ro"]);
/**
@ -250,7 +248,7 @@ et2_register_widget(et2_vfsName_ro, ["vfs-name_ro"]);
*
* @augments et2_valueWidget
*/
var et2_vfsMime = expose(et2_valueWidget.extend([et2_IDetachedDOM],
var et2_vfsMime = (function(){ "use strict"; return expose(et2_valueWidget.extend([et2_IDetachedDOM],
{
attributes: {
"value": {
@ -431,7 +429,7 @@ var et2_vfsMime = expose(et2_valueWidget.extend([et2_IDetachedDOM],
this.set_value(_values['value']);
}
}
}));
}));}).call(this);
et2_register_widget(et2_vfsMime, ["vfs-mime"]);
/**
@ -440,7 +438,7 @@ et2_register_widget(et2_vfsMime, ["vfs-mime"]);
*
* @augments et2_description
*/
var et2_vfsSize = et2_description.extend({
var et2_vfsSize = (function(){ "use strict"; return et2_description.extend({
attributes: {
"value": {
"type": "integer"
@ -489,7 +487,7 @@ var et2_vfsSize = et2_description.extend({
}
this._super.apply(this, arguments);
}
});
});}).call(this);
et2_register_widget(et2_vfsSize, ["vfs-size"]);
@ -498,7 +496,7 @@ et2_register_widget(et2_vfsSize, ["vfs-size"]);
*
* @augments et2_description
*/
var et2_vfsMode = et2_description.extend({
var et2_vfsMode = (function(){ "use strict"; return et2_description.extend({
// Masks for file types
types: {
'l': 0xA000, // link
@ -603,7 +601,7 @@ var et2_vfsMode = et2_description.extend({
}
this._super.apply(this, arguments);
}
});
});}).call(this);
et2_register_widget(et2_vfsMode, ["vfs-mode"]);
@ -613,7 +611,7 @@ et2_register_widget(et2_vfsMode, ["vfs-mode"]);
*
* @augments et2_selectAccount_ro
*/
var et2_vfsUid = et2_selectAccount_ro.extend(
var et2_vfsUid = (function(){ "use strict"; return et2_selectAccount_ro.extend(
{
/**
* @memberOf et2_vfsUid
@ -627,7 +625,7 @@ var et2_vfsUid = et2_selectAccount_ro.extend(
}
this._super.apply(this, arguments);
}
});
});}).call(this);
et2_register_widget(et2_vfsUid, ["vfs-uid","vfs-gid"]);
@ -640,11 +638,11 @@ et2_register_widget(et2_vfsUid, ["vfs-uid","vfs-gid"]);
*
* @augments et2_file
*/
var et2_vfsUpload = et2_file.extend(
var et2_vfsUpload = (function(){ "use strict"; return et2_file.extend(
{
attributes: {
"value": {
"type": "any", // Either nothing, or an object with file info
"type": "any" // Either nothing, or an object with file info
},
"path": {
"name": "Path",
@ -669,7 +667,7 @@ var et2_vfsUpload = et2_file.extend(
init: function(_parent, attrs) {
this._super.apply(this, arguments);
$j(this.node).addClass("et2_vfs");
if(!this.options.path)
{
this.options.path = this.options.id;
@ -740,6 +738,8 @@ var et2_vfsUpload = et2_file.extend(
/**
* Add in the request id
*
* @param {type} form
*/
beforeSend: function(form)
{
@ -799,11 +799,11 @@ var et2_vfsUpload = et2_file.extend(
});
}
}
});
});}).call(this);
et2_register_widget(et2_vfsUpload, ["vfs-upload"]);
var et2_vfsSelect = et2_inputWidget.extend(
var et2_vfsSelect = (function(){ "use strict"; return et2_inputWidget.extend(
{
// Allowed mode options
modes: ['open','open-multiple','saveas','select-dir'],
@ -985,5 +985,5 @@ var et2_vfsSelect = et2_inputWidget.extend(
getValue: function() {
return this.value;
}
});
});}).call(this);
et2_register_widget(et2_vfsSelect, ["vfs-select"]);

View File

@ -7,11 +7,9 @@
* @link http://www.egroupware.org
* @author Hadi Nategh <hn[at]stylite.de>
* @copyright Stylite AG
* @version $Id:$
* @version $Id$
*/
"use strict";
/*egw:uses
jquery.jquery;
et2_core_interfaces;
@ -19,8 +17,8 @@
*/
/**
* This widget represents the HTML5 video tag with all its optional attributes
*
* This widget represents the HTML5 video tag with all its optional attributes
*
* The widget can be created in the following ways:
* <code>
* var videoTag = et2_createWidget("video", {
@ -46,7 +44,7 @@
*
* @augments et2_baseWidget
*/
var et2_video = et2_baseWidget.extend(et2_IDOMNode,
var et2_video = (function(){ "use strict"; return et2_baseWidget.extend(et2_IDOMNode,
{
attributes: {
"video_src": {
@ -90,8 +88,8 @@ var et2_video = et2_baseWidget.extend(et2_IDOMNode,
"description": "Defines if the video should be played repeatedly"
}
},
/**
* Constructor
*
@ -99,7 +97,7 @@ var et2_video = et2_baseWidget.extend(et2_IDOMNode,
*/
init: function() {
this._super.apply(this, arguments);
//Create Video tag
this.video = jQuery(document.createElement("video"));
if (this.options.controls)
@ -131,24 +129,24 @@ var et2_video = et2_baseWidget.extend(et2_IDOMNode,
* @param {string} _value url
*/
set_src: function(_value) {
if (_value)
{
var source = jQuery(document.createElement('source'))
.attr('src',_value)
.appendTo(this.video);
if (this.options.src_type)
{
source.attr('type',this.options.src_type);
}
}
},
/**
* Set autoplay option for video
* -If autoplay is set, video would be played automatically after the page is loaded
*
*
* @param {string} _value true set the autoplay and false not to set
*/
set_autoplay: function (_value)
@ -158,7 +156,7 @@ var et2_video = et2_baseWidget.extend(et2_IDOMNode,
this.video.attr("autoplay",_value);
}
},
/**
* Set controls option for video
*
@ -171,11 +169,11 @@ var et2_video = et2_baseWidget.extend(et2_IDOMNode,
this.video.attr("controls",_value);
}
},
/**
* Set poster attribute in order to specify
* Set poster attribute in order to specify
* an image to be shown while video is loading or before user play it
*
*
* @param {type} _url
*/
set_poster: function (_url)
@ -185,7 +183,7 @@ var et2_video = et2_baseWidget.extend(et2_IDOMNode,
this.video.attr("poster", _url);
}
}
});
});}).call(this);
et2_register_widget(et2_video, ["video"]);

View File

@ -35,6 +35,8 @@ var et2_IExposable = new Interface(
*/
function expose (widget)
{
"use strict";
// Common expose functions
var THUMBNAIL_MAX = 100;
@ -49,7 +51,7 @@ function expose (widget)
// For filtering to only show things we can handle
var mime_regex = new RegExp(/(video\/(mp4|ogg|webm))|(image\/:*(?!tif|x-xcf|pdf))/);
// IE only supports video/mp4 mime type
if (navigator.userAgent.match(/(MSIE|Trident)/)) mime_regex.compile(/(video\/mp4)|(image\/:*(?!tif|x-xcf|pdf))/);
@ -377,7 +379,7 @@ function expose (widget)
set_value:function (_value)
{
if (typeof this._super == 'undefined') return;
this._super.apply(this,arguments);
// Do not run set value of expose if expose_view is not set
// it causes a wired error on nested image widgets which
@ -386,7 +388,7 @@ function expose (widget)
{
return;
}
var self=this;
// If the media type is not supported do not bind the click handler
@ -442,14 +444,14 @@ function expose (widget)
this.expose_options.index = current_index;
gallery = blueimp.Gallery(mediaContent, this.expose_options);
},
/**
* Check if clicked target from nm is in depth
*
*
* @param nm nextmatch widget
* @param target selected target dom node
*
* @return {boolean} returns false if target is not in depth otherwise True
*
* @return {boolean} returns false if target is not in depth otherwise True
*/
_is_target_indepth: function (nm, target){
var res = false;