Add Chosen.jQuery definitions and tests

This commit is contained in:
Boris Yankov
2012-10-30 22:05:15 +02:00
parent 1433975dbc
commit cc4cd9e7dc
3 changed files with 33 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for Chosen.JQuery 0.9
// Project: http://harvesthq.github.com/chosen/
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="jquery-1.8.d.ts"/>
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;
}
+1 -1
View File
@@ -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
+8
View File
@@ -0,0 +1,8 @@
/// <reference path="../Definitions/chosen-0.9.d.ts" />
$(".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 });