From 04396aeb570c00587518339b57c57b4682629b15 Mon Sep 17 00:00:00 2001 From: "shaver%mozilla.org" Date: Thu, 24 Mar 2005 18:38:14 +0000 Subject: [PATCH] - Convert to chrome.manifest, removing contents.rdf and outdated install.rdf stanza. - Remove fake-account mess, replacing it with a sidebar model. --- calendar/lightning/Makefile.in | 3 +- calendar/lightning/chrome.manifest | 3 ++ .../lightning/content/calendar-management.js | 44 +++++++++++++++++++ calendar/lightning/content/contents.rdf | 0 calendar/lightning/content/fake-account.js | 0 .../content/messenger-overlay-sidebar.xul | 29 ++++++++++++ .../lightning/content/messenger-overlay.xul | 0 calendar/lightning/install.rdf | 9 ---- calendar/lightning/jar.mn | 6 +-- calendar/lightning/locale/contents.rdf | 0 10 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 calendar/lightning/chrome.manifest create mode 100644 calendar/lightning/content/calendar-management.js delete mode 100644 calendar/lightning/content/contents.rdf delete mode 100644 calendar/lightning/content/fake-account.js create mode 100644 calendar/lightning/content/messenger-overlay-sidebar.xul delete mode 100644 calendar/lightning/content/messenger-overlay.xul delete mode 100644 calendar/lightning/locale/contents.rdf diff --git a/calendar/lightning/Makefile.in b/calendar/lightning/Makefile.in index ba216c667db..f5e252978f9 100644 --- a/calendar/lightning/Makefile.in +++ b/calendar/lightning/Makefile.in @@ -44,10 +44,9 @@ include $(DEPTH)/config/autoconf.mk MODULE = lightning -ifndef LIGHTNING_IN_TREE export XPI_NAME = lightning +XPI_INSTALL_EXTRAS = $(srcdir)/chrome.manifest XPI_PKGNAME = lightning DIRS = ../../db/sqlite3/src ../../storage ../libical ../base -endif include $(topsrcdir)/config/rules.mk diff --git a/calendar/lightning/chrome.manifest b/calendar/lightning/chrome.manifest new file mode 100644 index 00000000000..c62671b11de --- /dev/null +++ b/calendar/lightning/chrome.manifest @@ -0,0 +1,3 @@ +content lightning jar:chrome/lightning.jar!/content/lightning/ +locale lightning en-US jar:chrome/en-US.jar!/locale/en-US/lightning/ +overlay chrome://messenger/content/messenger.xul chrome://lightning/content/messenger-overlay-sidebar.xul diff --git a/calendar/lightning/content/calendar-management.js b/calendar/lightning/content/calendar-management.js new file mode 100644 index 00000000000..83f7ed669d5 --- /dev/null +++ b/calendar/lightning/content/calendar-management.js @@ -0,0 +1,44 @@ +function getCalendarManager() +{ + return Components.classes["@mozilla.org/calendar/manager;1"].getService(Components.interfaces.calICalendarManager); +} + +function getCalendars() +{ + return getCalendarManager().getCalendars({}); +} + +var ltnCalendarTreeView = { + get rowCount() + { + try { + return getCalendars().length; + } catch (e) { + return 0; + } + }, + getCellText: function (row, col) + { + try { + return getCalendars()[row].name; + } catch (e) { + return ""; + } + }, + setTree: function(treebox) { this.treebox = treebox; }, + isContainer: function(row) { return false; }, + isSeparator: function(row) { return false; }, + isSorted: function(row) { return false; }, + getLevel: function(row) { return 0; }, + getImageSrc: function(row, col) { return null; }, + getRowProperties: function(row, props) { }, + getCellProperties: function(row, col, props) { }, + getColumnProperties: function(colid, col, props) { } +}; + +function ltnSetTreeView() +{ + document.getElementById("calendarTree").view = ltnCalendarTreeView; +} + +window.addEventListener("load", ltnSetTreeView, false); diff --git a/calendar/lightning/content/contents.rdf b/calendar/lightning/content/contents.rdf deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/calendar/lightning/content/fake-account.js b/calendar/lightning/content/fake-account.js deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/calendar/lightning/content/messenger-overlay-sidebar.xul b/calendar/lightning/content/messenger-overlay-sidebar.xul new file mode 100644 index 00000000000..04e9d0418e7 --- /dev/null +++ b/calendar/lightning/content/messenger-overlay-sidebar.xul @@ -0,0 +1,29 @@ + + + + + + +