Skip to content

Commit 7fe6ea9

Browse files
author
Andrew Volozhanin
committed
Merge remote-tracking branch 'upstream/master'
* upstream/master: (69 commits) Released 0.11.0. Added "allowEmptyOption" option (selectize#163). Fixed broken bootstrap3 build. Fixing confusing description renamed the undefined plugins variable to selector_plugins Released 0.10.1. Bind createFilter callback to Selectize instance. Released 0.10.0. Calculate scrollbar width (fixes selectize#360). Fix for selectize#438 + tests. Added createFilter sample to contacts demo. Cherry picked commit 6e04d7b from selectize#370. Minor cleanup of selectize#405. Forgot self qualifier on Jquery cached data allocated by selectized is now cleaned up at destroy time Removing extra tabs selectized class should not have been added before the classes were checked and propegated to all of the controls created by selectize. It was previously added after this initialization and is now also added at the same time. Used method call to isFull to avoid duplicate code Consolidated the refreshState call to capture just becoming full during bulk (or any) addItem call Delaying updating attributes and caret during bulk insertion ... Conflicts: src/selectize.js
2 parents 2fb59bb + f293d8b commit 7fe6ea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1704
-1177
lines changed

Gruntfile.js

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ module.exports = function(grunt) {
66
grunt.loadNpmTasks('grunt-contrib-concat');
77
grunt.loadNpmTasks('grunt-contrib-clean');
88
grunt.loadNpmTasks('grunt-contrib-copy');
9+
grunt.loadNpmTasks('grunt-contrib-less');
910
grunt.loadNpmTasks('grunt-replace');
10-
grunt.loadNpmTasks('grunt-recess');
1111

1212
grunt.registerTask('configure', [
1313
'clean:pre',
@@ -20,10 +20,10 @@ module.exports = function(grunt) {
2020
'concat:less_theme_dependencies',
2121
'concat:less_plugins',
2222
'concat:js',
23-
'recess',
23+
'less:uncompressed',
2424
'clean_bootstrap2_css',
2525
'replace',
26-
'concat:js_standalone',
26+
'build_standalone',
2727
'uglify',
2828
'clean:post',
2929
]);
@@ -36,10 +36,33 @@ module.exports = function(grunt) {
3636
grunt.registerTask('clean_bootstrap2_css', 'Cleans CSS rules ocurring before the header comment.', function() {
3737
var file = 'dist/css/selectize.bootstrap2.css';
3838
var source = fs.readFileSync(file, 'utf8');
39-
fs.writeFileSync(file, source.replace(/^(.|\s)+?\/\*/m, '/*'), 'utf8');
39+
grunt.file.write(file, source.replace(/^(.|\s)+?\/\*/m, '/*'));
4040
grunt.log.writeln('Cleaned "' + file + '".');
4141
});
4242

43+
grunt.registerTask('build_standalone', '', function() {
44+
var files, i, n, source, name, path, modules = [];
45+
46+
// amd definitions must be changed to be not anonymous
47+
// @see https://github.com/brianreavis/selectize.js/issues/89
48+
files = [];
49+
for (i = 0, n = files_js_dependencies.length; i < n; i++) {
50+
path = files_js_dependencies[i];
51+
name = path.match(/([^\/]+?).js$/)[1];
52+
source = grunt.file.read(path).replace('define(factory);', 'define(\'' + name + '\', factory);');
53+
modules.push(source);
54+
}
55+
56+
path = 'dist/js/selectize.js';
57+
source = grunt.file.read(path).replace(/define\((.*?)factory\);/, 'define(\'selectize\', $1factory);');
58+
modules.push(source);
59+
60+
// write output
61+
path = 'dist/js/standalone/selectize.js';
62+
grunt.file.write(path, modules.join('\n\n'));
63+
grunt.log.writeln('Built "' + path + '".');
64+
});
65+
4366
var files_js = [
4467
'src/contrib/*.js',
4568
'src/*.js',
@@ -66,7 +89,7 @@ module.exports = function(grunt) {
6689
if (!selector_plugins) return;
6790

6891
if (selector_plugins.indexOf(',') !== -1) {
69-
selector_plugins = '{' + plugins.split(/\s*,\s*/).join(',') + '}';
92+
selector_plugins = '{' + selector_plugins.split(/\s*,\s*/).join(',') + '}';
7093
}
7194

7295
// javascript
@@ -131,10 +154,8 @@ module.exports = function(grunt) {
131154
]
132155
}
133156
},
134-
recess: {
135-
options: {
136-
compile: true
137-
},
157+
less: {
158+
options: {},
138159
uncompressed: {
139160
files: {
140161
'dist/css/selectize.css': ['dist/less/selectize.less'],
@@ -173,25 +194,10 @@ module.exports = function(grunt) {
173194
],
174195
'dist/less/selectize.bootstrap3.tmp.less': [
175196
'bower_components/bootstrap3/less/variables.less',
176-
'bower_components/bootstrap3/less/mixins.less',
197+
'bower_components/bootstrap3/less/mixins/nav-divider.less',
177198
'dist/less/selectize.bootstrap3.less'
178199
]
179200
}
180-
},
181-
js_standalone: {
182-
options: {
183-
stripBanners: false
184-
},
185-
files: {
186-
'dist/js/standalone/selectize.js': (function() {
187-
var files = [];
188-
for (var i = 0, n = files_js_dependencies.length; i < n; i++) {
189-
files.push(files_js_dependencies[i]);
190-
}
191-
files.push('dist/js/selectize.js');
192-
return files;
193-
})()
194-
}
195201
}
196202
},
197203
uglify: {

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
.PHONY: compile release test
22
plugins=*
3+
GRUNT=node_modules/.bin/grunt
4+
TESTEM=node_modules/.bin/testem
35

46
all: compile
57
test:
6-
testem
8+
$(TESTEM)
79
compile:
8-
grunt --plugins=$(plugins)
10+
$(GRUNT) --plugins=$(plugins)
911
release:
1012
ifeq ($(strip $(version)),)
1113
@echo "\033[31mERROR:\033[0;39m No version provided."

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Selectize is an extensible jQuery-based custom &lt;select&gt; UI control. It's u
2424

2525
### Dependencies
2626

27-
- [jquery](https://github.com/jquery/jquery)
27+
- [jquery](https://github.com/jquery/jquery) (1.7 and greater)
2828
- [sifter](https://github.com/brianreavis/sifter.js) (bundled in ["standalone" build](dist/js/standalone))
2929
- [microplugin](https://github.com/brianreavis/microplugin.js) (bundled in ["standalone" build](dist/js/standalone))
3030

@@ -45,6 +45,8 @@ All pre-built files needed to use Selectize can be found in the ["dist"](dist/)
4545
- [**css/**](dist/css)
4646
- [selectize.css](dist/css/selectize.css) — Core styles
4747
- [selectize.default.css](dist/css/selectize.default.css) — Default theme (with core styles)
48+
- [selectize.bootstrap2.css](dist/css/selectize.bootstrap2.css) - Bootstrap 2 theme
49+
- [selectize.bootstrap3.css](dist/css/selectize.bootstrap3.css) - Bootstrap 3 theme
4850

4951
### Usage
5052

@@ -68,7 +70,6 @@ By default, all [plugins](src/plugins) are included. To hand-pick what plugins (
6870

6971
```sh
7072
# dependencies
71-
npm install -g grunt-cli
7273
npm install -g bower
7374
npm install
7475

bower.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "selectize",
33
"keywords": ["select", "ui", "form", "input", "control", "autocomplete", "tagging", "tag"],
44
"description": "Selectize is a jQuery-based custom <select> UI control. Useful for tagging, contact lists, country selectors, etc.",
5-
"version": "0.8.2",
5+
"version": "0.11.0",
66
"license": "Apache License, Version 2.0",
77
"readmeFilename": "README.md",
88
"repository": {
@@ -25,15 +25,16 @@
2525
".travis.yml",
2626
"testem.json",
2727
"selectize.jquery.json",
28-
"*.sh"
28+
"*.sh",
29+
"package.json"
2930
],
3031
"dependencies": {
31-
"jquery": ">=0.6.0",
32+
"jquery": ">=1.7.0",
3233
"sifter": "0.3.x",
3334
"microplugin": "0.0.x"
3435
},
3536
"devDependencies": {
3637
"bootstrap2": "bootstrap#2",
37-
"bootstrap3": "bootstrap#3"
38+
"bootstrap3": "bootstrap#3.2"
3839
}
3940
}

0 commit comments

Comments
 (0)