Pin and unpin calendars

pull/1/head
yflory 4 years ago
parent 2987e468a9
commit 15d582e810

@ -22,6 +22,9 @@
.tui-full-calendar-month * { .tui-full-calendar-month * {
color: @cryptpad_text_col !important; // XXX color: @cryptpad_text_col !important; // XXX
} }
.tui-full-calendar-dayname * {
color: @cryptpad_text_col !important; // XXX
}
} }
.tui-full-calendar-timegrid-timezone { .tui-full-calendar-timegrid-timezone {
background-color: @cp_sidebar-right-bg !important; background-color: @cp_sidebar-right-bg !important;

@ -212,6 +212,13 @@ define([
list = list.concat(mList); list = list.concat(mList);
} }
if (store.proxy.calendars) {
var cList = Object.keys(store.proxy.calendars).map(function (c) {
return store.proxy.calendars[c].channel;
});
list = list.concat(cList);
}
list.push(userChannel); list.push(userChannel);
list.sort(); list.sort();

@ -264,7 +264,12 @@ ctx.calendars[channel] = {
} }
// Add the calendar and call back // Add the calendar and call back
c[cal.channel] = cal; c[cal.channel] = cal;
// XXX PIN (also make sure it's included in the reset) var pin = store.pin || ctx.pinPads;
pin([cal.channel], function (res) {
if (res && res.error) {
console.error(res.error);
}
});
ctx.Store.onSync(store.id, cb); ctx.Store.onSync(store.id, cb);
}); });
}; };
@ -292,6 +297,12 @@ ctx.calendars[channel] = {
if (!cal) { return void cb(); } // Already deleted if (!cal) { return void cb(); } // Already deleted
delete store.proxy.calendars[id]; delete store.proxy.calendars[id];
var unpin = store.unpin || ctx.unpinPads;
unpin([id], function (res) {
if (res && res.error) {
console.error(res.error);
}
});
ctx.Store.onSync(store.id, cb); ctx.Store.onSync(store.id, cb);
// XXX broadcast to inner // XXX broadcast to inner
}; };

@ -154,6 +154,13 @@ define([
if (membersChannel) { list.push(membersChannel); } if (membersChannel) { list.push(membersChannel); }
if (mailboxChannel) { list.push(mailboxChannel); } if (mailboxChannel) { list.push(mailboxChannel); }
if (store.proxy.calendars) {
var cList = Object.keys(store.proxy.calendars).map(function (c) {
return store.proxy.calendars[c].channel;
});
list = list.concat(cList);
}
var state = store.roster.getState(); var state = store.roster.getState();
if (state.members) { if (state.members) {
Object.keys(state.members).forEach(function (curve) { Object.keys(state.members).forEach(function (curve) {

Loading…
Cancel
Save