Permalink
Browse files

clean up settings

  • Loading branch information...
1 parent a1af7f9 commit 5a0b789b5f69a589e9dab6ee045d8c47dd2c3c0f @loopj loopj committed Aug 4, 2011
Showing with 25 additions and 10 deletions.
  1. +25 −10 src/jquery.tokeninput.js
View
35 src/jquery.tokeninput.js
@@ -11,31 +11,46 @@
(function ($) {
// Default settings
var DEFAULT_SETTINGS = {
+ // Search settings
propertyToSearch: "name",
+ method: "GET",
+ contentType: "json",
+ queryParam: "q",
+ searchDelay: 300,
+ minChars: 1,
+ jsonContainer: null,
+
+ // Display settings
hintText: "Type in a search term",
noResultsText: "No results",
searchingText: "Searching...",
deleteText: "×",
- searchDelay: 300,
- minChars: 1,
+ animateDropdown: true,
+
+ // Tokenization settings
tokenLimit: null,
- jsonContainer: null,
- method: "GET",
- contentType: "json",
- queryParam: "q",
tokenDelimiter: ",",
- tokenValue: "id",
preventDuplicates: false,
+
+ // Output settings
+ tokenValue: "id",
+
+ // Prepopulation settings
prePopulate: null,
processPrePopulate: false,
- animateDropdown: true,
+
+ // Manipulation settings
+ idPrefix: "token-input-",
+
+ // Formatters
resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
+
+ // Callbacks
onResult: null,
onAdd: null,
onDelete: null,
- onReady: null,
- idPrefix: "token-input-"
+ onReady: null
};
// Default classes to use when theming

0 comments on commit 5a0b789

Please sign in to comment.