carte-server 1.0.6 → 1.0.7

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: a988b4ffc64e624ab4703f6978e40eaec2d3e32d
4
- data.tar.gz: 5e4a4519d061bf29a4b89006430812b7a7a446b9
3
+ metadata.gz: d81ce3e8c26a94618aac1527f475ba4a8fae8a7a
4
+ data.tar.gz: c555caad49ebb424cd41bcd65a2328cab83d3374
5
5
  SHA512:
6
- metadata.gz: 9979a1dc96578eead74536780ad69eeea39e2a529438ce6164c790d9ea582ef5ed3adccee58dcbbaca1a695578b60fb74194a71d6543890ce9f6fe911dcff586
7
- data.tar.gz: e136696b82768ec243296ee587f905c46dbc111f7bccfed643670aab2faafe2a212bb0b3c7094e25a992ebf2a60919c34a67bdf53457e6fa38c5b4a650b60e69
6
+ metadata.gz: 820d0748a05bc04fcfd3aa45d48c85cf71799157ae7996b0c13aa07c72762bc1ea6ddeef8ee63de61a9a012f364bb38e72ad4c58e4a8e0680e07c25fe7c6b2b2
7
+ data.tar.gz: 62f67eb92f36ffcccfc4f92b87f18e3e8b0604c4d9f2399367e118a8ce18f3f42406c404e5a500be33f325e4e7a6a0677bf2e28e2cf5762d7c4daea8d1db2b72
@@ -14,11 +14,13 @@ Button = require('react-bootstrap').Button
14
14
  window.onerror = (error, url, line) -> alert error
15
15
 
16
16
  Flash = React.createClass
17
+ scrollEventNames: ['touchstart', 'touchmove', 'touchend', 'gesturestart', 'gesturechange', 'gestureend']
18
+
17
19
  componentDidMount: ->
18
20
  console.log '[views/flash] componentDidMount', @props
19
21
  $(document).on 'keydown', @onKeyDown
20
- #for eventName in ['touchstart', 'touchmove', 'touchend', 'gesturestart', 'gesturechange', 'gestureend']
21
- # $(document).on eventName, (event)-> event.preventDefault(); event.stopPropagation()
22
+ for eventName in @scrollEventNames
23
+ $(document).on eventName, @preventScroll
22
24
 
23
25
  @setState currCards: @props.cards
24
26
 
@@ -37,6 +39,8 @@ Flash = React.createClass
37
39
  componentWillUnmount: ->
38
40
  console.log '[views/flash] FlashMain componentWillUnmount'
39
41
  $(document).off 'keydown', @onKeyDown
42
+ for eventName in @scrollEventNames
43
+ $(document).off eventName, @preventScroll
40
44
 
41
45
  onKeyDown: (event)->
42
46
  switch event.keyCode
@@ -44,6 +48,11 @@ Flash = React.createClass
44
48
  when 37 then @onClickPrev()
45
49
  when 39 then @onClickNext()
46
50
 
51
+ preventScroll: (event)->
52
+ tagName = event.target.tagName.toLowerCase()
53
+ return if tagName == 'button' || tagName == 'a'
54
+ event.preventDefault()
55
+
47
56
  getInitialState: ->
48
57
  currCard: null
49
58
  currCards: null
@@ -186,6 +195,9 @@ Flash = React.createClass
186
195
  onClickMenuItem: (params)->
187
196
  ()=> window.location.hash = '#/?' + @queryParam(params)
188
197
 
198
+ onTouchStartTools: (event)->
199
+ event.stopPropagation()
200
+
189
201
  render: ->
190
202
  clearInterval @interval if @interval
191
203
  if @props.cards.query.auto != 'off'
@@ -194,10 +206,9 @@ Flash = React.createClass
194
206
  when 'fast' then bpm = 90
195
207
  when 'normal' then bpm = 60
196
208
  when 'slow' then bpm = 30
197
- console.log 'bpm!!!!!!!!!!!!!!!!!!!!!!!!!!', bpm
198
209
  @interval = setInterval @onClickNext, 1000 * 60 / bpm
199
210
  <div onTouchStart={@onTouchStart} onTouchMove={@onTouchMove} onTouchEnd={@onTouchEnd} style={overflow:'hidden',width:'100%',height:'100%'}>
200
- <div style={position:'absolute',bottom:0,width:'100%',padding:'47px 0px 0px 0px'} onMouseOver={@onMouseOverTools} onMouseLeave={@onMouseLeaveTools}>
211
+ <div onTouchStart={@onTouchStartTools} style={position:'absolute',bottom:0,width:'100%',padding:'47px 0px 0px 0px'} onMouseOver={@onMouseOverTools} onMouseLeave={@onMouseLeaveTools}>
201
212
  <span className={classnames("pull-right":true, 'carte-hidden': !@state.showTools)}>
202
213
  <ButtonGroup>
203
214
  <DropdownButton bsSize='large' bsStyle='default' title={'Auto: ' + @props.cards.query.auto} dropup pullRight className={classnames('open': @state.menuOpen)}>
@@ -265,6 +276,7 @@ module.exports = React.createClass
265
276
 
266
277
  componentWillUnmount: ->
267
278
  console.log '[views/slideshow] componentWillUnmount'
279
+ React.unmountComponentAtNode(@node)
268
280
  document.body.removeChild(@node)
269
281
 
270
282
  renderSlideshow: ->
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "carte-client",
3
3
  "description": "something like dictionary, wiki, or information card",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
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: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - tily