daftos 0.1.0 → 0.2.0

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 (307) hide show
  1. data/.DS_Store +0 -0
  2. data/Gemfile +1 -0
  3. data/Gemfile.lock +2 -0
  4. data/Rakefile +4 -0
  5. data/VERSION +1 -1
  6. data/bin/daftos +14 -0
  7. data/daftos.gemspec +363 -0
  8. data/lib/.DS_Store +0 -0
  9. data/lib/apis/.DS_Store +0 -0
  10. data/lib/apis/filesystem_api.rb +68 -0
  11. data/lib/apps/.DS_Store +0 -0
  12. data/lib/apps/apps/body.html +6 -0
  13. data/lib/apps/apps/options.json +7 -0
  14. data/lib/apps/filebrowser/.DS_Store +0 -0
  15. data/lib/apps/filebrowser/body.html +32 -0
  16. data/lib/apps/filebrowser/coffee/filebrowser.coffee +51 -0
  17. data/lib/apps/filebrowser/js/.DS_Store +0 -0
  18. data/lib/apps/filebrowser/js/daftos.js +1 -0
  19. data/lib/apps/filebrowser/options.json +7 -0
  20. data/lib/apps/photobooth/.DS_Store +0 -0
  21. data/lib/apps/photobooth/body.html +1 -0
  22. data/lib/apps/photobooth/coffee/photobooth.coffee +37 -0
  23. data/lib/apps/photobooth/coffee/test.html +278 -0
  24. data/lib/apps/photobooth/css/style.css +30 -0
  25. data/lib/apps/photobooth/js/.DS_Store +0 -0
  26. data/lib/apps/photobooth/js/daftos.js +1 -0
  27. data/lib/apps/photobooth/options.json +26 -0
  28. data/lib/apps/photobrowser/body.html +2 -0
  29. data/lib/apps/photobrowser/coffee/photobrowser.coffee +18 -0
  30. data/lib/apps/photobrowser/js/.DS_Store +0 -0
  31. data/lib/apps/photobrowser/options.json +16 -0
  32. data/lib/apps/texteditor/body.html +1 -0
  33. data/lib/apps/texteditor/coffee/texteditor.coffee +31 -0
  34. data/lib/apps/texteditor/js/.DS_Store +0 -0
  35. data/lib/apps/texteditor/js/ace-compat-noconflict.js +1 -0
  36. data/lib/apps/texteditor/js/ace-compat-uncompressed-noconflict.js +480 -0
  37. data/lib/apps/texteditor/js/ace-compat-uncompressed.js +480 -0
  38. data/lib/apps/texteditor/js/ace-compat.js +1 -0
  39. data/lib/apps/texteditor/js/ace-noconflict.js +10 -0
  40. data/lib/apps/texteditor/js/ace-uncompressed-noconflict.js +19559 -0
  41. data/lib/apps/texteditor/js/ace-uncompressed.js +19559 -0
  42. data/lib/apps/texteditor/js/ace.js +10 -0
  43. data/lib/apps/texteditor/js/keybinding-emacs-noconflict.js +1 -0
  44. data/lib/apps/texteditor/js/keybinding-emacs-uncompressed-noconflict.js +150 -0
  45. data/lib/apps/texteditor/js/keybinding-emacs-uncompressed.js +150 -0
  46. data/lib/apps/texteditor/js/keybinding-emacs.js +1 -0
  47. data/lib/apps/texteditor/js/keybinding-vim-noconflict.js +1 -0
  48. data/lib/apps/texteditor/js/keybinding-vim-uncompressed-noconflict.js +138 -0
  49. data/lib/apps/texteditor/js/keybinding-vim-uncompressed.js +138 -0
  50. data/lib/apps/texteditor/js/keybinding-vim.js +1 -0
  51. data/lib/apps/texteditor/js/mode-c_cpp-noconflict.js +1 -0
  52. data/lib/apps/texteditor/js/mode-c_cpp-uncompressed-noconflict.js +917 -0
  53. data/lib/apps/texteditor/js/mode-c_cpp-uncompressed.js +917 -0
  54. data/lib/apps/texteditor/js/mode-c_cpp.js +1 -0
  55. data/lib/apps/texteditor/js/mode-clojure-noconflict.js +1 -0
  56. data/lib/apps/texteditor/js/mode-clojure-uncompressed-noconflict.js +422 -0
  57. data/lib/apps/texteditor/js/mode-clojure-uncompressed.js +422 -0
  58. data/lib/apps/texteditor/js/mode-clojure.js +1 -0
  59. data/lib/apps/texteditor/js/mode-coffee-noconflict.js +1 -0
  60. data/lib/apps/texteditor/js/mode-coffee-uncompressed-noconflict.js +605 -0
  61. data/lib/apps/texteditor/js/mode-coffee-uncompressed.js +605 -0
  62. data/lib/apps/texteditor/js/mode-coffee.js +1 -0
  63. data/lib/apps/texteditor/js/mode-coldfusion-noconflict.js +1 -0
  64. data/lib/apps/texteditor/js/mode-coldfusion-uncompressed-noconflict.js +2454 -0
  65. data/lib/apps/texteditor/js/mode-coldfusion-uncompressed.js +2454 -0
  66. data/lib/apps/texteditor/js/mode-coldfusion.js +1 -0
  67. data/lib/apps/texteditor/js/mode-csharp-noconflict.js +1 -0
  68. data/lib/apps/texteditor/js/mode-csharp-uncompressed-noconflict.js +767 -0
  69. data/lib/apps/texteditor/js/mode-csharp-uncompressed.js +767 -0
  70. data/lib/apps/texteditor/js/mode-csharp.js +1 -0
  71. data/lib/apps/texteditor/js/mode-css-noconflict.js +1 -0
  72. data/lib/apps/texteditor/js/mode-css-uncompressed-noconflict.js +640 -0
  73. data/lib/apps/texteditor/js/mode-css-uncompressed.js +640 -0
  74. data/lib/apps/texteditor/js/mode-css.js +1 -0
  75. data/lib/apps/texteditor/js/mode-golang-noconflict.js +1 -0
  76. data/lib/apps/texteditor/js/mode-golang-uncompressed-noconflict.js +378 -0
  77. data/lib/apps/texteditor/js/mode-golang-uncompressed.js +378 -0
  78. data/lib/apps/texteditor/js/mode-golang.js +1 -0
  79. data/lib/apps/texteditor/js/mode-groovy-noconflict.js +1 -0
  80. data/lib/apps/texteditor/js/mode-groovy-uncompressed-noconflict.js +1391 -0
  81. data/lib/apps/texteditor/js/mode-groovy-uncompressed.js +1391 -0
  82. data/lib/apps/texteditor/js/mode-groovy.js +1 -0
  83. data/lib/apps/texteditor/js/mode-haxe-noconflict.js +1 -0
  84. data/lib/apps/texteditor/js/mode-haxe-uncompressed-noconflict.js +767 -0
  85. data/lib/apps/texteditor/js/mode-haxe-uncompressed.js +767 -0
  86. data/lib/apps/texteditor/js/mode-haxe.js +1 -0
  87. data/lib/apps/texteditor/js/mode-html-noconflict.js +1 -0
  88. data/lib/apps/texteditor/js/mode-html-uncompressed-noconflict.js +2470 -0
  89. data/lib/apps/texteditor/js/mode-html-uncompressed.js +2470 -0
  90. data/lib/apps/texteditor/js/mode-html.js +1 -0
  91. data/lib/apps/texteditor/js/mode-java-noconflict.js +1 -0
  92. data/lib/apps/texteditor/js/mode-java-uncompressed-noconflict.js +1393 -0
  93. data/lib/apps/texteditor/js/mode-java-uncompressed.js +1393 -0
  94. data/lib/apps/texteditor/js/mode-java.js +1 -0
  95. data/lib/apps/texteditor/js/mode-javascript-noconflict.js +1 -0
  96. data/lib/apps/texteditor/js/mode-javascript-uncompressed-noconflict.js +1224 -0
  97. data/lib/apps/texteditor/js/mode-javascript-uncompressed.js +1224 -0
  98. data/lib/apps/texteditor/js/mode-javascript.js +1 -0
  99. data/lib/apps/texteditor/js/mode-json-noconflict.js +1 -0
  100. data/lib/apps/texteditor/js/mode-json-uncompressed-noconflict.js +698 -0
  101. data/lib/apps/texteditor/js/mode-json-uncompressed.js +698 -0
  102. data/lib/apps/texteditor/js/mode-json.js +1 -0
  103. data/lib/apps/texteditor/js/mode-latex-noconflict.js +1 -0
  104. data/lib/apps/texteditor/js/mode-latex-uncompressed-noconflict.js +95 -0
  105. data/lib/apps/texteditor/js/mode-latex-uncompressed.js +95 -0
  106. data/lib/apps/texteditor/js/mode-latex.js +1 -0
  107. data/lib/apps/texteditor/js/mode-less-noconflict.js +1 -0
  108. data/lib/apps/texteditor/js/mode-less-uncompressed-noconflict.js +654 -0
  109. data/lib/apps/texteditor/js/mode-less-uncompressed.js +654 -0
  110. data/lib/apps/texteditor/js/mode-less.js +1 -0
  111. data/lib/apps/texteditor/js/mode-liquid-noconflict.js +1 -0
  112. data/lib/apps/texteditor/js/mode-liquid-uncompressed-noconflict.js +1353 -0
  113. data/lib/apps/texteditor/js/mode-liquid-uncompressed.js +1353 -0
  114. data/lib/apps/texteditor/js/mode-liquid.js +1 -0
  115. data/lib/apps/texteditor/js/mode-lua-noconflict.js +1 -0
  116. data/lib/apps/texteditor/js/mode-lua-uncompressed-noconflict.js +523 -0
  117. data/lib/apps/texteditor/js/mode-lua-uncompressed.js +523 -0
  118. data/lib/apps/texteditor/js/mode-lua.js +1 -0
  119. data/lib/apps/texteditor/js/mode-markdown-noconflict.js +1 -0
  120. data/lib/apps/texteditor/js/mode-markdown-uncompressed-noconflict.js +2918 -0
  121. data/lib/apps/texteditor/js/mode-markdown-uncompressed.js +2918 -0
  122. data/lib/apps/texteditor/js/mode-markdown.js +1 -0
  123. data/lib/apps/texteditor/js/mode-ocaml-noconflict.js +1 -0
  124. data/lib/apps/texteditor/js/mode-ocaml-uncompressed-noconflict.js +539 -0
  125. data/lib/apps/texteditor/js/mode-ocaml-uncompressed.js +539 -0
  126. data/lib/apps/texteditor/js/mode-ocaml.js +1 -0
  127. data/lib/apps/texteditor/js/mode-perl-noconflict.js +1 -0
  128. data/lib/apps/texteditor/js/mode-perl-uncompressed-noconflict.js +573 -0
  129. data/lib/apps/texteditor/js/mode-perl-uncompressed.js +573 -0
  130. data/lib/apps/texteditor/js/mode-perl.js +1 -0
  131. data/lib/apps/texteditor/js/mode-pgsql-noconflict.js +1 -0
  132. data/lib/apps/texteditor/js/mode-pgsql-uncompressed-noconflict.js +1104 -0
  133. data/lib/apps/texteditor/js/mode-pgsql-uncompressed.js +1104 -0
  134. data/lib/apps/texteditor/js/mode-pgsql.js +1 -0
  135. data/lib/apps/texteditor/js/mode-php-noconflict.js +1 -0
  136. data/lib/apps/texteditor/js/mode-php-uncompressed-noconflict.js +1883 -0
  137. data/lib/apps/texteditor/js/mode-php-uncompressed.js +1883 -0
  138. data/lib/apps/texteditor/js/mode-php.js +1 -0
  139. data/lib/apps/texteditor/js/mode-powershell-noconflict.js +1 -0
  140. data/lib/apps/texteditor/js/mode-powershell-uncompressed-noconflict.js +708 -0
  141. data/lib/apps/texteditor/js/mode-powershell-uncompressed.js +708 -0
  142. data/lib/apps/texteditor/js/mode-powershell.js +1 -0
  143. data/lib/apps/texteditor/js/mode-python-noconflict.js +1 -0
  144. data/lib/apps/texteditor/js/mode-python-uncompressed-noconflict.js +506 -0
  145. data/lib/apps/texteditor/js/mode-python-uncompressed.js +506 -0
  146. data/lib/apps/texteditor/js/mode-python.js +1 -0
  147. data/lib/apps/texteditor/js/mode-ruby-noconflict.js +1 -0
  148. data/lib/apps/texteditor/js/mode-ruby-uncompressed-noconflict.js +391 -0
  149. data/lib/apps/texteditor/js/mode-ruby-uncompressed.js +391 -0
  150. data/lib/apps/texteditor/js/mode-ruby.js +1 -0
  151. data/lib/apps/texteditor/js/mode-scad-noconflict.js +1 -0
  152. data/lib/apps/texteditor/js/mode-scad-uncompressed-noconflict.js +905 -0
  153. data/lib/apps/texteditor/js/mode-scad-uncompressed.js +905 -0
  154. data/lib/apps/texteditor/js/mode-scad.js +1 -0
  155. data/lib/apps/texteditor/js/mode-scala-noconflict.js +1 -0
  156. data/lib/apps/texteditor/js/mode-scala-uncompressed-noconflict.js +1393 -0
  157. data/lib/apps/texteditor/js/mode-scala-uncompressed.js +1393 -0
  158. data/lib/apps/texteditor/js/mode-scala.js +1 -0
  159. data/lib/apps/texteditor/js/mode-scss-noconflict.js +1 -0
  160. data/lib/apps/texteditor/js/mode-scss-uncompressed-noconflict.js +678 -0
  161. data/lib/apps/texteditor/js/mode-scss-uncompressed.js +678 -0
  162. data/lib/apps/texteditor/js/mode-scss.js +1 -0
  163. data/lib/apps/texteditor/js/mode-sh-noconflict.js +1 -0
  164. data/lib/apps/texteditor/js/mode-sh-uncompressed-noconflict.js +289 -0
  165. data/lib/apps/texteditor/js/mode-sh-uncompressed.js +289 -0
  166. data/lib/apps/texteditor/js/mode-sh.js +1 -0
  167. data/lib/apps/texteditor/js/mode-sql-noconflict.js +1 -0
  168. data/lib/apps/texteditor/js/mode-sql-uncompressed-noconflict.js +159 -0
  169. data/lib/apps/texteditor/js/mode-sql-uncompressed.js +159 -0
  170. data/lib/apps/texteditor/js/mode-sql.js +1 -0
  171. data/lib/apps/texteditor/js/mode-svg-noconflict.js +1 -0
  172. data/lib/apps/texteditor/js/mode-svg-uncompressed-noconflict.js +2133 -0
  173. data/lib/apps/texteditor/js/mode-svg-uncompressed.js +2133 -0
  174. data/lib/apps/texteditor/js/mode-svg.js +1 -0
  175. data/lib/apps/texteditor/js/mode-text-noconflict.js +0 -0
  176. data/lib/apps/texteditor/js/mode-text-uncompressed-noconflict.js +0 -0
  177. data/lib/apps/texteditor/js/mode-text-uncompressed.js +0 -0
  178. data/lib/apps/texteditor/js/mode-text.js +0 -0
  179. data/lib/apps/texteditor/js/mode-textile-noconflict.js +1 -0
  180. data/lib/apps/texteditor/js/mode-textile-uncompressed-noconflict.js +254 -0
  181. data/lib/apps/texteditor/js/mode-textile-uncompressed.js +254 -0
  182. data/lib/apps/texteditor/js/mode-textile.js +1 -0
  183. data/lib/apps/texteditor/js/mode-xml-noconflict.js +1 -0
  184. data/lib/apps/texteditor/js/mode-xml-uncompressed-noconflict.js +1009 -0
  185. data/lib/apps/texteditor/js/mode-xml-uncompressed.js +1009 -0
  186. data/lib/apps/texteditor/js/mode-xml.js +1 -0
  187. data/lib/apps/texteditor/js/mode-xquery-noconflict.js +1 -0
  188. data/lib/apps/texteditor/js/mode-xquery-uncompressed-noconflict.js +540 -0
  189. data/lib/apps/texteditor/js/mode-xquery-uncompressed.js +540 -0
  190. data/lib/apps/texteditor/js/mode-xquery.js +1 -0
  191. data/lib/apps/texteditor/js/theme-chrome-noconflict.js +1 -0
  192. data/lib/apps/texteditor/js/theme-chrome-uncompressed-noconflict.js +207 -0
  193. data/lib/apps/texteditor/js/theme-chrome-uncompressed.js +207 -0
  194. data/lib/apps/texteditor/js/theme-chrome.js +1 -0
  195. data/lib/apps/texteditor/js/theme-clouds-noconflict.js +1 -0
  196. data/lib/apps/texteditor/js/theme-clouds-uncompressed-noconflict.js +160 -0
  197. data/lib/apps/texteditor/js/theme-clouds-uncompressed.js +160 -0
  198. data/lib/apps/texteditor/js/theme-clouds.js +1 -0
  199. data/lib/apps/texteditor/js/theme-clouds_midnight-noconflict.js +1 -0
  200. data/lib/apps/texteditor/js/theme-clouds_midnight-uncompressed-noconflict.js +161 -0
  201. data/lib/apps/texteditor/js/theme-clouds_midnight-uncompressed.js +161 -0
  202. data/lib/apps/texteditor/js/theme-clouds_midnight.js +1 -0
  203. data/lib/apps/texteditor/js/theme-cobalt-noconflict.js +1 -0
  204. data/lib/apps/texteditor/js/theme-cobalt-uncompressed-noconflict.js +187 -0
  205. data/lib/apps/texteditor/js/theme-cobalt-uncompressed.js +187 -0
  206. data/lib/apps/texteditor/js/theme-cobalt.js +1 -0
  207. data/lib/apps/texteditor/js/theme-crimson_editor-noconflict.js +1 -0
  208. data/lib/apps/texteditor/js/theme-crimson_editor-uncompressed-noconflict.js +198 -0
  209. data/lib/apps/texteditor/js/theme-crimson_editor-uncompressed.js +198 -0
  210. data/lib/apps/texteditor/js/theme-crimson_editor.js +1 -0
  211. data/lib/apps/texteditor/js/theme-dawn-noconflict.js +1 -0
  212. data/lib/apps/texteditor/js/theme-dawn-uncompressed-noconflict.js +191 -0
  213. data/lib/apps/texteditor/js/theme-dawn-uncompressed.js +191 -0
  214. data/lib/apps/texteditor/js/theme-dawn.js +1 -0
  215. data/lib/apps/texteditor/js/theme-dreamweaver-noconflict.js +1 -0
  216. data/lib/apps/texteditor/js/theme-dreamweaver-uncompressed-noconflict.js +227 -0
  217. data/lib/apps/texteditor/js/theme-dreamweaver-uncompressed.js +227 -0
  218. data/lib/apps/texteditor/js/theme-dreamweaver.js +1 -0
  219. data/lib/apps/texteditor/js/theme-eclipse-noconflict.js +1 -0
  220. data/lib/apps/texteditor/js/theme-eclipse-uncompressed-noconflict.js +147 -0
  221. data/lib/apps/texteditor/js/theme-eclipse-uncompressed.js +147 -0
  222. data/lib/apps/texteditor/js/theme-eclipse.js +1 -0
  223. data/lib/apps/texteditor/js/theme-idle_fingers-noconflict.js +1 -0
  224. data/lib/apps/texteditor/js/theme-idle_fingers-uncompressed-noconflict.js +179 -0
  225. data/lib/apps/texteditor/js/theme-idle_fingers-uncompressed.js +179 -0
  226. data/lib/apps/texteditor/js/theme-idle_fingers.js +1 -0
  227. data/lib/apps/texteditor/js/theme-kr_theme-noconflict.js +1 -0
  228. data/lib/apps/texteditor/js/theme-kr_theme-uncompressed-noconflict.js +182 -0
  229. data/lib/apps/texteditor/js/theme-kr_theme-uncompressed.js +182 -0
  230. data/lib/apps/texteditor/js/theme-kr_theme.js +1 -0
  231. data/lib/apps/texteditor/js/theme-merbivore-noconflict.js +1 -0
  232. data/lib/apps/texteditor/js/theme-merbivore-uncompressed-noconflict.js +182 -0
  233. data/lib/apps/texteditor/js/theme-merbivore-uncompressed.js +182 -0
  234. data/lib/apps/texteditor/js/theme-merbivore.js +1 -0
  235. data/lib/apps/texteditor/js/theme-merbivore_soft-noconflict.js +1 -0
  236. data/lib/apps/texteditor/js/theme-merbivore_soft-uncompressed-noconflict.js +188 -0
  237. data/lib/apps/texteditor/js/theme-merbivore_soft-uncompressed.js +188 -0
  238. data/lib/apps/texteditor/js/theme-merbivore_soft.js +1 -0
  239. data/lib/apps/texteditor/js/theme-mono_industrial-noconflict.js +1 -0
  240. data/lib/apps/texteditor/js/theme-mono_industrial-uncompressed-noconflict.js +190 -0
  241. data/lib/apps/texteditor/js/theme-mono_industrial-uncompressed.js +190 -0
  242. data/lib/apps/texteditor/js/theme-mono_industrial.js +1 -0
  243. data/lib/apps/texteditor/js/theme-monokai-noconflict.js +1 -0
  244. data/lib/apps/texteditor/js/theme-monokai-uncompressed-noconflict.js +188 -0
  245. data/lib/apps/texteditor/js/theme-monokai-uncompressed.js +188 -0
  246. data/lib/apps/texteditor/js/theme-monokai.js +1 -0
  247. data/lib/apps/texteditor/js/theme-pastel_on_dark-noconflict.js +1 -0
  248. data/lib/apps/texteditor/js/theme-pastel_on_dark-uncompressed-noconflict.js +192 -0
  249. data/lib/apps/texteditor/js/theme-pastel_on_dark-uncompressed.js +192 -0
  250. data/lib/apps/texteditor/js/theme-pastel_on_dark.js +1 -0
  251. data/lib/apps/texteditor/js/theme-solarized_dark-noconflict.js +1 -0
  252. data/lib/apps/texteditor/js/theme-solarized_dark-uncompressed-noconflict.js +173 -0
  253. data/lib/apps/texteditor/js/theme-solarized_dark-uncompressed.js +173 -0
  254. data/lib/apps/texteditor/js/theme-solarized_dark.js +1 -0
  255. data/lib/apps/texteditor/js/theme-solarized_light-noconflict.js +1 -0
  256. data/lib/apps/texteditor/js/theme-solarized_light-uncompressed-noconflict.js +172 -0
  257. data/lib/apps/texteditor/js/theme-solarized_light-uncompressed.js +172 -0
  258. data/lib/apps/texteditor/js/theme-solarized_light.js +1 -0
  259. data/lib/apps/texteditor/js/theme-textmate-noconflict.js +0 -0
  260. data/lib/apps/texteditor/js/theme-textmate-uncompressed-noconflict.js +0 -0
  261. data/lib/apps/texteditor/js/theme-textmate-uncompressed.js +0 -0
  262. data/lib/apps/texteditor/js/theme-textmate.js +0 -0
  263. data/lib/apps/texteditor/js/theme-tomorrow-noconflict.js +1 -0
  264. data/lib/apps/texteditor/js/theme-tomorrow-uncompressed-noconflict.js +206 -0
  265. data/lib/apps/texteditor/js/theme-tomorrow-uncompressed.js +206 -0
  266. data/lib/apps/texteditor/js/theme-tomorrow.js +1 -0
  267. data/lib/apps/texteditor/js/theme-tomorrow_night-noconflict.js +1 -0
  268. data/lib/apps/texteditor/js/theme-tomorrow_night-uncompressed-noconflict.js +206 -0
  269. data/lib/apps/texteditor/js/theme-tomorrow_night-uncompressed.js +206 -0
  270. data/lib/apps/texteditor/js/theme-tomorrow_night.js +1 -0
  271. data/lib/apps/texteditor/js/theme-tomorrow_night_blue-noconflict.js +1 -0
  272. data/lib/apps/texteditor/js/theme-tomorrow_night_blue-uncompressed-noconflict.js +206 -0
  273. data/lib/apps/texteditor/js/theme-tomorrow_night_blue-uncompressed.js +206 -0
  274. data/lib/apps/texteditor/js/theme-tomorrow_night_blue.js +1 -0
  275. data/lib/apps/texteditor/js/theme-tomorrow_night_bright-noconflict.js +1 -0
  276. data/lib/apps/texteditor/js/theme-tomorrow_night_bright-uncompressed-noconflict.js +206 -0
  277. data/lib/apps/texteditor/js/theme-tomorrow_night_bright-uncompressed.js +206 -0
  278. data/lib/apps/texteditor/js/theme-tomorrow_night_bright.js +1 -0
  279. data/lib/apps/texteditor/js/theme-tomorrow_night_eighties-noconflict.js +1 -0
  280. data/lib/apps/texteditor/js/theme-tomorrow_night_eighties-uncompressed-noconflict.js +202 -0
  281. data/lib/apps/texteditor/js/theme-tomorrow_night_eighties-uncompressed.js +202 -0
  282. data/lib/apps/texteditor/js/theme-tomorrow_night_eighties.js +1 -0
  283. data/lib/apps/texteditor/js/theme-twilight-noconflict.js +1 -0
  284. data/lib/apps/texteditor/js/theme-twilight-uncompressed-noconflict.js +204 -0
  285. data/lib/apps/texteditor/js/theme-twilight-uncompressed.js +204 -0
  286. data/lib/apps/texteditor/js/theme-twilight.js +1 -0
  287. data/lib/apps/texteditor/js/theme-vibrant_ink-noconflict.js +1 -0
  288. data/lib/apps/texteditor/js/theme-vibrant_ink-uncompressed-noconflict.js +183 -0
  289. data/lib/apps/texteditor/js/theme-vibrant_ink-uncompressed.js +183 -0
  290. data/lib/apps/texteditor/js/theme-vibrant_ink.js +1 -0
  291. data/lib/apps/texteditor/js/worker-coffee.js +7991 -0
  292. data/lib/apps/texteditor/js/worker-css.js +12224 -0
  293. data/lib/apps/texteditor/js/worker-javascript.js +11124 -0
  294. data/lib/apps/texteditor/js/worker-json.js +3593 -0
  295. data/lib/apps/texteditor/options.json +16 -0
  296. data/lib/daftos/.DS_Store +0 -0
  297. data/lib/daftos/server.rb +106 -0
  298. data/lib/daftos/views/app_footer.erb +2 -0
  299. data/lib/daftos/views/app_header.erb +33 -0
  300. data/lib/daftos.rb +25 -2
  301. data/lib/libs/.DS_Store +0 -0
  302. data/lib/libs/coffee/daftos.coffee +36 -0
  303. data/lib/libs/css/bootstrap.css +3496 -0
  304. data/lib/libs/js/bootstrap.js +1720 -0
  305. data/lib/libs/js/jquery.js +4 -0
  306. data/myapp.pid +1 -0
  307. metadata +325 -12
@@ -0,0 +1,1391 @@
1
+ ace.define('ace/mode/groovy', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/groovy_highlight_rules'], function(require, exports, module) {
2
+ "use strict";
3
+
4
+ var oop = require("../lib/oop");
5
+ var JavaScriptMode = require("./javascript").Mode;
6
+ var Tokenizer = require("../tokenizer").Tokenizer;
7
+ var GroovyHighlightRules = require("./groovy_highlight_rules").GroovyHighlightRules;
8
+
9
+ var Mode = function() {
10
+ JavaScriptMode.call(this);
11
+ this.$tokenizer = new Tokenizer(new GroovyHighlightRules().getRules());
12
+ };
13
+ oop.inherits(Mode, JavaScriptMode);
14
+
15
+ (function() {
16
+
17
+ this.createWorker = function(session) {
18
+ return null;
19
+ };
20
+
21
+ }).call(Mode.prototype);
22
+
23
+ exports.Mode = Mode;
24
+ });
25
+ /* ***** BEGIN LICENSE BLOCK *****
26
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
27
+ *
28
+ * The contents of this file are subject to the Mozilla Public License Version
29
+ * 1.1 (the "License"); you may not use this file except in compliance with
30
+ * the License. You may obtain a copy of the License at
31
+ * http://www.mozilla.org/MPL/
32
+ *
33
+ * Software distributed under the License is distributed on an "AS IS" basis,
34
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
35
+ * for the specific language governing rights and limitations under the
36
+ * License.
37
+ *
38
+ * The Original Code is Ajax.org Code Editor (ACE).
39
+ *
40
+ * The Initial Developer of the Original Code is
41
+ * Ajax.org B.V.
42
+ * Portions created by the Initial Developer are Copyright (C) 2010
43
+ * the Initial Developer. All Rights Reserved.
44
+ *
45
+ * Contributor(s):
46
+ * Fabian Jakobs <fabian AT ajax DOT org>
47
+ *
48
+ * Alternatively, the contents of this file may be used under the terms of
49
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
50
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
51
+ * in which case the provisions of the GPL or the LGPL are applicable instead
52
+ * of those above. If you wish to allow use of your version of this file only
53
+ * under the terms of either the GPL or the LGPL, and not to allow others to
54
+ * use your version of this file under the terms of the MPL, indicate your
55
+ * decision by deleting the provisions above and replace them with the notice
56
+ * and other provisions required by the GPL or the LGPL. If you do not delete
57
+ * the provisions above, a recipient may use your version of this file under
58
+ * the terms of any one of the MPL, the GPL or the LGPL.
59
+ *
60
+ * ***** END LICENSE BLOCK ***** */
61
+
62
+ ace.define('ace/mode/javascript', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/javascript_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/range', 'ace/worker/worker_client', 'ace/mode/behaviour/cstyle', 'ace/mode/folding/cstyle'], function(require, exports, module) {
63
+ "use strict";
64
+
65
+ var oop = require("../lib/oop");
66
+ var TextMode = require("./text").Mode;
67
+ var Tokenizer = require("../tokenizer").Tokenizer;
68
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
69
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
70
+ var Range = require("../range").Range;
71
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
72
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
73
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
74
+
75
+ var Mode = function() {
76
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
77
+ this.$outdent = new MatchingBraceOutdent();
78
+ this.$behaviour = new CstyleBehaviour();
79
+ this.foldingRules = new CStyleFoldMode();
80
+ };
81
+ oop.inherits(Mode, TextMode);
82
+
83
+ (function() {
84
+
85
+
86
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
87
+ var outdent = true;
88
+ var re = /^(\s*)\/\//;
89
+
90
+ for (var i=startRow; i<= endRow; i++) {
91
+ if (!re.test(doc.getLine(i))) {
92
+ outdent = false;
93
+ break;
94
+ }
95
+ }
96
+
97
+ if (outdent) {
98
+ var deleteRange = new Range(0, 0, 0, 0);
99
+ for (var i=startRow; i<= endRow; i++)
100
+ {
101
+ var line = doc.getLine(i);
102
+ var m = line.match(re);
103
+ deleteRange.start.row = i;
104
+ deleteRange.end.row = i;
105
+ deleteRange.end.column = m[0].length;
106
+ doc.replace(deleteRange, m[1]);
107
+ }
108
+ }
109
+ else {
110
+ doc.indentRows(startRow, endRow, "//");
111
+ }
112
+ };
113
+
114
+ this.getNextLineIndent = function(state, line, tab) {
115
+ var indent = this.$getIndent(line);
116
+
117
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
118
+ var tokens = tokenizedLine.tokens;
119
+ var endState = tokenizedLine.state;
120
+
121
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
122
+ return indent;
123
+ }
124
+
125
+ if (state == "start" || state == "regex_allowed") {
126
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
127
+ if (match) {
128
+ indent += tab;
129
+ }
130
+ } else if (state == "doc-start") {
131
+ if (endState == "start" || state == "regex_allowed") {
132
+ return "";
133
+ }
134
+ var match = line.match(/^\s*(\/?)\*/);
135
+ if (match) {
136
+ if (match[1]) {
137
+ indent += " ";
138
+ }
139
+ indent += "* ";
140
+ }
141
+ }
142
+
143
+ return indent;
144
+ };
145
+
146
+ this.checkOutdent = function(state, line, input) {
147
+ return this.$outdent.checkOutdent(line, input);
148
+ };
149
+
150
+ this.autoOutdent = function(state, doc, row) {
151
+ this.$outdent.autoOutdent(doc, row);
152
+ };
153
+
154
+ this.createWorker = function(session) {
155
+ var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
156
+ worker.attachToDocument(session.getDocument());
157
+
158
+ worker.on("jslint", function(results) {
159
+ var errors = [];
160
+ for (var i=0; i<results.data.length; i++) {
161
+ var error = results.data[i];
162
+ if (error)
163
+ errors.push({
164
+ row: error.line-1,
165
+ column: error.character-1,
166
+ text: error.reason,
167
+ type: "warning",
168
+ lint: error
169
+ });
170
+ }
171
+ session.setAnnotations(errors);
172
+ });
173
+
174
+ worker.on("narcissus", function(e) {
175
+ session.setAnnotations([e.data]);
176
+ });
177
+
178
+ worker.on("terminate", function() {
179
+ session.clearAnnotations();
180
+ });
181
+
182
+ return worker;
183
+ };
184
+
185
+ }).call(Mode.prototype);
186
+
187
+ exports.Mode = Mode;
188
+ });
189
+ /* ***** BEGIN LICENSE BLOCK *****
190
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
191
+ *
192
+ * The contents of this file are subject to the Mozilla Public License Version
193
+ * 1.1 (the "License"); you may not use this file except in compliance with
194
+ * the License. You may obtain a copy of the License at
195
+ * http://www.mozilla.org/MPL/
196
+ *
197
+ * Software distributed under the License is distributed on an "AS IS" basis,
198
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
199
+ * for the specific language governing rights and limitations under the
200
+ * License.
201
+ *
202
+ * The Original Code is Ajax.org Code Editor (ACE).
203
+ *
204
+ * The Initial Developer of the Original Code is
205
+ * Ajax.org B.V.
206
+ * Portions created by the Initial Developer are Copyright (C) 2010
207
+ * the Initial Developer. All Rights Reserved.
208
+ *
209
+ * Contributor(s):
210
+ * Fabian Jakobs <fabian AT ajax DOT org>
211
+ * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
212
+ *
213
+ * Alternatively, the contents of this file may be used under the terms of
214
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
215
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
216
+ * in which case the provisions of the GPL or the LGPL are applicable instead
217
+ * of those above. If you wish to allow use of your version of this file only
218
+ * under the terms of either the GPL or the LGPL, and not to allow others to
219
+ * use your version of this file under the terms of the MPL, indicate your
220
+ * decision by deleting the provisions above and replace them with the notice
221
+ * and other provisions required by the GPL or the LGPL. If you do not delete
222
+ * the provisions above, a recipient may use your version of this file under
223
+ * the terms of any one of the MPL, the GPL or the LGPL.
224
+ *
225
+ * ***** END LICENSE BLOCK ***** */
226
+
227
+ ace.define('ace/mode/javascript_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/unicode', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
228
+ "use strict";
229
+
230
+ var oop = require("../lib/oop");
231
+ var lang = require("../lib/lang");
232
+ var unicode = require("../unicode");
233
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
234
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
235
+
236
+ var JavaScriptHighlightRules = function() {
237
+
238
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
239
+ var globals = lang.arrayToMap(
240
+ // Constructors
241
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
242
+ // E4X
243
+ "Namespace|QName|XML|XMLList|" +
244
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
245
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
246
+ // Errors
247
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
248
+ "SyntaxError|TypeError|URIError|" +
249
+ // Non-constructor functions
250
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
251
+ "isNaN|parseFloat|parseInt|" +
252
+ // Other
253
+ "JSON|Math|" +
254
+ // Pseudo
255
+ "this|arguments|prototype|window|document"
256
+ ).split("|")
257
+ );
258
+
259
+ var keywords = lang.arrayToMap(
260
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
261
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
262
+ "const|yield|import|get|set").split("|")
263
+ );
264
+
265
+ // keywords which can be followed by regular expressions
266
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
267
+
268
+ var deprecated = lang.arrayToMap(
269
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
270
+ );
271
+
272
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
273
+
274
+ var buildinConstants = lang.arrayToMap(
275
+ ("null|Infinity|NaN|undefined").split("|")
276
+ );
277
+
278
+ var futureReserved = lang.arrayToMap(
279
+ ("class|enum|extends|super|export|implements|private|" +
280
+ "public|interface|package|protected|static").split("|")
281
+ );
282
+
283
+ // TODO: Unicode escape sequences
284
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
285
+ + unicode.packages.L
286
+ + unicode.packages.Mn + unicode.packages.Mc
287
+ + unicode.packages.Nd
288
+ + unicode.packages.Pc + "\\$_]*\\b";
289
+
290
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
291
+ "u[0-9a-fA-F]{4}|" + // unicode
292
+ "[0-2][0-7]{0,2}|" + // oct
293
+ "3[0-6][0-7]?|" + // oct
294
+ "37[0-7]?|" + // oct
295
+ "[4-7][0-7]?|" + //oct
296
+ ".)";
297
+
298
+ // regexp must not have capturing parentheses. Use (?:) instead.
299
+ // regexps are ordered -> the first match is used
300
+
301
+ this.$rules = {
302
+ "start" : [
303
+ {
304
+ token : "comment",
305
+ regex : /\/\/.*$/
306
+ },
307
+ DocCommentHighlightRules.getStartRule("doc-start"),
308
+ {
309
+ token : "comment", // multi line comment
310
+ merge : true,
311
+ regex : /\/\*/,
312
+ next : "comment"
313
+ }, {
314
+ token : "string",
315
+ regex : "'(?=.)",
316
+ next : "qstring"
317
+ }, {
318
+ token : "string",
319
+ regex : '"(?=.)',
320
+ next : "qqstring"
321
+ }, {
322
+ token : "constant.numeric", // hex
323
+ regex : /0[xX][0-9a-fA-F]+\b/
324
+ }, {
325
+ token : "constant.numeric", // float
326
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
327
+ }, { // match stuff like: Sound.prototype.play = function() { }
328
+ token : [
329
+ "storage.type",
330
+ "punctuation.operator",
331
+ "support.function",
332
+ "punctuation.operator",
333
+ "entity.name.function",
334
+ "text",
335
+ "keyword.operator",
336
+ "text",
337
+ "storage.type",
338
+ "text",
339
+ "paren.lparen"
340
+ ],
341
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
342
+ next: "function_arguments"
343
+ }, { // match stuff like: Sound.prototype.play = myfunc
344
+ token : [
345
+ "storage.type",
346
+ "punctuation.operator",
347
+ "support.function",
348
+ "punctuation.operator",
349
+ "entity.name.function",
350
+ "text",
351
+ "keyword.operator",
352
+ "text"
353
+ ],
354
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
355
+ next: "function_arguments"
356
+ }, { // match stuff like: Sound.play = function() { }
357
+ token : [
358
+ "storage.type",
359
+ "punctuation.operator",
360
+ "entity.name.function",
361
+ "text",
362
+ "keyword.operator",
363
+ "text",
364
+ "storage.type",
365
+ "text",
366
+ "paren.lparen"
367
+ ],
368
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
369
+ next: "function_arguments"
370
+ }, { // match stuff like: play = function() { }
371
+ token : [
372
+ "entity.name.function",
373
+ "text",
374
+ "keyword.operator",
375
+ "text",
376
+ "storage.type",
377
+ "text",
378
+ "paren.lparen"
379
+ ],
380
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
381
+ next: "function_arguments"
382
+ }, { // match regular function like: function myFunc(arg) { }
383
+ token : [
384
+ "storage.type",
385
+ "text",
386
+ "entity.name.function",
387
+ "text",
388
+ "paren.lparen"
389
+ ],
390
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
391
+ next: "function_arguments"
392
+ }, { // match stuff like: foobar: function() { }
393
+ token : [
394
+ "entity.name.function",
395
+ "text",
396
+ "punctuation.operator",
397
+ "text",
398
+ "storage.type",
399
+ "text",
400
+ "paren.lparen"
401
+ ],
402
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
403
+ next: "function_arguments"
404
+ }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
405
+ token : [
406
+ "text",
407
+ "text",
408
+ "storage.type",
409
+ "text",
410
+ "paren.lparen"
411
+ ],
412
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
413
+ next: "function_arguments"
414
+ }, {
415
+ token : "constant.language.boolean",
416
+ regex : /(?:true|false)\b/
417
+ }, {
418
+ token : "keyword",
419
+ regex : "(?:" + kwBeforeRe + ")\\b",
420
+ next : "regex_allowed"
421
+ }, {
422
+ token : ["punctuation.operator", "support.function"],
423
+ regex : /(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
424
+ }, {
425
+ token : ["punctuation.operator", "support.function.dom"],
426
+ regex : /(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
427
+ }, {
428
+ token : ["punctuation.operator", "support.constant"],
429
+ regex : /(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
430
+ }, {
431
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
432
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
433
+ }, {
434
+ token : function(value) {
435
+ if (globals.hasOwnProperty(value))
436
+ return "variable.language";
437
+ else if (deprecated.hasOwnProperty(value))
438
+ return "invalid.deprecated";
439
+ else if (definitions.hasOwnProperty(value))
440
+ return "storage.type";
441
+ else if (keywords.hasOwnProperty(value))
442
+ return "keyword";
443
+ else if (buildinConstants.hasOwnProperty(value))
444
+ return "constant.language";
445
+ else if (futureReserved.hasOwnProperty(value))
446
+ return "invalid.illegal";
447
+ else if (value == "debugger")
448
+ return "invalid.deprecated";
449
+ else
450
+ return "identifier";
451
+ },
452
+ regex : identifierRe
453
+ }, {
454
+ token : "keyword.operator",
455
+ regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
456
+ next : "regex_allowed"
457
+ }, {
458
+ token : "punctuation.operator",
459
+ regex : /\?|\:|\,|\;|\./,
460
+ next : "regex_allowed"
461
+ }, {
462
+ token : "paren.lparen",
463
+ regex : /[\[({]/,
464
+ next : "regex_allowed"
465
+ }, {
466
+ token : "paren.rparen",
467
+ regex : /[\])}]/
468
+ }, {
469
+ token : "keyword.operator",
470
+ regex : /\/=?/,
471
+ next : "regex_allowed"
472
+ }, {
473
+ token: "comment",
474
+ regex: /^#!.*$/
475
+ }, {
476
+ token : "text",
477
+ regex : /\s+/
478
+ }
479
+ ],
480
+ // regular expressions are only allowed after certain tokens. This
481
+ // makes sure we don't mix up regexps with the divison operator
482
+ "regex_allowed": [
483
+ DocCommentHighlightRules.getStartRule("doc-start"),
484
+ {
485
+ token : "comment", // multi line comment
486
+ merge : true,
487
+ regex : "\\/\\*",
488
+ next : "comment_regex_allowed"
489
+ }, {
490
+ token : "comment",
491
+ regex : "\\/\\/.*$"
492
+ }, {
493
+ token: "string.regexp",
494
+ regex: "\\/",
495
+ next: "regex",
496
+ merge: true
497
+ }, {
498
+ token : "text",
499
+ regex : "\\s+"
500
+ }, {
501
+ // immediately return to the start mode without matching
502
+ // anything
503
+ token: "empty",
504
+ regex: "",
505
+ next: "start"
506
+ }
507
+ ],
508
+ "regex": [
509
+ {
510
+ token: "regexp.keyword.operator",
511
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
512
+ }, {
513
+ // flag
514
+ token: "string.regexp",
515
+ regex: "/\\w*",
516
+ next: "start",
517
+ merge: true
518
+ }, {
519
+ token: "string.regexp",
520
+ regex: "[^\\\\/\\[]+",
521
+ merge: true
522
+ }, {
523
+ token: "string.regexp.charachterclass",
524
+ regex: "\\[",
525
+ next: "regex_character_class",
526
+ merge: true
527
+ }, {
528
+ token: "empty",
529
+ regex: "",
530
+ next: "start"
531
+ }
532
+ ],
533
+ "regex_character_class": [
534
+ {
535
+ token: "regexp.keyword.operator",
536
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
537
+ }, {
538
+ token: "string.regexp.charachterclass",
539
+ regex: "]",
540
+ next: "regex",
541
+ merge: true
542
+ }, {
543
+ token: "string.regexp.charachterclass",
544
+ regex: "[^\\\\\\]]+",
545
+ merge: true
546
+ }, {
547
+ token: "empty",
548
+ regex: "",
549
+ next: "start"
550
+ }
551
+ ],
552
+ "function_arguments": [
553
+ {
554
+ token: "variable.parameter",
555
+ regex: identifierRe,
556
+ }, {
557
+ token: "punctuation.operator",
558
+ regex: "[, ]+",
559
+ merge: true
560
+ }, {
561
+ token: "punctuation.operator",
562
+ regex: "$",
563
+ merge: true
564
+ }, {
565
+ token: "empty",
566
+ regex: "",
567
+ next: "start"
568
+ }
569
+ ],
570
+ "comment_regex_allowed" : [
571
+ {
572
+ token : "comment", // closing comment
573
+ regex : ".*?\\*\\/",
574
+ merge : true,
575
+ next : "regex_allowed"
576
+ }, {
577
+ token : "comment", // comment spanning whole line
578
+ merge : true,
579
+ regex : ".+"
580
+ }
581
+ ],
582
+ "comment" : [
583
+ {
584
+ token : "comment", // closing comment
585
+ regex : ".*?\\*\\/",
586
+ merge : true,
587
+ next : "start"
588
+ }, {
589
+ token : "comment", // comment spanning whole line
590
+ merge : true,
591
+ regex : ".+"
592
+ }
593
+ ],
594
+ "qqstring" : [
595
+ {
596
+ token : "constant.language.escape",
597
+ regex : escapedRe
598
+ }, {
599
+ token : "string",
600
+ regex : '[^"\\\\]+',
601
+ merge : true
602
+ }, {
603
+ token : "string",
604
+ regex : "\\\\$",
605
+ next : "qqstring",
606
+ merge : true
607
+ }, {
608
+ token : "string",
609
+ regex : '"|$',
610
+ next : "start",
611
+ merge : true
612
+ }
613
+ ],
614
+ "qstring" : [
615
+ {
616
+ token : "constant.language.escape",
617
+ regex : escapedRe
618
+ }, {
619
+ token : "string",
620
+ regex : "[^'\\\\]+",
621
+ merge : true
622
+ }, {
623
+ token : "string",
624
+ regex : "\\\\$",
625
+ next : "qstring",
626
+ merge : true
627
+ }, {
628
+ token : "string",
629
+ regex : "'|$",
630
+ next : "start",
631
+ merge : true
632
+ }
633
+ ]
634
+ };
635
+
636
+ this.embedRules(DocCommentHighlightRules, "doc-",
637
+ [ DocCommentHighlightRules.getEndRule("start") ]);
638
+ };
639
+
640
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
641
+
642
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
643
+ });
644
+ /* ***** BEGIN LICENSE BLOCK *****
645
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
646
+ *
647
+ * The contents of this file are subject to the Mozilla Public License Version
648
+ * 1.1 (the "License"); you may not use this file except in compliance with
649
+ * the License. You may obtain a copy of the License at
650
+ * http://www.mozilla.org/MPL/
651
+ *
652
+ * Software distributed under the License is distributed on an "AS IS" basis,
653
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
654
+ * for the specific language governing rights and limitations under the
655
+ * License.
656
+ *
657
+ * The Original Code is Ajax.org Code Editor (ACE).
658
+ *
659
+ * The Initial Developer of the Original Code is
660
+ * Ajax.org B.V.
661
+ * Portions created by the Initial Developer are Copyright (C) 2010
662
+ * the Initial Developer. All Rights Reserved.
663
+ *
664
+ * Contributor(s):
665
+ * Fabian Jakobs <fabian AT ajax DOT org>
666
+ *
667
+ * Alternatively, the contents of this file may be used under the terms of
668
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
669
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
670
+ * in which case the provisions of the GPL or the LGPL are applicable instead
671
+ * of those above. If you wish to allow use of your version of this file only
672
+ * under the terms of either the GPL or the LGPL, and not to allow others to
673
+ * use your version of this file under the terms of the MPL, indicate your
674
+ * decision by deleting the provisions above and replace them with the notice
675
+ * and other provisions required by the GPL or the LGPL. If you do not delete
676
+ * the provisions above, a recipient may use your version of this file under
677
+ * the terms of any one of the MPL, the GPL or the LGPL.
678
+ *
679
+ * ***** END LICENSE BLOCK ***** */
680
+
681
+ ace.define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
682
+ "use strict";
683
+
684
+ var oop = require("../lib/oop");
685
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
686
+
687
+ var DocCommentHighlightRules = function() {
688
+
689
+ this.$rules = {
690
+ "start" : [ {
691
+ token : "comment.doc.tag",
692
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
693
+ }, {
694
+ token : "comment.doc",
695
+ merge : true,
696
+ regex : "\\s+"
697
+ }, {
698
+ token : "comment.doc",
699
+ merge : true,
700
+ regex : "TODO"
701
+ }, {
702
+ token : "comment.doc",
703
+ merge : true,
704
+ regex : "[^@\\*]+"
705
+ }, {
706
+ token : "comment.doc",
707
+ merge : true,
708
+ regex : "."
709
+ }]
710
+ };
711
+ };
712
+
713
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
714
+
715
+ DocCommentHighlightRules.getStartRule = function(start) {
716
+ return {
717
+ token : "comment.doc", // doc comment
718
+ merge : true,
719
+ regex : "\\/\\*(?=\\*)",
720
+ next : start
721
+ };
722
+ };
723
+
724
+ DocCommentHighlightRules.getEndRule = function (start) {
725
+ return {
726
+ token : "comment.doc", // closing comment
727
+ merge : true,
728
+ regex : "\\*\\/",
729
+ next : start
730
+ };
731
+ };
732
+
733
+
734
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
735
+
736
+ });
737
+ /* ***** BEGIN LICENSE BLOCK *****
738
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
739
+ *
740
+ * The contents of this file are subject to the Mozilla Public License Version
741
+ * 1.1 (the "License"); you may not use this file except in compliance with
742
+ * the License. You may obtain a copy of the License at
743
+ * http://www.mozilla.org/MPL/
744
+ *
745
+ * Software distributed under the License is distributed on an "AS IS" basis,
746
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
747
+ * for the specific language governing rights and limitations under the
748
+ * License.
749
+ *
750
+ * The Original Code is Ajax.org Code Editor (ACE).
751
+ *
752
+ * The Initial Developer of the Original Code is
753
+ * Ajax.org B.V.
754
+ * Portions created by the Initial Developer are Copyright (C) 2010
755
+ * the Initial Developer. All Rights Reserved.
756
+ *
757
+ * Contributor(s):
758
+ * Fabian Jakobs <fabian AT ajax DOT org>
759
+ *
760
+ * Alternatively, the contents of this file may be used under the terms of
761
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
762
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
763
+ * in which case the provisions of the GPL or the LGPL are applicable instead
764
+ * of those above. If you wish to allow use of your version of this file only
765
+ * under the terms of either the GPL or the LGPL, and not to allow others to
766
+ * use your version of this file under the terms of the MPL, indicate your
767
+ * decision by deleting the provisions above and replace them with the notice
768
+ * and other provisions required by the GPL or the LGPL. If you do not delete
769
+ * the provisions above, a recipient may use your version of this file under
770
+ * the terms of any one of the MPL, the GPL or the LGPL.
771
+ *
772
+ * ***** END LICENSE BLOCK ***** */
773
+
774
+ ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
775
+ "use strict";
776
+
777
+ var Range = require("../range").Range;
778
+
779
+ var MatchingBraceOutdent = function() {};
780
+
781
+ (function() {
782
+
783
+ this.checkOutdent = function(line, input) {
784
+ if (! /^\s+$/.test(line))
785
+ return false;
786
+
787
+ return /^\s*\}/.test(input);
788
+ };
789
+
790
+ this.autoOutdent = function(doc, row) {
791
+ var line = doc.getLine(row);
792
+ var match = line.match(/^(\s*\})/);
793
+
794
+ if (!match) return 0;
795
+
796
+ var column = match[1].length;
797
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
798
+
799
+ if (!openBracePos || openBracePos.row == row) return 0;
800
+
801
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
802
+ doc.replace(new Range(row, 0, row, column-1), indent);
803
+ };
804
+
805
+ this.$getIndent = function(line) {
806
+ var match = line.match(/^(\s+)/);
807
+ if (match) {
808
+ return match[1];
809
+ }
810
+
811
+ return "";
812
+ };
813
+
814
+ }).call(MatchingBraceOutdent.prototype);
815
+
816
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
817
+ });
818
+ /* vim:ts=4:sts=4:sw=4:
819
+ * ***** BEGIN LICENSE BLOCK *****
820
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
821
+ *
822
+ * The contents of this file are subject to the Mozilla Public License Version
823
+ * 1.1 (the "License"); you may not use this file except in compliance with
824
+ * the License. You may obtain a copy of the License at
825
+ * http://www.mozilla.org/MPL/
826
+ *
827
+ * Software distributed under the License is distributed on an "AS IS" basis,
828
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
829
+ * for the specific language governing rights and limitations under the
830
+ * License.
831
+ *
832
+ * The Original Code is Ajax.org Code Editor (ACE).
833
+ *
834
+ * The Initial Developer of the Original Code is
835
+ * Ajax.org B.V.
836
+ * Portions created by the Initial Developer are Copyright (C) 2010
837
+ * the Initial Developer. All Rights Reserved.
838
+ *
839
+ * Contributor(s):
840
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
841
+ *
842
+ * Alternatively, the contents of this file may be used under the terms of
843
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
844
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
845
+ * in which case the provisions of the GPL or the LGPL are applicable instead
846
+ * of those above. If you wish to allow use of your version of this file only
847
+ * under the terms of either the GPL or the LGPL, and not to allow others to
848
+ * use your version of this file under the terms of the MPL, indicate your
849
+ * decision by deleting the provisions above and replace them with the notice
850
+ * and other provisions required by the GPL or the LGPL. If you do not delete
851
+ * the provisions above, a recipient may use your version of this file under
852
+ * the terms of any one of the MPL, the GPL or the LGPL.
853
+ *
854
+ * ***** END LICENSE BLOCK ***** */
855
+
856
+ ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
857
+ "use strict";
858
+
859
+ var oop = require("../../lib/oop");
860
+ var Behaviour = require('../behaviour').Behaviour;
861
+
862
+ var CstyleBehaviour = function () {
863
+
864
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
865
+ if (text == '{') {
866
+ var selection = editor.getSelectionRange();
867
+ var selected = session.doc.getTextRange(selection);
868
+ if (selected !== "") {
869
+ return {
870
+ text: '{' + selected + '}',
871
+ selection: false
872
+ };
873
+ } else {
874
+ return {
875
+ text: '{}',
876
+ selection: [1, 1]
877
+ };
878
+ }
879
+ } else if (text == '}') {
880
+ var cursor = editor.getCursorPosition();
881
+ var line = session.doc.getLine(cursor.row);
882
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
883
+ if (rightChar == '}') {
884
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
885
+ if (matching !== null) {
886
+ return {
887
+ text: '',
888
+ selection: [1, 1]
889
+ };
890
+ }
891
+ }
892
+ } else if (text == "\n") {
893
+ var cursor = editor.getCursorPosition();
894
+ var line = session.doc.getLine(cursor.row);
895
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
896
+ if (rightChar == '}') {
897
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
898
+ if (!openBracePos)
899
+ return null;
900
+
901
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
902
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
903
+
904
+ return {
905
+ text: '\n' + indent + '\n' + next_indent,
906
+ selection: [1, indent.length, 1, indent.length]
907
+ };
908
+ }
909
+ }
910
+ });
911
+
912
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
913
+ var selected = session.doc.getTextRange(range);
914
+ if (!range.isMultiLine() && selected == '{') {
915
+ var line = session.doc.getLine(range.start.row);
916
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
917
+ if (rightChar == '}') {
918
+ range.end.column++;
919
+ return range;
920
+ }
921
+ }
922
+ });
923
+
924
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
925
+ if (text == '(') {
926
+ var selection = editor.getSelectionRange();
927
+ var selected = session.doc.getTextRange(selection);
928
+ if (selected !== "") {
929
+ return {
930
+ text: '(' + selected + ')',
931
+ selection: false
932
+ };
933
+ } else {
934
+ return {
935
+ text: '()',
936
+ selection: [1, 1]
937
+ };
938
+ }
939
+ } else if (text == ')') {
940
+ var cursor = editor.getCursorPosition();
941
+ var line = session.doc.getLine(cursor.row);
942
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
943
+ if (rightChar == ')') {
944
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
945
+ if (matching !== null) {
946
+ return {
947
+ text: '',
948
+ selection: [1, 1]
949
+ };
950
+ }
951
+ }
952
+ }
953
+ });
954
+
955
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
956
+ var selected = session.doc.getTextRange(range);
957
+ if (!range.isMultiLine() && selected == '(') {
958
+ var line = session.doc.getLine(range.start.row);
959
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
960
+ if (rightChar == ')') {
961
+ range.end.column++;
962
+ return range;
963
+ }
964
+ }
965
+ });
966
+
967
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
968
+ if (text == '"' || text == "'") {
969
+ var quote = text;
970
+ var selection = editor.getSelectionRange();
971
+ var selected = session.doc.getTextRange(selection);
972
+ if (selected !== "") {
973
+ return {
974
+ text: quote + selected + quote,
975
+ selection: false
976
+ };
977
+ } else {
978
+ var cursor = editor.getCursorPosition();
979
+ var line = session.doc.getLine(cursor.row);
980
+ var leftChar = line.substring(cursor.column-1, cursor.column);
981
+
982
+ // We're escaped.
983
+ if (leftChar == '\\') {
984
+ return null;
985
+ }
986
+
987
+ // Find what token we're inside.
988
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
989
+ var col = 0, token;
990
+ var quotepos = -1; // Track whether we're inside an open quote.
991
+
992
+ for (var x = 0; x < tokens.length; x++) {
993
+ token = tokens[x];
994
+ if (token.type == "string") {
995
+ quotepos = -1;
996
+ } else if (quotepos < 0) {
997
+ quotepos = token.value.indexOf(quote);
998
+ }
999
+ if ((token.value.length + col) > selection.start.column) {
1000
+ break;
1001
+ }
1002
+ col += tokens[x].value.length;
1003
+ }
1004
+
1005
+ // Try and be smart about when we auto insert.
1006
+ if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf(quote) === token.value.length-1)))) {
1007
+ return {
1008
+ text: quote + quote,
1009
+ selection: [1,1]
1010
+ };
1011
+ } else if (token && token.type === "string") {
1012
+ // Ignore input and move right one if we're typing over the closing quote.
1013
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1014
+ if (rightChar == quote) {
1015
+ return {
1016
+ text: '',
1017
+ selection: [1, 1]
1018
+ };
1019
+ }
1020
+ }
1021
+ }
1022
+ }
1023
+ });
1024
+
1025
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1026
+ var selected = session.doc.getTextRange(range);
1027
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1028
+ var line = session.doc.getLine(range.start.row);
1029
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1030
+ if (rightChar == '"') {
1031
+ range.end.column++;
1032
+ return range;
1033
+ }
1034
+ }
1035
+ });
1036
+
1037
+ };
1038
+
1039
+ oop.inherits(CstyleBehaviour, Behaviour);
1040
+
1041
+ exports.CstyleBehaviour = CstyleBehaviour;
1042
+ });/* ***** BEGIN LICENSE BLOCK *****
1043
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1044
+ *
1045
+ * The contents of this file are subject to the Mozilla Public License Version
1046
+ * 1.1 (the "License"); you may not use this file except in compliance with
1047
+ * the License. You may obtain a copy of the License at
1048
+ * http://www.mozilla.org/MPL/
1049
+ *
1050
+ * Software distributed under the License is distributed on an "AS IS" basis,
1051
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1052
+ * for the specific language governing rights and limitations under the
1053
+ * License.
1054
+ *
1055
+ * The Original Code is Ajax.org Code Editor (ACE).
1056
+ *
1057
+ * The Initial Developer of the Original Code is
1058
+ * Ajax.org B.V.
1059
+ * Portions created by the Initial Developer are Copyright (C) 2010
1060
+ * the Initial Developer. All Rights Reserved.
1061
+ *
1062
+ * Contributor(s):
1063
+ * Fabian Jakobs <fabian AT ajax DOT org>
1064
+ *
1065
+ * Alternatively, the contents of this file may be used under the terms of
1066
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1067
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1068
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1069
+ * of those above. If you wish to allow use of your version of this file only
1070
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1071
+ * use your version of this file under the terms of the MPL, indicate your
1072
+ * decision by deleting the provisions above and replace them with the notice
1073
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1074
+ * the provisions above, a recipient may use your version of this file under
1075
+ * the terms of any one of the MPL, the GPL or the LGPL.
1076
+ *
1077
+ * ***** END LICENSE BLOCK ***** */
1078
+
1079
+ ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1080
+ "use strict";
1081
+
1082
+ var oop = require("../../lib/oop");
1083
+ var Range = require("../../range").Range;
1084
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1085
+
1086
+ var FoldMode = exports.FoldMode = function() {};
1087
+ oop.inherits(FoldMode, BaseFoldMode);
1088
+
1089
+ (function() {
1090
+
1091
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1092
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1093
+
1094
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1095
+ var line = session.getLine(row);
1096
+ var match = line.match(this.foldingStartMarker);
1097
+ if (match) {
1098
+ var i = match.index;
1099
+
1100
+ if (match[1])
1101
+ return this.openingBracketBlock(session, match[1], row, i);
1102
+
1103
+ var range = session.getCommentFoldRange(row, i + match[0].length);
1104
+ range.end.column -= 2;
1105
+ return range;
1106
+ }
1107
+
1108
+ if (foldStyle !== "markbeginend")
1109
+ return;
1110
+
1111
+ var match = line.match(this.foldingStopMarker);
1112
+ if (match) {
1113
+ var i = match.index + match[0].length;
1114
+
1115
+ if (match[2]) {
1116
+ var range = session.getCommentFoldRange(row, i);
1117
+ range.end.column -= 2;
1118
+ return range;
1119
+ }
1120
+
1121
+ var end = {row: row, column: i};
1122
+ var start = session.$findOpeningBracket(match[1], end);
1123
+
1124
+ if (!start)
1125
+ return;
1126
+
1127
+ start.column++;
1128
+ end.column--;
1129
+
1130
+ return Range.fromPoints(start, end);
1131
+ }
1132
+ };
1133
+
1134
+ }).call(FoldMode.prototype);
1135
+
1136
+ });/* ***** BEGIN LICENSE BLOCK *****
1137
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1138
+ *
1139
+ * The contents of this file are subject to the Mozilla Public License Version
1140
+ * 1.1 (the "License"); you may not use this file except in compliance with
1141
+ * the License. You may obtain a copy of the License at
1142
+ * http://www.mozilla.org/MPL/
1143
+ *
1144
+ * Software distributed under the License is distributed on an "AS IS" basis,
1145
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1146
+ * for the specific language governing rights and limitations under the
1147
+ * License.
1148
+ *
1149
+ * The Original Code is Ajax.org Code Editor (ACE).
1150
+ *
1151
+ * The Initial Developer of the Original Code is
1152
+ * Ajax.org B.V.
1153
+ * Portions created by the Initial Developer are Copyright (C) 2010
1154
+ * the Initial Developer. All Rights Reserved.
1155
+ *
1156
+ * Contributor(s):
1157
+ * Fabian Jakobs <fabian AT ajax DOT org>
1158
+ *
1159
+ * Alternatively, the contents of this file may be used under the terms of
1160
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1161
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1162
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1163
+ * of those above. If you wish to allow use of your version of this file only
1164
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1165
+ * use your version of this file under the terms of the MPL, indicate your
1166
+ * decision by deleting the provisions above and replace them with the notice
1167
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1168
+ * the provisions above, a recipient may use your version of this file under
1169
+ * the terms of any one of the MPL, the GPL or the LGPL.
1170
+ *
1171
+ * ***** END LICENSE BLOCK ***** */
1172
+
1173
+ ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1174
+ "use strict";
1175
+
1176
+ var Range = require("../../range").Range;
1177
+
1178
+ var FoldMode = exports.FoldMode = function() {};
1179
+
1180
+ (function() {
1181
+
1182
+ this.foldingStartMarker = null;
1183
+ this.foldingStopMarker = null;
1184
+
1185
+ // must return "" if there's no fold, to enable caching
1186
+ this.getFoldWidget = function(session, foldStyle, row) {
1187
+ var line = session.getLine(row);
1188
+ if (this.foldingStartMarker.test(line))
1189
+ return "start";
1190
+ if (foldStyle == "markbeginend"
1191
+ && this.foldingStopMarker
1192
+ && this.foldingStopMarker.test(line))
1193
+ return "end";
1194
+ return "";
1195
+ };
1196
+
1197
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1198
+ return null;
1199
+ };
1200
+
1201
+ this.indentationBlock = function(session, row, column) {
1202
+ var re = /^\s*/;
1203
+ var startRow = row;
1204
+ var endRow = row;
1205
+ var line = session.getLine(row);
1206
+ var startColumn = column || line.length;
1207
+ var startLevel = line.match(re)[0].length;
1208
+ var maxRow = session.getLength()
1209
+
1210
+ while (++row < maxRow) {
1211
+ line = session.getLine(row);
1212
+ var level = line.match(re)[0].length;
1213
+
1214
+ if (level == line.length)
1215
+ continue;
1216
+
1217
+ if (level <= startLevel)
1218
+ break;
1219
+
1220
+ endRow = row;
1221
+ }
1222
+
1223
+ if (endRow > startRow) {
1224
+ var endColumn = session.getLine(endRow).length;
1225
+ return new Range(startRow, startColumn, endRow, endColumn);
1226
+ }
1227
+ };
1228
+
1229
+ this.openingBracketBlock = function(session, bracket, row, column) {
1230
+ var start = {row: row, column: column + 1};
1231
+ var end = session.$findClosingBracket(bracket, start);
1232
+ if (!end)
1233
+ return;
1234
+
1235
+ var fw = session.foldWidgets[end.row];
1236
+ if (fw == null)
1237
+ fw = this.getFoldWidget(session, end.row);
1238
+
1239
+ if (fw == "start") {
1240
+ end.row --;
1241
+ end.column = session.getLine(end.row).length;
1242
+ }
1243
+ return Range.fromPoints(start, end);
1244
+ };
1245
+
1246
+ }).call(FoldMode.prototype);
1247
+
1248
+ });
1249
+ ace.define('ace/mode/groovy_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/doc_comment_highlight_rules', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1250
+ "use strict";
1251
+
1252
+ var oop = require("../lib/oop");
1253
+ var lang = require("../lib/lang");
1254
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
1255
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1256
+
1257
+ var GroovyHighlightRules = function() {
1258
+
1259
+ var keywords = lang.arrayToMap(
1260
+ ("assert|with|abstract|continue|for|new|switch|" +
1261
+ "assert|default|goto|package|synchronized|" +
1262
+ "boolean|do|if|private|this|" +
1263
+ "break|double|implements|protected|throw|" +
1264
+ "byte|else|import|public|throws|" +
1265
+ "case|enum|instanceof|return|transient|" +
1266
+ "catch|extends|int|short|try|" +
1267
+ "char|final|interface|static|void|" +
1268
+ "class|finally|long|strictfp|volatile|" +
1269
+ "def|float|native|super|while").split("|")
1270
+ );
1271
+
1272
+ var buildinConstants = lang.arrayToMap(
1273
+ ("null|Infinity|NaN|undefined").split("|")
1274
+ );
1275
+
1276
+ var langClasses = lang.arrayToMap(
1277
+ ("AbstractMethodError|AssertionError|ClassCircularityError|"+
1278
+ "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
1279
+ "ExceptionInInitializerError|IllegalAccessError|"+
1280
+ "IllegalThreadStateException|InstantiationError|InternalError|"+
1281
+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
1282
+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
1283
+ "SuppressWarnings|TypeNotPresentException|UnknownError|"+
1284
+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
1285
+ "InstantiationException|IndexOutOfBoundsException|"+
1286
+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
1287
+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
1288
+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
1289
+ "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
1290
+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
1291
+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
1292
+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
1293
+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
1294
+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
1295
+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
1296
+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
1297
+ "ArrayStoreException|ClassCastException|LinkageError|"+
1298
+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
1299
+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
1300
+ "Cloneable|Class|CharSequence|Comparable|String|Object").split("|")
1301
+ );
1302
+
1303
+ var importClasses = lang.arrayToMap(
1304
+ ("").split("|")
1305
+ );
1306
+ // regexp must not have capturing parentheses. Use (?:) instead.
1307
+ // regexps are ordered -> the first match is used
1308
+
1309
+ this.$rules = {
1310
+ "start" : [
1311
+ {
1312
+ token : "comment",
1313
+ regex : "\\/\\/.*$"
1314
+ },
1315
+ DocCommentHighlightRules.getStartRule("doc-start"),
1316
+ {
1317
+ token : "comment", // multi line comment
1318
+ merge : true,
1319
+ regex : "\\/\\*",
1320
+ next : "comment"
1321
+ }, {
1322
+ token : "string.regexp",
1323
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
1324
+ }, {
1325
+ token : "string", // single line
1326
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1327
+ }, {
1328
+ token : "string", // single line
1329
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1330
+ }, {
1331
+ token : "constant.numeric", // hex
1332
+ regex : "0[xX][0-9a-fA-F]+\\b"
1333
+ }, {
1334
+ token : "constant.numeric", // float
1335
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1336
+ }, {
1337
+ token : "constant.language.boolean",
1338
+ regex : "(?:true|false)\\b"
1339
+ }, {
1340
+ token : function(value) {
1341
+ if (value == "this")
1342
+ return "variable.language";
1343
+ else if (keywords.hasOwnProperty(value))
1344
+ return "keyword";
1345
+ else if (langClasses.hasOwnProperty(value))
1346
+ return "support.function";
1347
+ else if (importClasses.hasOwnProperty(value))
1348
+ return "support.function";
1349
+ else if (buildinConstants.hasOwnProperty(value))
1350
+ return "constant.language";
1351
+ else
1352
+ return "identifier";
1353
+ },
1354
+ // TODO: Unicode escape sequences
1355
+ // TODO: Unicode identifiers
1356
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1357
+ }, {
1358
+ token : "keyword.operator",
1359
+ regex : "\\?:|\\?\\.|\\*\\.|<=>|=~|==~|\\.@|\\*\\.@|\\.&|as|in|is|!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
1360
+ }, {
1361
+ token : "lparen",
1362
+ regex : "[[({]"
1363
+ }, {
1364
+ token : "rparen",
1365
+ regex : "[\\])}]"
1366
+ }, {
1367
+ token : "text",
1368
+ regex : "\\s+"
1369
+ }
1370
+ ],
1371
+ "comment" : [
1372
+ {
1373
+ token : "comment", // closing comment
1374
+ regex : ".*?\\*\\/",
1375
+ next : "start"
1376
+ }, {
1377
+ token : "comment", // comment spanning whole line
1378
+ merge : true,
1379
+ regex : ".+"
1380
+ }
1381
+ ]
1382
+ };
1383
+
1384
+ this.embedRules(DocCommentHighlightRules, "doc-",
1385
+ [ DocCommentHighlightRules.getEndRule("start") ]);
1386
+ };
1387
+
1388
+ oop.inherits(GroovyHighlightRules, TextHighlightRules);
1389
+
1390
+ exports.GroovyHighlightRules = GroovyHighlightRules;
1391
+ });