- Convert to chrome.manifest, removing contents.rdf and outdated install.rdf

stanza.
- Remove fake-account mess, replacing it with a sidebar model.
This commit is contained in:
shaver%mozilla.org 2005-03-24 18:38:14 +00:00
parent 693db6d988
commit bff53e291f
10 changed files with 79 additions and 155 deletions

View File

@ -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

View File

@ -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

View File

@ -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 "<Unknown " + row + ">";
}
},
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);

View File

@ -1,30 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:lightning"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:lightning"
chrome:displayName="Lightning (Calendar)"
chrome:author="Mozilla Calendar Team"
chrome:name="lightning"
chrome:description="This extension integrates calendar functionality into Thunderbird."
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
#expand chrome:skinVersion="__MOZILLA_SKIN_VERSION__"
/>
<!-- overlay information -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://messenger/content/messenger.xul"/>
</RDF:Seq>
<RDF:Seq about="chrome://messenger/content/messenger.xul">
<RDF:li>chrome://lightning/content/messenger-overlay.xul</RDF:li>
</RDF:Seq>
</RDF:RDF>

View File

@ -1,70 +0,0 @@
function ltndbg(s)
{
dump("LTN: " + s + "\n");
}
var ltnAccount;
const LTN_FAKE_ACCOUNT_KEY = "lightning-fake-account";
const LTN_SERVER_NAME = "Calendars"; // XXX l10n
const LTN_FAKE_USER = "lightning-fake-user";
const LTN_SERVER_HOSTNAME = "lightning";
function ltnEnsureFakeAccount()
{
ltnAccount = /*TBG*/accountManager.getAccount(LTN_FAKE_ACCOUNT_KEY);
if (ltnAccount.incomingServer.username == LTN_FAKE_USER) {
ltndbg("found fake account: " + ltnAccount);
return;
}
ltndbg("creating fake account");
var server = /*TBG*/accountManager.
createIncomingServer(LTN_FAKE_USER, LTN_SERVER_HOSTNAME, "none");
server.prettyName = LTN_SERVER_NAME;
ltnAccount.incomingServer = server;
/*TBG*/accountManager.saveAccountInfo();
ltndbg("created: " + ltnAccount);
}
ltnEnsureFakeAccount();
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Oracle Corporation code.
*
* The Initial Developer of the Original Code is
* Oracle Corporation
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Mike Shaver <shaver@off.net>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

View File

@ -0,0 +1,29 @@
<?xml version="1.0"?>
<!-- DOCTYPE overlay SYSTEM "chrome://lightning/locale/lightning.dtd" -->
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://lightning/content/calendar-management.js"/>
<vbox id="folderPaneBox">
<splitter id="folderpaneCalendarSplitter" collapse="after" persist="state"/>
<popupset>
<popup id="ltnCalendarTreeContext" onpopupshowing="return true;">
<menuitem id="ltnCalendarTreeContext-newCalendar"
label="New Calendar"
oncommand="ltnNewCalendar();"/>
</popup>
</popupset>
<tree id="calendarTree" flex="1" context="ltnCalendarTreeContext">
<treecols>
<treecol label="Calendar" id="col-calendar-Calendar" flex="1"/>
</treecols>
<treechildren>
</treechildren>
</tree>
</vbox>
</overlay>

View File

@ -1,16 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE overlay SYSTEM "chrome://lightning/locale/lightning.dtd">
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<window id="messengerWindow">
<script type="application/x-javascript"
src="chrome://lightning/content/fake-account.js"/>
</window>
<popup id="threadPaneContext">
<menuitem id="test" label="Overlay Test"/>
</popup>
</overlay>

View File

@ -21,14 +21,5 @@
<em:description>An experimental calendar extension for Thunderbird</em:description>
<em:creator>Mozilla Foundation Calendar Squad</em:creator>
<em:file>
<Description about="urn:mozilla:extension:file:lightning.jar">
<em:package>content/lightning/</em:package>
</Description>
<Description about="urn:mozilla:extension:file:en-US.jar">
<em:locale>locale/en-US/lightning/</em:locale>
</Description>
</em:file>
</Description>
</RDF>

View File

@ -1,8 +1,6 @@
lightning.jar:
* content/lightning/contents.rdf (content/contents.rdf)
content/lightning/messenger-overlay.xul (content/messenger-overlay.xul)
content/lightning/fake-account.js (content/fake-account.js)
content/lightning/messenger-overlay-sidebar.xul (content/messenger-overlay-sidebar.xul)
content/lightning/calendar-management.js (content/calendar-management.js)
en-US.jar:
locale/en-US/lightning/lightning.dtd (locale/lightning.dtd)
* locale/en-US/lightning/contents.rdf (locale/contents.rdf)

View File

@ -1,24 +0,0 @@
<?xml version="1.0"?>
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the skins being supplied by this package -->
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<!-- locale information -->
<RDF:Description about="urn:mozilla:locale:en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:lightning"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
<!-- Version Information. State that we work only with major version of this
package. -->
<RDF:Description about="urn:mozilla:locale:en-US:lightning"
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"/>
</RDF:RDF>