From d1fbb8ffb7eee1786d38002844d68e92f6b8a26e Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Mon, 10 Aug 2020 11:45:43 +0800 Subject: [PATCH] update tabcontrol style --- SuperScriptViewer/ServerCore.py | 18 ++- SuperScriptViewer/static/converter.js | 0 SuperScriptViewer/static/tabcontrol.css | 14 ++ SuperScriptViewer/static/tabcontrol.js | 13 ++ SuperScriptViewer/static/viewer.css | 15 -- .../templates/help/converter.html | 143 ++++++++++++++---- SuperScriptViewer/templates/viewer.html | 18 ++- 7 files changed, 165 insertions(+), 56 deletions(-) create mode 100644 SuperScriptViewer/static/converter.js create mode 100644 SuperScriptViewer/static/tabcontrol.css create mode 100644 SuperScriptViewer/static/tabcontrol.js diff --git a/SuperScriptViewer/ServerCore.py b/SuperScriptViewer/ServerCore.py index e139171..5ef1ef4 100644 --- a/SuperScriptViewer/ServerCore.py +++ b/SuperScriptViewer/ServerCore.py @@ -44,9 +44,19 @@ def nospecHandle(): return redirect(url_for('indexHandle')) @app.route('/help', methods=['GET']) -def helpHandle(): +def helpMainHandle(): return render_template("help.html") +@app.route('/help/', methods=['GET']) +def helpHandle(scriptPath): + if scriptPath == 'converter': + return render_template("help/converter.html", + tabcontrol_css = url_for('static', filename='tabcontrol.css'), + tabcontrol_js = url_for('static', filename='tabcontrol.js'), + converter_js = url_for('static', filename='converter.js')) + else: + abort(404) + @app.route('/about', methods=['GET']) def aboutHandle(): return render_template("about.html", static_icon = url_for('static', filename='icon.png')) @@ -104,8 +114,10 @@ def viewerHandle(scriptPath): gWidth = width, gHeight = height, hamburgerHistory = hamburger, - static_css = url_for('static', filename='viewer.css'), - static_js = url_for('static', filename='viewer.js'), + viewer_css = url_for('static', filename='viewer.css'), + tabcontrol_css = url_for('static', filename='tabcontrol.css'), + viewer_js = url_for('static', filename='viewer.js'), + tabcontrol_js = url_for('static', filename='tabcontrol.js'), hamburgerCurrent = currentHamburger, blocks = dbBlocks, cells = dbCells, diff --git a/SuperScriptViewer/static/converter.js b/SuperScriptViewer/static/converter.js new file mode 100644 index 0000000..e69de29 diff --git a/SuperScriptViewer/static/tabcontrol.css b/SuperScriptViewer/static/tabcontrol.css new file mode 100644 index 0000000..c803d47 --- /dev/null +++ b/SuperScriptViewer/static/tabcontrol.css @@ -0,0 +1,14 @@ +/*side panel style*/ +div.tabitem-activated { + background: #0000ff; +} +div.tabitem-activated b { + color: white; +} + +div.tabitem-deactivated { + background: #ffffff00; +} +div.tabitem-deactivated b { + color: black; +} \ No newline at end of file diff --git a/SuperScriptViewer/static/tabcontrol.js b/SuperScriptViewer/static/tabcontrol.js new file mode 100644 index 0000000..2ba6341 --- /dev/null +++ b/SuperScriptViewer/static/tabcontrol.js @@ -0,0 +1,13 @@ +function tabControlSwitcher(tabcontrolIndex, neededIndex) { + //disable all + $(".tabnavigation_" + tabcontrolIndex).each(function () { + $(this).removeClass("tabitem-activated").addClass("tabitem-deactivated"); + }); + $(".tabpanel_" + tabcontrolIndex).each(function () { + $(this).hide(); + }); + + // set current + $("#tabnavigation_" + tabcontrolIndex + "_" + neededIndex).removeClass("tabitem-deactivated").addClass("tabitem-activated"); + $("#tabpanel_" + tabcontrolIndex + "_" + neededIndex).show(); +} \ No newline at end of file diff --git a/SuperScriptViewer/static/viewer.css b/SuperScriptViewer/static/viewer.css index f6d117f..58aab0e 100644 --- a/SuperScriptViewer/static/viewer.css +++ b/SuperScriptViewer/static/viewer.css @@ -85,21 +85,6 @@ text.link-delay { 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; diff --git a/SuperScriptViewer/templates/help/converter.html b/SuperScriptViewer/templates/help/converter.html index 4a6192d..0d2a978 100644 --- a/SuperScriptViewer/templates/help/converter.html +++ b/SuperScriptViewer/templates/help/converter.html @@ -4,6 +4,10 @@ Help - Converter + + + + @@ -11,39 +15,118 @@

This page provide some useful converter for your decoding work. All converter is interactive..


-

Reverse C style byte array

-

This converter will reverse your inputed C style byte array. Actually, it take responsibility for the convert between big-endian and little-endian.
-Typical and legal input just like this: 0x00, 0xBb, 0xff, 0xFF
-Support multi-input. Use line break to split each input.

-

Input:

- -

Output:

- +
+
Reverse C style byte array
+
C style byte array to HEX
+
C style byte array to DEC
+
Lowcase upcase converter
+
-

C style byte array to HEX

-

This converter will converte provided C style byte array into HEX number. It is double interactive.
-Acceptable byte array should follow little-endian format.
-Support multi-input. Use line break to split each input.

-

Byte array:

- -

HEX number:

- +
+

This converter will reverse your inputed C style byte array. Actually, it take responsibility for the convert between big-endian and little-endian.
+ Typical and legal input just like this: 0x00, 0xBb, 0xff, 0xFF
+ Support multi-input. Use line break to split each input.

+ + + + + + + + + + + + + + + + + + + + +
Input 
 
 Output
+
-

C style byte array to DEC

-

This converter will converte provided C style byte array into DEC number. It is double interactive.
-Acceptable byte array should follow little-endian format.
-Support multi-input. Use line break to split each input.

-

Byte array:

- -

DEC number:

- + -

Lowcase upcase converter

-

This converter will provide the convert between lowcase and upcase string. It is double interactive.

-

Lowcase:

- -

Upcase:

- + + + diff --git a/SuperScriptViewer/templates/viewer.html b/SuperScriptViewer/templates/viewer.html index 787322c..449bd04 100644 --- a/SuperScriptViewer/templates/viewer.html +++ b/SuperScriptViewer/templates/viewer.html @@ -4,9 +4,11 @@ Script Viewer - + + - + + @@ -81,18 +83,18 @@
-
Properties
-
Display
-
Tools
+
Properties
+
Display
+
Tools
-
+

Properties of ---

-