mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1015: do not override the jQuery contains() function by defining our own with that name; rather use the one from Underscore.
This commit is contained in:
parent
f29ff1b468
commit
c573d61207
@ -61,18 +61,6 @@ jQuery.getQueryParameters = function(s) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* small function to check if an array contains
|
|
||||||
* a given item.
|
|
||||||
*/
|
|
||||||
jQuery.contains = function(arr, item) {
|
|
||||||
for (var i = 0; i < arr.length; i++) {
|
|
||||||
if (arr[i] == item)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* highlight a given string on a jquery object by wrapping it in
|
* highlight a given string on a jquery object by wrapping it in
|
||||||
* span elements with the given class name.
|
* span elements with the given class name.
|
||||||
|
@ -150,7 +150,7 @@ var Search = {
|
|||||||
hlterms.push(tmp[i].toLowerCase());
|
hlterms.push(tmp[i].toLowerCase());
|
||||||
}
|
}
|
||||||
// only add if not already in the list
|
// only add if not already in the list
|
||||||
if (!$.contains(toAppend, word))
|
if (!$u.contains(toAppend, word))
|
||||||
toAppend.push(word);
|
toAppend.push(word);
|
||||||
};
|
};
|
||||||
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
|
var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
|
||||||
@ -217,7 +217,7 @@ var Search = {
|
|||||||
// search result.
|
// search result.
|
||||||
for (var i = 0; i < excluded.length; i++) {
|
for (var i = 0; i < excluded.length; i++) {
|
||||||
if (terms[excluded[i]] == file ||
|
if (terms[excluded[i]] == file ||
|
||||||
$.contains(terms[excluded[i]] || [], file)) {
|
$u.contains(terms[excluded[i]] || [], file)) {
|
||||||
valid = false;
|
valid = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user