more and meaningful tooltips

This commit is contained in:
Torsten Ruger 2015-08-10 22:29:49 +03:00
parent 8ed2a03ea9
commit 7b82ff31dd
5 changed files with 61 additions and 11 deletions

View File

@ -7,12 +7,19 @@
.tooltip span {
z-index:10;display:none; padding:14px 20px;
margin-top:-30px; margin-left:28px;
width:300px; line-height:16px;
width:150px; line-height:16px;
}
.tooltip:hover span{
.tooltip:hover span {
display:inline; position:absolute; color:#111;
border:1px solid #DCA; background:#fffAF0;}
.callout {z-index:20;position:absolute;top:30px;border:0;left:-12px;}
border:1px solid #DCA; background:#fffAF0;
}
.callout {
z-index:20;
position:absolute;
top:30px;
border:0;
left:-12px;
}
/*CSS3 extras*/
.tooltip span
@ -28,8 +35,13 @@ $susy: (
.debugger-view { @include container(90%); }
.classes { @include span(3); }
.classes {
@include span(3);
}
.one-class {
margin: 10px;
}
.file-view {
@include span(4);
margin: span(1);

View File

@ -5,12 +5,28 @@ module Main
super(*args)
page._classes!.clear
all = []
Virtual.machine.space.classes.each do |name , claz|
next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name
all << name
end
all.sort.each do |name|
c = Volt::Model.new :name => name
page._classes << c
end
end
def variables(clas_model)
self.variables(clas_model.name)
end
def self.variables(clas_name)
layout = Virtual.machine.space.get_class_by_name(clas_name).object_layout
vars = []
layout.object_instance_names.each do |name|
vars << name
end
vars
end
end
end

View File

@ -23,5 +23,25 @@ module Main
var.class.name.split("::").last[0,2]
end
def variables val
name = val.class.name.split("::").last
ClassesController.variables(name)
end
def content(id)
object = Virtual.machine.objects[id]
fields = []
if object and ! object.is_a?(String)
clazz = object.class.name.split("::").last
fields << "#{clazz}:#{object.internal_object_length}"
fields << "--------------------"
object.get_instance_variables.each do |variable|
f = object.get_instance_variable(variable)
fields << "#{f.class.name.split('::').last} : #{f.object_id}"
end
end
fields
end
end
end

View File

@ -5,8 +5,13 @@
<div class="classes">
<h4> Classes </h4>
{{page._classes.each do |clas| }}
<div class="one-class">
<div class="one-class tooltip">
{{ clas._name }}
<span>
{{clas._name}}<br/>
-------------- <br/>
{{variables(clas).join("\n") }}
</span>
</div>
{{end}}
</div>

View File

@ -20,16 +20,13 @@
<div class="field tooltip">
{{index}}{{marker(attribute)}}
<span>
{{attribute.class}}
{{variables(attribute).join("\n")}}
</span>
</div>
<div class="value tooltip">
{{attribute.object_id}}
<span>
long text with initlong text with initlong <br/>
text with initlong text with initlong
<h3>text with initlong </h3>
text with initlong text with init
{{content(attribute.object_id).join("\n")}}
</span>
</div>
</div>