diff --git a/customize.dist/src/less2/include/sidebar-layout.less b/customize.dist/src/less2/include/sidebar-layout.less index ef93eae4a..1b0c75932 100644 --- a/customize.dist/src/less2/include/sidebar-layout.less +++ b/customize.dist/src/less2/include/sidebar-layout.less @@ -69,7 +69,7 @@ background: @cp_sidebar-right-bg; color: @cp_sidebar-right-fg; overflow: auto; - padding-bottom: 200px; + //padding-bottom: 200px; // XXX what was the intent behind this? // Following rules are only in settings .cp-sidebarlayout-element { diff --git a/www/calendar/export.js b/www/calendar/export.js index 64775762b..5967e2027 100644 --- a/www/calendar/export.js +++ b/www/calendar/export.js @@ -123,6 +123,7 @@ define([ var jcalData = ICAL.parse(content); vcalendar = new ICAL.Component(jcalData); } catch (e) { + console.error(e); return void cb(e); } @@ -147,6 +148,18 @@ define([ var isAllDay = false; var start = ev.getFirstPropertyValue('dtstart'); var end = ev.getFirstPropertyValue('dtend'); + var duration = ev.getFirstPropertyValue('duration'); + if (!end && !duration) { + if (start.isDate) { + end = start.clone(); + end.adjust(1); // Add one day + } else { + end = start.clone(); + } + } else if (!end) { + end = start.clone(); + end.addDuration(duration); + } if (start.isDate && end.isDate) { isAllDay = true; start = String(start); @@ -175,7 +188,7 @@ define([ hidden.push(al.toString()); } var trigger = al.getFirstPropertyValue('trigger'); - var minutes = -trigger.toSeconds() / 60; + var minutes = trigger ? (-trigger.toSeconds() / 60) : 0; if (reminders.indexOf(minutes) === -1) { reminders.push(minutes); } }); diff --git a/www/calendar/inner.js b/www/calendar/inner.js index 21cb12789..a1fd8c8e8 100644 --- a/www/calendar/inner.js +++ b/www/calendar/inner.js @@ -566,7 +566,7 @@ define([ attributes: { 'class': 'fa fa-trash-o', }, - content: h('span', Messages.kanban_delete), + content: h('span', Messages.kanban_delete), // XXX delete key is misleading... "Remove" ? `poll_remove`, `fc_remove` action: function (e) { e.stopPropagation(); var cal = APP.calendars[id]; @@ -586,8 +586,9 @@ define([ }, function (err) { if (err) { console.error(err); - UI.warn(Messages.error); + return void UI.warn(Messages.error); } + renderCalendar(); }); }); } @@ -722,7 +723,7 @@ define([ if (!calendars.length) { return; } var team = privateData.teams[teamId]; var avatar = h('span.cp-avatar'); - common.displayAvatar($(avatar), team.avatar, team.displayName); + common.displayAvatar($(avatar), team.avatar, team.displayName || team.name); APP.$calendars.append(h('div.cp-calendar-team', [ avatar, h('span.cp-name', {title: team.name}, team.name) diff --git a/www/support/ui.js b/www/support/ui.js index fac6ef438..2f97ec412 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -10,14 +10,12 @@ define([ '/customize/messages.js', ], function ($, ApiConfig, h, UI, Hash, Util, Clipboard, UIElements, Messages) { - var send = function (ctx, id, type, data, dest) { + var getDebuggingData = function (ctx, data) { var common = ctx.common; - var supportKey = ApiConfig.supportMailbox; - var supportChannel = Hash.getChannelIdFromKey(supportKey); var metadataMgr = common.getMetadataMgr(); - var user = metadataMgr.getUserData(); var privateData = metadataMgr.getPrivateData(); - + var user = metadataMgr.getUserData(); + var teams = privateData.teams || {}; data = data || {}; data.sender = { @@ -34,16 +32,12 @@ define([ data.sender.quota = ctx.pinUsage; } - data.id = id; - data.time = +new Date(); - - var teams = privateData.teams || {}; if (!ctx.isAdmin) { data.sender.userAgent = Util.find(window, ['navigator', 'userAgent']); data.sender.vendor = Util.find(window, ['navigator', 'vendor']); data.sender.appVersion = Util.find(window, ['navigator', 'appVersion']); - data.sender.appVersion = Util.find(window, ['screen', 'width']); - data.sender.appVersion = Util.find(window, ['screen', 'height']); + data.sender.screenWidth = Util.find(window, ['screen', 'width']); + data.sender.screenHeight = Util.find(window, ['screen', 'height']); data.sender.blockLocation = privateData.blockLocation || ''; data.sender.teams = Object.keys(teams).map(function (key) { var team = teams[key]; @@ -57,7 +51,25 @@ define([ } return ret; }).filter(Boolean); + } + return data; + }; + + var send = function (ctx, id, type, data, dest) { + var common = ctx.common; + var supportKey = ApiConfig.supportMailbox; + var supportChannel = Hash.getChannelIdFromKey(supportKey); + var metadataMgr = common.getMetadataMgr(); + var user = metadataMgr.getUserData(); + var privateData = metadataMgr.getPrivateData(); + + data = getDebuggingData(ctx, data); + + data.id = id; + data.time = +new Date(); + + if (!ctx.isAdmin) { // "dest" is the recipient that is not the admin support mailbox. // In the support page, make sure dest is always ourselves. dest.channel = privateData.support; @@ -474,6 +486,10 @@ define([ ui.makeCloseMessage = function (content, hash) { return makeCloseMessage(ctx, content, hash); }; + ui.getDebuggingData = function (data) { + return getDebuggingData(ctx, data); + }; + return ui; };