🌐 AI搜索 & 代理 主页
Skip to content

Commit d122e2b

Browse files
committed
Merged
2 parents fa2f14f + 842199e commit d122e2b

22 files changed

+64
-44
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
### 1.2.0 (not yet released)
4+
* Fix various typos [#137](https://github.com/corejavascript/typeahead.js/pull/137)
5+
36
### 1.1.1 January 12, 2017
47
* Fix hiding of .visuallyhidden style (introduced in #104) [#107](https://github.com/corejavascript/typeahead.js/pull/107)
58

dist/bloodhound.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
55
*/
66

7+
78
(function(root, factory) {
89
if (typeof define === "function" && define.amd) {
910
define([ "jquery" ], function(a0) {
1011
return root["Bloodhound"] = factory(a0);
1112
});
12-
} else if (typeof exports === "object") {
13+
} else if (typeof module === "object" && module.exports) {
1314
module.exports = factory(require("jquery"));
1415
} else {
1516
root["Bloodhound"] = factory(root["jQuery"]);
@@ -774,7 +775,7 @@
774775
} else if (o.wildcard) {
775776
prepare = prepareByWildcard;
776777
} else {
777-
prepare = idenityPrepare;
778+
prepare = identityPrepare;
778779
}
779780
return prepare;
780781
function prepareByReplace(query, settings) {
@@ -785,7 +786,7 @@
785786
settings.url = settings.url.replace(wildcard, encodeURIComponent(query));
786787
return settings;
787788
}
788-
function idenityPrepare(query, settings) {
789+
function identityPrepare(query, settings) {
789790
return settings;
790791
}
791792
}

dist/bloodhound.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typeahead.bundle.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
55
*/
66

7+
78
(function(root, factory) {
89
if (typeof define === "function" && define.amd) {
910
define([ "jquery" ], function(a0) {
1011
return root["Bloodhound"] = factory(a0);
1112
});
12-
} else if (typeof exports === "object") {
13+
} else if (typeof module === "object" && module.exports) {
1314
module.exports = factory(require("jquery"));
1415
} else {
1516
root["Bloodhound"] = factory(root["jQuery"]);
@@ -774,7 +775,7 @@
774775
} else if (o.wildcard) {
775776
prepare = prepareByWildcard;
776777
} else {
777-
prepare = idenityPrepare;
778+
prepare = identityPrepare;
778779
}
779780
return prepare;
780781
function prepareByReplace(query, settings) {
@@ -785,7 +786,7 @@
785786
settings.url = settings.url.replace(wildcard, encodeURIComponent(query));
786787
return settings;
787788
}
788-
function idenityPrepare(query, settings) {
789+
function identityPrepare(query, settings) {
789790
return settings;
790791
}
791792
}
@@ -956,7 +957,7 @@
956957
define([ "jquery" ], function(a0) {
957958
return factory(a0);
958959
});
959-
} else if (typeof exports === "object") {
960+
} else if (typeof module === "object" && module.exports) {
960961
module.exports = factory(require("jquery"));
961962
} else {
962963
factory(root["jQuery"]);

dist/typeahead.bundle.min.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/typeahead.jquery.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
* Copyright 2013-2017 Twitter, Inc. and other contributors; Licensed MIT
55
*/
66

7+
78
(function(root, factory) {
89
if (typeof define === "function" && define.amd) {
910
define([ "jquery" ], function(a0) {
1011
return factory(a0);
1112
});
12-
} else if (typeof exports === "object") {
13+
} else if (typeof module === "object" && module.exports) {
1314
module.exports = factory(require("jquery"));
1415
} else {
1516
factory(root["jQuery"]);

dist/typeahead.jquery.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/bloodhound.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Table of Contents
1212
* [Usage](#usage)
1313
* [API](#api)
1414
* [Options](#options)
15-
* [Tokenizers] (#tokenizers)
15+
* [Tokenizers](#tokenizers)
1616
* [Prefetch](#prefetch)
1717
* [Remote](#remote)
1818

@@ -297,6 +297,17 @@ When configuring `remote`, the following options are available.
297297
you to transform the remote response before the Bloodhound instance operates
298298
on it. Defaults to the [identity function].
299299

300+
* `transport` – A function with the signature `transport(options, onSuccess, onError)`
301+
that allows you to specify a custom transport:
302+
```javascript
303+
transport: function (options, onSuccess, onError) {
304+
// Modify the options or replace the next line
305+
$.ajax(options)
306+
.done(function(data, textStatus, request) { onSuccess(data); })
307+
.fail(function(request, textStatus, errorThrown) { onError(errorThrown); });
308+
}
309+
```
310+
300311
<!-- section links -->
301312

302313
[identity function]: http://en.wikipedia.org/wiki/Identity_function

doc/jquery_typeahead.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Datasets can be configured using the following options.
155155

156156
* `limit` – The max number of suggestions to be displayed. Defaults to `5`.
157157

158-
* `display` – For a given suggestion, determines the string representation
158+
* `display` | `displayKey` – For a given suggestion, determines the string representation
159159
of it. This will be used when setting the value of the input control after a
160160
suggestion is selected. Can be either a key string or a function that
161161
transforms a suggestion object into a string. Defaults to stringifying the

src/bloodhound/bloodhound.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var Bloodhound = (function() {
3333
queryTokenizer: o.queryTokenizer
3434
});
3535

36-
// hold off on intialization if the intialize option was explicitly false
36+
// hold off on initialization if the initialize option was explicitly false
3737
o.initialize !== false && this.initialize();
3838
}
3939

0 commit comments

Comments
 (0)