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,640 @@
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/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) {
39
+ "use strict";
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
45
+ var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
46
+ var WorkerClient = require("../worker/worker_client").WorkerClient;
47
+ var CStyleFoldMode = require("./folding/cstyle").FoldMode;
48
+
49
+ var Mode = function() {
50
+ this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i");
51
+ this.$outdent = new MatchingBraceOutdent();
52
+ this.foldingRules = new CStyleFoldMode();
53
+ };
54
+ oop.inherits(Mode, TextMode);
55
+
56
+ (function() {
57
+
58
+ this.foldingRules = "cStyle";
59
+
60
+ this.getNextLineIndent = function(state, line, tab) {
61
+ var indent = this.$getIndent(line);
62
+
63
+ // ignore braces in comments
64
+ var tokens = this.$tokenizer.getLineTokens(line, state).tokens;
65
+ if (tokens.length && tokens[tokens.length-1].type == "comment") {
66
+ return indent;
67
+ }
68
+
69
+ var match = line.match(/^.*\{\s*$/);
70
+ if (match) {
71
+ indent += tab;
72
+ }
73
+
74
+ return indent;
75
+ };
76
+
77
+ this.checkOutdent = function(state, line, input) {
78
+ return this.$outdent.checkOutdent(line, input);
79
+ };
80
+
81
+ this.autoOutdent = function(state, doc, row) {
82
+ this.$outdent.autoOutdent(doc, row);
83
+ };
84
+
85
+ this.createWorker = function(session) {
86
+ var worker = new WorkerClient(["ace"], "worker-css.js", "ace/mode/css_worker", "Worker");
87
+ worker.attachToDocument(session.getDocument());
88
+
89
+ worker.on("csslint", function(e) {
90
+ var errors = [];
91
+ e.data.forEach(function(message) {
92
+ errors.push({
93
+ row: message.line - 1,
94
+ column: message.col - 1,
95
+ text: message.message,
96
+ type: message.type,
97
+ lint: message
98
+ });
99
+ });
100
+
101
+ session.setAnnotations(errors);
102
+ });
103
+ return worker;
104
+ };
105
+
106
+ }).call(Mode.prototype);
107
+
108
+ exports.Mode = Mode;
109
+
110
+ });
111
+ /* ***** BEGIN LICENSE BLOCK *****
112
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
113
+ *
114
+ * The contents of this file are subject to the Mozilla Public License Version
115
+ * 1.1 (the "License"); you may not use this file except in compliance with
116
+ * the License. You may obtain a copy of the License at
117
+ * http://www.mozilla.org/MPL/
118
+ *
119
+ * Software distributed under the License is distributed on an "AS IS" basis,
120
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
121
+ * for the specific language governing rights and limitations under the
122
+ * License.
123
+ *
124
+ * The Original Code is Ajax.org Code Editor (ACE).
125
+ *
126
+ * The Initial Developer of the Original Code is
127
+ * Ajax.org B.V.
128
+ * Portions created by the Initial Developer are Copyright (C) 2010
129
+ * the Initial Developer. All Rights Reserved.
130
+ *
131
+ * Contributor(s):
132
+ * Fabian Jakobs <fabian AT ajax DOT org>
133
+ *
134
+ * Alternatively, the contents of this file may be used under the terms of
135
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
136
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
137
+ * in which case the provisions of the GPL or the LGPL are applicable instead
138
+ * of those above. If you wish to allow use of your version of this file only
139
+ * under the terms of either the GPL or the LGPL, and not to allow others to
140
+ * use your version of this file under the terms of the MPL, indicate your
141
+ * decision by deleting the provisions above and replace them with the notice
142
+ * and other provisions required by the GPL or the LGPL. If you do not delete
143
+ * the provisions above, a recipient may use your version of this file under
144
+ * the terms of any one of the MPL, the GPL or the LGPL.
145
+ *
146
+ * ***** END LICENSE BLOCK ***** */
147
+
148
+ ace.define('ace/mode/css_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
149
+ "use strict";
150
+
151
+ var oop = require("../lib/oop");
152
+ var lang = require("../lib/lang");
153
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
154
+
155
+ var CssHighlightRules = function() {
156
+
157
+ var properties = lang.arrayToMap(
158
+ ("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("|")
159
+ );
160
+
161
+ var functions = lang.arrayToMap(
162
+ ("rgb|rgba|url|attr|counter|counters").split("|")
163
+ );
164
+
165
+ var constants = lang.arrayToMap(
166
+ ("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("|")
167
+ );
168
+
169
+ var colors = lang.arrayToMap(
170
+ ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" +
171
+ "purple|red|silver|teal|white|yellow").split("|")
172
+ );
173
+
174
+ var fonts = lang.arrayToMap(
175
+ ("arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|" +
176
+ "symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|" +
177
+ "serif|monospace").split("|")
178
+ );
179
+
180
+ // regexp must not have capturing parentheses. Use (?:) instead.
181
+ // regexps are ordered -> the first match is used
182
+
183
+ var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
184
+ var pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
185
+ 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";
186
+
187
+ var base_ruleset = [
188
+ {
189
+ token : "comment", // multi line comment
190
+ merge : true,
191
+ regex : "\\/\\*",
192
+ next : "ruleset_comment"
193
+ }, {
194
+ token : "string", // single line
195
+ regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
196
+ }, {
197
+ token : "string", // single line
198
+ regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
199
+ }, {
200
+ token : ["constant.numeric", "keyword"],
201
+ 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|%)"
202
+ }, {
203
+ token : ["constant.numeric"],
204
+ regex : "([0-9]+)"
205
+ }, {
206
+ token : "constant.numeric", // hex6 color
207
+ regex : "#[a-f0-9]{6}"
208
+ }, {
209
+ token : "constant.numeric", // hex3 color
210
+ regex : "#[a-f0-9]{3}"
211
+ }, {
212
+ token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
213
+ regex : pseudoElements
214
+ }, {
215
+ token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
216
+ regex : pseudoClasses
217
+ }, {
218
+ token : function(value) {
219
+ if (properties.hasOwnProperty(value.toLowerCase())) {
220
+ return "support.type";
221
+ }
222
+ else if (functions.hasOwnProperty(value.toLowerCase())) {
223
+ return "support.function";
224
+ }
225
+ else if (constants.hasOwnProperty(value.toLowerCase())) {
226
+ return "support.constant";
227
+ }
228
+ else if (colors.hasOwnProperty(value.toLowerCase())) {
229
+ return "support.constant.color";
230
+ }
231
+ else if (fonts.hasOwnProperty(value.toLowerCase())) {
232
+ return "support.constant.fonts";
233
+ }
234
+ else {
235
+ return "text";
236
+ }
237
+ },
238
+ regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
239
+ }
240
+ ];
241
+
242
+ var ruleset = lang.copyArray(base_ruleset);
243
+ ruleset.unshift({
244
+ token : "paren.rparen",
245
+ regex : "\\}",
246
+ next: "start"
247
+ });
248
+
249
+ var media_ruleset = lang.copyArray( base_ruleset );
250
+ media_ruleset.unshift({
251
+ token : "paren.rparen",
252
+ regex : "\\}",
253
+ next: "media"
254
+ });
255
+
256
+ var base_comment = [{
257
+ token : "comment", // comment spanning whole line
258
+ merge : true,
259
+ regex : ".+"
260
+ }];
261
+
262
+ var comment = lang.copyArray(base_comment);
263
+ comment.unshift({
264
+ token : "comment", // closing comment
265
+ regex : ".*?\\*\\/",
266
+ next : "start"
267
+ });
268
+
269
+ var media_comment = lang.copyArray(base_comment);
270
+ media_comment.unshift({
271
+ token : "comment", // closing comment
272
+ regex : ".*?\\*\\/",
273
+ next : "media"
274
+ });
275
+
276
+ var ruleset_comment = lang.copyArray(base_comment);
277
+ ruleset_comment.unshift({
278
+ token : "comment", // closing comment
279
+ regex : ".*?\\*\\/",
280
+ next : "ruleset"
281
+ });
282
+
283
+ this.$rules = {
284
+ "start" : [{
285
+ token : "comment", // multi line comment
286
+ merge : true,
287
+ regex : "\\/\\*",
288
+ next : "comment"
289
+ }, {
290
+ token: "paren.lparen",
291
+ regex: "\\{",
292
+ next: "ruleset"
293
+ }, {
294
+ token: "string",
295
+ regex: "@.*?{",
296
+ next: "media"
297
+ },{
298
+ token: "keyword",
299
+ regex: "#[a-z0-9-_]+"
300
+ },{
301
+ token: "variable",
302
+ regex: "\\.[a-z0-9-_]+"
303
+ },{
304
+ token: "string",
305
+ regex: ":[a-z0-9-_]+"
306
+ },{
307
+ token: "constant",
308
+ regex: "[a-z0-9-_]+"
309
+ }],
310
+
311
+ "media" : [ {
312
+ token : "comment", // multi line comment
313
+ merge : true,
314
+ regex : "\\/\\*",
315
+ next : "media_comment"
316
+ }, {
317
+ token: "paren.lparen",
318
+ regex: "\\{",
319
+ next: "media_ruleset"
320
+ },{
321
+ token: "string",
322
+ regex: "\\}",
323
+ next: "start"
324
+ },{
325
+ token: "keyword",
326
+ regex: "#[a-z0-9-_]+"
327
+ },{
328
+ token: "variable",
329
+ regex: "\\.[a-z0-9-_]+"
330
+ },{
331
+ token: "string",
332
+ regex: ":[a-z0-9-_]+"
333
+ },{
334
+ token: "constant",
335
+ regex: "[a-z0-9-_]+"
336
+ }],
337
+
338
+ "comment" : comment,
339
+
340
+ "ruleset" : ruleset,
341
+ "ruleset_comment" : ruleset_comment,
342
+
343
+ "media_ruleset" : media_ruleset,
344
+ "media_comment" : media_comment
345
+ };
346
+ };
347
+
348
+ oop.inherits(CssHighlightRules, TextHighlightRules);
349
+
350
+ exports.CssHighlightRules = CssHighlightRules;
351
+
352
+ });
353
+ /* ***** BEGIN LICENSE BLOCK *****
354
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
355
+ *
356
+ * The contents of this file are subject to the Mozilla Public License Version
357
+ * 1.1 (the "License"); you may not use this file except in compliance with
358
+ * the License. You may obtain a copy of the License at
359
+ * http://www.mozilla.org/MPL/
360
+ *
361
+ * Software distributed under the License is distributed on an "AS IS" basis,
362
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
363
+ * for the specific language governing rights and limitations under the
364
+ * License.
365
+ *
366
+ * The Original Code is Ajax.org Code Editor (ACE).
367
+ *
368
+ * The Initial Developer of the Original Code is
369
+ * Ajax.org B.V.
370
+ * Portions created by the Initial Developer are Copyright (C) 2010
371
+ * the Initial Developer. All Rights Reserved.
372
+ *
373
+ * Contributor(s):
374
+ * Fabian Jakobs <fabian AT ajax DOT org>
375
+ *
376
+ * Alternatively, the contents of this file may be used under the terms of
377
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
378
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
379
+ * in which case the provisions of the GPL or the LGPL are applicable instead
380
+ * of those above. If you wish to allow use of your version of this file only
381
+ * under the terms of either the GPL or the LGPL, and not to allow others to
382
+ * use your version of this file under the terms of the MPL, indicate your
383
+ * decision by deleting the provisions above and replace them with the notice
384
+ * and other provisions required by the GPL or the LGPL. If you do not delete
385
+ * the provisions above, a recipient may use your version of this file under
386
+ * the terms of any one of the MPL, the GPL or the LGPL.
387
+ *
388
+ * ***** END LICENSE BLOCK ***** */
389
+
390
+ ace.define('ace/mode/matching_brace_outdent', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
391
+ "use strict";
392
+
393
+ var Range = require("../range").Range;
394
+
395
+ var MatchingBraceOutdent = function() {};
396
+
397
+ (function() {
398
+
399
+ this.checkOutdent = function(line, input) {
400
+ if (! /^\s+$/.test(line))
401
+ return false;
402
+
403
+ return /^\s*\}/.test(input);
404
+ };
405
+
406
+ this.autoOutdent = function(doc, row) {
407
+ var line = doc.getLine(row);
408
+ var match = line.match(/^(\s*\})/);
409
+
410
+ if (!match) return 0;
411
+
412
+ var column = match[1].length;
413
+ var openBracePos = doc.findMatchingBracket({row: row, column: column});
414
+
415
+ if (!openBracePos || openBracePos.row == row) return 0;
416
+
417
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
418
+ doc.replace(new Range(row, 0, row, column-1), indent);
419
+ };
420
+
421
+ this.$getIndent = function(line) {
422
+ var match = line.match(/^(\s+)/);
423
+ if (match) {
424
+ return match[1];
425
+ }
426
+
427
+ return "";
428
+ };
429
+
430
+ }).call(MatchingBraceOutdent.prototype);
431
+
432
+ exports.MatchingBraceOutdent = MatchingBraceOutdent;
433
+ });
434
+ /* ***** BEGIN LICENSE BLOCK *****
435
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
436
+ *
437
+ * The contents of this file are subject to the Mozilla Public License Version
438
+ * 1.1 (the "License"); you may not use this file except in compliance with
439
+ * the License. You may obtain a copy of the License at
440
+ * http://www.mozilla.org/MPL/
441
+ *
442
+ * Software distributed under the License is distributed on an "AS IS" basis,
443
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
444
+ * for the specific language governing rights and limitations under the
445
+ * License.
446
+ *
447
+ * The Original Code is Ajax.org Code Editor (ACE).
448
+ *
449
+ * The Initial Developer of the Original Code is
450
+ * Ajax.org B.V.
451
+ * Portions created by the Initial Developer are Copyright (C) 2010
452
+ * the Initial Developer. All Rights Reserved.
453
+ *
454
+ * Contributor(s):
455
+ * Fabian Jakobs <fabian AT ajax DOT org>
456
+ *
457
+ * Alternatively, the contents of this file may be used under the terms of
458
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
459
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
460
+ * in which case the provisions of the GPL or the LGPL are applicable instead
461
+ * of those above. If you wish to allow use of your version of this file only
462
+ * under the terms of either the GPL or the LGPL, and not to allow others to
463
+ * use your version of this file under the terms of the MPL, indicate your
464
+ * decision by deleting the provisions above and replace them with the notice
465
+ * and other provisions required by the GPL or the LGPL. If you do not delete
466
+ * the provisions above, a recipient may use your version of this file under
467
+ * the terms of any one of the MPL, the GPL or the LGPL.
468
+ *
469
+ * ***** END LICENSE BLOCK ***** */
470
+
471
+ ace.define('ace/mode/folding/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/range', 'ace/mode/folding/fold_mode'], function(require, exports, module) {
472
+ "use strict";
473
+
474
+ var oop = require("../../lib/oop");
475
+ var Range = require("../../range").Range;
476
+ var BaseFoldMode = require("./fold_mode").FoldMode;
477
+
478
+ var FoldMode = exports.FoldMode = function() {};
479
+ oop.inherits(FoldMode, BaseFoldMode);
480
+
481
+ (function() {
482
+
483
+ this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
484
+ this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
485
+
486
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
487
+ var line = session.getLine(row);
488
+ var match = line.match(this.foldingStartMarker);
489
+ if (match) {
490
+ var i = match.index;
491
+
492
+ if (match[1])
493
+ return this.openingBracketBlock(session, match[1], row, i);
494
+
495
+ var range = session.getCommentFoldRange(row, i + match[0].length);
496
+ range.end.column -= 2;
497
+ return range;
498
+ }
499
+
500
+ if (foldStyle !== "markbeginend")
501
+ return;
502
+
503
+ var match = line.match(this.foldingStopMarker);
504
+ if (match) {
505
+ var i = match.index + match[0].length;
506
+
507
+ if (match[2]) {
508
+ var range = session.getCommentFoldRange(row, i);
509
+ range.end.column -= 2;
510
+ return range;
511
+ }
512
+
513
+ var end = {row: row, column: i};
514
+ var start = session.$findOpeningBracket(match[1], end);
515
+
516
+ if (!start)
517
+ return;
518
+
519
+ start.column++;
520
+ end.column--;
521
+
522
+ return Range.fromPoints(start, end);
523
+ }
524
+ };
525
+
526
+ }).call(FoldMode.prototype);
527
+
528
+ });/* ***** BEGIN LICENSE BLOCK *****
529
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
530
+ *
531
+ * The contents of this file are subject to the Mozilla Public License Version
532
+ * 1.1 (the "License"); you may not use this file except in compliance with
533
+ * the License. You may obtain a copy of the License at
534
+ * http://www.mozilla.org/MPL/
535
+ *
536
+ * Software distributed under the License is distributed on an "AS IS" basis,
537
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
538
+ * for the specific language governing rights and limitations under the
539
+ * License.
540
+ *
541
+ * The Original Code is Ajax.org Code Editor (ACE).
542
+ *
543
+ * The Initial Developer of the Original Code is
544
+ * Ajax.org B.V.
545
+ * Portions created by the Initial Developer are Copyright (C) 2010
546
+ * the Initial Developer. All Rights Reserved.
547
+ *
548
+ * Contributor(s):
549
+ * Fabian Jakobs <fabian AT ajax DOT org>
550
+ *
551
+ * Alternatively, the contents of this file may be used under the terms of
552
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
553
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
554
+ * in which case the provisions of the GPL or the LGPL are applicable instead
555
+ * of those above. If you wish to allow use of your version of this file only
556
+ * under the terms of either the GPL or the LGPL, and not to allow others to
557
+ * use your version of this file under the terms of the MPL, indicate your
558
+ * decision by deleting the provisions above and replace them with the notice
559
+ * and other provisions required by the GPL or the LGPL. If you do not delete
560
+ * the provisions above, a recipient may use your version of this file under
561
+ * the terms of any one of the MPL, the GPL or the LGPL.
562
+ *
563
+ * ***** END LICENSE BLOCK ***** */
564
+
565
+ ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
566
+ "use strict";
567
+
568
+ var Range = require("../../range").Range;
569
+
570
+ var FoldMode = exports.FoldMode = function() {};
571
+
572
+ (function() {
573
+
574
+ this.foldingStartMarker = null;
575
+ this.foldingStopMarker = null;
576
+
577
+ // must return "" if there's no fold, to enable caching
578
+ this.getFoldWidget = function(session, foldStyle, row) {
579
+ var line = session.getLine(row);
580
+ if (this.foldingStartMarker.test(line))
581
+ return "start";
582
+ if (foldStyle == "markbeginend"
583
+ && this.foldingStopMarker
584
+ && this.foldingStopMarker.test(line))
585
+ return "end";
586
+ return "";
587
+ };
588
+
589
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
590
+ return null;
591
+ };
592
+
593
+ this.indentationBlock = function(session, row, column) {
594
+ var re = /^\s*/;
595
+ var startRow = row;
596
+ var endRow = row;
597
+ var line = session.getLine(row);
598
+ var startColumn = column || line.length;
599
+ var startLevel = line.match(re)[0].length;
600
+ var maxRow = session.getLength()
601
+
602
+ while (++row < maxRow) {
603
+ line = session.getLine(row);
604
+ var level = line.match(re)[0].length;
605
+
606
+ if (level == line.length)
607
+ continue;
608
+
609
+ if (level <= startLevel)
610
+ break;
611
+
612
+ endRow = row;
613
+ }
614
+
615
+ if (endRow > startRow) {
616
+ var endColumn = session.getLine(endRow).length;
617
+ return new Range(startRow, startColumn, endRow, endColumn);
618
+ }
619
+ };
620
+
621
+ this.openingBracketBlock = function(session, bracket, row, column) {
622
+ var start = {row: row, column: column + 1};
623
+ var end = session.$findClosingBracket(bracket, start);
624
+ if (!end)
625
+ return;
626
+
627
+ var fw = session.foldWidgets[end.row];
628
+ if (fw == null)
629
+ fw = this.getFoldWidget(session, end.row);
630
+
631
+ if (fw == "start") {
632
+ end.row --;
633
+ end.column = session.getLine(end.row).length;
634
+ }
635
+ return Range.fromPoints(start, end);
636
+ };
637
+
638
+ }).call(FoldMode.prototype);
639
+
640
+ });