Switch tagsinput to bower
This commit is contained in:
parent
6b034e951a
commit
0cc0b8cc72
6 changed files with 57 additions and 29 deletions
|
@ -1,8 +1,10 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
|
|
||||||
var bower = grunt.file.readJSON('bower.json');
|
var bower = grunt.file.readJSON('bower.json');
|
||||||
var components = [];
|
var components = [];
|
||||||
for (i in bower.concat.app) {
|
for (var i in bower.concat.app) {
|
||||||
components.push('components/' + bower.concat.app[i] + '/**/*.js');
|
components.push('components/' + bower.concat.app[i] + '/**/*.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
52
bower.json
52
bower.json
|
@ -11,24 +11,52 @@
|
||||||
"protobuf": "~3.8.0",
|
"protobuf": "~3.8.0",
|
||||||
"bootstrap": "~3.3.0",
|
"bootstrap": "~3.3.0",
|
||||||
"mustache": "~0.8.2",
|
"mustache": "~0.8.2",
|
||||||
"qrcode": "git://github.com/davidshimjs/qrcodejs.git"
|
"qrcode": "git://github.com/davidshimjs/qrcodejs.git",
|
||||||
|
"bootstrap-tagsinput": "~0.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "~2.0.1",
|
"mocha": "~2.0.1",
|
||||||
"chai": "~1.9.2"
|
"chai": "~1.9.2"
|
||||||
},
|
},
|
||||||
"preen": {
|
"preen": {
|
||||||
"jquery" : [ "dist/jquery.js" ],
|
"jquery": [
|
||||||
"long" : [ "dist/Long.js" ],
|
"dist/jquery.js"
|
||||||
"bytebuffer" : [ "dist/ByteBufferAB.js" ],
|
],
|
||||||
"protobuf" : [ "dist/ProtoBuf.js" ],
|
"long": [
|
||||||
"mustache" : [ "mustache.js" ],
|
"dist/Long.js"
|
||||||
"underscore" : [ "underscore.js" ],
|
],
|
||||||
"backbone" : [ "backbone.js" ],
|
"bytebuffer": [
|
||||||
"qrcode" : [ "qrcode.js" ],
|
"dist/ByteBufferAB.js"
|
||||||
"mocha" : [ "mocha.js", "mocha.css" ],
|
],
|
||||||
"chai" : [ "chai.js" ],
|
"protobuf": [
|
||||||
"bootstrap" : [ "dist/css/bootstrap.css" ]
|
"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": {
|
"concat": {
|
||||||
"app": [
|
"app": [
|
||||||
|
|
|
@ -29,12 +29,6 @@
|
||||||
.bootstrap-tagsinput .tag {
|
.bootstrap-tagsinput .tag {
|
||||||
margin-right: 2px;
|
margin-right: 2px;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #00badd;
|
|
||||||
padding: 2px 5px;
|
|
||||||
border-radius: 2px;
|
|
||||||
}
|
|
||||||
.bootstrap-tagsinput .tag.error {
|
|
||||||
background-color: #ccc;
|
|
||||||
}
|
}
|
||||||
.bootstrap-tagsinput .tag [data-role="remove"] {
|
.bootstrap-tagsinput .tag [data-role="remove"] {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
|
@ -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),
|
var itemValue = self.options.itemValue(item),
|
||||||
itemText = self.options.itemText(item),
|
itemText = self.options.itemText(item),
|
||||||
tagClass = self.options.tagClass(item);
|
tagClass = self.options.tagClass(item);
|
||||||
|
@ -122,6 +114,12 @@
|
||||||
if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
|
if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
|
||||||
return;
|
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
|
// register item in internal array and map
|
||||||
self.itemsArray.push(item);
|
self.itemsArray.push(item);
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
<link href='/favicon.ico' rel='shortcut icon'>
|
<link href='/favicon.ico' rel='shortcut icon'>
|
||||||
<link href="/stylesheets/normalize.css" rel="stylesheet" type="text/css" />
|
<link href="/stylesheets/normalize.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/stylesheets/manifest.css" rel="stylesheet" type="text/css" />
|
<link href="/stylesheets/manifest.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="/components/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/stylesheets/index.css" rel="stylesheet" type="text/css" />
|
<link href="/stylesheets/index.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="/stylesheets/bootstrap-tagsinput.css" rel="stylesheet" type="text/css" />
|
|
||||||
</head>
|
</head>
|
||||||
<body class='signal index' data-name="curve25519" data-tools="pnacl" data-configs="Debug Release" data-path="nacl/pnacl/{config}">
|
<body class='signal index' data-name="curve25519" data-tools="pnacl" data-configs="Debug Release" data-path="nacl/pnacl/{config}">
|
||||||
<div class='title-bar' id='header'>
|
<div class='title-bar' id='header'>
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
<script type="text/javascript" src="js/components.js"></script>
|
<script type="text/javascript" src="js/components.js"></script>
|
||||||
<script type="text/javascript" src="js-deps/backbone.localStorage.js"></script>
|
<script type="text/javascript" src="js-deps/backbone.localStorage.js"></script>
|
||||||
<script type="text/javascript" src="js-deps/libphonenumber_api-compiled.js"></script>
|
<script type="text/javascript" src="js-deps/libphonenumber_api-compiled.js"></script>
|
||||||
<script type="text/javascript" src="js-deps/bootstrap-tagsinput.js"></script>
|
<script type="text/javascript" src="components/bootstrap-tagsinput/dist/bootstrap-tagsinput.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="js/protobufs.js"></script>
|
<script type="text/javascript" src="js/protobufs.js"></script>
|
||||||
<script type="text/javascript" src="js/helpers.js"></script>
|
<script type="text/javascript" src="js/helpers.js"></script>
|
||||||
|
|
|
@ -70,3 +70,9 @@ li.entry img {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bootstrap-tagsinput .tag {
|
||||||
|
background-color: #00badd;
|
||||||
|
padding: 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue