[Pkg-mozext-commits] [sage-extension] 08/20: feed discovery, many updates

David Prévot taffit at moszumanska.debian.org
Fri May 1 03:10:25 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag sage_1_2
in repository sage-extension.

commit b725c78a29a7ca94bff6a15adf56fe65c911c4e5
Author: Peter Andrews <petea at jhu.edu>
Date:   Fri Jul 9 05:06:21 2004 +0000

    feed discovery, many updates
---
 src/sage/content/commonfunc.js              |  86 +++++++++++++++++---
 src/sage/content/createhtml.js              |   2 +-
 src/sage/content/discover_feeds.js          | 117 ++++++++++++++++++++++++++++
 src/sage/content/discover_feeds.xul         |  78 +++++++++++++++++++
 src/sage/content/feedlib.js                 |  64 +++++++++++----
 src/sage/content/getrsstitle.js             |   2 +-
 src/sage/content/res/template-html.txt      |   1 +
 src/sage/content/sage.js                    | 112 +++++++++-----------------
 src/sage/content/sage.xul                   |   5 +-
 src/sage/content/settings/exUnregisterer.js |   4 +-
 src/sage/content/settings/settings.js       |   2 +-
 src/sage/content/settings/settings.xul      |  30 ++++++-
 src/sage/content/updatechecker.js           |  60 +++++++-------
 src/sage/locale/en-US/sage.dtd              |   2 +
 src/sage/locale/en-US/sage.properties       |   7 +-
 src/sage/locale/fr-FR/sage.dtd              |   2 +
 src/sage/locale/fr-FR/sage.properties       |   7 +-
 src/sage/locale/hu-HU/sage.dtd              |   2 +
 src/sage/locale/hu-HU/sage.properties       |   7 +-
 src/sage/locale/ja-JP/sage.dtd              |   3 +-
 src/sage/locale/ja-JP/sage.properties       |   7 +-
 src/sage/skin/classic/sage.css              |  34 +++++++-
 src/sage/skin/classic/sage.xbl              |  13 ++++
 src/sage/skin/classic/toolbar.png           | Bin 0 -> 4126 bytes
 24 files changed, 503 insertions(+), 144 deletions(-)

diff --git a/src/sage/content/commonfunc.js b/src/sage/content/commonfunc.js
index 29d3ae5..a52c613 100755
--- a/src/sage/content/commonfunc.js
+++ b/src/sage/content/commonfunc.js
@@ -1,3 +1,72 @@
+
+var aConsoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
+
+function logMessage(message) {
+	aConsoleService.logStringMessage("Sage: " + message);
+}
+
+function dateFormat(date, twelveHourClock, format) {
+	function padout(number) { return (number < 10) ? '0' + number : number; }
+
+	if(!format) {
+		format = 0;
+	}
+	
+	var dayOfMonth = date.getDate();
+
+	var day;
+	switch (date.getDay()) {
+		case 0: day = strRes.getString("date_sunday_short"); break
+		case 1: day = strRes.getString("date_monday_short"); break
+		case 2: day = strRes.getString("date_tuesday_short"); break
+		case 3: day = strRes.getString("date_wednesday_short"); break
+		case 4: day = strRes.getString("date_thursday_short"); break
+		case 5: day = strRes.getString("date_friday_short"); break
+		case 6: day = strRes.getString("date_saturday_short"); break
+	}
+
+	var month, monthNum;
+	monthNum = date.getMonth() + 1;
+	switch (monthNum) {
+		case 1: month = strRes.getString("date_january_short"); break
+		case 2: month = strRes.getString("date_february_short"); break
+		case 3: month = strRes.getString("date_march_short"); break
+		case 4: month = strRes.getString("date_april_short"); break
+		case 5: month = strRes.getString("date_may_short"); break
+		case 6: month = strRes.getString("date_june_short"); break
+		case 7: month = strRes.getString("date_july_short"); break
+		case 8: month = strRes.getString("date_august_short"); break
+		case 9: month = strRes.getString("date_september_short"); break
+		case 10: month = strRes.getString("date_october_short"); break
+		case 11: month = strRes.getString("date_november_short"); break
+		case 12: month = strRes.getString("date_december_short"); break
+	}
+
+	var year = date.getYear() + 1900;
+
+	var date_str;
+	switch(format) {
+		case 0:
+			date_str = day + ", " + month + " " + dayOfMonth + ", " + year;
+			break
+		case 1:
+			date_str = monthNum + "/" + dayOfMonth + "/" + year;
+			break
+	}
+
+	var hours = date.getHours(), minutes = padout(date.getMinutes()), seconds = padout(date.getSeconds());
+	var adjhours, time_str;
+	if(twelveHourClock) {
+		adjhours = (hours == 0) ? 12 : ((hours < 13) ? hours : hours-12);
+		time_str = adjhours + ":" + minutes + ((hours < 12) ? " AM" : " PM");
+	} else {
+		time_str = hours + ":" + minutes;
+	}
+	return date_str + " " + time_str;
+}
+
+
+
 var CommonFunc = {
 
 	RSS_READER_FOLDER_ID: "sage.folder_id",
@@ -25,29 +94,28 @@ var CommonFunc = {
 	STATUS_ERROR: "error",
 	STATUS_NO_CHECK: "no-check",
 
-	setBMDSProperty: function(aInput, aArcURI, aNewValue){
+	setBMDSProperty: function(aInput, aArcURI, aNewValue) {
 		var changed = false;
 		var aOldValue = this.getBMDSTargetByURL(aInput, aArcURI);		
-		if(typeof(aInput) == "string"){
+		if(typeof(aInput) == "string") {
 			aInput = RDF.GetResource(aInput);
 		}
-		if(typeof(aArcURI) == "string"){
+		if(typeof(aArcURI) == "string") {
 			aArcURI = RDF.GetResource(aArcURI);
 		}
 
-		if(typeof(aNewValue) == "string"){
+		if(typeof(aNewValue) == "string") {
 			aNewValue = RDF.GetLiteral(aNewValue);
-		}else if(typeof(aNewValue) == "number"){
+		} else if(typeof(aNewValue) == "number") {
 			aNewValue = RDF.GetIntLiteral(aNewValue);		
 		}
-
 		
 		if(aArcURI && (aOldValue || aNewValue) && aOldValue != aNewValue) {
-			if(aOldValue && !aNewValue){
+			if(aOldValue && !aNewValue) {
 				BMDS.Unassert(aInput, aArcURI, aOldValue);
-			}else if (!aOldValue && aNewValue){
+			} else if(!aOldValue && aNewValue) {
 				BMDS.Assert(aInput, aArcURI, aNewValue, true);
-			}else /* if (aOldValue && aNewValue) */ {
+			} else /* if(aOldValue && aNewValue) */ {
 				BMDS.Change(aInput, aArcURI, aOldValue, aNewValue);
 			}
 			changed = true;
diff --git a/src/sage/content/createhtml.js b/src/sage/content/createhtml.js
index 435b0b6..e5c109b 100755
--- a/src/sage/content/createhtml.js
+++ b/src/sage/content/createhtml.js
@@ -79,7 +79,7 @@ var CreateHTML = {
 		}
 		htmlSource = htmlSource.replace("**HTMLTITLE**", feed.getTitle());
 		htmlSource = htmlSource.replace("**TITLE**", feed.getTitle());
-		htmlSource = htmlSource.replace("**LINK**", feed.getLink());
+		htmlSource = htmlSource.replace(/\*\*LINK\*\*/g, feed.getLink());
 		htmlSource = htmlSource.replace("**DESCRIPTION**", feed.getDescription());
 
 		var itemsSource = "";
diff --git a/src/sage/content/discover_feeds.js b/src/sage/content/discover_feeds.js
new file mode 100644
index 0000000..bbb386c
--- /dev/null
+++ b/src/sage/content/discover_feeds.js
@@ -0,0 +1,117 @@
+
+var strRes;
+var feedTree;
+var dataSource;
+var rdf;
+var feeds;
+var ds;
+var rdfService;
+var schema;
+var document_host;
+
+function init() {
+	strRes = document.getElementById("strRes");
+	feedTree = document.getElementById("feedTree");
+
+	dataSource = Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"];
+	rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"];
+
+	rdfService =	rdf.getService(Components.interfaces.nsIRDFService);
+
+	ds = dataSource.createInstance(Components.interfaces.nsIRDFInMemoryDataSource);
+	feedTree.database.AddDataSource(ds);
+
+	schema = "http://sage.mozdev.org/FeedData#";
+
+	ds = feedTree.database.GetDataSources();
+	ds = ( ds.getNext(), ds.getNext() );
+	ds = ds.QueryInterface(Components.interfaces.nsIRDFDataSource);
+
+	ds.Assert(rdfService.GetResource(schema + "Feeds"), rdfService.GetResource(schema + "child"), rdfService.GetResource(schema + "LocalFeeds"), true);
+	ds.Assert(rdfService.GetResource(schema + "LocalFeeds"), rdfService.GetResource(schema + "Title"), rdfService.GetLiteral("Site Feeds"), true);
+	ds.Assert(rdfService.GetResource(schema + "Feeds"), rdfService.GetResource(schema + "child"), rdfService.GetResource(schema + "ExternalFeeds"), true);
+	ds.Assert(rdfService.GetResource(schema + "ExternalFeeds"), rdfService.GetResource(schema + "Title"), rdfService.GetLiteral("External Feeds"), true);
+
+	var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator);
+	var window = windowManager.getMostRecentWindow("navigator:browser").document.getElementById("content");
+	var current_document = window.contentDocument;
+
+	document_host = current_document.location.host;
+	logMessage("host: " + document_host);
+
+	var possible_feeds = new Object();
+
+	var links = current_document.getElementsByTagName("link");
+	for(var c = 0; c < links.length; c++) {
+		if(links[c].rel == "alternate" && (links[c].type == "text/xml" || links[c].type == "application/atom+xml" || links[c].type == "application/rss+xml")) {
+			possible_feeds[links[c].href] = links[c].href;
+			logMessage("Found: " + links[c].href);
+		}
+	}
+
+	links = current_document.getElementsByTagName("a");
+	for(c = 0; c < links.length; c++) {
+		if(links[c].href.match(/xml$|rss$|rdf$/i)) {
+			possible_feeds[links[c].href] = links[c].href;
+			logMessage("Found: " + links[c].href);
+		}
+	}
+
+	feeds = new Array();
+	var httpReq;
+	for(url in possible_feeds) {
+		httpReq = new XMLHttpRequest();
+		httpReq.onload = httpLoaded;
+		httpReq.open("GET", url, true);
+		httpReq.setRequestHeader("User-Agent", CommonFunc.USER_AGENT);
+		httpReq.overrideMimeType("application/xml");
+		try {
+			httpReq.send(null);
+		} catch(e) {
+				// FAILURE
+			httpReq.abort();
+		}
+	}
+
+}
+
+function doOK() {
+  return true;
+}
+
+function doCancel() {
+  return true;
+}
+
+function httpLoaded(e) {
+	var httpReq = e.target;
+	var uri = httpReq.channel.originalURI;
+	try {
+		var feed = new Feed(httpReq.responseXML);
+		addFeed(uri, feed);
+	} catch(e) { }
+}
+
+function addFeed(uri, feed) {
+	var feedClass, lastPubDate, itemCount;
+	if(uri.host == document_host) {  // feed is local
+		feedClass = "LocalFeeds";
+	} else {  // feed is external
+		feedClass = "ExternalFeeds";
+	}
+	var twelveHourClock = CommonFunc.getPrefValue(CommonFunc.TWELVE_HOUR_CLOCK, "bool", false);
+	lastPubDate = "N/A";
+	if(feed.hasLastPubDate()) {
+		lastPubDate = dateFormat(feed.getLastPubDate(), twelveHourClock, 1);
+	}
+	itemCount = feed.getItemCount()
+	
+	ds.Assert(rdfService.GetResource(schema + feedClass), rdfService.GetResource(schema + "child"), rdfService.GetResource(schema + uri.spec), true);
+	ds.Assert(rdfService.GetResource(schema + uri.spec), rdfService.GetResource(schema + "Title"), rdfService.GetLiteral(feed.getTitle()), true);
+	ds.Assert(rdfService.GetResource(schema + uri.spec), rdfService.GetResource(schema + "Format"), rdfService.GetLiteral(feed.getFormat()), true);
+	ds.Assert(rdfService.GetResource(schema + uri.spec), rdfService.GetResource(schema + "URL"), rdfService.GetLiteral(uri.spec), true);
+	ds.Assert(rdfService.GetResource(schema + uri.spec), rdfService.GetResource(schema + "LastPubDate"), rdfService.GetLiteral(lastPubDate), true);
+	ds.Assert(rdfService.GetResource(schema + uri.spec), rdfService.GetResource(schema + "ItemCount"), rdfService.GetLiteral(itemCount), true);
+	
+	logMessage("Parsed and added: " + uri.spec);
+}
\ No newline at end of file
diff --git a/src/sage/content/discover_feeds.xul b/src/sage/content/discover_feeds.xul
new file mode 100644
index 0000000..af3b221
--- /dev/null
+++ b/src/sage/content/discover_feeds.xul
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+
+<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
+
+<!DOCTYPE page SYSTEM "chrome://sage/locale/sage.dtd">
+<dialog id="sage_discover_feeds" title="Do Nothing"
+        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        buttons="cancel"
+				onload="init();"
+        ondialogcancel="return doCancel();">
+
+<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
+<script type="application/x-javascript" src="chrome://browser/content/bookmarks/bookmarks.js"/>
+<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
+<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
+
+<script type="application/x-javascript" src="chrome://sage/content/commonfunc.js"/>
+<script type="application/x-javascript" src="chrome://sage/content/feedlib.js"/>
+<script type="application/x-javascript" src="chrome://sage/content/discover_feeds.js"/>
+
+<stringbundleset>
+	<stringbundle id="strRes" src="chrome://sage/locale/sage.properties"/>
+</stringbundleset>
+
+<vbox>
+	<description value="The following feeds were discovered"/>
+
+	<tree id="feedTree"
+				datasources="rdf:null"
+				ref="http://sage.mozdev.org/FeedData#Feeds"
+				containment="http://sage.mozdev.org/FeedData#child"
+				flex="1"
+				enableColumnDrag="true"
+				seltype="single"
+				minheight="120"
+				minwidth="350">
+
+		<treecols>
+			<treecol id="title" label="Title" flex="2" persist="width ordinal hidden" primary="true"/>
+			<splitter class="tree-splitter"/>
+			<treecol id="format" label="Format" flex="1" persist="width ordinal hidden"/>
+			<splitter class="tree-splitter"/>
+			<treecol id="url" label="URL" flex="1" hidden="true" persist="width ordinal hidden"/>
+			<splitter class="tree-splitter"/>
+			<treecol id="lastPubDate" label="Last Update" flex="1" hidden="true" persist="width ordinal hidden"/>
+			<splitter class="tree-splitter"/>
+			<treecol id="itemCount" label="Items" flex="1" hidden="true" persist="width ordinal hidden"/>
+		</treecols>
+
+				<template>
+					<rule>
+						<treechildren>
+							<treeitem uri="rdf:*">
+								<treerow>
+ 									<treecell label="rdf:http://sage.mozdev.org/FeedData#Title"/>
+ 									<treecell label="rdf:http://sage.mozdev.org/FeedData#Format"/>
+ 									<treecell label="rdf:http://sage.mozdev.org/FeedData#URL"/>
+ 									<treecell label="rdf:http://sage.mozdev.org/FeedData#LastPubDate"/>
+ 									<treecell label="rdf:http://sage.mozdev.org/FeedData#ItemCount"/>
+								</treerow>
+							</treeitem>
+						</treechildren>
+					</rule>
+				</template>
+			
+	</tree>
+
+	<hbox align="center" flex="1">
+		<spacer flex="1"/>
+		<button label="Add Feed"/>
+		<spacer flex="1"/>
+		<button dlgtype="cancel" label="Close"/>
+		<spacer flex="1"/>
+	</hbox>
+
+</vbox>
+
+</dialog>
\ No newline at end of file
diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index d106a0c..5a680f4 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -16,8 +16,10 @@ function	Feed(feedXML) {
 	var rootNodeName = feedXML.documentElement.localName.toLowerCase();
 	if(rootNodeName == "feed") {
 		this.parseATOM();
-	} else {
+	} else if(rootNodeName == "rss" || rootNodeName == "rdf") {
 		this.parseRSS();
+	} else {
+		throw "Feed has invalid root element";
 	}
 }
 
@@ -25,7 +27,17 @@ Feed.prototype.parseRSS = function() {
 
 	var feedXML = this.feedXML;
 
-	this.feedFormat = "RSS";
+	first_element = feedXML.documentElement;
+
+	if(first_element.localName.toLowerCase() == "rdf") {
+		this.feedFormat = "RSS (1.0)";
+	} else if(first_element.localName.toLowerCase() == "rss") {
+		if(first_element.hasAttribute("version")) {
+			this.feedFormat = "RSS (" + first_element.getAttribute("version") + ")";
+		} else {
+			this.feedFormat = "RSS (?)";
+		}
+	}
 
 	var channelNode;
 	if(feedXML.getElementsByTagName("channel").length != 0) {
@@ -107,7 +119,13 @@ Feed.prototype.parseATOM = function() {
 
 	var feedXML = this.feedXML;
 
-	this.feedFormat = "ATOM";
+	first_element = feedXML.documentElement;
+
+	if(first_element.hasAttribute("version")) {
+		this.feedFormat = "ATOM (" + first_element.getAttribute("version") + ")";
+	} else {
+		this.feedFormat = "ATOM (?)";
+	}
 
 	for(var i = feedXML.documentElement.firstChild; i != null; i = i.nextSibling) {
 		if(i.nodeType != i.ELEMENT_NODE) continue;
@@ -245,6 +263,16 @@ Feed.prototype.getFormat = function() {
 	return this.feedFormat;
 }
 
+Feed.prototype.getSignature = function() {
+	var sig = "[";
+	for(var c = 0; c < this.getItemCount(); c++) {
+		if(c != 0) sig += ",";
+		sig += this.getItem(c).getTitle().length;
+	}
+	sig += "]";
+	return sig;
+}
+
 
 
 function FeedItem(title, link, content, pubDate) {
@@ -263,17 +291,19 @@ FeedItem.prototype.hasTitle = function() {
 }
 
 FeedItem.prototype.getTitle = function() {
+	var title;
 	if(this.hasTitle()) {
-		return this.title;
+		title = this.title.replace(/<.*?>/g,'');;
 	} else {
 		if(this.hasContent()) {
 			temp = this.getContent();
 			temp = temp.replace(/<.*?>/g,'');
-			return temp.substring(0, 30) + "...";
+			title = temp.substring(0, 30) + "...";
 		} else {
-			return "No Title";
+			title = "No Title";
 		}
 	}
+	return title;
 }
 
 FeedItem.prototype.getLink = function() {
@@ -335,17 +365,23 @@ function iso8601ToJSDate(date_str) {
 	var tz_mark = "Z";
 	var tz_hours = 0;
 	var tz_minutes = 0;
+	var time, whole_time, tz;
 
 	if(tmp.length == 2) {
-		var whole_time = tmp[1];
+		whole_time = tmp[1];
 		tz_mark = whole_time.match("[Z+-]{1}");
-		tmp = whole_time.split(tz_mark);
-		var time = tmp[0];
-		if(tz_mark != "Z") {
-			var tz = tmp[1];
-			tmp = tz.split(":");
-			tz_hours = tmp[0];
-			tz_minutes = tmp[1];
+		if(tz_mark) {
+			tmp = whole_time.split(tz_mark);
+			time = tmp[0];
+			if(tz_mark == "+" || tz_mark == "-") {
+				tz = tmp[1];
+				tmp = tz.split(":");
+				tz_hours = tmp[0];
+				tz_minutes = tmp[1];
+			}
+		} else {
+			tz_mark = "Z";
+			time = whole_time;
 		}
 		tmp = time.split(":");
 		hours = tmp[0];
diff --git a/src/sage/content/getrsstitle.js b/src/sage/content/getrsstitle.js
index 5dd309f..9e2346d 100755
--- a/src/sage/content/getrsstitle.js
+++ b/src/sage/content/getrsstitle.js
@@ -47,7 +47,7 @@ var GetRssTitle = {
 		
 		var prompt = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
 		var resultValue = { value: rssTitle };
-		var result = prompt.prompt(window, "RSS Reader Panel", "New Title", resultValue, null, {});
+		var result = prompt.prompt(window, "Sage", strRes.getString("get_feed_title"), resultValue, null, {});
 
 		if(result) {
 			CommonFunc.setBMDSProperty(GetRssTitle.res, CommonFunc.BM_NAME, resultValue.value);
diff --git a/src/sage/content/res/template-html.txt b/src/sage/content/res/template-html.txt
index 84ead98..215b94b 100755
--- a/src/sage/content/res/template-html.txt
+++ b/src/sage/content/res/template-html.txt
@@ -6,6 +6,7 @@
 	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 	<meta http-equiv="Content-Style-Type" content="text/css">
 	<link rel="stylesheet" type="text/css" title="standard Style" href="**CSSURL**">
+	<base href="**LINK**">
 	<title>Sage - **HTMLTITLE**</title>
 </head>
 
diff --git a/src/sage/content/sage.js b/src/sage/content/sage.js
index e55b0ec..d44592d 100755
--- a/src/sage/content/sage.js
+++ b/src/sage/content/sage.js
@@ -27,7 +27,6 @@ var rssLoading = false;
 var sageFolderID = "";
 var enableTooltip = true;
 var popupTimeoutId=0;
-var aConsoleService
 
 
 function init() {
@@ -48,69 +47,33 @@ function init() {
 		strRes.getString("RESULT_ERROR_FAILURE_STR")
 	);
 
-  	// Load Preference
+	// if feed folder has not been set, assume new user and install default feed folder and demo feeds
+	if(!CommonFunc.getPrefValue(CommonFunc.RSS_READER_FOLDER_ID, "str", null)) {
+		logMessage("creating default feed folder...");
+		var new_folder = BMSVC.createFolderInContainer("Sage Feeds", RDF.GetResource("NC:BookmarksRoot"), null);
+		CommonFunc.setPrefValue(CommonFunc.RSS_READER_FOLDER_ID, "str", new_folder.Value);
+		BMSVC.createBookmarkInContainer("BBC News | News Front Page | World Edition", "http://news.bbc.co.uk/rss/newsonline_world_edition/front_page/rss091.xml", null, "updated", null, null, new_folder, null);
+		BMSVC.createBookmarkInContainer("Yahoo! News - Sports", "http://rss.news.yahoo.com/rss/sports", null, "updated", null, null, new_folder, null);
+		BMSVC.createBookmarkInContainer("Sage Project News", "http://sage.mozdev.org/rss.xml", null, "updated", null, null, new_folder, null);
+	}
+
+	// set feed folder location
 	sageFolderID = CommonFunc.getPrefValue(CommonFunc.RSS_READER_FOLDER_ID, "str", "NC:BookmarksRoot");
-  	// observe Preference
-  prefObserverSageFolder = CommonFunc.addPrefListener(CommonFunc.RSS_READER_FOLDER_ID, sageFolderChanged);
+	// check for changes to the feed folder
+	prefObserverSageFolder = CommonFunc.addPrefListener(CommonFunc.RSS_READER_FOLDER_ID, sageFolderChanged);
 
 	bookmarksTree.tree.setAttribute("ref", sageFolderID);
 	bookmarksTree.treeBoxObject.selection.select(0);
-	
+
 	FeedSearch.init();
 	toggleShowSearchBar();
 	toggleShowFeedItemList();
 
-  aConsoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
-
 	logMessage("initialized");
 }
 
-function logMessage(message) {
-	aConsoleService.logStringMessage("Sage: " + message);
-}
-
-function dateFormat(date, twelveHourClock) {
-	function padout(number) { return (number < 10) ? '0' + number : number; }
-
-	var day;
-	switch (date.getDay()) {
-		case 0: day = strRes.getString("date_sunday_short"); break
-		case 1: day = strRes.getString("date_monday_short"); break
-		case 2: day = strRes.getString("date_tuesday_short"); break
-		case 3: day = strRes.getString("date_wednesday_short"); break
-		case 4: day = strRes.getString("date_thursday_short"); break
-		case 5: day = strRes.getString("date_friday_short"); break
-		case 6: day = strRes.getString("date_saturday_short"); break
-	}
-
-	var month;
-	switch (date.getMonth()) {
-		case 0: month = strRes.getString("date_january_short"); break
-		case 1: month = strRes.getString("date_february_short"); break
-		case 2: month = strRes.getString("date_march_short"); break
-		case 3: month = strRes.getString("date_april_short"); break
-		case 4: month = strRes.getString("date_may_short"); break
-		case 5: month = strRes.getString("date_june_short"); break
-		case 6: month = strRes.getString("date_july_short"); break
-		case 7: month = strRes.getString("date_august_short"); break
-		case 8: month = strRes.getString("date_september_short"); break
-		case 9: month = strRes.getString("date_october_short"); break
-		case 10: month = strRes.getString("date_november_short"); break
-		case 11: month = strRes.getString("date_december_short"); break
-	}
-
-	var year = date.getYear() + 1900;
-
-	var date_str = day + ", " + month + " " + date.getDate() + ", " + year; 
-
-	var hours = date.getHours(), minutes = padout(date.getMinutes()), seconds = padout(date.getSeconds());
-	if(twelveHourClock) {
-		var adjhours = (hours == 0) ? 12 : ((hours < 13) ? hours : hours-12);
-		var time_str = adjhours + ":" + minutes + ((hours < 12) ? " AM" : " PM");
-	} else {
-		var time_str = hours + ":" + minutes;
-	}
-	return date_str + " " + time_str;
+function discoverFeeds() {
+	window.openDialog("chrome://sage/contents/discover_feeds.xul", "sage_discover_feeds", "chrome,modal,close");
 }
 
 	// �X�V���ꂽRSS�̂ݕ\��
@@ -148,12 +111,12 @@ function done() {
 
 function openOPMLWizard() {
 	var dialogURL = "chrome://sage/content/opml/opml.xul";
-	window.openDialog(dialogURL, "", "chrome,dialog,modal");
+	window.openDialog(dialogURL, "", "chrome,modal,close");
 }
 
 function openSettingDialog() {
 	var dialogURL = "chrome://sage/content/settings/settings.xul";
-	window.openDialog(dialogURL, "", "chrome,dialog,modal");
+	window.openDialog(dialogURL, "", "chrome,modal,close");
 }
 
 function openSageProjectFeed() {
@@ -376,8 +339,7 @@ function setRssItemListBox() {
 	}
 }
 
-
-function isVisited(aURL){
+function isVisited(aURL) {
 	try {
 		var globalHistory = Components.classes["@mozilla.org/browser/global-history;1"].getService(Components.interfaces.nsIGlobalHistory);
 		var URI = Components.classes['@mozilla.org/network/standard-url;1'].createInstance(Components.interfaces.nsIURI);
@@ -387,27 +349,27 @@ function isVisited(aURL){
 	return false;
 }
 
-function getCheckboxCheck(aID){
+function getCheckboxCheck(aID) {
 	var checkboxNode = document.getElementById(aID);
 	return checkboxNode.getAttribute("checked") == "true";
 }
 
-function showRssItemListPopup(aEvent){
-	if(aEvent.originalTarget.localName != "listitem"){
+function showRssItemListPopup(aEvent) {
+	if(aEvent.originalTarget.localName != "listitem") {
 		rssItemListPopup.hidePopup();
 		return;
 	}
-	if(!getCheckboxCheck("chkShowTooltip")){
+	if(!getCheckboxCheck("chkShowTooltip")) {
 		rssItemListPopup.hidePopup();
 		return;
 	}
 	
 	var description = htmlToText(currentFeed.getItem(aEvent.originalTarget.value).getContent());
-	if(description.indexOf("/") != -1){
+	if(description.indexOf("/") != -1) {
 		description = description.replace(/\//gm, "/\u200B");
 	}
 		// description ��400�����ȓ�ɂ���
-	if(description.length > 400){
+	if(description.length > 400) {
 		description = description.substring(0,400) + "...";
 	}
 
@@ -421,27 +383,23 @@ function showRssItemListPopup(aEvent){
 	popupTimeoutId = setTimeout("rssItemListPopup.showPopup(rssItemListBox)", 150);
 }
 
-function hideRssItemListPopup(aEvent){
+function hideRssItemListPopup(aEvent) {
 	clearTimeout(popupTimeoutId);
 	rssItemListPopup.hidePopup();
 }
 
-
-function htmlToText(aStr){
-	var	formatConverter = Components.classes["@mozilla.org/widget/htmlformatconverter;1"]
-								.createInstance(Components.interfaces.nsIFormatConverter);
-	var fromStr = Components.classes["@mozilla.org/supports-string;1"]
-								.createInstance(Components.interfaces.nsISupportsString);
+function htmlToText(aStr) {
+	var	formatConverter = Components.classes["@mozilla.org/widget/htmlformatconverter;1"].createInstance(Components.interfaces.nsIFormatConverter);
+	var fromStr = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
 	fromStr.data = aStr;
 	var toStr = { value: null };
 
-	try{
-		formatConverter.convert("text/html", fromStr, fromStr.toString().length,
-									"text/unicode", toStr, {});
-	}catch(e){
+	try {
+		formatConverter.convert("text/html", fromStr, fromStr.toString().length, "text/unicode", toStr, {});
+	} catch(e) {
 		return aStr;
 	}
-	if(toStr.value){
+	if(toStr.value) {
 		toStr = toStr.value.QueryInterface(Components.interfaces.nsISupportsString);
 		return toStr.toString();
 	}
@@ -536,8 +494,8 @@ function httpGetResult(aResultCode) {
 				}
 			}
 
-			BMSVC.updateLastVisitedDate(lastResource.url, responseXML.characterSet);
-			CommonFunc.setBMDSProperty(lastResource.res, CommonFunc.BM_DESCRIPTION, CommonFunc.STATUS_NO_UPDATE);
+			BMSVC.updateLastVisitedDate(lastResource.url, "UTF-8");
+			CommonFunc.setBMDSProperty(lastResource.res, CommonFunc.BM_DESCRIPTION, CommonFunc.STATUS_NO_UPDATE + " " + currentFeed.getSignature());
 		}
 
 		setStatusDone();
diff --git a/src/sage/content/sage.xul b/src/sage/content/sage.xul
index 3ba539f..0b92d06 100755
--- a/src/sage/content/sage.xul
+++ b/src/sage/content/sage.xul
@@ -8,8 +8,8 @@
 
 <!DOCTYPE page SYSTEM "chrome://sage/locale/sage.dtd">
 <page id="pageSagePanel" title="&sage.label;"
-	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 	onload="init();" onunload="done()">
 
 <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
@@ -46,7 +46,8 @@
 
 <toolbox class="plain">
 	<toolbar class="plain">
-		<toolbarbutton image="chrome://sage/skin/check_feeds.png" oncommand="updateCheck()" tooltiptext="&menu.checkUpdate;"></toolbarbutton>
+		<toolbarbutton id="checkFeeds" class="sage_button" oncommand="updateCheck()" tooltiptext="&menu.checkUpdate;"/>
+		<toolbarbutton id="discoverFeeds" class="sage_button" oncommand="discoverFeeds()" tooltiptext="&menu.discoverFeeds;"/>
 		<spacer flex="1"/>
 		<toolbarbutton type="menu" label="&menu.tools;">
 			<menupopup>
diff --git a/src/sage/content/settings/exUnregisterer.js b/src/sage/content/settings/exUnregisterer.js
index 4a55ec6..b6a68e4 100755
--- a/src/sage/content/settings/exUnregisterer.js
+++ b/src/sage/content/settings/exUnregisterer.js
@@ -408,8 +408,8 @@ exUnregisterer.prototype =
 	{
 		var dsource;
 		try {
-			var dsource = this.RDF.GetDataSource(aDsourcePath);
-				dsource = dsource.QueryInterface(Components.interfaces.nsIRDFDataSource);
+			dsource = this.RDF.GetDataSource(aDsourcePath);
+			dsource = dsource.QueryInterface(Components.interfaces.nsIRDFDataSource);
 		}
 		catch(e) {
 			return;
diff --git a/src/sage/content/settings/settings.js b/src/sage/content/settings/settings.js
index 4444a52..a8262b7 100755
--- a/src/sage/content/settings/settings.js
+++ b/src/sage/content/settings/settings.js
@@ -102,7 +102,7 @@ function fillSelectFolderMenupopup () {
 function fillFolder(aPopup, aFolder, aDepth) {
 	RDFC.Init(BMDS, aFolder);
 	var children = RDFC.GetElements();
-	while (children.hasMoreElements()){
+	while (children.hasMoreElements()) {
 		var curr = children.getNext();
 		if (RDFCU.IsContainer(BMDS, curr)) {
 			curr = curr.QueryInterface(Components.interfaces.nsIRDFResource);
diff --git a/src/sage/content/settings/settings.xul b/src/sage/content/settings/settings.xul
index 0d42ac2..c0f0dc4 100755
--- a/src/sage/content/settings/settings.xul
+++ b/src/sage/content/settings/settings.xul
@@ -14,7 +14,7 @@
 <script type="application/x-javascript" src="chrome://sage/content/settings/settings.js"/>
 
 
-<dialogheader title="&sage.label;" description="version &sage.version;"/>
+<dialogheader title="&sage.label;" description="&sage.version.label; &sage.version;"/>
 
 <stringbundleset>
 	<stringbundle id="strRes" src="chrome://sage/locale/sage.properties"/>
@@ -32,12 +32,38 @@
 <groupbox>
 	<caption label="&settings.general.caption;"/>
 	<checkbox id="chkAutoFeedTitle" label="&settings.autoFeedTitle.label;"/>
+	<checkbox id="chkTwelveHourClock" label="&settings.twelveHourClock.label;"/>
+	<grid>
+		<columns>
+			<column/>
+			<column/>
+		</columns>
+		<rows>
+			<row align="center">
+				<label value="Feed item order:"/>
+				<menulist id="itemOrder">
+					<menupopup>
+						<menuitem label="Cronological" value="chrono"/>
+						<menuitem label="Source" value="source"/>
+					</menupopup>
+				</menulist>
+			</row>
+			<row align="center">
+				<label value="Feed discovery mode:"/>
+				<menulist id="feedDiscoveryMode">
+					<menupopup>
+						<menuitem label="Exhaustive" value="exhaustive"/>
+						<menuitem label="Conservative" value="conservative"/>
+					</menupopup>
+				</menulist>
+			</row>
+		</rows>
+	</grid>
 </groupbox>
 
 <groupbox>
 	<caption label="&openInContentsArea.caption;"/>
 	<checkbox id="chkRenderFeeds" label="&settings.renderFeeds.label;"/>
-	<checkbox id="chkTwelveHourClock" label="&settings.twelveHourClock.label;"/>
 	<checkbox id="chkAllowEContent" label="&allowEContent.label;"/>
 	<vbox flex="1">
 		<checkbox id="chkUserCssEnable" label="&enableUserCss.label;" oncommand="setDisabled()"/>
diff --git a/src/sage/content/updatechecker.js b/src/sage/content/updatechecker.js
index 24872a3..e60cac7 100755
--- a/src/sage/content/updatechecker.js
+++ b/src/sage/content/updatechecker.js
@@ -1,20 +1,22 @@
 var UpdateChecker = {
 	checking: false,
-	resourceList: null,
+	checkList: null,
 	httpReq: null,
 	lastResource: null,
 
 	startCheck: function(aCheckFolderId) {
 		if(this.checking) return;
-	
-		this.resourceList = CommonFunc.getBMDSCChildren(aCheckFolderId);
-		
+
+		var resourceList = CommonFunc.getBMDSCChildren(aCheckFolderId);
+		this.checkList = new Array();
+
 			// Delete separator and updeed resource
-		for(var i=0; i<this.resourceList.length; i++) {
-			var url = CommonFunc.getBMDSProperty(this.resourceList[i], CommonFunc.BM_URL);
-			var desc = CommonFunc.getBMDSProperty(this.resourceList[i], CommonFunc.BM_DESCRIPTION);
-			if(!url || desc == CommonFunc.STATUS_UPDATE || desc == CommonFunc.STATUS_NO_CHECK) {
-				this.resourceList.splice(i,1);
+		for(var i = 0; i < resourceList.length; i++) {
+			var url = CommonFunc.getBMDSProperty(resourceList[i], CommonFunc.BM_URL);
+			var desc = CommonFunc.getBMDSProperty(resourceList[i], CommonFunc.BM_DESCRIPTION);
+			var status = desc.split(" ")[0];
+			if(url && !(status == CommonFunc.STATUS_UPDATE || status == CommonFunc.STATUS_NO_CHECK)) {
+				this.checkList.push(resourceList[i]);
 			}
 		}
 		
@@ -29,7 +31,7 @@ var UpdateChecker = {
 	},
 
 	check: function() {
-		this.lastResource = this.resourceList.shift();
+		this.lastResource = this.checkList.shift();
 		var name = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_NAME);
 		var url = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_URL);
 
@@ -80,7 +82,6 @@ var UpdateChecker = {
 
 	httpLoaded: function(e) {
 		var lastModified = 0;
-		var gettingLastModified = false;
 
 		try {
 			var feed = new Feed(UpdateChecker.httpReq.responseXML);
@@ -91,17 +92,12 @@ var UpdateChecker = {
 
 		if(feed.hasLastPubDate()) {
 			lastModified = feed.getLastPubDate().getTime();
-		} else {
-			try {
-				lastModified = UpdateChecker.httpReq.getResponseHeader("Last-modified");
-				lastModified = new Date(lastModified).getTime();
-			} catch(e) {}
 		}
 		
-		UpdateChecker.checkResult(true, lastModified);
+		UpdateChecker.checkResult(true, lastModified, feed);
 	},
 
-	checkResult: function(aSucceed, aLastModified) {
+	checkResult: function(aSucceed, aLastModified, feed) {
 		var name = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_NAME);
 		var url = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_URL);
 		var status = 0;
@@ -113,23 +109,29 @@ var UpdateChecker = {
 			lastVisit /= 1000;
 		}
 
-		if(aLastModified) {
-			if(aLastModified > lastVisit) {
-				status = CommonFunc.STATUS_UPDATE;
+		if(aSucceed) {
+			if(aLastModified) {
+				if(aLastModified > lastVisit) {
+					status = CommonFunc.STATUS_UPDATE;
+				} else {
+					status = CommonFunc.STATUS_NO_UPDATE;
+				}
 			} else {
-				status = CommonFunc.STATUS_NO_UPDATE;
+				var sig = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_DESCRIPTION).match(/\[.*\]/);
+				if(sig != feed.getSignature()) {
+					logMessage("signature mismatch: " + feed.getTitle() + "; old sig: " + sig + "  new sig: " + feed.getSignature());
+					status = CommonFunc.STATUS_UPDATE;
+				} else {
+					status = CommonFunc.STATUS_NO_UPDATE;
+				}
 			}
 		} else {
-			if(aSucceed) {
-				status = CommonFunc.STATUS_UNKNOWN;
-			} else {
-				status = CommonFunc.STATUS_ERROR;
-			}
+			status = CommonFunc.STATUS_ERROR;
 		}
 
-		CommonFunc.setBMDSProperty(this.lastResource, CommonFunc.BM_DESCRIPTION, status);
+		CommonFunc.setBMDSProperty(this.lastResource, CommonFunc.BM_DESCRIPTION, status + " " + CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_DESCRIPTION).match(/\[.*\]/));
 		
-		if(this.resourceList.length == 0) {
+		if(this.checkList.length == 0) {
 			this.checking = false;
 			this.onChecked(name, url);
 			return;
diff --git a/src/sage/locale/en-US/sage.dtd b/src/sage/locale/en-US/sage.dtd
index 94fa6f6..8fb08e7 100755
--- a/src/sage/locale/en-US/sage.dtd
+++ b/src/sage/locale/en-US/sage.dtd
@@ -1,5 +1,6 @@
 <!ENTITY sage.label				"Sage">
 <!ENTITY sage.version				"1.2">
+<!ENTITY sage.version.label				"version">
 
 <!ENTITY sage.toolbarLabel			"Sage">
 <!ENTITY sage.sidebarTitle			"Sage">
@@ -16,6 +17,7 @@
 <!ENTITY menu.opmlImportExport			"OPML Import/Export...">
 <!ENTITY menu.setting				"Settings...">
 <!ENTITY menu.sageProjectFeed				"Sage Project News">
+<!ENTITY menu.discoverFeeds				"Discover Feeds">
 
 
 <!-- Setting Dialog -->
diff --git a/src/sage/locale/en-US/sage.properties b/src/sage/locale/en-US/sage.properties
index f460de6..986b847 100755
--- a/src/sage/locale/en-US/sage.properties
+++ b/src/sage/locale/en-US/sage.properties
@@ -9,6 +9,11 @@ CHECK_UPDATE = Check Feeds
 GET_RSS_TITLE= Get Feed Title
 
 
+# get feed title dialog
+
+get_feed_title = New Feed Title
+
+
 # OPML wizzard
 
 opml_import_done = Import Complete
@@ -28,7 +33,7 @@ date_sunday_short = Sun
 date_monday = Monday
 date_monday_short = Mon
 date_tuesday = Tuesday
-date_tuesday_short = Tues
+date_tuesday_short = Tue
 date_wednesday = Wednesday
 date_wednesday_short = Wed
 date_thursday = Thursday
diff --git a/src/sage/locale/fr-FR/sage.dtd b/src/sage/locale/fr-FR/sage.dtd
index b79c610..d9c7eed 100644
--- a/src/sage/locale/fr-FR/sage.dtd
+++ b/src/sage/locale/fr-FR/sage.dtd
@@ -2,6 +2,7 @@
 
 <!ENTITY sage.label				"Sage">
 <!ENTITY sage.version				"1.2">
+<!ENTITY sage.version.label				"">
 
 <!ENTITY sage.toolbarLabel			"Sage">
 <!ENTITY sage.sidebarTitle			"Sage">
@@ -18,6 +19,7 @@
 <!ENTITY menu.opmlImportExport			"Import/Export OPML...">
 <!ENTITY menu.setting				"Configuration...">
 <!ENTITY menu.sageProjectFeed				"">
+<!ENTITY menu.discoverFeeds				"">
 
 <!-- Setting Dialog -->
 <!ENTITY settings.general.caption     "">
diff --git a/src/sage/locale/fr-FR/sage.properties b/src/sage/locale/fr-FR/sage.properties
index e151b8c..7e44d59 100644
--- a/src/sage/locale/fr-FR/sage.properties
+++ b/src/sage/locale/fr-FR/sage.properties
@@ -9,6 +9,11 @@ CHECK_UPDATE = V\u00e9rification des fils
 GET_RSS_TITLE= Trouver le nom du fil
 
 
+# get feed title dialog
+
+get_feed_title = New Feed Title
+
+
 # OPML wizzard
 
 opml_import_done = Import Complete
@@ -29,7 +34,7 @@ date_sunday_short = Sun
 date_monday = Monday
 date_monday_short = Mon
 date_tuesday = Tuesday
-date_tuesday_short = Tues
+date_tuesday_short = Tue
 date_wednesday = Wednesday
 date_wednesday_short = Wed
 date_thursday = Thursday
diff --git a/src/sage/locale/hu-HU/sage.dtd b/src/sage/locale/hu-HU/sage.dtd
index f4b8f30..8de2b44 100755
--- a/src/sage/locale/hu-HU/sage.dtd
+++ b/src/sage/locale/hu-HU/sage.dtd
@@ -2,6 +2,7 @@
 
 <!ENTITY sage.label				"Sage">
 <!ENTITY sage.version				"1.2">
+<!ENTITY sage.version.label				"">
 
 <!ENTITY sage.toolbarLabel			"Sage">
 <!ENTITY sage.sidebarTitle			"Sage">
@@ -18,6 +19,7 @@
 <!ENTITY menu.opmlImportExport      "OPML import/export...">
 <!ENTITY menu.setting               "Be�ll�t�sok...">
 <!ENTITY menu.sageProjectFeed				"A Sage projekt h�rei">
+<!ENTITY menu.discoverFeeds					"">
 
 
 <!-- Setting Dialog -->
diff --git a/src/sage/locale/hu-HU/sage.properties b/src/sage/locale/hu-HU/sage.properties
index a903f0c..48493ba 100755
--- a/src/sage/locale/hu-HU/sage.properties
+++ b/src/sage/locale/hu-HU/sage.properties
@@ -9,6 +9,11 @@ CHECK_UPDATE = Friss
 GET_RSS_TITLE= RSS c�m let�lt�se
 
 
+# get feed title dialog
+
+get_feed_title = New Feed Title
+
+
 # OPML wizzard
 
 opml_import_done = Import Complete
@@ -29,7 +34,7 @@ date_sunday_short = Sun
 date_monday = Monday
 date_monday_short = Mon
 date_tuesday = Tuesday
-date_tuesday_short = Tues
+date_tuesday_short = Tue
 date_wednesday = Wednesday
 date_wednesday_short = Wed
 date_thursday = Thursday
diff --git a/src/sage/locale/ja-JP/sage.dtd b/src/sage/locale/ja-JP/sage.dtd
index 50e4a54..c4d0b34 100755
--- a/src/sage/locale/ja-JP/sage.dtd
+++ b/src/sage/locale/ja-JP/sage.dtd
@@ -1,5 +1,6 @@
 <!ENTITY sage.label			"RSS リーダパネル">
 <!ENTITY sage.version			"1.2">
+<!ENTITY sage.version.label				"">
 
 <!ENTITY sage.toolbarLabel		"RSS リーダ">
 <!ENTITY sage.sidebarTitle		"RSS リーダ">
@@ -17,7 +18,7 @@
 <!ENTITY menu.opmlImportExport		"OPML インポート/エクスポート...">
 <!ENTITY menu.setting				"設定...">
 <!ENTITY menu.sageProjectFeed				"">
-
+<!ENTITY menu.discoverFeeds				"">
 
 <!-- Setting Dialog -->
 <!ENTITY settings.general.caption     "">
diff --git a/src/sage/locale/ja-JP/sage.properties b/src/sage/locale/ja-JP/sage.properties
index 227c706..bf6179e 100755
--- a/src/sage/locale/ja-JP/sage.properties
+++ b/src/sage/locale/ja-JP/sage.properties
@@ -9,6 +9,11 @@ CHECK_UPDATE = \u66f4\u65b0\u30c1\u30a7\u30c3\u30af
 GET_RSS_TITLE= RSS \u30bf\u30a4\u30c8\u30eb\u306e\u53d6\u5f97
 
 
+# get feed title dialog
+
+get_feed_title = New Feed Title
+
+
 # OPML wizzard
 
 opml_import_done = Import Complete
@@ -29,7 +34,7 @@ date_sunday_short = Sun
 date_monday = Monday
 date_monday_short = Mon
 date_tuesday = Tuesday
-date_tuesday_short = Tues
+date_tuesday_short = Tue
 date_wednesday = Wednesday
 date_wednesday_short = Wed
 date_thursday = Thursday
diff --git a/src/sage/skin/classic/sage.css b/src/sage/skin/classic/sage.css
index 827096f..3673966 100755
--- a/src/sage/skin/classic/sage.css
+++ b/src/sage/skin/classic/sage.css
@@ -1,5 +1,38 @@
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
+toolbarbutton.sage_button {
+	list-style-image: url("chrome://sage/skin/toolbar.png") !important;
+	-moz-binding: url("chrome://sage/skin/sage.xbl#toolbarbutton");
+}
+
+toolbarbutton.sage_button2 > .toolbarbutton-text {
+	display: none !important;
+}
+
+#checkFeeds {
+	-moz-image-region: rect(0px 26px 24px 0px) !important;
+}
+
+#checkFeeds[buttondown="true"] {
+	-moz-image-region: rect(24px 26px 48px 0px) !important;
+}
+
+#checkFeeds[disabled="true"] {
+	-moz-image-region: rect(48px 26px 72px 0px) !important;
+}
+
+#discoverFeeds {
+	-moz-image-region: rect(0px 52px 24px 26px) !important;
+}
+
+#discoverFeeds[buttondown="true"] {
+	-moz-image-region: rect(24px 52px 48px 26px) !important;
+}
+
+#discoverFeeds[disabled="true"] {
+	-moz-image-region: rect(48px 52px 72px 26px) !important;
+}
+
 #bookmarksTree {
   -moz-binding: url("chrome://sage/content/bookmarksTree.xml#bookmarks-tree-name");
 }
@@ -38,7 +71,6 @@ treechildren::-moz-tree-cell-text(rss, updated) {
   font-weight:  normal;
 }
 
-
 #sage-splitter {
   border: none;
   border-bottom: 1px solid ThreeDLightShadow;
diff --git a/src/sage/skin/classic/sage.xbl b/src/sage/skin/classic/sage.xbl
new file mode 100644
index 0000000..28a1480
--- /dev/null
+++ b/src/sage/skin/classic/sage.xbl
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+					xmlns:xbl="http://www.mozilla.org/xbl">
+
+  <binding id="toolbarbutton" extends="chrome://global/content/bindings/button.xml#menu-button-base">
+    <content>
+        <xul:toolbarbutton anonid="button" allowevents="true" class="sage_button2" xbl:inherits="disabled,buttonover,buttondown,label"/>
+    </content>
+  </binding>
+
+</bindings>
\ No newline at end of file
diff --git a/src/sage/skin/classic/toolbar.png b/src/sage/skin/classic/toolbar.png
new file mode 100644
index 0000000..db7abd3
Binary files /dev/null and b/src/sage/skin/classic/toolbar.png differ

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/sage-extension.git



More information about the Pkg-mozext-commits mailing list