Skip to content

Commit 12b8976

Browse files
committed
initial
0 parents  commit 12b8976

14 files changed

+383
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
charset = utf-8
10+
11+
[*.js]
12+
max_line_length = 80
13+
indent_brace_style = 1TBS
14+
spaces_around_operators = true
15+
quote_type = auto

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
.build*
3+
.npm*
4+
.meteor*
5+
smart.lock
6+
nbproject*
7+
/packages/
8+
.idea/

.jshintrc

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"maxerr" : 50,
3+
"bitwise" : true,
4+
"camelcase" : true,
5+
"curly" : true,
6+
"eqeqeq" : true,
7+
"forin" : true,
8+
"immed" : false,
9+
"indent" : 2,
10+
"latedef" : false,
11+
"newcap" : false,
12+
"noarg" : true,
13+
"noempty" : true,
14+
"nonew" : false,
15+
"plusplus" : false,
16+
"quotmark" : false,
17+
"undef" : false,
18+
"unused" : true,
19+
"strict" : false,
20+
"trailing" : true,
21+
"maxparams" : false,
22+
"maxdepth" : false,
23+
"maxstatements" : false,
24+
"maxcomplexity" : false,
25+
"asi" : false,
26+
"boss" : false,
27+
"debug" : false,
28+
"eqnull" : false,
29+
"es5" : false,
30+
"esnext" : false,
31+
"moz" : false,
32+
"evil" : false,
33+
"expr" : false,
34+
"funcscope" : false,
35+
"globalstrict" : true,
36+
"iterator" : false,
37+
"lastsemic" : false,
38+
"laxbreak" : false,
39+
"laxcomma" : false,
40+
"loopfunc" : false,
41+
"multistr" : false,
42+
"proto" : false,
43+
"scripturl" : false,
44+
"smarttabs" : false,
45+
"shadow" : false,
46+
"sub" : false,
47+
"supernew" : false,
48+
"validthis" : false,
49+
"browser" : true,
50+
"couch" : false,
51+
"devel" : true,
52+
"dojo" : false,
53+
"jquery" : false,
54+
"mootools" : false,
55+
"node" : false,
56+
"nonstandard" : false,
57+
"prototypejs" : false,
58+
"rhino" : false,
59+
"worker" : false,
60+
"wsh" : false,
61+
"yui" : false,
62+
"nomen" : false,
63+
"onevar" : false,
64+
"passfail" : false,
65+
"white" : false,
66+
"predef" : [
67+
"Meteor",
68+
"Accounts",
69+
"Session",
70+
"Template",
71+
"check",
72+
"Match",
73+
"Tracker",
74+
"EJSON",
75+
"Email",
76+
"Package",
77+
"Tinytest",
78+
"Npm",
79+
"Assets",
80+
"Packages",
81+
"process",
82+
"LocalCollection",
83+
"_",
84+
"Random",
85+
"HTTP"
86+
]
87+
}

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- "0.10"
4+
before_install:
5+
- "curl -L http://git.io/ejPSng | /bin/sh"

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Eric Dobbertin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
aldeed:autoform-bs-button-group-input
2+
=========================
3+
4+
An add-on Meteor package for [aldeed:autoform](https://github.com/aldeed/meteor-autoform). Provides a Bootstrap button group theme for the "select-checkbox" and "select-radio" AutoForm input types.
5+
6+
## Installation
7+
8+
In a Meteor app directory, enter:
9+
10+
```bash
11+
$ meteor add aldeed:autoform-bs-button-group-input
12+
```
13+
14+
## Usage
15+
16+
Specify "select-checkbox" or "select-radio" for the `type` attribute of any input, and then specify "buttonGroup" as the `template` attribute.
17+
18+
```js
19+
{{> afQuickField name="plans" type="select-radio" template="buttonGroup" value=2 label=false}}
20+
```
21+
22+
## Contributing
23+
24+
Anyone is welcome to contribute. Fork, make your changes, and then submit a pull request.
25+
26+
[![Support via Gratipay](https://cdn.rawgit.com/gratipay/gratipay-badge/2.1.3/dist/gratipay.png)](https://gratipay.com/aldeed/)

cb-buttons.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template name="afCheckboxGroup_buttonGroup">
2+
<div class="btn-group af-checkbox-group" data-toggle="buttons" {{dsk}}>
3+
{{#each this.items}}
4+
<label class="btn btn-default {{#if this.selected}}active{{/if}}">
5+
<input type="checkbox" value="{{this.value}}" {{atts}} />
6+
{{this.label}}
7+
</label>
8+
{{/each}}
9+
</div>
10+
</template>

cb-buttons.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Template["afCheckboxGroup_buttonGroup"].helpers({
2+
atts: function selectedAttsAdjust() {
3+
var atts = _.clone(this.atts);
4+
if (this.selected) {
5+
atts.checked = "";
6+
}
7+
// remove data-schema-key attribute because we put it
8+
// on the entire group
9+
delete atts["data-schema-key"];
10+
return atts;
11+
},
12+
dsk: function dsk() {
13+
return {
14+
"data-schema-key": this.atts["data-schema-key"]
15+
}
16+
}
17+
});

package.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Package.describe({
2+
name: 'aldeed:autoform-bs-button-group-input',
3+
summary: 'A Bootstrap button group theme for the "select-checkbox" and "select-radio" AutoForm input types',
4+
version: '1.0.0',
5+
git: 'https://github.com/aldeed/meteor-autoform-bs-button-group-input.git'
6+
});
7+
8+
Package.onUse(function(api) {
9+
api.use('[email protected]');
10+
api.use('[email protected]');
11+
api.use('aldeed:[email protected]');
12+
api.addFiles([
13+
'cb-buttons.html',
14+
'cb-buttons.js',
15+
'rad-buttons.html',
16+
'rad-buttons.js'
17+
], 'client');
18+
});

rad-buttons.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<template name="afRadioGroup_buttonGroup">
2+
<div class="btn-group af-radio-group" data-toggle="buttons" {{dsk}}>
3+
{{#each this.items}}
4+
<label class="btn btn-default {{#if this.selected}}active{{/if}}">
5+
<input type="radio" value="{{this.value}}" {{atts}} />
6+
{{this.label}}
7+
</label>
8+
{{/each}}
9+
</div>
10+
</template>

0 commit comments

Comments
 (0)