Move player overlays one level up

openid
Marcin Kulik 13 years ago
parent e425441c05
commit 1d9bded8ef

@ -1,4 +1,6 @@
class AsciiIo.PlayerView extends Backbone.View class AsciiIo.PlayerView extends Backbone.View
events:
'click .start-prompt': 'onStartPromptClick'
initialize: (options) -> initialize: (options) ->
@movie = new AsciiIo.Movie( @movie = new AsciiIo.Movie(
@ -21,13 +23,17 @@ class AsciiIo.PlayerView extends Backbone.View
createChildViews: -> createChildViews: ->
@$el.append(@rendererView.$el) @$el.append(@rendererView.$el)
@rendererView.afterInsertedToDom() @rendererView.afterInsertedToDom()
@rendererView.showLoadingIndicator() @showLoadingIndicator()
@hudView = new AsciiIo.HudView() @hudView = new AsciiIo.HudView()
@$el.append(@hudView.$el) @$el.append(@hudView.$el)
onStartPromptClick: ->
@hideToggleOverlay()
$(@rendererView.el).click()
onMovieLoaded: (asciicast) -> onMovieLoaded: (asciicast) ->
@rendererView.hideLoadingIndicator() @hideLoadingIndicator()
@hudView.setDuration(asciicast.get('duration')) @hudView.setDuration(asciicast.get('duration'))
@bindEvents() @bindEvents()
@ -35,7 +41,7 @@ class AsciiIo.PlayerView extends Backbone.View
if @options.autoPlay if @options.autoPlay
@movie.play() @movie.play()
else else
@rendererView.showToggleOverlay() @showToggleOverlay()
bindEvents: -> bindEvents: ->
@rendererView.on 'terminal-click', => @rendererView.on 'terminal-click', =>
@ -65,3 +71,15 @@ class AsciiIo.PlayerView extends Backbone.View
@movie.on 'movie-finished', => @movie.on 'movie-finished', =>
@rendererView.stopCursorBlink() @rendererView.stopCursorBlink()
@hudView.setProgress(100) @hudView.setProgress(100)
showLoadingIndicator: ->
@$el.append('<div class="loading">')
hideLoadingIndicator: ->
@$('.loading').remove()
showToggleOverlay: ->
@$el.append('<div class="start-prompt">')
hideToggleOverlay: ->
@$('.start-prompt').remove()

@ -10,7 +10,6 @@ class AsciiIo.Renderer.Base extends Backbone.View
onClick: -> onClick: ->
@trigger('terminal-click') @trigger('terminal-click')
@hideToggleOverlay()
render: (changes, cursorX, cursorY) -> render: (changes, cursorX, cursorY) ->
for n, fragments of changes for n, fragments of changes
@ -22,18 +21,6 @@ class AsciiIo.Renderer.Base extends Backbone.View
afterInsertedToDom: -> afterInsertedToDom: ->
showLoadingIndicator: ->
@$el.append('<div class="loading">')
hideLoadingIndicator: ->
@$('.loading').remove()
showToggleOverlay: ->
@$el.append('<div class="start-prompt">')
hideToggleOverlay: ->
@$('.start-prompt').remove()
showCursor: (show) -> showCursor: (show) ->
throw '#showCursor not implemented' throw '#showCursor not implemented'

@ -379,5 +379,10 @@ class AsciiIo.VT
@buffer.setCharset('special') @buffer.setCharset('special')
# References:
# http://en.wikipedia.org/wiki/ANSI_escape_code
# http://ttssh2.sourceforge.jp/manual/en/about/ctrlseq.html
# http://real-world-systems.com/docs/ANSIcode.html
# http://www.shaels.net/index.php/propterm/documents # http://www.shaels.net/index.php/propterm/documents
# http://manpages.ubuntu.com/manpages/lucid/man7/urxvt.7.html # http://manpages.ubuntu.com/manpages/lucid/man7/urxvt.7.html
# http://vt100.net/docs/vt102-ug/chapter5.html

@ -49,30 +49,6 @@ $color5: #EDC951;
color: #ccc; color: #ccc;
cursor: pointer; cursor: pointer;
.loading {
background-image: url(image-path('loader.gif'));
background-repeat: no-repeat;
background-position: center;
z-index: 10;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.start-prompt {
background-image: url(image-path('play-button-1.png'));
background-repeat: no-repeat;
background-position: center;
z-index: 20;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.line { .line {
/* background-color: black;*/ /* background-color: black;*/
/* padding: 0;*/ /* padding: 0;*/
@ -88,6 +64,31 @@ $color5: #EDC951;
} }
} }
.loading {
background-image: url(image-path('loader.gif'));
background-repeat: no-repeat;
background-position: center;
z-index: 10;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.start-prompt {
background-image: url(image-path('play-button-1.png'));
background-repeat: no-repeat;
background-position: center;
z-index: 20;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
cursor: pointer;
}
.hud { .hud {
background-color: #333; background-color: #333;
opacity: 0; opacity: 0;

Loading…
Cancel
Save