diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 00000000..13e74517 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,76 @@ +module.exports = function(grunt) { + var lang = grunt.option('lang') || 'en'; + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + banner: + '/*!\n'+ + ' * jQuery QueryBuilder <%= pkg.version %>\n'+ + ' * Copyright <%= grunt.template.today("yyyy") %> Damien "Mistic" Sorel (http://www.strangeplanet.fr)\n'+ + ' * Licensed under MIT (http://opensource.org/licenses/MIT)\n'+ + ' */', + + // compress js + uglify: { + options: { + banner: '<%= banner %>\n' + }, + nolang: { + files: { + 'dist/query-builder.min.js': ['src/query-builder.js'] + } + }, + lang: { + files: { + 'dist/query-builder.min.js': [ + 'src/query-builder.js', + 'src/i18n/'+ lang +'.js' + ] + } + } + }, + + // copy i18n + copy: { + i18n: { + files: [{ + expand: true, + flatten: true, + src: ['src/i18n/*.js'], + dest: 'dist/i18n' + }] + } + }, + + // compress css + cssmin: { + options: { + banner: '<%= banner %>', + keepSpecialComments: 0 + }, + dist: { + files: { + 'dist/query-builder.min.css': [ + 'src/query-builder.css' + ] + } + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + + grunt.registerTask('default', [ + 'uglify:nolang', + 'copy', + 'cssmin' + ]); + + grunt.registerTask('onelang', [ + 'uglify:lang', + 'cssmin' + ]); +}; \ No newline at end of file diff --git a/bower.json b/bower.json index d895008a..4e2fe3c6 100644 --- a/bower.json +++ b/bower.json @@ -7,11 +7,13 @@ }], "description": "jQuery plugin for user friendly query/filter creator", "main": [ - "./query-builder.js", - "./query-builder.css" + "dist/query-builder.min.js", + "dist/query-builder.min.css" ], "dependencies" : { - "bootstrap": "3.x.x" + "jquery": ">= 1.9.0", + "bootstrap": "3.x.x", + "momentjs": "2.x.x" }, "keywords": [ "jquery", diff --git a/i18n/en.js b/dist/i18n/en.js similarity index 100% rename from i18n/en.js rename to dist/i18n/en.js diff --git a/i18n/fr.js b/dist/i18n/fr.js similarity index 100% rename from i18n/fr.js rename to dist/i18n/fr.js diff --git a/i18n/ro.js b/dist/i18n/ro.js similarity index 100% rename from i18n/ro.js rename to dist/i18n/ro.js diff --git a/dist/query-builder.min.css b/dist/query-builder.min.css new file mode 100644 index 00000000..6a46361b --- /dev/null +++ b/dist/query-builder.min.css @@ -0,0 +1,6 @@ +/*! + * jQuery QueryBuilder 1.0.0 + * Copyright 2014 Damien "Mistic" Sorel (http://www.strangeplanet.fr) + * Licensed under MIT (http://opensource.org/licenses/MIT) + */ +.rule-container,.rule-placeholder,.rules-group-container{margin:4px 0;border-radius:5px;padding:5px;border:1px solid #eee;background:#fff;background:rgba(255,255,255,.9)}.rules-group-container{padding:10px 10px 5px;border:1px solid #DCC896;background:#FCF9ED;background:rgba(250,240,210,.5)}.rules-group-header{margin-bottom:10px}.rules-group-header input[name$=_cond]{display:none}.rules-list{list-style:none;padding:0 0 0 20px;margin:0}.rule-container.has-error{background:#fdd;border-color:#f99}.rule-container>div:not(.rule-header){display:inline-block;margin:0 5px 0 0;vertical-align:top}.rule-value-container:not(:empty){border-left:1px solid #ddd;padding-left:5px}.rule-value-container label{margin-bottom:0}.rule-value-container label.block{display:block}.rule-container input[type=number],.rule-container input[type=text],.rule-container select{padding:1px}.rules-list>*{position:relative}.rules-list>:after,.rules-list>:before{content:'';position:absolute;left:-15px;width:15px;height:calc(50% + 4px);border-color:#ccc;border-style:solid}.rules-list>:before{top:-2px;border-width:0 0 2px 2px}.rules-list>:after{top:50%;border-width:0 0 0 2px}.rules-list>:first-child:before{top:-12px;height:calc(50% + 14px)}.rules-list>:last-child:before{border-radius:0 0 0 4px}.rules-list>:last-child:after{display:none}.rule-container .drag-handle,.rules-group-container .drag-handle{cursor:move;display:inline-block}.rule-container .dragged,.rules-group-container .dragged{opacity:.5}.rule-placeholder{border:1px dashed #bbb;opacity:.7}.query-builder>.rules-group-container>.rules-group-header .drag-handle,.query-builder>.rules-group-container>.rules-group-header [data-delete]{display:none} \ No newline at end of file diff --git a/dist/query-builder.min.js b/dist/query-builder.min.js new file mode 100644 index 00000000..14b5da37 --- /dev/null +++ b/dist/query-builder.min.js @@ -0,0 +1,6 @@ +/*! + * jQuery QueryBuilder 1.0.0 + * Copyright 2014 Damien "Mistic" Sorel (http://www.strangeplanet.fr) + * Licensed under MIT (http://opensource.org/licenses/MIT) + */ +!function(a){"use strict";var b=["string","integer","double","date","time","datetime"],c=["text","radio","checkbox","select"],d=function(b,c){var e=this;this.$el=b,this.settings=a.extend(!0,{},d.DEFAULTS,c),this.filters=this.settings.filters,this.lang=this.settings.lang,this.operators=this.settings.operators,this.status={group_id:0,rule_id:0,generatedId:!1},this.$el.attr("id")||(this.$el.attr("id","qb_"+Math.floor(99999*Math.random())),this.status.generatedId=!0),this.$el_id=this.$el.attr("id"),(!this.filters||this.filters.length<1)&&a.error("Missing filters list"),this.checkFilters(),this.$el.on("change.queryBuilder",".rules-group-header input[name$=_cond]",function(){var b=a(this);b.is(":checked")&&(b.parent().addClass("active"),b.parent().siblings().removeClass("active"))}),this.$el.on("change.queryBuilder",".rule-filter-container select[name$=_filter]",function(){var b=a(this),c=b.closest("li");e.createRuleOperators(c,b.val()),e.createRuleInput(c,b.val())}),this.$el.on("change.queryBuilder",".rule-operator-container select[name$=_operator]",function(){var b=a(this),c=b.closest("li");e.updateRuleOperator(c,b.val())}),this.$el.on("click.queryBuilder","[data-add=rule]",function(){var b=a(this),c=b.closest("dl").find(">dd>ul");e.addRule(c)}),this.$el.on("click.queryBuilder","[data-add=group]",function(){var b=a(this),c=b.closest("dl").find(">dd>ul");e.addGroup(c)}),this.$el.on("click.queryBuilder","[data-delete=rule]",function(){var b=a(this),c=b.closest("li");c.remove()}),this.$el.on("click.queryBuilder","[data-delete=group]",function(){var b=a(this),c=b.closest("dl");c.remove()}),this.settings.sortable&&this.initSortable(),this.$el.addClass("query-builder"),this.addGroup(this.$el)};d.DEFAULTS={onValidationError:null,onAfterAddGroup:null,onAfterAddRule:null,sortable:!1,filters:[],lang:{add_rule:"Add rule",add_group:"Add group",delete_rule:"Delete",delete_group:"Delete",and_condition:"AND",or_condition:"OR",filter_select_placeholder:"------",operator_equal:"equal",operator_not_equal:"not equal",operator_in:"in",operator_not_in:"not in",operator_less:"less",operator_less_or_equal:"less or equal",operator_greater:"greater",operator_greater_or_equal:"greater or equal",operator_begins_with:"begins with",operator_not_begins_with:"doesn't begin with",operator_contains:"contains",operator_not_contains:"doesn't contain",operator_ends_with:"ends with",operator_not_ends_with:"doesn't end with",operator_is_empty:"is empty",operator_is_not_empty:"is not empty",operator_is_null:"is null",operator_is_not_null:"is not null"},operators:[{type:"equal",accept_values:!0,apply_to:["string","number","datetime"]},{type:"not_equal",accept_values:!0,apply_to:["string","number","datetime"]},{type:"in",accept_values:!0,apply_to:["string","number","datetime"]},{type:"not_in",accept_values:!0,apply_to:["string","number","datetime"]},{type:"less",accept_values:!0,apply_to:["number","datetime"]},{type:"less_or_equal",accept_values:!0,apply_to:["number","datetime"]},{type:"greater",accept_values:!0,apply_to:["number","datetime"]},{type:"greater_or_equal",accept_values:!0,apply_to:["number","datetime"]},{type:"begins_with",accept_values:!0,apply_to:["string"]},{type:"not_begins_with",accept_values:!0,apply_to:["string"]},{type:"contains",accept_values:!0,apply_to:["string"]},{type:"not_contains",accept_values:!0,apply_to:["string"]},{type:"ends_with",accept_values:!0,apply_to:["string"]},{type:"not_ends_with",accept_values:!0,apply_to:["string"]},{type:"is_empty",accept_values:!1,apply_to:["string"]},{type:"is_not_empty",accept_values:!1,apply_to:["string"]},{type:"is_null",accept_values:!1,apply_to:["string","number","datetime"]},{type:"is_not_null",accept_values:!1,apply_to:["string","number","datetime"]}]},window.QueryBuilder={setDefaults:function(b){a.extend(!0,d.DEFAULTS,b)}},d.prototype.destroy=function(){this.status.generatedId&&this.$el.removeAttr("id"),this.$el.empty().off("click.queryBuilder change.queryBuilder").removeClass("query-builder").removeData("queryBuilder")},d.prototype.reset=function(){this.status.group_id=1,this.status.rule_id=0,this.addRule(this.$el.find(">dl>dd>ul").empty())},d.prototype.clear=function(){this.status.group_id=0,this.status.rule_id=0,this.$el.empty()},d.prototype.getRules=function(){this.markRuleAsError(this.$el.find("li"),!1);var b=this.$el.find(">dl"),c=this;return function d(b){var e={},f=b.find(">dd>ul>*");e.condition=b.find(">dt input[name$=_cond]:checked").val(),e.rules=[];for(var g=0,h=f.length;h>g;g++){var i=f.eq(g);if(i.hasClass("rule-container")){var j=c.getRuleFilter(i);if("-1"==j)continue;var k=c.getFilterById(j),l=c.getOperator(c.getRuleOperator(i)),m=null;if(l.accept_values){m=c.getRuleValue(i,k);var n=c.validateValue(m,k);if(n!==!0)return c.markRuleAsError(i,!0),c.triggerValidationError(n,k,l,m,i),{};k.valueParser&&(m=k.valueParser.call(this,m,k,l))}var o={id:k.id,field:k.field,type:k.type,input:k.input,operator:l.type,value:m};e.rules.push(o)}else{var o=d(i);if(a.isEmptyObject(o))return{};e.rules.push(o)}}return 0==e.rules.length?{}:e}(b)},d.prototype.setRules=function(b){this.clear();var c=this.$el,d=this;!function e(b,c){var f=d.addGroup(c,!1),g=f.find(">dd>ul"),h=f.find(">dt input[name$=_cond]");b.condition||(b.condition="AND"),h.filter("[value=AND]").prop("checked","AND"==b.condition.toUpperCase()),h.filter("[value=OR]").prop("checked","OR"==b.condition.toUpperCase()),h.trigger("change"),a.each(b.rules,function(b,c){if(c.rules&&c.rules.length>0)e(c,g);else{c.id||a.error("Missing rule field id"),c.value||(c.value=""),c.operator||(c.operator="equal");var f=d.addRule(g),h=d.getFilterById(c.id),i=f.find(".rule-value-container");switch(f.find(".rule-filter-container select[name$=_filter]").val(c.id).trigger("change"),f.find(".rule-operator-container select[name$=_operator]").val(c.operator).trigger("change"),h.input){case"radio":i.find('input[name$=_value][value="'+c.value+'"]').prop("checked",!0).trigger("change");break;case"checkbox":a.isArray(c.value)||(c.value=[c.value]),a.each(c.value,function(a,b){i.find('input[name$=_value][value="'+b+'"]').prop("checked",!0).trigger("change")});break;case"select":i.find("select[name$=_value]").val(c.value).trigger("change");break;case"text":default:i.find("input[name$=_value]").val(c.value).trigger("change")}h.onAfterSetValue&&h.onAfterSetValue.call(this,f,c.value,h,c.operator)}})}(b,c)},d.prototype.checkFilters=function(){var d=[];a.each(this.filters,function(e,f){switch(f.id||a.error("Missing filter id: "+e),-1!=d.indexOf(f.id)&&a.error("Filter already defined: "+f.id),d.push(f.id),f.type||a.error("Missing filter type: "+f.id),-1==b.indexOf(f.type)&&a.error("Invalid type: "+f.type),f.input?-1==c.indexOf(f.input)&&a.error("Invalid input: "+f.input):f.input="text",f.field||(f.field=f.id),f.label||(f.label=f.field),f.type){case"string":f.internalType="string";break;case"integer":case"double":f.internalType="number";break;case"date":case"time":case"datetime":f.internalType="datetime"}switch(f.input){case"radio":case"checkbox":(!f.values||f.values.length<1)&&a.error("Missing values for filter: "+f.id)}})},d.prototype.addGroup=function(a,b){b=null==b?!0:b;var c=this.nextGroupId();a.append(this.getGroupTemplate(c));var d=a.find("#"+c);return this.settings.onAfterAddGroup&&this.settings.onAfterAddGroup.call(this,d),b&&this.addRule(d.find(">dd>ul")),d},d.prototype.addRule=function(a){var b=this.nextRuleId();a.append(this.getRuleTemplate(b));var c=a.find("#"+b);return this.settings.onAfterAddRule&&this.settings.onAfterAddRule.call(this,c),c},d.prototype.createRuleOperators=function(a,b){var c=(a.find(".rule-operator-container").empty(),a.attr("id"));if("-1"!=b){var d=this.getOperators(b),e=this.getRuleOperatorSelect(c,d);a.find(".rule-operator-container").html(e)}},d.prototype.createRuleInput=function(a,b){if("-1"!=b){var c=a.find(".rule-value-container").empty(),d=a.attr("id"),e=this.getOperator(this.getRuleOperator(a));if(e.accept_values){var f=this.getFilterById(b),g=this.getRuleInput(d,f);c.html(g).show(),f.onAfterCreateRuleInput&&f.onAfterCreateRuleInput.call(this,a,f),f.plugin&&c.find("select"==f.input?"select":"input")[f.plugin](f.plugin_config||{})}}},d.prototype.updateRuleOperator=function(a,b){var c=a.find(".rule-value-container"),d=this.getFilterById(this.getRuleFilter(a)),e=this.getOperator(b);e.accept_values?(c.show(),c.is(":empty")&&this.createRuleInput(a,this.getRulefilter(a))):c.hide(),d.onAfterChangeOperator&&d.onAfterChangeOperator.call(this,a,d,e.type)},d.prototype.validateValue=function(a,b){var c=b.validation||{};if(c.callback)return c.callback.call(this,a,b);switch(b.input){case"radio":if(void 0==a)return"radio_empty";break;case"checkbox":if(0==a.length)return"checkbox_empty";break;case"select":if(b.multiple){if(0==a.length)return"select_empty"}else if(void 0==a)return"select_empty";break;case"text":default:switch(b.internalType){case"string":if(void 0!=c.min){if(a.lengthc.max)return"string_exceed_max_length";if(c.format&&!c.format.test(a))return"string_invalid_format";break;case"number":if(isNaN(a))return"number_nan";if("integer"==b.type){if(parseInt(a)!=a)return"number_not_integer"}else if(parseFloat(a)!=a)return"number_not_double";if(void 0!=c.min&&ac.max)return"number_exceed_max";if(c.step){var d=a/c.step;if(parseInt(d)!=d)return"number_wrong_step"}break;case"datetime":if(window.moment&&c.format){var e=moment(a,c.format);if(!e.isValid())return"datetime_invalid";if(c.min&&emoment(c.max,c.format))return"datetime_exceed_max"}}}return!0},d.prototype.markRuleAsError=function(a,b){b?a.addClass("has-error"):a.removeClass("has-error")},d.prototype.triggerValidationError=function(a,b,c,d,e){b.onValidationError&&b.onValidationError.call(this,e,a,d,b,c),this.settings.onValidationError&&this.settings.onValidationError.call(this,e,a,d,b,c);var f=jQuery.Event("validationError.queryBuilder",{error:a,filter:b,operator:c,value:d,targetRule:e[0],builder:this});this.$el.trigger(f)},d.prototype.initSortable=function(){a.event.props.push("dataTransfer");var b,c=!1;this.$el.on("mousedown",".drag-handle",function(){c=!0}),this.$el.on("mouseup",".drag-handle",function(){c=!1}),this.$el.on("dragstart","[draggable]",function(d){d.stopPropagation(),c?(d.dataTransfer.setData("id",d.target.id),b=a('
 
'),b.height(a(d.target).height()),b.insertAfter(d.target),a(d.target).hide(),c=!1):d.preventDefault()}),this.$el.on("dragenter","[draggable]",function(c){c.stopPropagation();var d,e=a(c.target);return d=e.closest(".rule-container"),d.length?void b.detach().insertAfter(d):(d=e.closest(".rules-group-container"),d.length?void b.detach().appendTo(d.find(".rules-list").eq(0)):void 0)}),this.$el.on("dragover","[draggable]",function(a){a.preventDefault(),a.stopPropagation()}),this.$el.on("drop",function(b){b.stopPropagation();var c,d=a("#"+b.dataTransfer.getData("id")),e=a(b.target);return c=e.closest(".rule-container"),c.length?void d.detach().insertAfter(c):(c=e.closest(".rules-group-container"),c.length?void d.detach().appendTo(c.find(".rules-list").eq(0)):void 0)}),this.$el.on("dragend","[draggable]",function(c){c.stopPropagation();var d=a("#"+c.dataTransfer.getData("id"));d.show(),b.remove()})},d.prototype.nextGroupId=function(){var a=this.$el_id+"_group_"+this.status.group_id;return this.status.group_id++,a},d.prototype.nextRuleId=function(){var a=this.$el_id+"_rule_"+this.status.rule_id;return this.status.rule_id++,a},d.prototype.getOperators=function(a){"string"==typeof a&&(a=this.getFilterById(a));for(var b=[],c=0,d=this.operators.length;d>c;c++)-1!=this.operators[c].apply_to.indexOf(a.internalType)&&(a.operators&&-1==a.operators.indexOf(this.operators[c].type)||b.push({type:this.operators[c].type,label:this.lang["operator_"+this.operators[c].type]}));return b},d.prototype.getFilterById=function(a){for(var b=0,c=this.filters.length;c>b;b++)if(this.filters[b].id==a)return this.filters[b];throw"Undefined filter: "+a},d.prototype.getOperator=function(a){for(var b=0,c=this.operators.length;c>b;b++)if(this.operators[b].type==a)return this.operators[b];throw"Undefined operator: "+a},d.prototype.getRuleFilter=function(a){return a.find(".rule-filter-container select[name$=_filter]").val()},d.prototype.getRuleOperator=function(a){return a.find(".rule-operator-container select[name$=_operator]").val()},d.prototype.getRuleValue=function(b,c){c=c||this.getFilterByType(this.getRulefilter(b));var d,e=b.find(".rule-value-container");switch(c.input){case"radio":d=e.find("input[name$=_value]:checked").val();break;case"checkbox":d=[],e.find("input[name$=_value]:checked").each(function(){d.push(a(this).val())});break;case"select":c.multiple?(d=[],e.find("select[name$=_value] option:selected").each(function(){d.push(a(this).val())})):d=e.find("select[name$=_value] option:selected").val();break;case"text":default:d=e.find("input[name$=_value]").val()}return d},d.prototype.getGroupTemplate=function(a){return"
"+(this.settings.sortable?'
':"")+"
    "},d.prototype.getRuleTemplate=function(a){return"
  • "+(this.settings.sortable?'
    ':"")+'
    '+this.getRuleFilterSelect(a)+'
  • '},d.prototype.getRuleFilterSelect=function(b){var c='"},d.prototype.getRuleOperatorSelect=function(a,b){for(var c='"},d.prototype.getRuleInput=function(b,c){var d=c.validation||{},e="";switch(c.input){case"radio":var f=c.vertical?" class=block":"";a.each(c.values,function(a,c){e+=" '+c+" "});break;case"checkbox":var f=c.vertical?" class=block":"";a.each(c.values,function(a,c){e+=" '+c+" "});break;case"select":e+='";break;case"text":default:switch(c.internalType){case"number":e+='1&&a.error("Unable to initialize on multiple target");var c=this.data("queryBuilder"),e="object"==typeof b&&b||{};return c||"destroy"!=b?(c||this.data("queryBuilder",new d(this,e)),"string"==typeof b?c[b].apply(c,Array.prototype.slice.call(arguments,1)):this):this}}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index ab2f6697..69f09019 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,14 @@ }, "description": "jQuery plugin for user friendly query/filter creator", "main": [ - "./query-builder.js", - "./query-builder.css" + "dist/query-builder.min.js", + "dist/query-builder.min.css" ], - "dependencies" : { - "bootstrap": "3.x.x" + "devDependencies": { + "grunt": "~0.4.5", + "grunt-contrib-uglify": "~0.4.0", + "grunt-contrib-cssmin": "~0.9.0", + "grunt-contrib-copy": "~0.5.0" }, "keywords": [ "jquery", diff --git a/src/i18n/en.js b/src/i18n/en.js new file mode 100644 index 00000000..eb151803 --- /dev/null +++ b/src/i18n/en.js @@ -0,0 +1,30 @@ +QueryBuilder.setDefaults({ lang: { + "add_rule": "Add rule", + "add_group": "Add group", + "delete_rule": "Delete", + "delete_group": "Delete", + + "and_condition": "AND", + "or_condition": "OR", + + "filter_select_placeholder": "------", + + "operator_equal": "equal", + "operator_not_equal": "not equal", + "operator_in": "in", + "operator_not_in": "not in", + "operator_less": "less", + "operator_less_or_equal": "less or equal", + "operator_greater": "greater", + "operator_greater_or_equal": "greater or equal", + "operator_begins_with": "begins with", + "operator_not_begins_with": "doesn't begin with", + "operator_contains": "contains", + "operator_not_contains": "doesn't contain", + "operator_ends_with": "ends with", + "operator_not_ends_with": "doesn't end with", + "operator_is_empty": "is empty", + "operator_is_not_empty": "is not empty", + "operator_is_null": "is null", + "operator_is_not_null": "is not null" +}}); \ No newline at end of file diff --git a/src/i18n/fr.js b/src/i18n/fr.js new file mode 100644 index 00000000..4255913f --- /dev/null +++ b/src/i18n/fr.js @@ -0,0 +1,30 @@ +QueryBuilder.setDefaults({ lang: { + "add_rule": "Ajouter une règle", + "add_group": "Ajouter un groupe", + "delete_rule": "Supprimer", + "delete_group": "Supprimer", + + "and_condition": "ET", + "or_condition": "OU", + + "filter_select_placeholder": "------", + + "operator_equal": "égal", + "operator_not_equal": "non égal", + "operator_in": "dans", + "operator_not_in": "pas dans", + "operator_less": "inférieur", + "operator_less_or_equal": "inférieur ou égal", + "operator_greater": "supérieur", + "operator_greater_or_equal": "supérieur ou égal", + "operator_begins_with": "commence par", + "operator_not_begins_with": "ne commence pas par", + "operator_contains": "contient", + "operator_not_contains": "ne contient pas", + "operator_ends_with": "finit par", + "operator_not_ends_with": "ne finit pas par", + "operator_is_empty": "est vide", + "operator_is_not_empty": "n'est pas vide", + "operator_is_null": "est nul", + "operator_is_not_null": "n'est pas nul" +}}); \ No newline at end of file diff --git a/src/i18n/ro.js b/src/i18n/ro.js new file mode 100644 index 00000000..1120bc31 --- /dev/null +++ b/src/i18n/ro.js @@ -0,0 +1,30 @@ +QueryBuilder.setDefaults({ lang: { + "add_rule": "Adaugă regulă", + "add_group": "Adaugă grup", + "delete_rule": "Şterge", + "delete_group": "Şterge", + + "and_condition": "ŞI", + "or_condition": "SAU", + + "filter_select_placeholder": "------", + + "operator_equal": "egal", + "operator_not_equal": "diferit", + "operator_in": "în", + "operator_not_in": "nu în", + "operator_less": "mai puţin", + "operator_less_or_equal": "mai puţin sau egal", + "operator_greater": "mai mare", + "operator_greater_or_equal": "mai mare sau egal", + "operator_begins_with": "începe cu", + "operator_not_begins_with": "nu începe cu", + "operator_contains": "conţine", + "operator_not_contains": "nu conţine", + "operator_ends_with": "se termină cu", + "operator_not_ends_with": "nu se termină cu", + "operator_is_empty": "este gol", + "operator_is_not_empty": "nu este gol", + "operator_is_null": "e nul", + "operator_is_not_null": "nu e nul" +}}); \ No newline at end of file diff --git a/query-builder.css b/src/query-builder.css similarity index 98% rename from query-builder.css rename to src/query-builder.css index dea13e39..9b7d696e 100644 --- a/query-builder.css +++ b/src/query-builder.css @@ -1,5 +1,5 @@ /*! - * QueryBuilder v1.0.0-SNAPSHOT + * jQuery QueryBuilder * Copyright 2014 Damien "Mistic" Sorel (http://www.strangeplanet.fr) * Licensed under MIT (http://opensource.org/licenses/MIT) */ diff --git a/query-builder.js b/src/query-builder.js similarity index 99% rename from query-builder.js rename to src/query-builder.js index 2585bec2..a7e8ad52 100644 --- a/query-builder.js +++ b/src/query-builder.js @@ -1,5 +1,5 @@ /*! - * QueryBuilder v1.0.0-SNAPSHOT + * jQuery QueryBuilder * Copyright 2014 Damien "Mistic" Sorel (http://www.strangeplanet.fr) * Licensed under MIT (http://opensource.org/licenses/MIT) */ diff --git a/tests/index.html b/tests/index.html index d4762be9..82e1d990 100644 --- a/tests/index.html +++ b/tests/index.html @@ -4,7 +4,7 @@ - + @@ -27,7 +27,7 @@

    Output

    - +