[Pkg-mozext-commits] [sage-extension] 32/54: Livemarks integration, bug 7302

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


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

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

commit 2a16339008ec7f0285f6423a42ec832e144dae19
Author: Peter Andrews <petea at jhu.edu>
Date:   Wed Oct 6 02:13:53 2004 +0000

    Livemarks integration, bug 7302
---
 src/sage/content/bookmarksTree.xml | 19 ++++++++++++++-----
 src/sage/content/commonfunc.js     |  6 +++++-
 src/sage/content/getrsstitle.js    |  8 +++++++-
 src/sage/content/opml/opml.js      | 19 ++++++++++++++-----
 src/sage/content/sage.js           |  2 +-
 src/sage/content/updatechecker.js  |  9 ++++++++-
 src/sage/skin/classic/sage.css     | 21 +++++++++++++--------
 7 files changed, 62 insertions(+), 22 deletions(-)

diff --git a/src/sage/content/bookmarksTree.xml b/src/sage/content/bookmarksTree.xml
index 4eab153..245f57d 100755
--- a/src/sage/content/bookmarksTree.xml
+++ b/src/sage/content/bookmarksTree.xml
@@ -23,12 +23,12 @@
 		<tree anonid="bookmarks-tree" flex="1" class="plain" hidecolumnpicker="true"
 				datasources="rdf:bookmarks rdf:internetsearch rdf:localsearch" ref="NC:BookmarksRoot" flags="dont-build-content"
 				onselect="this.parentNode.treeBoxObject.view.selectionChanged();" seltype="single">
-		<template xmlns:nc="http://home.netscape.com/NC-rdf#">
+		<template>
 			<rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
 			<treechildren>
 				<treeitem uri="rdf:*">
-				<treerow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type separator">
-					<treecell properties="separator" label="rdf:http://home.netscape.com/NC-rdf#Name"/>
+				<treerow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type">
+					<treecell label="rdf:http://home.netscape.com/NC-rdf#Name" properties="separator"/>
 				</treerow>
 				</treeitem>
 			</treechildren>
@@ -37,7 +37,16 @@
 			<treechildren>
 				<treeitem uri="rdf:*">
 				<treerow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
-					<treecell	label="rdf:http://home.netscape.com/NC-rdf#Name" properties="rdf:http://home.netscape.com/NC-rdf#Description rss"/>
+					<treecell	label="rdf:http://home.netscape.com/NC-rdf#Name" properties="rdf:http://home.netscape.com/NC-rdf#Description feed"/>
+				</treerow>
+				</treeitem>
+			</treechildren>
+			</rule>
+			<rule iscontainer="true">
+			<treechildren>
+				<treeitem uri="rdf:*">
+				<treerow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
+					<treecell	label="rdf:http://home.netscape.com/NC-rdf#Name" properties="rdf:http://home.netscape.com/NC-rdf#Description folder"/>
 				</treerow>
 				</treeitem>
 			</treechildren>
@@ -46,7 +55,7 @@
 			<treechildren>
 				<treeitem uri="rdf:*">
 				<treerow properties="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type rdf:http://home.netscape.com/NC-rdf#loading rdf:http://home.netscape.com/WEB-rdf#status">
-					<treecell	label="rdf:http://home.netscape.com/NC-rdf#Name" properties="rdf:http://home.netscape.com/NC-rdf#Description rss"/>
+					<treecell	label="rdf:http://home.netscape.com/NC-rdf#Name" properties="rdf:http://home.netscape.com/NC-rdf#Description feed"/>
 				</treerow>
 				</treeitem>
 			</treechildren>
diff --git a/src/sage/content/commonfunc.js b/src/sage/content/commonfunc.js
index dce0de6..e9a4c43 100755
--- a/src/sage/content/commonfunc.js
+++ b/src/sage/content/commonfunc.js
@@ -167,7 +167,11 @@ var CommonFunc = {
 		while(containerChildren.hasMoreElements()) {
 			var res = containerChildren.getNext().QueryInterface(kRDFRSCIID);
 			if(RDFCU.IsContainer(BMDS, res)) {
-				resultArray = resultArray.concat(this.getBMDSCChildren(res));
+				if(BMDS.HasAssertion(res, RDF.GetResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), RDF.GetResource("http://home.netscape.com/NC-rdf#Livemark"), true)) {
+					resultArray.push(res);
+				} else {
+					resultArray = resultArray.concat(this.getBMDSCChildren(res));
+				}
 			} else {
 				resultArray.push(res);
 			}
diff --git a/src/sage/content/getrsstitle.js b/src/sage/content/getrsstitle.js
index 666797b..8720b01 100755
--- a/src/sage/content/getrsstitle.js
+++ b/src/sage/content/getrsstitle.js
@@ -8,7 +8,13 @@ var GetRssTitle = {
 		if(this.checking) return;
 	
 		this.res = RDF.GetResource(aBookmrkID);
-		this.url = CommonFunc.getBMDSProperty(this.res, CommonFunc.BM_URL);
+		var type = CommonFunc.getBMDSProperty(this.res, CommonFunc.RDF_TYPE);
+		if(type == NC_NS + "Bookmark") {
+			this.url = CommonFunc.getBMDSProperty(this.res, CommonFunc.BM_URL);
+		}
+		if(type == NC_NS + "Livemark") {
+			this.url = CommonFunc.getBMDSProperty(this.res, CommonFunc.BM_FEEDURL);
+		}
 		
 		this.httpReq = new XMLHttpRequest();
 		this.httpReq.onload = this.httpLoaded;
diff --git a/src/sage/content/opml/opml.js b/src/sage/content/opml/opml.js
index 2873c0a..ec20b66 100755
--- a/src/sage/content/opml/opml.js
+++ b/src/sage/content/opml/opml.js
@@ -212,12 +212,18 @@ function createOpmlSource() {
 }
 
 function createOpmlOutline(aOpmlDoc, aRssItem) {
-	var url = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_URL);
+	var type = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.RDF_TYPE);
+	var url;
+	if(type == NC_NS + "Bookmark") {
+		url = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_URL);
+	}
+	if(type == NC_NS + "Livemark") {
+		url = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_FEEDURL);
+	}
 	var title = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_NAME);
-	var isContainer = RDFCU.IsContainer(BMDS, aRssItem);
 	var outlineNode = aOpmlDoc.createElement("outline");
 
-	if(isContainer) {
+	if(type == NC_NS + "Folder") {
 		outlineNode.setAttribute("text", title);
 
 		var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);
@@ -226,9 +232,12 @@ function createOpmlOutline(aOpmlDoc, aRssItem) {
 
 		while(containerChildren.hasMoreElements()) {
 			var res = containerChildren.getNext().QueryInterface(kRDFRSCIID);
-			outlineNode.appendChild(createOpmlOutline(aOpmlDoc, res));
+			var res_type = CommonFunc.getBMDSProperty(res, CommonFunc.RDF_TYPE);
+			if(res_type == NC_NS + "Folder" || res_type == NC_NS + "Bookmark" || res_type == NC_NS + "Livemark") {
+				outlineNode.appendChild(createOpmlOutline(aOpmlDoc, res));
+			}
 		}
-	} else {
+	} else if(type == NC_NS + "Bookmark" || type == NC_NS + "Livemark") {
 		outlineNode.setAttribute("type", "rss");
 		outlineNode.setAttribute("text", title);
 		outlineNode.setAttribute("title", title);
diff --git a/src/sage/content/sage.js b/src/sage/content/sage.js
index 6f198a2..119307f 100755
--- a/src/sage/content/sage.js
+++ b/src/sage/content/sage.js
@@ -192,7 +192,7 @@ function createTreeContextMenu2(aEvent) {
 	var cmdSrc = "";
 	var tempMenuItem;
 
-	if(selection.type == "Bookmark") {
+	if(selection.type == "Bookmark" || selection.type == "Livemark") {
 		cmdSrc = "GetRssTitle.getRssTitle('" + itemId + "')";
 		tempMenuItem = document.createElement("menuitem");
 		tempMenuItem.setAttribute("label", strRes.getString("GET_RSS_TITLE"));
diff --git a/src/sage/content/updatechecker.js b/src/sage/content/updatechecker.js
index 64bf027..0a881ac 100755
--- a/src/sage/content/updatechecker.js
+++ b/src/sage/content/updatechecker.js
@@ -37,7 +37,14 @@ var UpdateChecker = {
 	check: function() {
 		this.lastResource = this.checkList.shift();
 		var name = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_NAME);
-		var url = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_URL);
+		var type = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.RDF_TYPE);
+		var url;
+		if(type == NC_NS + "Bookmark") {
+			url = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_URL);
+		}
+		if(type == NC_NS + "Livemark") {
+			url = CommonFunc.getBMDSProperty(this.lastResource, CommonFunc.BM_FEEDURL);
+		}
 
 		if(!url) {
 			this.checkResult(false, 0);
diff --git a/src/sage/skin/classic/sage.css b/src/sage/skin/classic/sage.css
index b8151b6..c55ea38 100755
--- a/src/sage/skin/classic/sage.css
+++ b/src/sage/skin/classic/sage.css
@@ -37,27 +37,32 @@ toolbarbutton.sage_button2 > .toolbarbutton-text {
   -moz-binding: url("chrome://sage/content/bookmarksTree.xml#bookmarks-tree-name");
 }
 
-treechildren::-moz-tree-image(rss, updated) {
+treechildren::-moz-tree-image(feed),
+treechildren::-moz-tree-image(feed, no-updated),
+treechildren::-moz-tree-image(feed, no-check) {
   -moz-image-region: auto !important;
-  list-style-image: url("chrome://sage/skin/icon/updated.png") !important;
+  list-style-image: url("chrome://sage/skin/icon/no-updated.png") !important;
 }
-treechildren::-moz-tree-image(rss, no-updated),
-treechildren::-moz-tree-image(rss, no-check) {
+treechildren::-moz-tree-image(feed, updated) {
   -moz-image-region: auto !important;
-  list-style-image: url("chrome://sage/skin/icon/no-updated.png") !important;
+  list-style-image: url("chrome://sage/skin/icon/updated.png") !important;
 }
-treechildren::-moz-tree-image(rss, unknown) {
+treechildren::-moz-tree-image(feed, unknown) {
   -moz-image-region: auto !important;
   list-style-image: url("chrome://sage/skin/icon/unknown.png") !important;
 }
-treechildren::-moz-tree-image(rss, error) {
+treechildren::-moz-tree-image(feed, error) {
   -moz-image-region: auto !important;
   list-style-image: url("chrome://sage/skin/icon/error.gif") !important;
 }
-treechildren::-moz-tree-cell-text(rss, updated) {
+treechildren::-moz-tree-cell-text(feed, updated) {
   font-weight: bold !important;
 }
 
+treechildren::-moz-tree-twisty {
+	width: 0px !important;
+}
+
 #bookmarksTreeBox,
 #rssItemListBoxBox {
   min-height: 90px;

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