summaryrefslogtreecommitdiffstats
path: root/indenters/examples/example.js
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2024-09-18 14:21:27 +0900
committerMichele Calgaro <[email protected]>2024-09-18 14:21:27 +0900
commit8d6255b84d9fb6a585d010119f289baff0794df9 (patch)
tree5e2a9bb3ea6f85217a9e01cee5634dca5170ca50 /indenters/examples/example.js
parent3db895919a4cd36972dd5241f480a68fe0f4eb4d (diff)
downloaduniversal-indent-gui-tqt-8d6255b84d9fb6a585d010119f289baff0794df9.tar.gz
universal-indent-gui-tqt-8d6255b84d9fb6a585d010119f289baff0794df9.zip
Added indenter examples
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'indenters/examples/example.js')
-rwxr-xr-xindenters/examples/example.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/indenters/examples/example.js b/indenters/examples/example.js
new file mode 100755
index 0000000..a807cae
--- /dev/null
+++ b/indenters/examples/example.js
@@ -0,0 +1,12 @@
+function decode() {
+var jsdecoder = new JsDecoder();var jscolorizer = new JsColorizer();var code;
+jsdecoder.s = document.getElementById("a1").value;
+code = jsdecoder.decode();
+
+if (document.all) { document.getElementById("a2").innerText = code; }
+else {
+ code = code.replace(/&/g, "&amp;"); code = code.replace(/</g, "&lt;");
+ code = code.replace(/>/g, "&gt;"); jscolorizer.s = code;
+ code = jscolorizer.colorize(); document.getElementById("a2").innerHTML = code;
+}
+} \ No newline at end of file