www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 72789baef6dac8d86f905e2f1cdea5de62a8b505
parent 66bfaaae13ba8590cb542b9ecafb4b232a5a201d
Author: aurimasv <aurimas.dev@gmail.com>
Date:   Sat, 12 May 2012 05:25:13 -0500

Minor RDF tweaks

Diffstat:
Mchrome/content/zotero/xpcom/rdf/identity.js | 17+++++++----------
Mchrome/content/zotero/xpcom/rdf/init.js | 18++++++++----------
2 files changed, 15 insertions(+), 20 deletions(-)

diff --git a/chrome/content/zotero/xpcom/rdf/identity.js b/chrome/content/zotero/xpcom/rdf/identity.js @@ -202,7 +202,7 @@ We replace the bigger with the smaller. moveIndex(this.classActions); moveIndex(this.propertyActions); - tabulator.log.debug("Equate done. "+big+" now links to "+small) + $rdf.log.debug("Equate done. "+big+" now links to "+small) return true; // true means the statement does not need to be put in }; @@ -250,9 +250,7 @@ We replace the bigger with the smaller. return new $rdf.Literal(val); // @@ differet types if(typeof val == 'boolean') return new $rdf.Literal(val ? "1" : "0", undefined, $rdf.Symbol.prototype.XSDboolean); - else if(typeof val == 'number') - return new $rdf.Literal('' + val); // @@ datatypes - else if(typeof val == 'undefined') + if(typeof val == 'undefined') return undefined; else // @@ add converting of dates and numbers throw "Can't make Term from " + val + " of type " + typeof val; @@ -390,12 +388,11 @@ We replace the bigger with the smaller. break; } } - if(st != null) results.push(st); - } - - if(justOne) { - if(results.length > 1) - results = results.slice(0, 1); + if(st != null) { + results.push(st); + if(justOne) + break; + } } return results; }; // statementsMatching diff --git a/chrome/content/zotero/xpcom/rdf/init.js b/chrome/content/zotero/xpcom/rdf/init.js @@ -19,7 +19,11 @@ var $rdf = { } throw "RDFArrayRemove: Array did not contain " + x; }, - } + }, + log: { + debug: Zotero.debug, + warn: Zotero.debug + } }; if(Zotero.RDF) { @@ -28,11 +32,5 @@ if(Zotero.RDF) { Zotero.RDF = {AJAW:$rdf}; } -var tabulator = { - log: { - debug: Zotero.debug, - warn: Zotero.debug - } -}; - -var alert = Zotero.debug; -\ No newline at end of file +var tabulator = {log: $rdf.log}; +var alert = $rdf.log.warn; +\ No newline at end of file