[Pkg-mozext-commits] [sage-extension] 34/39: many updates
David Prévot
taffit at moszumanska.debian.org
Fri May 1 03:10:22 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag sage_1_1
in repository sage-extension.
commit 00c524425701129b76667f7b02d575f814f3946a
Author: Peter Andrews <petea at jhu.edu>
Date: Thu Jun 10 07:15:28 2004 +0000
many updates
---
src/sage/content/createhtml.js | 1 +
src/sage/content/feedlib.js | 14 +++++++++++-
src/sage/content/res/sage.css | 11 ++++++++++
src/sage/content/res/template-html.txt | 10 +++++----
src/sage/content/res/template-item.txt | 1 +
src/sage/content/sage.js | 39 +++++++++++++++++++--------------
src/sage/content/sage.xul | 6 -----
src/sage/content/updatechecker.js | 13 ++++++++---
src/sage/skin/classic/technorati.gif | Bin 0 -> 1055 bytes
9 files changed, 64 insertions(+), 31 deletions(-)
diff --git a/src/sage/content/createhtml.js b/src/sage/content/createhtml.js
index a622236..48f587c 100755
--- a/src/sage/content/createhtml.js
+++ b/src/sage/content/createhtml.js
@@ -100,6 +100,7 @@ var CreateHTML = {
var itemSource = this.ITEM_SOURCE;
itemSource = itemSource.replace("**NUMBER**", i+1);
itemSource = itemSource.replace("**LINK**", link);
+ itemSource = itemSource.replace("**TECHNORATI**", encodeURIComponent(link));
itemSource = itemSource.replace("**TITLE**", title);
itemSource = itemSource.replace("**DESCRIPTION**", description);
itemSource = itemSource.replace("**PUBDATE**", pubDate);
diff --git a/src/sage/content/feedlib.js b/src/sage/content/feedlib.js
index 69ada4a..05b4fbf 100644
--- a/src/sage/content/feedlib.js
+++ b/src/sage/content/feedlib.js
@@ -195,8 +195,20 @@ Feed.prototype.getTitle = function() {
return this.title;
}
+Feed.prototype.hasDescription = function() {
+ if(!this.description) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
Feed.prototype.getDescription = function() {
- return this.description;
+ if(this.hasDescription()) {
+ return this.description;
+ } else {
+ return "";
+ }
}
Feed.prototype.getLink = function() {
diff --git a/src/sage/content/res/sage.css b/src/sage/content/res/sage.css
index 9f83338..956f92d 100755
--- a/src/sage/content/res/sage.css
+++ b/src/sage/content/res/sage.css
@@ -73,4 +73,15 @@ div.item-pubDate {
font-size: x-small;
margin: 0px;
padding: 8px 10px;
+ width: 80%;
+ float: left;
+}
+
+div.item-technorati {
+ font-size: x-small;
+ margin: 0px;
+ padding: 8px 10px;
+ width: 20%;
+ float: right;
+ text-align: right;
}
\ No newline at end of file
diff --git a/src/sage/content/res/template-html.txt b/src/sage/content/res/template-html.txt
index afdff33..84ead98 100755
--- a/src/sage/content/res/template-html.txt
+++ b/src/sage/content/res/template-html.txt
@@ -1,13 +1,14 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
<html>
+
<head>
<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**">
+ <link rel="stylesheet" type="text/css" title="standard Style" href="**CSSURL**">
<title>Sage - **HTMLTITLE**</title>
</head>
+
<body>
<div id="rss-header">
<h1 id="rss-title"><a id="rss-link" href="**LINK**">**TITLE**</a></h1>
@@ -16,4 +17,5 @@
**ITEMS**
</body>
+
</html>
\ No newline at end of file
diff --git a/src/sage/content/res/template-item.txt b/src/sage/content/res/template-item.txt
index f21822b..6ce5745 100755
--- a/src/sage/content/res/template-item.txt
+++ b/src/sage/content/res/template-item.txt
@@ -5,4 +5,5 @@
</h2>
**DESCRIPTION**
**PUBDATE**
+ <div class="item-technorati"><a href="http://www.technorati.com/cosmos/search.html?url=**TECHNORATI**"><img src="chrome://sage/skin/technorati.gif" border="0"></a></div>
</div>
diff --git a/src/sage/content/sage.js b/src/sage/content/sage.js
index b29ec8a..fdc446d 100755
--- a/src/sage/content/sage.js
+++ b/src/sage/content/sage.js
@@ -51,7 +51,7 @@ function init() {
// Load Preference
sageFolderID = CommonFunc.getPrefValue(CommonFunc.RSS_READER_FOLDER_ID, "str", "NC:BookmarksRoot");
// observe Preference
- prefObserverSageFolder = CommonFunc.addPrefListener(CommonFunc.RSS_READER_FOLDER_ID, sageFolderChanged);
+ prefObserverSageFolder = CommonFunc.addPrefListener(CommonFunc.RSS_READER_FOLDER_ID, sageFolderChanged);
bookmarksTree.tree.setAttribute("ref", sageFolderID);
bookmarksTree.treeBoxObject.selection.select(0);
@@ -62,18 +62,22 @@ function init() {
aConsoleService = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
- aConsoleService.logStringMessage("Sage initialized.");
+ logMessage("initialized");
+}
+
+function logMessage(message) {
+ aConsoleService.logStringMessage("Sage: " + message);
}
// �X�V���ꂽRSS�̂ݕ\��
-function showOnlyUpdated(){
- if(getCheckboxCheck("chkOnlyUpdate")){
+function showOnlyUpdated() {
+ if(getCheckboxCheck("chkOnlyUpdate")) {
var findURL = "find:datasource=rdf:bookmarks&match=";
findURL += CommonFunc.BM_DESCRIPTION;
findURL += "&method=is&text=updated";
bookmarksTree.tree.setAttribute("ref", findURL);
- }else{
+ } else {
bookmarksTree.tree.setAttribute("ref", sageFolderID);
}
}
@@ -86,7 +90,7 @@ function sageFolderChanged(subject, topic, prefName) {
}
function done() {
- if(prefObserverSageFolder){
+ if(prefObserverSageFolder) {
CommonFunc.removePrefListener(prefObserverSageFolder);
}
@@ -95,6 +99,8 @@ function done() {
rssLoading = false;
}
UpdateChecker.done();
+
+ logMessage("shutdown");
}
function openOPMLWizard() {
@@ -329,17 +335,13 @@ function setRssItemListBox() {
}
- // URL ���K��ς݂����ׂ�
function isVisited(aURL){
- try{
- var globalHistory = Components.classes["@mozilla.org/rdf/datasource;1?name=history"]
- .getService(Components.interfaces.nsIGlobalHistory);
- // �h���C���̏��������� nsIURI �ɔC����
- var URI = Components.classes['@mozilla.org/network/standard-url;1']
- .createInstance(Components.interfaces.nsIURI);
+ 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);
URI.spec = aURL;
return globalHistory.isVisited(URI.spec);
- }catch(e){}
+ } catch(e) {}
return false;
}
@@ -417,13 +419,14 @@ function httpGet(aURL) {
responseXML = null;
httpReq = new XMLHttpRequest();
+
+ httpReq.open("GET", aURL);
+
httpReq.onload = httpLoaded;
httpReq.onerror = httpError;
httpReq.onreadystatechange = httpReadyStateChange;
-
try {
- httpReq.open("GET", aURL);
httpReq.setRequestHeader("User-Agent", USER_AGENT);
httpReq.overrideMimeType("application/xml");
} catch(e) {
@@ -438,7 +441,9 @@ function httpGet(aURL) {
}
}
-function httpError(e) {}
+function httpError(e) {
+ logMessage("HTTP Error");
+}
function httpReadyStateChange() {
diff --git a/src/sage/content/sage.xul b/src/sage/content/sage.xul
index e206625..90828fd 100755
--- a/src/sage/content/sage.xul
+++ b/src/sage/content/sage.xul
@@ -40,12 +40,6 @@
<command id="cmd_bm_properties" oncommand="goDoCommand('cmd_bm_properties');"/>
-
-
-
-
-
-
<stringbundleset>
<stringbundle id="strRes" src="chrome://sage/locale/sage.properties"/>
</stringbundleset>
diff --git a/src/sage/content/updatechecker.js b/src/sage/content/updatechecker.js
index ca78724..24872a3 100755
--- a/src/sage/content/updatechecker.js
+++ b/src/sage/content/updatechecker.js
@@ -43,12 +43,16 @@ var UpdateChecker = {
this.httpReq = new XMLHttpRequest();
this.httpReq.parent = this;
+
+ this.httpReq.open("GET", url);
+
this.httpReq.onload = this.httpLoaded;
+ this.httpReq.onerror = this.httpError;
this.httpReq.onreadystatechange = this.httpReadyStateChange;
- this.httpReq.open("GET", url);
- this.httpReq.setRequestHeader("User-Agent", USER_AGENT);
- this.httpReq.overrideMimeType("application/xml");
+
try {
+ this.httpReq.setRequestHeader("User-Agent", USER_AGENT);
+ this.httpReq.overrideMimeType("application/xml");
this.httpReq.send(null);
this.onCheck(name, url);
} catch(e) {
@@ -58,6 +62,9 @@ var UpdateChecker = {
}
},
+ httpError: function() {
+ logMessage("HTTP Error");
+ },
httpReadyStateChange: function() {
if(UpdateChecker.httpReq.readyState == 2) {
diff --git a/src/sage/skin/classic/technorati.gif b/src/sage/skin/classic/technorati.gif
new file mode 100644
index 0000000..fa1b7bf
Binary files /dev/null and b/src/sage/skin/classic/technorati.gif 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