From 509aff95521af3756b55bd01f84457648164d222 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 6 Apr 2018 13:03:39 +0300 Subject: [PATCH] show source better still wip --- config.ru | 2 +- lib/views/instruction_view.rb | 3 ++- lib/views/object_view.rb | 2 +- lib/views/source_view.rb | 14 +++++++------- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/config.ru b/config.ru index a2463e9..7f20042 100644 --- a/config.ru +++ b/config.ru @@ -25,7 +25,7 @@ class DebugServer < Opal::Server end end -run Opal::Server.new { |s| +run Opal::Sprockets::Server.new { |s| s.main = 'debugger.js.rb' s.append_path 'lib' s.append_path 'assets' diff --git a/lib/views/instruction_view.rb b/lib/views/instruction_view.rb index ebf55af..c98338d 100644 --- a/lib/views/instruction_view.rb +++ b/lib/views/instruction_view.rb @@ -36,7 +36,8 @@ class InstructionView < ListView def instruction_text return "" unless @interpreter.instruction - @interpreter.instruction.to_s + text = @interpreter.instruction.to_s + text.split("(").first end end diff --git a/lib/views/object_view.rb b/lib/views/object_view.rb index 872256b..3826311 100644 --- a/lib/views/object_view.rb +++ b/lib/views/object_view.rb @@ -45,7 +45,7 @@ class ObjectView < ListView end def content_elements - fields = [ConstantView.new("li" , "----------------------------------")] + fields = [ConstantView.new("li" , "---------------------------------")] object = @object if object and ! object.is_a?(String) object.get_instance_variables.each do |variable| diff --git a/lib/views/source_view.rb b/lib/views/source_view.rb index 752a177..a239425 100644 --- a/lib/views/source_view.rb +++ b/lib/views/source_view.rb @@ -20,13 +20,13 @@ class SourceView < ElementView update_method case i.source when Mom::Instruction - id = i.source.object_id.to_s(16) - if e = @text.at_css("#i#{id}") - if (old = @text.at_css(".fade_in")) - old.remove_class("fade_in") - end - e.add_class "fade_in" - end + @ticker.text = i.source.class.name + # if e = @text.at_css("#i#{id}") + # if (old = @text.at_css(".fade_in")) + # old.remove_class("fade_in") + # end + # e.add_class "fade_in" + # end when String @ticker.text = i.source when Risc::Instruction