From ea767e5647cc6859b3238fbd7240a62f939893ad Mon Sep 17 00:00:00 2001 From: aurimasv Date: Thu, 26 Apr 2012 17:36:17 -0500 Subject: [PATCH] Set up environment for RDF parser --- chrome/content/zotero/xpcom/rdf.js | 9 +++--- chrome/content/zotero/xpcom/rdf/init.js | 32 +++++++++++++++++++ .../zotero/xpcom/translation/translate.js | 2 +- components/zotero-service.js | 1 + 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 chrome/content/zotero/xpcom/rdf/init.js diff --git a/chrome/content/zotero/xpcom/rdf.js b/chrome/content/zotero/xpcom/rdf.js index dceef34ffd..e68120ce57 100644 --- a/chrome/content/zotero/xpcom/rdf.js +++ b/chrome/content/zotero/xpcom/rdf.js @@ -1,6 +1,7 @@ // Tweaks to get the Tabulator RDF library to work without Tabulator. All of this happens in the // Zotero.RDF.AJAW namespace. -var kb = new RDFIndexedFormula(); -var tabulator = {log:{debug:function(arg) { - Zotero.debug(arg, 4); -}}}; +$rdf.RDFIndexedFormula = $rdf.IndexedFormula; +$rdf.RDFSymbol = $rdf.Symbol; +$rdf.RDFBlankNode = $rdf.BlankNode; + +Zotero.RDF.AJAW = $rdf; \ No newline at end of file diff --git a/chrome/content/zotero/xpcom/rdf/init.js b/chrome/content/zotero/xpcom/rdf/init.js new file mode 100644 index 0000000000..81941997b6 --- /dev/null +++ b/chrome/content/zotero/xpcom/rdf/init.js @@ -0,0 +1,32 @@ +/* Set up the environment before loading the rest of the files into Zotero */ +var $rdf = { + Util: { + ArrayIndexOf: function (arr, item, i) { + //supported in all browsers except IE<9 + return arr.indexOf(item, i); + }, + RDFArrayRemove: function(a, x) { //removes all statements equal to x from a + for(var i=0; i