From b62b479ae43f0ca556ce3f53ebb995ced4c4cbb5 Mon Sep 17 00:00:00 2001
From: Simon Kornblith <simon@simonster.com>
Date: Thu, 13 Aug 2015 19:39:13 -0400
Subject: [PATCH] Silence some warnings in QuickFormat

---
 chrome/content/zotero/integration/quickFormat.js     | 12 ++++++------
 .../zotero/integration/windowDraggingUtils.js        |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/integration/quickFormat.js b/chrome/content/zotero/integration/quickFormat.js
index 5919ff6b1..0bcead651 100644
--- a/chrome/content/zotero/integration/quickFormat.js
+++ b/chrome/content/zotero/integration/quickFormat.js
@@ -80,7 +80,7 @@ var Zotero_QuickFormat = new function () {
 			var locators = Zotero.Cite.labels;
 			var menu = document.getElementById("locator-label");
 			var labelList = document.getElementById("locator-label-popup");
-			for each(var locator in locators) {
+			for(var locator of locators) {
 				var locatorLabel = Zotero.getString('citation.locator.'+locator.replace(/\s/g,''));
 				
 				// add to list of labels
@@ -267,7 +267,7 @@ var Zotero_QuickFormat = new function () {
 			if(year) str += " "+year;
 			
 			var s = new Zotero.Search();
-			str = str.replace(" & ", " ", "g").replace(" and ", " ", "g");
+			str = str.replace(/ (?:&|and) /g, " ", "g");
 			if(charRe.test(str)) {
 				Zotero.debug("QuickFormat: QuickSearch: "+str);
 				s.addCondition("quicksearch-titleCreatorYear", "contains", str);
@@ -304,7 +304,7 @@ var Zotero_QuickFormat = new function () {
 					for(var i=0, iCount=citedItems.length; i<iCount; i++) {
 						// Generate a string to search for each item
 						var item = citedItems[i],
-							itemStr = [creator.ref.firstName+" "+creator.ref.lastName for each(creator in item.getCreators())];
+							itemStr = [creator.ref.firstName+" "+creator.ref.lastName for (creator of item.getCreators())];
 						itemStr = itemStr.concat([item.getField("title"), item.getField("date", true, true).substr(0, 4)]).join(" ");
 						
 						// See if words match
@@ -397,7 +397,7 @@ var Zotero_QuickFormat = new function () {
 		// Also take into account items cited in this citation. This means that the sorting isn't
 		// exactly by # of items cited from each library, but maybe it's better this way.
 		_updateCitationObject();
-		for each(var citationItem in io.citation.citationItems) {
+		for(var citationItem of io.citation.citationItems) {
 			var citedItem = Zotero.Cite.getItem(citationItem.id);
 			if(!citedItem.cslItemID) {
 				var libraryID = citedItem.libraryID ? citedItem.libraryID : 0;
@@ -786,7 +786,7 @@ var Zotero_QuickFormat = new function () {
 			if(!panelFrameHeight) {
 				panelFrameHeight = referencePanel.boxObject.height - referencePanel.clientHeight;
 				var computedStyle = window.getComputedStyle(referenceBox, null);
-				for each(var attr in ["border-top-width", "border-bottom-width"]) {
+				for(var attr of ["border-top-width", "border-bottom-width"]) {
 					var val = computedStyle.getPropertyValue(attr);
 					if(val) {
 						var m = pixelRe.exec(val);
@@ -941,7 +941,7 @@ var Zotero_QuickFormat = new function () {
 		if(item.id) {
 			var libraryName = item.libraryID ? Zotero.Libraries.getName(item.libraryID)
 							: Zotero.getString('pane.collections.library');
-			panelLibraryLink.textContent = Zotero.getString("integration.openInLibrary", libraryName);
+			panelLibraryLink.label = Zotero.getString("integration.openInLibrary", libraryName);
 		}
 
 		target.setAttribute("selected", "true");
diff --git a/chrome/content/zotero/integration/windowDraggingUtils.js b/chrome/content/zotero/integration/windowDraggingUtils.js
index bbcc23b09..d23f3e40a 100644
--- a/chrome/content/zotero/integration/windowDraggingUtils.js
+++ b/chrome/content/zotero/integration/windowDraggingUtils.js
@@ -51,7 +51,7 @@ WindowDraggingElement.prototype = {
     if (aEvent.button != 0 ||
         this._window.fullScreen ||
         !this.mouseDownCheck.call(this._elem, aEvent) ||
-        aEvent.getPreventDefault())
+        aEvent.defaultPrevented)
       return false;
 
     let target = aEvent.originalTarget, parent = aEvent.originalTarget;