remove hardcoded translations

and add a contextmenu handler for the calendar sidebar
pull/1/head
ansuz 4 years ago
parent efdbab386c
commit bf65a577dd

@ -58,41 +58,6 @@ define([
var metadataMgr; var metadataMgr;
var sframeChan; var sframeChan;
Messages.calendar = "BETA Calendar"; // XXX
Messages.calendar_default = "My calendar"; // XXX
Messages.calendar_new = "New calendar"; // XXX
Messages.calendar_day = "Day";
Messages.calendar_week = "Week";
Messages.calendar_month = "Month";
Messages.calendar_today = "Today";
Messages.calendar_more = "{0} more";
Messages.calendar_deleteConfirm = "Are you sure you want to delete this calendar from your account?";
Messages.calendar_deleteTeamConfirm = "Are you sure you want to delete this calendar from this team?";
Messages.calendar_deleteOwned = " It will still be visible for the users it has been shared with.";
Messages.calendar_errorNoCalendar = "No editable calendar selected!";
Messages.calendar_tempCalendar = "Viewing";
Messages.calendar_import = "Import to my calendars";
Messages.calendar_import_temp = "Import this calendar";
Messages.calendar_newEvent = "New event";
Messages.calendar_new = "New calendar";
Messages.calendar_dateRange = "{0} - {1}";
Messages.calendar_dateTimeRange = "{0} {1} - {2}";
Messages.calendar_weekNumber = "Week {0}";
Messages.calendar_update = "Update";
Messages.calendar_title = "Title";
Messages.calendar_loc = "Location";
Messages.calendar_location = "Location: {0}";
Messages.calendar_allDay = "All day";
Messages.calendar_minutes = "Minutes";
Messages.calendar_hours = "Hours";
Messages.calendar_days = "Days";
Messages.calendar_before = "before";
Messages.calendar_notifications = "Reminders";
Messages.calendar_addNotification = "Add reminder";
Messages.calendar_noNotification = "None";
var onCalendarsUpdate = Util.mkEvent(); var onCalendarsUpdate = Util.mkEvent();
var newCalendar = function (data, cb) { var newCalendar = function (data, cb) {
@ -603,15 +568,15 @@ Messages.calendar_noNotification = "None";
action: function (e) { action: function (e) {
e.stopPropagation(); e.stopPropagation();
var cal = APP.calendars[id]; var cal = APP.calendars[id];
var key = Messages.calendar_deleteConfirm;
var teams = (cal && cal.teams) || []; var teams = (cal && cal.teams) || [];
var text = [ Messages.calendar_deleteConfirm ];
if (teams.length === 1 && teams[0] !== 1) { if (teams.length === 1 && teams[0] !== 1) {
key = Messages.calendar_deleteTeamConfirm; text[0] = Messages.calendar_deleteTeamConfirm;
} }
if (cal.owned) { if (cal.owned) {
key += Messages.calendar_deleteOwned; text = text.concat([' ', Messages.calendar_deleteOwned]);
} }
UI.confirm(key, function (yes) { UI.confirm(h('span', text), function (yes) {
if (!yes) { return; } if (!yes) { return; }
deleteCalendar({ deleteCalendar({
id: id, id: id,
@ -663,7 +628,7 @@ Messages.calendar_noNotification = "None";
(isReadOnly(id, teamId) ? h('i.fa.fa-eye', {title: Messages.readonly}) : undefined), (isReadOnly(id, teamId) ? h('i.fa.fa-eye', {title: Messages.readonly}) : undefined),
edit edit
]); ]);
$(calendar).click(function () { var $calendar = $(calendar).click(function () {
if (teamId === 0) { return; } if (teamId === 0) { return; }
data.hidden = !data.hidden; data.hidden = !data.hidden;
if (APP.$calendars) { if (APP.$calendars) {
@ -674,6 +639,12 @@ Messages.calendar_noNotification = "None";
renderCalendar(); renderCalendar();
}); });
if (!data.loading) {
$calendar.contextmenu(function (ev) {
ev.preventDefault();
$(edit).click();
});
}
if (APP.$calendars) { APP.$calendars.append(calendar); } if (APP.$calendars) { APP.$calendars.append(calendar); }
return calendar; return calendar;
}; };

@ -461,13 +461,6 @@ define([
} }
}; };
Messages.reminder_missed = "You missed <b>{0}</b> on {1}"; // XXX
Messages.reminder_now = "<b>{0}</b> is starting!"; // XXX
Messages.reminder_inProgress = "<b>{0}</b> has started on {1}"; // XXX
Messages.reminder_inProgressAllDay = "<b>{0}</b> is happening today"; // XXX
Messages.reminder_minutes = "<b>{0}</b> will start in {1} minutes!"; // XXX
Messages.reminder_time = "<b>{0}</b> will start today at {1}!"; // XXX
Messages.reminder_date = "<b>{0}</b> will start on {1}!"; // XXX
handlers['REMINDER'] = function (common, data) { handlers['REMINDER'] = function (common, data) {
var content = data.content; var content = data.content;
var msg = content.msg.content; var msg = content.msg.content;

@ -46,7 +46,6 @@ define([
var t = rect.bottom + $iframe.scrollTop() +'px'; var t = rect.bottom + $iframe.scrollTop() +'px';
var text = href; var text = href;
Messages.pad_goToAnchor = "Go to anchor"; // XXX
if (text[0] === '#') { text = Messages.pad_goToAnchor; } if (text[0] === '#') { text = Messages.pad_goToAnchor; }
var a = h('a', { href: href}, text); var a = h('a', { href: href}, text);
var link = h('div.cp-link-clicked.non-realtime', { var link = h('div.cp-link-clicked.non-realtime', {

@ -84,7 +84,7 @@ define([
'cp-settings-pad-width', 'cp-settings-pad-width',
'cp-settings-pad-spellcheck', 'cp-settings-pad-spellcheck',
'cp-settings-pad-notif', 'cp-settings-pad-notif',
'cp-settings-pad-openlink', // XXX test, translate and re-enable 'cp-settings-pad-openlink',
], ],
'code': [ // Msg.settings_cat_code 'code': [ // Msg.settings_cat_code
'cp-settings-code-indent-unit', 'cp-settings-code-indent-unit',
@ -1603,10 +1603,6 @@ define([
cb($d); cb($d);
}, true); }, true);
Messages.settings_notifCalendarTitle = "Calendar notifications"; // XXX
Messages.settings_notifCalendarHint = "You can disable completely calendar notifications for incoming events.";
Messages.settings_notifCalendarCheckbox = "Enable calendar notifications";
makeBlock('notif-calendar', function(cb) { // Msg.settings_notifCalendarHint, .settings_notifCalendarTitle makeBlock('notif-calendar', function(cb) { // Msg.settings_notifCalendarHint, .settings_notifCalendarTitle
var $cbox = $(UI.createCheckbox('cp-settings-cache', var $cbox = $(UI.createCheckbox('cp-settings-cache',

Loading…
Cancel
Save