carte-server 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78815b0f269198095f1608e9a498820bb5d0c771
4
- data.tar.gz: 8d2833dc30b92f2bca88f3c865333f3dc6edf4ca
3
+ metadata.gz: 1588bcae30f07e9328f0544d3b0276ac7452fb40
4
+ data.tar.gz: 28ce06311f7becefb4f080e08d7abba02cd85e57
5
5
  SHA512:
6
- metadata.gz: ab54463ad01c2b6f1a1e3b98e71077f33997c539a7b38ec27bb9e27df448ce70e5fd8d6044bb15ffaf2b425542e5428e57652e3d56ba683d01947af1ffc092cb
7
- data.tar.gz: ae2b69ccf3300a2b96cdf02d5340774e55f0a91e8dff0f3d52c62fa7606ed993e049e99189c0ac60663556b77d2adb4e58d71924d7e6faa1102b18747f32a56b
6
+ metadata.gz: b249cbf0dfd97b5e12c4ed0530377b842ab49d0ea18c0f25f7c4bd7e9d9f6272e96f73402c1ff141a9a0422f063c09f866609b59d4388df62ac7220b3be4abf4
7
+ data.tar.gz: d426ff1c3ce87509cbccdf60810243f65b854172166a60963772cbab89154ad4793ef229600fd9d65e600acb647b3be91f25394d086b24da105c92e61485b3c3
@@ -4,6 +4,7 @@ React = require('react/addons')
4
4
  Modal = require('react-bootstrap/lib/Modal')
5
5
  Button = require('react-bootstrap/lib/Button')
6
6
  TagsInput = require('react-tagsinput')
7
+ CardModel = require('../models/card')
7
8
 
8
9
  module.exports = React.createClass
9
10
  mixins: [React.addons.LinkedStateMixin]
@@ -17,6 +18,8 @@ module.exports = React.createClass
17
18
  tags: @props.card.get('tags') || []
18
19
  errors: false
19
20
  shaking: false
21
+ dontCloseDialog: false
22
+ createSuccess: false
20
23
 
21
24
  onChangeTitle: (event)->
22
25
  @setState title: event.target.value
@@ -24,6 +27,9 @@ module.exports = React.createClass
24
27
  onChangeContent: (event)->
25
28
  @setState content: event.target.value
26
29
 
30
+ onChangeDontCloseDialog: (event)->
31
+ @setState dontCloseDialog: !@state.dontCloseDialog
32
+
27
33
  onClickOk: (event)->
28
34
  event.preventDefault()
29
35
  @setState updating: true
@@ -34,10 +40,19 @@ module.exports = React.createClass
34
40
  @props.card.save attributes,
35
41
  success: ()=>
36
42
  @setState updating: false
37
- @props.onRequestHide()
38
- @props.card.set 'title', @state.title
39
43
  if @props.card.isNew()
40
- location.hash = '/' + @state.title
44
+ if @state.dontCloseDialog
45
+ @setState
46
+ createSuccess: true
47
+ title: ''
48
+ content: ''
49
+ tags: []
50
+ @props.card = new CardModel()
51
+ @props.card._isNew = true
52
+ else
53
+ @props.onRequestHide()
54
+ @props.card.set 'title', @state.title
55
+ location.hash = '/' + @state.title
41
56
  error: (model, response, options)=>
42
57
  console.log response.responseJSON
43
58
  @setState errors: response.responseJSON.card.errors
@@ -59,6 +74,11 @@ module.exports = React.createClass
59
74
  }
60
75
  </ul>
61
76
  </div>
77
+ else if @state.createSuccess
78
+ <div className="alert alert-success" role="alert" style={padding:'5px'}>
79
+ <i className="glyphicon glyphicon-info-sign" />&nbsp;
80
+ You created a card successfully. Let's create next one.
81
+ </div>
62
82
  }
63
83
  <div className="form-group">
64
84
  <label class="control-label">Title</label>
@@ -72,6 +92,14 @@ module.exports = React.createClass
72
92
  <label class="control-label">Tags</label>
73
93
  <TagsInput ref='tags' valueLink={this.linkState('tags')} />
74
94
  </div>
95
+ {
96
+ if @props.card.isNew()
97
+ <div className="checkbox">
98
+ <label>
99
+ <input type="checkbox" checked={@state.dontCloseDialog} onChange={@onChangeDontCloseDialog} /> Don't Close Dialog
100
+ </label>
101
+ </div>
102
+ }
75
103
  <div className="form-group" style={{paddingBottom:'17px'}}>
76
104
  <button className="btn btn-default pull-right" onClick={@onClickOk} disabled={@state.updating}>
77
105
  &nbsp;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "carte-client",
3
3
  "description": "something like dictionary, wiki, or information card",
4
- "version": "0.0.24",
4
+ "version": "0.0.25",
5
5
  "main": "lib/carte.coffee",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carte-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - tily