diff --git a/SuperScriptViewer/SuperScriptViewer.py b/SuperScriptViewer/SuperScriptViewer.py index 07388bc..bd898c7 100644 --- a/SuperScriptViewer/SuperScriptViewer.py +++ b/SuperScriptViewer/SuperScriptViewer.py @@ -4,7 +4,7 @@ import os import sys # debug use -os.remove('decorate.db') +# os.remove('decorate.db') print('Super Script View') if not os.path.isfile("decorate.db"): diff --git a/SuperScriptViewer/static/site.css b/SuperScriptViewer/static/site.css index 63b0e3e..f6d117f 100644 --- a/SuperScriptViewer/static/site.css +++ b/SuperScriptViewer/static/site.css @@ -1,8 +1,10 @@ +/*navigation style*/ p.hamburger { margin: 0 5px 0 5px; padding: 0; } +/*graph style*/ div.block-target { position: absolute; background: green; @@ -81,4 +83,28 @@ div.cell-bio { text.link-delay { font-size: 12px; color: black; +} + +/*side panel style*/ +div.tabitem-activated { + background: #0000ff; +} +b.tabitem-activated { + color: white; +} + +div.tabitem-deactivated { + background: #ffffff00; +} +b.tabitem-deactivated { + color: black; +} + +pre { + border: 1px solid black; + border-radius: 2px; + padding: 5px; + margin: 5px; + background: #3f3f3f; + color: white; } \ No newline at end of file diff --git a/SuperScriptViewer/static/site.js b/SuperScriptViewer/static/site.js index 38f39b6..61840c1 100644 --- a/SuperScriptViewer/static/site.js +++ b/SuperScriptViewer/static/site.js @@ -1,4 +1,4 @@ -previousHighlight = "" +previousHighlight = ""; function highlightLink(target) { realTarget = ".target" + target @@ -56,18 +56,44 @@ function queryInfo(obj) { }, function(data, status) { //set id - $("#propertyWindow-id").text(obj); + $("#sidepanel-properties-id").text(obj); //set data - $("#propertyWindow-container").empty() + $("#sidepanel-properties-container").empty() for (var key in data) { - $("#propertyWindow-container").append("

" + key + ":
" + data[key] +"

") + $("#sidepanel-properties-container").append("

" + key + ":

" + data[key] +"

") } - - $("#propertyWindow-main").show(); }); } -function closePropertyWindow() { - $("#propertyWindow-main").hide(); +function sidePanelSwitcher(target) { + // 0->property; 1->display; 2->tools + //disable all + $("#sidepanel-properties").hide(); + $("#sidepanel-display").hide(); + $("#sidepanel-tools").hide(); + $(".tabitem").each(function() { + $(this).removeClass("tabitem-activated").addClass("tabitem-deactivated"); + }); + + switch (target) { + case 0: + $("#sidepanel-properties").show(); + $(".tabitem1").each(function() { + $(this).removeClass("tabitem-deactivated").addClass("tabitem-activated"); + }); + break; + case 1: + $("#sidepanel-display").show(); + $(".tabitem2").each(function() { + $(this).removeClass("tabitem-deactivated").addClass("tabitem-activated"); + }); + break; + case 2: + $("#sidepanel-tools").show(); + $(".tabitem3").each(function() { + $(this).removeClass("tabitem-deactivated").addClass("tabitem-activated"); + }); + break; + } } diff --git a/SuperScriptViewer/templates/viewer.html b/SuperScriptViewer/templates/viewer.html index 3603054..9f4a43e 100644 --- a/SuperScriptViewer/templates/viewer.html +++ b/SuperScriptViewer/templates/viewer.html @@ -9,9 +9,9 @@ - -
-
+ +
+

Script Hierarchy

@@ -24,70 +24,97 @@

{{ hamburgerCurrent|e }}

-
- -
-
-
-
- {# blocks content #} - {% for i in blocks %} -
- {% if i[4] != '{}' %} -
- {% endif %} - {% for pin in pinDecoder(i[5]) %} -
- {% endfor %} - {% for pout in pinDecoder(i[6]) %} -
- {% endfor %} - {% for bin in pinDecoder(i[7]) %} -
- {% endfor %} - {% for bout in pinDecoder(i[8]) %} -
+ +
+
+ {# blocks content #} + {% for i in blocks %} +
+ {% if i[4] != '{}' %} +
+ {% endif %} + {% for pin in pinDecoder(i[5]) %} +
+ {% endfor %} + {% for pout in pinDecoder(i[6]) %} +
+ {% endfor %} + {% for bin in pinDecoder(i[7]) %} +
+ {% endfor %} + {% for bout in pinDecoder(i[8]) %} +
+ {% endfor %} + + {% if i[13] != -1 %} +

{{ i[2]|e }}

+ {% else %} +

{{ i[2]|e }}

+ {% endif %} +

{{ i[3]|e }}

+
{% endfor %} - {% if i[13] != -1 %} -

{{ i[2]|e }}

- {% else %} -

{{ i[2]|e }}

- {% endif %} -

{{ i[3]|e }}

+ {# cells content #} + {% for i in cells %} +
+ {% endfor %} + + + {# links content #} + {% for i in links %} + {% if i[1] == -2 %} + + {% elif i[1] == -1 %} + + {% else %} + + {{ i[1] }} + {% endif %} + {% endfor %} +
- {% endfor %} - - {# cells content #} - {% for i in cells %} -
- {% endfor %} - - - {# links content #} - {% for i in links %} - {% if i[1] == -2 %} - - {% elif i[1] == -1 %} - - {% else %} - - {{ i[1] }} - {% endif %} - {% endfor %} -
-