diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml
index bff6496626..a2cedddc70 100644
--- a/chrome/content/zotero/bindings/attachmentbox.xml
+++ b/chrome/content/zotero/bindings/attachmentbox.xml
@@ -297,7 +297,7 @@
}
// Note editor
- var noteEditor = this._id('note-editor');
+ var noteEditor = this._id('attachment-note-editor');
if (this.displayNote) {
if (this.displayNoteIfEmpty || this.item.getNote() != '') {
Zotero.debug("setting links on top");
@@ -542,7 +542,7 @@
-
+
diff --git a/chrome/content/zotero/bindings/noteeditor.xml b/chrome/content/zotero/bindings/noteeditor.xml
index f06d99adeb..6929f9fcd0 100644
--- a/chrome/content/zotero/bindings/noteeditor.xml
+++ b/chrome/content/zotero/bindings/noteeditor.xml
@@ -216,9 +216,13 @@
-
+
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
index 35d564b20b..5c75532adf 100644
--- a/chrome/content/zotero/bindings/styled-textbox.xml
+++ b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -103,6 +103,7 @@
this._constructed = true;
+ // Don't load if a value hasn't yet been set
if (this._loadOnConstruct) {
this._load();
}
diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js
index 59b4586836..d651ac0ec7 100644
--- a/chrome/content/zotero/integration/quickFormat.js
+++ b/chrome/content/zotero/integration/quickFormat.js
@@ -162,7 +162,7 @@ var Zotero_QuickFormat = new function () {
var str = _getEditorContent();
var haveConditions = false;
- const specifiedLocatorRe = /(?:,? *(pp|p)(?:\. *| +)|:)([0-9\-]+) *$/;
+ const specifiedLocatorRe = /^(?:,? *(pp|p)(?:\. *| +)|:)([0-9\-]+) *$/;
const yearPageLocatorRe = /,? *([0-9]+) *((B[. ]*C[. ]*|B[. ]*)|[AC][. ]*|A[. ]*D[. ]*|C[. ]*E[. ]*)?,? *(?:([0-9\-]+))?$/i;
const creatorSplitRe = /(?:,| *(?:and|\&)) +/;
const charRe = /[\w\u007F-\uFFFF]/;
@@ -230,22 +230,16 @@ var Zotero_QuickFormat = new function () {
str = str.substr(0, m.index)+str.substring(m.index+m[0].length);
}
+ if(year) str += " "+year;
var s = new Zotero.Search();
str = str.replace(" & ", " ", "g").replace(" and ", " ", "g");
if(charRe.test(str)) {
Zotero.debug("QuickFormat: QuickSearch: "+str);
- s.addCondition("quicksearch-titlesAndCreators", "contains", str);
+ s.addCondition("quicksearch-titleCreatorYear", "contains", str);
s.addCondition("itemType", "isNot", "attachment");
haveConditions = true;
}
-
- if(year) {
- Zotero.debug("QuickFormat: Year: "+year);
- s.addCondition("date", "isAfter", (year-1)+"-12-31 23:59:59");
- s.addCondition("date", "isBefore", (year)+"-12-31 23:59:59");
- haveConditions = true;
- }
}
var ids = (haveConditions ? s.search() : []);
diff --git a/chrome/content/zotero/xpcom/annotate.js b/chrome/content/zotero/xpcom/annotate.js
index d180eec2c2..5d84b5fbbf 100644
--- a/chrome/content/zotero/xpcom/annotate.js
+++ b/chrome/content/zotero/xpcom/annotate.js
@@ -262,7 +262,7 @@ Zotero.Annotate = new function() {
function _seen(node,array) {
var seen = false;
for (n in array) {
- if (node.isSameNode(array[n])) {
+ if (node === array[n]) {
var seen = true;
}
}
@@ -389,7 +389,7 @@ Zotero.Annotate.Path.prototype.fromNode = function(node, offset) {
}
if(!node) throw "Annotate: Path() resolved text offset inappropriately";
- while(node && !node.isSameNode(this._document)) {
+ while(node && !node === this._document) {
var number = 1;
var sibling = node.previousSibling;
while(sibling) {
@@ -1378,7 +1378,7 @@ Zotero.Highlight.prototype.unhighlight = function(container, offset, path, mode)
if(!span) continue;
var parentNode = span.parentNode;
- if(mode != 0 && span.isSameNode(container.parentNode) && offset != 0) {
+ if(mode != 0 && span === container.parentNode && offset != 0) {
if(mode == 1) {
// split text node
var textNode = container.splitText(offset);
@@ -1387,7 +1387,7 @@ Zotero.Highlight.prototype.unhighlight = function(container, offset, path, mode)
// loop through, removing nodes
var node = span.firstChild;
- while(span.firstChild && !span.firstChild.isSameNode(textNode)) {
+ while(span.firstChild && !span.firstChild === textNode) {
parentNode.insertBefore(span.removeChild(span.firstChild), span);
}
} else if(mode == 2) {
@@ -1435,25 +1435,25 @@ Zotero.Highlight.prototype._highlight = function() {
var ancestor = this.range.commonAncestorContainer;
- var onlyOneNode = startNode.isSameNode(endNode);
+ var onlyOneNode = startNode === endNode;
- if(!onlyOneNode && !startNode.isSameNode(ancestor) && !endNode.isSameNode(ancestor)) {
+ if(!onlyOneNode && !startNode === ancestor && !endNode === ancestor) {
// highlight nodes after start node in the DOM hierarchy not at ancestor level
- while(startNode.parentNode && !startNode.parentNode.isSameNode(ancestor)) {
+ while(startNode.parentNode && !startNode.parentNode === ancestor) {
if(startNode.nextSibling) {
this._highlightSpaceBetween(startNode.nextSibling, startNode.parentNode.lastChild);
}
startNode = startNode.parentNode
}
// highlight nodes after end node in the DOM hierarchy not at ancestor level
- while(endNode.parentNode && !endNode.parentNode.isSameNode(ancestor)) {
+ while(endNode.parentNode && !endNode.parentNode === ancestor) {
if(endNode.previousSibling) {
this._highlightSpaceBetween(endNode.parentNode.firstChild, endNode.previousSibling);
}
endNode = endNode.parentNode
}
// highlight nodes between start node and end node at ancestor level
- if(!startNode.isSameNode(endNode.previousSibling)) {
+ if(!startNode === endNode.previousSibling) {
this._highlightSpaceBetween(startNode.nextSibling, endNode.previousSibling);
}
}
@@ -1531,10 +1531,10 @@ Zotero.Highlight.prototype._highlightTextNode = function(textNode) {
// look for span in this.spans and delete it if it's there
var span = previousSiblingHighlighted ? previousSibling : nextSibling;
for(var i=0; i