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,1393 @@
1
+ define('ace/mode/java', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/javascript', 'ace/tokenizer', 'ace/mode/java_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 JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
8
+
9
+ var Mode = function() {
10
+ JavaScriptMode.call(this);
11
+
12
+ this.$tokenizer = new Tokenizer(new JavaHighlightRules().getRules());
13
+ };
14
+ oop.inherits(Mode, JavaScriptMode);
15
+
16
+ (function() {
17
+
18
+ this.createWorker = function(session) {
19
+ return null;
20
+ };
21
+
22
+ }).call(Mode.prototype);
23
+
24
+ exports.Mode = Mode;
25
+ });
26
+ /* ***** BEGIN LICENSE BLOCK *****
27
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
28
+ *
29
+ * The contents of this file are subject to the Mozilla Public License Version
30
+ * 1.1 (the "License"); you may not use this file except in compliance with
31
+ * the License. You may obtain a copy of the License at
32
+ * http://www.mozilla.org/MPL/
33
+ *
34
+ * Software distributed under the License is distributed on an "AS IS" basis,
35
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
36
+ * for the specific language governing rights and limitations under the
37
+ * License.
38
+ *
39
+ * The Original Code is Ajax.org Code Editor (ACE).
40
+ *
41
+ * The Initial Developer of the Original Code is
42
+ * Ajax.org B.V.
43
+ * Portions created by the Initial Developer are Copyright (C) 2010
44
+ * the Initial Developer. All Rights Reserved.
45
+ *
46
+ * Contributor(s):
47
+ * Fabian Jakobs <fabian AT ajax DOT org>
48
+ *
49
+ * Alternatively, the contents of this file may be used under the terms of
50
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
51
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
52
+ * in which case the provisions of the GPL or the LGPL are applicable instead
53
+ * of those above. If you wish to allow use of your version of this file only
54
+ * under the terms of either the GPL or the LGPL, and not to allow others to
55
+ * use your version of this file under the terms of the MPL, indicate your
56
+ * decision by deleting the provisions above and replace them with the notice
57
+ * and other provisions required by the GPL or the LGPL. If you do not delete
58
+ * the provisions above, a recipient may use your version of this file under
59
+ * the terms of any one of the MPL, the GPL or the LGPL.
60
+ *
61
+ * ***** END LICENSE BLOCK ***** */
62
+
63
+ 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) {
64
+ "use strict";
65
+
66
+ var oop = require("../lib/oop");
67
+ var TextMode = require("./text").Mode;
68
+ var Tokenizer = require("../tokenizer").Tokenizer;
69
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
70
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
71
+ var Range = require("../range").Range;
72
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
73
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
74
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
75
+
76
+ var Mode = function() {
77
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
78
+ this.$outdent = new MatchingBraceOutdent();
79
+ this.$behaviour = new CstyleBehaviour();
80
+ this.foldingRules = new CStyleFoldMode();
81
+ };
82
+ oop.inherits(Mode, TextMode);
83
+
84
+ (function() {
85
+
86
+
87
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
88
+ var outdent = true;
89
+ var re = /^(\s*)\/\//;
90
+
91
+ for (var i=startRow; i<= endRow; i++) {
92
+ if (!re.test(doc.getLine(i))) {
93
+ outdent = false;
94
+ break;
95
+ }
96
+ }
97
+
98
+ if (outdent) {
99
+ var deleteRange = new Range(0, 0, 0, 0);
100
+ for (var i=startRow; i<= endRow; i++)
101
+ {
102
+ var line = doc.getLine(i);
103
+ var m = line.match(re);
104
+ deleteRange.start.row = i;
105
+ deleteRange.end.row = i;
106
+ deleteRange.end.column = m[0].length;
107
+ doc.replace(deleteRange, m[1]);
108
+ }
109
+ }
110
+ else {
111
+ doc.indentRows(startRow, endRow, "//");
112
+ }
113
+ };
114
+
115
+ this.getNextLineIndent = function(state, line, tab) {
116
+ var indent = this.$getIndent(line);
117
+
118
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
119
+ var tokens = tokenizedLine.tokens;
120
+ var endState = tokenizedLine.state;
121
+
122
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
123
+ return indent;
124
+ }
125
+
126
+ if (state == "start" || state == "regex_allowed") {
127
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
128
+ if (match) {
129
+ indent += tab;
130
+ }
131
+ } else if (state == "doc-start") {
132
+ if (endState == "start" || state == "regex_allowed") {
133
+ return "";
134
+ }
135
+ var match = line.match(/^\s*(\/?)\*/);
136
+ if (match) {
137
+ if (match[1]) {
138
+ indent += " ";
139
+ }
140
+ indent += "* ";
141
+ }
142
+ }
143
+
144
+ return indent;
145
+ };
146
+
147
+ this.checkOutdent = function(state, line, input) {
148
+ return this.$outdent.checkOutdent(line, input);
149
+ };
150
+
151
+ this.autoOutdent = function(state, doc, row) {
152
+ this.$outdent.autoOutdent(doc, row);
153
+ };
154
+
155
+ this.createWorker = function(session) {
156
+ var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
157
+ worker.attachToDocument(session.getDocument());
158
+
159
+ worker.on("jslint", function(results) {
160
+ var errors = [];
161
+ for (var i=0; i<results.data.length; i++) {
162
+ var error = results.data[i];
163
+ if (error)
164
+ errors.push({
165
+ row: error.line-1,
166
+ column: error.character-1,
167
+ text: error.reason,
168
+ type: "warning",
169
+ lint: error
170
+ });
171
+ }
172
+ session.setAnnotations(errors);
173
+ });
174
+
175
+ worker.on("narcissus", function(e) {
176
+ session.setAnnotations([e.data]);
177
+ });
178
+
179
+ worker.on("terminate", function() {
180
+ session.clearAnnotations();
181
+ });
182
+
183
+ return worker;
184
+ };
185
+
186
+ }).call(Mode.prototype);
187
+
188
+ exports.Mode = Mode;
189
+ });
190
+ /* ***** BEGIN LICENSE BLOCK *****
191
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
192
+ *
193
+ * The contents of this file are subject to the Mozilla Public License Version
194
+ * 1.1 (the "License"); you may not use this file except in compliance with
195
+ * the License. You may obtain a copy of the License at
196
+ * http://www.mozilla.org/MPL/
197
+ *
198
+ * Software distributed under the License is distributed on an "AS IS" basis,
199
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
200
+ * for the specific language governing rights and limitations under the
201
+ * License.
202
+ *
203
+ * The Original Code is Ajax.org Code Editor (ACE).
204
+ *
205
+ * The Initial Developer of the Original Code is
206
+ * Ajax.org B.V.
207
+ * Portions created by the Initial Developer are Copyright (C) 2010
208
+ * the Initial Developer. All Rights Reserved.
209
+ *
210
+ * Contributor(s):
211
+ * Fabian Jakobs <fabian AT ajax DOT org>
212
+ * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
213
+ *
214
+ * Alternatively, the contents of this file may be used under the terms of
215
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
216
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
217
+ * in which case the provisions of the GPL or the LGPL are applicable instead
218
+ * of those above. If you wish to allow use of your version of this file only
219
+ * under the terms of either the GPL or the LGPL, and not to allow others to
220
+ * use your version of this file under the terms of the MPL, indicate your
221
+ * decision by deleting the provisions above and replace them with the notice
222
+ * and other provisions required by the GPL or the LGPL. If you do not delete
223
+ * the provisions above, a recipient may use your version of this file under
224
+ * the terms of any one of the MPL, the GPL or the LGPL.
225
+ *
226
+ * ***** END LICENSE BLOCK ***** */
227
+
228
+ 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) {
229
+ "use strict";
230
+
231
+ var oop = require("../lib/oop");
232
+ var lang = require("../lib/lang");
233
+ var unicode = require("../unicode");
234
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
235
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
236
+
237
+ var JavaScriptHighlightRules = function() {
238
+
239
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
240
+ var globals = lang.arrayToMap(
241
+ // Constructors
242
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
243
+ // E4X
244
+ "Namespace|QName|XML|XMLList|" +
245
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
246
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
247
+ // Errors
248
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
249
+ "SyntaxError|TypeError|URIError|" +
250
+ // Non-constructor functions
251
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
252
+ "isNaN|parseFloat|parseInt|" +
253
+ // Other
254
+ "JSON|Math|" +
255
+ // Pseudo
256
+ "this|arguments|prototype|window|document"
257
+ ).split("|")
258
+ );
259
+
260
+ var keywords = lang.arrayToMap(
261
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
262
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
263
+ "const|yield|import|get|set").split("|")
264
+ );
265
+
266
+ // keywords which can be followed by regular expressions
267
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
268
+
269
+ var deprecated = lang.arrayToMap(
270
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
271
+ );
272
+
273
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
274
+
275
+ var buildinConstants = lang.arrayToMap(
276
+ ("null|Infinity|NaN|undefined").split("|")
277
+ );
278
+
279
+ var futureReserved = lang.arrayToMap(
280
+ ("class|enum|extends|super|export|implements|private|" +
281
+ "public|interface|package|protected|static").split("|")
282
+ );
283
+
284
+ // TODO: Unicode escape sequences
285
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
286
+ + unicode.packages.L
287
+ + unicode.packages.Mn + unicode.packages.Mc
288
+ + unicode.packages.Nd
289
+ + unicode.packages.Pc + "\\$_]*\\b";
290
+
291
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
292
+ "u[0-9a-fA-F]{4}|" + // unicode
293
+ "[0-2][0-7]{0,2}|" + // oct
294
+ "3[0-6][0-7]?|" + // oct
295
+ "37[0-7]?|" + // oct
296
+ "[4-7][0-7]?|" + //oct
297
+ ".)";
298
+
299
+ // regexp must not have capturing parentheses. Use (?:) instead.
300
+ // regexps are ordered -> the first match is used
301
+
302
+ this.$rules = {
303
+ "start" : [
304
+ {
305
+ token : "comment",
306
+ regex : /\/\/.*$/
307
+ },
308
+ DocCommentHighlightRules.getStartRule("doc-start"),
309
+ {
310
+ token : "comment", // multi line comment
311
+ merge : true,
312
+ regex : /\/\*/,
313
+ next : "comment"
314
+ }, {
315
+ token : "string",
316
+ regex : "'(?=.)",
317
+ next : "qstring"
318
+ }, {
319
+ token : "string",
320
+ regex : '"(?=.)',
321
+ next : "qqstring"
322
+ }, {
323
+ token : "constant.numeric", // hex
324
+ regex : /0[xX][0-9a-fA-F]+\b/
325
+ }, {
326
+ token : "constant.numeric", // float
327
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
328
+ }, { // match stuff like: Sound.prototype.play = function() { }
329
+ token : [
330
+ "storage.type",
331
+ "punctuation.operator",
332
+ "support.function",
333
+ "punctuation.operator",
334
+ "entity.name.function",
335
+ "text",
336
+ "keyword.operator",
337
+ "text",
338
+ "storage.type",
339
+ "text",
340
+ "paren.lparen"
341
+ ],
342
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
343
+ next: "function_arguments"
344
+ }, { // match stuff like: Sound.prototype.play = myfunc
345
+ token : [
346
+ "storage.type",
347
+ "punctuation.operator",
348
+ "support.function",
349
+ "punctuation.operator",
350
+ "entity.name.function",
351
+ "text",
352
+ "keyword.operator",
353
+ "text"
354
+ ],
355
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
356
+ next: "function_arguments"
357
+ }, { // match stuff like: Sound.play = function() { }
358
+ token : [
359
+ "storage.type",
360
+ "punctuation.operator",
361
+ "entity.name.function",
362
+ "text",
363
+ "keyword.operator",
364
+ "text",
365
+ "storage.type",
366
+ "text",
367
+ "paren.lparen"
368
+ ],
369
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
370
+ next: "function_arguments"
371
+ }, { // match stuff like: play = function() { }
372
+ token : [
373
+ "entity.name.function",
374
+ "text",
375
+ "keyword.operator",
376
+ "text",
377
+ "storage.type",
378
+ "text",
379
+ "paren.lparen"
380
+ ],
381
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
382
+ next: "function_arguments"
383
+ }, { // match regular function like: function myFunc(arg) { }
384
+ token : [
385
+ "storage.type",
386
+ "text",
387
+ "entity.name.function",
388
+ "text",
389
+ "paren.lparen"
390
+ ],
391
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
392
+ next: "function_arguments"
393
+ }, { // match stuff like: foobar: function() { }
394
+ token : [
395
+ "entity.name.function",
396
+ "text",
397
+ "punctuation.operator",
398
+ "text",
399
+ "storage.type",
400
+ "text",
401
+ "paren.lparen"
402
+ ],
403
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
404
+ next: "function_arguments"
405
+ }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
406
+ token : [
407
+ "text",
408
+ "text",
409
+ "storage.type",
410
+ "text",
411
+ "paren.lparen"
412
+ ],
413
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
414
+ next: "function_arguments"
415
+ }, {
416
+ token : "constant.language.boolean",
417
+ regex : /(?:true|false)\b/
418
+ }, {
419
+ token : "keyword",
420
+ regex : "(?:" + kwBeforeRe + ")\\b",
421
+ next : "regex_allowed"
422
+ }, {
423
+ token : ["punctuation.operator", "support.function"],
424
+ 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(?=\()/
425
+ }, {
426
+ token : ["punctuation.operator", "support.function.dom"],
427
+ 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(?=\()/
428
+ }, {
429
+ token : ["punctuation.operator", "support.constant"],
430
+ 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/
431
+ }, {
432
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
433
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
434
+ }, {
435
+ token : function(value) {
436
+ if (globals.hasOwnProperty(value))
437
+ return "variable.language";
438
+ else if (deprecated.hasOwnProperty(value))
439
+ return "invalid.deprecated";
440
+ else if (definitions.hasOwnProperty(value))
441
+ return "storage.type";
442
+ else if (keywords.hasOwnProperty(value))
443
+ return "keyword";
444
+ else if (buildinConstants.hasOwnProperty(value))
445
+ return "constant.language";
446
+ else if (futureReserved.hasOwnProperty(value))
447
+ return "invalid.illegal";
448
+ else if (value == "debugger")
449
+ return "invalid.deprecated";
450
+ else
451
+ return "identifier";
452
+ },
453
+ regex : identifierRe
454
+ }, {
455
+ token : "keyword.operator",
456
+ regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
457
+ next : "regex_allowed"
458
+ }, {
459
+ token : "punctuation.operator",
460
+ regex : /\?|\:|\,|\;|\./,
461
+ next : "regex_allowed"
462
+ }, {
463
+ token : "paren.lparen",
464
+ regex : /[\[({]/,
465
+ next : "regex_allowed"
466
+ }, {
467
+ token : "paren.rparen",
468
+ regex : /[\])}]/
469
+ }, {
470
+ token : "keyword.operator",
471
+ regex : /\/=?/,
472
+ next : "regex_allowed"
473
+ }, {
474
+ token: "comment",
475
+ regex: /^#!.*$/
476
+ }, {
477
+ token : "text",
478
+ regex : /\s+/
479
+ }
480
+ ],
481
+ // regular expressions are only allowed after certain tokens. This
482
+ // makes sure we don't mix up regexps with the divison operator
483
+ "regex_allowed": [
484
+ DocCommentHighlightRules.getStartRule("doc-start"),
485
+ {
486
+ token : "comment", // multi line comment
487
+ merge : true,
488
+ regex : "\\/\\*",
489
+ next : "comment_regex_allowed"
490
+ }, {
491
+ token : "comment",
492
+ regex : "\\/\\/.*$"
493
+ }, {
494
+ token: "string.regexp",
495
+ regex: "\\/",
496
+ next: "regex",
497
+ merge: true
498
+ }, {
499
+ token : "text",
500
+ regex : "\\s+"
501
+ }, {
502
+ // immediately return to the start mode without matching
503
+ // anything
504
+ token: "empty",
505
+ regex: "",
506
+ next: "start"
507
+ }
508
+ ],
509
+ "regex": [
510
+ {
511
+ token: "regexp.keyword.operator",
512
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
513
+ }, {
514
+ // flag
515
+ token: "string.regexp",
516
+ regex: "/\\w*",
517
+ next: "start",
518
+ merge: true
519
+ }, {
520
+ token: "string.regexp",
521
+ regex: "[^\\\\/\\[]+",
522
+ merge: true
523
+ }, {
524
+ token: "string.regexp.charachterclass",
525
+ regex: "\\[",
526
+ next: "regex_character_class",
527
+ merge: true
528
+ }, {
529
+ token: "empty",
530
+ regex: "",
531
+ next: "start"
532
+ }
533
+ ],
534
+ "regex_character_class": [
535
+ {
536
+ token: "regexp.keyword.operator",
537
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
538
+ }, {
539
+ token: "string.regexp.charachterclass",
540
+ regex: "]",
541
+ next: "regex",
542
+ merge: true
543
+ }, {
544
+ token: "string.regexp.charachterclass",
545
+ regex: "[^\\\\\\]]+",
546
+ merge: true
547
+ }, {
548
+ token: "empty",
549
+ regex: "",
550
+ next: "start"
551
+ }
552
+ ],
553
+ "function_arguments": [
554
+ {
555
+ token: "variable.parameter",
556
+ regex: identifierRe,
557
+ }, {
558
+ token: "punctuation.operator",
559
+ regex: "[, ]+",
560
+ merge: true
561
+ }, {
562
+ token: "punctuation.operator",
563
+ regex: "$",
564
+ merge: true
565
+ }, {
566
+ token: "empty",
567
+ regex: "",
568
+ next: "start"
569
+ }
570
+ ],
571
+ "comment_regex_allowed" : [
572
+ {
573
+ token : "comment", // closing comment
574
+ regex : ".*?\\*\\/",
575
+ merge : true,
576
+ next : "regex_allowed"
577
+ }, {
578
+ token : "comment", // comment spanning whole line
579
+ merge : true,
580
+ regex : ".+"
581
+ }
582
+ ],
583
+ "comment" : [
584
+ {
585
+ token : "comment", // closing comment
586
+ regex : ".*?\\*\\/",
587
+ merge : true,
588
+ next : "start"
589
+ }, {
590
+ token : "comment", // comment spanning whole line
591
+ merge : true,
592
+ regex : ".+"
593
+ }
594
+ ],
595
+ "qqstring" : [
596
+ {
597
+ token : "constant.language.escape",
598
+ regex : escapedRe
599
+ }, {
600
+ token : "string",
601
+ regex : '[^"\\\\]+',
602
+ merge : true
603
+ }, {
604
+ token : "string",
605
+ regex : "\\\\$",
606
+ next : "qqstring",
607
+ merge : true
608
+ }, {
609
+ token : "string",
610
+ regex : '"|$',
611
+ next : "start",
612
+ merge : true
613
+ }
614
+ ],
615
+ "qstring" : [
616
+ {
617
+ token : "constant.language.escape",
618
+ regex : escapedRe
619
+ }, {
620
+ token : "string",
621
+ regex : "[^'\\\\]+",
622
+ merge : true
623
+ }, {
624
+ token : "string",
625
+ regex : "\\\\$",
626
+ next : "qstring",
627
+ merge : true
628
+ }, {
629
+ token : "string",
630
+ regex : "'|$",
631
+ next : "start",
632
+ merge : true
633
+ }
634
+ ]
635
+ };
636
+
637
+ this.embedRules(DocCommentHighlightRules, "doc-",
638
+ [ DocCommentHighlightRules.getEndRule("start") ]);
639
+ };
640
+
641
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
642
+
643
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
644
+ });
645
+ /* ***** BEGIN LICENSE BLOCK *****
646
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
647
+ *
648
+ * The contents of this file are subject to the Mozilla Public License Version
649
+ * 1.1 (the "License"); you may not use this file except in compliance with
650
+ * the License. You may obtain a copy of the License at
651
+ * http://www.mozilla.org/MPL/
652
+ *
653
+ * Software distributed under the License is distributed on an "AS IS" basis,
654
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
655
+ * for the specific language governing rights and limitations under the
656
+ * License.
657
+ *
658
+ * The Original Code is Ajax.org Code Editor (ACE).
659
+ *
660
+ * The Initial Developer of the Original Code is
661
+ * Ajax.org B.V.
662
+ * Portions created by the Initial Developer are Copyright (C) 2010
663
+ * the Initial Developer. All Rights Reserved.
664
+ *
665
+ * Contributor(s):
666
+ * Fabian Jakobs <fabian AT ajax DOT org>
667
+ *
668
+ * Alternatively, the contents of this file may be used under the terms of
669
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
670
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
671
+ * in which case the provisions of the GPL or the LGPL are applicable instead
672
+ * of those above. If you wish to allow use of your version of this file only
673
+ * under the terms of either the GPL or the LGPL, and not to allow others to
674
+ * use your version of this file under the terms of the MPL, indicate your
675
+ * decision by deleting the provisions above and replace them with the notice
676
+ * and other provisions required by the GPL or the LGPL. If you do not delete
677
+ * the provisions above, a recipient may use your version of this file under
678
+ * the terms of any one of the MPL, the GPL or the LGPL.
679
+ *
680
+ * ***** END LICENSE BLOCK ***** */
681
+
682
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
683
+ "use strict";
684
+
685
+ var oop = require("../lib/oop");
686
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
687
+
688
+ var DocCommentHighlightRules = function() {
689
+
690
+ this.$rules = {
691
+ "start" : [ {
692
+ token : "comment.doc.tag",
693
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
694
+ }, {
695
+ token : "comment.doc",
696
+ merge : true,
697
+ regex : "\\s+"
698
+ }, {
699
+ token : "comment.doc",
700
+ merge : true,
701
+ regex : "TODO"
702
+ }, {
703
+ token : "comment.doc",
704
+ merge : true,
705
+ regex : "[^@\\*]+"
706
+ }, {
707
+ token : "comment.doc",
708
+ merge : true,
709
+ regex : "."
710
+ }]
711
+ };
712
+ };
713
+
714
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
715
+
716
+ DocCommentHighlightRules.getStartRule = function(start) {
717
+ return {
718
+ token : "comment.doc", // doc comment
719
+ merge : true,
720
+ regex : "\\/\\*(?=\\*)",
721
+ next : start
722
+ };
723
+ };
724
+
725
+ DocCommentHighlightRules.getEndRule = function (start) {
726
+ return {
727
+ token : "comment.doc", // closing comment
728
+ merge : true,
729
+ regex : "\\*\\/",
730
+ next : start
731
+ };
732
+ };
733
+
734
+
735
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
736
+
737
+ });
738
+ /* ***** BEGIN LICENSE BLOCK *****
739
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
740
+ *
741
+ * The contents of this file are subject to the Mozilla Public License Version
742
+ * 1.1 (the "License"); you may not use this file except in compliance with
743
+ * the License. You may obtain a copy of the License at
744
+ * http://www.mozilla.org/MPL/
745
+ *
746
+ * Software distributed under the License is distributed on an "AS IS" basis,
747
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
748
+ * for the specific language governing rights and limitations under the
749
+ * License.
750
+ *
751
+ * The Original Code is Ajax.org Code Editor (ACE).
752
+ *
753
+ * The Initial Developer of the Original Code is
754
+ * Ajax.org B.V.
755
+ * Portions created by the Initial Developer are Copyright (C) 2010
756
+ * the Initial Developer. All Rights Reserved.
757
+ *
758
+ * Contributor(s):
759
+ * Fabian Jakobs <fabian AT ajax DOT org>
760
+ *
761
+ * Alternatively, the contents of this file may be used under the terms of
762
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
763
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
764
+ * in which case the provisions of the GPL or the LGPL are applicable instead
765
+ * of those above. If you wish to allow use of your version of this file only
766
+ * under the terms of either the GPL or the LGPL, and not to allow others to
767
+ * use your version of this file under the terms of the MPL, indicate your
768
+ * decision by deleting the provisions above and replace them with the notice
769
+ * and other provisions required by the GPL or the LGPL. If you do not delete
770
+ * the provisions above, a recipient may use your version of this file under
771
+ * the terms of any one of the MPL, the GPL or the LGPL.
772
+ *
773
+ * ***** END LICENSE BLOCK ***** */
774
+
775
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
776
+ "use strict";
777
+
778
+ var Range = require("../range").Range;
779
+
780
+ var MatchingBraceOutdent = function() {};
781
+
782
+ (function() {
783
+
784
+ this.checkOutdent = function(line, input) {
785
+ if (! /^\s+$/.test(line))
786
+ return false;
787
+
788
+ return /^\s*\}/.test(input);
789
+ };
790
+
791
+ this.autoOutdent = function(doc, row) {
792
+ var line = doc.getLine(row);
793
+ var match = line.match(/^(\s*\})/);
794
+
795
+ if (!match) return 0;
796
+
797
+ var column = match[1].length;
798
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
799
+
800
+ if (!openBracePos || openBracePos.row == row) return 0;
801
+
802
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
803
+ doc.replace(new Range(row, 0, row, column-1), indent);
804
+ };
805
+
806
+ this.$getIndent = function(line) {
807
+ var match = line.match(/^(\s+)/);
808
+ if (match) {
809
+ return match[1];
810
+ }
811
+
812
+ return "";
813
+ };
814
+
815
+ }).call(MatchingBraceOutdent.prototype);
816
+
817
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
818
+ });
819
+ /* vim:ts=4:sts=4:sw=4:
820
+ * ***** BEGIN LICENSE BLOCK *****
821
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
822
+ *
823
+ * The contents of this file are subject to the Mozilla Public License Version
824
+ * 1.1 (the "License"); you may not use this file except in compliance with
825
+ * the License. You may obtain a copy of the License at
826
+ * http://www.mozilla.org/MPL/
827
+ *
828
+ * Software distributed under the License is distributed on an "AS IS" basis,
829
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
830
+ * for the specific language governing rights and limitations under the
831
+ * License.
832
+ *
833
+ * The Original Code is Ajax.org Code Editor (ACE).
834
+ *
835
+ * The Initial Developer of the Original Code is
836
+ * Ajax.org B.V.
837
+ * Portions created by the Initial Developer are Copyright (C) 2010
838
+ * the Initial Developer. All Rights Reserved.
839
+ *
840
+ * Contributor(s):
841
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
842
+ *
843
+ * Alternatively, the contents of this file may be used under the terms of
844
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
845
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
846
+ * in which case the provisions of the GPL or the LGPL are applicable instead
847
+ * of those above. If you wish to allow use of your version of this file only
848
+ * under the terms of either the GPL or the LGPL, and not to allow others to
849
+ * use your version of this file under the terms of the MPL, indicate your
850
+ * decision by deleting the provisions above and replace them with the notice
851
+ * and other provisions required by the GPL or the LGPL. If you do not delete
852
+ * the provisions above, a recipient may use your version of this file under
853
+ * the terms of any one of the MPL, the GPL or the LGPL.
854
+ *
855
+ * ***** END LICENSE BLOCK ***** */
856
+
857
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
858
+ "use strict";
859
+
860
+ var oop = require("../../lib/oop");
861
+ var Behaviour = require('../behaviour').Behaviour;
862
+
863
+ var CstyleBehaviour = function () {
864
+
865
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
866
+ if (text == '{') {
867
+ var selection = editor.getSelectionRange();
868
+ var selected = session.doc.getTextRange(selection);
869
+ if (selected !== "") {
870
+ return {
871
+ text: '{' + selected + '}',
872
+ selection: false
873
+ };
874
+ } else {
875
+ return {
876
+ text: '{}',
877
+ selection: [1, 1]
878
+ };
879
+ }
880
+ } else if (text == '}') {
881
+ var cursor = editor.getCursorPosition();
882
+ var line = session.doc.getLine(cursor.row);
883
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
884
+ if (rightChar == '}') {
885
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
886
+ if (matching !== null) {
887
+ return {
888
+ text: '',
889
+ selection: [1, 1]
890
+ };
891
+ }
892
+ }
893
+ } else if (text == "\n") {
894
+ var cursor = editor.getCursorPosition();
895
+ var line = session.doc.getLine(cursor.row);
896
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
897
+ if (rightChar == '}') {
898
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
899
+ if (!openBracePos)
900
+ return null;
901
+
902
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
903
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
904
+
905
+ return {
906
+ text: '\n' + indent + '\n' + next_indent,
907
+ selection: [1, indent.length, 1, indent.length]
908
+ };
909
+ }
910
+ }
911
+ });
912
+
913
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
914
+ var selected = session.doc.getTextRange(range);
915
+ if (!range.isMultiLine() && selected == '{') {
916
+ var line = session.doc.getLine(range.start.row);
917
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
918
+ if (rightChar == '}') {
919
+ range.end.column++;
920
+ return range;
921
+ }
922
+ }
923
+ });
924
+
925
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
926
+ if (text == '(') {
927
+ var selection = editor.getSelectionRange();
928
+ var selected = session.doc.getTextRange(selection);
929
+ if (selected !== "") {
930
+ return {
931
+ text: '(' + selected + ')',
932
+ selection: false
933
+ };
934
+ } else {
935
+ return {
936
+ text: '()',
937
+ selection: [1, 1]
938
+ };
939
+ }
940
+ } else if (text == ')') {
941
+ var cursor = editor.getCursorPosition();
942
+ var line = session.doc.getLine(cursor.row);
943
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
944
+ if (rightChar == ')') {
945
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
946
+ if (matching !== null) {
947
+ return {
948
+ text: '',
949
+ selection: [1, 1]
950
+ };
951
+ }
952
+ }
953
+ }
954
+ });
955
+
956
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
957
+ var selected = session.doc.getTextRange(range);
958
+ if (!range.isMultiLine() && selected == '(') {
959
+ var line = session.doc.getLine(range.start.row);
960
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
961
+ if (rightChar == ')') {
962
+ range.end.column++;
963
+ return range;
964
+ }
965
+ }
966
+ });
967
+
968
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
969
+ if (text == '"' || text == "'") {
970
+ var quote = text;
971
+ var selection = editor.getSelectionRange();
972
+ var selected = session.doc.getTextRange(selection);
973
+ if (selected !== "") {
974
+ return {
975
+ text: quote + selected + quote,
976
+ selection: false
977
+ };
978
+ } else {
979
+ var cursor = editor.getCursorPosition();
980
+ var line = session.doc.getLine(cursor.row);
981
+ var leftChar = line.substring(cursor.column-1, cursor.column);
982
+
983
+ // We're escaped.
984
+ if (leftChar == '\\') {
985
+ return null;
986
+ }
987
+
988
+ // Find what token we're inside.
989
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
990
+ var col = 0, token;
991
+ var quotepos = -1; // Track whether we're inside an open quote.
992
+
993
+ for (var x = 0; x < tokens.length; x++) {
994
+ token = tokens[x];
995
+ if (token.type == "string") {
996
+ quotepos = -1;
997
+ } else if (quotepos < 0) {
998
+ quotepos = token.value.indexOf(quote);
999
+ }
1000
+ if ((token.value.length + col) > selection.start.column) {
1001
+ break;
1002
+ }
1003
+ col += tokens[x].value.length;
1004
+ }
1005
+
1006
+ // Try and be smart about when we auto insert.
1007
+ 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)))) {
1008
+ return {
1009
+ text: quote + quote,
1010
+ selection: [1,1]
1011
+ };
1012
+ } else if (token && token.type === "string") {
1013
+ // Ignore input and move right one if we're typing over the closing quote.
1014
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
1015
+ if (rightChar == quote) {
1016
+ return {
1017
+ text: '',
1018
+ selection: [1, 1]
1019
+ };
1020
+ }
1021
+ }
1022
+ }
1023
+ }
1024
+ });
1025
+
1026
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
1027
+ var selected = session.doc.getTextRange(range);
1028
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
1029
+ var line = session.doc.getLine(range.start.row);
1030
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
1031
+ if (rightChar == '"') {
1032
+ range.end.column++;
1033
+ return range;
1034
+ }
1035
+ }
1036
+ });
1037
+
1038
+ };
1039
+
1040
+ oop.inherits(CstyleBehaviour, Behaviour);
1041
+
1042
+ exports.CstyleBehaviour = CstyleBehaviour;
1043
+ });/* ***** BEGIN LICENSE BLOCK *****
1044
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1045
+ *
1046
+ * The contents of this file are subject to the Mozilla Public License Version
1047
+ * 1.1 (the "License"); you may not use this file except in compliance with
1048
+ * the License. You may obtain a copy of the License at
1049
+ * http://www.mozilla.org/MPL/
1050
+ *
1051
+ * Software distributed under the License is distributed on an "AS IS" basis,
1052
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1053
+ * for the specific language governing rights and limitations under the
1054
+ * License.
1055
+ *
1056
+ * The Original Code is Ajax.org Code Editor (ACE).
1057
+ *
1058
+ * The Initial Developer of the Original Code is
1059
+ * Ajax.org B.V.
1060
+ * Portions created by the Initial Developer are Copyright (C) 2010
1061
+ * the Initial Developer. All Rights Reserved.
1062
+ *
1063
+ * Contributor(s):
1064
+ * Fabian Jakobs <fabian AT ajax DOT org>
1065
+ *
1066
+ * Alternatively, the contents of this file may be used under the terms of
1067
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1068
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1069
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1070
+ * of those above. If you wish to allow use of your version of this file only
1071
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1072
+ * use your version of this file under the terms of the MPL, indicate your
1073
+ * decision by deleting the provisions above and replace them with the notice
1074
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1075
+ * the provisions above, a recipient may use your version of this file under
1076
+ * the terms of any one of the MPL, the GPL or the LGPL.
1077
+ *
1078
+ * ***** END LICENSE BLOCK ***** */
1079
+
1080
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1081
+ "use strict";
1082
+
1083
+ var oop = require("../../lib/oop");
1084
+ var Range = require("../../range").Range;
1085
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1086
+
1087
+ var FoldMode = exports.FoldMode = function() {};
1088
+ oop.inherits(FoldMode, BaseFoldMode);
1089
+
1090
+ (function() {
1091
+
1092
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1093
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1094
+
1095
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1096
+ var line = session.getLine(row);
1097
+ var match = line.match(this.foldingStartMarker);
1098
+ if (match) {
1099
+ var i = match.index;
1100
+
1101
+ if (match[1])
1102
+ return this.openingBracketBlock(session, match[1], row, i);
1103
+
1104
+ var range = session.getCommentFoldRange(row, i + match[0].length);
1105
+ range.end.column -= 2;
1106
+ return range;
1107
+ }
1108
+
1109
+ if (foldStyle !== "markbeginend")
1110
+ return;
1111
+
1112
+ var match = line.match(this.foldingStopMarker);
1113
+ if (match) {
1114
+ var i = match.index + match[0].length;
1115
+
1116
+ if (match[2]) {
1117
+ var range = session.getCommentFoldRange(row, i);
1118
+ range.end.column -= 2;
1119
+ return range;
1120
+ }
1121
+
1122
+ var end = {row: row, column: i};
1123
+ var start = session.$findOpeningBracket(match[1], end);
1124
+
1125
+ if (!start)
1126
+ return;
1127
+
1128
+ start.column++;
1129
+ end.column--;
1130
+
1131
+ return Range.fromPoints(start, end);
1132
+ }
1133
+ };
1134
+
1135
+ }).call(FoldMode.prototype);
1136
+
1137
+ });/* ***** BEGIN LICENSE BLOCK *****
1138
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1139
+ *
1140
+ * The contents of this file are subject to the Mozilla Public License Version
1141
+ * 1.1 (the "License"); you may not use this file except in compliance with
1142
+ * the License. You may obtain a copy of the License at
1143
+ * http://www.mozilla.org/MPL/
1144
+ *
1145
+ * Software distributed under the License is distributed on an "AS IS" basis,
1146
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1147
+ * for the specific language governing rights and limitations under the
1148
+ * License.
1149
+ *
1150
+ * The Original Code is Ajax.org Code Editor (ACE).
1151
+ *
1152
+ * The Initial Developer of the Original Code is
1153
+ * Ajax.org B.V.
1154
+ * Portions created by the Initial Developer are Copyright (C) 2010
1155
+ * the Initial Developer. All Rights Reserved.
1156
+ *
1157
+ * Contributor(s):
1158
+ * Fabian Jakobs <fabian AT ajax DOT org>
1159
+ *
1160
+ * Alternatively, the contents of this file may be used under the terms of
1161
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1162
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1163
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1164
+ * of those above. If you wish to allow use of your version of this file only
1165
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1166
+ * use your version of this file under the terms of the MPL, indicate your
1167
+ * decision by deleting the provisions above and replace them with the notice
1168
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1169
+ * the provisions above, a recipient may use your version of this file under
1170
+ * the terms of any one of the MPL, the GPL or the LGPL.
1171
+ *
1172
+ * ***** END LICENSE BLOCK ***** */
1173
+
1174
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1175
+ "use strict";
1176
+
1177
+ var Range = require("../../range").Range;
1178
+
1179
+ var FoldMode = exports.FoldMode = function() {};
1180
+
1181
+ (function() {
1182
+
1183
+ this.foldingStartMarker = null;
1184
+ this.foldingStopMarker = null;
1185
+
1186
+ // must return "" if there's no fold, to enable caching
1187
+ this.getFoldWidget = function(session, foldStyle, row) {
1188
+ var line = session.getLine(row);
1189
+ if (this.foldingStartMarker.test(line))
1190
+ return "start";
1191
+ if (foldStyle == "markbeginend"
1192
+ && this.foldingStopMarker
1193
+ && this.foldingStopMarker.test(line))
1194
+ return "end";
1195
+ return "";
1196
+ };
1197
+
1198
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1199
+ return null;
1200
+ };
1201
+
1202
+ this.indentationBlock = function(session, row, column) {
1203
+ var re = /^\s*/;
1204
+ var startRow = row;
1205
+ var endRow = row;
1206
+ var line = session.getLine(row);
1207
+ var startColumn = column || line.length;
1208
+ var startLevel = line.match(re)[0].length;
1209
+ var maxRow = session.getLength()
1210
+
1211
+ while (++row < maxRow) {
1212
+ line = session.getLine(row);
1213
+ var level = line.match(re)[0].length;
1214
+
1215
+ if (level == line.length)
1216
+ continue;
1217
+
1218
+ if (level <= startLevel)
1219
+ break;
1220
+
1221
+ endRow = row;
1222
+ }
1223
+
1224
+ if (endRow > startRow) {
1225
+ var endColumn = session.getLine(endRow).length;
1226
+ return new Range(startRow, startColumn, endRow, endColumn);
1227
+ }
1228
+ };
1229
+
1230
+ this.openingBracketBlock = function(session, bracket, row, column) {
1231
+ var start = {row: row, column: column + 1};
1232
+ var end = session.$findClosingBracket(bracket, start);
1233
+ if (!end)
1234
+ return;
1235
+
1236
+ var fw = session.foldWidgets[end.row];
1237
+ if (fw == null)
1238
+ fw = this.getFoldWidget(session, end.row);
1239
+
1240
+ if (fw == "start") {
1241
+ end.row --;
1242
+ end.column = session.getLine(end.row).length;
1243
+ }
1244
+ return Range.fromPoints(start, end);
1245
+ };
1246
+
1247
+ }).call(FoldMode.prototype);
1248
+
1249
+ });
1250
+ define('ace/mode/java_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) {
1251
+ "use strict";
1252
+
1253
+ var oop = require("../lib/oop");
1254
+ var lang = require("../lib/lang");
1255
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
1256
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1257
+
1258
+ var JavaHighlightRules = function() {
1259
+
1260
+ // taken from http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
1261
+ var keywords = lang.arrayToMap(
1262
+ ("abstract|continue|for|new|switch|" +
1263
+ "assert|default|goto|package|synchronized|" +
1264
+ "boolean|do|if|private|this|" +
1265
+ "break|double|implements|protected|throw|" +
1266
+ "byte|else|import|public|throws|" +
1267
+ "case|enum|instanceof|return|transient|" +
1268
+ "catch|extends|int|short|try|" +
1269
+ "char|final|interface|static|void|" +
1270
+ "class|finally|long|strictfp|volatile|" +
1271
+ "const|float|native|super|while").split("|")
1272
+ );
1273
+
1274
+ var buildinConstants = lang.arrayToMap(
1275
+ ("null|Infinity|NaN|undefined").split("|")
1276
+ );
1277
+
1278
+ var langClasses = lang.arrayToMap(
1279
+ ("AbstractMethodError|AssertionError|ClassCircularityError|"+
1280
+ "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
1281
+ "ExceptionInInitializerError|IllegalAccessError|"+
1282
+ "IllegalThreadStateException|InstantiationError|InternalError|"+
1283
+ "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
1284
+ "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
1285
+ "SuppressWarnings|TypeNotPresentException|UnknownError|"+
1286
+ "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
1287
+ "InstantiationException|IndexOutOfBoundsException|"+
1288
+ "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
1289
+ "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
1290
+ "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
1291
+ "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
1292
+ "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
1293
+ "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
1294
+ "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
1295
+ "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
1296
+ "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
1297
+ "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
1298
+ "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
1299
+ "ArrayStoreException|ClassCastException|LinkageError|"+
1300
+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
1301
+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
1302
+ "Cloneable|Class|CharSequence|Comparable|String|Object").split("|")
1303
+ );
1304
+
1305
+ var importClasses = lang.arrayToMap(
1306
+ ("").split("|")
1307
+ );
1308
+ // regexp must not have capturing parentheses. Use (?:) instead.
1309
+ // regexps are ordered -> the first match is used
1310
+
1311
+ this.$rules = {
1312
+ "start" : [
1313
+ {
1314
+ token : "comment",
1315
+ regex : "\\/\\/.*$"
1316
+ },
1317
+ DocCommentHighlightRules.getStartRule("doc-start"),
1318
+ {
1319
+ token : "comment", // multi line comment
1320
+ merge : true,
1321
+ regex : "\\/\\*",
1322
+ next : "comment"
1323
+ }, {
1324
+ token : "string.regexp",
1325
+ regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)"
1326
+ }, {
1327
+ token : "string", // single line
1328
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
1329
+ }, {
1330
+ token : "string", // single line
1331
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
1332
+ }, {
1333
+ token : "constant.numeric", // hex
1334
+ regex : "0[xX][0-9a-fA-F]+\\b"
1335
+ }, {
1336
+ token : "constant.numeric", // float
1337
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
1338
+ }, {
1339
+ token : "constant.language.boolean",
1340
+ regex : "(?:true|false)\\b"
1341
+ }, {
1342
+ token : function(value) {
1343
+ if (value == "this")
1344
+ return "variable.language";
1345
+ else if (keywords.hasOwnProperty(value))
1346
+ return "keyword";
1347
+ else if (langClasses.hasOwnProperty(value))
1348
+ return "support.function";
1349
+ else if (importClasses.hasOwnProperty(value))
1350
+ return "support.function";
1351
+ else if (buildinConstants.hasOwnProperty(value))
1352
+ return "constant.language";
1353
+ else
1354
+ return "identifier";
1355
+ },
1356
+ // TODO: Unicode escape sequences
1357
+ // TODO: Unicode identifiers
1358
+ regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
1359
+ }, {
1360
+ token : "keyword.operator",
1361
+ regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
1362
+ }, {
1363
+ token : "lparen",
1364
+ regex : "[[({]"
1365
+ }, {
1366
+ token : "rparen",
1367
+ regex : "[\\])}]"
1368
+ }, {
1369
+ token : "text",
1370
+ regex : "\\s+"
1371
+ }
1372
+ ],
1373
+ "comment" : [
1374
+ {
1375
+ token : "comment", // closing comment
1376
+ regex : ".*?\\*\\/",
1377
+ next : "start"
1378
+ }, {
1379
+ token : "comment", // comment spanning whole line
1380
+ merge : true,
1381
+ regex : ".+"
1382
+ }
1383
+ ]
1384
+ };
1385
+
1386
+ this.embedRules(DocCommentHighlightRules, "doc-",
1387
+ [ DocCommentHighlightRules.getEndRule("start") ]);
1388
+ };
1389
+
1390
+ oop.inherits(JavaHighlightRules, TextHighlightRules);
1391
+
1392
+ exports.JavaHighlightRules = JavaHighlightRules;
1393
+ });