forked from extern/egroupware
fixing scope of "use strict", so we do not need to remove it when concatinating our scripts like we do now with minjs, also enabled "use strict" for calendar/js/app.js and fixed a reference error found by it
This commit is contained in:
parent
4c37f90cc1
commit
3a9c0c237b
@ -40,7 +40,7 @@
|
|||||||
*
|
*
|
||||||
* @augments AppJS
|
* @augments AppJS
|
||||||
*/
|
*/
|
||||||
app.classes.calendar = AppJS.extend(
|
app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* application name
|
* application name
|
||||||
@ -2060,7 +2060,7 @@ app.classes.calendar = AppJS.extend(
|
|||||||
// caching keys, otherwise they'll fetch & cache consolidated
|
// caching keys, otherwise they'll fetch & cache consolidated
|
||||||
if(state.state.view == 'day' && state.state.owner.length < parseInt(this.egw.preference('day_consolidate','calendar')))
|
if(state.state.view == 'day' && state.state.owner.length < parseInt(this.egw.preference('day_consolidate','calendar')))
|
||||||
{
|
{
|
||||||
day_value = [];
|
var day_value = [];
|
||||||
for(var i = 0; i < state.state.owner.length; i++)
|
for(var i = 0; i < state.state.owner.length; i++)
|
||||||
{
|
{
|
||||||
day_value.push({
|
day_value.push({
|
||||||
@ -3501,7 +3501,7 @@ app.classes.calendar = AppJS.extend(
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});}).call(this);
|
||||||
|
|
||||||
|
|
||||||
jQuery.extend(app.classes.calendar,{
|
jQuery.extend(app.classes.calendar,{
|
||||||
|
9
calendar/js/app.min.js
vendored
Normal file
9
calendar/js/app.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
calendar/js/app.min.js.map
Normal file
1
calendar/js/app.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -9,8 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
et2_core_valueWidget;
|
et2_core_valueWidget;
|
||||||
/calendar/js/et2_widget_event.js;
|
/calendar/js/et2_widget_event.js;
|
||||||
@ -23,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
* @augments et2_valueWidget
|
* @augments et2_valueWidget
|
||||||
*/
|
*/
|
||||||
var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizeable],
|
var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizeable],
|
||||||
{
|
{
|
||||||
|
|
||||||
attributes: {
|
attributes: {
|
||||||
@ -95,7 +93,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
|
|||||||
rowHeight: 20,
|
rowHeight: 20,
|
||||||
// Percentage; not yet available
|
// Percentage; not yet available
|
||||||
titleHeight: 2.0
|
titleHeight: 2.0
|
||||||
}
|
};
|
||||||
|
|
||||||
this.registeredUID = null;
|
this.registeredUID = null;
|
||||||
},
|
},
|
||||||
@ -170,7 +168,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
|
|||||||
|
|
||||||
// Figure out insert index
|
// Figure out insert index
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
var siblings = this._parent.getDOMNode(this).childNodes
|
var siblings = this._parent.getDOMNode(this).childNodes;
|
||||||
while(idx < siblings.length && siblings[idx] != this.getDOMNode())
|
while(idx < siblings.length && siblings[idx] != this.getDOMNode())
|
||||||
{
|
{
|
||||||
idx++;
|
idx++;
|
||||||
@ -193,9 +191,9 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
|
|||||||
* Set the date
|
* Set the date
|
||||||
*
|
*
|
||||||
* @param {string|Date} _date New date
|
* @param {string|Date} _date New date
|
||||||
* @param {Object[]} events=false List of event data to be displayed, or false to
|
* @param {Object[]} events =false List of event data to be displayed, or false to
|
||||||
* automatically fetch data from content array
|
* automatically fetch data from content array
|
||||||
* @param {boolean} force_redraw=false Redraw even if the date is the same.
|
* @param {boolean} force_redraw =false Redraw even if the date is the same.
|
||||||
* Used for when new data is available.
|
* Used for when new data is available.
|
||||||
*/
|
*/
|
||||||
set_date: function(_date, events, force_redraw)
|
set_date: function(_date, events, force_redraw)
|
||||||
@ -314,7 +312,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
|
|||||||
|
|
||||||
this.options.owner = typeof _owner !== 'object' ? [_owner] : _owner;
|
this.options.owner = typeof _owner !== 'object' ? [_owner] : _owner;
|
||||||
|
|
||||||
var cache_id = app.classes.calendar._daywise_cache_id(this.options.date,_owner)
|
var cache_id = app.classes.calendar._daywise_cache_id(this.options.date,_owner);
|
||||||
if(this.options.date && this.registeredUID &&
|
if(this.options.date && this.registeredUID &&
|
||||||
cache_id !== this.registeredUID)
|
cache_id !== this.registeredUID)
|
||||||
{
|
{
|
||||||
@ -707,7 +705,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var count = parseInt(indicator.attr('data-hidden_count')) + 1
|
var count = parseInt(indicator.attr('data-hidden_count')) + 1;
|
||||||
indicator.attr('data-hidden_count', count);
|
indicator.attr('data-hidden_count', count);
|
||||||
if(this.display_settings.granularity === 0)
|
if(this.display_settings.granularity === 0)
|
||||||
{
|
{
|
||||||
@ -1070,6 +1068,6 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea
|
|||||||
|
|
||||||
this._out_of_view();
|
this._out_of_view();
|
||||||
}
|
}
|
||||||
});
|
});}).call(this);
|
||||||
|
|
||||||
et2_register_widget(et2_calendar_daycol, ["calendar-daycol"]);
|
et2_register_widget(et2_calendar_daycol, ["calendar-daycol"]);
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
/etemplate/js/et2_core_valueWidget;
|
/etemplate/js/et2_core_valueWidget;
|
||||||
*/
|
*/
|
||||||
@ -42,7 +40,7 @@
|
|||||||
*
|
*
|
||||||
* @augments et2_valueWidget
|
* @augments et2_valueWidget
|
||||||
*/
|
*/
|
||||||
var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM],
|
var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
|
||||||
{
|
{
|
||||||
|
|
||||||
attributes: {
|
attributes: {
|
||||||
@ -905,7 +903,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
setDetachedAttributes: function(_nodes, _values) {
|
setDetachedAttributes: function(_nodes, _values) {
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});}).call(this);
|
||||||
et2_register_widget(et2_calendar_event, ["calendar-event"]);
|
et2_register_widget(et2_calendar_event, ["calendar-event"]);
|
||||||
|
|
||||||
// Static class stuff
|
// Static class stuff
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
et2_widget_taglist;
|
et2_widget_taglist;
|
||||||
*/
|
*/
|
||||||
@ -25,7 +23,7 @@
|
|||||||
* @see http://nicolasbize.github.io/magicsuggest/
|
* @see http://nicolasbize.github.io/magicsuggest/
|
||||||
* @augments et2_selectbox
|
* @augments et2_selectbox
|
||||||
*/
|
*/
|
||||||
var et2_calendar_owner = et2_taglist_email.extend(
|
var et2_calendar_owner = (function(){ "use strict"; return et2_taglist_email.extend(
|
||||||
{
|
{
|
||||||
attributes: {
|
attributes: {
|
||||||
"autocomplete_url": {
|
"autocomplete_url": {
|
||||||
@ -47,7 +45,7 @@ var et2_calendar_owner = et2_taglist_email.extend(
|
|||||||
// Set to empty object to use selectbox's option finding
|
// Set to empty object to use selectbox's option finding
|
||||||
"default": {},
|
"default": {},
|
||||||
"description": "Internally used to hold the select options."
|
"description": "Internally used to hold the select options."
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Allows sub-widgets to override options to the library
|
// Allows sub-widgets to override options to the library
|
||||||
@ -81,7 +79,7 @@ var et2_calendar_owner = et2_taglist_email.extend(
|
|||||||
.removeClass('ms-res-item-active');
|
.removeClass('ms-res-item-active');
|
||||||
}
|
}
|
||||||
},1);
|
},1);
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -92,5 +90,5 @@ var et2_calendar_owner = et2_taglist_email.extend(
|
|||||||
if(this.taglist == null) return null;
|
if(this.taglist == null) return null;
|
||||||
return this.taglist.getValue();
|
return this.taglist.getValue();
|
||||||
}
|
}
|
||||||
});
|
});}).call(this);
|
||||||
et2_register_widget(et2_calendar_owner, ["calendar-owner"]);
|
et2_register_widget(et2_calendar_owner, ["calendar-owner"]);
|
@ -9,8 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
/calendar/js/et2_widget_view.js;
|
/calendar/js/et2_widget_view.js;
|
||||||
/calendar/js/et2_widget_planner_row.js;
|
/calendar/js/et2_widget_planner_row.js;
|
||||||
@ -25,7 +23,7 @@
|
|||||||
*
|
*
|
||||||
* @augments et2_calendar_view
|
* @augments et2_calendar_view
|
||||||
*/
|
*/
|
||||||
var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable],
|
var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable],
|
||||||
{
|
{
|
||||||
createNamespace: true,
|
createNamespace: true,
|
||||||
|
|
||||||
@ -375,7 +373,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
}
|
}
|
||||||
else // users
|
else // users
|
||||||
{
|
{
|
||||||
user = parseInt(user)
|
user = parseInt(user);
|
||||||
for(var j = 0; j < accounts.length && already_added.indexOf(''+user) < 0; j++)
|
for(var j = 0; j < accounts.length && already_added.indexOf(''+user) < 0; j++)
|
||||||
{
|
{
|
||||||
if(accounts[j].value === user)
|
if(accounts[j].value === user)
|
||||||
@ -433,7 +431,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
}
|
}
|
||||||
rows[label_index].push(event);
|
rows[label_index].push(event);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
for(var user in participants)
|
for(var user in participants)
|
||||||
{
|
{
|
||||||
var participant = participants[user];
|
var participant = participants[user];
|
||||||
@ -692,7 +690,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
* Something changed, and the planner needs to be re-drawn. We wait a bit to
|
* Something changed, and the planner needs to be re-drawn. We wait a bit to
|
||||||
* avoid re-drawing twice if start and end date both changed, then recreate.
|
* avoid re-drawing twice if start and end date both changed, then recreate.
|
||||||
*
|
*
|
||||||
* @param {boolean} trigger=false Trigger an event once things are done.
|
* @param {boolean} trigger =false Trigger an event once things are done.
|
||||||
* Waiting until invalidate completes prevents 2 updates when changing the date range.
|
* Waiting until invalidate completes prevents 2 updates when changing the date range.
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
@ -938,7 +936,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
for(var left = 0,i = 0; i < days;t.setUTCDate(1),t.setUTCMonth(t.getUTCMonth()+1),left += days_in_month*day_width,i += days_in_month)
|
for(var left = 0,i = 0; i < days;t.setUTCDate(1),t.setUTCMonth(t.getUTCMonth()+1),left += days_in_month*day_width,i += days_in_month)
|
||||||
{
|
{
|
||||||
var u = new Date(t.getUTCFullYear(),t.getUTCMonth()+1,0,-t.getTimezoneOffset()/60);
|
var u = new Date(t.getUTCFullYear(),t.getUTCMonth()+1,0,-t.getTimezoneOffset()/60);
|
||||||
days_in_month = 1+ ((u-t) / (24*3600*1000))
|
days_in_month = 1+ ((u-t) / (24*3600*1000));
|
||||||
|
|
||||||
var first = new Date(t.getUTCFullYear(),t.getUTCMonth(),1,-t.getTimezoneOffset()/60);
|
var first = new Date(t.getUTCFullYear(),t.getUTCMonth(),1,-t.getTimezoneOffset()/60);
|
||||||
if(days_in_month <= 0) break;
|
if(days_in_month <= 0) break;
|
||||||
@ -947,7 +945,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
{
|
{
|
||||||
days_in_month = days - i;
|
days_in_month = days - i;
|
||||||
}
|
}
|
||||||
var title = app.calendar.egw.lang(date('F',new Date(t.valueOf() + t.getTimezoneOffset() * 60 * 1000)))
|
var title = app.calendar.egw.lang(date('F',new Date(t.valueOf() + t.getTimezoneOffset() * 60 * 1000)));
|
||||||
if (days_in_month > 10)
|
if (days_in_month > 10)
|
||||||
{
|
{
|
||||||
title += ' '+t.getUTCFullYear();
|
title += ' '+t.getUTCFullYear();
|
||||||
@ -976,7 +974,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
{
|
{
|
||||||
|
|
||||||
var content = '<div class="calendar_plannerScale" data-planner_view="week">';
|
var content = '<div class="calendar_plannerScale" data-planner_view="week">';
|
||||||
var state = ''
|
var state = '';
|
||||||
|
|
||||||
// we're not using UTC so date() formatting function works
|
// we're not using UTC so date() formatting function works
|
||||||
var t = new Date(start.valueOf());
|
var t = new Date(start.valueOf());
|
||||||
@ -1006,7 +1004,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
if(start.getTimezoneOffset() > 0)
|
if(start.getTimezoneOffset() > 0)
|
||||||
{
|
{
|
||||||
// Gets the right week start west of GMT
|
// Gets the right week start west of GMT
|
||||||
usertime.setUTCMinutes(usertime.getUTCMinutes() +start.getTimezoneOffset())
|
usertime.setUTCMinutes(usertime.getUTCMinutes() +start.getTimezoneOffset());
|
||||||
}
|
}
|
||||||
state = app.calendar.date.start_of_week(usertime);
|
state = app.calendar.date.start_of_week(usertime);
|
||||||
state.setUTCHours(0);
|
state.setUTCHours(0);
|
||||||
@ -1192,7 +1190,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
if(!parent)
|
if(!parent)
|
||||||
{
|
{
|
||||||
debugger;
|
debugger;
|
||||||
egw.debug('error','No parent objectManager found')
|
egw.debug('error','No parent objectManager found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1298,6 +1296,9 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Automatically add dnd support for linking
|
* Automatically add dnd support for linking
|
||||||
|
*
|
||||||
|
* @param {type} mgr
|
||||||
|
* @param {type} actionLinks
|
||||||
*/
|
*/
|
||||||
_init_links_dnd: function(mgr,actionLinks) {
|
_init_links_dnd: function(mgr,actionLinks) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -1421,6 +1422,10 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
/**
|
/**
|
||||||
* Show the current time while dragging
|
* Show the current time while dragging
|
||||||
* Used for resizing as well as drag & drop
|
* Used for resizing as well as drag & drop
|
||||||
|
*
|
||||||
|
* @param {type} element
|
||||||
|
* @param {type} position
|
||||||
|
* @param {type} height
|
||||||
*/
|
*/
|
||||||
_drag_helper: function(element, position ,height)
|
_drag_helper: function(element, position ,height)
|
||||||
{
|
{
|
||||||
@ -1444,6 +1449,10 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for dropping an event on the timegrid
|
* Handler for dropping an event on the timegrid
|
||||||
|
*
|
||||||
|
* @param {type} planner
|
||||||
|
* @param {type} event
|
||||||
|
* @param {type} ui
|
||||||
*/
|
*/
|
||||||
_event_drop: function(planner, event,ui) {
|
_event_drop: function(planner, event,ui) {
|
||||||
var e = new jQuery.Event('change');
|
var e = new jQuery.Event('change');
|
||||||
@ -1662,6 +1671,8 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Call change handler, if set
|
* Call change handler, if set
|
||||||
|
*
|
||||||
|
* @param {type} event
|
||||||
*/
|
*/
|
||||||
change: function(event) {
|
change: function(event) {
|
||||||
if (this.onchange)
|
if (this.onchange)
|
||||||
@ -1681,6 +1692,9 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Call event change handler, if set
|
* Call event change handler, if set
|
||||||
|
*
|
||||||
|
* @param {type} event
|
||||||
|
* @param {type} dom_node
|
||||||
*/
|
*/
|
||||||
event_change: function(event, dom_node) {
|
event_change: function(event, dom_node) {
|
||||||
if (this.onevent_change)
|
if (this.onevent_change)
|
||||||
@ -1887,5 +1901,5 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi
|
|||||||
// Set height for rows
|
// Set height for rows
|
||||||
this.rows.height(this.div.height() - this.headers.outerHeight());
|
this.rows.height(this.div.height() - this.headers.outerHeight());
|
||||||
}
|
}
|
||||||
});
|
});}).call(this);
|
||||||
et2_register_widget(et2_calendar_planner, ["calendar-planner"]);
|
et2_register_widget(et2_calendar_planner, ["calendar-planner"]);
|
@ -8,6 +8,11 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*egw:uses
|
||||||
|
/calendar/js/et2_widget_view.js;
|
||||||
|
/calendar/js/et2_widget_daycol.js;
|
||||||
|
/calendar/js/et2_widget_event.js;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -17,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @augments et2_valueWidget
|
* @augments et2_valueWidget
|
||||||
*/
|
*/
|
||||||
var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM],
|
var et2_calendar_planner_row = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM],
|
||||||
{
|
{
|
||||||
attributes: {
|
attributes: {
|
||||||
start_date: {
|
start_date: {
|
||||||
@ -201,7 +206,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
(holidays ? ' title="'+holidays.join(',')+'"' : '')+
|
(holidays ? ' title="'+holidays.join(',')+'"' : '')+
|
||||||
' ></div>';
|
' ></div>';
|
||||||
}
|
}
|
||||||
t.setUTCDate(t.getUTCDate()+1)
|
t.setUTCDate(t.getUTCDate()+1);
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
},
|
},
|
||||||
@ -460,8 +465,8 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM],
|
|||||||
|
|
||||||
setDetachedAttributes: function(_nodes, _values) {
|
setDetachedAttributes: function(_nodes, _values) {
|
||||||
|
|
||||||
},
|
}
|
||||||
|
|
||||||
});
|
});}).call(this);
|
||||||
|
|
||||||
et2_register_widget(et2_calendar_planner_row, ["calendar-planner_row"]);
|
et2_register_widget(et2_calendar_planner_row, ["calendar-planner_row"]);
|
@ -9,12 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
/calendar/js/et2_widget_view.js;
|
/calendar/js/et2_widget_view.js;
|
||||||
/calendar/js/et2_widget_daycol.js;
|
|
||||||
/calendar/js/et2_widget_event.js;
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,7 +27,7 @@
|
|||||||
*
|
*
|
||||||
* @augments et2_calendar_view
|
* @augments et2_calendar_view
|
||||||
*/
|
*/
|
||||||
var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable],
|
var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable],
|
||||||
{
|
{
|
||||||
createNamespace: true,
|
createNamespace: true,
|
||||||
|
|
||||||
@ -323,6 +319,10 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
/**
|
/**
|
||||||
* Show the current time while dragging
|
* Show the current time while dragging
|
||||||
* Used for resizing as well as drag & drop
|
* Used for resizing as well as drag & drop
|
||||||
|
*
|
||||||
|
* @param {type} element
|
||||||
|
* @param {type} helper
|
||||||
|
* @param {type} height
|
||||||
*/
|
*/
|
||||||
_drag_helper: function(element, helper,height)
|
_drag_helper: function(element, helper,height)
|
||||||
{
|
{
|
||||||
@ -385,6 +385,11 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for dropping an event on the timegrid
|
* Handler for dropping an event on the timegrid
|
||||||
|
*
|
||||||
|
* @param {type} timegrid
|
||||||
|
* @param {type} event
|
||||||
|
* @param {type} ui
|
||||||
|
* @param {type} dropEnd
|
||||||
*/
|
*/
|
||||||
_event_drop: function(timegrid, event,ui, dropEnd) {
|
_event_drop: function(timegrid, event,ui, dropEnd) {
|
||||||
var e = new jQuery.Event('change');
|
var e = new jQuery.Event('change');
|
||||||
@ -646,7 +651,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
|
|
||||||
this.scrolling
|
this.scrolling
|
||||||
.appendTo(this.div)
|
.appendTo(this.div)
|
||||||
.off()
|
.off();
|
||||||
|
|
||||||
// No time grid - list
|
// No time grid - list
|
||||||
if(this.options.granularity === 0)
|
if(this.options.granularity === 0)
|
||||||
@ -695,7 +700,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
};
|
};
|
||||||
var html = '';
|
var html = '';
|
||||||
var line_height = parseInt(this.div.css('line-height'));
|
var line_height = parseInt(this.div.css('line-height'));
|
||||||
this._top_time = 0
|
this._top_time = 0;
|
||||||
for(var t = 0,i = 0; t < 1440; t += granularity,++i)
|
for(var t = 0,i = 0; t < 1440; t += granularity,++i)
|
||||||
{
|
{
|
||||||
html += '<div class="calendar_calTimeRow" style="height: '+(100/row_count)+'%;">';
|
html += '<div class="calendar_calTimeRow" style="height: '+(100/row_count)+'%;">';
|
||||||
@ -712,7 +717,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
);
|
);
|
||||||
if(t <= wd_start && t + granularity > wd_start)
|
if(t <= wd_start && t + granularity > wd_start)
|
||||||
{
|
{
|
||||||
this._top_time = this.rowHeight * (i+1+(wd_start - (t+granularity))/granularity)
|
this._top_time = this.rowHeight * (i+1+(wd_start - (t+granularity))/granularity);
|
||||||
}
|
}
|
||||||
|
|
||||||
var time_label = (typeof show[granularity] === 'undefined' ? t % 60 === 0 : show[granularity].indexOf(t % 60) !== -1) ? time : '';
|
var time_label = (typeof show[granularity] === 'undefined' ? t % 60 === 0 : show[granularity].indexOf(t % 60) !== -1) ? time : '';
|
||||||
@ -1009,7 +1014,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
if(!parent)
|
if(!parent)
|
||||||
{
|
{
|
||||||
debugger;
|
debugger;
|
||||||
egw.debug('error','No parent objectManager found')
|
egw.debug('error','No parent objectManager found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1128,6 +1133,9 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Automatically add dnd support for linking
|
* Automatically add dnd support for linking
|
||||||
|
*
|
||||||
|
* @param {type} mgr
|
||||||
|
* @param {type} actionLinks
|
||||||
*/
|
*/
|
||||||
_init_links_dnd: function(mgr,actionLinks) {
|
_init_links_dnd: function(mgr,actionLinks) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -1298,9 +1306,9 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
* 20150502: [...]
|
* 20150502: [...]
|
||||||
* }
|
* }
|
||||||
* Days should be in order.
|
* Days should be in order.
|
||||||
* @param {string|number|Date} events.start_date - New start date
|
* {string|number|Date} events.start_date - New start date
|
||||||
* @param {string|number|Date} events.end_date - New end date
|
* {string|number|Date} events.end_date - New end date
|
||||||
* @param {number|number[]|string|string[]} event.owner - Owner ID, which can
|
* {number|number[]|string|string[]} event.owner - Owner ID, which can
|
||||||
* be an account ID, a resource ID (as defined in calendar_bo, not
|
* be an account ID, a resource ID (as defined in calendar_bo, not
|
||||||
* necessarily an entry from the resource app), or a list containing a
|
* necessarily an entry from the resource app), or a list containing a
|
||||||
* combination of both.
|
* combination of both.
|
||||||
@ -1415,7 +1423,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.owner.options.application = 'home-accounts'
|
this.owner.options.application = 'home-accounts';
|
||||||
this.owner.set_value(typeof _owner == "string" || typeof _owner == "number" ? _owner : jQuery.extend([],_owner));
|
this.owner.set_value(typeof _owner == "string" || typeof _owner == "number" ? _owner : jQuery.extend([],_owner));
|
||||||
this.set_label('');
|
this.set_label('');
|
||||||
$j(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode());
|
$j(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode());
|
||||||
@ -1528,6 +1536,9 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Call event change handler, if set
|
* Call event change handler, if set
|
||||||
|
*
|
||||||
|
* @param {type} event
|
||||||
|
* @param {type} dom_node
|
||||||
*/
|
*/
|
||||||
event_change: function(event, dom_node) {
|
event_change: function(event, dom_node) {
|
||||||
if (this.onevent_change)
|
if (this.onevent_change)
|
||||||
@ -1745,7 +1756,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
|
|
||||||
// Resizable interface
|
// Resizable interface
|
||||||
/**
|
/**
|
||||||
* @param {boolean} [too_small=null] Force the widget to act as if it was too small
|
* @param {boolean} [_too_small=null] Force the widget to act as if it was too small
|
||||||
*/
|
*/
|
||||||
resize: function (_too_small)
|
resize: function (_too_small)
|
||||||
{
|
{
|
||||||
@ -1833,5 +1844,5 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes
|
|||||||
day.set_width(day_width + 'px');
|
day.set_width(day_width + 'px');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});}).call(this);
|
||||||
et2_register_widget(et2_calendar_timegrid, ["calendar-timegrid"]);
|
et2_register_widget(et2_calendar_timegrid, ["calendar-timegrid"]);
|
@ -8,8 +8,6 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
/*egw:uses
|
/*egw:uses
|
||||||
/etemplate/js/et2_core_valueWidget;
|
/etemplate/js/et2_core_valueWidget;
|
||||||
*/
|
*/
|
||||||
@ -23,7 +21,7 @@
|
|||||||
*
|
*
|
||||||
* @augments et2_valueWidget
|
* @augments et2_valueWidget
|
||||||
*/
|
*/
|
||||||
var et2_calendar_view = et2_valueWidget.extend(
|
var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend(
|
||||||
{
|
{
|
||||||
createNamespace: true,
|
createNamespace: true,
|
||||||
|
|
||||||
@ -41,7 +39,7 @@ var et2_calendar_view = et2_valueWidget.extend(
|
|||||||
end_date: {
|
end_date: {
|
||||||
name: "End date",
|
name: "End date",
|
||||||
type: "any"
|
type: "any"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -253,9 +251,9 @@ var et2_calendar_view = et2_valueWidget.extend(
|
|||||||
* 20150502: [...]
|
* 20150502: [...]
|
||||||
* }
|
* }
|
||||||
* Days should be in order.
|
* Days should be in order.
|
||||||
* @param {string|number|Date} events.start_date - New start date
|
* {string|number|Date} events.start_date - New start date
|
||||||
* @param {string|number|Date} events.end_date - New end date
|
* {string|number|Date} events.end_date - New end date
|
||||||
* @param {number|number[]|string|string[]} event.owner - Owner ID, which can
|
* {number|number[]|string|string[]} event.owner - Owner ID, which can
|
||||||
* be an account ID, a resource ID (as defined in calendar_bo, not
|
* be an account ID, a resource ID (as defined in calendar_bo, not
|
||||||
* necessarily an entry from the resource app), or a list containing a
|
* necessarily an entry from the resource app), or a list containing a
|
||||||
* combination of both.
|
* combination of both.
|
||||||
@ -333,7 +331,7 @@ var et2_calendar_view = et2_valueWidget.extend(
|
|||||||
}
|
}
|
||||||
else // users
|
else // users
|
||||||
{
|
{
|
||||||
user = parseInt(user)
|
user = parseInt(user);
|
||||||
var accounts = egw.accounts('both');
|
var accounts = egw.accounts('both');
|
||||||
for(var j = 0; j < accounts.length; j++)
|
for(var j = 0; j < accounts.length; j++)
|
||||||
{
|
{
|
||||||
@ -376,9 +374,9 @@ var et2_calendar_view = et2_valueWidget.extend(
|
|||||||
result.widget_id = 'event_' + widget_id.join('');
|
result.widget_id = 'event_' + widget_id.join('');
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
},
|
}
|
||||||
|
|
||||||
});
|
});}).call(this);
|
||||||
|
|
||||||
// Static class stuff
|
// Static class stuff
|
||||||
jQuery.extend(et2_calendar_view,
|
jQuery.extend(et2_calendar_view,
|
||||||
|
Loading…
Reference in New Issue
Block a user