[Pkg-mozext-commits] [sage-extension] 17/49: internalize RDF_NS and NC_NS strings for Deer Park compatibility
David Prévot
taffit at moszumanska.debian.org
Fri May 1 03:10:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag sage_1_3_10
in repository sage-extension.
commit 3d79f9044e0bcf2c854aa4eff8d7c63017fdfa1f
Author: Peter Andrews <petea at jhu.edu>
Date: Sun Jun 12 22:16:05 2005 +0000
internalize RDF_NS and NC_NS strings for Deer Park compatibility
---
src/sage/content/commonfunc.js | 12 +++++++-----
src/sage/content/getrsstitle.js | 4 ++--
src/sage/content/opml/opml.js | 10 +++++-----
src/sage/content/sage.js | 28 ++++++++++++++--------------
src/sage/content/settings/settings.js | 4 ++--
src/sage/content/updatechecker.js | 4 ++--
6 files changed, 32 insertions(+), 30 deletions(-)
diff --git a/src/sage/content/commonfunc.js b/src/sage/content/commonfunc.js
index 907aed7..21701f5 100755
--- a/src/sage/content/commonfunc.js
+++ b/src/sage/content/commonfunc.js
@@ -86,14 +86,16 @@ var CommonFunc = {
// ++++++++++ ++++++++++ Bookmark RDF ++++++++++ ++++++++++
- BM_LAST_VISIT: "http://home.netscape.com/WEB-rdf#LastVisitDate",
+ NC_NS: "http://home.netscape.com/NC-rdf#",
+ BM_LAST_VISIT: "http://home.netscape.com/WEB-rdf#LastVisitDate",
BM_LAST_MODIFIED: "http://home.netscape.com/WEB-rdf#LastModifiedDate",
BM_DESCRIPTION: "http://home.netscape.com/NC-rdf#Description",
- BM_NAME: "http://home.netscape.com/NC-rdf#Name",
- BM_URL: "http://home.netscape.com/NC-rdf#URL",
- BM_FEEDURL: "http://home.netscape.com/NC-rdf#FeedURL",
+ BM_NAME: "http://home.netscape.com/NC-rdf#Name",
+ BM_URL: "http://home.netscape.com/NC-rdf#URL",
+ BM_FEEDURL: "http://home.netscape.com/NC-rdf#FeedURL",
- RDF_TYPE: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
+ RDF_NS: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+ RDF_TYPE: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
STATUS_UPDATE: "updated",
STATUS_NO_UPDATE: "no-updated",
diff --git a/src/sage/content/getrsstitle.js b/src/sage/content/getrsstitle.js
index 8720b01..9cb0af2 100755
--- a/src/sage/content/getrsstitle.js
+++ b/src/sage/content/getrsstitle.js
@@ -9,10 +9,10 @@ var GetRssTitle = {
this.res = RDF.GetResource(aBookmrkID);
var type = CommonFunc.getBMDSProperty(this.res, CommonFunc.RDF_TYPE);
- if(type == NC_NS + "Bookmark") {
+ if(type == CommonFunc.NC_NS + "Bookmark") {
this.url = CommonFunc.getBMDSProperty(this.res, CommonFunc.BM_URL);
}
- if(type == NC_NS + "Livemark") {
+ if(type == CommonFunc.NC_NS + "Livemark") {
this.url = CommonFunc.getBMDSProperty(this.res, CommonFunc.BM_FEEDURL);
}
diff --git a/src/sage/content/opml/opml.js b/src/sage/content/opml/opml.js
index 90b5f0a..ee3c604 100755
--- a/src/sage/content/opml/opml.js
+++ b/src/sage/content/opml/opml.js
@@ -214,16 +214,16 @@ function createOpmlSource() {
function createOpmlOutline(aOpmlDoc, aRssItem) {
var type = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.RDF_TYPE);
var url;
- if(type == NC_NS + "Bookmark") {
+ if(type == CommonFunc.NC_NS + "Bookmark") {
url = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_URL);
}
- if(type == NC_NS + "Livemark") {
+ if(type == CommonFunc.NC_NS + "Livemark") {
url = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_FEEDURL);
}
var title = CommonFunc.getBMDSProperty(aRssItem, CommonFunc.BM_NAME);
var outlineNode = aOpmlDoc.createElement("outline");
- if(type == NC_NS + "Folder") {
+ if(type == CommonFunc.NC_NS + "Folder") {
outlineNode.setAttribute("text", title);
var rdfContainer = Components.classes["@mozilla.org/rdf/container;1"].getService(Components.interfaces.nsIRDFContainer);
@@ -233,11 +233,11 @@ function createOpmlOutline(aOpmlDoc, aRssItem) {
while(containerChildren.hasMoreElements()) {
var res = containerChildren.getNext().QueryInterface(kRDFRSCIID);
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") {
+ if(res_type == CommonFunc.NC_NS + "Folder" || res_type == CommonFunc.NC_NS + "Bookmark" || res_type == CommonFunc.NC_NS + "Livemark") {
outlineNode.appendChild(createOpmlOutline(aOpmlDoc, res));
}
}
- } else if(type == NC_NS + "Bookmark" || type == NC_NS + "Livemark") {
+ } else if(type == CommonFunc.NC_NS + "Bookmark" || type == CommonFunc.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 0aeacc2..8bd9cf9 100755
--- a/src/sage/content/sage.js
+++ b/src/sage/content/sage.js
@@ -47,7 +47,7 @@ function init() {
strRes.getString("RESULT_NOT_AVAILABLE_STR"),
strRes.getString("RESULT_ERROR_FAILURE_STR")
);
-
+
// get the version string from the last release used
var lastVersion = CommonFunc.getPrefValue(CommonFunc.LAST_VERSION, "str", null);
if(lastVersion) {
@@ -186,12 +186,12 @@ function updateCheck(aCheckFolderId) {
function BookmarkResource(aRes, aDB) {
this.res = aRes;
this.db = aDB;
- this.name = BookmarksUtils.getProperty(this.res, NC_NS + "Name", this.db);
- if(BookmarksUtils.getProperty(this.res, RDF_NS + "type", this.db) == NC_NS + "Bookmark") {
- this.url = BookmarksUtils.getProperty(this.res, NC_NS + "URL", this.db);
+ this.name = BookmarksUtils.getProperty(this.res, CommonFunc.NC_NS + "Name", this.db);
+ if(BookmarksUtils.getProperty(this.res, CommonFunc.RDF_NS + "type", this.db) == CommonFunc.NC_NS + "Bookmark") {
+ this.url = BookmarksUtils.getProperty(this.res, CommonFunc.NC_NS + "URL", this.db);
}
- if(BookmarksUtils.getProperty(this.res, RDF_NS + "type", this.db) == NC_NS + "Livemark") {
- this.url = BookmarksUtils.getProperty(this.res, NC_NS + "FeedURL", this.db);
+ if(BookmarksUtils.getProperty(this.res, CommonFunc.RDF_NS + "type", this.db) == CommonFunc.NC_NS + "Livemark") {
+ this.url = BookmarksUtils.getProperty(this.res, CommonFunc.NC_NS + "FeedURL", this.db);
}
}
@@ -203,9 +203,9 @@ function bookmarksOpen() {
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);
+ var parentType = BookmarksUtils.getProperty(parent, CommonFunc.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") {
+ if(parentType == CommonFunc.NC_NS + "Livemark") {
getContentBrowser().loadURI(lastResource.url);
} else {
setStatusLoading();
@@ -227,9 +227,9 @@ function createTreeContextMenu2(aEvent) {
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);
+ var parentType = BookmarksUtils.getProperty(parent, CommonFunc.RDF_NS + "type", bookmarksTree.db);
- if((selection.type == "Bookmark" && parentType != NC_NS + "Livemark") || selection.type == "Livemark") {
+ if((selection.type == "Bookmark" && parentType != CommonFunc.NC_NS + "Livemark") || selection.type == "Livemark") {
cmdSrc = "GetRssTitle.getRssTitle('" + itemId + "')";
tempMenuItem = document.createElement("menuitem");
tempMenuItem.setAttribute("label", strRes.getString("GET_RSS_TITLE"));
@@ -247,7 +247,7 @@ function createTreeContextMenu2(aEvent) {
}
function bookmarksTreeClick(aEvent) {
- var selectedItemType = BookmarksUtils.getProperty(bookmarksTree.currentResource, RDF_NS + "type", bookmarksTree.db);
+ var selectedItemType = BookmarksUtils.getProperty(bookmarksTree.currentResource, CommonFunc.RDF_NS + "type", bookmarksTree.db);
switch(aEvent.type) {
case "click":
var obj = {};
@@ -258,7 +258,7 @@ function bookmarksTreeClick(aEvent) {
return;
}
if(obj.value == "twisty") return;
- if(selectedItemType == NC_NS + "Folder") {
+ if(selectedItemType == CommonFunc.NC_NS + "Folder") {
bookmarksTree.treeBoxObject.view.toggleOpenState(row);
}
break;
@@ -274,8 +274,8 @@ function bookmarksTreeClick(aEvent) {
if(aEvent.button == 1) { CreateHTML.tabbed = true; } // click middle button
if(aEvent.ctrlKey) { CreateHTML.tabbed = true; } // press Ctrl Key
- const BOOKMARK_SEPARATOR = NC_NS + "BookmarkSeparator";
- const BOOKMARK_FOLDER = NC_NS + "Folder";
+ const BOOKMARK_SEPARATOR = CommonFunc.NC_NS + "BookmarkSeparator";
+ const BOOKMARK_FOLDER = CommonFunc.NC_NS + "Folder";
if(selectedItemType == BOOKMARK_SEPARATOR || selectedItemType == BOOKMARK_FOLDER) {
return;
}
diff --git a/src/sage/content/settings/settings.js b/src/sage/content/settings/settings.js
index 4e825ae..bd94665 100755
--- a/src/sage/content/settings/settings.js
+++ b/src/sage/content/settings/settings.js
@@ -23,8 +23,8 @@ function init() {
var header = document.getElementById("header");
header.setAttribute("description", header.getAttribute("description") + " " + CommonFunc.versionString(CommonFunc.VERSION, 1));
- sageFolderID = CommonFunc.getPrefValue(CommonFunc.FEED_FOLDER_ID, "str", "NC:BookmarksRoot");
- gNameArc = RDF.GetResource(NC_NS + "Name");
+ sageFolderID = CommonFunc.getPrefValue(CommonFunc.FEED_FOLDER_ID, "str", "NC:BookmarksRoot");
+ gNameArc = RDF.GetResource(CommonFunc.NC_NS + "Name");
gList = document.getElementById("select-menu");
chkUserCssEnable = document.getElementById("chkUserCssEnable");
diff --git a/src/sage/content/updatechecker.js b/src/sage/content/updatechecker.js
index c4d2c59..38253a9 100755
--- a/src/sage/content/updatechecker.js
+++ b/src/sage/content/updatechecker.js
@@ -7,10 +7,10 @@ var UpdateChecker = {
getURL: function(resource) {
var type = CommonFunc.getBMDSProperty(resource, CommonFunc.RDF_TYPE);
var url;
- if(type == NC_NS + "Bookmark") {
+ if(type == CommonFunc.NC_NS + "Bookmark") {
url = CommonFunc.getBMDSProperty(resource, CommonFunc.BM_URL);
}
- if(type == NC_NS + "Livemark") {
+ if(type == CommonFunc.NC_NS + "Livemark") {
url = CommonFunc.getBMDSProperty(resource, CommonFunc.BM_FEEDURL);
}
return url;
--
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