Skip to content

Commit 97d9d02

Browse files
committed
Added selectize lib for creating taggable input field.
1 parent 0a33f49 commit 97d9d02

14 files changed

+5665
-5
lines changed

src/Properties/launchSettings.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
"profiles": {
33
"IIS Express": {
44
"commandName": "IISExpress",
5-
"launchBrowser": true,
65
"environmentVariables": {
7-
"ASPNET_ENV": "dev"
6+
"ASPNET_ENV": "prod"
87
}
98
}
109
}

src/Views/Home/Index.cshtml

+13
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,16 @@
33
}
44

55
<p>Create <code>.gitattributes</code> files for your project.</p>
6+
7+
<p>
8+
<input type="text" id="select">
9+
</p>
10+
11+
<script>
12+
$(document).ready(function() {
13+
$('#select').selectize({
14+
plugins: ['restore_on_backspace', 'remove_button'],
15+
delimiter: ','
16+
});
17+
})
18+
</script>

src/Views/Shared/_Layout.cshtml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<meta charset="utf-8">
88
<meta name="viewport" content="width=device-width, initial-scale=1.0">
99
<title>@AppSettings.Options.SiteTitle - @ViewBag.Title</title>
10+
<link rel="stylesheet" type="text/css" href="~/lib/selectize/css/selectize.css">
11+
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
12+
<script type="text/javascript" src="~/lib/selectize/js/selectize.js"></script>
13+
1014
<environment names="prod">
1115
@Html.ApplicationInsightsJavaScript(TelemetryConfiguration)
1216
</environment>

src/bower.json

+9
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,14 @@
22
"name": "gitattributes.io",
33
"private": true,
44
"dependencies": {
5+
"selectize": "0.12.1"
6+
},
7+
"overrides": {
8+
"selectize": {
9+
"main": [
10+
"./dist/css/*",
11+
"./dist/js/standalone/*"
12+
]
13+
}
514
}
615
}

src/gulpfile.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
var gulp = require("gulp"),
44
del = require("del"),
55
fs = require("fs");
6+
var bower = require("main-bower-files");
7+
var bowerNormalize = require("gulp-bower-normalize");
68

79
eval("var project = " + fs.readFileSync("./project.json"));
810

@@ -17,6 +19,10 @@ gulp.task("clean", function (cb) {
1719
});
1820

1921
gulp.task("copy", ["clean"], function () {
20-
return gulp.src('./data/gitattributes/*.gitattributes')
21-
.pipe(gulp.dest(paths.data));
22+
gulp.src('./data/gitattributes/*.gitattributes')
23+
.pipe(gulp.dest(paths.data));
24+
25+
return gulp.src(bower(), { base: paths.bower })
26+
.pipe(bowerNormalize())
27+
.pipe(gulp.dest(paths.lib));
2228
});

src/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"devDependencies": {
55
"del": "^1.1.1",
66
"gulp": "3.8.11",
7-
"rimraf": "^2.3.3"
7+
"rimraf": "^2.3.3",
8+
"gulp-bower-normalize": "^1.0.5",
9+
"main-bower-files": "^2.7.0"
810
}
911
}

src/wwwroot/_references.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/// <autosync enabled="true" />
22
/// <reference path="../gulpfile.js" />
3+
/// <reference path="lib/selectize/js/selectize.js" />

0 commit comments

Comments
 (0)