introduce base classes
This commit is contained in:
parent
e7e85b8d73
commit
ef60cbdc45
@ -1,4 +1,4 @@
|
||||
class ClassView
|
||||
class ClassView < ListView
|
||||
|
||||
def initialize
|
||||
|
||||
@ -22,4 +22,27 @@ class ClassView
|
||||
end
|
||||
vars
|
||||
end
|
||||
|
||||
def draw
|
||||
div.classes do
|
||||
h4 {"Classes"}
|
||||
ul.nav do
|
||||
#{{page._classes.each do |clas| }}
|
||||
li do
|
||||
a { "me "}
|
||||
# <a href="#">{{ clas._name }}</a>
|
||||
# {{ unless variables(clas).empty? }}
|
||||
# <ul>
|
||||
# {{variables(clas).each do |var| }}
|
||||
# <li>
|
||||
# <a href="#">{{var}}</a>
|
||||
# </li>
|
||||
# {{ end }}
|
||||
# </ul>
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
6
lib/element_view.rb
Normal file
6
lib/element_view.rb
Normal file
@ -0,0 +1,6 @@
|
||||
class ElementView
|
||||
|
||||
def initialize
|
||||
|
||||
end
|
||||
end
|
9
lib/list_view.rb
Normal file
9
lib/list_view.rb
Normal file
@ -0,0 +1,9 @@
|
||||
require "element_view"
|
||||
|
||||
class ListView < ElementView
|
||||
|
||||
def initialize
|
||||
|
||||
end
|
||||
|
||||
end
|
@ -3,13 +3,13 @@ require 'browser'
|
||||
require 'native'
|
||||
require "salama"
|
||||
require "interpreter/interpreter"
|
||||
|
||||
require "list_view"
|
||||
require_relative "class_view"
|
||||
#require_relative "registers_view"
|
||||
#require_relative "object_view"
|
||||
#require_relative "space_view"
|
||||
|
||||
class MainView
|
||||
class MainView < ListView
|
||||
|
||||
def initialize
|
||||
machine = Virtual.machine.boot
|
||||
@ -17,15 +17,18 @@ class MainView
|
||||
Virtual::Compiler.compile( code , machine.space.get_main )
|
||||
machine.run_before "Register::CallImplementation"
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@parent = $document.body
|
||||
puts @parent.parent.name
|
||||
draw
|
||||
end
|
||||
|
||||
def draw
|
||||
DOM {
|
||||
node = DOM {
|
||||
div.info {
|
||||
span.red "I'm all cooked up."
|
||||
}
|
||||
}.append_to($document.body)
|
||||
}
|
||||
node.append_to(@parent)
|
||||
end
|
||||
def no
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user