[Pkg-mozext-commits] [sage-extension] 39/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 b029ad249567e19c24522852e8f18036fa564810
Author: Peter Andrews <petea at jhu.edu>
Date: Sat Oct 9 19:58:42 2004 +0000
Livemarks integration, bug 7302
---
src/sage/content/sage.js | 24 +++++++++++++++++++++---
src/sage/content/sage.xul | 1 +
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/sage/content/sage.js b/src/sage/content/sage.js
index 6b245c0..dad4557 100755
--- a/src/sage/content/sage.js
+++ b/src/sage/content/sage.js
@@ -179,8 +179,19 @@ function BookmarkResource(aRes, aDB) {
function bookmarksOpen() {
lastResource = new BookmarkResource(bookmarksTree.currentResource, bookmarksTree.db);
- setStatusLoading();
- httpGet(lastResource.url);
+ // get type of parent node
+ var predicate = lastResource.db.ArcLabelsIn(lastResource.res).getNext();
+ if(predicate instanceof Components.interfaces.nsIRDFResource) {
+ var parent = lastResource.db.GetSource(predicate, lastResource.res, true);
+ }
+ var parentType = BookmarksUtils.getProperty(parent, RDF_NS + "type", lastResource.db);
+ // if this is a livemark child, open as a web page, otherwise process it as a feed
+ if(parentType == NC_NS + "Livemark") {
+ getContentBrowser().loadURI(lastResource.url);
+ } else {
+ setStatusLoading();
+ httpGet(lastResource.url);
+ }
}
function createTreeContextMenu2(aEvent) {
@@ -192,7 +203,14 @@ function createTreeContextMenu2(aEvent) {
var cmdSrc = "";
var tempMenuItem;
- if(selection.type == "Bookmark" || selection.type == "Livemark") {
+ // get type of parent node
+ var predicate = bookmarksTree.db.ArcLabelsIn(bookmarksTree.currentResource).getNext();
+ if(predicate instanceof Components.interfaces.nsIRDFResource) {
+ var parent = bookmarksTree.db.GetSource(predicate, bookmarksTree.currentResource, true);
+ }
+ var parentType = BookmarksUtils.getProperty(parent, RDF_NS + "type", bookmarksTree.db);
+
+ if((selection.type == "Bookmark" && parentType != NC_NS + "Livemark") || 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/sage.xul b/src/sage/content/sage.xul
index 255af50..7302796 100755
--- a/src/sage/content/sage.xul
+++ b/src/sage/content/sage.xul
@@ -14,6 +14,7 @@
<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://browser/content/utilityOverlay.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
--
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