carte-server 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/carte/client/views/slideshow.cjsx +54 -20
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a988b4ffc64e624ab4703f6978e40eaec2d3e32d
|
4
|
+
data.tar.gz: 5e4a4519d061bf29a4b89006430812b7a7a446b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9979a1dc96578eead74536780ad69eeea39e2a529438ce6164c790d9ea582ef5ed3adccee58dcbbaca1a695578b60fb74194a71d6543890ce9f6fe911dcff586
|
7
|
+
data.tar.gz: e136696b82768ec243296ee587f905c46dbc111f7bccfed643670aab2faafe2a212bb0b3c7094e25a992ebf2a60919c34a67bdf53457e6fa38c5b4a650b60e69
|
@@ -11,12 +11,14 @@ MenuItem = require('react-bootstrap').MenuItem
|
|
11
11
|
ButtonGroup = require('react-bootstrap').ButtonGroup
|
12
12
|
Button = require('react-bootstrap').Button
|
13
13
|
|
14
|
-
|
14
|
+
window.onerror = (error, url, line) -> alert error
|
15
15
|
|
16
16
|
Flash = React.createClass
|
17
17
|
componentDidMount: ->
|
18
18
|
console.log '[views/flash] componentDidMount', @props
|
19
19
|
$(document).on 'keydown', @onKeyDown
|
20
|
+
#for eventName in ['touchstart', 'touchmove', 'touchend', 'gesturestart', 'gesturechange', 'gestureend']
|
21
|
+
# $(document).on eventName, (event)-> event.preventDefault(); event.stopPropagation()
|
20
22
|
|
21
23
|
@setState currCards: @props.cards
|
22
24
|
|
@@ -33,6 +35,7 @@ Flash = React.createClass
|
|
33
35
|
@forceUpdate.bind(@, null)
|
34
36
|
|
35
37
|
componentWillUnmount: ->
|
38
|
+
console.log '[views/flash] FlashMain componentWillUnmount'
|
36
39
|
$(document).off 'keydown', @onKeyDown
|
37
40
|
|
38
41
|
onKeyDown: (event)->
|
@@ -101,16 +104,38 @@ Flash = React.createClass
|
|
101
104
|
@setState prevCards: prevCards
|
102
105
|
|
103
106
|
onTouchStart: (event)->
|
104
|
-
|
107
|
+
touchStart =
|
108
|
+
x: event.touches[0].pageX
|
109
|
+
y: event.touches[0].pageY
|
110
|
+
time: new Date
|
111
|
+
if !@tapped
|
112
|
+
@tapped = setTimeout =>
|
113
|
+
@touchStart = touchStart
|
114
|
+
@touchDelta = {}
|
115
|
+
@tapped = null
|
116
|
+
, 300
|
117
|
+
else
|
118
|
+
clearTimeout @tapped
|
119
|
+
@tapped = null
|
120
|
+
@setState showTools: !@state.showTools
|
121
|
+
|
122
|
+
onTouchMove: (event)->
|
123
|
+
return if !@touchStart
|
124
|
+
return if ( event.touches.length > 1 || event.scale && event.scale != 1)
|
125
|
+
|
126
|
+
@touchDelta =
|
127
|
+
x: event.touches[0].pageX - @touchStart.x
|
128
|
+
y: event.touches[0].pageY - @touchStart.y
|
105
129
|
|
106
130
|
onTouchEnd: (event)->
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
131
|
+
return if !@touchStart
|
132
|
+
duration = new Date - @touchStart.time
|
133
|
+
isValid = Number(duration) < 250 && Math.abs(@touchDelta.x) > 20
|
134
|
+
if @touchDelta.x < 0
|
135
|
+
@onClickNext()
|
136
|
+
else
|
137
|
+
@onClickPrev()
|
138
|
+
@touchStart = null
|
114
139
|
|
115
140
|
onClickNext: ->
|
116
141
|
if @props.cards.query.hide != 'none' && @state.hiding
|
@@ -154,28 +179,37 @@ Flash = React.createClass
|
|
154
179
|
onMouseLeaveTools: ()->
|
155
180
|
@setState showTools: false
|
156
181
|
|
157
|
-
onClick: ->
|
158
|
-
@setState showTools: !@state.showTools
|
159
|
-
|
160
182
|
queryParam: (query)->
|
161
183
|
query = $.extend {}, @props.cards.query, query
|
162
184
|
$.param(query)
|
163
185
|
|
186
|
+
onClickMenuItem: (params)->
|
187
|
+
()=> window.location.hash = '#/?' + @queryParam(params)
|
188
|
+
|
164
189
|
render: ->
|
165
|
-
|
190
|
+
clearInterval @interval if @interval
|
191
|
+
if @props.cards.query.auto != 'off'
|
192
|
+
bpm = null
|
193
|
+
switch @props.cards.query.auto
|
194
|
+
when 'fast' then bpm = 90
|
195
|
+
when 'normal' then bpm = 60
|
196
|
+
when 'slow' then bpm = 30
|
197
|
+
console.log 'bpm!!!!!!!!!!!!!!!!!!!!!!!!!!', bpm
|
198
|
+
@interval = setInterval @onClickNext, 1000 * 60 / bpm
|
199
|
+
<div onTouchStart={@onTouchStart} onTouchMove={@onTouchMove} onTouchEnd={@onTouchEnd} style={overflow:'hidden',width:'100%',height:'100%'}>
|
166
200
|
<div style={position:'absolute',bottom:0,width:'100%',padding:'47px 0px 0px 0px'} onMouseOver={@onMouseOverTools} onMouseLeave={@onMouseLeaveTools}>
|
167
201
|
<span className={classnames("pull-right":true, 'carte-hidden': !@state.showTools)}>
|
168
202
|
<ButtonGroup>
|
169
203
|
<DropdownButton bsSize='large' bsStyle='default' title={'Auto: ' + @props.cards.query.auto} dropup pullRight className={classnames('open': @state.menuOpen)}>
|
170
|
-
<MenuItem href={
|
171
|
-
<MenuItem href={
|
172
|
-
<MenuItem href={
|
173
|
-
<MenuItem href={
|
204
|
+
<MenuItem href={"#/?" + @queryParam(auto: "off")} eventKey='1'>off</MenuItem>
|
205
|
+
<MenuItem href={"#/?" + @queryParam(auto: "fast")} eventKey='2'>fast</MenuItem>
|
206
|
+
<MenuItem href={"#/?" + @queryParam(auto: "normal")} eventKey='3'>normal</MenuItem>
|
207
|
+
<MenuItem href={"#/?" + @queryParam(auto: "slow")} eventKey='4'>slow</MenuItem>
|
174
208
|
</DropdownButton>
|
175
209
|
<DropdownButton bsSize='large' bsStyle='default' title={'Hide: ' + @props.cards.query.hide} dropup pullRight className={classnames('open': @state.menuOpen)}>
|
176
|
-
<MenuItem href={
|
177
|
-
<MenuItem href={
|
178
|
-
<MenuItem href={
|
210
|
+
<MenuItem href={"#/?" + @queryParam(hide: "none")} eventKey='1'>none</MenuItem>
|
211
|
+
<MenuItem href={"#/?" + @queryParam(hide: "title")} eventKey='2'>title</MenuItem>
|
212
|
+
<MenuItem href={"#/?" + @queryParam(hide: "content")} eventKey='3'>content</MenuItem>
|
179
213
|
</DropdownButton>
|
180
214
|
<Button bsSize='large' href={@closeLink()}><strong>×</strong></Button>
|
181
215
|
</ButtonGroup>
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carte-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tily
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|