bee_api 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/bin/bee_api +84 -0
  2. data/lib/mdpreview.rb +80 -0
  3. data/lib/mdpreview/translator.rb +60 -0
  4. data/lib/mdpreview/version.rb +3 -0
  5. data/test/mdptest.rb +100 -0
  6. data/vendor/HISTORY.md +237 -0
  7. data/vendor/Jakefile.js +316 -0
  8. data/vendor/LICENSE +176 -0
  9. data/vendor/NOTICE +17 -0
  10. data/vendor/README.md +102 -0
  11. data/vendor/app/chrome/documentation.txt +12 -0
  12. data/vendor/app/chrome/manifest.json +24 -0
  13. data/vendor/app/web/ajax.js +43 -0
  14. data/vendor/app/web/app.css +292 -0
  15. data/vendor/app/web/app.js +377 -0
  16. data/vendor/app/web/beta/index.html +17 -0
  17. data/vendor/app/web/datapolicy.txt +48 -0
  18. data/vendor/app/web/doc/doc.css +60 -0
  19. data/vendor/app/web/doc/img/actions_menu.png +0 -0
  20. data/vendor/app/web/doc/img/button_actions_menu.png +0 -0
  21. data/vendor/app/web/doc/img/button_dragarea.png +0 -0
  22. data/vendor/app/web/doc/img/jsoneditor.png +0 -0
  23. data/vendor/app/web/doc/img/jsonformatter.png +0 -0
  24. data/vendor/app/web/doc/img/main_menu.png +0 -0
  25. data/vendor/app/web/doc/img/splitter.png +0 -0
  26. data/vendor/app/web/doc/index.html +201 -0
  27. data/vendor/app/web/favicon.ico +0 -0
  28. data/vendor/app/web/fileretriever.css +54 -0
  29. data/vendor/app/web/fileretriever.js +567 -0
  30. data/vendor/app/web/fileretriever.php +120 -0
  31. data/vendor/app/web/googlea47c4a0b36d11021.html +1 -0
  32. data/vendor/app/web/hash.js +133 -0
  33. data/vendor/app/web/img/description.txt +20 -0
  34. data/vendor/app/web/img/header_background.png +0 -0
  35. data/vendor/app/web/img/icon_128.png +0 -0
  36. data/vendor/app/web/img/icon_16.png +0 -0
  37. data/vendor/app/web/img/icon_gray.svg +151 -0
  38. data/vendor/app/web/img/icon_gray_16.svg +150 -0
  39. data/vendor/app/web/img/icon_orange.svg +151 -0
  40. data/vendor/app/web/img/logo.png +0 -0
  41. data/vendor/app/web/img/logo.xcf +0 -0
  42. data/vendor/app/web/img/logo_app.png +0 -0
  43. data/vendor/app/web/img/logo_app.xcf +0 -0
  44. data/vendor/app/web/index.html +191 -0
  45. data/vendor/app/web/notify.js +150 -0
  46. data/vendor/app/web/queryparams.js +71 -0
  47. data/vendor/app/web/robots.txt +0 -0
  48. data/vendor/app/web/splitter.js +179 -0
  49. data/vendor/app/web/test.html +224 -0
  50. data/vendor/component.json +33 -0
  51. data/vendor/docs/api.md +188 -0
  52. data/vendor/docs/usage.md +137 -0
  53. data/vendor/examples/01_basic_usage.html +45 -0
  54. data/vendor/examples/02_viewer.html +38 -0
  55. data/vendor/examples/03_switch_mode.html +98 -0
  56. data/vendor/examples/cur.file +1 -0
  57. data/vendor/examples/jquery.js +2 -0
  58. data/vendor/examples/meta.js +1 -0
  59. data/vendor/examples/requirejs_demo/requirejs_demo.html +19 -0
  60. data/vendor/examples/requirejs_demo/scripts/main.js +25 -0
  61. data/vendor/examples/requirejs_demo/scripts/require.js +35 -0
  62. data/vendor/img/jsoneditor-icons.png +0 -0
  63. data/vendor/jsoneditor-min.css +1 -0
  64. data/vendor/jsoneditor-min.js +34 -0
  65. data/vendor/jsoneditor.css +597 -0
  66. data/vendor/jsoneditor.js +6069 -0
  67. data/vendor/jsoneditor/css/contextmenu.css +219 -0
  68. data/vendor/jsoneditor/css/img/description.txt +13 -0
  69. data/vendor/jsoneditor/css/img/export.sh +16 -0
  70. data/vendor/jsoneditor/css/img/jsoneditor-icons.png +0 -0
  71. data/vendor/jsoneditor/css/img/jsoneditor-icons.svg +861 -0
  72. data/vendor/jsoneditor/css/jsoneditor.css +220 -0
  73. data/vendor/jsoneditor/css/menu.css +81 -0
  74. data/vendor/jsoneditor/css/searchbox.css +73 -0
  75. data/vendor/jsoneditor/js/appendnode.js +211 -0
  76. data/vendor/jsoneditor/js/contextmenu.js +440 -0
  77. data/vendor/jsoneditor/js/header.js +32 -0
  78. data/vendor/jsoneditor/js/highlighter.js +82 -0
  79. data/vendor/jsoneditor/js/history.js +218 -0
  80. data/vendor/jsoneditor/js/jsoneditor.js +206 -0
  81. data/vendor/jsoneditor/js/module.js +50 -0
  82. data/vendor/jsoneditor/js/node.js +2864 -0
  83. data/vendor/jsoneditor/js/searchbox.js +288 -0
  84. data/vendor/jsoneditor/js/texteditor.js +311 -0
  85. data/vendor/jsoneditor/js/treeeditor.js +770 -0
  86. data/vendor/jsoneditor/js/util.js +582 -0
  87. data/vendor/lib/ace/ace.js +11 -0
  88. data/vendor/lib/ace/mode-json.js +1 -0
  89. data/vendor/lib/ace/theme-jsoneditor.js +144 -0
  90. data/vendor/lib/ace/theme-textmate.js +163 -0
  91. data/vendor/lib/ace/worker-json.js +1 -0
  92. data/vendor/lib/jsonlint/README.md +62 -0
  93. data/vendor/lib/jsonlint/jsonlint.js +432 -0
  94. data/vendor/misc/screenshots/actionsmenu_640x400.png +0 -0
  95. data/vendor/misc/screenshots/codeeditor_640x400.png +0 -0
  96. data/vendor/misc/screenshots/description.json +17 -0
  97. data/vendor/misc/screenshots/jsoneditoronline.png +0 -0
  98. data/vendor/misc/screenshots/jsoneditoronline_640x400.png +0 -0
  99. data/vendor/misc/screenshots/search_640x400.png +0 -0
  100. data/vendor/misc/screenshots/small_tile.xcf +0 -0
  101. data/vendor/misc/screenshots/small_tile_440x280.png +0 -0
  102. data/vendor/misc/todo.txt +101 -0
  103. data/vendor/package.json +28 -0
  104. data/vendor/test/couchdbeditor.html +100 -0
  105. data/vendor/test/largefile.json +12605 -0
  106. data/vendor/test/test_ace.html +60 -0
  107. data/vendor/test/test_editable_div.html +449 -0
  108. metadata +154 -0
@@ -0,0 +1,17 @@
1
+ JSON Editor Online
2
+ http://jsoneditoronline.org
3
+
4
+ Copyright (C) 2011-2013 Jos de Jong
5
+
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
@@ -0,0 +1,102 @@
1
+ # JSON Editor Online
2
+ http://jsoneditoronline.org/
3
+
4
+
5
+ ### Description
6
+
7
+ JSON Editor Online is a web-based tool to view, edit, and format JSON.
8
+ It shows your data side by side in a clear, editable treeview and in
9
+ a code editor.
10
+
11
+
12
+ ### Screenshot
13
+
14
+ <a href="http://jsoneditoronline.org">
15
+ <img alt="jsoneditor"
16
+ src="https://raw.github.com/josdejong/jsoneditor/master/misc/screenshots/jsoneditoronline.png">
17
+ </a>
18
+
19
+
20
+ ### Features
21
+
22
+ - View and edit JSON side by side in a treeview and a code editor.
23
+ - Edit, add, move, remove, and duplicate fields and values.
24
+ - Change type of values.
25
+ - Sort arrays and objects.
26
+ - Colorized values, color depends of the value type.
27
+ - Search & highlight text in the treeview.
28
+ - Undo and redo all actions.
29
+ - Load and save files and urls.
30
+ - Format, compact, and inspect JSON in the code editor powered by [Ace](http://ace.ajax.org/).
31
+ - Library can be loaded as CommonJS module, AMD module, or as a regular javascript file.
32
+
33
+
34
+ ### Install
35
+
36
+ with npm:
37
+
38
+ npm install jsoneditor
39
+
40
+ with bower:
41
+
42
+ npm install bower
43
+
44
+ download:
45
+
46
+ [http://jsoneditoronline.org/downloads/](http://jsoneditoronline.org/downloads/)
47
+
48
+
49
+ ### Use
50
+
51
+ ```html
52
+ <!DOCTYPE HTML>
53
+ <html>
54
+ <head>
55
+ <link rel="stylesheet" type="text/css" href="jsoneditor/jsoneditor-min.css">
56
+ <script type="text/javascript" src="jsoneditor/jsoneditor-min.js"></script>
57
+ </head>
58
+ <body>
59
+ <div id="jsoneditor" style="width: 400px; height: 400px;"></div>
60
+
61
+ <script type="text/javascript" >
62
+ // create the editor
63
+ var container = document.getElementById("jsoneditor");
64
+ var editor = new jsoneditor.JSONEditor(container);
65
+
66
+ // set json
67
+ var json = {
68
+ "Array": [1, 2, 3],
69
+ "Boolean": true,
70
+ "Null": null,
71
+ "Number": 123,
72
+ "Object": {"a": "b", "c": "d"},
73
+ "String": "Hello World"
74
+ };
75
+ editor.set(json);
76
+
77
+ // get json
78
+ var json = editor.get();
79
+ </script>
80
+ </body>
81
+ </html>
82
+ ```
83
+
84
+ ### Documentation
85
+
86
+ - Docs: [https://github.com/josdejong/jsoneditor/tree/master/docs](https://github.com/josdejong/jsoneditor/tree/master/docs)
87
+ - Examples: [https://github.com/josdejong/jsoneditor/tree/master/examples](https://github.com/josdejong/jsoneditor/tree/master/examples)
88
+ - Source: [https://github.com/josdejong/jsoneditor](https://github.com/josdejong/jsoneditor)
89
+ - History: [https://github.com/josdejong/jsoneditor/blob/master/HISTORY.md](https://github.com/josdejong/jsoneditor/blob/master/HISTORY.md)
90
+
91
+
92
+ ### Build
93
+
94
+ The code of the JSON Editor is located in the folder `jsoneditor`.
95
+ The code for the web application in `app/web`.
96
+ To build the library from sourcecode, run
97
+
98
+ jake
99
+
100
+ in the root of the project. This will generate the files `jsoneditor.js`,
101
+ `jsoneditor.css`, and minified versions, and will create a folder `build`
102
+ containing the zipped library and the built web application.
@@ -0,0 +1,12 @@
1
+ Chrome App
2
+
3
+ https://developers.google.com/chrome/web-store/articles/launching
4
+ https://developers.google.com/chrome/web-store/articles/launching#pre-launch-checklist
5
+ https://developers.google.com/chrome/web-store/docs/publish
6
+
7
+ http://developer.chrome.com/extensions/apps.html
8
+ http://developer.chrome.com/trunk/extensions/apps/about_apps.html
9
+
10
+ Tutorial
11
+ http://ohboard.com/blog/chrome-web-app-development-guide/
12
+
@@ -0,0 +1,24 @@
1
+ {
2
+ "manifest_version": 2,
3
+ "name": "JSON Editor",
4
+ "version": "@@version",
5
+ "description": "JSON Editor is a tool to view, edit, and format JSON. It shows your data in an editable treeview and in a code editor.",
6
+ "app": {
7
+ "urls": [
8
+ "http://jsoneditoronline.org/",
9
+ "http://jsoneditoronline.org/index.html",
10
+ "http://jsoneditoronline.org/changelog.txt",
11
+ "http://jsoneditoronline.org/NOTICE"
12
+ ],
13
+ "launch": {
14
+ "web_url": "http://jsoneditoronline.org/"
15
+ }
16
+ },
17
+ "icons": {
18
+ "16": "icon_16.png",
19
+ "128": "icon_128.png"
20
+ },
21
+ "permissions": [
22
+ ],
23
+ "offline_enabled": false
24
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * ajax
3
+ * Utility to perform ajax get and post requests. Supported browsers:
4
+ * Chrome, Firefox, Opera, Safari, Internet Explorer 7+.
5
+ */
6
+ var ajax = (function () {
7
+ function fetch (method, url, body, headers, callback) {
8
+ try {
9
+ var xhr = new XMLHttpRequest();
10
+ xhr.onreadystatechange = function() {
11
+ if (xhr.readyState == 4) {
12
+ callback(xhr.responseText, xhr.status);
13
+ }
14
+ };
15
+ xhr.open(method, url, true);
16
+ if (headers) {
17
+ for (var name in headers) {
18
+ if (headers.hasOwnProperty(name)) {
19
+ xhr.setRequestHeader(name, headers[name]);
20
+ }
21
+ }
22
+ }
23
+ xhr.send(body);
24
+ }
25
+ catch (err) {
26
+ callback(err, 0);
27
+ }
28
+ }
29
+
30
+ function get (url, headers, callback) {
31
+ fetch('GET', url, null, headers, callback);
32
+ }
33
+
34
+ function post (url, body, headers, callback) {
35
+ fetch('POST', url, body, headers, callback)
36
+ }
37
+
38
+ return {
39
+ 'fetch': fetch,
40
+ 'get': get,
41
+ 'post': post
42
+ }
43
+ })();
@@ -0,0 +1,292 @@
1
+ body, html {
2
+ font-family: arial, sans-serif;
3
+ font-size: 11pt;
4
+
5
+ width: 100%;
6
+ height: 100%;
7
+ margin: 0;
8
+ padding: 0;
9
+
10
+ overflow: hidden;
11
+ }
12
+
13
+ span.header-light {
14
+ color: gray;
15
+ }
16
+
17
+ #header {
18
+ width: 100%;
19
+ height: 40px;
20
+ /* TODO
21
+ overflow: hidden;
22
+ */
23
+
24
+ background: #4D4D4D url('img/header_background.png');
25
+ color: white;
26
+ }
27
+
28
+ #logo {
29
+ height: 32px;
30
+ margin: 4px 10px;
31
+ border: none;
32
+ }
33
+
34
+ #menu {
35
+ position: absolute;
36
+ top: 5px;
37
+ right: 15px;
38
+ font-size: 11pt;
39
+ }
40
+
41
+ #menu ul {
42
+ list-style: none;
43
+ margin: 0;
44
+ padding: 0;
45
+ clear: both;
46
+ }
47
+
48
+ #menu ul li {
49
+ color: #e6e6e6;
50
+ background: none;
51
+ border: none;
52
+ border-right: 1px solid #737373;
53
+ height: 30px;
54
+ padding: 0;
55
+ margin: 0;
56
+ float: left;
57
+ position: relative;
58
+
59
+ text-decoration: none;
60
+ }
61
+
62
+ #menu ul li:first-child {
63
+ border-left: 1px solid #737373;
64
+ }
65
+
66
+ #menu ul li:hover {
67
+ color: white;
68
+ background-color: #737373;
69
+ }
70
+
71
+ #menu ul li ul {
72
+ display: none;
73
+ }
74
+
75
+ #menu ul li:hover > ul {
76
+ display: block;
77
+ }
78
+
79
+ #menu ul li ul {
80
+ position: absolute;
81
+ top: 30px;
82
+ left: 0;
83
+ z-index: 999;
84
+
85
+ background: #f5f5f5;
86
+ border: 1px solid lightgray;
87
+ box-shadow: 0 0 15px rgba(128, 128, 128, 0.5);
88
+ }
89
+
90
+ #menu ul li ul li {
91
+ color: #737373;
92
+ background: none;
93
+ border: none;
94
+ margin: 0;
95
+ padding: 0;
96
+ }
97
+
98
+ #menu ul li ul li:first-child {
99
+ border-left: none;
100
+ }
101
+
102
+ #menu ul li ul li:hover {
103
+ background-color: white;
104
+ }
105
+
106
+ #menu a {
107
+ padding: 6px 10px;
108
+ display: block;
109
+ cursor: pointer;
110
+ text-decoration: none;
111
+ color: white;
112
+ }
113
+
114
+ #menu ul li ul li a {
115
+ color: #737373;
116
+ width: 80px;
117
+ }
118
+
119
+
120
+ #openMenuButton {
121
+ font-size: 75%;
122
+ margin-left: 2px;
123
+ }
124
+ #menu #open {
125
+ cursor: default;
126
+ }
127
+
128
+ /* TODO: enable the menu with keys (when openMenuButton is active) */
129
+
130
+ #auto {
131
+ width: 100%;
132
+ height: 100%;
133
+
134
+ margin: -40px 0 -24px 0;
135
+ padding: 40px 0 24px 0;
136
+
137
+ -moz-box-sizing: border-box;
138
+ -webkit-box-sizing: border-box;
139
+ box-sizing: border-box;
140
+
141
+ overflow: hidden;
142
+ }
143
+
144
+ #contents {
145
+ width: 100%;
146
+ height: 100%;
147
+ overflow: hidden;
148
+ }
149
+
150
+ #codeEditor, #treeEditor {
151
+ height: 100%;
152
+ width: 400px;
153
+
154
+ -moz-box-sizing: border-box;
155
+ -webkit-box-sizing: border-box;
156
+ box-sizing: border-box;
157
+ }
158
+
159
+ #codeEditor {
160
+ float: left;
161
+ padding: 15px 0 15px 15px;
162
+ }
163
+
164
+ #treeEditor {
165
+ float: left;
166
+ padding: 15px 15px 15px 0;
167
+ }
168
+
169
+ #splitter {
170
+ text-align: center;
171
+ float: left;
172
+ height: 100%;
173
+ padding: 15px;
174
+ -moz-box-sizing: border-box;
175
+ -webkit-box-sizing: border-box;
176
+ box-sizing: border-box;
177
+ }
178
+
179
+ #splitter #buttons {
180
+ margin: 0 0 15px 0;
181
+ }
182
+
183
+ #splitter #toTree {
184
+ margin: 40px 0 0 0 ;
185
+ }
186
+
187
+ #splitter #toCode {
188
+ margin: 20px 0 0 0 ;
189
+ }
190
+
191
+ #splitter #drag {
192
+ font-size: 32px;
193
+ color: lightgray;
194
+ border-radius: 3px;
195
+ min-width: 24px;
196
+ cursor: col-resize;
197
+ }
198
+
199
+ #splitter #drag:hover,
200
+ #splitter #drag.active {
201
+ color: gray;
202
+ background-color: #f5f5f5;
203
+
204
+ }
205
+
206
+ #footer {
207
+ width: 100%;
208
+ height: 23px;
209
+ font-size: 10pt;
210
+
211
+ overflow: hidden;
212
+ color: #BFBFBF;
213
+ border-top: 1px solid lightgray;
214
+ text-align: center;
215
+ background-color: #F5F5F5;
216
+ }
217
+ #footer-inner {
218
+ margin: 4px;
219
+ }
220
+
221
+ a.header {
222
+ color: white;
223
+ text-decoration: none;
224
+ }
225
+ a.footer {
226
+ color: #BFBFBF;
227
+ text-decoration: none;
228
+ }
229
+ a.footer:hover {
230
+ color: red;
231
+ text-decoration: underline;
232
+ }
233
+
234
+ #ad {
235
+ float: right;
236
+ right: 15px;
237
+ padding: 15px 0 15px 0;
238
+ position: relative;
239
+ }
240
+
241
+ #chromeAppInfo {
242
+ line-height: normal;
243
+ padding: 0 5px 20px 5px;
244
+ }
245
+
246
+ div.error, div.notification {
247
+ border-radius: 2px;
248
+ padding: 5px;
249
+ margin: 5px;
250
+ box-shadow: 0 0 15px rgba(128, 128, 128, 0.5);
251
+
252
+ /* TODO: add some transition effect */
253
+ }
254
+ div.error {
255
+ color: red;
256
+ background-color: #FFC0CB;
257
+ border: 1px solid red;
258
+ }
259
+ div.notification {
260
+ color: #1a1a1a;
261
+ background-color: #FFFFAB;
262
+ border: 1px solid #e6d600;
263
+ }
264
+ pre.error {
265
+ margin: 0 0 10px 0;
266
+ white-space: pre-wrap;
267
+ font-family: droid sans mono, monospace, courier new, courier, sans-serif;
268
+ font-size: 10pt;
269
+ }
270
+ a.error {
271
+ color: red;
272
+ font-size: 8pt;
273
+ }
274
+
275
+ button.convert {
276
+ cursor: default;
277
+ padding: 2px;
278
+ }
279
+
280
+ div.convert-right, div.convert-left {
281
+ width: 24px;
282
+ height: 24px;
283
+ margin: 0;
284
+ }
285
+
286
+ div.convert-right {
287
+ background: url('lib/jsoneditor/img/jsoneditor-icons.png') -0 -48px;
288
+ }
289
+
290
+ div.convert-left {
291
+ background: url('lib/jsoneditor/img/jsoneditor-icons.png') -24px -48px;
292
+ }