introduce base classes

This commit is contained in:
Torsten Ruger 2015-08-20 14:48:45 +02:00
parent e7e85b8d73
commit ef60cbdc45
4 changed files with 46 additions and 5 deletions

View File

@ -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
View File

@ -0,0 +1,6 @@
class ElementView
def initialize
end
end

9
lib/list_view.rb Normal file
View File

@ -0,0 +1,9 @@
require "element_view"
class ListView < ElementView
def initialize
end
end

View File

@ -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