diff --git a/SuperScriptViewer/ServerCore.py b/SuperScriptViewer/ServerCore.py index b5e3a95..f7e7916 100644 --- a/SuperScriptViewer/ServerCore.py +++ b/SuperScriptViewer/ServerCore.py @@ -203,14 +203,14 @@ def infoHandle(target, tag): data = {} existedSet = set() - if tag == 0: + if tag == '0': # call from cell cur.execute("SELECT * FROM info WHERE [target] == ?", (target, )) - elif tag == 1: + elif tag == '1': # call from bb cur.execute("SELECT * FROM info WHERE [attach_bb] == ?", (target, )) else: - return [] + return {} # get data for i in cur.fetchall(): if i[0] in existedSet: @@ -220,7 +220,7 @@ def infoHandle(target, tag): data[i[0]] = { 'name': i[3], 'is_setting': True if i[2] != 0 else False, - 'data': [] + 'data': [(i[4], i[5])] } return data diff --git a/SuperScriptViewer/SuperScriptViewer.py b/SuperScriptViewer/SuperScriptViewer.py index 1436297..c56ec5d 100644 --- a/SuperScriptViewer/SuperScriptViewer.py +++ b/SuperScriptViewer/SuperScriptViewer.py @@ -6,14 +6,14 @@ import sys import getopt try: - opts, args = getopt.getopt(sys.argv, "hi:o:e:f") + opts, args = getopt.getopt(sys.argv[1:], "hi:o:e:f") except getopt.GetoptError: print('Wrong arguments!') - print('python SuperScriptViewer.py -i -o -e -f') + print('python SuperScriptViewer.py -i -o -e -c -f') sys.exit(1) for opt, arg in opts: if opt == '-h': - print('python SuperScriptViewer.py -i -o -e -f') + print('python SuperScriptViewer.py -i -o -e -c -f') sys.exit(0) elif opt == '-i': CustomConfig.export_db = arg @@ -21,6 +21,8 @@ for opt, arg in opts: CustomConfig.decorated_db = arg elif opt == '-e': CustomConfig.env_db = arg + elif opt == '-c': + CustomConfig.database_encoding = arg elif opt == '-f': CustomConfig.force_regenerate = True diff --git a/SuperScriptViewer/SuperScriptViewer.pyproj b/SuperScriptViewer/SuperScriptViewer.pyproj index 34cc9c7..0b4eb58 100644 --- a/SuperScriptViewer/SuperScriptViewer.pyproj +++ b/SuperScriptViewer/SuperScriptViewer.pyproj @@ -12,8 +12,7 @@ SuperScriptViewer SuperScriptViewer Standard Python launcher - - + -f False diff --git a/SuperScriptViewer/static/env.js b/SuperScriptViewer/static/env.js index ffbfd23..5cf824a 100644 --- a/SuperScriptViewer/static/env.js +++ b/SuperScriptViewer/static/env.js @@ -37,8 +37,8 @@ function doQuery(fieldIndex, queryTag) { for(var i = 0; i < data['data'].length; i++) { $("#resultTable_" + fieldIndex).append(""); for(var j = 0; j < data['data'][i].length; j++) { - $("#resultTable_" + fieldIndex + " tr:last-child").append(""); - $("#resultTable_" + fieldIndex + " tr:last-child td:last-child").text(data['data'][i][j]); + $("#resultTable_" + fieldIndex + " tr:last").append(""); + $("#resultTable_" + fieldIndex + " tr:last td:last").text(data['data'][i][j]); } } }); diff --git a/SuperScriptViewer/static/viewer.css b/SuperScriptViewer/static/viewer.css index 9662eec..323e47c 100644 --- a/SuperScriptViewer/static/viewer.css +++ b/SuperScriptViewer/static/viewer.css @@ -91,9 +91,10 @@ pre.propertyItem { border: 1px solid black; border-radius: 2px; padding: 5px; - margin: 5px; background: #3f3f3f; color: white; + white-space: pre-wrap; + word-wrap: break-word; } code.propertyItem { diff --git a/SuperScriptViewer/static/viewer.js b/SuperScriptViewer/static/viewer.js index 7317fb9..463587f 100644 --- a/SuperScriptViewer/static/viewer.js +++ b/SuperScriptViewer/static/viewer.js @@ -48,22 +48,22 @@ function localstorageAssist_Set(index, value) { //=======================================internal event previousHighlight = ""; function highlightLink(target) { - realTarget = ".target" + target + realTarget = ".target" + target; if (previousHighlight != "") { //need restore $(previousHighlight).each(function () { if ($(this).hasClass("link-blink")) { - $(this).attr("stroke", "black") + $(this).attr("stroke", "black"); } if ($(this).hasClass("link-blinkDelay")) { - $(this).attr("fill", "black") + $(this).attr("fill", "black"); } if ($(this).hasClass("link-plink")) { - $(this).attr("stroke", "blue") + $(this).attr("stroke", "blue"); } if ($(this).hasClass("link-elink")) { - $(this).attr("stroke", "cyan") + $(this).attr("stroke", "cyan"); } }); } @@ -76,20 +76,20 @@ function highlightLink(target) { //apply new highlight $(realTarget).each(function () { if ($(this).hasClass("link-blink")) { - $(this).attr("stroke", "yellow") + $(this).attr("stroke", "yellow"); } if ($(this).hasClass("link-blinkDelay")) { - $(this).attr("fill", "yellow") + $(this).attr("fill", "yellow"); } if ($(this).hasClass("link-plink")) { - $(this).attr("stroke", "orange") + $(this).attr("stroke", "orange"); } if ($(this).hasClass("link-elink")) { - $(this).attr("stroke", "orange") + $(this).attr("stroke", "orange"); } }); - previousHighlight = realTarget + previousHighlight = realTarget; } //cancel event seperate @@ -110,12 +110,15 @@ function queryInfo(type, obj) { target: obj }, function (data, status) { + //set target + $("#sidepanel-properties-target b").text(obj); + //set data - $("#sidepanel-properties-container").empty() + $("#sidepanel-properties-container").empty(); for (var key in data) { $("#sidepanel-properties-container").append("
"); - var box = $("#sidepanel-properties-container div:last-child"); + var box = $("#sidepanel-properties-container div:last"); if (data[key]["is_setting"]) $(box).append("

S

"); else @@ -125,9 +128,9 @@ function queryInfo(type, obj) { $(box).find("p i").text("(" + key + ")"); for (var i = 0; i < data[key]['data'].length; i++) { - $(box).append("

")
-                    $(box).find("p:last-child").text(data[key]['data'][0])
-                    $(box).find("pre:last-child").text(data[key]['data'][1])
+                    $(box).append("

");
+                    $(box).find("p:last").text(data[key]['data'][i][0]);
+                    $(box).find("pre:last").text(data[key]['data'][i][1]);
                 }
             }
         });
diff --git a/SuperScriptViewer/templates/viewer.html b/SuperScriptViewer/templates/viewer.html
index 13b1e5e..d56eccf 100644
--- a/SuperScriptViewer/templates/viewer.html
+++ b/SuperScriptViewer/templates/viewer.html
@@ -88,12 +88,13 @@
             
Tools
-
+
+

Selected target:

-