Skip to content

Commit 036364c

Browse files
author
Ben TORFS
committed
Initial import of existing files
1 parent af0db01 commit 036364c

18 files changed

+1113
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Specific to this project
2+
test/e2e/screenshots
3+
4+
5+
# Numerous always-ignore extensions
6+
*.diff
7+
*.err
8+
*.orig
9+
*.log
10+
*.rej
11+
*.swo
12+
*.swp
13+
*.zip
14+
*.vi
15+
*~
16+
17+
# OS or Editor folders
18+
.DS_Store
19+
._*
20+
Thumbs.db
21+
.cache
22+
.project
23+
.settings
24+
.tmproj
25+
*.esproj
26+
nbproject
27+
*.sublime-project
28+
*.sublime-workspace
29+
.idea
30+
31+
# Folders to ignore
32+
node_modules
33+
bower_components

.jscsrc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"requireCurlyBraces": [
3+
"if",
4+
"else",
5+
"for",
6+
"while",
7+
"do",
8+
"try",
9+
"catch"
10+
],
11+
"requireOperatorBeforeLineBreak": true,
12+
"validateIndentation": 4,
13+
"validateQuoteMarks": "'",
14+
15+
"disallowMixedSpacesAndTabs": true,
16+
"disallowTrailingWhitespace": true,
17+
"disallowSpaceAfterPrefixUnaryOperators": true,
18+
"disallowMultipleVarDecl": true,
19+
20+
"requireSpaceAfterKeywords": [
21+
"if",
22+
"else",
23+
"for",
24+
"while",
25+
"do",
26+
"switch",
27+
"return",
28+
"try",
29+
"catch"
30+
],
31+
"requireSpaceBeforeBinaryOperators": [
32+
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
33+
"&=", "|=", "^=", "+=",
34+
35+
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
36+
"|", "^", "&&", "||", "===", "==", ">=",
37+
"<=", "<", ">", "!=", "!=="
38+
],
39+
"requireSpaceAfterBinaryOperators": true,
40+
"requireSpacesInConditionalExpression": true,
41+
"requireSpaceBeforeBlockStatements": true,
42+
"requireLineFeedAtFileEnd": true,
43+
"disallowSpacesInsideObjectBrackets": "all",
44+
"disallowSpacesInsideArrayBrackets": "all",
45+
"disallowSpacesInsideParentheses": true,
46+
47+
48+
"validateJSDoc": {
49+
"checkParamNames": true,
50+
"requireParamTypes": true
51+
},
52+
53+
"disallowNewlineBeforeBlockStatements": true
54+
}

.jshintrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"asi": true,
3+
"browser": true,
4+
"eqeqeq": false,
5+
"eqnull": true,
6+
"es3": true,
7+
"expr": true,
8+
"jquery": true,
9+
"latedef": true,
10+
"laxbreak": true,
11+
"nonbsp": true,
12+
"strict": true,
13+
"undef": true,
14+
"unused": true,
15+
"predef": ["angular", "_"]
16+
}

Gruntfile.js

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
module.exports = function (grunt) {
2+
3+
grunt.loadNpmTasks('grunt-contrib-clean');
4+
grunt.loadNpmTasks('grunt-contrib-jshint');
5+
grunt.loadNpmTasks('grunt-contrib-concat');
6+
grunt.loadNpmTasks("grunt-contrib-watch");
7+
grunt.loadNpmTasks('grunt-jscs');
8+
grunt.loadNpmTasks('grunt-contrib-uglify');
9+
grunt.loadNpmTasks('grunt-karma');
10+
grunt.loadNpmTasks('grunt-maven-tasks');
11+
grunt.loadNpmTasks('grunt-html2js');
12+
grunt.loadNpmTasks('grunt-contrib-connect');
13+
grunt.loadNpmTasks('grunt-protractor-runner');
14+
grunt.loadNpmTasks('grunt-bootlint');
15+
grunt.loadNpmTasks('grunt-ng-annotate');
16+
17+
// Project configuration.
18+
grunt.initConfig({
19+
20+
pkg: grunt.file.readJSON('package.json'),
21+
22+
clean: {
23+
options: {
24+
force: true
25+
},
26+
dist: ['dist']
27+
},
28+
29+
ngAnnotate: {
30+
add: {
31+
options: {
32+
singleQuotes: true
33+
},
34+
files: {
35+
'dist/angular-bootstrap-multiselect.js': 'dist/angular-bootstrap-multiselect.js'
36+
}
37+
}
38+
},
39+
40+
bootlint: {
41+
options: {
42+
stoponerror: true,
43+
relaxerror: ['E001', 'W001', 'W002', 'W003', 'W005']
44+
},
45+
files: ['src/**/*.html']
46+
},
47+
48+
jshint: {
49+
options: {
50+
jshintrc: '.jshintrc'
51+
},
52+
sources: {
53+
src: ['src/**/*.js']
54+
}
55+
},
56+
57+
jscs: {
58+
options: {
59+
config: '.jscsrc'
60+
},
61+
src: {
62+
src: '<%= jshint.sources.src %>'
63+
}
64+
},
65+
66+
html2js: {
67+
options: {
68+
base: 'src',
69+
module: 'btorfs.multiselect.templates'
70+
},
71+
main: {
72+
src: ['src/**/*.html'],
73+
dest: 'dist/angular-bootstrap-multiselect-templates.js'
74+
}
75+
},
76+
77+
concat: {
78+
options: {},
79+
files: {
80+
src: ['src/**/*.js', 'dist/angular-bootstrap-multiselect-templates.js'],
81+
dest: 'dist/angular-bootstrap-multiselect.js'
82+
}
83+
},
84+
85+
uglify: {
86+
files: {
87+
src: 'dist/angular-bootstrap-multiselect.js',
88+
dest: 'dist/angular-bootstrap-multiselect.min.js'
89+
}
90+
},
91+
92+
karma: {
93+
ci: {
94+
configFile: 'test/unit/karma.conf.js',
95+
reporters: ["dots"]
96+
},
97+
dev: {
98+
configFile: 'test/unit/karma.conf.js'
99+
}
100+
},
101+
102+
watch: {
103+
karma: {
104+
files: ['src/**/*', 'test/unit/**/*'],
105+
tasks: ['build', 'karma:dev']
106+
}
107+
},
108+
109+
connect: {
110+
e2e: {
111+
options: {
112+
port: 9000,
113+
base: '.'
114+
}
115+
}
116+
},
117+
118+
protractor: {
119+
options: {
120+
keepAlive: false,
121+
configFile: "test/e2e/protractor.conf.js",
122+
args: {
123+
baseUrl: 'http://localhost:9000'
124+
}
125+
},
126+
run: {}
127+
}
128+
129+
});
130+
131+
// Quality checks
132+
grunt.registerTask('check', ['bootlint', 'jshint', 'jscs']);
133+
134+
// Build files
135+
grunt.registerTask('build', ['html2js', 'concat', 'ngAnnotate', 'uglify']);
136+
137+
// Continuous integration task
138+
grunt.registerTask('ci', ['clean', 'check', 'build', 'karma:ci']);
139+
140+
// Run UI tests
141+
grunt.registerTask('e2e', ['connect', 'protractor']);
142+
143+
// Continously build and execute unit tests after every file change, during development
144+
grunt.registerTask('dev', ['build', 'watch']);
145+
146+
// Default task: does everything including UI tests
147+
grunt.registerTask('default', ['clean', 'check', 'build', 'karma:ci', 'e2e']);
148+
};

bower.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "angular-bootstrap-multiselect",
3+
"version": "1.0.0",
4+
"main": "dist/angular-bootstrap-multiselect",
5+
"ignore": [
6+
"src",
7+
"test",
8+
"node_modules",
9+
"bower_components",
10+
"Gruntfile.js",
11+
"**/.*"
12+
],
13+
"dependencies": {
14+
"angular": ">=1.3.0"
15+
},
16+
"devDependencies": {
17+
"angular-mocks": ">=1.3.0"
18+
}
19+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
angular.module('btorfs.multiselect.templates', ['multiselect.html']);
2+
3+
angular.module("multiselect.html", []).run(["$templateCache", function($templateCache) {
4+
$templateCache.put("multiselect.html",
5+
"<div class=\"btn-group\" style=\"width: 100%\">\n" +
6+
" <button type=\"button\" class=\"form-control btn btn-default btn-block dropdown-toggle\" ng-click=\"toggleDropdown()\">\n" +
7+
" {{getButtonText()}}&nbsp;<span class=\"caret\"></span></button>\n" +
8+
" <ul class=\"dropdown-menu dropdown-menu-form\"\n" +
9+
" ng-style=\"{display: open ? 'block' : 'none'}\" style=\"width: 100%; overflow-x: auto\">\n" +
10+
"\n" +
11+
" <li ng-show=\"showSelectAll\">\n" +
12+
" <a ng-click=\"selectAll()\" href=\"\">\n" +
13+
" <span class=\"glyphicon glyphicon-ok\"></span> Select All\n" +
14+
" </a>\n" +
15+
" </li>\n" +
16+
" <li ng-show=\"showUnselectAll\">\n" +
17+
" <a ng-click=\"unselectAll()\" href=\"\">\n" +
18+
" <span class=\"glyphicon glyphicon-remove\"></span> Unselect All\n" +
19+
" </a>\n" +
20+
" </li>\n" +
21+
" <li ng-show=\"(showSelectAll || showUnselectAll)\"\n" +
22+
" class=\"divider\">\n" +
23+
" </li>\n" +
24+
"\n" +
25+
" <li role=\"presentation\" ng-repeat=\"option in selection\" class=\"active\">\n" +
26+
" <a class=\"item-selected\" href=\"\" ng-click=\"toggleItem(option); $event.stopPropagation()\">\n" +
27+
" <span class=\"glyphicon glyphicon-remove\"></span>\n" +
28+
" {{getDisplay(option)}}\n" +
29+
" </a>\n" +
30+
" </li>\n" +
31+
" <li ng-show=\"selection.length > 0\" class=\"divider\"></li>\n" +
32+
"\n" +
33+
" <li ng-show=\"showSearch\">\n" +
34+
" <div class=\"dropdown-header\">\n" +
35+
" <input type=\"text\" class=\"form-control input-sm\" style=\"width: 100%;\"\n" +
36+
" ng-model=\"searchFilter\" placeholder=\"Search...\"/>\n" +
37+
" </div>\n" +
38+
" </li>\n" +
39+
"\n" +
40+
" <li ng-show=\"showSearch\" class=\"divider\"></li>\n" +
41+
" <li role=\"presentation\" ng-repeat=\"option in options | filter:search() | limitTo: searchLimit\"\n" +
42+
" ng-if=\"!isSelected(option)\">\n" +
43+
" <a class=\"item-unselected\" href=\"\" ng-click=\"toggleItem(option); $event.stopPropagation()\">\n" +
44+
" {{getDisplay(option)}}\n" +
45+
" </a>\n" +
46+
" </li>\n" +
47+
"\n" +
48+
" <li class=\"divider\" ng-show=\"selectionLimit > 1\"></li>\n" +
49+
" <li role=\"presentation\" ng-show=\"selectionLimit > 1\">\n" +
50+
" <a>{{selection.length || 0}} / {{selectionLimit}} selected</a>\n" +
51+
" </li>\n" +
52+
"\n" +
53+
" </ul>\n" +
54+
"</div>");
55+
}]);

0 commit comments

Comments
 (0)