diff --git a/lib/class_view.rb b/lib/class_view.rb index 458efac..7dc921f 100644 --- a/lib/class_view.rb +++ b/lib/class_view.rb @@ -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 "} + # {{ clas._name }} + # {{ unless variables(clas).empty? }} + # + end + end + end + end + end + end diff --git a/lib/element_view.rb b/lib/element_view.rb new file mode 100644 index 0000000..a8bdad9 --- /dev/null +++ b/lib/element_view.rb @@ -0,0 +1,6 @@ +class ElementView + + def initialize + + end +end diff --git a/lib/list_view.rb b/lib/list_view.rb new file mode 100644 index 0000000..5d7930e --- /dev/null +++ b/lib/list_view.rb @@ -0,0 +1,9 @@ +require "element_view" + +class ListView < ElementView + + def initialize + + end + +end diff --git a/lib/main_view.rb b/lib/main_view.rb index e57e891..4010f52 100644 --- a/lib/main_view.rb +++ b/lib/main_view.rb @@ -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