ace-rails-ap 0.0.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. data/lib/ace/rails/version.rb +1 -1
  2. data/vendor/assets/javascripts/ace.js +15680 -1
  3. data/vendor/assets/javascripts/keybinding-emacs.js +367 -1
  4. data/vendor/assets/javascripts/keybinding-vim.js +1635 -1
  5. data/vendor/assets/javascripts/mode-c9search.js +275 -0
  6. data/vendor/assets/javascripts/mode-c_cpp.js +744 -1
  7. data/vendor/assets/javascripts/mode-clojure.js +364 -1
  8. data/vendor/assets/javascripts/mode-coffee.js +527 -1
  9. data/vendor/assets/javascripts/mode-coldfusion.js +1966 -1
  10. data/vendor/assets/javascripts/mode-csharp.js +633 -1
  11. data/vendor/assets/javascripts/mode-css.js +499 -1
  12. data/vendor/assets/javascripts/mode-diff.js +250 -0
  13. data/vendor/assets/javascripts/{mode-c_cpp-uncompressed.js → mode-glsl.js} +147 -244
  14. data/vendor/assets/javascripts/mode-golang.js +681 -1
  15. data/vendor/assets/javascripts/mode-groovy.js +1240 -1
  16. data/vendor/assets/javascripts/mode-haxe.js +633 -1
  17. data/vendor/assets/javascripts/mode-html.js +2064 -1
  18. data/vendor/assets/javascripts/mode-java.js +1202 -1
  19. data/vendor/assets/javascripts/mode-javascript.js +1069 -1
  20. data/vendor/assets/javascripts/mode-json.js +588 -1
  21. data/vendor/assets/javascripts/{mode-haxe-uncompressed.js → mode-jsx.js} +189 -312
  22. data/vendor/assets/javascripts/mode-latex.js +95 -1
  23. data/vendor/assets/javascripts/mode-less.js +512 -1
  24. data/vendor/assets/javascripts/mode-liquid.js +1125 -1
  25. data/vendor/assets/javascripts/mode-lua.js +551 -1
  26. data/vendor/assets/javascripts/{mode-html-uncompressed.js → mode-luahtml.js} +544 -604
  27. data/vendor/assets/javascripts/{mode-coldfusion-uncompressed.js → mode-luapage.js} +2326 -2180
  28. data/vendor/assets/javascripts/mode-markdown.js +2369 -1
  29. data/vendor/assets/javascripts/mode-ocaml.js +464 -1
  30. data/vendor/assets/javascripts/mode-perl.js +432 -1
  31. data/vendor/assets/javascripts/mode-pgsql.js +970 -1
  32. data/vendor/assets/javascripts/mode-php.js +1718 -1
  33. data/vendor/assets/javascripts/mode-powershell.js +610 -1
  34. data/vendor/assets/javascripts/mode-python.js +397 -1
  35. data/vendor/assets/javascripts/mode-ruby.js +318 -1
  36. data/vendor/assets/javascripts/mode-scad.js +732 -1
  37. data/vendor/assets/javascripts/mode-scala.js +1237 -1
  38. data/vendor/assets/javascripts/mode-scss.js +537 -1
  39. data/vendor/assets/javascripts/mode-sh.js +250 -1
  40. data/vendor/assets/javascripts/mode-sql.js +140 -1
  41. data/vendor/assets/javascripts/mode-svg.js +1681 -1
  42. data/vendor/assets/javascripts/mode-tcl.js +320 -0
  43. data/vendor/assets/javascripts/mode-textile.js +182 -1
  44. data/vendor/assets/javascripts/mode-xml.js +829 -1
  45. data/vendor/assets/javascripts/mode-xquery.js +605 -1
  46. data/vendor/assets/javascripts/mode-yaml.js +189 -0
  47. data/vendor/assets/javascripts/theme-chrome.js +213 -1
  48. data/vendor/assets/javascripts/theme-clouds.js +167 -1
  49. data/vendor/assets/javascripts/theme-clouds_midnight.js +168 -1
  50. data/vendor/assets/javascripts/theme-cobalt.js +194 -1
  51. data/vendor/assets/javascripts/theme-crimson_editor.js +200 -1
  52. data/vendor/assets/javascripts/theme-dawn.js +198 -1
  53. data/vendor/assets/javascripts/theme-dreamweaver.js +230 -1
  54. data/vendor/assets/javascripts/theme-eclipse.js +157 -1
  55. data/vendor/assets/javascripts/theme-github.js +182 -0
  56. data/vendor/assets/javascripts/theme-idle_fingers.js +186 -1
  57. data/vendor/assets/javascripts/theme-kr_theme.js +189 -1
  58. data/vendor/assets/javascripts/theme-merbivore.js +189 -1
  59. data/vendor/assets/javascripts/theme-merbivore_soft.js +195 -1
  60. data/vendor/assets/javascripts/theme-mono_industrial.js +197 -1
  61. data/vendor/assets/javascripts/theme-monokai.js +194 -1
  62. data/vendor/assets/javascripts/theme-pastel_on_dark.js +199 -1
  63. data/vendor/assets/javascripts/theme-solarized_dark.js +180 -1
  64. data/vendor/assets/javascripts/theme-solarized_light.js +179 -1
  65. data/vendor/assets/javascripts/theme-textmate.js +216 -0
  66. data/vendor/assets/javascripts/theme-tomorrow.js +213 -1
  67. data/vendor/assets/javascripts/theme-tomorrow_night.js +213 -1
  68. data/vendor/assets/javascripts/theme-tomorrow_night_blue.js +213 -1
  69. data/vendor/assets/javascripts/theme-tomorrow_night_bright.js +213 -1
  70. data/vendor/assets/javascripts/theme-tomorrow_night_eighties.js +209 -1
  71. data/vendor/assets/javascripts/theme-twilight.js +211 -1
  72. data/vendor/assets/javascripts/theme-vibrant_ink.js +190 -1
  73. data/vendor/assets/javascripts/worker-coffee.js +83 -893
  74. data/vendor/assets/javascripts/worker-css.js +88 -1402
  75. data/vendor/assets/javascripts/worker-javascript.js +97 -812
  76. data/vendor/assets/javascripts/worker-json.js +84 -761
  77. data/vendor/assets/javascripts/worker-xquery.js +66464 -0
  78. metadata +12 -195
  79. data/vendor/assets/javascripts/ace-compat-noconflict.js +0 -1
  80. data/vendor/assets/javascripts/ace-compat-uncompressed-noconflict.js +0 -480
  81. data/vendor/assets/javascripts/ace-compat-uncompressed.js +0 -480
  82. data/vendor/assets/javascripts/ace-compat.js +0 -1
  83. data/vendor/assets/javascripts/ace-noconflict.js +0 -10
  84. data/vendor/assets/javascripts/ace-uncompressed-noconflict.js +0 -19976
  85. data/vendor/assets/javascripts/ace-uncompressed.js +0 -19976
  86. data/vendor/assets/javascripts/keybinding-emacs-noconflict.js +0 -1
  87. data/vendor/assets/javascripts/keybinding-emacs-uncompressed-noconflict.js +0 -150
  88. data/vendor/assets/javascripts/keybinding-emacs-uncompressed.js +0 -150
  89. data/vendor/assets/javascripts/keybinding-vim-noconflict.js +0 -1
  90. data/vendor/assets/javascripts/keybinding-vim-uncompressed-noconflict.js +0 -138
  91. data/vendor/assets/javascripts/keybinding-vim-uncompressed.js +0 -138
  92. data/vendor/assets/javascripts/mode-c_cpp-noconflict.js +0 -1
  93. data/vendor/assets/javascripts/mode-c_cpp-uncompressed-noconflict.js +0 -919
  94. data/vendor/assets/javascripts/mode-clojure-noconflict.js +0 -1
  95. data/vendor/assets/javascripts/mode-clojure-uncompressed-noconflict.js +0 -422
  96. data/vendor/assets/javascripts/mode-clojure-uncompressed.js +0 -422
  97. data/vendor/assets/javascripts/mode-coffee-noconflict.js +0 -1
  98. data/vendor/assets/javascripts/mode-coffee-uncompressed-noconflict.js +0 -607
  99. data/vendor/assets/javascripts/mode-coffee-uncompressed.js +0 -607
  100. data/vendor/assets/javascripts/mode-coldfusion-noconflict.js +0 -1
  101. data/vendor/assets/javascripts/mode-coldfusion-uncompressed-noconflict.js +0 -2458
  102. data/vendor/assets/javascripts/mode-csharp-noconflict.js +0 -1
  103. data/vendor/assets/javascripts/mode-csharp-uncompressed-noconflict.js +0 -769
  104. data/vendor/assets/javascripts/mode-csharp-uncompressed.js +0 -769
  105. data/vendor/assets/javascripts/mode-css-noconflict.js +0 -1
  106. data/vendor/assets/javascripts/mode-css-uncompressed-noconflict.js +0 -641
  107. data/vendor/assets/javascripts/mode-css-uncompressed.js +0 -641
  108. data/vendor/assets/javascripts/mode-golang-noconflict.js +0 -1
  109. data/vendor/assets/javascripts/mode-golang-uncompressed-noconflict.js +0 -378
  110. data/vendor/assets/javascripts/mode-golang-uncompressed.js +0 -378
  111. data/vendor/assets/javascripts/mode-groovy-noconflict.js +0 -1
  112. data/vendor/assets/javascripts/mode-groovy-uncompressed-noconflict.js +0 -1393
  113. data/vendor/assets/javascripts/mode-groovy-uncompressed.js +0 -1393
  114. data/vendor/assets/javascripts/mode-haxe-noconflict.js +0 -1
  115. data/vendor/assets/javascripts/mode-haxe-uncompressed-noconflict.js +0 -769
  116. data/vendor/assets/javascripts/mode-html-noconflict.js +0 -1
  117. data/vendor/assets/javascripts/mode-html-uncompressed-noconflict.js +0 -2475
  118. data/vendor/assets/javascripts/mode-java-noconflict.js +0 -1
  119. data/vendor/assets/javascripts/mode-java-uncompressed-noconflict.js +0 -1395
  120. data/vendor/assets/javascripts/mode-java-uncompressed.js +0 -1395
  121. data/vendor/assets/javascripts/mode-javascript-noconflict.js +0 -1
  122. data/vendor/assets/javascripts/mode-javascript-uncompressed-noconflict.js +0 -1226
  123. data/vendor/assets/javascripts/mode-javascript-uncompressed.js +0 -1226
  124. data/vendor/assets/javascripts/mode-json-noconflict.js +0 -1
  125. data/vendor/assets/javascripts/mode-json-uncompressed-noconflict.js +0 -701
  126. data/vendor/assets/javascripts/mode-json-uncompressed.js +0 -701
  127. data/vendor/assets/javascripts/mode-latex-noconflict.js +0 -1
  128. data/vendor/assets/javascripts/mode-latex-uncompressed-noconflict.js +0 -95
  129. data/vendor/assets/javascripts/mode-latex-uncompressed.js +0 -95
  130. data/vendor/assets/javascripts/mode-less-noconflict.js +0 -1
  131. data/vendor/assets/javascripts/mode-less-uncompressed-noconflict.js +0 -655
  132. data/vendor/assets/javascripts/mode-less-uncompressed.js +0 -655
  133. data/vendor/assets/javascripts/mode-liquid-noconflict.js +0 -1
  134. data/vendor/assets/javascripts/mode-liquid-uncompressed-noconflict.js +0 -1353
  135. data/vendor/assets/javascripts/mode-liquid-uncompressed.js +0 -1353
  136. data/vendor/assets/javascripts/mode-lua-noconflict.js +0 -1
  137. data/vendor/assets/javascripts/mode-lua-uncompressed-noconflict.js +0 -523
  138. data/vendor/assets/javascripts/mode-lua-uncompressed.js +0 -523
  139. data/vendor/assets/javascripts/mode-markdown-noconflict.js +0 -1
  140. data/vendor/assets/javascripts/mode-markdown-uncompressed-noconflict.js +0 -2925
  141. data/vendor/assets/javascripts/mode-markdown-uncompressed.js +0 -2925
  142. data/vendor/assets/javascripts/mode-ocaml-noconflict.js +0 -1
  143. data/vendor/assets/javascripts/mode-ocaml-uncompressed-noconflict.js +0 -539
  144. data/vendor/assets/javascripts/mode-ocaml-uncompressed.js +0 -539
  145. data/vendor/assets/javascripts/mode-perl-noconflict.js +0 -1
  146. data/vendor/assets/javascripts/mode-perl-uncompressed-noconflict.js +0 -574
  147. data/vendor/assets/javascripts/mode-perl-uncompressed.js +0 -574
  148. data/vendor/assets/javascripts/mode-pgsql-noconflict.js +0 -1
  149. data/vendor/assets/javascripts/mode-pgsql-uncompressed-noconflict.js +0 -1104
  150. data/vendor/assets/javascripts/mode-pgsql-uncompressed.js +0 -1104
  151. data/vendor/assets/javascripts/mode-php-noconflict.js +0 -1
  152. data/vendor/assets/javascripts/mode-php-uncompressed-noconflict.js +0 -1885
  153. data/vendor/assets/javascripts/mode-php-uncompressed.js +0 -1885
  154. data/vendor/assets/javascripts/mode-powershell-noconflict.js +0 -1
  155. data/vendor/assets/javascripts/mode-powershell-uncompressed-noconflict.js +0 -710
  156. data/vendor/assets/javascripts/mode-powershell-uncompressed.js +0 -710
  157. data/vendor/assets/javascripts/mode-python-noconflict.js +0 -1
  158. data/vendor/assets/javascripts/mode-python-uncompressed-noconflict.js +0 -507
  159. data/vendor/assets/javascripts/mode-python-uncompressed.js +0 -507
  160. data/vendor/assets/javascripts/mode-ruby-noconflict.js +0 -1
  161. data/vendor/assets/javascripts/mode-ruby-uncompressed-noconflict.js +0 -391
  162. data/vendor/assets/javascripts/mode-ruby-uncompressed.js +0 -391
  163. data/vendor/assets/javascripts/mode-scad-noconflict.js +0 -1
  164. data/vendor/assets/javascripts/mode-scad-uncompressed-noconflict.js +0 -907
  165. data/vendor/assets/javascripts/mode-scad-uncompressed.js +0 -907
  166. data/vendor/assets/javascripts/mode-scala-noconflict.js +0 -1
  167. data/vendor/assets/javascripts/mode-scala-uncompressed-noconflict.js +0 -1395
  168. data/vendor/assets/javascripts/mode-scala-uncompressed.js +0 -1395
  169. data/vendor/assets/javascripts/mode-scss-noconflict.js +0 -1
  170. data/vendor/assets/javascripts/mode-scss-uncompressed-noconflict.js +0 -679
  171. data/vendor/assets/javascripts/mode-scss-uncompressed.js +0 -679
  172. data/vendor/assets/javascripts/mode-sh-noconflict.js +0 -1
  173. data/vendor/assets/javascripts/mode-sh-uncompressed-noconflict.js +0 -289
  174. data/vendor/assets/javascripts/mode-sh-uncompressed.js +0 -289
  175. data/vendor/assets/javascripts/mode-sql-noconflict.js +0 -1
  176. data/vendor/assets/javascripts/mode-sql-uncompressed-noconflict.js +0 -159
  177. data/vendor/assets/javascripts/mode-sql-uncompressed.js +0 -159
  178. data/vendor/assets/javascripts/mode-svg-noconflict.js +0 -1
  179. data/vendor/assets/javascripts/mode-svg-uncompressed-noconflict.js +0 -2137
  180. data/vendor/assets/javascripts/mode-svg-uncompressed.js +0 -2137
  181. data/vendor/assets/javascripts/mode-text-noconflict.js +0 -0
  182. data/vendor/assets/javascripts/mode-text-uncompressed-noconflict.js +0 -0
  183. data/vendor/assets/javascripts/mode-text-uncompressed.js +0 -0
  184. data/vendor/assets/javascripts/mode-textile-noconflict.js +0 -1
  185. data/vendor/assets/javascripts/mode-textile-uncompressed-noconflict.js +0 -254
  186. data/vendor/assets/javascripts/mode-textile-uncompressed.js +0 -254
  187. data/vendor/assets/javascripts/mode-xml-noconflict.js +0 -1
  188. data/vendor/assets/javascripts/mode-xml-uncompressed-noconflict.js +0 -1012
  189. data/vendor/assets/javascripts/mode-xml-uncompressed.js +0 -1012
  190. data/vendor/assets/javascripts/mode-xquery-noconflict.js +0 -1
  191. data/vendor/assets/javascripts/mode-xquery-uncompressed-noconflict.js +0 -540
  192. data/vendor/assets/javascripts/mode-xquery-uncompressed.js +0 -540
  193. data/vendor/assets/javascripts/theme-chrome-noconflict.js +0 -1
  194. data/vendor/assets/javascripts/theme-chrome-uncompressed-noconflict.js +0 -207
  195. data/vendor/assets/javascripts/theme-chrome-uncompressed.js +0 -207
  196. data/vendor/assets/javascripts/theme-clouds-noconflict.js +0 -1
  197. data/vendor/assets/javascripts/theme-clouds-uncompressed-noconflict.js +0 -160
  198. data/vendor/assets/javascripts/theme-clouds-uncompressed.js +0 -160
  199. data/vendor/assets/javascripts/theme-clouds_midnight-noconflict.js +0 -1
  200. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed-noconflict.js +0 -161
  201. data/vendor/assets/javascripts/theme-clouds_midnight-uncompressed.js +0 -161
  202. data/vendor/assets/javascripts/theme-cobalt-noconflict.js +0 -1
  203. data/vendor/assets/javascripts/theme-cobalt-uncompressed-noconflict.js +0 -187
  204. data/vendor/assets/javascripts/theme-cobalt-uncompressed.js +0 -187
  205. data/vendor/assets/javascripts/theme-crimson_editor-noconflict.js +0 -1
  206. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed-noconflict.js +0 -198
  207. data/vendor/assets/javascripts/theme-crimson_editor-uncompressed.js +0 -198
  208. data/vendor/assets/javascripts/theme-dawn-noconflict.js +0 -1
  209. data/vendor/assets/javascripts/theme-dawn-uncompressed-noconflict.js +0 -191
  210. data/vendor/assets/javascripts/theme-dawn-uncompressed.js +0 -191
  211. data/vendor/assets/javascripts/theme-dreamweaver-noconflict.js +0 -1
  212. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed-noconflict.js +0 -227
  213. data/vendor/assets/javascripts/theme-dreamweaver-uncompressed.js +0 -227
  214. data/vendor/assets/javascripts/theme-eclipse-noconflict.js +0 -1
  215. data/vendor/assets/javascripts/theme-eclipse-uncompressed-noconflict.js +0 -147
  216. data/vendor/assets/javascripts/theme-eclipse-uncompressed.js +0 -147
  217. data/vendor/assets/javascripts/theme-idle_fingers-noconflict.js +0 -1
  218. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed-noconflict.js +0 -179
  219. data/vendor/assets/javascripts/theme-idle_fingers-uncompressed.js +0 -179
  220. data/vendor/assets/javascripts/theme-kr_theme-noconflict.js +0 -1
  221. data/vendor/assets/javascripts/theme-kr_theme-uncompressed-noconflict.js +0 -182
  222. data/vendor/assets/javascripts/theme-kr_theme-uncompressed.js +0 -182
  223. data/vendor/assets/javascripts/theme-merbivore-noconflict.js +0 -1
  224. data/vendor/assets/javascripts/theme-merbivore-uncompressed-noconflict.js +0 -182
  225. data/vendor/assets/javascripts/theme-merbivore-uncompressed.js +0 -182
  226. data/vendor/assets/javascripts/theme-merbivore_soft-noconflict.js +0 -1
  227. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed-noconflict.js +0 -188
  228. data/vendor/assets/javascripts/theme-merbivore_soft-uncompressed.js +0 -188
  229. data/vendor/assets/javascripts/theme-mono_industrial-noconflict.js +0 -1
  230. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed-noconflict.js +0 -190
  231. data/vendor/assets/javascripts/theme-mono_industrial-uncompressed.js +0 -190
  232. data/vendor/assets/javascripts/theme-monokai-noconflict.js +0 -1
  233. data/vendor/assets/javascripts/theme-monokai-uncompressed-noconflict.js +0 -191
  234. data/vendor/assets/javascripts/theme-monokai-uncompressed.js +0 -191
  235. data/vendor/assets/javascripts/theme-pastel_on_dark-noconflict.js +0 -1
  236. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed-noconflict.js +0 -192
  237. data/vendor/assets/javascripts/theme-pastel_on_dark-uncompressed.js +0 -192
  238. data/vendor/assets/javascripts/theme-solarized_dark-noconflict.js +0 -1
  239. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed-noconflict.js +0 -176
  240. data/vendor/assets/javascripts/theme-solarized_dark-uncompressed.js +0 -176
  241. data/vendor/assets/javascripts/theme-solarized_light-noconflict.js +0 -1
  242. data/vendor/assets/javascripts/theme-solarized_light-uncompressed-noconflict.js +0 -172
  243. data/vendor/assets/javascripts/theme-solarized_light-uncompressed.js +0 -172
  244. data/vendor/assets/javascripts/theme-textmate-noconflict.js +0 -0
  245. data/vendor/assets/javascripts/theme-textmate-uncompressed-noconflict.js +0 -0
  246. data/vendor/assets/javascripts/theme-textmate-uncompressed.js +0 -0
  247. data/vendor/assets/javascripts/theme-tomorrow-noconflict.js +0 -1
  248. data/vendor/assets/javascripts/theme-tomorrow-uncompressed-noconflict.js +0 -206
  249. data/vendor/assets/javascripts/theme-tomorrow-uncompressed.js +0 -206
  250. data/vendor/assets/javascripts/theme-tomorrow_night-noconflict.js +0 -1
  251. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed-noconflict.js +0 -206
  252. data/vendor/assets/javascripts/theme-tomorrow_night-uncompressed.js +0 -206
  253. data/vendor/assets/javascripts/theme-tomorrow_night_blue-noconflict.js +0 -1
  254. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed-noconflict.js +0 -209
  255. data/vendor/assets/javascripts/theme-tomorrow_night_blue-uncompressed.js +0 -209
  256. data/vendor/assets/javascripts/theme-tomorrow_night_bright-noconflict.js +0 -1
  257. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed-noconflict.js +0 -206
  258. data/vendor/assets/javascripts/theme-tomorrow_night_bright-uncompressed.js +0 -206
  259. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-noconflict.js +0 -1
  260. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed-noconflict.js +0 -202
  261. data/vendor/assets/javascripts/theme-tomorrow_night_eighties-uncompressed.js +0 -202
  262. data/vendor/assets/javascripts/theme-twilight-noconflict.js +0 -1
  263. data/vendor/assets/javascripts/theme-twilight-uncompressed-noconflict.js +0 -204
  264. data/vendor/assets/javascripts/theme-twilight-uncompressed.js +0 -204
  265. data/vendor/assets/javascripts/theme-vibrant_ink-noconflict.js +0 -1
  266. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed-noconflict.js +0 -183
  267. data/vendor/assets/javascripts/theme-vibrant_ink-uncompressed.js +0 -183
@@ -35,8 +35,8 @@ var require = function(parentId, id) {
35
35
  var module = require.modules[id];
36
36
  if (module) {
37
37
  if (!module.initialized) {
38
- module.exports = module.factory().exports;
39
38
  module.initialized = true;
39
+ module.exports = module.factory().exports;
40
40
  }
41
41
  return module.exports;
42
42
  }
@@ -56,6 +56,10 @@ require.tlns = {};
56
56
  var define = function(id, deps, factory) {
57
57
  if (arguments.length == 2) {
58
58
  factory = deps;
59
+ if (typeof id != "string") {
60
+ deps = id;
61
+ id = require.id;
62
+ }
59
63
  } else if (arguments.length == 1) {
60
64
  factory = id;
61
65
  id = require.id;
@@ -149,25 +153,15 @@ onmessage = function(e) {
149
153
  */
150
154
 
151
155
  define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) {
152
- "use strict";
156
+
153
157
 
154
158
  require("./regexp");
155
159
  require("./es5-shim");
156
160
 
157
161
  });
158
- /*
159
- * Based on code from:
160
- *
161
- * XRegExp 1.5.0
162
- * (c) 2007-2010 Steven Levithan
163
- * MIT License
164
- * <http://xregexp.com>
165
- * Provides an augmented, extensible, cross-browser implementation of regular expressions,
166
- * including support for additional syntax, flags, and methods
167
- */
168
162
 
169
163
  define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) {
170
- "use strict";
164
+
171
165
 
172
166
  //---------------------------------
173
167
  // Private variables
@@ -187,6 +181,9 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
187
181
  return !x.lastIndex;
188
182
  }();
189
183
 
184
+ if (compliantLastIndexIncrement && compliantExecNpcg)
185
+ return;
186
+
190
187
  //---------------------------------
191
188
  // Overriden native methods
192
189
  //---------------------------------
@@ -252,7 +249,7 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
252
249
  (regex.multiline ? "m" : "") +
253
250
  (regex.extended ? "x" : "") + // Proposed for ES4; included in AS3
254
251
  (regex.sticky ? "y" : "");
255
- };
252
+ }
256
253
 
257
254
  function indexOf (array, item, from) {
258
255
  if (Array.prototype.indexOf) // Use the native array method if available
@@ -262,30 +259,9 @@ define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, ex
262
259
  return i;
263
260
  }
264
261
  return -1;
265
- };
262
+ }
266
263
 
267
264
  });
268
- // vim: ts=4 sts=4 sw=4 expandtab
269
- // -- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
270
- // -- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal Project)
271
- // -- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
272
- // -- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
273
- // -- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
274
- // -- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
275
- // -- kossnocorp Sasha Koss XXX TODO License or CLA
276
- // -- bryanforbes Bryan Forbes XXX TODO License or CLA
277
- // -- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
278
- // -- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD License
279
- // -- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
280
- // -- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
281
- // -- iwyg XXX TODO License or CLA
282
- // -- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
283
- // -- xavierm02 Montillet Xavier XXX TODO License or CLA
284
- // -- Raynos Raynos XXX TODO License or CLA
285
- // -- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
286
- // -- rwldrn Rick Waldron Copyright (C) 2011 MIT License
287
- // -- lexer Alexey Zakharov XXX TODO License or CLA
288
-
289
265
  /*!
290
266
  Copyright (c) 2009, 280 North Inc. http://280north.com/
291
267
  MIT License. http://github.com/280north/narwhal/blob/master/README.md
@@ -1324,48 +1300,9 @@ var prepareString = "a"[0] != "a",
1324
1300
  return Object(o);
1325
1301
  };
1326
1302
  });
1327
- /* vim:ts=4:sts=4:sw=4:
1328
- * ***** BEGIN LICENSE BLOCK *****
1329
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1330
- *
1331
- * The contents of this file are subject to the Mozilla Public License Version
1332
- * 1.1 (the "License"); you may not use this file except in compliance with
1333
- * the License. You may obtain a copy of the License at
1334
- * http://www.mozilla.org/MPL/
1335
- *
1336
- * Software distributed under the License is distributed on an "AS IS" basis,
1337
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1338
- * for the specific language governing rights and limitations under the
1339
- * License.
1340
- *
1341
- * The Original Code is Ajax.org Code Editor (ACE).
1342
- *
1343
- * The Initial Developer of the Original Code is
1344
- * Ajax.org B.V.
1345
- * Portions created by the Initial Developer are Copyright (C) 2010
1346
- * the Initial Developer. All Rights Reserved.
1347
- *
1348
- * Contributor(s):
1349
- * Fabian Jakobs <fabian AT ajax DOT org>
1350
- * Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)
1351
- * Mike de Boer <mike AT ajax DOT org>
1352
- *
1353
- * Alternatively, the contents of this file may be used under the terms of
1354
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1355
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1356
- * in which case the provisions of the GPL or the LGPL are applicable instead
1357
- * of those above. If you wish to allow use of your version of this file only
1358
- * under the terms of either the GPL or the LGPL, and not to allow others to
1359
- * use your version of this file under the terms of the MPL, indicate your
1360
- * decision by deleting the provisions above and replace them with the notice
1361
- * and other provisions required by the GPL or the LGPL. If you do not delete
1362
- * the provisions above, a recipient may use your version of this file under
1363
- * the terms of any one of the MPL, the GPL or the LGPL.
1364
- *
1365
- * ***** END LICENSE BLOCK ***** */
1366
1303
 
1367
1304
  define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) {
1368
- "use strict";
1305
+
1369
1306
 
1370
1307
  var EventEmitter = {};
1371
1308
 
@@ -1380,7 +1317,8 @@ EventEmitter._dispatchEvent = function(eventName, e) {
1380
1317
  return;
1381
1318
 
1382
1319
  e = e || {};
1383
- e.type = eventName;
1320
+ if (!e.type)
1321
+ e.type = eventName;
1384
1322
 
1385
1323
  if (!e.stopPropagation) {
1386
1324
  e.stopPropagation = function() {
@@ -1419,7 +1357,7 @@ EventEmitter.addEventListener = function(eventName, callback) {
1419
1357
 
1420
1358
  var listeners = this._eventRegistry[eventName];
1421
1359
  if (!listeners)
1422
- var listeners = this._eventRegistry[eventName] = [];
1360
+ listeners = this._eventRegistry[eventName] = [];
1423
1361
 
1424
1362
  if (listeners.indexOf(callback) == -1)
1425
1363
  listeners.push(callback);
@@ -1445,45 +1383,9 @@ EventEmitter.removeAllListeners = function(eventName) {
1445
1383
  exports.EventEmitter = EventEmitter;
1446
1384
 
1447
1385
  });
1448
- /* ***** BEGIN LICENSE BLOCK *****
1449
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1450
- *
1451
- * The contents of this file are subject to the Mozilla Public License Version
1452
- * 1.1 (the "License"); you may not use this file except in compliance with
1453
- * the License. You may obtain a copy of the License at
1454
- * http://www.mozilla.org/MPL/
1455
- *
1456
- * Software distributed under the License is distributed on an "AS IS" basis,
1457
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1458
- * for the specific language governing rights and limitations under the
1459
- * License.
1460
- *
1461
- * The Original Code is Ajax.org Code Editor (ACE).
1462
- *
1463
- * The Initial Developer of the Original Code is
1464
- * Ajax.org B.V.
1465
- * Portions created by the Initial Developer are Copyright (C) 2010
1466
- * the Initial Developer. All Rights Reserved.
1467
- *
1468
- * Contributor(s):
1469
- * Fabian Jakobs <fabian AT ajax DOT org>
1470
- *
1471
- * Alternatively, the contents of this file may be used under the terms of
1472
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1473
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1474
- * in which case the provisions of the GPL or the LGPL are applicable instead
1475
- * of those above. If you wish to allow use of your version of this file only
1476
- * under the terms of either the GPL or the LGPL, and not to allow others to
1477
- * use your version of this file under the terms of the MPL, indicate your
1478
- * decision by deleting the provisions above and replace them with the notice
1479
- * and other provisions required by the GPL or the LGPL. If you do not delete
1480
- * the provisions above, a recipient may use your version of this file under
1481
- * the terms of any one of the MPL, the GPL or the LGPL.
1482
- *
1483
- * ***** END LICENSE BLOCK ***** */
1484
1386
 
1485
1387
  define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) {
1486
- "use strict";
1388
+
1487
1389
 
1488
1390
  exports.inherits = (function() {
1489
1391
  var tempCtor = function() {};
@@ -1506,45 +1408,9 @@ exports.implement = function(proto, mixin) {
1506
1408
  };
1507
1409
 
1508
1410
  });
1509
- /* ***** BEGIN LICENSE BLOCK *****
1510
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1511
- *
1512
- * The contents of this file are subject to the Mozilla Public License Version
1513
- * 1.1 (the "License"); you may not use this file except in compliance with
1514
- * the License. You may obtain a copy of the License at
1515
- * http://www.mozilla.org/MPL/
1516
- *
1517
- * Software distributed under the License is distributed on an "AS IS" basis,
1518
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1519
- * for the specific language governing rights and limitations under the
1520
- * License.
1521
- *
1522
- * The Original Code is Ajax.org Code Editor (ACE).
1523
- *
1524
- * The Initial Developer of the Original Code is
1525
- * Ajax.org B.V.
1526
- * Portions created by the Initial Developer are Copyright (C) 2010
1527
- * the Initial Developer. All Rights Reserved.
1528
- *
1529
- * Contributor(s):
1530
- * Fabian Jakobs <fabian AT ajax DOT org>
1531
- *
1532
- * Alternatively, the contents of this file may be used under the terms of
1533
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1534
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1535
- * in which case the provisions of the GPL or the LGPL are applicable instead
1536
- * of those above. If you wish to allow use of your version of this file only
1537
- * under the terms of either the GPL or the LGPL, and not to allow others to
1538
- * use your version of this file under the terms of the MPL, indicate your
1539
- * decision by deleting the provisions above and replace them with the notice
1540
- * and other provisions required by the GPL or the LGPL. If you do not delete
1541
- * the provisions above, a recipient may use your version of this file under
1542
- * the terms of any one of the MPL, the GPL or the LGPL.
1543
- *
1544
- * ***** END LICENSE BLOCK ***** */
1545
1411
 
1546
1412
  define('ace/mode/coffee_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/coffee/coffee-script'], function(require, exports, module) {
1547
- "use strict";
1413
+
1548
1414
 
1549
1415
  var oop = require("../lib/oop");
1550
1416
  var Mirror = require("../worker/mirror").Mirror;
@@ -1599,7 +1465,7 @@ oop.inherits(Worker, Mirror);
1599
1465
 
1600
1466
  });
1601
1467
  define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) {
1602
- "use strict";
1468
+
1603
1469
 
1604
1470
  var Document = require("../document").Document;
1605
1471
  var lang = require("../lib/lang");
@@ -1641,59 +1507,15 @@ var Mirror = exports.Mirror = function(sender) {
1641
1507
  }).call(Mirror.prototype);
1642
1508
 
1643
1509
  });
1644
- /* ***** BEGIN LICENSE BLOCK *****
1645
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1646
- *
1647
- * The contents of this file are subject to the Mozilla Public License Version
1648
- * 1.1 (the "License"); you may not use this file except in compliance with
1649
- * the License. You may obtain a copy of the License at
1650
- * http://www.mozilla.org/MPL/
1651
- *
1652
- * Software distributed under the License is distributed on an "AS IS" basis,
1653
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1654
- * for the specific language governing rights and limitations under the
1655
- * License.
1656
- *
1657
- * The Original Code is Ajax.org Code Editor (ACE).
1658
- *
1659
- * The Initial Developer of the Original Code is
1660
- * Ajax.org B.V.
1661
- * Portions created by the Initial Developer are Copyright (C) 2010
1662
- * the Initial Developer. All Rights Reserved.
1663
- *
1664
- * Contributor(s):
1665
- * Fabian Jakobs <fabian AT ajax DOT org>
1666
- *
1667
- * Alternatively, the contents of this file may be used under the terms of
1668
- * either the GNU General Public License Version 2 or later (the "GPL"), or
1669
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1670
- * in which case the provisions of the GPL or the LGPL are applicable instead
1671
- * of those above. If you wish to allow use of your version of this file only
1672
- * under the terms of either the GPL or the LGPL, and not to allow others to
1673
- * use your version of this file under the terms of the MPL, indicate your
1674
- * decision by deleting the provisions above and replace them with the notice
1675
- * and other provisions required by the GPL or the LGPL. If you do not delete
1676
- * the provisions above, a recipient may use your version of this file under
1677
- * the terms of any one of the MPL, the GPL or the LGPL.
1678
- *
1679
- * ***** END LICENSE BLOCK ***** */
1680
1510
 
1681
1511
  define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) {
1682
- "use strict";
1512
+
1683
1513
 
1684
1514
  var oop = require("./lib/oop");
1685
1515
  var EventEmitter = require("./lib/event_emitter").EventEmitter;
1686
1516
  var Range = require("./range").Range;
1687
1517
  var Anchor = require("./anchor").Anchor;
1688
1518
 
1689
- /**
1690
- * class Document
1691
- *
1692
- * Contains the text of the document. Documents are controlled by a single [[EditSession `EditSession`]]. At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index.
1693
- *
1694
- *
1695
- **/
1696
-
1697
1519
  /**
1698
1520
  * new Document([text])
1699
1521
  * - text (String | Array): The starting text
@@ -1701,16 +1523,16 @@ var Anchor = require("./anchor").Anchor;
1701
1523
  * Creates a new `Document`. If `text` is included, the `Document` contains those strings; otherwise, it's empty.
1702
1524
  *
1703
1525
  **/
1526
+
1704
1527
  var Document = function(text) {
1705
1528
  this.$lines = [];
1706
1529
 
1707
- if (Array.isArray(text)) {
1708
- this.insertLines(0, text);
1709
- }
1710
1530
  // There has to be one line at least in the document. If you pass an empty
1711
1531
  // string to the insert function, nothing will happen. Workaround.
1712
- else if (text.length == 0) {
1532
+ if (text.length == 0) {
1713
1533
  this.$lines = [""];
1534
+ } else if (Array.isArray(text)) {
1535
+ this.insertLines(0, text);
1714
1536
  } else {
1715
1537
  this.insert({row: 0, column:0}, text);
1716
1538
  }
@@ -1719,49 +1541,18 @@ var Document = function(text) {
1719
1541
  (function() {
1720
1542
 
1721
1543
  oop.implement(this, EventEmitter);
1722
-
1723
- /**
1724
- * Document.setValue(text) -> Void
1725
- * - text (String): The text to use
1726
- *
1727
- * Replaces all the lines in the current `Document` with the value of `text`.
1728
- **/
1729
1544
  this.setValue = function(text) {
1730
1545
  var len = this.getLength();
1731
1546
  this.remove(new Range(0, 0, len, this.getLine(len-1).length));
1732
1547
  this.insert({row: 0, column:0}, text);
1733
1548
  };
1734
-
1735
- /**
1736
- * Document.getValue() -> String
1737
- *
1738
- * Returns all the lines in the document as a single string, split by the new line character.
1739
- **/
1740
1549
  this.getValue = function() {
1741
1550
  return this.getAllLines().join(this.getNewLineCharacter());
1742
1551
  };
1743
-
1744
- /**
1745
- * Document.createAnchor(row, column) -> Anchor
1746
- * - row (Number): The row number to use
1747
- * - column (Number): The column number to use
1748
- *
1749
- * Creates a new `Anchor` to define a floating point in the document.
1750
- **/
1751
1552
  this.createAnchor = function(row, column) {
1752
1553
  return new Anchor(this, row, column);
1753
1554
  };
1754
1555
 
1755
- /** internal, hide
1756
- * Document.$split(text) -> [String]
1757
- * - text (String): The text to work with
1758
- * + ([String]): A String array, with each index containing a piece of the original `text` string.
1759
- *
1760
- * Splits a string of text on any newline (`\n`) or carriage-return ('\r') characters.
1761
- *
1762
- *
1763
- **/
1764
-
1765
1556
  // check for IE split bug
1766
1557
  if ("aaa".split(/a/).length == 0)
1767
1558
  this.$split = function(text) {
@@ -1771,13 +1562,6 @@ var Document = function(text) {
1771
1562
  this.$split = function(text) {
1772
1563
  return text.split(/\r\n|\r|\n/);
1773
1564
  };
1774
-
1775
-
1776
- /** internal, hide
1777
- * Document.$detectNewLine(text) -> Void
1778
- *
1779
- *
1780
- **/
1781
1565
  this.$detectNewLine = function(text) {
1782
1566
  var match = text.match(/^.*?(\r\n|\r|\n)/m);
1783
1567
  if (match) {
@@ -1786,18 +1570,6 @@ var Document = function(text) {
1786
1570
  this.$autoNewLine = "\n";
1787
1571
  }
1788
1572
  };
1789
-
1790
- /**
1791
- * Document.getNewLineCharacter() -> String
1792
- * + (String): If `newLineMode == windows`, `\r\n` is returned.<br/>
1793
- * If `newLineMode == unix`, `\n` is returned.<br/>
1794
- * If `newLineMode == auto`, the value of `autoNewLine` is returned.
1795
- *
1796
- * Returns the newline character that's being used, depending on the value of `newLineMode`.
1797
- *
1798
- *
1799
- *
1800
- **/
1801
1573
  this.getNewLineCharacter = function() {
1802
1574
  switch (this.$newLineMode) {
1803
1575
  case "windows":
@@ -1813,87 +1585,30 @@ var Document = function(text) {
1813
1585
 
1814
1586
  this.$autoNewLine = "\n";
1815
1587
  this.$newLineMode = "auto";
1816
- /**
1817
- * Document.setNewLineMode(newLineMode) -> Void
1818
- * - newLineMode(String): [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param}
1819
- *
1820
- * [Sets the new line mode.]{: #Document.setNewLineMode.desc}
1821
- **/
1822
1588
  this.setNewLineMode = function(newLineMode) {
1823
1589
  if (this.$newLineMode === newLineMode)
1824
1590
  return;
1825
1591
 
1826
1592
  this.$newLineMode = newLineMode;
1827
1593
  };
1828
-
1829
- /**
1830
- * Document.getNewLineMode() -> String
1831
- *
1832
- * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode}
1833
- *
1834
- **/
1835
1594
  this.getNewLineMode = function() {
1836
1595
  return this.$newLineMode;
1837
1596
  };
1838
-
1839
- /**
1840
- * Document.isNewLine(text) -> Boolean
1841
- * - text (String): The text to check
1842
- *
1843
- * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`).
1844
- *
1845
- **/
1846
1597
  this.isNewLine = function(text) {
1847
1598
  return (text == "\r\n" || text == "\r" || text == "\n");
1848
1599
  };
1849
-
1850
- /**
1851
- * Document.getLine(row) -> String
1852
- * - row (Number): The row index to retrieve
1853
- *
1854
- * Returns a verbatim copy of the given line as it is in the document
1855
- *
1856
- **/
1857
1600
  this.getLine = function(row) {
1858
1601
  return this.$lines[row] || "";
1859
1602
  };
1860
-
1861
- /**
1862
- * Document.getLines(firstRow, lastRow) -> [String]
1863
- * - firstRow (Number): The first row index to retrieve
1864
- * - lastRow (Number): The final row index to retrieve
1865
- *
1866
- * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`.
1867
- *
1868
- **/
1869
1603
  this.getLines = function(firstRow, lastRow) {
1870
1604
  return this.$lines.slice(firstRow, lastRow + 1);
1871
1605
  };
1872
-
1873
- /**
1874
- * Document.getAllLines() -> [String]
1875
- *
1876
- * Returns all lines in the document as string array. Warning: The caller should not modify this array!
1877
- **/
1878
1606
  this.getAllLines = function() {
1879
1607
  return this.getLines(0, this.getLength());
1880
1608
  };
1881
-
1882
- /**
1883
- * Document.getLength() -> Number
1884
- *
1885
- * Returns the number of rows in the document.
1886
- **/
1887
1609
  this.getLength = function() {
1888
1610
  return this.$lines.length;
1889
1611
  };
1890
-
1891
- /**
1892
- * Document.getTextRange(range) -> String
1893
- * - range (Range): The range to work with
1894
- *
1895
- * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc}
1896
- **/
1897
1612
  this.getTextRange = function(range) {
1898
1613
  if (range.start.row == range.end.row) {
1899
1614
  return this.$lines[range.start.row].substring(range.start.column,
@@ -1906,12 +1621,6 @@ var Document = function(text) {
1906
1621
  return lines.join(this.getNewLineCharacter());
1907
1622
  }
1908
1623
  };
1909
-
1910
- /** internal, hide
1911
- * Document.$clipPosition(position) -> Number
1912
- *
1913
- *
1914
- **/
1915
1624
  this.$clipPosition = function(position) {
1916
1625
  var length = this.getLength();
1917
1626
  if (position.row >= length) {
@@ -1920,16 +1629,6 @@ var Document = function(text) {
1920
1629
  }
1921
1630
  return position;
1922
1631
  };
1923
-
1924
- /**
1925
- * Document.insert(position, text) -> Number
1926
- * - position (Number): The position to start inserting at
1927
- * - text (String): A chunk of text to insert
1928
- * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`.
1929
- * Inserts a block of `text` and the indicated `position`.
1930
- *
1931
- *
1932
- **/
1933
1632
  this.insert = function(position, text) {
1934
1633
  if (!text || text.length === 0)
1935
1634
  return position;
@@ -1952,24 +1651,40 @@ var Document = function(text) {
1952
1651
  }
1953
1652
  return position;
1954
1653
  };
1955
-
1956
1654
  /**
1957
- * Document.insertLines(row, lines) -> Object
1958
- * - row (Number): The index of the row to insert at
1959
- * - lines (Array): An array of strings
1960
- * + (Object): Returns an object containing the final row and column, like this:<br/>
1961
- * ```{row: endRow, column: 0}```<br/>
1962
- * If `lines` is empty, this function returns an object containing the current row, and column, like this:<br/>
1963
- * ```{row: row, column: 0}```
1964
- *
1965
- * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event.
1966
- *
1967
- *
1968
- **/
1655
+ * Document@change(e)
1656
+ * - e (Object): Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties.
1657
+ *
1658
+ * Fires whenever the document changes.
1659
+ *
1660
+ * Several methods trigger different `"change"` events. Below is a list of each action type, followed by each property that's also available:
1661
+ *
1662
+ * * `"insertLines"` (emitted by [[Document.insertLines]])
1663
+ * * `range`: the [[Range]] of the change within the document
1664
+ * * `lines`: the lines in the document that are changing
1665
+ * * `"insertText"` (emitted by [[Document.insertNewLine]])
1666
+ * * `range`: the [[Range]] of the change within the document
1667
+ * * `text`: the text that's being added
1668
+ * * `"removeLines"` (emitted by [[Document.insertLines]])
1669
+ * * `range`: the [[Range]] of the change within the document
1670
+ * * `lines`: the lines in the document that were removed
1671
+ * * `nl`: the new line character (as defined by [[Document.getNewLineCharacter]])
1672
+ * * `"removeText"` (emitted by [[Document.removeInLine]] and [[Document.removeNewLine]])
1673
+ * * `range`: the [[Range]] of the change within the document
1674
+ * * `text`: the text that's being removed
1675
+ *
1676
+ **/
1969
1677
  this.insertLines = function(row, lines) {
1970
1678
  if (lines.length == 0)
1971
1679
  return {row: row, column: 0};
1972
1680
 
1681
+ // apply doesn't work for big arrays (smallest threshold is on safari 0xFFFF)
1682
+ // to circumvent that we have to break huge inserts into smaller chunks here
1683
+ if (lines.length > 0xFFFF) {
1684
+ var end = this.insertLines(row, lines.slice(0xFFFF));
1685
+ lines = lines.slice(0, 0xFFFF);
1686
+ }
1687
+
1973
1688
  var args = [row, 0];
1974
1689
  args.push.apply(args, lines);
1975
1690
  this.$lines.splice.apply(this.$lines, args);
@@ -1981,20 +1696,8 @@ var Document = function(text) {
1981
1696
  lines: lines
1982
1697
  };
1983
1698
  this._emit("change", { data: delta });
1984
- return range.end;
1699
+ return end || range.end;
1985
1700
  };
1986
-
1987
- /**
1988
- * Document.insertNewLine(position) -> Object
1989
- * - position (String): The position to insert at
1990
- * + (Object): Returns an object containing the final row and column, like this:<br/>
1991
- * ```{row: endRow, column: 0}```
1992
- *
1993
- * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event.
1994
- *
1995
- *
1996
- *
1997
- **/
1998
1701
  this.insertNewLine = function(position) {
1999
1702
  position = this.$clipPosition(position);
2000
1703
  var line = this.$lines[position.row] || "";
@@ -2016,20 +1719,6 @@ var Document = function(text) {
2016
1719
 
2017
1720
  return end;
2018
1721
  };
2019
-
2020
- /**
2021
- * Document.insertInLine(position, text) -> Object | Number
2022
- * - position (Number): The position to insert at
2023
- * - text (String): A chunk of text
2024
- * + (Object): Returns an object containing the final row and column, like this:<br/>
2025
- * ```{row: endRow, column: 0}```
2026
- * + (Number): If `text` is empty, this function returns the value of `position`
2027
- *
2028
- * Inserts `text` into the `position` at the current row. This method also triggers the `'change'` event.
2029
- *
2030
- *
2031
- *
2032
- **/
2033
1722
  this.insertInLine = function(position, text) {
2034
1723
  if (text.length == 0)
2035
1724
  return position;
@@ -2053,16 +1742,6 @@ var Document = function(text) {
2053
1742
 
2054
1743
  return end;
2055
1744
  };
2056
-
2057
- /**
2058
- * Document.remove(range) -> Object
2059
- * - range (Range): A specified Range to remove
2060
- * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`.
2061
- *
2062
- * Removes the `range` from the document.
2063
- *
2064
- *
2065
- **/
2066
1745
  this.remove = function(range) {
2067
1746
  // clip to document
2068
1747
  range.start = this.$clipPosition(range.start);
@@ -2094,18 +1773,6 @@ var Document = function(text) {
2094
1773
  }
2095
1774
  return range.start;
2096
1775
  };
2097
-
2098
- /**
2099
- * Document.removeInLine(row, startColumn, endColumn) -> Object
2100
- * - row (Number): The row to remove from
2101
- * - startColumn (Number): The column to start removing at
2102
- * - endColumn (Number): The column to stop removing at
2103
- * + (Object): Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.<br/>If `startColumn` is equal to `endColumn`, this function returns nothing.
2104
- *
2105
- * Removes the specified columns from the `row`. This method also triggers the `'change'` event.
2106
- *
2107
- *
2108
- **/
2109
1776
  this.removeInLine = function(row, startColumn, endColumn) {
2110
1777
  if (startColumn == endColumn)
2111
1778
  return;
@@ -2124,17 +1791,6 @@ var Document = function(text) {
2124
1791
  this._emit("change", { data: delta });
2125
1792
  return range.start;
2126
1793
  };
2127
-
2128
- /**
2129
- * Document.removeLines(firstRow, lastRow) -> [String]
2130
- * - firstRow (Number): The first row to be removed
2131
- * - lastRow (Number): The last row to be removed
2132
- * + ([String]): Returns all the removed lines.
2133
- *
2134
- * Removes a range of full lines. This method also triggers the `'change'` event.
2135
- *
2136
- *
2137
- **/
2138
1794
  this.removeLines = function(firstRow, lastRow) {
2139
1795
  var range = new Range(firstRow, 0, lastRow + 1, 0);
2140
1796
  var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
@@ -2148,14 +1804,6 @@ var Document = function(text) {
2148
1804
  this._emit("change", { data: delta });
2149
1805
  return removed;
2150
1806
  };
2151
-
2152
- /**
2153
- * Document.removeNewLine(row) -> Void
2154
- * - row (Number): The row to check
2155
- *
2156
- * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event.
2157
- *
2158
- **/
2159
1807
  this.removeNewLine = function(row) {
2160
1808
  var firstLine = this.getLine(row);
2161
1809
  var secondLine = this.getLine(row+1);
@@ -2172,19 +1820,6 @@ var Document = function(text) {
2172
1820
  };
2173
1821
  this._emit("change", { data: delta });
2174
1822
  };
2175
-
2176
- /**
2177
- * Document.replace(range, text) -> Object
2178
- * - range (Range): A specified Range to replace
2179
- * - text (String): The new text to use as a replacement
2180
- * + (Object): Returns an object containing the final row and column, like this:
2181
- * {row: endRow, column: 0}
2182
- * If the text and range are empty, this function returns an object containing the current `range.start` value.
2183
- * If the text is the exact same as what currently exists, this function returns an object containing the current `range.end` value.
2184
- *
2185
- * Replaces a range in the document with the new `text`.
2186
- *
2187
- **/
2188
1823
  this.replace = function(range, text) {
2189
1824
  if (text.length == 0 && range.isEmpty())
2190
1825
  return range.start;
@@ -2204,12 +1839,6 @@ var Document = function(text) {
2204
1839
 
2205
1840
  return end;
2206
1841
  };
2207
-
2208
- /**
2209
- * Document.applyDeltas(deltas) -> Void
2210
- *
2211
- * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
2212
- **/
2213
1842
  this.applyDeltas = function(deltas) {
2214
1843
  for (var i=0; i<deltas.length; i++) {
2215
1844
  var delta = deltas[i];
@@ -2225,12 +1854,6 @@ var Document = function(text) {
2225
1854
  this.remove(range);
2226
1855
  }
2227
1856
  };
2228
-
2229
- /**
2230
- * Document.revertDeltas(deltas) -> Void
2231
- *
2232
- * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
2233
- **/
2234
1857
  this.revertDeltas = function(deltas) {
2235
1858
  for (var i=deltas.length-1; i>=0; i--) {
2236
1859
  var delta = deltas[i];
@@ -2252,45 +1875,9 @@ var Document = function(text) {
2252
1875
 
2253
1876
  exports.Document = Document;
2254
1877
  });
2255
- /* ***** BEGIN LICENSE BLOCK *****
2256
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2257
- *
2258
- * The contents of this file are subject to the Mozilla Public License Version
2259
- * 1.1 (the "License"); you may not use this file except in compliance with
2260
- * the License. You may obtain a copy of the License at
2261
- * http://www.mozilla.org/MPL/
2262
- *
2263
- * Software distributed under the License is distributed on an "AS IS" basis,
2264
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2265
- * for the specific language governing rights and limitations under the
2266
- * License.
2267
- *
2268
- * The Original Code is Ajax.org Code Editor (ACE).
2269
- *
2270
- * The Initial Developer of the Original Code is
2271
- * Ajax.org B.V.
2272
- * Portions created by the Initial Developer are Copyright (C) 2010
2273
- * the Initial Developer. All Rights Reserved.
2274
- *
2275
- * Contributor(s):
2276
- * Fabian Jakobs <fabian AT ajax DOT org>
2277
- *
2278
- * Alternatively, the contents of this file may be used under the terms of
2279
- * either the GNU General Public License Version 2 or later (the "GPL"), or
2280
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2281
- * in which case the provisions of the GPL or the LGPL are applicable instead
2282
- * of those above. If you wish to allow use of your version of this file only
2283
- * under the terms of either the GPL or the LGPL, and not to allow others to
2284
- * use your version of this file under the terms of the MPL, indicate your
2285
- * decision by deleting the provisions above and replace them with the notice
2286
- * and other provisions required by the GPL or the LGPL. If you do not delete
2287
- * the provisions above, a recipient may use your version of this file under
2288
- * the terms of any one of the MPL, the GPL or the LGPL.
2289
- *
2290
- * ***** END LICENSE BLOCK ***** */
2291
1878
 
2292
1879
  define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) {
2293
- "use strict";
1880
+
2294
1881
 
2295
1882
  /**
2296
1883
  * class Range
@@ -2334,53 +1921,15 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2334
1921
  this.end.row == range.end.row &&
2335
1922
  this.start.column == range.start.column &&
2336
1923
  this.end.column == range.end.column
2337
- };
2338
-
2339
- /**
2340
- * Range.toString() -> String
2341
- *
2342
- * Returns a string containing the range's row and column information, given like this:
2343
- *
2344
- * [start.row/start.column] -> [end.row/end.column]
2345
- *
2346
- **/
2347
-
1924
+ };
2348
1925
  this.toString = function() {
2349
1926
  return ("Range: [" + this.start.row + "/" + this.start.column +
2350
1927
  "] -> [" + this.end.row + "/" + this.end.column + "]");
2351
- };
2352
-
2353
- /** related to: Range.compare
2354
- * Range.contains(row, column) -> Boolean
2355
- * - row (Number): A row to check for
2356
- * - column (Number): A column to check for
2357
- *
2358
- * Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if:
2359
- *
2360
- * this.start.row <= row <= this.end.row &&
2361
- * this.start.column <= column <= this.end.column
2362
- *
2363
- **/
1928
+ };
2364
1929
 
2365
1930
  this.contains = function(row, column) {
2366
1931
  return this.compare(row, column) == 0;
2367
- };
2368
-
2369
- /** related to: Range.compare
2370
- * Range.compareRange(range) -> Number
2371
- * - range (Range): A range to compare with
2372
- * + (Number): This method returns one of the following numbers:<br/>
2373
- * <br/>
2374
- * * `-2`: (B) is in front of (A), and doesn't intersect with (A)<br/>
2375
- * * `-1`: (B) begins before (A) but ends inside of (A)<br/>
2376
- * * `0`: (B) is completely inside of (A) OR (A) is completely inside of (B)<br/>
2377
- * * `+1`: (B) begins inside of (A) but ends outside of (A)<br/>
2378
- * * `+2`: (B) is after (A) and doesn't intersect with (A)<br/>
2379
- * * `42`: FTW state: (B) ends in (A) but starts outside of (A)
2380
- *
2381
- * Compares `this` range (A) with another range (B).
2382
- *
2383
- **/
1932
+ };
2384
1933
  this.compareRange = function(range) {
2385
1934
  var cmp,
2386
1935
  end = range.end,
@@ -2617,30 +2166,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2617
2166
 
2618
2167
  return 0;
2619
2168
  };
2620
-
2621
- /**
2622
- * Range.compareStart(row, column) -> Number
2623
- * - row (Number): A row point to compare with
2624
- * - column (Number): A column point to compare with
2625
- * + (Number): This method returns one of the following numbers:<br/>
2626
- * <br/>
2627
- * * `0` if the two points are exactly equal<br/>
2628
- * * `-1` if `p.row` is less then the calling range<br/>
2629
- * * `1` if `p.row` is greater than the calling range, or if `isStart` is `true`.<br/>
2630
- * <br/>
2631
- * If the starting row of the calling range is equal to `p.row`, and:<br/>
2632
- * * `p.column` is greater than or equal to the calling range's starting column, this returns `0`<br/>
2633
- * * Otherwise, it returns -1<br/>
2634
- * <br/>
2635
- * If the ending row of the calling range is equal to `p.row`, and:<br/>
2636
- * * `p.column` is less than or equal to the calling range's ending column, this returns `0`<br/>
2637
- * * Otherwise, it returns 1
2638
- *
2639
- * Checks the row and column points with the row and column points of the calling range.
2640
- *
2641
- *
2642
- *
2643
- **/
2644
2169
  this.compareStart = function(row, column) {
2645
2170
  if (this.start.row == row && this.start.column == column) {
2646
2171
  return -1;
@@ -2678,7 +2203,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2678
2203
  }
2679
2204
  }
2680
2205
 
2681
- /**
2206
+ /**
2682
2207
  * Range.compareInside(row, column) -> Number
2683
2208
  * - row (Number): A row point to compare with
2684
2209
  * - column (Number): A column point to compare with
@@ -2703,7 +2228,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2703
2228
  }
2704
2229
  }
2705
2230
 
2706
- /**
2231
+ /**
2707
2232
  * Range.clipRows(firstRow, lastRow) -> Range
2708
2233
  * - firstRow (Number): The starting row
2709
2234
  * - lastRow (Number): The ending row
@@ -2741,15 +2266,6 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2741
2266
  }
2742
2267
  return Range.fromPoints(start || this.start, end || this.end);
2743
2268
  };
2744
-
2745
- /**
2746
- * Range.extend(row, column) -> Range
2747
- * - row (Number): A new row to extend to
2748
- * - column (Number): A new column to extend to
2749
- *
2750
- * Changes the row and column points for the calling range for both the starting and ending points. This method returns that range with a new row.
2751
- *
2752
- **/
2753
2269
  this.extend = function(row, column) {
2754
2270
  var cmp = this.compare(row, column);
2755
2271
 
@@ -2766,46 +2282,18 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2766
2282
  this.isEmpty = function() {
2767
2283
  return (this.start.row == this.end.row && this.start.column == this.end.column);
2768
2284
  };
2769
-
2770
- /**
2771
- * Range.isMultiLine() -> Boolean
2772
- *
2773
- * Returns true if the range spans across multiple lines.
2774
- *
2775
- **/
2776
2285
  this.isMultiLine = function() {
2777
2286
  return (this.start.row !== this.end.row);
2778
2287
  };
2779
-
2780
- /**
2781
- * Range.clone() -> Range
2782
- *
2783
- * Returns a duplicate of the calling range.
2784
- *
2785
- **/
2786
2288
  this.clone = function() {
2787
2289
  return Range.fromPoints(this.start, this.end);
2788
2290
  };
2789
-
2790
- /**
2791
- * Range.collapseRows() -> Range
2792
- *
2793
- * Returns a range containing the starting and ending rows of the original range, but with a column value of `0`.
2794
- *
2795
- **/
2796
2291
  this.collapseRows = function() {
2797
2292
  if (this.end.column == 0)
2798
2293
  return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0)
2799
2294
  else
2800
2295
  return new Range(this.start.row, 0, this.end.row, 0)
2801
2296
  };
2802
-
2803
- /**
2804
- * Range.toScreenRange(session) -> Range
2805
- * - session (EditSession): The `EditSession` to retrieve coordinates from
2806
- *
2807
- * Given the current `Range`, this function converts those starting and ending points into screen positions, and then returns a new `Range` object.
2808
- **/
2809
2297
  this.toScreenRange = function(session) {
2810
2298
  var screenPosStart =
2811
2299
  session.documentToScreenPosition(this.start);
@@ -2819,71 +2307,19 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
2819
2307
  };
2820
2308
 
2821
2309
  }).call(Range.prototype);
2822
-
2823
- /**
2824
- * Range.fromPoints(start, end) -> Range
2825
- * - start (Range): A starting point to use
2826
- * - end (Range): An ending point to use
2827
- *
2828
- * Creates and returns a new `Range` based on the row and column of the given parameters.
2829
- *
2830
- **/
2831
2310
  Range.fromPoints = function(start, end) {
2832
2311
  return new Range(start.row, start.column, end.row, end.column);
2833
2312
  };
2834
2313
 
2835
2314
  exports.Range = Range;
2836
2315
  });
2837
- /* ***** BEGIN LICENSE BLOCK *****
2838
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2839
- *
2840
- * The contents of this file are subject to the Mozilla Public License Version
2841
- * 1.1 (the "License"); you may not use this file except in compliance with
2842
- * the License. You may obtain a copy of the License at
2843
- * http://www.mozilla.org/MPL/
2844
- *
2845
- * Software distributed under the License is distributed on an "AS IS" basis,
2846
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2847
- * for the specific language governing rights and limitations under the
2848
- * License.
2849
- *
2850
- * The Original Code is Ajax.org Code Editor (ACE).
2851
- *
2852
- * The Initial Developer of the Original Code is
2853
- * Ajax.org B.V.
2854
- * Portions created by the Initial Developer are Copyright (C) 2010
2855
- * the Initial Developer. All Rights Reserved.
2856
- *
2857
- * Contributor(s):
2858
- * Fabian Jakobs <fabian AT ajax DOT org>
2859
- *
2860
- * Alternatively, the contents of this file may be used under the terms of
2861
- * either the GNU General Public License Version 2 or later (the "GPL"), or
2862
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2863
- * in which case the provisions of the GPL or the LGPL are applicable instead
2864
- * of those above. If you wish to allow use of your version of this file only
2865
- * under the terms of either the GPL or the LGPL, and not to allow others to
2866
- * use your version of this file under the terms of the MPL, indicate your
2867
- * decision by deleting the provisions above and replace them with the notice
2868
- * and other provisions required by the GPL or the LGPL. If you do not delete
2869
- * the provisions above, a recipient may use your version of this file under
2870
- * the terms of any one of the MPL, the GPL or the LGPL.
2871
- *
2872
- * ***** END LICENSE BLOCK ***** */
2873
2316
 
2874
2317
  define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) {
2875
- "use strict";
2318
+
2876
2319
 
2877
2320
  var oop = require("./lib/oop");
2878
2321
  var EventEmitter = require("./lib/event_emitter").EventEmitter;
2879
2322
 
2880
- /**
2881
- * class Anchor
2882
- *
2883
- * Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated
2884
- *
2885
- **/
2886
-
2887
2323
  /**
2888
2324
  * new Anchor(doc, row, column)
2889
2325
  * - doc (Document): The document to associate with the anchor
@@ -2909,36 +2345,14 @@ var Anchor = exports.Anchor = function(doc, row, column) {
2909
2345
  (function() {
2910
2346
 
2911
2347
  oop.implement(this, EventEmitter);
2912
-
2913
- /**
2914
- * Anchor.getPosition() -> Object
2915
- *
2916
- * Returns an object identifying the `row` and `column` position of the current anchor.
2917
- *
2918
- **/
2919
2348
 
2920
2349
  this.getPosition = function() {
2921
2350
  return this.$clipPositionToDocument(this.row, this.column);
2922
2351
  };
2923
-
2924
- /**
2925
- * Anchor.getDocument() -> Document
2926
- *
2927
- * Returns the current document.
2928
- *
2929
- **/
2930
2352
 
2931
2353
  this.getDocument = function() {
2932
2354
  return this.document;
2933
2355
  };
2934
-
2935
- /**
2936
- * Anchor@onChange(e)
2937
- * - e (Event): Contains data about the event
2938
- *
2939
- * Fires whenever the anchor position changes. Events that can trigger this function include `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
2940
- *
2941
- **/
2942
2356
 
2943
2357
  this.onChange = function(e) {
2944
2358
  var delta = e.data;
@@ -3005,16 +2419,6 @@ var Anchor = exports.Anchor = function(doc, row, column) {
3005
2419
  this.setPosition(row, column, true);
3006
2420
  };
3007
2421
 
3008
- /**
3009
- * Anchor.setPosition(row, column, noClip)
3010
- * - row (Number): The row index to move the anchor to
3011
- * - column (Number): The column index to move the anchor to
3012
- * - noClip (Boolean): Identifies if you want the position to be clipped
3013
- *
3014
- * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped.
3015
- *
3016
- **/
3017
-
3018
2422
  this.setPosition = function(row, column, noClip) {
3019
2423
  var pos;
3020
2424
  if (noClip) {
@@ -3042,26 +2446,10 @@ var Anchor = exports.Anchor = function(doc, row, column) {
3042
2446
  value: pos
3043
2447
  });
3044
2448
  };
3045
-
3046
- /**
3047
- * Anchor.detach()
3048
- *
3049
- * When called, the `'change'` event listener is removed.
3050
- *
3051
- **/
3052
2449
 
3053
2450
  this.detach = function() {
3054
2451
  this.document.removeEventListener("change", this.$onChange);
3055
2452
  };
3056
-
3057
- /** internal, hide
3058
- * Anchor.clipPositionToDocument(row, column)
3059
- * - row (Number): The row index to clip the anchor to
3060
- * - column (Number): The column index to clip the anchor to
3061
- *
3062
- * Clips the anchor position to the specified row and column.
3063
- *
3064
- **/
3065
2453
 
3066
2454
  this.$clipPositionToDocument = function(row, column) {
3067
2455
  var pos = {};
@@ -3088,45 +2476,9 @@ var Anchor = exports.Anchor = function(doc, row, column) {
3088
2476
  }).call(Anchor.prototype);
3089
2477
 
3090
2478
  });
3091
- /* ***** BEGIN LICENSE BLOCK *****
3092
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3093
- *
3094
- * The contents of this file are subject to the Mozilla Public License Version
3095
- * 1.1 (the "License"); you may not use this file except in compliance with
3096
- * the License. You may obtain a copy of the License at
3097
- * http://www.mozilla.org/MPL/
3098
- *
3099
- * Software distributed under the License is distributed on an "AS IS" basis,
3100
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
3101
- * for the specific language governing rights and limitations under the
3102
- * License.
3103
- *
3104
- * The Original Code is Ajax.org Code Editor (ACE).
3105
- *
3106
- * The Initial Developer of the Original Code is
3107
- * Ajax.org B.V.
3108
- * Portions created by the Initial Developer are Copyright (C) 2010
3109
- * the Initial Developer. All Rights Reserved.
3110
- *
3111
- * Contributor(s):
3112
- * Fabian Jakobs <fabian AT ajax DOT org>
3113
- *
3114
- * Alternatively, the contents of this file may be used under the terms of
3115
- * either the GNU General Public License Version 2 or later (the "GPL"), or
3116
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
3117
- * in which case the provisions of the GPL or the LGPL are applicable instead
3118
- * of those above. If you wish to allow use of your version of this file only
3119
- * under the terms of either the GPL or the LGPL, and not to allow others to
3120
- * use your version of this file under the terms of the MPL, indicate your
3121
- * decision by deleting the provisions above and replace them with the notice
3122
- * and other provisions required by the GPL or the LGPL. If you do not delete
3123
- * the provisions above, a recipient may use your version of this file under
3124
- * the terms of any one of the MPL, the GPL or the LGPL.
3125
- *
3126
- * ***** END LICENSE BLOCK ***** */
3127
2479
 
3128
2480
  define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) {
3129
- "use strict";
2481
+
3130
2482
 
3131
2483
  exports.stringReverse = function(string) {
3132
2484
  return string.split("").reverse().join("");
@@ -3191,9 +2543,13 @@ exports.arrayToMap = function(arr) {
3191
2543
 
3192
2544
  };
3193
2545
 
3194
- /*
3195
- * splice out of 'array' anything that === 'value'
3196
- */
2546
+ exports.createMap = function(props) {
2547
+ var map = Object.create(null);
2548
+ for (var i in props) {
2549
+ map[i] = props[i];
2550
+ }
2551
+ return map;
2552
+ };
3197
2553
  exports.arrayRemove = function(array, value) {
3198
2554
  for (var i = 0; i <= array.length; i++) {
3199
2555
  if (value === array[i]) {
@@ -3206,6 +2562,20 @@ exports.escapeRegExp = function(str) {
3206
2562
  return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1');
3207
2563
  };
3208
2564
 
2565
+ exports.getMatchOffsets = function(string, regExp) {
2566
+ var matches = [];
2567
+
2568
+ string.replace(regExp, function(str) {
2569
+ matches.push({
2570
+ offset: arguments[arguments.length-2],
2571
+ length: str.length
2572
+ });
2573
+ });
2574
+
2575
+ return matches;
2576
+ };
2577
+
2578
+
3209
2579
  exports.deferredCall = function(fcn) {
3210
2580
 
3211
2581
  var timer = null;
@@ -3238,42 +2608,6 @@ exports.deferredCall = function(fcn) {
3238
2608
  };
3239
2609
 
3240
2610
  });
3241
- /* ***** BEGIN LICENSE BLOCK *****
3242
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3243
- *
3244
- * The contents of this file are subject to the Mozilla Public License Version
3245
- * 1.1 (the "License"); you may not use this file except in compliance with
3246
- * the License. You may obtain a copy of the License at
3247
- * http://www.mozilla.org/MPL/
3248
- *
3249
- * Software distributed under the License is distributed on an "AS IS" basis,
3250
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
3251
- * for the specific language governing rights and limitations under the
3252
- * License.
3253
- *
3254
- * The Original Code is Ajax.org Code Editor (ACE).
3255
- *
3256
- * The Initial Developer of the Original Code is
3257
- * Ajax.org B.V.
3258
- * Portions created by the Initial Developer are Copyright (C) 2010
3259
- * the Initial Developer. All Rights Reserved.
3260
- *
3261
- * Contributor(s):
3262
- * Fabian Jakobs <fabian AT ajax DOT org>
3263
- *
3264
- * Alternatively, the contents of this file may be used under the terms of
3265
- * either the GNU General Public License Version 2 or later (the "GPL"), or
3266
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
3267
- * in which case the provisions of the GPL or the LGPL are applicable instead
3268
- * of those above. If you wish to allow use of your version of this file only
3269
- * under the terms of either the GPL or the LGPL, and not to allow others to
3270
- * use your version of this file under the terms of the MPL, indicate your
3271
- * decision by deleting the provisions above and replace them with the notice
3272
- * and other provisions required by the GPL or the LGPL. If you do not delete
3273
- * the provisions above, a recipient may use your version of this file under
3274
- * the terms of any one of the MPL, the GPL or the LGPL.
3275
- *
3276
- * ***** END LICENSE BLOCK ***** */
3277
2611
 
3278
2612
  define('ace/mode/coffee/coffee-script', ['require', 'exports', 'module' , 'ace/mode/coffee/lexer', 'ace/mode/coffee/parser', 'ace/mode/coffee/nodes'], function(require, exports, module) {
3279
2613
 
@@ -3301,30 +2635,6 @@ define('ace/mode/coffee/coffee-script', ['require', 'exports', 'module' , 'ace/m
3301
2635
  return parser.parse(lexer.tokenize(code));
3302
2636
  };
3303
2637
  });
3304
- /*
3305
- * Copyright (c) 2011 Jeremy Ashkenas
3306
- *
3307
- * Permission is hereby granted, free of charge, to any person
3308
- * obtaining a copy of this software and associated documentation
3309
- * files (the "Software"), to deal in the Software without
3310
- * restriction, including without limitation the rights to use,
3311
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
3312
- * copies of the Software, and to permit persons to whom the
3313
- * Software is furnished to do so, subject to the following
3314
- * conditions:
3315
- *
3316
- * The above copyright notice and this permission notice shall be
3317
- * included in all copies or substantial portions of the Software.
3318
- *
3319
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3320
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3321
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3322
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3323
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3324
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3325
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
3326
- * OTHER DEALINGS IN THE SOFTWARE.
3327
- */
3328
2638
 
3329
2639
  define('ace/mode/coffee/lexer', ['require', 'exports', 'module' , 'ace/mode/coffee/rewriter', 'ace/mode/coffee/helpers'], function(require, exports, module) {
3330
2640
  // Generated by CoffeeScript 1.2.1-pre
@@ -4040,30 +3350,6 @@ define('ace/mode/coffee/lexer', ['require', 'exports', 'module' , 'ace/mode/coff
4040
3350
 
4041
3351
 
4042
3352
  });
4043
- /*
4044
- * Copyright (c) 2011 Jeremy Ashkenas
4045
- *
4046
- * Permission is hereby granted, free of charge, to any person
4047
- * obtaining a copy of this software and associated documentation
4048
- * files (the "Software"), to deal in the Software without
4049
- * restriction, including without limitation the rights to use,
4050
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
4051
- * copies of the Software, and to permit persons to whom the
4052
- * Software is furnished to do so, subject to the following
4053
- * conditions:
4054
- *
4055
- * The above copyright notice and this permission notice shall be
4056
- * included in all copies or substantial portions of the Software.
4057
- *
4058
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4059
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
4060
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
4061
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
4062
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
4063
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4064
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4065
- * OTHER DEALINGS IN THE SOFTWARE.
4066
- */
4067
3353
 
4068
3354
  define('ace/mode/coffee/rewriter', ['require', 'exports', 'module' ], function(require, exports, module) {
4069
3355
  // Generated by CoffeeScript 1.2.1-pre
@@ -4382,30 +3668,6 @@ define('ace/mode/coffee/rewriter', ['require', 'exports', 'module' ], function(r
4382
3668
 
4383
3669
 
4384
3670
  });
4385
- /*
4386
- * Copyright (c) 2011 Jeremy Ashkenas
4387
- *
4388
- * Permission is hereby granted, free of charge, to any person
4389
- * obtaining a copy of this software and associated documentation
4390
- * files (the "Software"), to deal in the Software without
4391
- * restriction, including without limitation the rights to use,
4392
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
4393
- * copies of the Software, and to permit persons to whom the
4394
- * Software is furnished to do so, subject to the following
4395
- * conditions:
4396
- *
4397
- * The above copyright notice and this permission notice shall be
4398
- * included in all copies or substantial portions of the Software.
4399
- *
4400
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4401
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
4402
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
4403
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
4404
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
4405
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4406
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4407
- * OTHER DEALINGS IN THE SOFTWARE.
4408
- */
4409
3671
 
4410
3672
  define('ace/mode/coffee/helpers', ['require', 'exports', 'module' ], function(require, exports, module) {
4411
3673
  // Generated by CoffeeScript 1.2.1-pre
@@ -4482,30 +3744,6 @@ define('ace/mode/coffee/helpers', ['require', 'exports', 'module' ], function(re
4482
3744
 
4483
3745
 
4484
3746
  });
4485
- /*
4486
- * Copyright (c) 2011 Jeremy Ashkenas
4487
- *
4488
- * Permission is hereby granted, free of charge, to any person
4489
- * obtaining a copy of this software and associated documentation
4490
- * files (the "Software"), to deal in the Software without
4491
- * restriction, including without limitation the rights to use,
4492
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
4493
- * copies of the Software, and to permit persons to whom the
4494
- * Software is furnished to do so, subject to the following
4495
- * conditions:
4496
- *
4497
- * The above copyright notice and this permission notice shall be
4498
- * included in all copies or substantial portions of the Software.
4499
- *
4500
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
4501
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
4502
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
4503
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
4504
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
4505
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4506
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4507
- * OTHER DEALINGS IN THE SOFTWARE.
4508
- */
4509
3747
 
4510
3748
  define('ace/mode/coffee/parser', ['require', 'exports', 'module' ], function(require, exports, module) {
4511
3749
  /* Jison generated parser */
@@ -5085,30 +4323,6 @@ module.exports = parser;
5085
4323
 
5086
4324
 
5087
4325
  });
5088
- /*
5089
- * Copyright (c) 2011 Jeremy Ashkenas
5090
- *
5091
- * Permission is hereby granted, free of charge, to any person
5092
- * obtaining a copy of this software and associated documentation
5093
- * files (the "Software"), to deal in the Software without
5094
- * restriction, including without limitation the rights to use,
5095
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
5096
- * copies of the Software, and to permit persons to whom the
5097
- * Software is furnished to do so, subject to the following
5098
- * conditions:
5099
- *
5100
- * The above copyright notice and this permission notice shall be
5101
- * included in all copies or substantial portions of the Software.
5102
- *
5103
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
5104
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
5105
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5106
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
5107
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
5108
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5109
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
5110
- * OTHER DEALINGS IN THE SOFTWARE.
5111
- */
5112
4326
 
5113
4327
  define('ace/mode/coffee/nodes', ['require', 'exports', 'module' , 'ace/mode/coffee/scope', 'ace/mode/coffee/lexer', 'ace/mode/coffee/helpers'], function(require, exports, module) {
5114
4328
  // Generated by CoffeeScript 1.2.1-pre
@@ -7841,30 +7055,6 @@ define('ace/mode/coffee/nodes', ['require', 'exports', 'module' , 'ace/mode/coff
7841
7055
 
7842
7056
 
7843
7057
  });
7844
- /*
7845
- * Copyright (c) 2011 Jeremy Ashkenas
7846
- *
7847
- * Permission is hereby granted, free of charge, to any person
7848
- * obtaining a copy of this software and associated documentation
7849
- * files (the "Software"), to deal in the Software without
7850
- * restriction, including without limitation the rights to use,
7851
- * copy, modify, merge, publish, distribute, sublicense, and/or sell
7852
- * copies of the Software, and to permit persons to whom the
7853
- * Software is furnished to do so, subject to the following
7854
- * conditions:
7855
- *
7856
- * The above copyright notice and this permission notice shall be
7857
- * included in all copies or substantial portions of the Software.
7858
- *
7859
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
7860
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7861
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7862
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7863
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7864
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7865
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
7866
- * OTHER DEALINGS IN THE SOFTWARE.
7867
- */
7868
7058
 
7869
7059
  define('ace/mode/coffee/scope', ['require', 'exports', 'module' , 'ace/mode/coffee/helpers'], function(require, exports, module) {
7870
7060
  // Generated by CoffeeScript 1.2.1-pre