Skip to content

Commit

Permalink
Diff marker; Numerous bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Staal committed Jan 27, 2013
1 parent 6e1ff7d commit a5b35e6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions lib/foundry-xray/app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Application
@title = $('#title')
@transform = $('#transform')
@selector = $('#functions select')
@diff = $('#diff')

@zoomButton = $('#zoom button')

Expand Down Expand Up @@ -61,6 +62,7 @@ class Application
@timeline.show()
@title.removeClass('error')
@transform.removeClass('active').html('')
@diff.html('')

input = @data[@currentFunction]

Expand All @@ -72,6 +74,7 @@ class Application
@drawer = new Drawer(new Graph(@input))

@title.html @input.function.title()
@diff.html "~ " + @input.previousState.cursor if @input.previousState?.cursor?

@renewZoomer()
@renewSelector()
Expand Down
12 changes: 8 additions & 4 deletions lib/foundry-xray/app/assets/javascripts/lib/input.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class @Input
x.id < @events.length-1

@reset()
@skipState = true

reset: ->
@types = Object.extended()
Expand All @@ -54,9 +53,14 @@ class @Input

rewind: (to) ->
return if to == @cursor
@previousState = new InputState(@) unless @skipState
@skipState = false
@reset() if to < @cursor

if to < @cursor
delete @previousState
@reset()
else
@previousState = new InputState(@)

@reset()
@increment(to)

increment: (to) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class @InputState
constructor: (input) ->
@blocks = Object.extended()
@cursor = input.cursor

input.blocksMap.each (bname, id) =>
@blocks[bname] = input.blocks[id].instructions.map (x) ->
Expand Down
8 changes: 7 additions & 1 deletion lib/foundry-xray/app/assets/stylesheets/app.css.sass
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,14 @@ html
border-radius: 5px
border: 1px solid #aaaaaa

#diff
font-size: 10px
display: block
text-align: center
margin-top: 2px

.slider
margin-top: 20px
margin-top: 10px
margin-left: 6px
margin-bottom: 20px
width: 40px
Expand Down
1 change: 1 addition & 0 deletions lib/foundry-xray/app/views/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
%button.next
&uarr;
%input{:type => 'text', :size => 3, :value => 0}
%span#diff
.slider
#transforms
%button.prev
Expand Down

0 comments on commit a5b35e6

Please sign in to comment.