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,2454 @@
1
+ /* ***** BEGIN LICENSE BLOCK *****
2
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3
+ *
4
+ * The contents of this file are subject to the Mozilla Public License Version
5
+ * 1.1 (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ * http://www.mozilla.org/MPL/
8
+ *
9
+ * Software distributed under the License is distributed on an "AS IS" basis,
10
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11
+ * for the specific language governing rights and limitations under the
12
+ * License.
13
+ *
14
+ * The Original Code is Ajax.org Code Editor (ACE).
15
+ *
16
+ * The Initial Developer of the Original Code is
17
+ * Ajax.org B.V.
18
+ * Portions created by the Initial Developer are Copyright (C) 2010
19
+ * the Initial Developer. All Rights Reserved.
20
+ *
21
+ * Contributor(s):
22
+ * Fabian Jakobs <fabian AT ajax DOT org>
23
+ *
24
+ * Alternatively, the contents of this file may be used under the terms of
25
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
26
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
+ * in which case the provisions of the GPL or the LGPL are applicable instead
28
+ * of those above. If you wish to allow use of your version of this file only
29
+ * under the terms of either the GPL or the LGPL, and not to allow others to
30
+ * use your version of this file under the terms of the MPL, indicate your
31
+ * decision by deleting the provisions above and replace them with the notice
32
+ * and other provisions required by the GPL or the LGPL. If you do not delete
33
+ * the provisions above, a recipient may use your version of this file under
34
+ * the terms of any one of the MPL, the GPL or the LGPL.
35
+ *
36
+ * ***** END LICENSE BLOCK ***** */
37
+
38
+ define('ace/mode/coldfusion', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml', 'ace/mode/javascript', 'ace/mode/css', 'ace/tokenizer', 'ace/mode/coldfusion_highlight_rules'], function(require, exports, module) {
39
+ "use strict";
40
+
41
+ var oop = require("../lib/oop");
42
+ var XmlMode = require("./xml").Mode;
43
+ var JavaScriptMode = require("./javascript").Mode;
44
+ var CssMode = require("./css").Mode;
45
+ var Tokenizer = require("../tokenizer").Tokenizer;
46
+ var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules;
47
+
48
+ var Mode = function() {
49
+ XmlMode.call(this);
50
+
51
+ var highlighter = new ColdfusionHighlightRules();
52
+ this.$tokenizer = new Tokenizer(highlighter.getRules());
53
+
54
+ this.$embeds = highlighter.getEmbeds();
55
+ this.createModeDelegates({
56
+ "js-": JavaScriptMode,
57
+ "css-": CssMode
58
+ });
59
+ };
60
+ oop.inherits(Mode, XmlMode);
61
+
62
+ (function() {
63
+
64
+ this.getNextLineIndent = function(state, line, tab) {
65
+ return this.$getIndent(line);
66
+ };
67
+
68
+ }).call(Mode.prototype);
69
+
70
+ exports.Mode = Mode;
71
+ });
72
+ /* ***** BEGIN LICENSE BLOCK *****
73
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
74
+ *
75
+ * The contents of this file are subject to the Mozilla Public License Version
76
+ * 1.1 (the "License"); you may not use this file except in compliance with
77
+ * the License. You may obtain a copy of the License at
78
+ * http://www.mozilla.org/MPL/
79
+ *
80
+ * Software distributed under the License is distributed on an "AS IS" basis,
81
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
82
+ * for the specific language governing rights and limitations under the
83
+ * License.
84
+ *
85
+ * The Original Code is Ajax.org Code Editor (ACE).
86
+ *
87
+ * The Initial Developer of the Original Code is
88
+ * Ajax.org B.V.
89
+ * Portions created by the Initial Developer are Copyright (C) 2010
90
+ * the Initial Developer. All Rights Reserved.
91
+ *
92
+ * Contributor(s):
93
+ * Fabian Jakobs <fabian AT ajax DOT org>
94
+ *
95
+ * Alternatively, the contents of this file may be used under the terms of
96
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
97
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
98
+ * in which case the provisions of the GPL or the LGPL are applicable instead
99
+ * of those above. If you wish to allow use of your version of this file only
100
+ * under the terms of either the GPL or the LGPL, and not to allow others to
101
+ * use your version of this file under the terms of the MPL, indicate your
102
+ * decision by deleting the provisions above and replace them with the notice
103
+ * and other provisions required by the GPL or the LGPL. If you do not delete
104
+ * the provisions above, a recipient may use your version of this file under
105
+ * the terms of any one of the MPL, the GPL or the LGPL.
106
+ *
107
+ * ***** END LICENSE BLOCK ***** */
108
+
109
+ define('ace/mode/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
110
+ "use strict";
111
+
112
+ var oop = require("../lib/oop");
113
+ var TextMode = require("./text").Mode;
114
+ var Tokenizer = require("../tokenizer").Tokenizer;
115
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
116
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
117
+ var XmlFoldMode = require("./folding/xml").FoldMode;
118
+
119
+ var Mode = function() {
120
+ this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
121
+ this.$behaviour = new XmlBehaviour();
122
+ this.foldingRules = new XmlFoldMode();
123
+ };
124
+
125
+ oop.inherits(Mode, TextMode);
126
+
127
+ (function() {
128
+
129
+ this.getNextLineIndent = function(state, line, tab) {
130
+ return this.$getIndent(line);
131
+ };
132
+
133
+ }).call(Mode.prototype);
134
+
135
+ exports.Mode = Mode;
136
+ });
137
+ /* ***** BEGIN LICENSE BLOCK *****
138
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
139
+ *
140
+ * The contents of this file are subject to the Mozilla Public License Version
141
+ * 1.1 (the "License"); you may not use this file except in compliance with
142
+ * the License. You may obtain a copy of the License at
143
+ * http://www.mozilla.org/MPL/
144
+ *
145
+ * Software distributed under the License is distributed on an "AS IS" basis,
146
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
147
+ * for the specific language governing rights and limitations under the
148
+ * License.
149
+ *
150
+ * The Original Code is Ajax.org Code Editor (ACE).
151
+ *
152
+ * The Initial Developer of the Original Code is
153
+ * Ajax.org B.V.
154
+ * Portions created by the Initial Developer are Copyright (C) 2010
155
+ * the Initial Developer. All Rights Reserved.
156
+ *
157
+ * Contributor(s):
158
+ * Fabian Jakobs <fabian AT ajax DOT org>
159
+ *
160
+ * Alternatively, the contents of this file may be used under the terms of
161
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
162
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
163
+ * in which case the provisions of the GPL or the LGPL are applicable instead
164
+ * of those above. If you wish to allow use of your version of this file only
165
+ * under the terms of either the GPL or the LGPL, and not to allow others to
166
+ * use your version of this file under the terms of the MPL, indicate your
167
+ * decision by deleting the provisions above and replace them with the notice
168
+ * and other provisions required by the GPL or the LGPL. If you do not delete
169
+ * the provisions above, a recipient may use your version of this file under
170
+ * the terms of any one of the MPL, the GPL or the LGPL.
171
+ *
172
+ * ***** END LICENSE BLOCK ***** */
173
+
174
+ define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
175
+ "use strict";
176
+
177
+ var oop = require("../lib/oop");
178
+ var xmlUtil = require("./xml_util");
179
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
180
+
181
+ var XmlHighlightRules = function() {
182
+
183
+ // regexp must not have capturing parentheses
184
+ // regexps are ordered -> the first match is used
185
+ this.$rules = {
186
+ start : [{
187
+ token : "text",
188
+ regex : "<\\!\\[CDATA\\[",
189
+ next : "cdata"
190
+ }, {
191
+ token : "xml_pe",
192
+ regex : "<\\?.*?\\?>"
193
+ }, {
194
+ token : "comment",
195
+ merge : true,
196
+ regex : "<\\!--",
197
+ next : "comment"
198
+ }, {
199
+ token : "xml_pe",
200
+ regex : "<\\!.*?>"
201
+ }, {
202
+ token : "meta.tag", // opening tag
203
+ regex : "<\\/?",
204
+ next : "tag"
205
+ }, {
206
+ token : "text",
207
+ regex : "\\s+"
208
+ }, {
209
+ token : "constant.character.entity",
210
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
211
+ }, {
212
+ token : "text",
213
+ regex : "[^<]+"
214
+ }],
215
+
216
+ cdata : [{
217
+ token : "text",
218
+ regex : "\\]\\]>",
219
+ next : "start"
220
+ }, {
221
+ token : "text",
222
+ regex : "\\s+"
223
+ }, {
224
+ token : "text",
225
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
226
+ }],
227
+
228
+ comment : [{
229
+ token : "comment",
230
+ regex : ".*?-->",
231
+ next : "start"
232
+ }, {
233
+ token : "comment",
234
+ merge : true,
235
+ regex : ".+"
236
+ }]
237
+ };
238
+
239
+ xmlUtil.tag(this.$rules, "tag", "start");
240
+ };
241
+
242
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
243
+
244
+ exports.XmlHighlightRules = XmlHighlightRules;
245
+ });
246
+ /* ***** BEGIN LICENSE BLOCK *****
247
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
248
+ *
249
+ * The contents of this file are subject to the Mozilla Public License Version
250
+ * 1.1 (the "License"); you may not use this file except in compliance with
251
+ * the License. You may obtain a copy of the License at
252
+ * http://www.mozilla.org/MPL/
253
+ *
254
+ * Software distributed under the License is distributed on an "AS IS" basis,
255
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
256
+ * for the specific language governing rights and limitations under the
257
+ * License.
258
+ *
259
+ * The Original Code is Ajax.org Code Editor (ACE).
260
+ *
261
+ * The Initial Developer of the Original Code is
262
+ * Ajax.org B.V.
263
+ * Portions created by the Initial Developer are Copyright (C) 2010
264
+ * the Initial Developer. All Rights Reserved.
265
+ *
266
+ * Contributor(s):
267
+ * Fabian Jakobs <fabian AT ajax DOT org>
268
+ *
269
+ * Alternatively, the contents of this file may be used under the terms of
270
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
271
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
272
+ * in which case the provisions of the GPL or the LGPL are applicable instead
273
+ * of those above. If you wish to allow use of your version of this file only
274
+ * under the terms of either the GPL or the LGPL, and not to allow others to
275
+ * use your version of this file under the terms of the MPL, indicate your
276
+ * decision by deleting the provisions above and replace them with the notice
277
+ * and other provisions required by the GPL or the LGPL. If you do not delete
278
+ * the provisions above, a recipient may use your version of this file under
279
+ * the terms of any one of the MPL, the GPL or the LGPL.
280
+ *
281
+ * ***** END LICENSE BLOCK ***** */
282
+
283
+ define('ace/mode/xml_util', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
284
+ "use strict";
285
+
286
+ var lang = require("../lib/lang");
287
+
288
+ var formTags = lang.arrayToMap(
289
+ ("button|form|input|label|select|textarea").split("|")
290
+ );
291
+
292
+ var tableTags = lang.arrayToMap(
293
+ ("table|tbody|td|tfoot|th|tr").split("|")
294
+ );
295
+
296
+ function string(state) {
297
+ return [{
298
+ token : "string",
299
+ regex : '".*?"'
300
+ }, {
301
+ token : "string", // multi line string start
302
+ merge : true,
303
+ regex : '["].*',
304
+ next : state + "_qqstring"
305
+ }, {
306
+ token : "string",
307
+ regex : "'.*?'"
308
+ }, {
309
+ token : "string", // multi line string start
310
+ merge : true,
311
+ regex : "['].*",
312
+ next : state + "_qstring"
313
+ }];
314
+ }
315
+
316
+ function multiLineString(quote, state) {
317
+ return [{
318
+ token : "string",
319
+ merge : true,
320
+ regex : ".*?" + quote,
321
+ next : state
322
+ }, {
323
+ token : "string",
324
+ merge : true,
325
+ regex : '.+'
326
+ }];
327
+ }
328
+
329
+ exports.tag = function(states, name, nextState) {
330
+ states[name] = [{
331
+ token : "text",
332
+ regex : "\\s+"
333
+ }, {
334
+ //token : "meta.tag",
335
+
336
+ token : function(value) {
337
+ if ( value==='a' ) {
338
+ return "meta.tag.anchor";
339
+ }
340
+ else if ( value==='img' ) {
341
+ return "meta.tag.image";
342
+ }
343
+ else if ( value==='script' ) {
344
+ return "meta.tag.script";
345
+ }
346
+ else if ( value==='style' ) {
347
+ return "meta.tag.style";
348
+ }
349
+ else if (formTags.hasOwnProperty(value.toLowerCase())) {
350
+ return "meta.tag.form";
351
+ }
352
+ else if (tableTags.hasOwnProperty(value.toLowerCase())) {
353
+ return "meta.tag.table";
354
+ }
355
+ else {
356
+ return "meta.tag";
357
+ }
358
+ },
359
+ merge : true,
360
+ regex : "[-_a-zA-Z0-9:]+",
361
+ next : name + "_embed_attribute_list"
362
+ }, {
363
+ token: "empty",
364
+ regex: "",
365
+ next : name + "_embed_attribute_list"
366
+ }];
367
+
368
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
369
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
370
+
371
+ states[name + "_embed_attribute_list"] = [{
372
+ token : "meta.tag",
373
+ merge : true,
374
+ regex : "\/?>",
375
+ next : nextState
376
+ }, {
377
+ token : "keyword.operator",
378
+ regex : "="
379
+ }, {
380
+ token : "entity.other.attribute-name",
381
+ regex : "[-_a-zA-Z0-9:]+"
382
+ }, {
383
+ token : "constant.numeric", // float
384
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
385
+ }, {
386
+ token : "text",
387
+ regex : "\\s+"
388
+ }].concat(string(name));
389
+ };
390
+
391
+ });
392
+ /* vim:ts=4:sts=4:sw=4:
393
+ * ***** BEGIN LICENSE BLOCK *****
394
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
395
+ *
396
+ * The contents of this file are subject to the Mozilla Public License Version
397
+ * 1.1 (the "License"); you may not use this file except in compliance with
398
+ * the License. You may obtain a copy of the License at
399
+ * http://www.mozilla.org/MPL/
400
+ *
401
+ * Software distributed under the License is distributed on an "AS IS" basis,
402
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
403
+ * for the specific language governing rights and limitations under the
404
+ * License.
405
+ *
406
+ * The Original Code is Ajax.org Code Editor (ACE).
407
+ *
408
+ * The Initial Developer of the Original Code is
409
+ * Ajax.org B.V.
410
+ * Portions created by the Initial Developer are Copyright (C) 2010
411
+ * the Initial Developer. All Rights Reserved.
412
+ *
413
+ * Contributor(s):
414
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
415
+ *
416
+ * Alternatively, the contents of this file may be used under the terms of
417
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
418
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
419
+ * in which case the provisions of the GPL or the LGPL are applicable instead
420
+ * of those above. If you wish to allow use of your version of this file only
421
+ * under the terms of either the GPL or the LGPL, and not to allow others to
422
+ * use your version of this file under the terms of the MPL, indicate your
423
+ * decision by deleting the provisions above and replace them with the notice
424
+ * and other provisions required by the GPL or the LGPL. If you do not delete
425
+ * the provisions above, a recipient may use your version of this file under
426
+ * the terms of any one of the MPL, the GPL or the LGPL.
427
+ *
428
+ * ***** END LICENSE BLOCK ***** */
429
+
430
+ define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
431
+ "use strict";
432
+
433
+ var oop = require("../../lib/oop");
434
+ var Behaviour = require("../behaviour").Behaviour;
435
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
436
+
437
+ var XmlBehaviour = function () {
438
+
439
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
440
+
441
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
442
+ if (text == '<') {
443
+ var selection = editor.getSelectionRange();
444
+ var selected = session.doc.getTextRange(selection);
445
+ if (selected !== "") {
446
+ return false;
447
+ } else {
448
+ return {
449
+ text: '<>',
450
+ selection: [1, 1]
451
+ }
452
+ }
453
+ } else if (text == '>') {
454
+ var cursor = editor.getCursorPosition();
455
+ var line = session.doc.getLine(cursor.row);
456
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
457
+ if (rightChar == '>') { // need some kind of matching check here
458
+ return {
459
+ text: '',
460
+ selection: [1, 1]
461
+ }
462
+ }
463
+ } else if (text == "\n") {
464
+ var cursor = editor.getCursorPosition();
465
+ var line = session.doc.getLine(cursor.row);
466
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
467
+ if (rightChars == '</') {
468
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
469
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
470
+
471
+ return {
472
+ text: '\n' + indent + '\n' + next_indent,
473
+ selection: [1, indent.length, 1, indent.length]
474
+ }
475
+ }
476
+ }
477
+ });
478
+
479
+ }
480
+ oop.inherits(XmlBehaviour, Behaviour);
481
+
482
+ exports.XmlBehaviour = XmlBehaviour;
483
+ });/* vim:ts=4:sts=4:sw=4:
484
+ * ***** BEGIN LICENSE BLOCK *****
485
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
486
+ *
487
+ * The contents of this file are subject to the Mozilla Public License Version
488
+ * 1.1 (the "License"); you may not use this file except in compliance with
489
+ * the License. You may obtain a copy of the License at
490
+ * http://www.mozilla.org/MPL/
491
+ *
492
+ * Software distributed under the License is distributed on an "AS IS" basis,
493
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
494
+ * for the specific language governing rights and limitations under the
495
+ * License.
496
+ *
497
+ * The Original Code is Ajax.org Code Editor (ACE).
498
+ *
499
+ * The Initial Developer of the Original Code is
500
+ * Ajax.org B.V.
501
+ * Portions created by the Initial Developer are Copyright (C) 2010
502
+ * the Initial Developer. All Rights Reserved.
503
+ *
504
+ * Contributor(s):
505
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
506
+ *
507
+ * Alternatively, the contents of this file may be used under the terms of
508
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
509
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
510
+ * in which case the provisions of the GPL or the LGPL are applicable instead
511
+ * of those above. If you wish to allow use of your version of this file only
512
+ * under the terms of either the GPL or the LGPL, and not to allow others to
513
+ * use your version of this file under the terms of the MPL, indicate your
514
+ * decision by deleting the provisions above and replace them with the notice
515
+ * and other provisions required by the GPL or the LGPL. If you do not delete
516
+ * the provisions above, a recipient may use your version of this file under
517
+ * the terms of any one of the MPL, the GPL or the LGPL.
518
+ *
519
+ * ***** END LICENSE BLOCK ***** */
520
+
521
+ define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
522
+ "use strict";
523
+
524
+ var oop = require("../../lib/oop");
525
+ var Behaviour = require('../behaviour').Behaviour;
526
+
527
+ var CstyleBehaviour = function () {
528
+
529
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
530
+ if (text == '{') {
531
+ var selection = editor.getSelectionRange();
532
+ var selected = session.doc.getTextRange(selection);
533
+ if (selected !== "") {
534
+ return {
535
+ text: '{' + selected + '}',
536
+ selection: false
537
+ };
538
+ } else {
539
+ return {
540
+ text: '{}',
541
+ selection: [1, 1]
542
+ };
543
+ }
544
+ } else if (text == '}') {
545
+ var cursor = editor.getCursorPosition();
546
+ var line = session.doc.getLine(cursor.row);
547
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
548
+ if (rightChar == '}') {
549
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
550
+ if (matching !== null) {
551
+ return {
552
+ text: '',
553
+ selection: [1, 1]
554
+ };
555
+ }
556
+ }
557
+ } else if (text == "\n") {
558
+ var cursor = editor.getCursorPosition();
559
+ var line = session.doc.getLine(cursor.row);
560
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
561
+ if (rightChar == '}') {
562
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
563
+ if (!openBracePos)
564
+ return null;
565
+
566
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
567
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
568
+
569
+ return {
570
+ text: '\n' + indent + '\n' + next_indent,
571
+ selection: [1, indent.length, 1, indent.length]
572
+ };
573
+ }
574
+ }
575
+ });
576
+
577
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
578
+ var selected = session.doc.getTextRange(range);
579
+ if (!range.isMultiLine() && selected == '{') {
580
+ var line = session.doc.getLine(range.start.row);
581
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
582
+ if (rightChar == '}') {
583
+ range.end.column++;
584
+ return range;
585
+ }
586
+ }
587
+ });
588
+
589
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
590
+ if (text == '(') {
591
+ var selection = editor.getSelectionRange();
592
+ var selected = session.doc.getTextRange(selection);
593
+ if (selected !== "") {
594
+ return {
595
+ text: '(' + selected + ')',
596
+ selection: false
597
+ };
598
+ } else {
599
+ return {
600
+ text: '()',
601
+ selection: [1, 1]
602
+ };
603
+ }
604
+ } else if (text == ')') {
605
+ var cursor = editor.getCursorPosition();
606
+ var line = session.doc.getLine(cursor.row);
607
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
608
+ if (rightChar == ')') {
609
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
610
+ if (matching !== null) {
611
+ return {
612
+ text: '',
613
+ selection: [1, 1]
614
+ };
615
+ }
616
+ }
617
+ }
618
+ });
619
+
620
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
621
+ var selected = session.doc.getTextRange(range);
622
+ if (!range.isMultiLine() && selected == '(') {
623
+ var line = session.doc.getLine(range.start.row);
624
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
625
+ if (rightChar == ')') {
626
+ range.end.column++;
627
+ return range;
628
+ }
629
+ }
630
+ });
631
+
632
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
633
+ if (text == '"' || text == "'") {
634
+ var quote = text;
635
+ var selection = editor.getSelectionRange();
636
+ var selected = session.doc.getTextRange(selection);
637
+ if (selected !== "") {
638
+ return {
639
+ text: quote + selected + quote,
640
+ selection: false
641
+ };
642
+ } else {
643
+ var cursor = editor.getCursorPosition();
644
+ var line = session.doc.getLine(cursor.row);
645
+ var leftChar = line.substring(cursor.column-1, cursor.column);
646
+
647
+ // We're escaped.
648
+ if (leftChar == '\\') {
649
+ return null;
650
+ }
651
+
652
+ // Find what token we're inside.
653
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
654
+ var col = 0, token;
655
+ var quotepos = -1; // Track whether we're inside an open quote.
656
+
657
+ for (var x = 0; x < tokens.length; x++) {
658
+ token = tokens[x];
659
+ if (token.type == "string") {
660
+ quotepos = -1;
661
+ } else if (quotepos < 0) {
662
+ quotepos = token.value.indexOf(quote);
663
+ }
664
+ if ((token.value.length + col) > selection.start.column) {
665
+ break;
666
+ }
667
+ col += tokens[x].value.length;
668
+ }
669
+
670
+ // Try and be smart about when we auto insert.
671
+ 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)))) {
672
+ return {
673
+ text: quote + quote,
674
+ selection: [1,1]
675
+ };
676
+ } else if (token && token.type === "string") {
677
+ // Ignore input and move right one if we're typing over the closing quote.
678
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
679
+ if (rightChar == quote) {
680
+ return {
681
+ text: '',
682
+ selection: [1, 1]
683
+ };
684
+ }
685
+ }
686
+ }
687
+ }
688
+ });
689
+
690
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
691
+ var selected = session.doc.getTextRange(range);
692
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
693
+ var line = session.doc.getLine(range.start.row);
694
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
695
+ if (rightChar == '"') {
696
+ range.end.column++;
697
+ return range;
698
+ }
699
+ }
700
+ });
701
+
702
+ };
703
+
704
+ oop.inherits(CstyleBehaviour, Behaviour);
705
+
706
+ exports.CstyleBehaviour = CstyleBehaviour;
707
+ });/* ***** BEGIN LICENSE BLOCK *****
708
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
709
+ *
710
+ * The contents of this file are subject to the Mozilla Public License Version
711
+ * 1.1 (the "License"); you may not use this file except in compliance with
712
+ * the License. You may obtain a copy of the License at
713
+ * http://www.mozilla.org/MPL/
714
+ *
715
+ * Software distributed under the License is distributed on an "AS IS" basis,
716
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
717
+ * for the specific language governing rights and limitations under the
718
+ * License.
719
+ *
720
+ * The Original Code is Ajax.org Code Editor (ACE).
721
+ *
722
+ * The Initial Developer of the Original Code is
723
+ * Ajax.org B.V.
724
+ * Portions created by the Initial Developer are Copyright (C) 2010
725
+ * the Initial Developer. All Rights Reserved.
726
+ *
727
+ * Contributor(s):
728
+ * Fabian Jakobs <fabian AT ajax DOT org>
729
+ *
730
+ * Alternatively, the contents of this file may be used under the terms of
731
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
732
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
733
+ * in which case the provisions of the GPL or the LGPL are applicable instead
734
+ * of those above. If you wish to allow use of your version of this file only
735
+ * under the terms of either the GPL or the LGPL, and not to allow others to
736
+ * use your version of this file under the terms of the MPL, indicate your
737
+ * decision by deleting the provisions above and replace them with the notice
738
+ * and other provisions required by the GPL or the LGPL. If you do not delete
739
+ * the provisions above, a recipient may use your version of this file under
740
+ * the terms of any one of the MPL, the GPL or the LGPL.
741
+ *
742
+ * ***** END LICENSE BLOCK ***** */
743
+
744
+ define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
745
+ "use strict";
746
+
747
+ var oop = require("../../lib/oop");
748
+ var lang = require("../../lib/lang");
749
+ var Range = require("../../range").Range;
750
+ var BaseFoldMode = require("./fold_mode").FoldMode;
751
+ var TokenIterator = require("../../token_iterator").TokenIterator;
752
+
753
+ var FoldMode = exports.FoldMode = function(voidElements) {
754
+ BaseFoldMode.call(this);
755
+ this.voidElements = voidElements || {};
756
+ };
757
+ oop.inherits(FoldMode, BaseFoldMode);
758
+
759
+ (function() {
760
+
761
+ this.getFoldWidget = function(session, foldStyle, row) {
762
+ var tag = this._getFirstTagInLine(session, row);
763
+
764
+ if (tag.closing)
765
+ return foldStyle == "markbeginend" ? "end" : "";
766
+
767
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
768
+ return "";
769
+
770
+ if (tag.selfClosing)
771
+ return "";
772
+
773
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
774
+ return "";
775
+
776
+ return "start";
777
+ };
778
+
779
+ this._getFirstTagInLine = function(session, row) {
780
+ var tokens = session.getTokens(row, row)[0].tokens;
781
+ var value = "";
782
+ for (var i = 0; i < tokens.length; i++) {
783
+ var token = tokens[i];
784
+ if (token.type.indexOf("meta.tag") === 0)
785
+ value += token.value;
786
+ else
787
+ value += lang.stringRepeat(" ", token.value.length);
788
+ }
789
+
790
+ return this._parseTag(value);
791
+ };
792
+
793
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
794
+ this._parseTag = function(tag) {
795
+
796
+ var match = this.tagRe.exec(tag);
797
+ var column = this.tagRe.lastIndex || 0;
798
+ this.tagRe.lastIndex = 0;
799
+
800
+ return {
801
+ value: tag,
802
+ match: match ? match[2] : "",
803
+ closing: match ? !!match[3] : false,
804
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
805
+ tagName: match ? match[4] : "",
806
+ column: match[1] ? column + match[1].length : column
807
+ };
808
+ };
809
+
810
+ /*
811
+ * reads a full tag and places the iterator after the tag
812
+ */
813
+ this._readTagForward = function(iterator) {
814
+ var token = iterator.getCurrentToken();
815
+ if (!token)
816
+ return null;
817
+
818
+ var value = "";
819
+ var start;
820
+
821
+ do {
822
+ if (token.type.indexOf("meta.tag") === 0) {
823
+ if (!start) {
824
+ var start = {
825
+ row: iterator.getCurrentTokenRow(),
826
+ column: iterator.getCurrentTokenColumn()
827
+ };
828
+ }
829
+ value += token.value;
830
+ if (value.indexOf(">") !== -1) {
831
+ var tag = this._parseTag(value);
832
+ tag.start = start;
833
+ tag.end = {
834
+ row: iterator.getCurrentTokenRow(),
835
+ column: iterator.getCurrentTokenColumn() + token.value.length
836
+ };
837
+ iterator.stepForward();
838
+ return tag;
839
+ }
840
+ }
841
+ } while(token = iterator.stepForward());
842
+
843
+ return null;
844
+ };
845
+
846
+ this._readTagBackward = function(iterator) {
847
+ var token = iterator.getCurrentToken();
848
+ if (!token)
849
+ return null;
850
+
851
+ var value = "";
852
+ var end;
853
+
854
+ do {
855
+ if (token.type.indexOf("meta.tag") === 0) {
856
+ if (!end) {
857
+ end = {
858
+ row: iterator.getCurrentTokenRow(),
859
+ column: iterator.getCurrentTokenColumn() + token.value.length
860
+ };
861
+ }
862
+ value = token.value + value;
863
+ if (value.indexOf("<") !== -1) {
864
+ var tag = this._parseTag(value);
865
+ tag.end = end;
866
+ tag.start = {
867
+ row: iterator.getCurrentTokenRow(),
868
+ column: iterator.getCurrentTokenColumn()
869
+ };
870
+ iterator.stepBackward();
871
+ return tag;
872
+ }
873
+ }
874
+ } while(token = iterator.stepBackward());
875
+
876
+ return null;
877
+ };
878
+
879
+ this._pop = function(stack, tag) {
880
+ while (stack.length) {
881
+
882
+ var top = stack[stack.length-1];
883
+ if (!tag || top.tagName == tag.tagName) {
884
+ return stack.pop();
885
+ }
886
+ else if (this.voidElements[tag.tagName]) {
887
+ return;
888
+ }
889
+ else if (this.voidElements[top.tagName]) {
890
+ stack.pop();
891
+ continue;
892
+ } else {
893
+ return null;
894
+ }
895
+ }
896
+ };
897
+
898
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
899
+ var firstTag = this._getFirstTagInLine(session, row);
900
+
901
+ if (!firstTag.match)
902
+ return null;
903
+
904
+ var isBackward = firstTag.closing || firstTag.selfClosing;
905
+ var stack = [];
906
+ var tag;
907
+
908
+ if (!isBackward) {
909
+ var iterator = new TokenIterator(session, row, firstTag.column);
910
+ var start = {
911
+ row: row,
912
+ column: firstTag.column + firstTag.tagName.length + 2
913
+ };
914
+ while (tag = this._readTagForward(iterator)) {
915
+ if (tag.selfClosing) {
916
+ if (!stack.length) {
917
+ tag.start.column += tag.tagName.length + 2;
918
+ tag.end.column -= 2;
919
+ return Range.fromPoints(tag.start, tag.end);
920
+ } else
921
+ continue;
922
+ }
923
+
924
+ if (tag.closing) {
925
+ this._pop(stack, tag);
926
+ if (stack.length == 0)
927
+ return Range.fromPoints(start, tag.start);
928
+ }
929
+ else {
930
+ stack.push(tag)
931
+ }
932
+ }
933
+ }
934
+ else {
935
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
936
+ var end = {
937
+ row: row,
938
+ column: firstTag.column
939
+ };
940
+
941
+ while (tag = this._readTagBackward(iterator)) {
942
+ if (tag.selfClosing) {
943
+ if (!stack.length) {
944
+ tag.start.column += tag.tagName.length + 2;
945
+ tag.end.column -= 2;
946
+ return Range.fromPoints(tag.start, tag.end);
947
+ } else
948
+ continue;
949
+ }
950
+
951
+ if (!tag.closing) {
952
+ this._pop(stack, tag);
953
+ if (stack.length == 0) {
954
+ tag.start.column += tag.tagName.length + 2;
955
+ return Range.fromPoints(tag.start, end);
956
+ }
957
+ }
958
+ else {
959
+ stack.push(tag)
960
+ }
961
+ }
962
+ }
963
+
964
+ };
965
+
966
+ }).call(FoldMode.prototype);
967
+
968
+ });/* ***** BEGIN LICENSE BLOCK *****
969
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
970
+ *
971
+ * The contents of this file are subject to the Mozilla Public License Version
972
+ * 1.1 (the "License"); you may not use this file except in compliance with
973
+ * the License. You may obtain a copy of the License at
974
+ * http://www.mozilla.org/MPL/
975
+ *
976
+ * Software distributed under the License is distributed on an "AS IS" basis,
977
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
978
+ * for the specific language governing rights and limitations under the
979
+ * License.
980
+ *
981
+ * The Original Code is Ajax.org Code Editor (ACE).
982
+ *
983
+ * The Initial Developer of the Original Code is
984
+ * Ajax.org B.V.
985
+ * Portions created by the Initial Developer are Copyright (C) 2010
986
+ * the Initial Developer. All Rights Reserved.
987
+ *
988
+ * Contributor(s):
989
+ * Fabian Jakobs <fabian AT ajax DOT org>
990
+ *
991
+ * Alternatively, the contents of this file may be used under the terms of
992
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
993
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
994
+ * in which case the provisions of the GPL or the LGPL are applicable instead
995
+ * of those above. If you wish to allow use of your version of this file only
996
+ * under the terms of either the GPL or the LGPL, and not to allow others to
997
+ * use your version of this file under the terms of the MPL, indicate your
998
+ * decision by deleting the provisions above and replace them with the notice
999
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1000
+ * the provisions above, a recipient may use your version of this file under
1001
+ * the terms of any one of the MPL, the GPL or the LGPL.
1002
+ *
1003
+ * ***** END LICENSE BLOCK ***** */
1004
+
1005
+ define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1006
+ "use strict";
1007
+
1008
+ var Range = require("../../range").Range;
1009
+
1010
+ var FoldMode = exports.FoldMode = function() {};
1011
+
1012
+ (function() {
1013
+
1014
+ this.foldingStartMarker = null;
1015
+ this.foldingStopMarker = null;
1016
+
1017
+ // must return "" if there's no fold, to enable caching
1018
+ this.getFoldWidget = function(session, foldStyle, row) {
1019
+ var line = session.getLine(row);
1020
+ if (this.foldingStartMarker.test(line))
1021
+ return "start";
1022
+ if (foldStyle == "markbeginend"
1023
+ && this.foldingStopMarker
1024
+ && this.foldingStopMarker.test(line))
1025
+ return "end";
1026
+ return "";
1027
+ };
1028
+
1029
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1030
+ return null;
1031
+ };
1032
+
1033
+ this.indentationBlock = function(session, row, column) {
1034
+ var re = /^\s*/;
1035
+ var startRow = row;
1036
+ var endRow = row;
1037
+ var line = session.getLine(row);
1038
+ var startColumn = column || line.length;
1039
+ var startLevel = line.match(re)[0].length;
1040
+ var maxRow = session.getLength()
1041
+
1042
+ while (++row < maxRow) {
1043
+ line = session.getLine(row);
1044
+ var level = line.match(re)[0].length;
1045
+
1046
+ if (level == line.length)
1047
+ continue;
1048
+
1049
+ if (level <= startLevel)
1050
+ break;
1051
+
1052
+ endRow = row;
1053
+ }
1054
+
1055
+ if (endRow > startRow) {
1056
+ var endColumn = session.getLine(endRow).length;
1057
+ return new Range(startRow, startColumn, endRow, endColumn);
1058
+ }
1059
+ };
1060
+
1061
+ this.openingBracketBlock = function(session, bracket, row, column) {
1062
+ var start = {row: row, column: column + 1};
1063
+ var end = session.$findClosingBracket(bracket, start);
1064
+ if (!end)
1065
+ return;
1066
+
1067
+ var fw = session.foldWidgets[end.row];
1068
+ if (fw == null)
1069
+ fw = this.getFoldWidget(session, end.row);
1070
+
1071
+ if (fw == "start") {
1072
+ end.row --;
1073
+ end.column = session.getLine(end.row).length;
1074
+ }
1075
+ return Range.fromPoints(start, end);
1076
+ };
1077
+
1078
+ }).call(FoldMode.prototype);
1079
+
1080
+ });
1081
+ /* ***** BEGIN LICENSE BLOCK *****
1082
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1083
+ *
1084
+ * The contents of this file are subject to the Mozilla Public License Version
1085
+ * 1.1 (the "License"); you may not use this file except in compliance with
1086
+ * the License. You may obtain a copy of the License at
1087
+ * http://www.mozilla.org/MPL/
1088
+ *
1089
+ * Software distributed under the License is distributed on an "AS IS" basis,
1090
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1091
+ * for the specific language governing rights and limitations under the
1092
+ * License.
1093
+ *
1094
+ * The Original Code is Ajax.org Code Editor (ACE).
1095
+ *
1096
+ * The Initial Developer of the Original Code is
1097
+ * Ajax.org B.V.
1098
+ * Portions created by the Initial Developer are Copyright (C) 2010
1099
+ * the Initial Developer. All Rights Reserved.
1100
+ *
1101
+ * Contributor(s):
1102
+ * Fabian Jakobs <fabian AT ajax DOT org>
1103
+ *
1104
+ * Alternatively, the contents of this file may be used under the terms of
1105
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1106
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1107
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1108
+ * of those above. If you wish to allow use of your version of this file only
1109
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1110
+ * use your version of this file under the terms of the MPL, indicate your
1111
+ * decision by deleting the provisions above and replace them with the notice
1112
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1113
+ * the provisions above, a recipient may use your version of this file under
1114
+ * the terms of any one of the MPL, the GPL or the LGPL.
1115
+ *
1116
+ * ***** END LICENSE BLOCK ***** */
1117
+
1118
+ 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) {
1119
+ "use strict";
1120
+
1121
+ var oop = require("../lib/oop");
1122
+ var TextMode = require("./text").Mode;
1123
+ var Tokenizer = require("../tokenizer").Tokenizer;
1124
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
1125
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
1126
+ var Range = require("../range").Range;
1127
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
1128
+ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
1129
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
1130
+
1131
+ var Mode = function() {
1132
+ this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules());
1133
+ this.$outdent = new MatchingBraceOutdent();
1134
+ this.$behaviour = new CstyleBehaviour();
1135
+ this.foldingRules = new CStyleFoldMode();
1136
+ };
1137
+ oop.inherits(Mode, TextMode);
1138
+
1139
+ (function() {
1140
+
1141
+
1142
+ this.toggleCommentLines = function(state, doc, startRow, endRow) {
1143
+ var outdent = true;
1144
+ var re = /^(\s*)\/\//;
1145
+
1146
+ for (var i=startRow; i<= endRow; i++) {
1147
+ if (!re.test(doc.getLine(i))) {
1148
+ outdent = false;
1149
+ break;
1150
+ }
1151
+ }
1152
+
1153
+ if (outdent) {
1154
+ var deleteRange = new Range(0, 0, 0, 0);
1155
+ for (var i=startRow; i<= endRow; i++)
1156
+ {
1157
+ var line = doc.getLine(i);
1158
+ var m = line.match(re);
1159
+ deleteRange.start.row = i;
1160
+ deleteRange.end.row = i;
1161
+ deleteRange.end.column = m[0].length;
1162
+ doc.replace(deleteRange, m[1]);
1163
+ }
1164
+ }
1165
+ else {
1166
+ doc.indentRows(startRow, endRow, "//");
1167
+ }
1168
+ };
1169
+
1170
+ this.getNextLineIndent = function(state, line, tab) {
1171
+ var indent = this.$getIndent(line);
1172
+
1173
+ var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
1174
+ var tokens = tokenizedLine.tokens;
1175
+ var endState = tokenizedLine.state;
1176
+
1177
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
1178
+ return indent;
1179
+ }
1180
+
1181
+ if (state == "start" || state == "regex_allowed") {
1182
+ var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);
1183
+ if (match) {
1184
+ indent += tab;
1185
+ }
1186
+ } else if (state == "doc-start") {
1187
+ if (endState == "start" || state == "regex_allowed") {
1188
+ return "";
1189
+ }
1190
+ var match = line.match(/^\s*(\/?)\*/);
1191
+ if (match) {
1192
+ if (match[1]) {
1193
+ indent += " ";
1194
+ }
1195
+ indent += "* ";
1196
+ }
1197
+ }
1198
+
1199
+ return indent;
1200
+ };
1201
+
1202
+ this.checkOutdent = function(state, line, input) {
1203
+ return this.$outdent.checkOutdent(line, input);
1204
+ };
1205
+
1206
+ this.autoOutdent = function(state, doc, row) {
1207
+ this.$outdent.autoOutdent(doc, row);
1208
+ };
1209
+
1210
+ this.createWorker = function(session) {
1211
+ var worker = new WorkerClient(["ace"], "worker-javascript.js", "ace/mode/javascript_worker", "JavaScriptWorker");
1212
+ worker.attachToDocument(session.getDocument());
1213
+
1214
+ worker.on("jslint", function(results) {
1215
+ var errors = [];
1216
+ for (var i=0; i<results.data.length; i++) {
1217
+ var error = results.data[i];
1218
+ if (error)
1219
+ errors.push({
1220
+ row: error.line-1,
1221
+ column: error.character-1,
1222
+ text: error.reason,
1223
+ type: "warning",
1224
+ lint: error
1225
+ });
1226
+ }
1227
+ session.setAnnotations(errors);
1228
+ });
1229
+
1230
+ worker.on("narcissus", function(e) {
1231
+ session.setAnnotations([e.data]);
1232
+ });
1233
+
1234
+ worker.on("terminate", function() {
1235
+ session.clearAnnotations();
1236
+ });
1237
+
1238
+ return worker;
1239
+ };
1240
+
1241
+ }).call(Mode.prototype);
1242
+
1243
+ exports.Mode = Mode;
1244
+ });
1245
+ /* ***** BEGIN LICENSE BLOCK *****
1246
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1247
+ *
1248
+ * The contents of this file are subject to the Mozilla Public License Version
1249
+ * 1.1 (the "License"); you may not use this file except in compliance with
1250
+ * the License. You may obtain a copy of the License at
1251
+ * http://www.mozilla.org/MPL/
1252
+ *
1253
+ * Software distributed under the License is distributed on an "AS IS" basis,
1254
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1255
+ * for the specific language governing rights and limitations under the
1256
+ * License.
1257
+ *
1258
+ * The Original Code is Ajax.org Code Editor (ACE).
1259
+ *
1260
+ * The Initial Developer of the Original Code is
1261
+ * Ajax.org B.V.
1262
+ * Portions created by the Initial Developer are Copyright (C) 2010
1263
+ * the Initial Developer. All Rights Reserved.
1264
+ *
1265
+ * Contributor(s):
1266
+ * Fabian Jakobs <fabian AT ajax DOT org>
1267
+ * Mihai Sucan <mihai DOT sucan AT gmail DOT com>
1268
+ *
1269
+ * Alternatively, the contents of this file may be used under the terms of
1270
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1271
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1272
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1273
+ * of those above. If you wish to allow use of your version of this file only
1274
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1275
+ * use your version of this file under the terms of the MPL, indicate your
1276
+ * decision by deleting the provisions above and replace them with the notice
1277
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1278
+ * the provisions above, a recipient may use your version of this file under
1279
+ * the terms of any one of the MPL, the GPL or the LGPL.
1280
+ *
1281
+ * ***** END LICENSE BLOCK ***** */
1282
+
1283
+ 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) {
1284
+ "use strict";
1285
+
1286
+ var oop = require("../lib/oop");
1287
+ var lang = require("../lib/lang");
1288
+ var unicode = require("../unicode");
1289
+ var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
1290
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1291
+
1292
+ var JavaScriptHighlightRules = function() {
1293
+
1294
+ // see: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects
1295
+ var globals = lang.arrayToMap(
1296
+ // Constructors
1297
+ ("Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" +
1298
+ // E4X
1299
+ "Namespace|QName|XML|XMLList|" +
1300
+ "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
1301
+ "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
1302
+ // Errors
1303
+ "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
1304
+ "SyntaxError|TypeError|URIError|" +
1305
+ // Non-constructor functions
1306
+ "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" +
1307
+ "isNaN|parseFloat|parseInt|" +
1308
+ // Other
1309
+ "JSON|Math|" +
1310
+ // Pseudo
1311
+ "this|arguments|prototype|window|document"
1312
+ ).split("|")
1313
+ );
1314
+
1315
+ var keywords = lang.arrayToMap(
1316
+ ("break|case|catch|continue|default|delete|do|else|finally|for|function|" +
1317
+ "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|" +
1318
+ "const|yield|import|get|set").split("|")
1319
+ );
1320
+
1321
+ // keywords which can be followed by regular expressions
1322
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield";
1323
+
1324
+ var deprecated = lang.arrayToMap(
1325
+ ("__parent__|__count__|escape|unescape|with|__proto__").split("|")
1326
+ );
1327
+
1328
+ var definitions = lang.arrayToMap(("const|let|var|function").split("|"));
1329
+
1330
+ var buildinConstants = lang.arrayToMap(
1331
+ ("null|Infinity|NaN|undefined").split("|")
1332
+ );
1333
+
1334
+ var futureReserved = lang.arrayToMap(
1335
+ ("class|enum|extends|super|export|implements|private|" +
1336
+ "public|interface|package|protected|static").split("|")
1337
+ );
1338
+
1339
+ // TODO: Unicode escape sequences
1340
+ var identifierRe = "[" + unicode.packages.L + "\\$_]["
1341
+ + unicode.packages.L
1342
+ + unicode.packages.Mn + unicode.packages.Mc
1343
+ + unicode.packages.Nd
1344
+ + unicode.packages.Pc + "\\$_]*\\b";
1345
+
1346
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
1347
+ "u[0-9a-fA-F]{4}|" + // unicode
1348
+ "[0-2][0-7]{0,2}|" + // oct
1349
+ "3[0-6][0-7]?|" + // oct
1350
+ "37[0-7]?|" + // oct
1351
+ "[4-7][0-7]?|" + //oct
1352
+ ".)";
1353
+
1354
+ // regexp must not have capturing parentheses. Use (?:) instead.
1355
+ // regexps are ordered -> the first match is used
1356
+
1357
+ this.$rules = {
1358
+ "start" : [
1359
+ {
1360
+ token : "comment",
1361
+ regex : /\/\/.*$/
1362
+ },
1363
+ DocCommentHighlightRules.getStartRule("doc-start"),
1364
+ {
1365
+ token : "comment", // multi line comment
1366
+ merge : true,
1367
+ regex : /\/\*/,
1368
+ next : "comment"
1369
+ }, {
1370
+ token : "string",
1371
+ regex : "'(?=.)",
1372
+ next : "qstring"
1373
+ }, {
1374
+ token : "string",
1375
+ regex : '"(?=.)',
1376
+ next : "qqstring"
1377
+ }, {
1378
+ token : "constant.numeric", // hex
1379
+ regex : /0[xX][0-9a-fA-F]+\b/
1380
+ }, {
1381
+ token : "constant.numeric", // float
1382
+ regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
1383
+ }, { // match stuff like: Sound.prototype.play = function() { }
1384
+ token : [
1385
+ "storage.type",
1386
+ "punctuation.operator",
1387
+ "support.function",
1388
+ "punctuation.operator",
1389
+ "entity.name.function",
1390
+ "text",
1391
+ "keyword.operator",
1392
+ "text",
1393
+ "storage.type",
1394
+ "text",
1395
+ "paren.lparen"
1396
+ ],
1397
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
1398
+ next: "function_arguments"
1399
+ }, { // match stuff like: Sound.prototype.play = myfunc
1400
+ token : [
1401
+ "storage.type",
1402
+ "punctuation.operator",
1403
+ "support.function",
1404
+ "punctuation.operator",
1405
+ "entity.name.function",
1406
+ "text",
1407
+ "keyword.operator",
1408
+ "text"
1409
+ ],
1410
+ regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)",
1411
+ next: "function_arguments"
1412
+ }, { // match stuff like: Sound.play = function() { }
1413
+ token : [
1414
+ "storage.type",
1415
+ "punctuation.operator",
1416
+ "entity.name.function",
1417
+ "text",
1418
+ "keyword.operator",
1419
+ "text",
1420
+ "storage.type",
1421
+ "text",
1422
+ "paren.lparen"
1423
+ ],
1424
+ regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
1425
+ next: "function_arguments"
1426
+ }, { // match stuff like: play = function() { }
1427
+ token : [
1428
+ "entity.name.function",
1429
+ "text",
1430
+ "keyword.operator",
1431
+ "text",
1432
+ "storage.type",
1433
+ "text",
1434
+ "paren.lparen"
1435
+ ],
1436
+ regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
1437
+ next: "function_arguments"
1438
+ }, { // match regular function like: function myFunc(arg) { }
1439
+ token : [
1440
+ "storage.type",
1441
+ "text",
1442
+ "entity.name.function",
1443
+ "text",
1444
+ "paren.lparen"
1445
+ ],
1446
+ regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
1447
+ next: "function_arguments"
1448
+ }, { // match stuff like: foobar: function() { }
1449
+ token : [
1450
+ "entity.name.function",
1451
+ "text",
1452
+ "punctuation.operator",
1453
+ "text",
1454
+ "storage.type",
1455
+ "text",
1456
+ "paren.lparen"
1457
+ ],
1458
+ regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
1459
+ next: "function_arguments"
1460
+ }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { })
1461
+ token : [
1462
+ "text",
1463
+ "text",
1464
+ "storage.type",
1465
+ "text",
1466
+ "paren.lparen"
1467
+ ],
1468
+ regex : "(:)(\\s*)(function)(\\s*)(\\()",
1469
+ next: "function_arguments"
1470
+ }, {
1471
+ token : "constant.language.boolean",
1472
+ regex : /(?:true|false)\b/
1473
+ }, {
1474
+ token : "keyword",
1475
+ regex : "(?:" + kwBeforeRe + ")\\b",
1476
+ next : "regex_allowed"
1477
+ }, {
1478
+ token : ["punctuation.operator", "support.function"],
1479
+ 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(?=\()/
1480
+ }, {
1481
+ token : ["punctuation.operator", "support.function.dom"],
1482
+ 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(?=\()/
1483
+ }, {
1484
+ token : ["punctuation.operator", "support.constant"],
1485
+ 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/
1486
+ }, {
1487
+ token : ["storage.type", "punctuation.operator", "support.function.firebug"],
1488
+ regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/
1489
+ }, {
1490
+ token : function(value) {
1491
+ if (globals.hasOwnProperty(value))
1492
+ return "variable.language";
1493
+ else if (deprecated.hasOwnProperty(value))
1494
+ return "invalid.deprecated";
1495
+ else if (definitions.hasOwnProperty(value))
1496
+ return "storage.type";
1497
+ else if (keywords.hasOwnProperty(value))
1498
+ return "keyword";
1499
+ else if (buildinConstants.hasOwnProperty(value))
1500
+ return "constant.language";
1501
+ else if (futureReserved.hasOwnProperty(value))
1502
+ return "invalid.illegal";
1503
+ else if (value == "debugger")
1504
+ return "invalid.deprecated";
1505
+ else
1506
+ return "identifier";
1507
+ },
1508
+ regex : identifierRe
1509
+ }, {
1510
+ token : "keyword.operator",
1511
+ regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/,
1512
+ next : "regex_allowed"
1513
+ }, {
1514
+ token : "punctuation.operator",
1515
+ regex : /\?|\:|\,|\;|\./,
1516
+ next : "regex_allowed"
1517
+ }, {
1518
+ token : "paren.lparen",
1519
+ regex : /[\[({]/,
1520
+ next : "regex_allowed"
1521
+ }, {
1522
+ token : "paren.rparen",
1523
+ regex : /[\])}]/
1524
+ }, {
1525
+ token : "keyword.operator",
1526
+ regex : /\/=?/,
1527
+ next : "regex_allowed"
1528
+ }, {
1529
+ token: "comment",
1530
+ regex: /^#!.*$/
1531
+ }, {
1532
+ token : "text",
1533
+ regex : /\s+/
1534
+ }
1535
+ ],
1536
+ // regular expressions are only allowed after certain tokens. This
1537
+ // makes sure we don't mix up regexps with the divison operator
1538
+ "regex_allowed": [
1539
+ DocCommentHighlightRules.getStartRule("doc-start"),
1540
+ {
1541
+ token : "comment", // multi line comment
1542
+ merge : true,
1543
+ regex : "\\/\\*",
1544
+ next : "comment_regex_allowed"
1545
+ }, {
1546
+ token : "comment",
1547
+ regex : "\\/\\/.*$"
1548
+ }, {
1549
+ token: "string.regexp",
1550
+ regex: "\\/",
1551
+ next: "regex",
1552
+ merge: true
1553
+ }, {
1554
+ token : "text",
1555
+ regex : "\\s+"
1556
+ }, {
1557
+ // immediately return to the start mode without matching
1558
+ // anything
1559
+ token: "empty",
1560
+ regex: "",
1561
+ next: "start"
1562
+ }
1563
+ ],
1564
+ "regex": [
1565
+ {
1566
+ token: "regexp.keyword.operator",
1567
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
1568
+ }, {
1569
+ // flag
1570
+ token: "string.regexp",
1571
+ regex: "/\\w*",
1572
+ next: "start",
1573
+ merge: true
1574
+ }, {
1575
+ token: "string.regexp",
1576
+ regex: "[^\\\\/\\[]+",
1577
+ merge: true
1578
+ }, {
1579
+ token: "string.regexp.charachterclass",
1580
+ regex: "\\[",
1581
+ next: "regex_character_class",
1582
+ merge: true
1583
+ }, {
1584
+ token: "empty",
1585
+ regex: "",
1586
+ next: "start"
1587
+ }
1588
+ ],
1589
+ "regex_character_class": [
1590
+ {
1591
+ token: "regexp.keyword.operator",
1592
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
1593
+ }, {
1594
+ token: "string.regexp.charachterclass",
1595
+ regex: "]",
1596
+ next: "regex",
1597
+ merge: true
1598
+ }, {
1599
+ token: "string.regexp.charachterclass",
1600
+ regex: "[^\\\\\\]]+",
1601
+ merge: true
1602
+ }, {
1603
+ token: "empty",
1604
+ regex: "",
1605
+ next: "start"
1606
+ }
1607
+ ],
1608
+ "function_arguments": [
1609
+ {
1610
+ token: "variable.parameter",
1611
+ regex: identifierRe,
1612
+ }, {
1613
+ token: "punctuation.operator",
1614
+ regex: "[, ]+",
1615
+ merge: true
1616
+ }, {
1617
+ token: "punctuation.operator",
1618
+ regex: "$",
1619
+ merge: true
1620
+ }, {
1621
+ token: "empty",
1622
+ regex: "",
1623
+ next: "start"
1624
+ }
1625
+ ],
1626
+ "comment_regex_allowed" : [
1627
+ {
1628
+ token : "comment", // closing comment
1629
+ regex : ".*?\\*\\/",
1630
+ merge : true,
1631
+ next : "regex_allowed"
1632
+ }, {
1633
+ token : "comment", // comment spanning whole line
1634
+ merge : true,
1635
+ regex : ".+"
1636
+ }
1637
+ ],
1638
+ "comment" : [
1639
+ {
1640
+ token : "comment", // closing comment
1641
+ regex : ".*?\\*\\/",
1642
+ merge : true,
1643
+ next : "start"
1644
+ }, {
1645
+ token : "comment", // comment spanning whole line
1646
+ merge : true,
1647
+ regex : ".+"
1648
+ }
1649
+ ],
1650
+ "qqstring" : [
1651
+ {
1652
+ token : "constant.language.escape",
1653
+ regex : escapedRe
1654
+ }, {
1655
+ token : "string",
1656
+ regex : '[^"\\\\]+',
1657
+ merge : true
1658
+ }, {
1659
+ token : "string",
1660
+ regex : "\\\\$",
1661
+ next : "qqstring",
1662
+ merge : true
1663
+ }, {
1664
+ token : "string",
1665
+ regex : '"|$',
1666
+ next : "start",
1667
+ merge : true
1668
+ }
1669
+ ],
1670
+ "qstring" : [
1671
+ {
1672
+ token : "constant.language.escape",
1673
+ regex : escapedRe
1674
+ }, {
1675
+ token : "string",
1676
+ regex : "[^'\\\\]+",
1677
+ merge : true
1678
+ }, {
1679
+ token : "string",
1680
+ regex : "\\\\$",
1681
+ next : "qstring",
1682
+ merge : true
1683
+ }, {
1684
+ token : "string",
1685
+ regex : "'|$",
1686
+ next : "start",
1687
+ merge : true
1688
+ }
1689
+ ]
1690
+ };
1691
+
1692
+ this.embedRules(DocCommentHighlightRules, "doc-",
1693
+ [ DocCommentHighlightRules.getEndRule("start") ]);
1694
+ };
1695
+
1696
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
1697
+
1698
+ exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
1699
+ });
1700
+ /* ***** BEGIN LICENSE BLOCK *****
1701
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1702
+ *
1703
+ * The contents of this file are subject to the Mozilla Public License Version
1704
+ * 1.1 (the "License"); you may not use this file except in compliance with
1705
+ * the License. You may obtain a copy of the License at
1706
+ * http://www.mozilla.org/MPL/
1707
+ *
1708
+ * Software distributed under the License is distributed on an "AS IS" basis,
1709
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1710
+ * for the specific language governing rights and limitations under the
1711
+ * License.
1712
+ *
1713
+ * The Original Code is Ajax.org Code Editor (ACE).
1714
+ *
1715
+ * The Initial Developer of the Original Code is
1716
+ * Ajax.org B.V.
1717
+ * Portions created by the Initial Developer are Copyright (C) 2010
1718
+ * the Initial Developer. All Rights Reserved.
1719
+ *
1720
+ * Contributor(s):
1721
+ * Fabian Jakobs <fabian AT ajax DOT org>
1722
+ *
1723
+ * Alternatively, the contents of this file may be used under the terms of
1724
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1725
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1726
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1727
+ * of those above. If you wish to allow use of your version of this file only
1728
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1729
+ * use your version of this file under the terms of the MPL, indicate your
1730
+ * decision by deleting the provisions above and replace them with the notice
1731
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1732
+ * the provisions above, a recipient may use your version of this file under
1733
+ * the terms of any one of the MPL, the GPL or the LGPL.
1734
+ *
1735
+ * ***** END LICENSE BLOCK ***** */
1736
+
1737
+ define('ace/mode/doc_comment_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
1738
+ "use strict";
1739
+
1740
+ var oop = require("../lib/oop");
1741
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
1742
+
1743
+ var DocCommentHighlightRules = function() {
1744
+
1745
+ this.$rules = {
1746
+ "start" : [ {
1747
+ token : "comment.doc.tag",
1748
+ regex : "@[\\w\\d_]+" // TODO: fix email addresses
1749
+ }, {
1750
+ token : "comment.doc",
1751
+ merge : true,
1752
+ regex : "\\s+"
1753
+ }, {
1754
+ token : "comment.doc",
1755
+ merge : true,
1756
+ regex : "TODO"
1757
+ }, {
1758
+ token : "comment.doc",
1759
+ merge : true,
1760
+ regex : "[^@\\*]+"
1761
+ }, {
1762
+ token : "comment.doc",
1763
+ merge : true,
1764
+ regex : "."
1765
+ }]
1766
+ };
1767
+ };
1768
+
1769
+ oop.inherits(DocCommentHighlightRules, TextHighlightRules);
1770
+
1771
+ DocCommentHighlightRules.getStartRule = function(start) {
1772
+ return {
1773
+ token : "comment.doc", // doc comment
1774
+ merge : true,
1775
+ regex : "\\/\\*(?=\\*)",
1776
+ next : start
1777
+ };
1778
+ };
1779
+
1780
+ DocCommentHighlightRules.getEndRule = function (start) {
1781
+ return {
1782
+ token : "comment.doc", // closing comment
1783
+ merge : true,
1784
+ regex : "\\*\\/",
1785
+ next : start
1786
+ };
1787
+ };
1788
+
1789
+
1790
+ exports.DocCommentHighlightRules = DocCommentHighlightRules;
1791
+
1792
+ });
1793
+ /* ***** BEGIN LICENSE BLOCK *****
1794
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1795
+ *
1796
+ * The contents of this file are subject to the Mozilla Public License Version
1797
+ * 1.1 (the "License"); you may not use this file except in compliance with
1798
+ * the License. You may obtain a copy of the License at
1799
+ * http://www.mozilla.org/MPL/
1800
+ *
1801
+ * Software distributed under the License is distributed on an "AS IS" basis,
1802
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1803
+ * for the specific language governing rights and limitations under the
1804
+ * License.
1805
+ *
1806
+ * The Original Code is Ajax.org Code Editor (ACE).
1807
+ *
1808
+ * The Initial Developer of the Original Code is
1809
+ * Ajax.org B.V.
1810
+ * Portions created by the Initial Developer are Copyright (C) 2010
1811
+ * the Initial Developer. All Rights Reserved.
1812
+ *
1813
+ * Contributor(s):
1814
+ * Fabian Jakobs <fabian AT ajax DOT org>
1815
+ *
1816
+ * Alternatively, the contents of this file may be used under the terms of
1817
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1818
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1819
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1820
+ * of those above. If you wish to allow use of your version of this file only
1821
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1822
+ * use your version of this file under the terms of the MPL, indicate your
1823
+ * decision by deleting the provisions above and replace them with the notice
1824
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1825
+ * the provisions above, a recipient may use your version of this file under
1826
+ * the terms of any one of the MPL, the GPL or the LGPL.
1827
+ *
1828
+ * ***** END LICENSE BLOCK ***** */
1829
+
1830
+ define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
1831
+ "use strict";
1832
+
1833
+ var Range = require("../range").Range;
1834
+
1835
+ var MatchingBraceOutdent = function() {};
1836
+
1837
+ (function() {
1838
+
1839
+ this.checkOutdent = function(line, input) {
1840
+ if (! /^\s+$/.test(line))
1841
+ return false;
1842
+
1843
+ return /^\s*\}/.test(input);
1844
+ };
1845
+
1846
+ this.autoOutdent = function(doc, row) {
1847
+ var line = doc.getLine(row);
1848
+ var match = line.match(/^(\s*\})/);
1849
+
1850
+ if (!match) return 0;
1851
+
1852
+ var column = match[1].length;
1853
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
1854
+
1855
+ if (!openBracePos || openBracePos.row == row) return 0;
1856
+
1857
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
1858
+ doc.replace(new Range(row, 0, row, column-1), indent);
1859
+ };
1860
+
1861
+ this.$getIndent = function(line) {
1862
+ var match = line.match(/^(\s+)/);
1863
+ if (match) {
1864
+ return match[1];
1865
+ }
1866
+
1867
+ return "";
1868
+ };
1869
+
1870
+ }).call(MatchingBraceOutdent.prototype);
1871
+
1872
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
1873
+ });
1874
+ /* ***** BEGIN LICENSE BLOCK *****
1875
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1876
+ *
1877
+ * The contents of this file are subject to the Mozilla Public License Version
1878
+ * 1.1 (the "License"); you may not use this file except in compliance with
1879
+ * the License. You may obtain a copy of the License at
1880
+ * http://www.mozilla.org/MPL/
1881
+ *
1882
+ * Software distributed under the License is distributed on an "AS IS" basis,
1883
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1884
+ * for the specific language governing rights and limitations under the
1885
+ * License.
1886
+ *
1887
+ * The Original Code is Ajax.org Code Editor (ACE).
1888
+ *
1889
+ * The Initial Developer of the Original Code is
1890
+ * Ajax.org B.V.
1891
+ * Portions created by the Initial Developer are Copyright (C) 2010
1892
+ * the Initial Developer. All Rights Reserved.
1893
+ *
1894
+ * Contributor(s):
1895
+ * Fabian Jakobs <fabian AT ajax DOT org>
1896
+ *
1897
+ * Alternatively, the contents of this file may be used under the terms of
1898
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1899
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1900
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1901
+ * of those above. If you wish to allow use of your version of this file only
1902
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1903
+ * use your version of this file under the terms of the MPL, indicate your
1904
+ * decision by deleting the provisions above and replace them with the notice
1905
+ * and other provisions required by the GPL or the LGPL. If you do not delete
1906
+ * the provisions above, a recipient may use your version of this file under
1907
+ * the terms of any one of the MPL, the GPL or the LGPL.
1908
+ *
1909
+ * ***** END LICENSE BLOCK ***** */
1910
+
1911
+ define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
1912
+ "use strict";
1913
+
1914
+ var oop = require("../../lib/oop");
1915
+ var Range = require("../../range").Range;
1916
+ var BaseFoldMode = require("./fold_mode").FoldMode;
1917
+
1918
+ var FoldMode = exports.FoldMode = function() {};
1919
+ oop.inherits(FoldMode, BaseFoldMode);
1920
+
1921
+ (function() {
1922
+
1923
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
1924
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
1925
+
1926
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1927
+ var line = session.getLine(row);
1928
+ var match = line.match(this.foldingStartMarker);
1929
+ if (match) {
1930
+ var i = match.index;
1931
+
1932
+ if (match[1])
1933
+ return this.openingBracketBlock(session, match[1], row, i);
1934
+
1935
+ var range = session.getCommentFoldRange(row, i + match[0].length);
1936
+ range.end.column -= 2;
1937
+ return range;
1938
+ }
1939
+
1940
+ if (foldStyle !== "markbeginend")
1941
+ return;
1942
+
1943
+ var match = line.match(this.foldingStopMarker);
1944
+ if (match) {
1945
+ var i = match.index + match[0].length;
1946
+
1947
+ if (match[2]) {
1948
+ var range = session.getCommentFoldRange(row, i);
1949
+ range.end.column -= 2;
1950
+ return range;
1951
+ }
1952
+
1953
+ var end = {row: row, column: i};
1954
+ var start = session.$findOpeningBracket(match[1], end);
1955
+
1956
+ if (!start)
1957
+ return;
1958
+
1959
+ start.column++;
1960
+ end.column--;
1961
+
1962
+ return Range.fromPoints(start, end);
1963
+ }
1964
+ };
1965
+
1966
+ }).call(FoldMode.prototype);
1967
+
1968
+ });/* ***** BEGIN LICENSE BLOCK *****
1969
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1970
+ *
1971
+ * The contents of this file are subject to the Mozilla Public License Version
1972
+ * 1.1 (the "License"); you may not use this file except in compliance with
1973
+ * the License. You may obtain a copy of the License at
1974
+ * http://www.mozilla.org/MPL/
1975
+ *
1976
+ * Software distributed under the License is distributed on an "AS IS" basis,
1977
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1978
+ * for the specific language governing rights and limitations under the
1979
+ * License.
1980
+ *
1981
+ * The Original Code is Ajax.org Code Editor (ACE).
1982
+ *
1983
+ * The Initial Developer of the Original Code is
1984
+ * Ajax.org B.V.
1985
+ * Portions created by the Initial Developer are Copyright (C) 2010
1986
+ * the Initial Developer. All Rights Reserved.
1987
+ *
1988
+ * Contributor(s):
1989
+ * Fabian Jakobs <fabian AT ajax DOT org>
1990
+ *
1991
+ * Alternatively, the contents of this file may be used under the terms of
1992
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
1993
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1994
+ * in which case the provisions of the GPL or the LGPL are applicable instead
1995
+ * of those above. If you wish to allow use of your version of this file only
1996
+ * under the terms of either the GPL or the LGPL, and not to allow others to
1997
+ * use your version of this file under the terms of the MPL, indicate your
1998
+ * decision by deleting the provisions above and replace them with the notice
1999
+ * and other provisions required by the GPL or the LGPL. If you do not delete
2000
+ * the provisions above, a recipient may use your version of this file under
2001
+ * the terms of any one of the MPL, the GPL or the LGPL.
2002
+ *
2003
+ * ***** END LICENSE BLOCK ***** */
2004
+
2005
+ define('ace/mode/css', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/css_highlight_rules', 'ace/mode/matching_brace_outdent', 'ace/worker/worker_client', 'ace/mode/folding/cstyle'], function(require, exports, module) {
2006
+ "use strict";
2007
+
2008
+ var oop = require("../lib/oop");
2009
+ var TextMode = require("./text").Mode;
2010
+ var Tokenizer = require("../tokenizer").Tokenizer;
2011
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2012
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
2013
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
2014
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
2015
+
2016
+ var Mode = function() {
2017
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
2018
+ this.$outdent = new MatchingBraceOutdent();
2019
+ this.foldingRules = new CStyleFoldMode();
2020
+ };
2021
+ oop.inherits(Mode, TextMode);
2022
+
2023
+ (function() {
2024
+
2025
+ this.foldingRules = "cStyle";
2026
+
2027
+ this.getNextLineIndent = function(state, line, tab) {
2028
+ var indent = this.$getIndent(line);
2029
+
2030
+ // ignore braces in comments
2031
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
2032
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
2033
+ return indent;
2034
+ }
2035
+
2036
+ var match = line.match(/^.*\{\s*$/);
2037
+ if (match) {
2038
+ indent += tab;
2039
+ }
2040
+
2041
+ return indent;
2042
+ };
2043
+
2044
+ this.checkOutdent = function(state, line, input) {
2045
+ return this.$outdent.checkOutdent(line, input);
2046
+ };
2047
+
2048
+ this.autoOutdent = function(state, doc, row) {
2049
+ this.$outdent.autoOutdent(doc, row);
2050
+ };
2051
+
2052
+ this.createWorker = function(session) {
2053
+ var worker = new WorkerClient(["ace"], "worker-css.js", "ace/mode/css_worker", "Worker");
2054
+ worker.attachToDocument(session.getDocument());
2055
+
2056
+ worker.on("csslint", function(e) {
2057
+ var errors = [];
2058
+ e.data.forEach(function(message) {
2059
+ errors.push({
2060
+ row: message.line - 1,
2061
+ column: message.col - 1,
2062
+ text: message.message,
2063
+ type: message.type,
2064
+ lint: message
2065
+ });
2066
+ });
2067
+
2068
+ session.setAnnotations(errors);
2069
+ });
2070
+ return worker;
2071
+ };
2072
+
2073
+ }).call(Mode.prototype);
2074
+
2075
+ exports.Mode = Mode;
2076
+
2077
+ });
2078
+ /* ***** BEGIN LICENSE BLOCK *****
2079
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2080
+ *
2081
+ * The contents of this file are subject to the Mozilla Public License Version
2082
+ * 1.1 (the "License"); you may not use this file except in compliance with
2083
+ * the License. You may obtain a copy of the License at
2084
+ * http://www.mozilla.org/MPL/
2085
+ *
2086
+ * Software distributed under the License is distributed on an "AS IS" basis,
2087
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2088
+ * for the specific language governing rights and limitations under the
2089
+ * License.
2090
+ *
2091
+ * The Original Code is Ajax.org Code Editor (ACE).
2092
+ *
2093
+ * The Initial Developer of the Original Code is
2094
+ * Ajax.org B.V.
2095
+ * Portions created by the Initial Developer are Copyright (C) 2010
2096
+ * the Initial Developer. All Rights Reserved.
2097
+ *
2098
+ * Contributor(s):
2099
+ * Fabian Jakobs <fabian AT ajax DOT org>
2100
+ *
2101
+ * Alternatively, the contents of this file may be used under the terms of
2102
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
2103
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2104
+ * in which case the provisions of the GPL or the LGPL are applicable instead
2105
+ * of those above. If you wish to allow use of your version of this file only
2106
+ * under the terms of either the GPL or the LGPL, and not to allow others to
2107
+ * use your version of this file under the terms of the MPL, indicate your
2108
+ * decision by deleting the provisions above and replace them with the notice
2109
+ * and other provisions required by the GPL or the LGPL. If you do not delete
2110
+ * the provisions above, a recipient may use your version of this file under
2111
+ * the terms of any one of the MPL, the GPL or the LGPL.
2112
+ *
2113
+ * ***** END LICENSE BLOCK ***** */
2114
+
2115
+ define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
2116
+ "use strict";
2117
+
2118
+ var oop = require("../lib/oop");
2119
+ var lang = require("../lib/lang");
2120
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2121
+
2122
+ var CssHighlightRules = function() {
2123
+
2124
+ var properties = lang.arrayToMap(
2125
+ ("animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index").split("|")
2126
+ );
2127
+
2128
+ var functions = lang.arrayToMap(
2129
+ ("rgb|rgba|url|attr|counter|counters").split("|")
2130
+ );
2131
+
2132
+ var constants = lang.arrayToMap(
2133
+ ("absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|font-size|font|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero").split("|")
2134
+ );
2135
+
2136
+ var colors = lang.arrayToMap(
2137
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
2138
+ "purple|red|silver|teal|white|yellow").split("|")
2139
+ );
2140
+
2141
+ var fonts = lang.arrayToMap(
2142
+ ("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
2143
+ "symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
2144
+ "serif|monospace").split("|")
2145
+ );
2146
+
2147
+ // regexp must not have capturing parentheses. Use (?:) instead.
2148
+ // regexps are ordered -> the first match is used
2149
+
2150
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
2151
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
2152
+ var pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
2153
+
2154
+ var base_ruleset = [
2155
+ {
2156
+ token : "comment", // multi line comment
2157
+ merge : true,
2158
+ regex : "\\/\\*",
2159
+ next : "ruleset_comment"
2160
+ }, {
2161
+ token : "string", // single line
2162
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
2163
+ }, {
2164
+ token : "string", // single line
2165
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
2166
+ }, {
2167
+ token : ["constant.numeric", "keyword"],
2168
+ regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
2169
+ }, {
2170
+ token : ["constant.numeric"],
2171
+ regex : "([0-9]+)"
2172
+ }, {
2173
+ token : "constant.numeric", // hex6 color
2174
+ regex : "#[a-f0-9]{6}"
2175
+ }, {
2176
+ token : "constant.numeric", // hex3 color
2177
+ regex : "#[a-f0-9]{3}"
2178
+ }, {
2179
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
2180
+ regex : pseudoElements
2181
+ }, {
2182
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
2183
+ regex : pseudoClasses
2184
+ }, {
2185
+ token : function(value) {
2186
+ if (properties.hasOwnProperty(value.toLowerCase())) {
2187
+ return "support.type";
2188
+ }
2189
+ else if (functions.hasOwnProperty(value.toLowerCase())) {
2190
+ return "support.function";
2191
+ }
2192
+ else if (constants.hasOwnProperty(value.toLowerCase())) {
2193
+ return "support.constant";
2194
+ }
2195
+ else if (colors.hasOwnProperty(value.toLowerCase())) {
2196
+ return "support.constant.color";
2197
+ }
2198
+ else if (fonts.hasOwnProperty(value.toLowerCase())) {
2199
+ return "support.constant.fonts";
2200
+ }
2201
+ else {
2202
+ return "text";
2203
+ }
2204
+ },
2205
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
2206
+ }
2207
+ ];
2208
+
2209
+ var ruleset = lang.copyArray(base_ruleset);
2210
+ ruleset.unshift({
2211
+ token : "paren.rparen",
2212
+ regex : "\\}",
2213
+ next: "start"
2214
+ });
2215
+
2216
+ var media_ruleset = lang.copyArray( base_ruleset );
2217
+ media_ruleset.unshift({
2218
+ token : "paren.rparen",
2219
+ regex : "\\}",
2220
+ next: "media"
2221
+ });
2222
+
2223
+ var base_comment = [{
2224
+ token : "comment", // comment spanning whole line
2225
+ merge : true,
2226
+ regex : ".+"
2227
+ }];
2228
+
2229
+ var comment = lang.copyArray(base_comment);
2230
+ comment.unshift({
2231
+ token : "comment", // closing comment
2232
+ regex : ".*?\\*\\/",
2233
+ next : "start"
2234
+ });
2235
+
2236
+ var media_comment = lang.copyArray(base_comment);
2237
+ media_comment.unshift({
2238
+ token : "comment", // closing comment
2239
+ regex : ".*?\\*\\/",
2240
+ next : "media"
2241
+ });
2242
+
2243
+ var ruleset_comment = lang.copyArray(base_comment);
2244
+ ruleset_comment.unshift({
2245
+ token : "comment", // closing comment
2246
+ regex : ".*?\\*\\/",
2247
+ next : "ruleset"
2248
+ });
2249
+
2250
+ this.$rules = {
2251
+ "start" : [{
2252
+ token : "comment", // multi line comment
2253
+ merge : true,
2254
+ regex : "\\/\\*",
2255
+ next : "comment"
2256
+ }, {
2257
+ token: "paren.lparen",
2258
+ regex: "\\{",
2259
+ next: "ruleset"
2260
+ }, {
2261
+ token: "string",
2262
+ regex: "@.*?{",
2263
+ next: "media"
2264
+ },{
2265
+ token: "keyword",
2266
+ regex: "#[a-z0-9-_]+"
2267
+ },{
2268
+ token: "variable",
2269
+ regex: "\\.[a-z0-9-_]+"
2270
+ },{
2271
+ token: "string",
2272
+ regex: ":[a-z0-9-_]+"
2273
+ },{
2274
+ token: "constant",
2275
+ regex: "[a-z0-9-_]+"
2276
+ }],
2277
+
2278
+ "media" : [ {
2279
+ token : "comment", // multi line comment
2280
+ merge : true,
2281
+ regex : "\\/\\*",
2282
+ next : "media_comment"
2283
+ }, {
2284
+ token: "paren.lparen",
2285
+ regex: "\\{",
2286
+ next: "media_ruleset"
2287
+ },{
2288
+ token: "string",
2289
+ regex: "\\}",
2290
+ next: "start"
2291
+ },{
2292
+ token: "keyword",
2293
+ regex: "#[a-z0-9-_]+"
2294
+ },{
2295
+ token: "variable",
2296
+ regex: "\\.[a-z0-9-_]+"
2297
+ },{
2298
+ token: "string",
2299
+ regex: ":[a-z0-9-_]+"
2300
+ },{
2301
+ token: "constant",
2302
+ regex: "[a-z0-9-_]+"
2303
+ }],
2304
+
2305
+ "comment" : comment,
2306
+
2307
+ "ruleset" : ruleset,
2308
+ "ruleset_comment" : ruleset_comment,
2309
+
2310
+ "media_ruleset" : media_ruleset,
2311
+ "media_comment" : media_comment
2312
+ };
2313
+ };
2314
+
2315
+ oop.inherits(CssHighlightRules, TextHighlightRules);
2316
+
2317
+ exports.CssHighlightRules = CssHighlightRules;
2318
+
2319
+ });
2320
+ /* ***** BEGIN LICENSE BLOCK *****
2321
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
2322
+ *
2323
+ * The contents of this file are subject to the Mozilla Public License Version
2324
+ * 1.1 (the "License"); you may not use this file except in compliance with
2325
+ * the License. You may obtain a copy of the License at
2326
+ * http://www.mozilla.org/MPL/
2327
+ *
2328
+ * Software distributed under the License is distributed on an "AS IS" basis,
2329
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
2330
+ * for the specific language governing rights and limitations under the
2331
+ * License.
2332
+ *
2333
+ * The Original Code is Ajax.org Code Editor (ACE).
2334
+ *
2335
+ * The Initial Developer of the Original Code is
2336
+ * Ajax.org B.V.
2337
+ * Portions created by the Initial Developer are Copyright (C) 2010
2338
+ * the Initial Developer. All Rights Reserved.
2339
+ *
2340
+ * Contributor(s):
2341
+ * Fabian Jakobs <fabian AT ajax DOT org>
2342
+ *
2343
+ * Alternatively, the contents of this file may be used under the terms of
2344
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
2345
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
2346
+ * in which case the provisions of the GPL or the LGPL are applicable instead
2347
+ * of those above. If you wish to allow use of your version of this file only
2348
+ * under the terms of either the GPL or the LGPL, and not to allow others to
2349
+ * use your version of this file under the terms of the MPL, indicate your
2350
+ * decision by deleting the provisions above and replace them with the notice
2351
+ * and other provisions required by the GPL or the LGPL. If you do not delete
2352
+ * the provisions above, a recipient may use your version of this file under
2353
+ * the terms of any one of the MPL, the GPL or the LGPL.
2354
+ *
2355
+ * ***** END LICENSE BLOCK ***** */
2356
+
2357
+ define('ace/mode/coldfusion_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/css_highlight_rules', 'ace/mode/javascript_highlight_rules', 'ace/mode/text_highlight_rules', 'ace/mode/xml_util'], function(require, exports, module) {
2358
+ "use strict";
2359
+
2360
+ var oop = require("../lib/oop");
2361
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
2362
+ var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
2363
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
2364
+ var xml_util = require("./xml_util");
2365
+
2366
+ var ColdfusionHighlightRules = function() {
2367
+
2368
+ // regexp must not have capturing parentheses
2369
+ // regexps are ordered -> the first match is used
2370
+
2371
+ this.$rules = {
2372
+ start : [ {
2373
+ token : "text",
2374
+ merge : true,
2375
+ regex : "<\\!\\[CDATA\\[",
2376
+ next : "cdata"
2377
+ }, {
2378
+ token : "xml_pe",
2379
+ regex : "<\\?.*?\\?>"
2380
+ }, {
2381
+ token : "comment",
2382
+ merge : true,
2383
+ regex : "<\\!--",
2384
+ next : "comment"
2385
+ }, {
2386
+ token : "meta.tag",
2387
+ regex : "<(?=\s*script)",
2388
+ next : "script"
2389
+ }, {
2390
+ token : "meta.tag",
2391
+ regex : "<(?=\s*style)",
2392
+ next : "style"
2393
+ }, {
2394
+ token : "meta.tag", // opening tag
2395
+ regex : "<\\/?",
2396
+ next : "tag"
2397
+ }, {
2398
+ token : "text",
2399
+ regex : "\\s+"
2400
+ }, {
2401
+ token : "text",
2402
+ regex : "[^<]+"
2403
+ } ],
2404
+
2405
+ cdata : [ {
2406
+ token : "text",
2407
+ regex : "\\]\\]>",
2408
+ next : "start"
2409
+ }, {
2410
+ token : "text",
2411
+ merge : true,
2412
+ regex : "\\s+"
2413
+ }, {
2414
+ token : "text",
2415
+ merge : true,
2416
+ regex : ".+"
2417
+ } ],
2418
+
2419
+ comment : [ {
2420
+ token : "comment",
2421
+ regex : ".*?-->",
2422
+ next : "start"
2423
+ }, {
2424
+ token : "comment",
2425
+ merge : true,
2426
+ regex : ".+"
2427
+ } ]
2428
+ };
2429
+
2430
+ xml_util.tag(this.$rules, "tag", "start");
2431
+ xml_util.tag(this.$rules, "style", "css-start");
2432
+ xml_util.tag(this.$rules, "script", "js-start");
2433
+
2434
+ this.embedRules(JavaScriptHighlightRules, "js-", [{
2435
+ token: "comment",
2436
+ regex: "\\/\\/.*(?=<\\/script>)",
2437
+ next: "tag"
2438
+ }, {
2439
+ token: "meta.tag",
2440
+ regex: "<\\/(?=script)",
2441
+ next: "tag"
2442
+ }]);
2443
+
2444
+ this.embedRules(CssHighlightRules, "css-", [{
2445
+ token: "meta.tag",
2446
+ regex: "<\\/(?=style)",
2447
+ next: "tag"
2448
+ }]);
2449
+ };
2450
+
2451
+ oop.inherits(ColdfusionHighlightRules, TextHighlightRules);
2452
+
2453
+ exports.ColdfusionHighlightRules = ColdfusionHighlightRules;
2454
+ });