From f0453a887ea5e150c5083bb51c9e9a7e49691138 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 19 Jan 2011 10:40:26 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20Input=20Field=20>=20Format=20>=20Pr?= =?UTF-8?q?ettify=20JSON=20and=20Serialize=20JSON=20Default=20Bundles=20-?= =?UTF-8?q?=20both=20bound=20to=20=E2=8C=A5=E2=8C=98J?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prettify JSON.spBundle/command.plist | 48 +++++++++++++++++++ .../Serialize JSON.spBundle/command.plist | 54 ++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 SharedSupport/Default Bundles/Prettify JSON.spBundle/command.plist create mode 100644 SharedSupport/Default Bundles/Serialize JSON.spBundle/command.plist (limited to 'SharedSupport') diff --git a/SharedSupport/Default Bundles/Prettify JSON.spBundle/command.plist b/SharedSupport/Default Bundles/Prettify JSON.spBundle/command.plist new file mode 100644 index 00000000..508394a9 --- /dev/null +++ b/SharedSupport/Default Bundles/Prettify JSON.spBundle/command.plist @@ -0,0 +1,48 @@ + + + + + author + Hans-Jörg Bibiko + category + Format + command + cat | python -mjson.tool + +# if there's a need to preserve Unicode characters use this line of code: +# cat | python -mjson.tool | perl -Xpe 'binmode STDIN,":utf8";binmode STDOUT,":utf8";s/\\u([0-9A-F]{4})/chr(hex($1))/ieg' + contact + znvy@ovovxb.qr + description + Take the selection or the entire content of the current text input field, interpret it as JSON, and replace the JSON data human-readable. Unicode characters will be converted to \u.... sequences. If you want to preserve these Unicode characters you can uncomment the last code line. + +Version 1.0 + input + selectedtext + input_fallback + entirecontent + internalKeyEquivalent + + characters + J + keyCode + 38 + modifierFlags + 1572864 + + keyEquivalent + ~@j + name + Prettify JSON + output + replaceselection + scope + inputfield + tooltip + Pretty print JSON data + uuid + 40BC811D-4BAB-41EA-A096-9A202B646619 + isDefaultBundle + + + diff --git a/SharedSupport/Default Bundles/Serialize JSON.spBundle/command.plist b/SharedSupport/Default Bundles/Serialize JSON.spBundle/command.plist new file mode 100644 index 00000000..a47bf148 --- /dev/null +++ b/SharedSupport/Default Bundles/Serialize JSON.spBundle/command.plist @@ -0,0 +1,54 @@ + + + + + author + Hans-Jörg Bibiko + category + Format + command + php -r ' +$jsonData = ""; +$inputStream = fopen("php://stdin", "r"); +while($d = fgets($inputStream)) { $jsonData .= $d; } +print json_encode(json_decode($jsonData)); +' + +# if there's a need to preserve Unicode characters pipe the output +# of the the PHP script to the following Perl code: +# perl -Xpe 'binmode STDIN,":utf8";binmode STDOUT,":utf8";s/\\u([0-9A-F]{4})/chr(hex($1))/ieg' + contact + znvy@ovovxb.qr + description + Take the selection or the entire content of the current text input field and serialize the JSON data. Unicode characters will be converted to \u.... sequences. If you want to preserve these Unicode characters you can uncomment the last code line. + +Version 1.0 + input + selectedtext + input_fallback + entirecontent + internalKeyEquivalent + + characters + J + keyCode + 38 + modifierFlags + 1572864 + + keyEquivalent + ~@j + name + Serialize JSON + output + replaceselection + scope + inputfield + tooltip + Serialize JSON data + uuid + D07AF7FA-CFD1-41A9-8786-FFF50FE8737A + isDefaultBundle + + + -- cgit v1.2.3