Skip to content

Commit e764efe

Browse files
committed
next version is 2.1.0
1 parent 8918ff0 commit e764efe

30 files changed

+851
-473
lines changed

Gruntfile.js

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var deepmerge = require('deepmerge');
2+
23
module.exports = function(grunt) {
34
grunt.util.linefeed = '\n';
45

@@ -17,8 +18,8 @@ module.exports = function(grunt) {
1718
grunt.config.set('lang_author', content.__author);
1819
var header = grunt.template.process('<%= langBanner %>');
1920

20-
loaded_modules.forEach(function(m) {
21-
var plugin_file = 'src/plugins/'+ m +'/i18n/'+ lang +'.json';
21+
loaded_plugins.forEach(function(p) {
22+
var plugin_file = 'src/plugins/'+ p +'/i18n/'+ lang +'.json';
2223

2324
if (grunt.file.exists(plugin_file)) {
2425
content = deepmerge(content, grunt.file.readJSON(plugin_file));
@@ -36,9 +37,9 @@ module.exports = function(grunt) {
3637
}
3738

3839

39-
var all_modules = {},
40+
var all_plugins = {},
4041
all_langs = {},
41-
loaded_modules = [],
42+
loaded_plugins = [],
4243
loaded_langs = [],
4344
js_core_files = [
4445
'src/main.js',
@@ -59,11 +60,11 @@ module.exports = function(grunt) {
5960

6061

6162
(function(){
62-
// list available modules and languages
63+
// list available plugins and languages
6364
grunt.file.expand('src/plugins/*/plugin.js')
6465
.forEach(function(f) {
6566
var n = f.split('/')[2];
66-
all_modules[n] = f;
67+
all_plugins[n] = f;
6768
});
6869

6970
grunt.file.expand('src/i18n/*.json')
@@ -72,23 +73,23 @@ module.exports = function(grunt) {
7273
all_langs[n] = f;
7374
});
7475

75-
// parse 'modules' parameter
76-
var arg_modules = grunt.option('modules');
77-
if (typeof arg_modules === 'string') {
78-
arg_modules.replace(/ /g, '').split(',').forEach(function(m) {
79-
if (all_modules[m]) {
80-
js_files_to_load.push(all_modules[m]);
81-
loaded_modules.push(m);
76+
// parse 'plugins' parameter
77+
var arg_plugins = grunt.option('plugins');
78+
if (typeof arg_plugins === 'string') {
79+
arg_plugins.replace(/ /g, '').split(',').forEach(function(p) {
80+
if (all_plugins[p]) {
81+
js_files_to_load.push(all_plugins[p]);
82+
loaded_plugins.push(p);
8283
}
8384
else {
84-
grunt.fail.warn('Module '+ m +' unknown');
85+
grunt.fail.warn('Plugin '+ p +' unknown');
8586
}
8687
});
8788
}
88-
else if (arg_modules === undefined) {
89-
for (var m in all_modules) {
90-
js_files_to_load.push(all_modules[m]);
91-
loaded_modules.push(m);
89+
else if (arg_plugins === undefined) {
90+
for (var p in all_plugins) {
91+
js_files_to_load.push(all_plugins[p]);
92+
loaded_plugins.push(p);
9293
}
9394
}
9495

@@ -135,7 +136,10 @@ module.exports = function(grunt) {
135136
// bump version
136137
bump: {
137138
options: {
138-
files: ['package.json', 'bower.json', 'composer.json']
139+
files: ['package.json', 'bower.json', 'composer.json'],
140+
createTag: false,
141+
commit: false,
142+
push: false
139143
}
140144
},
141145

@@ -166,7 +170,7 @@ module.exports = function(grunt) {
166170
}]
167171
},
168172
sass_plugins: {
169-
files: loaded_modules.map(function(name) {
173+
files: loaded_plugins.map(function(name) {
170174
return {
171175
src: 'src/plugins/'+ name +'/plugin.scss',
172176
dest: 'dist/scss/plugins/' + name + '.scss'
@@ -209,7 +213,7 @@ module.exports = function(grunt) {
209213
files: Object.keys(all_langs).map(function(name) {
210214
return {
211215
src: 'src/i18n/'+ name +'.json',
212-
dest: 'dist/i18n/' + name + '.js'
216+
dest: 'dist/i18n/query-builder.' + name + '.js'
213217
};
214218
}),
215219
options: {
@@ -258,8 +262,8 @@ module.exports = function(grunt) {
258262
wrapper: function() {
259263
var wrapper = grunt.file.read('src/.wrapper.js').replace(/\r\n/g, '\n').split(/@@js\n/);
260264

261-
if (loaded_modules.length) {
262-
wrapper[0] = '// Modules: ' + loaded_modules.join(', ') + '\n' + wrapper[0];
265+
if (loaded_plugins.length) {
266+
wrapper[0] = '// Plugins: ' + loaded_plugins.join(', ') + '\n' + wrapper[0];
263267
}
264268
if (loaded_langs.length) {
265269
wrapper[0] = '// Languages: ' + loaded_langs.join(', ') + '\n' + wrapper[0];
@@ -277,7 +281,7 @@ module.exports = function(grunt) {
277281
options: {
278282
separator: '',
279283
wrapper: function() {
280-
return ['', loaded_modules.reduce(function(wrapper, name) {
284+
return ['', loaded_plugins.reduce(function(wrapper, name) {
281285
if (grunt.file.exists('dist/scss/plugins/' + name + '.scss')) {
282286
wrapper+= '\n@import \'plugins/' + name + '\';';
283287
}
@@ -370,8 +374,8 @@ module.exports = function(grunt) {
370374

371375
scripts+= '\n';
372376

373-
for (var m in all_modules) {
374-
scripts+= '<script src="../' + all_modules[m] + '" data-cover></script>\n';
377+
for (var p in all_plugins) {
378+
scripts+= '<script src="../' + all_plugins[p] + '" data-cover></script>\n';
375379
}
376380

377381
return m1 + scripts + m2;
@@ -462,10 +466,10 @@ module.exports = function(grunt) {
462466
grunt.registerTask('list_modules', 'List QueryBuilder plugins and languages.', function() {
463467
grunt.log.writeln('\nAvailable QueryBuilder plugins:\n');
464468

465-
for (var m in all_modules) {
466-
grunt.log.write(m['cyan']);
469+
for (var p in all_plugins) {
470+
grunt.log.write(p['cyan']);
467471

468-
if (grunt.file.exists(all_modules[m].replace(/js$/, 'scss'))) {
472+
if (grunt.file.exists(all_plugins[p].replace(/js$/, 'scss'))) {
469473
grunt.log.write(' + CSS');
470474
}
471475

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,20 @@ Install Node and Bower dependencies `npm install & bower install` then run `grun
4343

4444
#### Options
4545

46-
You can choose which plugins to include with `--modules` :
46+
You can choose which plugins to include with `--plugins` :
4747
```bash
4848
# include "sql-support" plugin
49-
grunt --modules=sql-support
49+
grunt --plugins=sql-support
5050

51-
# disable all modules
52-
grunt --modules=false
51+
# disable all plugins
52+
grunt --plugins=false
5353
```
5454
All plugins are included by default.
5555

56-
You can also include ONE language with `--lang` :
56+
You can also include language files with `--languages` :
5757
```bash
58-
# include French translation
59-
grunt --lang=fr
58+
# include French & Italian translation
59+
grunt --languages=fr,it
6060
```
6161

6262
#### Other commands

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jQuery-QueryBuilder",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"authors": [{
55
"name": "Damien \"Mistic\" Sorel",
66
"email": "contact@git.strangeplanet.fr",

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mistic100/jquery-querybuilder",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"authors": [{
55
"name": "Damien \"Mistic\" Sorel",
66
"email": "contact@git.strangeplanet.fr",

dist/css/query-builder.dark.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery QueryBuilder 2.0.1
2+
* jQuery QueryBuilder 2.1.0
33
* Copyright 2014-2015 Damien "Mistic" Sorel (http://www.strangeplanet.fr)
44
* Licensed under MIT (http://opensource.org/licenses/MIT)
55
*/

dist/css/query-builder.dark.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/query-builder.default.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery QueryBuilder 2.0.1
2+
* jQuery QueryBuilder 2.1.0
33
* Copyright 2014-2015 Damien "Mistic" Sorel (http://www.strangeplanet.fr)
44
* Licensed under MIT (http://opensource.org/licenses/MIT)
55
*/

dist/css/query-builder.default.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/i18n/es.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

dist/i18n/da.js renamed to dist/i18n/query-builder.da.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
/*!
2-
* jQuery QueryBuilder 2.0.1
3-
* Oversat af Jna Borup Coyle, github@coyle.dk
2+
* jQuery QueryBuilder 2.1.0
3+
* Locale: Danish (da)
4+
* Author: Jna Borup Coyle, github@coyle.dk
45
* Licensed under MIT (http://opensource.org/licenses/MIT)
56
*/
67

7-
jQuery.fn.queryBuilder.defaults({ lang: {
8+
(function(root, factory) {
9+
if (typeof define === 'function' && define.amd) {
10+
define(['jquery', 'query-builder'], factory);
11+
}
12+
else {
13+
factory(root.jQuery);
14+
}
15+
}(this, function($) {
16+
"use strict";
17+
18+
var QueryBuilder = $.fn.queryBuilder;
19+
20+
QueryBuilder.regional['da'] = {
21+
"__locale": "Danish (da)",
22+
"__author": "Jna Borup Coyle, github@coyle.dk",
823
"add_rule": "Tilføj regel",
924
"add_group": "Tilføj gruppe",
1025
"delete_rule": "Slet regel",
@@ -35,4 +50,7 @@ jQuery.fn.queryBuilder.defaults({ lang: {
3550
"is_null": "er null",
3651
"is_not_null": "er ikke null"
3752
}
38-
}});
53+
};
54+
55+
QueryBuilder.defaults({ lang_code: 'da' });
56+
}));

0 commit comments

Comments
 (0)