puts status in header

This commit is contained in:
Torsten Ruger 2018-04-17 18:49:00 +03:00
parent ff3990841b
commit 88e49afb60
5 changed files with 12 additions and 12 deletions

View File

@ -15,19 +15,19 @@ body
.classes .classes
@include span(12%) @include span(12%)
.source_view .source_view
@include span(23%) @include span(24%)
.instruction_view .instruction_view
@include span(33%) @include span(30%)
.status_view .status_view
@include span(13%) @include span(15%)
line-height : 1.25em line-height : 1.25em
.header_state
color: #53a5ff
.labels_view .labels_view
@include span(1) @include span(1)

View File

@ -10,7 +10,7 @@ body
width: 190px width: 190px
border-radius: 8px border-radius: 8px
background: black background: black
border: 3px solid #C3D46A border: 2px solid #C3D46A
#nav li /* all list items */ #nav li /* all list items */

View File

@ -12,5 +12,5 @@ run Opal::Sprockets::Server.new { |s|
s.append_path 'assets' s.append_path 'assets'
s.debug = !ENV["DEBUG"].nil? s.debug = !ENV["DEBUG"].nil?
s.index_path = "index.html.erb" s.index_path = "index.html.erb"
s.sprockets.cache = Sprockets::Cache::MemoryStore.new(10000) s.sprockets.cache = Sprockets::Cache::MemoryStore.new(50000)
} }

View File

@ -27,7 +27,7 @@ class ElementView
# second argument is optional, but if given will be added as text (content) to the newly # second argument is optional, but if given will be added as text (content) to the newly
# created Element # created Element
# return the new Element, which is not linked into the dom at that point (see << and add*) # return the new Element, which is not linked into the dom at that point (see << and add*)
def div name_class = "div" , text = nil def div(name_class = "div" , text = nil)
name , clazz = name_class.split(".") name , clazz = name_class.split(".")
name = "div" if name.empty? name = "div" if name.empty?
element = $document.create_element(name) element = $document.create_element(name)

View File

@ -8,16 +8,16 @@ class StatusView < ElementView
end end
def draw def draw
header = div("h4" , "Interpreter" )
header << div("span.header_state" , state_text)
@element = div(".status_view") << @element = div(".status_view") <<
div("h4" , "Interpreter" ) << header <<
div("button.next" , "Next") << div("button.next" , "Next") <<
div("button.run" , "Run") << div("button.run" , "Run") <<
div("button.wizz" , "Wizz") << div("button.wizz" , "Wizz") <<
div( "br") << div( "br") <<
div("span.clock" , clock_text) << div("span.clock" , clock_text) <<
div( "br") << div( "br") <<
div("span.state" , state_text) <<
div( "br") <<
div("span.flags" , flags_text) << div("span.flags" , flags_text) <<
div( "br" , "Stdout") << div( "br" , "Stdout") <<
div("span.stdout") div("span.stdout")
@ -55,7 +55,7 @@ class StatusView < ElementView
end end
def state_text def state_text
"State #{@interpreter.state}" " (#{@interpreter.state})"
end end
def flags_text def flags_text