jQuery is now supported!

Update to latest version of Chosen.
This commit is contained in:
Patrick Filler 2011-07-13 17:30:34 -04:00
parent 6d81952999
commit 0616f2af69
2 changed files with 10 additions and 28 deletions

View file

@ -1,27 +1,11 @@
(function() { (function() {
/* /*
Chosen for Protoype.js Chosen, a Select Box Enhancer for jQuery and Protoype
by Patrick Filler for Harvest 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 Copyright (c) 2011 by Harvest
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.
*/ var Chosen, OptionsParser, get_side_border_padding, root; */ var Chosen, OptionsParser, get_side_border_padding, root;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
root = typeof exports !== "undefined" && exports !== null ? exports : this; root = typeof exports !== "undefined" && exports !== null ? exports : this;
@ -608,6 +592,7 @@
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) { if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
return this.keydown_backstroke(); return this.keydown_backstroke();
} else if (!this.pending_backstroke) { } else if (!this.pending_backstroke) {
this.result_clear_highlight();
return this.results_search(); return this.results_search();
} }
break; break;
@ -649,13 +634,14 @@
} }
}; };
Chosen.prototype.search_field_scale = function() { 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) { if (this.is_multiple) {
h = 0; h = 0;
w = 0; w = 0;
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;"; 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']; 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) + ";"; style_block += style + ":" + this.search_field.getStyle(style) + ";";
} }
div = new Element('div', { div = new Element('div', {

View file

@ -41,7 +41,7 @@
<div id="content"> <div id="content">
<div id="container"> <div id="container">
<p>Chosen is a javsacript plug-in for Prototype (jQuery support coming soon) that makes long, unwieldy select boxes much more user-friendly.</p> <p>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.</p>
<p><a href="https://github.com/harvesthq/chosen/">Project page on GitHub</a></p> <p><a href="https://github.com/harvesthq/chosen/">Project page on GitHub</a></p>
@ -1065,10 +1065,6 @@
<h2>FAQs</h2> <h2>FAQs</h2>
<ul class="faqs"> <ul class="faqs">
<li>
<h3>Why did you build this built for Prototype?</h3>
<p>Chosen was built for <a href="http://www.getharvest.com/">Harvest</a>, which relies heavily on the Prototype framework. We're hoping to release a jQuery version of the library soon.</p>
</li>
<li> <li>
<h3>What browsers are supported?</h3> <h3>What browsers are supported?</h3>
<p>All modern browsers are support (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled.</p> <p>All modern browsers are support (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled.</p>