diff --git a/Gruntfile.js b/Gruntfile.js index 1493cb1a..fce2d4c2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,8 +1,10 @@ +'use strict'; + module.exports = function(grunt) { var bower = grunt.file.readJSON('bower.json'); var components = []; - for (i in bower.concat.app) { + for (var i in bower.concat.app) { components.push('components/' + bower.concat.app[i] + '/**/*.js'); } diff --git a/bower.json b/bower.json index 7d11cd87..de74b23b 100644 --- a/bower.json +++ b/bower.json @@ -11,24 +11,52 @@ "protobuf": "~3.8.0", "bootstrap": "~3.3.0", "mustache": "~0.8.2", - "qrcode": "git://github.com/davidshimjs/qrcodejs.git" + "qrcode": "git://github.com/davidshimjs/qrcodejs.git", + "bootstrap-tagsinput": "~0.4.2" }, "devDependencies": { "mocha": "~2.0.1", "chai": "~1.9.2" }, "preen": { - "jquery" : [ "dist/jquery.js" ], - "long" : [ "dist/Long.js" ], - "bytebuffer" : [ "dist/ByteBufferAB.js" ], - "protobuf" : [ "dist/ProtoBuf.js" ], - "mustache" : [ "mustache.js" ], - "underscore" : [ "underscore.js" ], - "backbone" : [ "backbone.js" ], - "qrcode" : [ "qrcode.js" ], - "mocha" : [ "mocha.js", "mocha.css" ], - "chai" : [ "chai.js" ], - "bootstrap" : [ "dist/css/bootstrap.css" ] + "jquery": [ + "dist/jquery.js" + ], + "long": [ + "dist/Long.js" + ], + "bytebuffer": [ + "dist/ByteBufferAB.js" + ], + "protobuf": [ + "dist/ProtoBuf.js" + ], + "mustache": [ + "mustache.js" + ], + "underscore": [ + "underscore.js" + ], + "backbone": [ + "backbone.js" + ], + "qrcode": [ + "qrcode.js" + ], + "mocha": [ + "mocha.js", + "mocha.css" + ], + "chai": [ + "chai.js" + ], + "bootstrap": [ + "dist/css/bootstrap.css" + ], + "bootstrap-tagsinput": [ + "dist/bootstrap-tagsinput.js", + "dist/bootstrap-tagsinput.css" + ] }, "concat": { "app": [ diff --git a/stylesheets/bootstrap-tagsinput.css b/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css similarity index 89% rename from stylesheets/bootstrap-tagsinput.css rename to components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css index 05f19a1f..55f7c09d 100644 --- a/stylesheets/bootstrap-tagsinput.css +++ b/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css @@ -29,12 +29,6 @@ .bootstrap-tagsinput .tag { margin-right: 2px; color: white; - background-color: #00badd; - padding: 2px 5px; - border-radius: 2px; -} -.bootstrap-tagsinput .tag.error { - background-color: #ccc; } .bootstrap-tagsinput .tag [data-role="remove"] { margin-left: 8px; diff --git a/js-deps/bootstrap-tagsinput.js b/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js similarity index 99% rename from js-deps/bootstrap-tagsinput.js rename to components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js index 7199a46e..515ac37f 100644 --- a/js-deps/bootstrap-tagsinput.js +++ b/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js @@ -95,14 +95,6 @@ } } - // raise beforeItemAdd arg - var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false }); - self.$element.trigger(beforeItemAddEvent); - if (beforeItemAddEvent.cancel) - return; - - item = beforeItemAddEvent.item - var itemValue = self.options.itemValue(item), itemText = self.options.itemText(item), tagClass = self.options.tagClass(item); @@ -122,6 +114,12 @@ if (self.items().toString().length + item.length + 1 > self.options.maxInputLength) return; + // raise beforeItemAdd arg + var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false }); + self.$element.trigger(beforeItemAddEvent); + if (beforeItemAddEvent.cancel) + return; + // register item in internal array and map self.itemsArray.push(item); diff --git a/index.html b/index.html index ceb214cb..d3778270 100644 --- a/index.html +++ b/index.html @@ -12,8 +12,8 @@ + -