rsence-pre 3.0.0.11 → 3.0.0.12

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: e9b6d8279d4e6c4428be24337adf68655670640e
4
- data.tar.gz: 0a2beb7fecc41ddb17883bd6b41bcebebc85eed1
3
+ metadata.gz: df0a7c946c4da900e778339d4f35f828eae3d727
4
+ data.tar.gz: 5ffbc7db3fca63680c7158a1dcc93fae3840ed44
5
5
  SHA512:
6
- metadata.gz: 44011410d1f605a478e1e29ac4116c6235326ac5e0b80c33fe0624b2f1b6763828e3dbb600ac61a34f2bd1f90f145fd66d9b1dab1602047b7bdbf5bad5c34ecf
7
- data.tar.gz: 074b547410ecac12f7ba3f9600aacbe4f966c41f6b54541f1c8fbe6d3c1bf8932324aa6a484358e117a2d0500871c7dad0d376d3a1d3e78f4c8f3759741772f1
6
+ metadata.gz: b20f6de1442b949062871202b89e2d935065f4e53661aefb78ed48d4481cbb036da98af5602c01e92a0857ab71ad42dfef7a2cb2c28fadac874f43c30ce8b36e
7
+ data.tar.gz: 1c10e07f9510879752ed756e1511035361614e7d2ab3f8eb3abf897e379974c14096f81c3d0efea20eff8d2040cb0c9d2d1085584787c2c2e1084a16997c2dec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.0.11.pre
1
+ 3.0.0.12.pre
@@ -71,6 +71,10 @@
71
71
  - mediaelement_resources # MediaElement resources (swf and xap)
72
72
  - mediaelement_defaults # default settings for MediaElement
73
73
 
74
+ mediaplayers:
75
+ - audioplayer
76
+ - videoplayer
77
+
74
78
  # codemirror:
75
79
  # - codemirror # CodeMirror
76
80
 
@@ -165,6 +169,7 @@
165
169
  media:
166
170
  - mejs_theme
167
171
  - mediaelement
172
+ - mediaplayers
168
173
  # code:
169
174
  # - codemirror
170
175
  std_widgets:
@@ -25,7 +25,7 @@
25
25
  #{this.gradientCSS('#d6d6d6',[66,'#d0d0d0'],[71,'#d3d3d3'],'#cccccc')}
26
26
  }
27
27
  .default > .button_control > .button_label {
28
- left: 6px; right: 6px; top: 2px; bottom: auto;
28
+ left: 0; right: 0; top: 2px; bottom: auto;
29
29
  text-align: center; vertical-align: middle;
30
30
  white-space: nowrap;
31
31
  overflow: hidden;
@@ -18,7 +18,7 @@
18
18
  -webkit-box-sizing: border-box;
19
19
  box-sizing: border-box;
20
20
  }
21
- .default.textcontrol > .input_parent > .input::-ms-clear {
21
+ .default.textcontrol.ie > .input_parent > .input::-ms-clear {
22
22
  display: none;
23
23
  }
24
24
  .default.textcontrol.disabled > .input_parent > .input { color: #333; }
@@ -291,7 +291,7 @@ ELEM = HClass.extend
291
291
  unless y?
292
292
  [ x, y ] = x
293
293
  @setStyle( _id, 'left', x+'px' )
294
- @setStyle( _id, 'top', x+'px' )
294
+ @setStyle( _id, 'top', y+'px' )
295
295
 
296
296
  ###
297
297
  Shortcut for filling parent dimensions with optional offset(s)
@@ -0,0 +1,157 @@
1
+ HAudioPlayer = HControl.extend
2
+ # componentName: 'audioplayer'
3
+ controlDefaults: HControlDefaults.extend
4
+ autoPlay: false
5
+ skipSeconds: 2.0
6
+ playLabel: '►'
7
+ skipBackLabel: '◀◀'
8
+ pauseLabel: '❙❙'
9
+ stopLabel: '<div class="player_stop">&#9632;</div>'
10
+ rewindLabel: '<span class="player_rewind0">&#9614;</span><span class="player_rewind1">&#9664;</span><span class="player_rewind2">&#9664;</span>'
11
+ playerFeatures: [
12
+ # 'play'
13
+ # 'pause'
14
+ # 'stop'
15
+ # 'rewind'
16
+ # 'skipback'
17
+ # 'playPause'
18
+ 'playStop'
19
+ # 'mute'
20
+ # 'volume'
21
+ # 'seek'
22
+ # 'position'
23
+ # 'timeLeft'
24
+ ]
25
+ play: ->
26
+ @_mediaElement.play() if @_mediaElement?
27
+ @_playStopButton.setLabel(@options.stopLabel) if @_playStopButton?
28
+ @_playPauseButton.setLabel(@options.pauseLabel) if @_playPauseButton?
29
+ pause: ->
30
+ @_mediaElement.pause() if @_mediaElement?
31
+ _playLabel = @options.playLabel
32
+ @_playStopButton.setLabel(_playLabel) if @_playStopButton?
33
+ @_playPauseButton.setLabel(_playLabel) if @_playPauseButton?
34
+ seek: (_time)->
35
+ @_mediaElement.setCurrentTime(_time) if @_mediaElement?
36
+ stop: ->
37
+ @seek(0)
38
+ @pause()
39
+ rewind: ->
40
+ @seek(0)
41
+ skipBack: ->
42
+ @seek()
43
+ idle: ->
44
+ if @playing and @_mediaElement?
45
+ console.log('position:',@_mediaElement.currentPosition())
46
+ playStop: ->
47
+ if @playing
48
+ @stop()
49
+ else
50
+ @play()
51
+ @playing = !@playing
52
+ playPause: ->
53
+ if @playing
54
+ @pause()
55
+ else
56
+ @play()
57
+ @_playPauseButton.setLabel(@options.pauseLabel)
58
+ @playing = !@playing
59
+ _createFeatures: ->
60
+ for _playerFeature in @options.playerFeatures
61
+ @_createRewindButton() if _playerFeature == 'rewind'
62
+ @_createPlayButton() if _playerFeature == 'play'
63
+ @_createPauseButton() if _playerFeature == 'pause'
64
+ @_createStopButton() if _playerFeature == 'stop'
65
+ @_createPlayStopButton() if _playerFeature == 'playStop'
66
+ @_createPlayPauseButton() if _playerFeature == 'playPause'
67
+ _createPlayButton: ->
68
+ [ x, y, w, h ] = @_playGeom
69
+ _opt = @options
70
+ _buttonLabel = _opt.playLabel
71
+ @_playButton = HButton.extend( click: ->@parent.play() ).new( [x,y,h,h], @,
72
+ label: _buttonLabel
73
+ enabled: false
74
+ )
75
+ @_playGeom[0] += @_playGeom[2]
76
+ _createPauseButton: ->
77
+ [ x, y, w, h ] = @_playGeom
78
+ _opt = @options
79
+ _buttonLabel = _opt.pauseLabel
80
+ @_pauseButton = HButton.extend( click: ->@parent.pause() ).new( [x,y,h,h], @,
81
+ label: _buttonLabel
82
+ enabled: false
83
+ )
84
+ @_playGeom[0] += @_playGeom[2]
85
+ _createStopButton: ->
86
+ [ x, y, w, h ] = @_playGeom
87
+ _opt = @options
88
+ _buttonLabel = _opt.stopLabel
89
+ @_stopButton = HButton.extend( click: ->@parent.stop() ).new( [x,y,h,h], @,
90
+ label: _buttonLabel
91
+ enabled: false
92
+ )
93
+ @_playGeom[0] += @_playGeom[2]
94
+ _createRewindButton: ->
95
+ [ x, y, w, h ] = @_playGeom
96
+ _opt = @options
97
+ _buttonLabel = _opt.rewindLabel
98
+ @_rewindButton = HButton.extend( click: ->@parent.rewind() ).new( [x,y,h,h], @,
99
+ label: _buttonLabel
100
+ enabled: false
101
+ )
102
+ @_playGeom[0] += @_playGeom[2]
103
+ _createPlayStopButton: ->
104
+ [ x, y, w, h ] = @_playGeom
105
+ _opt = @options
106
+ if @options.autoPlay
107
+ _buttonLabel = _opt.stopLabel
108
+ else
109
+ _buttonLabel = _opt.playLabel
110
+ @_playStopButton = HButton.extend( click: ->@parent.playStop() ).new( [x,y,h,h], @,
111
+ label: _buttonLabel
112
+ enabled: false
113
+ )
114
+ @_playGeom[0] += @_playGeom[2]
115
+ _createPlayPauseButton: ->
116
+ [ x, y, w, h ] = @_playGeom
117
+ _opt = @options
118
+ if @options.autoPlay
119
+ _buttonLabel = _opt.pauseLabel
120
+ else
121
+ _buttonLabel = _opt.playLabel
122
+ @_playPauseButton = HButton.extend( click: ->@parent.playPause() ).new( [x,y,h,h], @,
123
+ label: _buttonLabel
124
+ enabled: false
125
+ )
126
+ @_playGeom[0] += @_playGeom[2]
127
+ _enableAll: (_state)->
128
+ @_playStopButton.setEnabled(_state) if @_playStopButton?
129
+ @_playPauseButton.setEnabled(_state) if @_playPauseButton?
130
+ @_playButton.setEnabled(_state) if @_playButton?
131
+ @_pauseButton.setEnabled(_state) if @_pauseButton?
132
+ @_stopButton.setEnabled(_state) if @_stopButton?
133
+ @_rewindButton.setEnabled(_state) if @_rewindButton?
134
+ _mediaLoaded: (_mediaElement, _domObject)->
135
+ @playing = @options.autoPlay
136
+ @play() if @playing
137
+ @_enableAll( @enabled )
138
+ _mediaFailed: ->
139
+ console.log('HAudioPlayer media failure:',arguments)
140
+ die: ->
141
+ @stop()
142
+ ELEM.del(@_audioElementId)
143
+ @base()
144
+ extDraw: ->
145
+ _opt = @options
146
+ @_playGeom = [0,0,@rect.height,@rect.height]
147
+ @_mediaElement = null
148
+ @_createFeatures()
149
+ @_audioElementId = ELEM.make(@elemId,'audio',{attr:{src:@value}})
150
+ _audioElement = ELEM.get(@_audioElementId)
151
+ try
152
+ @_mediaElement = new MediaElement(_audioElement,
153
+ success: => @_mediaLoaded()
154
+ error: => @_mediaFailed()
155
+ )
156
+ catch e
157
+ console.log('MediaElement init error:',e)
@@ -0,0 +1,14 @@
1
+ .default > .button_control > .button_label > .player_stop {
2
+ margin-left: -0.05em; font-size: 1.4em; line-height: 1em;
3
+ }
4
+ .default > .button_control > .button_label > .player_rewind0,
5
+ .default > .button_control > .button_label > .player_rewind1,
6
+ .default > .button_control > .button_label > .player_rewind2 {
7
+ text-shadow: none;
8
+ }
9
+ .default > .button_control > .button_label > .player_rewind1 {
10
+ margin-left: -1.15em;
11
+ }
12
+ .default > .button_control > .button_label > .player_rewind2 {
13
+ margin-left: -0.6em;
14
+ }
@@ -1 +1 @@
1
- LOAD(-> mejs.MediaElementDefaults.pluginPath = HThemeManager.themePaths.mejs )
1
+ (-> mejs.MediaElementDefaults.pluginPath = HThemeManager.themePaths.mejs )()
@@ -1,6 +1,6 @@
1
1
 
2
2
  module RSence
3
-
3
+
4
4
  # Simple Request class, slightly more involved
5
5
  # than the Rack::Request it's extending.
6
6
  class Request < Rack::Request
@@ -20,38 +20,26 @@ module RSence
20
20
  def unparsed_uri
21
21
  return @header['request-uri']
22
22
  end
23
+ @@env_transl = {
24
+ 'SERVER_NAME' => 'server-name',
25
+ 'PATH_INFO' => 'path-info',
26
+ 'SERVER_PROTOCOL' => 'server-protocol',
27
+ 'REQUEST_PATH' => 'request-path',
28
+ 'SERVER_SOFTWARE' => 'server-software',
29
+ 'REMOTE_ADDR' => 'remote-addr',
30
+ 'REQUEST_URI' => 'request-uri',
31
+ 'SERVER_PORT' => 'server-port',
32
+ 'QUERY_STRING' => 'query-string',
33
+ 'REQUEST_METHOD' => 'request-method'
34
+ }
23
35
  def env2header
24
- [ ['SERVER_NAME', 'server-name'],
25
- ['HTTP_USER_AGENT', 'user-agent'],
26
- ['HTTP_ACCEPT_ENCODING', 'accept-encoding'],
27
- ['PATH_INFO', 'path-info'],
28
- ['HTTP_HOST', 'host'],
29
- ['HTTP_ACCEPT_LANGUAGE', 'accept-language'],
30
- ['SERVER_PROTOCOL', 'server-protocol'],
31
- ['REQUEST_PATH', 'request-path'],
32
- ['HTTP_KEEP_ALIVE', 'keep-alive'],
33
- ['SERVER_SOFTWARE', 'server-software'],
34
- ['REMOTE_ADDR', 'remote-addr'],
35
- ['HTTP_REFERER', 'referer'],
36
- ['HTTP_VERSION', 'version'],
37
- ['HTTP_ACCEPT_CHARSET', 'accept-charset'],
38
- ['REQUEST_URI', 'request-uri'],
39
- ['SERVER_PORT', 'server-port'],
40
- ['QUERY_STRING', 'query-string'],
41
- ['HTTP_ACCEPT', 'accept'],
42
- ['REQUEST_METHOD', 'request-method'],
43
- ['HTTP_CONNECTION', 'connection'],
44
- ['HTTP_SOAPACTION', 'soapaction'],
45
- ['HTTP_FORWARDED_HOST', 'forwarded-host']
46
- ].each do |env_key,header_key|
47
- if @env.has_key?(env_key)
48
- @header[header_key] = @env[env_key]
49
- end
50
- if env_key.start_with?( 'HTTP_' )
51
- x_env_key = "HTTP_X#{env_key[4..-1]}"
52
- if @env.has_key?( x_env_key )
53
- @header["x-#{header_key}"] = @env[ x_env_key ]
54
- end
36
+ @env.each do |env_key,env_val|
37
+ if @@env_transl.has_key?(env_key)
38
+ http_key = @@env_transl[env_key]
39
+ @header[http_key] = @env[env_key]
40
+ elsif env_key.start_with?( 'HTTP_' )
41
+ http_key = env_key[4..-1].gsub(/_([A-Z0-9]+)/) {|m|'-'+$1.downcase}[1..-1]
42
+ @header[http_key] = @env[env_key]
55
43
  end
56
44
  end
57
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence-pre
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.11
4
+ version: 3.0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Riassence Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-16 00:00:00.000000000 Z
12
+ date: 2013-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rsence-deps
@@ -272,6 +272,9 @@ files:
272
272
  - client/js/lists/propertylist/propertylist.js
273
273
  - client/js/lists/propertylist/propertylisteditor/propertylisteditor.js
274
274
  - client/js/lists/radiobuttonlist/radiobuttonlist.js
275
+ - client/js/media/audioplayer/audioplayer.coffee
276
+ - client/js/media/audioplayer/themes/default/audioplayer.css
277
+ - client/js/media/audioplayer/themes/default/audioplayer.html
275
278
  - client/js/media/mediaelement/mediaelement.js
276
279
  - client/js/media/mediaelement_defaults/mediaelement_defaults.coffee
277
280
  - client/js/media/mediaelement_resources/mediaelement_resources.js