www

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

commit 72c8711cd341c011134857dbab4a8412b3639da4
parent 315100e5effd71a064f0474356af15ad0a31f402
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  3 May 2016 12:07:23 -0400

String::contains() -> indexOf() for Firefox 48 (and 38) compatibility

.contains() was removed in Firefox 48, but .includes() wasn't available until
40, so use indexOf() for now. We can start using .contains() once we no longer
need to support 38 ESR.

Diffstat:
Mchrome/content/zotero/xpcom/quickCopy.js | 2+-
Mchrome/content/zotero/xpcom/search.js | 2+-
Mcomponents/zotero-protocol-handler.js | 2+-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js @@ -145,7 +145,7 @@ Zotero.QuickCopy = new function() { // Only concern ourselves with entries containing the current domain // or paths that apply to all domains - if (!row.domainPath.contains(urlDomain[0]) && !row.domainPath.startsWith('/')) { + if (!row.domainPath.indexOf(urlDomain[0]) != -1 && !row.domainPath.startsWith('/')) { continue; } diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js @@ -1123,7 +1123,7 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () { let objectTypeClass = Zotero.DataObjectUtilities.getObjectsClassForObjectType(objectType); // Old-style library-key hash - if (objKey.contains('_')) { + if (objKey.indexOf('_') != -1) { [objLibraryID, objKey] = objKey.split('_'); } // libraryID assigned on search diff --git a/components/zotero-protocol-handler.js b/components/zotero-protocol-handler.js @@ -172,7 +172,7 @@ function ZoteroProtocolHandler() { // search // items // item - if (params.sort.contains('/')) { + if (params.sort.indexOf('/') != -1) { let parts = params.sort.split('/'); params.sort = parts[0]; params.direction = parts[1] == 'd' ? 'desc' : 'asc';