From 0616f2af69482943b15da996d603ed63a8914dae Mon Sep 17 00:00:00 2001 From: Patrick Filler Date: Wed, 13 Jul 2011 17:30:34 -0400 Subject: [PATCH] jQuery is now supported! Update to latest version of Chosen. --- chosen/chosen.proto.js | 32 +++++++++----------------------- index.html | 6 +----- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/chosen/chosen.proto.js b/chosen/chosen.proto.js index 27452b7..27a70d5 100644 --- a/chosen/chosen.proto.js +++ b/chosen/chosen.proto.js @@ -1,27 +1,11 @@ (function() { /* - Chosen for Protoype.js - by Patrick Filler for Harvest + Chosen, a Select Box Enhancer for jQuery and Protoype + by Patrick Filler for Harvest, http://getharvest.com - Copyright (c) 2011 Harvest + Available for use under the MIT License, http://en.wikipedia.org/wiki/MIT_License - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. + Copyright (c) 2011 by Harvest */ var Chosen, OptionsParser, get_side_border_padding, root; var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; root = typeof exports !== "undefined" && exports !== null ? exports : this; @@ -608,6 +592,7 @@ if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { return this.keydown_backstroke(); } else if (!this.pending_backstroke) { + this.result_clear_highlight(); return this.results_search(); } break; @@ -649,13 +634,14 @@ } }; Chosen.prototype.search_field_scale = function() { - var dd_top, div, h, style, style_block, styles, w; + var dd_top, div, h, style, style_block, styles, w, _i, _len; if (this.is_multiple) { h = 0; w = 0; style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"; styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing']; - for (style in styles) { + for (_i = 0, _len = styles.length; _i < _len; _i++) { + style = styles[_i]; style_block += style + ":" + this.search_field.getStyle(style) + ";"; } div = new Element('div', { @@ -760,4 +746,4 @@ return parser.parsed; }; root.OptionsParser = OptionsParser; -}).call(this); +}).call(this); \ No newline at end of file diff --git a/index.html b/index.html index 4ef0fc9..15a24c7 100644 --- a/index.html +++ b/index.html @@ -41,7 +41,7 @@
-

Chosen is a javsacript plug-in for Prototype (jQuery support coming soon) that makes long, unwieldy select boxes much more user-friendly.

+

Chosen is a javsacript plug-in makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.

Project page on GitHub

@@ -1065,10 +1065,6 @@

FAQs

    -
  • -

    Why did you build this built for Prototype?

    -

    Chosen was built for Harvest, which relies heavily on the Prototype framework. We're hoping to release a jQuery version of the library soon.

    -
  • What browsers are supported?

    All modern browsers are support (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled.