diff --git a/Definitions/chosen-0.9.d.ts b/Definitions/chosen-0.9.d.ts new file mode 100644 index 000000000..680b9622e --- /dev/null +++ b/Definitions/chosen-0.9.d.ts @@ -0,0 +1,24 @@ +// Type definitions for Chosen.JQuery 0.9 +// Project: http://harvesthq.github.com/chosen/ +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/// + +interface ChosenOptions { + allow_single_deselect?: bool; + disable_search_threshold?: number; + disable_search?: bool; + search_contains?: bool; + single_backstroke_delete?: bool; + max_selected_options?: number; + placeholder_text_multiple?: string; + placeholder_text?: string; + placeholder_text_single?: string; + no_results_text?: string; +} + +interface JQuery { + chosen(): JQuery; + chosen(options: ChosenOptions): JQuery; +} \ No newline at end of file diff --git a/README.md b/README.md index a12079134..b732bd80a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Complete * [Backbone.js](http://backbonejs.org/) * [Bootstrap](http://twitter.github.com/bootstrap/) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) +* [Chosen](http://harvesthq.github.com/chosen/) * [dynatree](http://code.google.com/p/dynatree/) (by [François de Campredon](https://github.com/fdecampredon)) * [ember.js](http://emberjs.com/) * [Express](http://expressjs.com/) @@ -43,7 +44,6 @@ Complete Next ---- -* Chosen * Facebook SDK * jQuery.Validate * google.visualization diff --git a/Tests/chosen-tests.ts b/Tests/chosen-tests.ts new file mode 100644 index 000000000..855aabe94 --- /dev/null +++ b/Tests/chosen-tests.ts @@ -0,0 +1,8 @@ +/// + +$(".chzn-select").chosen({ no_results_text: "No results matched" }); +$("#form_field").chosen().change(); +$("#form_field").trigger("liszt:updated"); + +$(".chzn-select").chosen(); +$(".chzn-select-deselect").chosen({ allow_single_deselect: true }); \ No newline at end of file