tianheng-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/README.md +9 -18
  2. package/lib/039af9192b9bb277966ceb4e4ce29c41.js +16 -0
  3. package/lib/2d84c80112a372bc149cad3464e90fa3.js +1617 -0
  4. package/lib/5977b934a4c6b480790864ea01303173.js +10834 -0
  5. package/lib/7745f3e776488705a38e62f85adad54d.js +16 -0
  6. package/lib/de8dee841ffdaaede3a2254deef30376.js +15395 -0
  7. package/lib/e78eab250e7f8ccac3d918dfdb06ca10.js +8904 -0
  8. package/lib/theme-chalk/fonts/PingFang.ttf +0 -0
  9. package/lib/theme-chalk/fonts/bpmn.eot +0 -0
  10. package/lib/theme-chalk/fonts/bpmn.svg +224 -0
  11. package/lib/theme-chalk/fonts/bpmn.ttf +0 -0
  12. package/lib/theme-chalk/fonts/bpmn.woff +0 -0
  13. package/lib/theme-chalk/fonts/bpmn.woff2 +0 -0
  14. package/lib/theme-chalk/fonts/fontawesome-webfont.eot +0 -0
  15. package/lib/theme-chalk/fonts/fontawesome-webfont.svg +2671 -0
  16. package/lib/theme-chalk/fonts/fontawesome-webfont.ttf +0 -0
  17. package/lib/theme-chalk/fonts/fontawesome-webfont.woff +0 -0
  18. package/lib/theme-chalk/fonts/fontawesome-webfont.woff2 +0 -0
  19. package/lib/theme-chalk/fonts/iconfont.eot +0 -0
  20. package/lib/theme-chalk/fonts/iconfont.svg +155 -0
  21. package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
  22. package/lib/theme-chalk/fonts/iconfont.woff +0 -0
  23. package/lib/theme-chalk/fonts/iconfont.woff2 +0 -0
  24. package/lib/theme-chalk/images/notData.png +0 -0
  25. package/lib/theme-chalk/index.scss +31 -0
  26. package/lib/theme-chalk/js/Log.js +99 -0
  27. package/lib/theme-chalk/js/axios.js +86 -0
  28. package/lib/theme-chalk/js/store/getters.js +5 -0
  29. package/lib/theme-chalk/js/store/modules/makingForm.js +21 -0
  30. package/lib/theme-chalk/js/store/store.js +26 -0
  31. package/lib/theme-chalk/styles/button.scss +501 -0
  32. package/lib/theme-chalk/styles/card.scss +29 -0
  33. package/lib/theme-chalk/styles/cell.scss +54 -0
  34. package/lib/theme-chalk/styles/codeEditor.scss +9 -0
  35. package/lib/theme-chalk/styles/col.scss +151 -0
  36. package/lib/theme-chalk/styles/dialog.scss +56 -0
  37. package/lib/theme-chalk/styles/empty.scss +22 -0
  38. package/lib/theme-chalk/styles/feature.scss +46 -0
  39. package/lib/theme-chalk/styles/font.css +7 -0
  40. package/lib/theme-chalk/styles/grid.scss +41 -0
  41. package/lib/theme-chalk/styles/icon.css +1944 -0
  42. package/lib/theme-chalk/styles/imagePreview.scss +113 -0
  43. package/lib/theme-chalk/styles/img.scss +35 -0
  44. package/lib/theme-chalk/styles/reset.scss +17 -0
  45. package/lib/theme-chalk/styles/root.css +64 -0
  46. package/lib/theme-chalk/styles/row.scss +23 -0
  47. package/lib/theme-chalk/styles/upload.scss +744 -0
  48. package/lib/theme-chalk/styles/variable.scss +80 -0
  49. package/lib/tianheng-ui.js +116 -0
  50. package/package.json +86 -48
  51. package/packages/Button/index.js +8 -0
  52. package/packages/Button/index.vue +80 -0
  53. package/packages/Card/index.js +8 -0
  54. package/packages/Card/index.vue +37 -0
  55. package/packages/Cell/index.js +8 -0
  56. package/packages/Cell/index.vue +68 -0
  57. package/packages/CodeEditor/index.js +8 -0
  58. package/packages/CodeEditor/index.vue +177 -0
  59. package/packages/Col/index.js +8 -0
  60. package/packages/Col/index.vue +43 -0
  61. package/packages/Dialog/index.js +8 -0
  62. package/packages/Dialog/index.vue +129 -0
  63. package/packages/Empty/index.js +8 -0
  64. package/packages/Empty/index.vue +35 -0
  65. package/packages/FormMaking/FormConfig.vue +60 -0
  66. package/packages/FormMaking/GenerateForm.vue +308 -0
  67. package/packages/FormMaking/GenerateFormItem.vue +887 -0
  68. package/packages/FormMaking/GenerateFormItemH5.vue +825 -0
  69. package/packages/FormMaking/Upload/index.vue +572 -0
  70. package/packages/FormMaking/WidgetConfig.vue +472 -0
  71. package/packages/FormMaking/WidgetForm.vue +159 -0
  72. package/packages/FormMaking/WidgetFormItem.vue +187 -0
  73. package/packages/FormMaking/custom/config.js +762 -0
  74. package/packages/FormMaking/custom/configs/alliance.vue +0 -0
  75. package/packages/FormMaking/custom/configs/blank.vue +54 -0
  76. package/packages/FormMaking/custom/configs/button.vue +172 -0
  77. package/packages/FormMaking/custom/configs/cascader.vue +175 -0
  78. package/packages/FormMaking/custom/configs/cell.vue +81 -0
  79. package/packages/FormMaking/custom/configs/checkbox.vue +234 -0
  80. package/packages/FormMaking/custom/configs/color.vue +137 -0
  81. package/packages/FormMaking/custom/configs/date.vue +158 -0
  82. package/packages/FormMaking/custom/configs/divider.vue +61 -0
  83. package/packages/FormMaking/custom/configs/editor.vue +71 -0
  84. package/packages/FormMaking/custom/configs/filler.vue +57 -0
  85. package/packages/FormMaking/custom/configs/grid.vue +103 -0
  86. package/packages/FormMaking/custom/configs/image.vue +138 -0
  87. package/packages/FormMaking/custom/configs/input.vue +176 -0
  88. package/packages/FormMaking/custom/configs/number.vue +140 -0
  89. package/packages/FormMaking/custom/configs/radio.vue +211 -0
  90. package/packages/FormMaking/custom/configs/rate.vue +109 -0
  91. package/packages/FormMaking/custom/configs/select.vue +305 -0
  92. package/packages/FormMaking/custom/configs/slider.vue +142 -0
  93. package/packages/FormMaking/custom/configs/switch.vue +130 -0
  94. package/packages/FormMaking/custom/configs/table.vue +105 -0
  95. package/packages/FormMaking/custom/configs/table_h5.vue +102 -0
  96. package/packages/FormMaking/custom/configs/tabs.vue +175 -0
  97. package/packages/FormMaking/custom/configs/text.vue +71 -0
  98. package/packages/FormMaking/custom/configs/textarea.vue +167 -0
  99. package/packages/FormMaking/custom/configs/time.vue +153 -0
  100. package/packages/FormMaking/custom/configs/upload.vue +155 -0
  101. package/packages/FormMaking/custom/index.js +32 -0
  102. package/packages/FormMaking/custom/items/alliance.vue +132 -0
  103. package/packages/FormMaking/custom/items/blank.vue +16 -0
  104. package/packages/FormMaking/custom/items/button.vue +27 -0
  105. package/packages/FormMaking/custom/items/cascader.vue +29 -0
  106. package/packages/FormMaking/custom/items/cell.vue +18 -0
  107. package/packages/FormMaking/custom/items/checkbox.vue +46 -0
  108. package/packages/FormMaking/custom/items/color.vue +19 -0
  109. package/packages/FormMaking/custom/items/date.vue +29 -0
  110. package/packages/FormMaking/custom/items/divider.vue +14 -0
  111. package/packages/FormMaking/custom/items/editor.vue +22 -0
  112. package/packages/FormMaking/custom/items/filler.vue +17 -0
  113. package/packages/FormMaking/custom/items/grid.vue +130 -0
  114. package/packages/FormMaking/custom/items/image.vue +70 -0
  115. package/packages/FormMaking/custom/items/input.vue +33 -0
  116. package/packages/FormMaking/custom/items/login.vue +13 -0
  117. package/packages/FormMaking/custom/items/number.vue +24 -0
  118. package/packages/FormMaking/custom/items/radio.vue +44 -0
  119. package/packages/FormMaking/custom/items/rate.vue +20 -0
  120. package/packages/FormMaking/custom/items/select.vue +32 -0
  121. package/packages/FormMaking/custom/items/slider.vue +34 -0
  122. package/packages/FormMaking/custom/items/switch.vue +22 -0
  123. package/packages/FormMaking/custom/items/table.vue +106 -0
  124. package/packages/FormMaking/custom/items/table_h5.vue +126 -0
  125. package/packages/FormMaking/custom/items/tabs.vue +145 -0
  126. package/packages/FormMaking/custom/items/text.vue +18 -0
  127. package/packages/FormMaking/custom/items/textarea.vue +37 -0
  128. package/packages/FormMaking/custom/items/time.vue +32 -0
  129. package/packages/FormMaking/custom/items/upload.vue +102 -0
  130. package/packages/FormMaking/custom/mixins/index.js +61 -0
  131. package/packages/FormMaking/custom/register.js +18 -0
  132. package/packages/FormMaking/generate.js +5 -0
  133. package/packages/FormMaking/iconfont/demo.css +539 -0
  134. package/packages/FormMaking/iconfont/demo_index.html +1159 -0
  135. package/packages/FormMaking/iconfont/iconfont.css +189 -0
  136. package/packages/FormMaking/iconfont/iconfont.eot +0 -0
  137. package/packages/FormMaking/iconfont/iconfont.js +1 -0
  138. package/packages/FormMaking/iconfont/iconfont.svg +155 -0
  139. package/packages/FormMaking/iconfont/iconfont.ttf +0 -0
  140. package/packages/FormMaking/iconfont/iconfont.woff +0 -0
  141. package/packages/FormMaking/iconfont/iconfont.woff2 +0 -0
  142. package/packages/FormMaking/index.js +33 -0
  143. package/packages/FormMaking/index.vue +807 -0
  144. package/packages/FormMaking/lang/en-US.js +187 -0
  145. package/packages/FormMaking/lang/zh-CN.js +187 -0
  146. package/packages/FormMaking/making.js +9 -0
  147. package/packages/FormMaking/styles/cover.scss +41 -0
  148. package/packages/FormMaking/styles/index.scss +785 -0
  149. package/packages/FormMaking/util/generateCode.js +163 -0
  150. package/packages/FormMaking/util/index.js +33 -0
  151. package/packages/FormMaking/util/request.js +28 -0
  152. package/packages/Grid/index.js +8 -0
  153. package/packages/Grid/index.vue +21 -0
  154. package/packages/GridItem/index.js +8 -0
  155. package/packages/GridItem/index.vue +69 -0
  156. package/packages/Icons/index.js +8 -0
  157. package/packages/Icons/index.vue +377 -0
  158. package/packages/Image/index.js +8 -0
  159. package/packages/Image/index.vue +146 -0
  160. package/packages/ImagePreview/index.js +8 -0
  161. package/packages/ImagePreview/index.vue +386 -0
  162. package/packages/Row/index.js +8 -0
  163. package/packages/Row/index.vue +33 -0
  164. package/packages/Table/action.js +8 -0
  165. package/packages/Table/action.vue +168 -0
  166. package/packages/Table/column.vue +63 -0
  167. package/packages/Table/index.js +8 -0
  168. package/packages/Table/index.vue +327 -0
  169. package/packages/Table/search.js +8 -0
  170. package/packages/Table/search.vue +163 -0
  171. package/packages/Table/tools.js +8 -0
  172. package/packages/Table/tools.vue +49 -0
  173. package/packages/TableMaking/custom/configs/fieldSearch.vue +17 -0
  174. package/packages/TableMaking/custom/configs/fieldTable.vue +15 -0
  175. package/packages/TableMaking/custom/items/search/index.vue +158 -0
  176. package/packages/TableMaking/custom/items/tools/index.vue +49 -0
  177. package/packages/TableMaking/generate.js +5 -0
  178. package/packages/TableMaking/generateTable.vue +560 -0
  179. package/packages/TableMaking/index.vue +229 -0
  180. package/packages/TableMaking/making.js +5 -0
  181. package/packages/TableMaking/util/index.js +433 -0
  182. package/packages/TableMaking/widgetConfig.vue +390 -0
  183. package/packages/TableMaking/widgetTable.vue +305 -0
  184. package/packages/Upload/ajax.js +85 -0
  185. package/packages/Upload/index.js +8 -0
  186. package/packages/Upload/index.vue +325 -0
  187. package/packages/Upload/upload-dragger.vue +70 -0
  188. package/packages/Upload/upload-list.vue +121 -0
  189. package/packages/Upload/upload.vue +193 -0
  190. package/packages/VueEditor/index.js +8 -0
  191. package/packages/VueEditor/index.vue +38 -0
  192. package/packages/Workflow/Log.js +99 -0
  193. package/packages/Workflow/designer/ProcessDesigner.vue +628 -0
  194. package/packages/Workflow/designer/index.js +7 -0
  195. package/packages/Workflow/designer/plugins/content-pad/contentPadProvider.js +390 -0
  196. package/packages/Workflow/designer/plugins/content-pad/index.js +6 -0
  197. package/packages/Workflow/designer/plugins/defaultEmpty.js +24 -0
  198. package/packages/Workflow/designer/plugins/descriptor/activitiDescriptor.json +1071 -0
  199. package/packages/Workflow/designer/plugins/descriptor/camundaDescriptor.json +1087 -0
  200. package/packages/Workflow/designer/plugins/descriptor/flowableDescriptor.json +1215 -0
  201. package/packages/Workflow/designer/plugins/extension-moddle/activiti/activitiExtension.js +74 -0
  202. package/packages/Workflow/designer/plugins/extension-moddle/activiti/index.js +9 -0
  203. package/packages/Workflow/designer/plugins/extension-moddle/camunda/extension.js +148 -0
  204. package/packages/Workflow/designer/plugins/extension-moddle/camunda/index.js +6 -0
  205. package/packages/Workflow/designer/plugins/extension-moddle/flowable/flowableExtension.js +74 -0
  206. package/packages/Workflow/designer/plugins/extension-moddle/flowable/index.js +9 -0
  207. package/packages/Workflow/designer/plugins/palette/CustomPalette.js +156 -0
  208. package/packages/Workflow/designer/plugins/palette/index.js +6 -0
  209. package/packages/Workflow/designer/plugins/palette/paletteProvider.js +160 -0
  210. package/packages/Workflow/designer/plugins/translate/customTranslate.js +41 -0
  211. package/packages/Workflow/designer/plugins/translate/zh.js +238 -0
  212. package/packages/Workflow/highlight/index.js +5 -0
  213. package/packages/Workflow/index.js +34 -0
  214. package/packages/Workflow/index.vue +399 -0
  215. package/packages/Workflow/modules/auto-place/CustomAutoPlace.js +81 -0
  216. package/packages/Workflow/modules/auto-place/index.js +6 -0
  217. package/packages/Workflow/modules/custom-renderer/CustomRenderer.js +17 -0
  218. package/packages/Workflow/modules/custom-renderer/index.js +6 -0
  219. package/packages/Workflow/modules/rules/CustomRules.js +16 -0
  220. package/packages/Workflow/modules/rules/index.js +6 -0
  221. package/packages/Workflow/palette/ProcessPalette.vue +106 -0
  222. package/packages/Workflow/palette/index.js +7 -0
  223. package/packages/Workflow/penal/PropertiesPanel.vue +245 -0
  224. package/packages/Workflow/penal/base/ElementBaseInfo.vue +80 -0
  225. package/packages/Workflow/penal/flow-condition/FlowCondition.vue +142 -0
  226. package/packages/Workflow/penal/form/ElementForm.vue +367 -0
  227. package/packages/Workflow/penal/index.js +7 -0
  228. package/packages/Workflow/penal/listeners/ElementListeners.vue +299 -0
  229. package/packages/Workflow/penal/listeners/UserTaskListeners.vue +322 -0
  230. package/packages/Workflow/penal/listeners/template.js +178 -0
  231. package/packages/Workflow/penal/listeners/utilSelf.js +64 -0
  232. package/packages/Workflow/penal/multi-instance/ElementMultiInstance.vue +200 -0
  233. package/packages/Workflow/penal/other/ElementOtherConfig.vue +59 -0
  234. package/packages/Workflow/penal/properties/ElementProperties.vue +135 -0
  235. package/packages/Workflow/penal/signal-message/SignalAndMessage.vue +104 -0
  236. package/packages/Workflow/penal/task/ElementTask.vue +73 -0
  237. package/packages/Workflow/penal/task/task-components/ReceiveTask.vue +97 -0
  238. package/packages/Workflow/penal/task/task-components/ScriptTask.vue +85 -0
  239. package/packages/Workflow/penal/task/task-components/UserTask.vue +535 -0
  240. package/packages/Workflow/theme/element-variables.scss +70 -0
  241. package/packages/Workflow/theme/index.scss +2 -0
  242. package/packages/Workflow/theme/process-designer.scss +157 -0
  243. package/packages/Workflow/theme/process-panel.scss +107 -0
  244. package/packages/Workflow/translations.js +25 -0
  245. package/packages/Workflow/utils.js +71 -0
  246. package/packages/index.js +160 -0
  247. package/babel.config.js +0 -15
  248. package/index.js +0 -11
  249. package/public/favicon.ico +0 -0
  250. package/public/index.html +0 -17
  251. package/src/App.vue +0 -28
  252. package/src/assets/logo.png +0 -0
  253. package/src/components/HelloWorld.vue +0 -58
  254. package/src/main.js +0 -8
@@ -0,0 +1,1617 @@
1
+ "no use strict";
2
+ !(function(window) {
3
+ if (typeof window.window != "undefined" && window.document)
4
+ return;
5
+ if (window.require && window.define)
6
+ return;
7
+
8
+ if (!window.console) {
9
+ window.console = function() {
10
+ var msgs = Array.prototype.slice.call(arguments, 0);
11
+ postMessage({type: "log", data: msgs});
12
+ };
13
+ window.console.error =
14
+ window.console.warn =
15
+ window.console.log =
16
+ window.console.trace = window.console;
17
+ }
18
+ window.window = window;
19
+ window.ace = window;
20
+
21
+ window.onerror = function(message, file, line, col, err) {
22
+ postMessage({type: "error", data: {
23
+ message: message,
24
+ data: err && err.data,
25
+ file: file,
26
+ line: line,
27
+ col: col,
28
+ stack: err && err.stack
29
+ }});
30
+ };
31
+
32
+ window.normalizeModule = function(parentId, moduleName) {
33
+ // normalize plugin requires
34
+ if (moduleName.indexOf("!") !== -1) {
35
+ var chunks = moduleName.split("!");
36
+ return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]);
37
+ }
38
+ // normalize relative requires
39
+ if (moduleName.charAt(0) == ".") {
40
+ var base = parentId.split("/").slice(0, -1).join("/");
41
+ moduleName = (base ? base + "/" : "") + moduleName;
42
+
43
+ while (moduleName.indexOf(".") !== -1 && previous != moduleName) {
44
+ var previous = moduleName;
45
+ moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
46
+ }
47
+ }
48
+
49
+ return moduleName;
50
+ };
51
+
52
+ window.require = function require(parentId, id) {
53
+ if (!id) {
54
+ id = parentId;
55
+ parentId = null;
56
+ }
57
+ if (!id.charAt)
58
+ throw new Error("worker.js require() accepts only (parentId, id) as arguments");
59
+
60
+ id = window.normalizeModule(parentId, id);
61
+
62
+ var module = window.require.modules[id];
63
+ if (module) {
64
+ if (!module.initialized) {
65
+ module.initialized = true;
66
+ module.exports = module.factory().exports;
67
+ }
68
+ return module.exports;
69
+ }
70
+
71
+ if (!window.require.tlns)
72
+ return console.log("unable to load " + id);
73
+
74
+ var path = resolveModuleId(id, window.require.tlns);
75
+ if (path.slice(-3) != ".js") path += ".js";
76
+
77
+ window.require.id = id;
78
+ window.require.modules[id] = {}; // prevent infinite loop on broken modules
79
+ importScripts(path);
80
+ return window.require(parentId, id);
81
+ };
82
+ function resolveModuleId(id, paths) {
83
+ var testPath = id, tail = "";
84
+ while (testPath) {
85
+ var alias = paths[testPath];
86
+ if (typeof alias == "string") {
87
+ return alias + tail;
88
+ } else if (alias) {
89
+ return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name);
90
+ } else if (alias === false) {
91
+ return "";
92
+ }
93
+ var i = testPath.lastIndexOf("/");
94
+ if (i === -1) break;
95
+ tail = testPath.substr(i) + tail;
96
+ testPath = testPath.slice(0, i);
97
+ }
98
+ return id;
99
+ }
100
+ window.require.modules = {};
101
+ window.require.tlns = {};
102
+
103
+ window.define = function(id, deps, factory) {
104
+ if (arguments.length == 2) {
105
+ factory = deps;
106
+ if (typeof id != "string") {
107
+ deps = id;
108
+ id = window.require.id;
109
+ }
110
+ } else if (arguments.length == 1) {
111
+ factory = id;
112
+ deps = [];
113
+ id = window.require.id;
114
+ }
115
+
116
+ if (typeof factory != "function") {
117
+ window.require.modules[id] = {
118
+ exports: factory,
119
+ initialized: true
120
+ };
121
+ return;
122
+ }
123
+
124
+ if (!deps.length)
125
+ // If there is no dependencies, we inject "require", "exports" and
126
+ // "module" as dependencies, to provide CommonJS compatibility.
127
+ deps = ["require", "exports", "module"];
128
+
129
+ var req = function(childId) {
130
+ return window.require(id, childId);
131
+ };
132
+
133
+ window.require.modules[id] = {
134
+ exports: {},
135
+ factory: function() {
136
+ var module = this;
137
+ var returnExports = factory.apply(this, deps.slice(0, factory.length).map(function(dep) {
138
+ switch (dep) {
139
+ // Because "require", "exports" and "module" aren't actual
140
+ // dependencies, we must handle them seperately.
141
+ case "require": return req;
142
+ case "exports": return module.exports;
143
+ case "module": return module;
144
+ // But for all other dependencies, we can just go ahead and
145
+ // require them.
146
+ default: return req(dep);
147
+ }
148
+ }));
149
+ if (returnExports)
150
+ module.exports = returnExports;
151
+ return module;
152
+ }
153
+ };
154
+ };
155
+ window.define.amd = {};
156
+ window.require.tlns = {};
157
+ window.initBaseUrls = function initBaseUrls(topLevelNamespaces) {
158
+ for (var i in topLevelNamespaces)
159
+ this.require.tlns[i] = topLevelNamespaces[i];
160
+ };
161
+
162
+ window.initSender = function initSender() {
163
+
164
+ var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter;
165
+ var oop = window.require("ace/lib/oop");
166
+
167
+ var Sender = function() {};
168
+
169
+ (function() {
170
+
171
+ oop.implement(this, EventEmitter);
172
+
173
+ this.callback = function(data, callbackId) {
174
+ postMessage({
175
+ type: "call",
176
+ id: callbackId,
177
+ data: data
178
+ });
179
+ };
180
+
181
+ this.emit = function(name, data) {
182
+ postMessage({
183
+ type: "event",
184
+ name: name,
185
+ data: data
186
+ });
187
+ };
188
+
189
+ }).call(Sender.prototype);
190
+
191
+ return new Sender();
192
+ };
193
+
194
+ var main = window.main = null;
195
+ var sender = window.sender = null;
196
+
197
+ window.onmessage = function(e) {
198
+ var msg = e.data;
199
+ if (msg.event && sender) {
200
+ sender._signal(msg.event, msg.data);
201
+ }
202
+ else if (msg.command) {
203
+ if (main[msg.command])
204
+ main[msg.command].apply(main, msg.args);
205
+ else if (window[msg.command])
206
+ window[msg.command].apply(window, msg.args);
207
+ else
208
+ throw new Error("Unknown command:" + msg.command);
209
+ }
210
+ else if (msg.init) {
211
+ window.initBaseUrls(msg.tlns);
212
+ sender = window.sender = window.initSender();
213
+ var clazz = this.require(msg.module)[msg.classname];
214
+ main = window.main = new clazz(sender);
215
+ }
216
+ };
217
+ })(this);
218
+
219
+ ace.define("ace/lib/oop",[], function(require, exports, module){"use strict";
220
+ exports.inherits = function (ctor, superCtor) {
221
+ ctor.super_ = superCtor;
222
+ ctor.prototype = Object.create(superCtor.prototype, {
223
+ constructor: {
224
+ value: ctor,
225
+ enumerable: false,
226
+ writable: true,
227
+ configurable: true
228
+ }
229
+ });
230
+ };
231
+ exports.mixin = function (obj, mixin) {
232
+ for (var key in mixin) {
233
+ obj[key] = mixin[key];
234
+ }
235
+ return obj;
236
+ };
237
+ exports.implement = function (proto, mixin) {
238
+ exports.mixin(proto, mixin);
239
+ };
240
+
241
+ });
242
+
243
+ ace.define("ace/apply_delta",[], function(require, exports, module){"use strict";
244
+ function throwDeltaError(delta, errorText) {
245
+ console.log("Invalid Delta:", delta);
246
+ throw "Invalid Delta: " + errorText;
247
+ }
248
+ function positionInDocument(docLines, position) {
249
+ return position.row >= 0 && position.row < docLines.length &&
250
+ position.column >= 0 && position.column <= docLines[position.row].length;
251
+ }
252
+ function validateDelta(docLines, delta) {
253
+ if (delta.action != "insert" && delta.action != "remove")
254
+ throwDeltaError(delta, "delta.action must be 'insert' or 'remove'");
255
+ if (!(delta.lines instanceof Array))
256
+ throwDeltaError(delta, "delta.lines must be an Array");
257
+ if (!delta.start || !delta.end)
258
+ throwDeltaError(delta, "delta.start/end must be an present");
259
+ var start = delta.start;
260
+ if (!positionInDocument(docLines, delta.start))
261
+ throwDeltaError(delta, "delta.start must be contained in document");
262
+ var end = delta.end;
263
+ if (delta.action == "remove" && !positionInDocument(docLines, end))
264
+ throwDeltaError(delta, "delta.end must contained in document for 'remove' actions");
265
+ var numRangeRows = end.row - start.row;
266
+ var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0));
267
+ if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars)
268
+ throwDeltaError(delta, "delta.range must match delta lines");
269
+ }
270
+ exports.applyDelta = function (docLines, delta, doNotValidate) {
271
+ var row = delta.start.row;
272
+ var startColumn = delta.start.column;
273
+ var line = docLines[row] || "";
274
+ switch (delta.action) {
275
+ case "insert":
276
+ var lines = delta.lines;
277
+ if (lines.length === 1) {
278
+ docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
279
+ }
280
+ else {
281
+ var args = [row, 1].concat(delta.lines);
282
+ docLines.splice.apply(docLines, args);
283
+ docLines[row] = line.substring(0, startColumn) + docLines[row];
284
+ docLines[row + delta.lines.length - 1] += line.substring(startColumn);
285
+ }
286
+ break;
287
+ case "remove":
288
+ var endColumn = delta.end.column;
289
+ var endRow = delta.end.row;
290
+ if (row === endRow) {
291
+ docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
292
+ }
293
+ else {
294
+ docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));
295
+ }
296
+ break;
297
+ }
298
+ };
299
+
300
+ });
301
+
302
+ ace.define("ace/lib/event_emitter",[], function(require, exports, module){"use strict";
303
+ var EventEmitter = {};
304
+ var stopPropagation = function () { this.propagationStopped = true; };
305
+ var preventDefault = function () { this.defaultPrevented = true; };
306
+ EventEmitter._emit =
307
+ EventEmitter._dispatchEvent = function (eventName, e) {
308
+ this._eventRegistry || (this._eventRegistry = {});
309
+ this._defaultHandlers || (this._defaultHandlers = {});
310
+ var listeners = this._eventRegistry[eventName] || [];
311
+ var defaultHandler = this._defaultHandlers[eventName];
312
+ if (!listeners.length && !defaultHandler)
313
+ return;
314
+ if (typeof e != "object" || !e)
315
+ e = {};
316
+ if (!e.type)
317
+ e.type = eventName;
318
+ if (!e.stopPropagation)
319
+ e.stopPropagation = stopPropagation;
320
+ if (!e.preventDefault)
321
+ e.preventDefault = preventDefault;
322
+ listeners = listeners.slice();
323
+ for (var i = 0; i < listeners.length; i++) {
324
+ listeners[i](e, this);
325
+ if (e.propagationStopped)
326
+ break;
327
+ }
328
+ if (defaultHandler && !e.defaultPrevented)
329
+ return defaultHandler(e, this);
330
+ };
331
+ EventEmitter._signal = function (eventName, e) {
332
+ var listeners = (this._eventRegistry || {})[eventName];
333
+ if (!listeners)
334
+ return;
335
+ listeners = listeners.slice();
336
+ for (var i = 0; i < listeners.length; i++)
337
+ listeners[i](e, this);
338
+ };
339
+ EventEmitter.once = function (eventName, callback) {
340
+ var _self = this;
341
+ this.on(eventName, function newCallback() {
342
+ _self.off(eventName, newCallback);
343
+ callback.apply(null, arguments);
344
+ });
345
+ if (!callback) {
346
+ return new Promise(function (resolve) {
347
+ callback = resolve;
348
+ });
349
+ }
350
+ };
351
+ EventEmitter.setDefaultHandler = function (eventName, callback) {
352
+ var handlers = this._defaultHandlers;
353
+ if (!handlers)
354
+ handlers = this._defaultHandlers = { _disabled_: {} };
355
+ if (handlers[eventName]) {
356
+ var old = handlers[eventName];
357
+ var disabled = handlers._disabled_[eventName];
358
+ if (!disabled)
359
+ handlers._disabled_[eventName] = disabled = [];
360
+ disabled.push(old);
361
+ var i = disabled.indexOf(callback);
362
+ if (i != -1)
363
+ disabled.splice(i, 1);
364
+ }
365
+ handlers[eventName] = callback;
366
+ };
367
+ EventEmitter.removeDefaultHandler = function (eventName, callback) {
368
+ var handlers = this._defaultHandlers;
369
+ if (!handlers)
370
+ return;
371
+ var disabled = handlers._disabled_[eventName];
372
+ if (handlers[eventName] == callback) {
373
+ if (disabled)
374
+ this.setDefaultHandler(eventName, disabled.pop());
375
+ }
376
+ else if (disabled) {
377
+ var i = disabled.indexOf(callback);
378
+ if (i != -1)
379
+ disabled.splice(i, 1);
380
+ }
381
+ };
382
+ EventEmitter.on =
383
+ EventEmitter.addEventListener = function (eventName, callback, capturing) {
384
+ this._eventRegistry = this._eventRegistry || {};
385
+ var listeners = this._eventRegistry[eventName];
386
+ if (!listeners)
387
+ listeners = this._eventRegistry[eventName] = [];
388
+ if (listeners.indexOf(callback) == -1)
389
+ listeners[capturing ? "unshift" : "push"](callback);
390
+ return callback;
391
+ };
392
+ EventEmitter.off =
393
+ EventEmitter.removeListener =
394
+ EventEmitter.removeEventListener = function (eventName, callback) {
395
+ this._eventRegistry = this._eventRegistry || {};
396
+ var listeners = this._eventRegistry[eventName];
397
+ if (!listeners)
398
+ return;
399
+ var index = listeners.indexOf(callback);
400
+ if (index !== -1)
401
+ listeners.splice(index, 1);
402
+ };
403
+ EventEmitter.removeAllListeners = function (eventName) {
404
+ if (!eventName)
405
+ this._eventRegistry = this._defaultHandlers = undefined;
406
+ if (this._eventRegistry)
407
+ this._eventRegistry[eventName] = undefined;
408
+ if (this._defaultHandlers)
409
+ this._defaultHandlers[eventName] = undefined;
410
+ };
411
+ exports.EventEmitter = EventEmitter;
412
+
413
+ });
414
+
415
+ ace.define("ace/range",[], function(require, exports, module){"use strict";
416
+ var comparePoints = function (p1, p2) {
417
+ return p1.row - p2.row || p1.column - p2.column;
418
+ };
419
+ var Range = function (startRow, startColumn, endRow, endColumn) {
420
+ this.start = {
421
+ row: startRow,
422
+ column: startColumn
423
+ };
424
+ this.end = {
425
+ row: endRow,
426
+ column: endColumn
427
+ };
428
+ };
429
+ (function () {
430
+ this.isEqual = function (range) {
431
+ return this.start.row === range.start.row &&
432
+ this.end.row === range.end.row &&
433
+ this.start.column === range.start.column &&
434
+ this.end.column === range.end.column;
435
+ };
436
+ this.toString = function () {
437
+ return ("Range: [" + this.start.row + "/" + this.start.column +
438
+ "] -> [" + this.end.row + "/" + this.end.column + "]");
439
+ };
440
+ this.contains = function (row, column) {
441
+ return this.compare(row, column) == 0;
442
+ };
443
+ this.compareRange = function (range) {
444
+ var cmp, end = range.end, start = range.start;
445
+ cmp = this.compare(end.row, end.column);
446
+ if (cmp == 1) {
447
+ cmp = this.compare(start.row, start.column);
448
+ if (cmp == 1) {
449
+ return 2;
450
+ }
451
+ else if (cmp == 0) {
452
+ return 1;
453
+ }
454
+ else {
455
+ return 0;
456
+ }
457
+ }
458
+ else if (cmp == -1) {
459
+ return -2;
460
+ }
461
+ else {
462
+ cmp = this.compare(start.row, start.column);
463
+ if (cmp == -1) {
464
+ return -1;
465
+ }
466
+ else if (cmp == 1) {
467
+ return 42;
468
+ }
469
+ else {
470
+ return 0;
471
+ }
472
+ }
473
+ };
474
+ this.comparePoint = function (p) {
475
+ return this.compare(p.row, p.column);
476
+ };
477
+ this.containsRange = function (range) {
478
+ return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
479
+ };
480
+ this.intersects = function (range) {
481
+ var cmp = this.compareRange(range);
482
+ return (cmp == -1 || cmp == 0 || cmp == 1);
483
+ };
484
+ this.isEnd = function (row, column) {
485
+ return this.end.row == row && this.end.column == column;
486
+ };
487
+ this.isStart = function (row, column) {
488
+ return this.start.row == row && this.start.column == column;
489
+ };
490
+ this.setStart = function (row, column) {
491
+ if (typeof row == "object") {
492
+ this.start.column = row.column;
493
+ this.start.row = row.row;
494
+ }
495
+ else {
496
+ this.start.row = row;
497
+ this.start.column = column;
498
+ }
499
+ };
500
+ this.setEnd = function (row, column) {
501
+ if (typeof row == "object") {
502
+ this.end.column = row.column;
503
+ this.end.row = row.row;
504
+ }
505
+ else {
506
+ this.end.row = row;
507
+ this.end.column = column;
508
+ }
509
+ };
510
+ this.inside = function (row, column) {
511
+ if (this.compare(row, column) == 0) {
512
+ if (this.isEnd(row, column) || this.isStart(row, column)) {
513
+ return false;
514
+ }
515
+ else {
516
+ return true;
517
+ }
518
+ }
519
+ return false;
520
+ };
521
+ this.insideStart = function (row, column) {
522
+ if (this.compare(row, column) == 0) {
523
+ if (this.isEnd(row, column)) {
524
+ return false;
525
+ }
526
+ else {
527
+ return true;
528
+ }
529
+ }
530
+ return false;
531
+ };
532
+ this.insideEnd = function (row, column) {
533
+ if (this.compare(row, column) == 0) {
534
+ if (this.isStart(row, column)) {
535
+ return false;
536
+ }
537
+ else {
538
+ return true;
539
+ }
540
+ }
541
+ return false;
542
+ };
543
+ this.compare = function (row, column) {
544
+ if (!this.isMultiLine()) {
545
+ if (row === this.start.row) {
546
+ return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0);
547
+ }
548
+ }
549
+ if (row < this.start.row)
550
+ return -1;
551
+ if (row > this.end.row)
552
+ return 1;
553
+ if (this.start.row === row)
554
+ return column >= this.start.column ? 0 : -1;
555
+ if (this.end.row === row)
556
+ return column <= this.end.column ? 0 : 1;
557
+ return 0;
558
+ };
559
+ this.compareStart = function (row, column) {
560
+ if (this.start.row == row && this.start.column == column) {
561
+ return -1;
562
+ }
563
+ else {
564
+ return this.compare(row, column);
565
+ }
566
+ };
567
+ this.compareEnd = function (row, column) {
568
+ if (this.end.row == row && this.end.column == column) {
569
+ return 1;
570
+ }
571
+ else {
572
+ return this.compare(row, column);
573
+ }
574
+ };
575
+ this.compareInside = function (row, column) {
576
+ if (this.end.row == row && this.end.column == column) {
577
+ return 1;
578
+ }
579
+ else if (this.start.row == row && this.start.column == column) {
580
+ return -1;
581
+ }
582
+ else {
583
+ return this.compare(row, column);
584
+ }
585
+ };
586
+ this.clipRows = function (firstRow, lastRow) {
587
+ if (this.end.row > lastRow)
588
+ var end = { row: lastRow + 1, column: 0 };
589
+ else if (this.end.row < firstRow)
590
+ var end = { row: firstRow, column: 0 };
591
+ if (this.start.row > lastRow)
592
+ var start = { row: lastRow + 1, column: 0 };
593
+ else if (this.start.row < firstRow)
594
+ var start = { row: firstRow, column: 0 };
595
+ return Range.fromPoints(start || this.start, end || this.end);
596
+ };
597
+ this.extend = function (row, column) {
598
+ var cmp = this.compare(row, column);
599
+ if (cmp == 0)
600
+ return this;
601
+ else if (cmp == -1)
602
+ var start = { row: row, column: column };
603
+ else
604
+ var end = { row: row, column: column };
605
+ return Range.fromPoints(start || this.start, end || this.end);
606
+ };
607
+ this.isEmpty = function () {
608
+ return (this.start.row === this.end.row && this.start.column === this.end.column);
609
+ };
610
+ this.isMultiLine = function () {
611
+ return (this.start.row !== this.end.row);
612
+ };
613
+ this.clone = function () {
614
+ return Range.fromPoints(this.start, this.end);
615
+ };
616
+ this.collapseRows = function () {
617
+ if (this.end.column == 0)
618
+ return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);
619
+ else
620
+ return new Range(this.start.row, 0, this.end.row, 0);
621
+ };
622
+ this.toScreenRange = function (session) {
623
+ var screenPosStart = session.documentToScreenPosition(this.start);
624
+ var screenPosEnd = session.documentToScreenPosition(this.end);
625
+ return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);
626
+ };
627
+ this.moveBy = function (row, column) {
628
+ this.start.row += row;
629
+ this.start.column += column;
630
+ this.end.row += row;
631
+ this.end.column += column;
632
+ };
633
+ }).call(Range.prototype);
634
+ Range.fromPoints = function (start, end) {
635
+ return new Range(start.row, start.column, end.row, end.column);
636
+ };
637
+ Range.comparePoints = comparePoints;
638
+ Range.comparePoints = function (p1, p2) {
639
+ return p1.row - p2.row || p1.column - p2.column;
640
+ };
641
+ exports.Range = Range;
642
+
643
+ });
644
+
645
+ ace.define("ace/anchor",[], function(require, exports, module){"use strict";
646
+ var oop = require("./lib/oop");
647
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
648
+ var Anchor = exports.Anchor = function (doc, row, column) {
649
+ this.$onChange = this.onChange.bind(this);
650
+ this.attach(doc);
651
+ if (typeof column == "undefined")
652
+ this.setPosition(row.row, row.column);
653
+ else
654
+ this.setPosition(row, column);
655
+ };
656
+ (function () {
657
+ oop.implement(this, EventEmitter);
658
+ this.getPosition = function () {
659
+ return this.$clipPositionToDocument(this.row, this.column);
660
+ };
661
+ this.getDocument = function () {
662
+ return this.document;
663
+ };
664
+ this.$insertRight = false;
665
+ this.onChange = function (delta) {
666
+ if (delta.start.row == delta.end.row && delta.start.row != this.row)
667
+ return;
668
+ if (delta.start.row > this.row)
669
+ return;
670
+ var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);
671
+ this.setPosition(point.row, point.column, true);
672
+ };
673
+ function $pointsInOrder(point1, point2, equalPointsInOrder) {
674
+ var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
675
+ return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter);
676
+ }
677
+ function $getTransformedPoint(delta, point, moveIfEqual) {
678
+ var deltaIsInsert = delta.action == "insert";
679
+ var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
680
+ var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
681
+ var deltaStart = delta.start;
682
+ var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range.
683
+ if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
684
+ return {
685
+ row: point.row,
686
+ column: point.column
687
+ };
688
+ }
689
+ if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
690
+ return {
691
+ row: point.row + deltaRowShift,
692
+ column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
693
+ };
694
+ }
695
+ return {
696
+ row: deltaStart.row,
697
+ column: deltaStart.column
698
+ };
699
+ }
700
+ this.setPosition = function (row, column, noClip) {
701
+ var pos;
702
+ if (noClip) {
703
+ pos = {
704
+ row: row,
705
+ column: column
706
+ };
707
+ }
708
+ else {
709
+ pos = this.$clipPositionToDocument(row, column);
710
+ }
711
+ if (this.row == pos.row && this.column == pos.column)
712
+ return;
713
+ var old = {
714
+ row: this.row,
715
+ column: this.column
716
+ };
717
+ this.row = pos.row;
718
+ this.column = pos.column;
719
+ this._signal("change", {
720
+ old: old,
721
+ value: pos
722
+ });
723
+ };
724
+ this.detach = function () {
725
+ this.document.off("change", this.$onChange);
726
+ };
727
+ this.attach = function (doc) {
728
+ this.document = doc || this.document;
729
+ this.document.on("change", this.$onChange);
730
+ };
731
+ this.$clipPositionToDocument = function (row, column) {
732
+ var pos = {};
733
+ if (row >= this.document.getLength()) {
734
+ pos.row = Math.max(0, this.document.getLength() - 1);
735
+ pos.column = this.document.getLine(pos.row).length;
736
+ }
737
+ else if (row < 0) {
738
+ pos.row = 0;
739
+ pos.column = 0;
740
+ }
741
+ else {
742
+ pos.row = row;
743
+ pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
744
+ }
745
+ if (column < 0)
746
+ pos.column = 0;
747
+ return pos;
748
+ };
749
+ }).call(Anchor.prototype);
750
+
751
+ });
752
+
753
+ ace.define("ace/document",[], function(require, exports, module){"use strict";
754
+ var oop = require("./lib/oop");
755
+ var applyDelta = require("./apply_delta").applyDelta;
756
+ var EventEmitter = require("./lib/event_emitter").EventEmitter;
757
+ var Range = require("./range").Range;
758
+ var Anchor = require("./anchor").Anchor;
759
+ var Document = function (textOrLines) {
760
+ this.$lines = [""];
761
+ if (textOrLines.length === 0) {
762
+ this.$lines = [""];
763
+ }
764
+ else if (Array.isArray(textOrLines)) {
765
+ this.insertMergedLines({ row: 0, column: 0 }, textOrLines);
766
+ }
767
+ else {
768
+ this.insert({ row: 0, column: 0 }, textOrLines);
769
+ }
770
+ };
771
+ (function () {
772
+ oop.implement(this, EventEmitter);
773
+ this.setValue = function (text) {
774
+ var len = this.getLength() - 1;
775
+ this.remove(new Range(0, 0, len, this.getLine(len).length));
776
+ this.insert({ row: 0, column: 0 }, text || "");
777
+ };
778
+ this.getValue = function () {
779
+ return this.getAllLines().join(this.getNewLineCharacter());
780
+ };
781
+ this.createAnchor = function (row, column) {
782
+ return new Anchor(this, row, column);
783
+ };
784
+ if ("aaa".split(/a/).length === 0) {
785
+ this.$split = function (text) {
786
+ return text.replace(/\r\n|\r/g, "\n").split("\n");
787
+ };
788
+ }
789
+ else {
790
+ this.$split = function (text) {
791
+ return text.split(/\r\n|\r|\n/);
792
+ };
793
+ }
794
+ this.$detectNewLine = function (text) {
795
+ var match = text.match(/^.*?(\r\n|\r|\n)/m);
796
+ this.$autoNewLine = match ? match[1] : "\n";
797
+ this._signal("changeNewLineMode");
798
+ };
799
+ this.getNewLineCharacter = function () {
800
+ switch (this.$newLineMode) {
801
+ case "windows":
802
+ return "\r\n";
803
+ case "unix":
804
+ return "\n";
805
+ default:
806
+ return this.$autoNewLine || "\n";
807
+ }
808
+ };
809
+ this.$autoNewLine = "";
810
+ this.$newLineMode = "auto";
811
+ this.setNewLineMode = function (newLineMode) {
812
+ if (this.$newLineMode === newLineMode)
813
+ return;
814
+ this.$newLineMode = newLineMode;
815
+ this._signal("changeNewLineMode");
816
+ };
817
+ this.getNewLineMode = function () {
818
+ return this.$newLineMode;
819
+ };
820
+ this.isNewLine = function (text) {
821
+ return (text == "\r\n" || text == "\r" || text == "\n");
822
+ };
823
+ this.getLine = function (row) {
824
+ return this.$lines[row] || "";
825
+ };
826
+ this.getLines = function (firstRow, lastRow) {
827
+ return this.$lines.slice(firstRow, lastRow + 1);
828
+ };
829
+ this.getAllLines = function () {
830
+ return this.getLines(0, this.getLength());
831
+ };
832
+ this.getLength = function () {
833
+ return this.$lines.length;
834
+ };
835
+ this.getTextRange = function (range) {
836
+ return this.getLinesForRange(range).join(this.getNewLineCharacter());
837
+ };
838
+ this.getLinesForRange = function (range) {
839
+ var lines;
840
+ if (range.start.row === range.end.row) {
841
+ lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
842
+ }
843
+ else {
844
+ lines = this.getLines(range.start.row, range.end.row);
845
+ lines[0] = (lines[0] || "").substring(range.start.column);
846
+ var l = lines.length - 1;
847
+ if (range.end.row - range.start.row == l)
848
+ lines[l] = lines[l].substring(0, range.end.column);
849
+ }
850
+ return lines;
851
+ };
852
+ this.insertLines = function (row, lines) {
853
+ console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
854
+ return this.insertFullLines(row, lines);
855
+ };
856
+ this.removeLines = function (firstRow, lastRow) {
857
+ console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
858
+ return this.removeFullLines(firstRow, lastRow);
859
+ };
860
+ this.insertNewLine = function (position) {
861
+ console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
862
+ return this.insertMergedLines(position, ["", ""]);
863
+ };
864
+ this.insert = function (position, text) {
865
+ if (this.getLength() <= 1)
866
+ this.$detectNewLine(text);
867
+ return this.insertMergedLines(position, this.$split(text));
868
+ };
869
+ this.insertInLine = function (position, text) {
870
+ var start = this.clippedPos(position.row, position.column);
871
+ var end = this.pos(position.row, position.column + text.length);
872
+ this.applyDelta({
873
+ start: start,
874
+ end: end,
875
+ action: "insert",
876
+ lines: [text]
877
+ }, true);
878
+ return this.clonePos(end);
879
+ };
880
+ this.clippedPos = function (row, column) {
881
+ var length = this.getLength();
882
+ if (row === undefined) {
883
+ row = length;
884
+ }
885
+ else if (row < 0) {
886
+ row = 0;
887
+ }
888
+ else if (row >= length) {
889
+ row = length - 1;
890
+ column = undefined;
891
+ }
892
+ var line = this.getLine(row);
893
+ if (column == undefined)
894
+ column = line.length;
895
+ column = Math.min(Math.max(column, 0), line.length);
896
+ return { row: row, column: column };
897
+ };
898
+ this.clonePos = function (pos) {
899
+ return { row: pos.row, column: pos.column };
900
+ };
901
+ this.pos = function (row, column) {
902
+ return { row: row, column: column };
903
+ };
904
+ this.$clipPosition = function (position) {
905
+ var length = this.getLength();
906
+ if (position.row >= length) {
907
+ position.row = Math.max(0, length - 1);
908
+ position.column = this.getLine(length - 1).length;
909
+ }
910
+ else {
911
+ position.row = Math.max(0, position.row);
912
+ position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
913
+ }
914
+ return position;
915
+ };
916
+ this.insertFullLines = function (row, lines) {
917
+ row = Math.min(Math.max(row, 0), this.getLength());
918
+ var column = 0;
919
+ if (row < this.getLength()) {
920
+ lines = lines.concat([""]);
921
+ column = 0;
922
+ }
923
+ else {
924
+ lines = [""].concat(lines);
925
+ row--;
926
+ column = this.$lines[row].length;
927
+ }
928
+ this.insertMergedLines({ row: row, column: column }, lines);
929
+ };
930
+ this.insertMergedLines = function (position, lines) {
931
+ var start = this.clippedPos(position.row, position.column);
932
+ var end = {
933
+ row: start.row + lines.length - 1,
934
+ column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
935
+ };
936
+ this.applyDelta({
937
+ start: start,
938
+ end: end,
939
+ action: "insert",
940
+ lines: lines
941
+ });
942
+ return this.clonePos(end);
943
+ };
944
+ this.remove = function (range) {
945
+ var start = this.clippedPos(range.start.row, range.start.column);
946
+ var end = this.clippedPos(range.end.row, range.end.column);
947
+ this.applyDelta({
948
+ start: start,
949
+ end: end,
950
+ action: "remove",
951
+ lines: this.getLinesForRange({ start: start, end: end })
952
+ });
953
+ return this.clonePos(start);
954
+ };
955
+ this.removeInLine = function (row, startColumn, endColumn) {
956
+ var start = this.clippedPos(row, startColumn);
957
+ var end = this.clippedPos(row, endColumn);
958
+ this.applyDelta({
959
+ start: start,
960
+ end: end,
961
+ action: "remove",
962
+ lines: this.getLinesForRange({ start: start, end: end })
963
+ }, true);
964
+ return this.clonePos(start);
965
+ };
966
+ this.removeFullLines = function (firstRow, lastRow) {
967
+ firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
968
+ lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);
969
+ var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
970
+ var deleteLastNewLine = lastRow < this.getLength() - 1;
971
+ var startRow = (deleteFirstNewLine ? firstRow - 1 : firstRow);
972
+ var startCol = (deleteFirstNewLine ? this.getLine(startRow).length : 0);
973
+ var endRow = (deleteLastNewLine ? lastRow + 1 : lastRow);
974
+ var endCol = (deleteLastNewLine ? 0 : this.getLine(endRow).length);
975
+ var range = new Range(startRow, startCol, endRow, endCol);
976
+ var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
977
+ this.applyDelta({
978
+ start: range.start,
979
+ end: range.end,
980
+ action: "remove",
981
+ lines: this.getLinesForRange(range)
982
+ });
983
+ return deletedLines;
984
+ };
985
+ this.removeNewLine = function (row) {
986
+ if (row < this.getLength() - 1 && row >= 0) {
987
+ this.applyDelta({
988
+ start: this.pos(row, this.getLine(row).length),
989
+ end: this.pos(row + 1, 0),
990
+ action: "remove",
991
+ lines: ["", ""]
992
+ });
993
+ }
994
+ };
995
+ this.replace = function (range, text) {
996
+ if (!(range instanceof Range))
997
+ range = Range.fromPoints(range.start, range.end);
998
+ if (text.length === 0 && range.isEmpty())
999
+ return range.start;
1000
+ if (text == this.getTextRange(range))
1001
+ return range.end;
1002
+ this.remove(range);
1003
+ var end;
1004
+ if (text) {
1005
+ end = this.insert(range.start, text);
1006
+ }
1007
+ else {
1008
+ end = range.start;
1009
+ }
1010
+ return end;
1011
+ };
1012
+ this.applyDeltas = function (deltas) {
1013
+ for (var i = 0; i < deltas.length; i++) {
1014
+ this.applyDelta(deltas[i]);
1015
+ }
1016
+ };
1017
+ this.revertDeltas = function (deltas) {
1018
+ for (var i = deltas.length - 1; i >= 0; i--) {
1019
+ this.revertDelta(deltas[i]);
1020
+ }
1021
+ };
1022
+ this.applyDelta = function (delta, doNotValidate) {
1023
+ var isInsert = delta.action == "insert";
1024
+ if (isInsert ? delta.lines.length <= 1 && !delta.lines[0]
1025
+ : !Range.comparePoints(delta.start, delta.end)) {
1026
+ return;
1027
+ }
1028
+ if (isInsert && delta.lines.length > 20000) {
1029
+ this.$splitAndapplyLargeDelta(delta, 20000);
1030
+ }
1031
+ else {
1032
+ applyDelta(this.$lines, delta, doNotValidate);
1033
+ this._signal("change", delta);
1034
+ }
1035
+ };
1036
+ this.$safeApplyDelta = function (delta) {
1037
+ var docLength = this.$lines.length;
1038
+ if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength
1039
+ || delta.action == "insert" && delta.start.row <= docLength) {
1040
+ this.applyDelta(delta);
1041
+ }
1042
+ };
1043
+ this.$splitAndapplyLargeDelta = function (delta, MAX) {
1044
+ var lines = delta.lines;
1045
+ var l = lines.length - MAX + 1;
1046
+ var row = delta.start.row;
1047
+ var column = delta.start.column;
1048
+ for (var from = 0, to = 0; from < l; from = to) {
1049
+ to += MAX - 1;
1050
+ var chunk = lines.slice(from, to);
1051
+ chunk.push("");
1052
+ this.applyDelta({
1053
+ start: this.pos(row + from, column),
1054
+ end: this.pos(row + to, column = 0),
1055
+ action: delta.action,
1056
+ lines: chunk
1057
+ }, true);
1058
+ }
1059
+ delta.lines = lines.slice(from);
1060
+ delta.start.row = row + from;
1061
+ delta.start.column = column;
1062
+ this.applyDelta(delta, true);
1063
+ };
1064
+ this.revertDelta = function (delta) {
1065
+ this.$safeApplyDelta({
1066
+ start: this.clonePos(delta.start),
1067
+ end: this.clonePos(delta.end),
1068
+ action: (delta.action == "insert" ? "remove" : "insert"),
1069
+ lines: delta.lines.slice()
1070
+ });
1071
+ };
1072
+ this.indexToPosition = function (index, startRow) {
1073
+ var lines = this.$lines || this.getAllLines();
1074
+ var newlineLength = this.getNewLineCharacter().length;
1075
+ for (var i = startRow || 0, l = lines.length; i < l; i++) {
1076
+ index -= lines[i].length + newlineLength;
1077
+ if (index < 0)
1078
+ return { row: i, column: index + lines[i].length + newlineLength };
1079
+ }
1080
+ return { row: l - 1, column: index + lines[l - 1].length + newlineLength };
1081
+ };
1082
+ this.positionToIndex = function (pos, startRow) {
1083
+ var lines = this.$lines || this.getAllLines();
1084
+ var newlineLength = this.getNewLineCharacter().length;
1085
+ var index = 0;
1086
+ var row = Math.min(pos.row, lines.length);
1087
+ for (var i = startRow || 0; i < row; ++i)
1088
+ index += lines[i].length + newlineLength;
1089
+ return index + pos.column;
1090
+ };
1091
+ }).call(Document.prototype);
1092
+ exports.Document = Document;
1093
+
1094
+ });
1095
+
1096
+ ace.define("ace/lib/lang",[], function(require, exports, module){"use strict";
1097
+ exports.last = function (a) {
1098
+ return a[a.length - 1];
1099
+ };
1100
+ exports.stringReverse = function (string) {
1101
+ return string.split("").reverse().join("");
1102
+ };
1103
+ exports.stringRepeat = function (string, count) {
1104
+ var result = '';
1105
+ while (count > 0) {
1106
+ if (count & 1)
1107
+ result += string;
1108
+ if (count >>= 1)
1109
+ string += string;
1110
+ }
1111
+ return result;
1112
+ };
1113
+ var trimBeginRegexp = /^\s\s*/;
1114
+ var trimEndRegexp = /\s\s*$/;
1115
+ exports.stringTrimLeft = function (string) {
1116
+ return string.replace(trimBeginRegexp, '');
1117
+ };
1118
+ exports.stringTrimRight = function (string) {
1119
+ return string.replace(trimEndRegexp, '');
1120
+ };
1121
+ exports.copyObject = function (obj) {
1122
+ var copy = {};
1123
+ for (var key in obj) {
1124
+ copy[key] = obj[key];
1125
+ }
1126
+ return copy;
1127
+ };
1128
+ exports.copyArray = function (array) {
1129
+ var copy = [];
1130
+ for (var i = 0, l = array.length; i < l; i++) {
1131
+ if (array[i] && typeof array[i] == "object")
1132
+ copy[i] = this.copyObject(array[i]);
1133
+ else
1134
+ copy[i] = array[i];
1135
+ }
1136
+ return copy;
1137
+ };
1138
+ exports.deepCopy = function deepCopy(obj) {
1139
+ if (typeof obj !== "object" || !obj)
1140
+ return obj;
1141
+ var copy;
1142
+ if (Array.isArray(obj)) {
1143
+ copy = [];
1144
+ for (var key = 0; key < obj.length; key++) {
1145
+ copy[key] = deepCopy(obj[key]);
1146
+ }
1147
+ return copy;
1148
+ }
1149
+ if (Object.prototype.toString.call(obj) !== "[object Object]")
1150
+ return obj;
1151
+ copy = {};
1152
+ for (var key in obj)
1153
+ copy[key] = deepCopy(obj[key]);
1154
+ return copy;
1155
+ };
1156
+ exports.arrayToMap = function (arr) {
1157
+ var map = {};
1158
+ for (var i = 0; i < arr.length; i++) {
1159
+ map[arr[i]] = 1;
1160
+ }
1161
+ return map;
1162
+ };
1163
+ exports.createMap = function (props) {
1164
+ var map = Object.create(null);
1165
+ for (var i in props) {
1166
+ map[i] = props[i];
1167
+ }
1168
+ return map;
1169
+ };
1170
+ exports.arrayRemove = function (array, value) {
1171
+ for (var i = 0; i <= array.length; i++) {
1172
+ if (value === array[i]) {
1173
+ array.splice(i, 1);
1174
+ }
1175
+ }
1176
+ };
1177
+ exports.escapeRegExp = function (str) {
1178
+ return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
1179
+ };
1180
+ exports.escapeHTML = function (str) {
1181
+ return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
1182
+ };
1183
+ exports.getMatchOffsets = function (string, regExp) {
1184
+ var matches = [];
1185
+ string.replace(regExp, function (str) {
1186
+ matches.push({
1187
+ offset: arguments[arguments.length - 2],
1188
+ length: str.length
1189
+ });
1190
+ });
1191
+ return matches;
1192
+ };
1193
+ exports.deferredCall = function (fcn) {
1194
+ var timer = null;
1195
+ var callback = function () {
1196
+ timer = null;
1197
+ fcn();
1198
+ };
1199
+ var deferred = function (timeout) {
1200
+ deferred.cancel();
1201
+ timer = setTimeout(callback, timeout || 0);
1202
+ return deferred;
1203
+ };
1204
+ deferred.schedule = deferred;
1205
+ deferred.call = function () {
1206
+ this.cancel();
1207
+ fcn();
1208
+ return deferred;
1209
+ };
1210
+ deferred.cancel = function () {
1211
+ clearTimeout(timer);
1212
+ timer = null;
1213
+ return deferred;
1214
+ };
1215
+ deferred.isPending = function () {
1216
+ return timer;
1217
+ };
1218
+ return deferred;
1219
+ };
1220
+ exports.delayedCall = function (fcn, defaultTimeout) {
1221
+ var timer = null;
1222
+ var callback = function () {
1223
+ timer = null;
1224
+ fcn();
1225
+ };
1226
+ var _self = function (timeout) {
1227
+ if (timer == null)
1228
+ timer = setTimeout(callback, timeout || defaultTimeout);
1229
+ };
1230
+ _self.delay = function (timeout) {
1231
+ timer && clearTimeout(timer);
1232
+ timer = setTimeout(callback, timeout || defaultTimeout);
1233
+ };
1234
+ _self.schedule = _self;
1235
+ _self.call = function () {
1236
+ this.cancel();
1237
+ fcn();
1238
+ };
1239
+ _self.cancel = function () {
1240
+ timer && clearTimeout(timer);
1241
+ timer = null;
1242
+ };
1243
+ _self.isPending = function () {
1244
+ return timer;
1245
+ };
1246
+ return _self;
1247
+ };
1248
+
1249
+ });
1250
+
1251
+ ace.define("ace/worker/mirror",[], function(require, exports, module) {
1252
+ "use strict";
1253
+
1254
+ var Document = require("../document").Document;
1255
+ var lang = require("../lib/lang");
1256
+
1257
+ var Mirror = exports.Mirror = function(sender) {
1258
+ this.sender = sender;
1259
+ var doc = this.doc = new Document("");
1260
+
1261
+ var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this));
1262
+
1263
+ var _self = this;
1264
+ sender.on("change", function(e) {
1265
+ var data = e.data;
1266
+ if (data[0].start) {
1267
+ doc.applyDeltas(data);
1268
+ } else {
1269
+ for (var i = 0; i < data.length; i += 2) {
1270
+ var d, err;
1271
+ if (Array.isArray(data[i+1])) {
1272
+ d = {action: "insert", start: data[i], lines: data[i+1]};
1273
+ } else {
1274
+ d = {action: "remove", start: data[i], end: data[i+1]};
1275
+ }
1276
+
1277
+ if ((d.action == "insert" ? d.start : d.end).row >= doc.$lines.length) {
1278
+ err = new Error("Invalid delta");
1279
+ err.data = {
1280
+ path: _self.$path,
1281
+ linesLength: doc.$lines.length,
1282
+ start: d.start,
1283
+ end: d.end
1284
+ };
1285
+ throw err;
1286
+ }
1287
+
1288
+ doc.applyDelta(d, true);
1289
+ }
1290
+ }
1291
+ if (_self.$timeout)
1292
+ return deferredUpdate.schedule(_self.$timeout);
1293
+ _self.onUpdate();
1294
+ });
1295
+ };
1296
+
1297
+ (function() {
1298
+
1299
+ this.$timeout = 500;
1300
+
1301
+ this.setTimeout = function(timeout) {
1302
+ this.$timeout = timeout;
1303
+ };
1304
+
1305
+ this.setValue = function(value) {
1306
+ this.doc.setValue(value);
1307
+ this.deferredUpdate.schedule(this.$timeout);
1308
+ };
1309
+
1310
+ this.getValue = function(callbackId) {
1311
+ this.sender.callback(this.doc.getValue(), callbackId);
1312
+ };
1313
+
1314
+ this.onUpdate = function() {
1315
+ };
1316
+
1317
+ this.isPending = function() {
1318
+ return this.deferredUpdate.isPending();
1319
+ };
1320
+
1321
+ }).call(Mirror.prototype);
1322
+
1323
+ });
1324
+
1325
+ ace.define("ace/mode/json/json_parse",[], function(require, exports, module) {
1326
+ "use strict";
1327
+
1328
+ var at, // The index of the current character
1329
+ ch, // The current character
1330
+ escapee = {
1331
+ '"': '"',
1332
+ '\\': '\\',
1333
+ '/': '/',
1334
+ b: '\b',
1335
+ f: '\f',
1336
+ n: '\n',
1337
+ r: '\r',
1338
+ t: '\t'
1339
+ },
1340
+ text,
1341
+
1342
+ error = function (m) {
1343
+
1344
+ throw {
1345
+ name: 'SyntaxError',
1346
+ message: m,
1347
+ at: at,
1348
+ text: text
1349
+ };
1350
+ },
1351
+
1352
+ next = function (c) {
1353
+
1354
+ if (c && c !== ch) {
1355
+ error("Expected '" + c + "' instead of '" + ch + "'");
1356
+ }
1357
+
1358
+ ch = text.charAt(at);
1359
+ at += 1;
1360
+ return ch;
1361
+ },
1362
+
1363
+ number = function () {
1364
+
1365
+ var number,
1366
+ string = '';
1367
+
1368
+ if (ch === '-') {
1369
+ string = '-';
1370
+ next('-');
1371
+ }
1372
+ while (ch >= '0' && ch <= '9') {
1373
+ string += ch;
1374
+ next();
1375
+ }
1376
+ if (ch === '.') {
1377
+ string += '.';
1378
+ while (next() && ch >= '0' && ch <= '9') {
1379
+ string += ch;
1380
+ }
1381
+ }
1382
+ if (ch === 'e' || ch === 'E') {
1383
+ string += ch;
1384
+ next();
1385
+ if (ch === '-' || ch === '+') {
1386
+ string += ch;
1387
+ next();
1388
+ }
1389
+ while (ch >= '0' && ch <= '9') {
1390
+ string += ch;
1391
+ next();
1392
+ }
1393
+ }
1394
+ number = +string;
1395
+ if (isNaN(number)) {
1396
+ error("Bad number");
1397
+ } else {
1398
+ return number;
1399
+ }
1400
+ },
1401
+
1402
+ string = function () {
1403
+
1404
+ var hex,
1405
+ i,
1406
+ string = '',
1407
+ uffff;
1408
+
1409
+ if (ch === '"') {
1410
+ while (next()) {
1411
+ if (ch === '"') {
1412
+ next();
1413
+ return string;
1414
+ } else if (ch === '\\') {
1415
+ next();
1416
+ if (ch === 'u') {
1417
+ uffff = 0;
1418
+ for (i = 0; i < 4; i += 1) {
1419
+ hex = parseInt(next(), 16);
1420
+ if (!isFinite(hex)) {
1421
+ break;
1422
+ }
1423
+ uffff = uffff * 16 + hex;
1424
+ }
1425
+ string += String.fromCharCode(uffff);
1426
+ } else if (typeof escapee[ch] === 'string') {
1427
+ string += escapee[ch];
1428
+ } else {
1429
+ break;
1430
+ }
1431
+ } else if (ch == "\n" || ch == "\r") {
1432
+ break;
1433
+ } else {
1434
+ string += ch;
1435
+ }
1436
+ }
1437
+ }
1438
+ error("Bad string");
1439
+ },
1440
+
1441
+ white = function () {
1442
+
1443
+ while (ch && ch <= ' ') {
1444
+ next();
1445
+ }
1446
+ },
1447
+
1448
+ word = function () {
1449
+
1450
+ switch (ch) {
1451
+ case 't':
1452
+ next('t');
1453
+ next('r');
1454
+ next('u');
1455
+ next('e');
1456
+ return true;
1457
+ case 'f':
1458
+ next('f');
1459
+ next('a');
1460
+ next('l');
1461
+ next('s');
1462
+ next('e');
1463
+ return false;
1464
+ case 'n':
1465
+ next('n');
1466
+ next('u');
1467
+ next('l');
1468
+ next('l');
1469
+ return null;
1470
+ }
1471
+ error("Unexpected '" + ch + "'");
1472
+ },
1473
+
1474
+ value, // Place holder for the value function.
1475
+
1476
+ array = function () {
1477
+
1478
+ var array = [];
1479
+
1480
+ if (ch === '[') {
1481
+ next('[');
1482
+ white();
1483
+ if (ch === ']') {
1484
+ next(']');
1485
+ return array; // empty array
1486
+ }
1487
+ while (ch) {
1488
+ array.push(value());
1489
+ white();
1490
+ if (ch === ']') {
1491
+ next(']');
1492
+ return array;
1493
+ }
1494
+ next(',');
1495
+ white();
1496
+ }
1497
+ }
1498
+ error("Bad array");
1499
+ },
1500
+
1501
+ object = function () {
1502
+
1503
+ var key,
1504
+ object = {};
1505
+
1506
+ if (ch === '{') {
1507
+ next('{');
1508
+ white();
1509
+ if (ch === '}') {
1510
+ next('}');
1511
+ return object; // empty object
1512
+ }
1513
+ while (ch) {
1514
+ key = string();
1515
+ white();
1516
+ next(':');
1517
+ if (Object.hasOwnProperty.call(object, key)) {
1518
+ error('Duplicate key "' + key + '"');
1519
+ }
1520
+ object[key] = value();
1521
+ white();
1522
+ if (ch === '}') {
1523
+ next('}');
1524
+ return object;
1525
+ }
1526
+ next(',');
1527
+ white();
1528
+ }
1529
+ }
1530
+ error("Bad object");
1531
+ };
1532
+
1533
+ value = function () {
1534
+
1535
+ white();
1536
+ switch (ch) {
1537
+ case '{':
1538
+ return object();
1539
+ case '[':
1540
+ return array();
1541
+ case '"':
1542
+ return string();
1543
+ case '-':
1544
+ return number();
1545
+ default:
1546
+ return ch >= '0' && ch <= '9' ? number() : word();
1547
+ }
1548
+ };
1549
+
1550
+ return function (source, reviver) {
1551
+ var result;
1552
+
1553
+ text = source;
1554
+ at = 0;
1555
+ ch = ' ';
1556
+ result = value();
1557
+ white();
1558
+ if (ch) {
1559
+ error("Syntax error");
1560
+ }
1561
+
1562
+ return typeof reviver === 'function' ? function walk(holder, key) {
1563
+ var k, v, value = holder[key];
1564
+ if (value && typeof value === 'object') {
1565
+ for (k in value) {
1566
+ if (Object.hasOwnProperty.call(value, k)) {
1567
+ v = walk(value, k);
1568
+ if (v !== undefined) {
1569
+ value[k] = v;
1570
+ } else {
1571
+ delete value[k];
1572
+ }
1573
+ }
1574
+ }
1575
+ }
1576
+ return reviver.call(holder, key, value);
1577
+ }({'': result}, '') : result;
1578
+ };
1579
+ });
1580
+
1581
+ ace.define("ace/mode/json_worker",[], function(require, exports, module) {
1582
+ "use strict";
1583
+
1584
+ var oop = require("../lib/oop");
1585
+ var Mirror = require("../worker/mirror").Mirror;
1586
+ var parse = require("./json/json_parse");
1587
+
1588
+ var JsonWorker = exports.JsonWorker = function(sender) {
1589
+ Mirror.call(this, sender);
1590
+ this.setTimeout(200);
1591
+ };
1592
+
1593
+ oop.inherits(JsonWorker, Mirror);
1594
+
1595
+ (function() {
1596
+
1597
+ this.onUpdate = function() {
1598
+ var value = this.doc.getValue();
1599
+ var errors = [];
1600
+ try {
1601
+ if (value)
1602
+ parse(value);
1603
+ } catch (e) {
1604
+ var pos = this.doc.indexToPosition(e.at-1);
1605
+ errors.push({
1606
+ row: pos.row,
1607
+ column: pos.column,
1608
+ text: e.message,
1609
+ type: "error"
1610
+ });
1611
+ }
1612
+ this.sender.emit("annotate", errors);
1613
+ };
1614
+
1615
+ }).call(JsonWorker.prototype);
1616
+
1617
+ });