Skip to content

Commit

Permalink
Released 0.7.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreavis committed Sep 16, 2013
1 parent 586ea16 commit 46d0b35
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 49 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "selectize",
"keywords": ["select", "ui", "form", "input", "control", "autocomplete", "tagging", "tag"],
"description": "Selectize is a jQuery-based custom <select> UI control. Useful for tagging, contact lists, country selectors, etc.",
"version": "0.7.6",
"version": "0.7.7",
"license": "Apache License, Version 2.0",
"readmeFilename": "README.md",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion dist/css/selectize.bootstrap2.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap2.css (v0.7.6) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.7.7) - Bootstrap 2 Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/css/selectize.bootstrap3.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap3.css (v0.7.6) - Bootstrap 3 Theme
* selectize.bootstrap3.css (v0.7.7) - Bootstrap 3 Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/css/selectize.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.css (v0.7.6)
* selectize.css (v0.7.7)
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/css/selectize.default.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.default.css (v0.7.6) - Default Theme
* selectize.default.css (v0.7.7) - Default Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/css/selectize.legacy.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.legacy.css (v0.7.6) - Default Theme
* selectize.legacy.css (v0.7.7) - Default Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
42 changes: 26 additions & 16 deletions dist/js/selectize.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.js (v0.7.6)
* selectize.js (v0.7.7)
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -157,17 +157,6 @@
.replace(/"/g, '&quot;');
};

/**
* Escapes quotation marks with backslashes. Useful
* for escaping values for use in CSS attribute selectors.
*
* @param {string} str
* @return {string}
*/
var escape_quotes = function(str) {
return str.replace(/(['"])/g, '\\$1');
};

var hook = {};

/**
Expand Down Expand Up @@ -1429,7 +1418,7 @@
*/
addOptionGroup: function(id, data) {
this.optgroups[id] = data;
this.trigger('optgroup_add', value, data);
this.trigger('optgroup_add', id, data);
},

/**
Expand Down Expand Up @@ -1527,8 +1516,7 @@
* @returns {object}
*/
getOption: function(value) {
value = hash_key(value);
return value ? this.$dropdown_content.find('[data-selectable]').filter('[data-value="' + escape_quotes(value) + '"]:first') : $();
return this.getElementWithValue(value, this.$dropdown_content.find('[data-selectable]'));
},

/**
Expand All @@ -1546,6 +1534,28 @@
return index >= 0 && index < $options.length ? $options.eq(index) : $();
},

/**
* Finds the first element with a "data-value" attribute
* that matches the given value.
*
* @param {mixed} value
* @param {object} $els
* @return {object}
*/
getElementWithValue: function(value, $els) {
value = hash_key(value);

if (value) {
for (var i = 0, n = $els.length; i < n; i++) {
if ($els[i].getAttribute('data-value') === value) {
return $($els[i]);
}
}
}

return $();
},

/**
* Returns the jQuery element of the item
* matching the given value.
Expand All @@ -1554,7 +1564,7 @@
* @returns {object}
*/
getItem: function(value) {
return this.$control.children('[data-value="' + escape_quotes(hash_key(value)) + '"]');
return this.getElementWithValue(value, this.$control.children());
},

/**
Expand Down
4 changes: 2 additions & 2 deletions dist/js/selectize.min.js

Large diffs are not rendered by default.

42 changes: 26 additions & 16 deletions dist/js/standalone/selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
}));

/**
* selectize.js (v0.7.6)
* selectize.js (v0.7.7)
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down Expand Up @@ -628,17 +628,6 @@
.replace(/"/g, '&quot;');
};

/**
* Escapes quotation marks with backslashes. Useful
* for escaping values for use in CSS attribute selectors.
*
* @param {string} str
* @return {string}
*/
var escape_quotes = function(str) {
return str.replace(/(['"])/g, '\\$1');
};

var hook = {};

/**
Expand Down Expand Up @@ -1900,7 +1889,7 @@
*/
addOptionGroup: function(id, data) {
this.optgroups[id] = data;
this.trigger('optgroup_add', value, data);
this.trigger('optgroup_add', id, data);
},

/**
Expand Down Expand Up @@ -1998,8 +1987,7 @@
* @returns {object}
*/
getOption: function(value) {
value = hash_key(value);
return value ? this.$dropdown_content.find('[data-selectable]').filter('[data-value="' + escape_quotes(value) + '"]:first') : $();
return this.getElementWithValue(value, this.$dropdown_content.find('[data-selectable]'));
},

/**
Expand All @@ -2017,6 +2005,28 @@
return index >= 0 && index < $options.length ? $options.eq(index) : $();
},

/**
* Finds the first element with a "data-value" attribute
* that matches the given value.
*
* @param {mixed} value
* @param {object} $els
* @return {object}
*/
getElementWithValue: function(value, $els) {
value = hash_key(value);

if (value) {
for (var i = 0, n = $els.length; i < n; i++) {
if ($els[i].getAttribute('data-value') === value) {
return $($els[i]);
}
}
}

return $();
},

/**
* Returns the jQuery element of the item
* matching the given value.
Expand All @@ -2025,7 +2035,7 @@
* @returns {object}
*/
getItem: function(value) {
return this.$control.children('[data-value="' + escape_quotes(hash_key(value)) + '"]');
return this.getElementWithValue(value, this.$control.children());
},

/**
Expand Down
6 changes: 3 additions & 3 deletions dist/js/standalone/selectize.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/less/selectize.bootstrap2.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap2.css (v0.7.6) - Bootstrap 2 Theme
* selectize.bootstrap2.css (v0.7.7) - Bootstrap 2 Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/less/selectize.bootstrap3.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.bootstrap3.css (v0.7.6) - Bootstrap 3 Theme
* selectize.bootstrap3.css (v0.7.7) - Bootstrap 3 Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/less/selectize.default.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.default.css (v0.7.6) - Default Theme
* selectize.default.css (v0.7.7) - Default Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion dist/less/selectize.legacy.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* selectize.legacy.css (v0.7.6) - Default Theme
* selectize.legacy.css (v0.7.7) - Default Theme
* Copyright (c) 2013 Brian Reavis & contributors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "selectize",
"keywords": ["select", "ui", "form", "input", "control", "autocomplete", "tagging", "tag"],
"description": "Selectize is a jQuery-based custom <select> UI control. Useful for tagging, contact lists, country selectors, etc.",
"version": "0.7.6",
"version": "0.7.7",
"author": "Brian Reavis <[email protected]>",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion selectize.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "selectize",
"version": "0.7.6",
"version": "0.7.7",
"title": "Selectize.js",
"author": {
"name": "Brian Reavis",
Expand Down

0 comments on commit 46d0b35

Please sign in to comment.