Diffstat (limited to 'frontend/delta/js/Clipperz/PM/UI/Components/Checkbox.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/delta/js/Clipperz/PM/UI/Components/Checkbox.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/frontend/delta/js/Clipperz/PM/UI/Components/Checkbox.js b/frontend/delta/js/Clipperz/PM/UI/Components/Checkbox.js new file mode 100644 index 0000000..9538063 --- a/dev/null +++ b/frontend/delta/js/Clipperz/PM/UI/Components/Checkbox.js | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2013 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz, the online password manager. | ||
6 | For further information about its features and functionalities please | ||
7 | refer to http://www.clipperz.com. | ||
8 | |||
9 | * Clipperz is free software: you can redistribute it and/or modify it | ||
10 | under the terms of the GNU Affero General Public License as published | ||
11 | by the Free Software Foundation, either version 3 of the License, or | ||
12 | (at your option) any later version. | ||
13 | |||
14 | * Clipperz is distributed in the hope that it will be useful, but | ||
15 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
17 | See the GNU Affero General Public License for more details. | ||
18 | |||
19 | * You should have received a copy of the GNU Affero General Public | ||
20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. | ||
21 | |||
22 | */ | ||
23 | |||
24 | Clipperz.PM.UI.Components.Checkbox = React.createClass({ | ||
25 | //http://development.tobypitman.com/iphoneCheckboxes/iphoneCheckboxes2.html | ||
26 | |||
27 | propTypes: { | ||
28 | 'checked': React.PropTypes.bool.isRequired, | ||
29 | 'id': React.PropTypes.string.isRequired, | ||
30 | 'eventHandler':React.PropTypes.func.isRequired | ||
31 | }, | ||
32 | |||
33 | //========================================================================= | ||
34 | |||
35 | render: function () { | ||
36 | returnReact.DOM.div({className:'checkbox', onClick:this.props['eventHandler']}, [ | ||
37 | React.DOM.input({name:this.props['id'], id:this.props['id'], value:this.props['id'], type:'checkbox', checked:this.props['checked']}), | ||
38 | React.DOM.label({className:'check', 'for':this.props['id']}), | ||
39 | React.DOM.label({className:'info', 'for':this.props['id']}, "enable local storage") | ||
40 | ]); | ||
41 | } | ||
42 | |||
43 | //========================================================================= | ||
44 | }); | ||