This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,000 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
.idea | ||
dist | ||
w11k-select.iml | ||
node_modules | ||
|
||
.DS_Store | ||
.sass-cache | ||
bower_components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
// Settings | ||
"passfail" : false, // Stop on first error. | ||
"maxerr" : 100, // Maximum errors before stopping. | ||
|
||
|
||
// Predefined globals whom JSHint will ignore. | ||
"browser" : false, // Standard browser globals e.g. `window`, `document`. | ||
"node" : false, | ||
"jquery" : true, | ||
|
||
"predef" : [ // Extra globals. | ||
// application code | ||
"angular", | ||
"_", | ||
"lodash", | ||
|
||
// test code | ||
"beforeEach", | ||
"afterEach", | ||
"module", | ||
"describe", | ||
"expect", | ||
"it", | ||
"inject", | ||
"jasmine", | ||
"spyOn", | ||
"browser", | ||
"element" | ||
], | ||
|
||
// Development. | ||
"debug" : false, // Allow debugger statements e.g. browser breakpoints. | ||
"devel" : false, // Allow development statements e.g. `console.log();`. | ||
|
||
|
||
// EcmaScript 5. | ||
"strict" : true, // Require `use strict` pragma in every file. | ||
"globalstrict" : true, // Allow global `use strict` syntax because build-system wraps all application code into a function | ||
|
||
|
||
// The Good Parts. | ||
"asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons). | ||
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons. | ||
"laxcomma" : true, // Tolerate line breaking before ',' | ||
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.). | ||
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments. | ||
"curly" : true, // Require {} for every new block or scope. | ||
"eqeqeq" : true, // Require triple equals i.e. `===`. | ||
"eqnull" : false, // Tolerate use of `== null`. | ||
"evil" : false, // Tolerate use of `eval`. | ||
"expr" : false, // Tolerate `ExpressionStatement` as Programs. | ||
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`. | ||
"immed" : true, // Require immediate invocations to be wrapped in parents e.g. `( function(){}() );` | ||
"latedef" : true, // Prohibit variable use before definition. | ||
"loopfunc" : false, // Allow functions to be defined within loops. | ||
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`. | ||
"regexp" : true, // Prohibit `.` and `[^...]` in regular expressions. | ||
"regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`. | ||
"scripturl" : true, // Tolerate script-targeted URLs. | ||
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`. | ||
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`. | ||
"undef" : true, // Require all non-global variables be declared before they are used. | ||
|
||
|
||
// Personal styling preferences. | ||
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`. | ||
"noempty" : true, // Prohibit use of empty blocks. | ||
"nonew" : true, // Prohibit use of constructors for side-effects. | ||
"nomen" : true, // Prohibit use of initial or trailing underbars in names. | ||
"onevar" : false, // Allow only one `var` statement per function. | ||
"plusplus" : false, // Prohibit use of `++` & `--`. | ||
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`. | ||
"trailing" : true, // Prohibit trailing whitespaces. | ||
"white" : true, // Check against strict whitespace and indentation rules. | ||
|
||
"indent": 2, | ||
"camelcase": true, | ||
"quotmark": "single", | ||
"unused": true, | ||
"smarttabs": false | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<a name="0.1.0"></a> | ||
## 0.1.0 (2014-03-03) | ||
|
||
#### Features | ||
|
||
* **options:** parse options given via attribute as ```"value" [as "label"] for "item" in "collection"``` | ||
* **ng-model:** use ngModelController to expose selected options and support validation | ||
* **multiple:** support single- and multiple-select mode | ||
* **disabled:** support disabled attribute to prevent change of selected options | ||
* **placeholder:** support placeholder texts for dropdown header and filter box | ||
* **template:** make template url configurable via config constant | ||
* **selected-message:** support customisable text for toggle-area |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
'use strict'; | ||
|
||
module.exports = function (grunt) { | ||
|
||
var pkg = require('./package.json'); | ||
|
||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-contrib-sass'); | ||
grunt.loadNpmTasks('grunt-contrib-copy'); | ||
grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
grunt.loadNpmTasks('grunt-html2js'); | ||
grunt.loadNpmTasks('grunt-bump'); | ||
grunt.loadNpmTasks('grunt-conventional-changelog'); | ||
|
||
var bowerrc = grunt.file.exists('./.bowerrc') ? grunt.file.readJSON('./.bowerrc') : { 'json': 'bower.json' }; | ||
|
||
var bumpFiles = [ 'package.json', '../w11k-select-bower/package.json' ]; | ||
if (grunt.file.exists(bowerrc.json)) { | ||
bumpFiles.push(bowerrc.json); | ||
} | ||
|
||
grunt.initConfig({ | ||
pkg: pkg, | ||
meta: { | ||
banner: | ||
'/**\n' + | ||
' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' + | ||
' * <%= pkg.homepage %>\n' + | ||
' *\n' + | ||
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>\n' + | ||
' */\n' | ||
}, | ||
|
||
clean: { | ||
dist: 'dist/*' | ||
}, | ||
jshint: { | ||
src: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
files: [{ | ||
expand: true, | ||
cwd: 'src', | ||
src: '**.js' | ||
}] | ||
} | ||
}, | ||
sass: { | ||
dist: { | ||
options: { | ||
style: 'expanded' | ||
}, | ||
files: { | ||
'dist/w11k-select.css': 'src/w11k-select.scss' | ||
} | ||
} | ||
}, | ||
copy: { | ||
template: { | ||
src: 'src/w11k-select.tpl.html', | ||
dest: 'dist/w11k-select.tpl.html' | ||
}, | ||
release: { | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'dist/', | ||
src: '*', | ||
dest: '../w11k-select-bower/dist/' | ||
}, | ||
{ | ||
src: 'bower.json', | ||
dest: '../w11k-select-bower/' | ||
} | ||
] | ||
} | ||
}, | ||
html2js: { | ||
template: { | ||
options: { | ||
base: 'src/', | ||
module: 'w11k.select.template', | ||
quoteChar: '\'', | ||
htmlmin: { | ||
collapseWhitespace: true | ||
} | ||
}, | ||
files: { | ||
'dist/w11k-select.tpl.js': 'src/w11k-select.tpl.html' | ||
} | ||
} | ||
}, | ||
uglify: { | ||
options: { | ||
banner: '<%= meta.banner %>' | ||
}, | ||
code: { | ||
options: { | ||
mangle: false, | ||
compress: false, | ||
beautify: true | ||
}, | ||
files: { | ||
'dist/w11k-select.js': 'src/w11k-select.js' | ||
} | ||
}, | ||
codeMinified: { | ||
files: [{ | ||
'dist/w11k-select.min.js': 'src/w11k-select.js' | ||
}] | ||
} | ||
}, | ||
bump: { | ||
options: { | ||
files: bumpFiles, | ||
commit: true, | ||
commitMessage: 'chore(project): bump version to %VERSION%', | ||
commitFiles: ['-a'], | ||
createTag: false, | ||
push: false | ||
} | ||
} | ||
}); | ||
|
||
|
||
grunt.registerTask('default', ['build']); | ||
|
||
grunt.registerTask('build', ['clean', 'jshint:src', 'sass', 'copy:template', 'html2js', 'uglify']); | ||
|
||
grunt.registerTask('release', ['build', 'copy:release']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "w11k-select", | ||
"version": "0.1.0", | ||
|
||
"dependencies": { | ||
"jquery": "1.11.x", | ||
"angular": "1.2.x", | ||
"w11k-dropdownToggle": "0.1.x", | ||
"angular-bindonce": "0.3.x", | ||
"font-awesome": "4.0.x" | ||
}, | ||
"devDependencies": { | ||
"bootstrap": "3.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html ng-app="demo"> | ||
<head> | ||
<script type="text/javascript" src="../bower_components/jquery/dist/jquery.js"></script> | ||
<script type="text/javascript" src="../bower_components/angular/angular.js"></script> | ||
<script type="text/javascript" src="../bower_components/w11k-dropdownToggle/dist/w11k-dropdownToggle.js"></script> | ||
<script type="text/javascript" src="../bower_components/angular-bindonce/bindonce.js"></script> | ||
<script type="text/javascript" src="../dist/w11k-select.js"></script> | ||
<script type="text/javascript" src="../dist/w11k-select.tpl.js"></script> | ||
<script type="text/javascript" src="demo.js"></script> | ||
|
||
<link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.css"/> | ||
<link rel="stylesheet" href="../dist/w11k-select.css"/> | ||
<link rel="stylesheet" href="../bower_components/font-awesome/css/font-awesome.css"/> | ||
|
||
<style type="text/css"> | ||
body { | ||
padding: 2em; | ||
} | ||
</style> | ||
</head> | ||
<body ng-controller="DemoCtrl"> | ||
<div class="row"> | ||
<div class="col-sm-6"> | ||
<div w11k-select multiple="true" | ||
ng-model="selected.data" | ||
options="option.value as option.label for option in options.data" | ||
placeholder="'All'" | ||
filter-placeholder="'Filter'" | ||
> | ||
</div> | ||
</div> | ||
<div class="col-sm-6"> | ||
|
||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
angular.module("demo", ["w11k.select", "w11k.select.template"]); | ||
|
||
angular.module("demo").controller("DemoCtrl", function ($scope) { | ||
|
||
}); |
Oops, something went wrong.