Silence some warnings in QuickFormat

This commit is contained in:
Simon Kornblith 2015-08-13 19:39:13 -04:00
parent 570e628679
commit b62b479ae4
2 changed files with 7 additions and 7 deletions

View file

@ -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");

View file

@ -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;