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