daftos 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
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,1009 @@
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/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/text', 'ace/tokenizer', 'ace/mode/xml_highlight_rules', 'ace/mode/behaviour/xml', 'ace/mode/folding/xml'], function(require, exports, module) {
39
+ "use strict";
40
+
41
+ var oop = require("../lib/oop");
42
+ var TextMode = require("./text").Mode;
43
+ var Tokenizer = require("../tokenizer").Tokenizer;
44
+ var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
45
+ var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
46
+ var XmlFoldMode = require("./folding/xml").FoldMode;
47
+
48
+ var Mode = function() {
49
+ this.$tokenizer = new Tokenizer(new XmlHighlightRules().getRules());
50
+ this.$behaviour = new XmlBehaviour();
51
+ this.foldingRules = new XmlFoldMode();
52
+ };
53
+
54
+ oop.inherits(Mode, TextMode);
55
+
56
+ (function() {
57
+
58
+ this.getNextLineIndent = function(state, line, tab) {
59
+ return this.$getIndent(line);
60
+ };
61
+
62
+ }).call(Mode.prototype);
63
+
64
+ exports.Mode = Mode;
65
+ });
66
+ /* ***** BEGIN LICENSE BLOCK *****
67
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
68
+ *
69
+ * The contents of this file are subject to the Mozilla Public License Version
70
+ * 1.1 (the "License"); you may not use this file except in compliance with
71
+ * the License. You may obtain a copy of the License at
72
+ * http://www.mozilla.org/MPL/
73
+ *
74
+ * Software distributed under the License is distributed on an "AS IS" basis,
75
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
76
+ * for the specific language governing rights and limitations under the
77
+ * License.
78
+ *
79
+ * The Original Code is Ajax.org Code Editor (ACE).
80
+ *
81
+ * The Initial Developer of the Original Code is
82
+ * Ajax.org B.V.
83
+ * Portions created by the Initial Developer are Copyright (C) 2010
84
+ * the Initial Developer. All Rights Reserved.
85
+ *
86
+ * Contributor(s):
87
+ * Fabian Jakobs <fabian AT ajax DOT org>
88
+ *
89
+ * Alternatively, the contents of this file may be used under the terms of
90
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
91
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
92
+ * in which case the provisions of the GPL or the LGPL are applicable instead
93
+ * of those above. If you wish to allow use of your version of this file only
94
+ * under the terms of either the GPL or the LGPL, and not to allow others to
95
+ * use your version of this file under the terms of the MPL, indicate your
96
+ * decision by deleting the provisions above and replace them with the notice
97
+ * and other provisions required by the GPL or the LGPL. If you do not delete
98
+ * the provisions above, a recipient may use your version of this file under
99
+ * the terms of any one of the MPL, the GPL or the LGPL.
100
+ *
101
+ * ***** END LICENSE BLOCK ***** */
102
+
103
+ ace.define('ace/mode/xml_highlight_rules', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/xml_util', 'ace/mode/text_highlight_rules'], function(require, exports, module) {
104
+ "use strict";
105
+
106
+ var oop = require("../lib/oop");
107
+ var xmlUtil = require("./xml_util");
108
+ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
109
+
110
+ var XmlHighlightRules = function() {
111
+
112
+ // regexp must not have capturing parentheses
113
+ // regexps are ordered -> the first match is used
114
+ this.$rules = {
115
+ start : [{
116
+ token : "text",
117
+ regex : "<\\!\\[CDATA\\[",
118
+ next : "cdata"
119
+ }, {
120
+ token : "xml_pe",
121
+ regex : "<\\?.*?\\?>"
122
+ }, {
123
+ token : "comment",
124
+ merge : true,
125
+ regex : "<\\!--",
126
+ next : "comment"
127
+ }, {
128
+ token : "xml_pe",
129
+ regex : "<\\!.*?>"
130
+ }, {
131
+ token : "meta.tag", // opening tag
132
+ regex : "<\\/?",
133
+ next : "tag"
134
+ }, {
135
+ token : "text",
136
+ regex : "\\s+"
137
+ }, {
138
+ token : "constant.character.entity",
139
+ regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
140
+ }, {
141
+ token : "text",
142
+ regex : "[^<]+"
143
+ }],
144
+
145
+ cdata : [{
146
+ token : "text",
147
+ regex : "\\]\\]>",
148
+ next : "start"
149
+ }, {
150
+ token : "text",
151
+ regex : "\\s+"
152
+ }, {
153
+ token : "text",
154
+ regex : "(?:[^\\]]|\\](?!\\]>))+"
155
+ }],
156
+
157
+ comment : [{
158
+ token : "comment",
159
+ regex : ".*?-->",
160
+ next : "start"
161
+ }, {
162
+ token : "comment",
163
+ merge : true,
164
+ regex : ".+"
165
+ }]
166
+ };
167
+
168
+ xmlUtil.tag(this.$rules, "tag", "start");
169
+ };
170
+
171
+ oop.inherits(XmlHighlightRules, TextHighlightRules);
172
+
173
+ exports.XmlHighlightRules = XmlHighlightRules;
174
+ });
175
+ /* ***** BEGIN LICENSE BLOCK *****
176
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
177
+ *
178
+ * The contents of this file are subject to the Mozilla Public License Version
179
+ * 1.1 (the "License"); you may not use this file except in compliance with
180
+ * the License. You may obtain a copy of the License at
181
+ * http://www.mozilla.org/MPL/
182
+ *
183
+ * Software distributed under the License is distributed on an "AS IS" basis,
184
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
185
+ * for the specific language governing rights and limitations under the
186
+ * License.
187
+ *
188
+ * The Original Code is Ajax.org Code Editor (ACE).
189
+ *
190
+ * The Initial Developer of the Original Code is
191
+ * Ajax.org B.V.
192
+ * Portions created by the Initial Developer are Copyright (C) 2010
193
+ * the Initial Developer. All Rights Reserved.
194
+ *
195
+ * Contributor(s):
196
+ * Fabian Jakobs <fabian AT ajax DOT org>
197
+ *
198
+ * Alternatively, the contents of this file may be used under the terms of
199
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
200
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
201
+ * in which case the provisions of the GPL or the LGPL are applicable instead
202
+ * of those above. If you wish to allow use of your version of this file only
203
+ * under the terms of either the GPL or the LGPL, and not to allow others to
204
+ * use your version of this file under the terms of the MPL, indicate your
205
+ * decision by deleting the provisions above and replace them with the notice
206
+ * and other provisions required by the GPL or the LGPL. If you do not delete
207
+ * the provisions above, a recipient may use your version of this file under
208
+ * the terms of any one of the MPL, the GPL or the LGPL.
209
+ *
210
+ * ***** END LICENSE BLOCK ***** */
211
+
212
+ ace.define('ace/mode/xml_util', ['require', 'exports', 'module' , 'ace/lib/lang'], function(require, exports, module) {
213
+ "use strict";
214
+
215
+ var lang = require("../lib/lang");
216
+
217
+ var formTags = lang.arrayToMap(
218
+ ("button|form|input|label|select|textarea").split("|")
219
+ );
220
+
221
+ var tableTags = lang.arrayToMap(
222
+ ("table|tbody|td|tfoot|th|tr").split("|")
223
+ );
224
+
225
+ function string(state) {
226
+ return [{
227
+ token : "string",
228
+ regex : '".*?"'
229
+ }, {
230
+ token : "string", // multi line string start
231
+ merge : true,
232
+ regex : '["].*',
233
+ next : state + "_qqstring"
234
+ }, {
235
+ token : "string",
236
+ regex : "'.*?'"
237
+ }, {
238
+ token : "string", // multi line string start
239
+ merge : true,
240
+ regex : "['].*",
241
+ next : state + "_qstring"
242
+ }];
243
+ }
244
+
245
+ function multiLineString(quote, state) {
246
+ return [{
247
+ token : "string",
248
+ merge : true,
249
+ regex : ".*?" + quote,
250
+ next : state
251
+ }, {
252
+ token : "string",
253
+ merge : true,
254
+ regex : '.+'
255
+ }];
256
+ }
257
+
258
+ exports.tag = function(states, name, nextState) {
259
+ states[name] = [{
260
+ token : "text",
261
+ regex : "\\s+"
262
+ }, {
263
+ //token : "meta.tag",
264
+
265
+ token : function(value) {
266
+ if ( value==='a' ) {
267
+ return "meta.tag.anchor";
268
+ }
269
+ else if ( value==='img' ) {
270
+ return "meta.tag.image";
271
+ }
272
+ else if ( value==='script' ) {
273
+ return "meta.tag.script";
274
+ }
275
+ else if ( value==='style' ) {
276
+ return "meta.tag.style";
277
+ }
278
+ else if (formTags.hasOwnProperty(value.toLowerCase())) {
279
+ return "meta.tag.form";
280
+ }
281
+ else if (tableTags.hasOwnProperty(value.toLowerCase())) {
282
+ return "meta.tag.table";
283
+ }
284
+ else {
285
+ return "meta.tag";
286
+ }
287
+ },
288
+ merge : true,
289
+ regex : "[-_a-zA-Z0-9:]+",
290
+ next : name + "_embed_attribute_list"
291
+ }, {
292
+ token: "empty",
293
+ regex: "",
294
+ next : name + "_embed_attribute_list"
295
+ }];
296
+
297
+ states[name + "_qstring"] = multiLineString("'", name + "_embed_attribute_list");
298
+ states[name + "_qqstring"] = multiLineString("\"", name + "_embed_attribute_list");
299
+
300
+ states[name + "_embed_attribute_list"] = [{
301
+ token : "meta.tag",
302
+ merge : true,
303
+ regex : "\/?>",
304
+ next : nextState
305
+ }, {
306
+ token : "keyword.operator",
307
+ regex : "="
308
+ }, {
309
+ token : "entity.other.attribute-name",
310
+ regex : "[-_a-zA-Z0-9:]+"
311
+ }, {
312
+ token : "constant.numeric", // float
313
+ regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
314
+ }, {
315
+ token : "text",
316
+ regex : "\\s+"
317
+ }].concat(string(name));
318
+ };
319
+
320
+ });
321
+ /* vim:ts=4:sts=4:sw=4:
322
+ * ***** BEGIN LICENSE BLOCK *****
323
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
324
+ *
325
+ * The contents of this file are subject to the Mozilla Public License Version
326
+ * 1.1 (the "License"); you may not use this file except in compliance with
327
+ * the License. You may obtain a copy of the License at
328
+ * http://www.mozilla.org/MPL/
329
+ *
330
+ * Software distributed under the License is distributed on an "AS IS" basis,
331
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
332
+ * for the specific language governing rights and limitations under the
333
+ * License.
334
+ *
335
+ * The Original Code is Ajax.org Code Editor (ACE).
336
+ *
337
+ * The Initial Developer of the Original Code is
338
+ * Ajax.org B.V.
339
+ * Portions created by the Initial Developer are Copyright (C) 2010
340
+ * the Initial Developer. All Rights Reserved.
341
+ *
342
+ * Contributor(s):
343
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
344
+ *
345
+ * Alternatively, the contents of this file may be used under the terms of
346
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
347
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
348
+ * in which case the provisions of the GPL or the LGPL are applicable instead
349
+ * of those above. If you wish to allow use of your version of this file only
350
+ * under the terms of either the GPL or the LGPL, and not to allow others to
351
+ * use your version of this file under the terms of the MPL, indicate your
352
+ * decision by deleting the provisions above and replace them with the notice
353
+ * and other provisions required by the GPL or the LGPL. If you do not delete
354
+ * the provisions above, a recipient may use your version of this file under
355
+ * the terms of any one of the MPL, the GPL or the LGPL.
356
+ *
357
+ * ***** END LICENSE BLOCK ***** */
358
+
359
+ ace.define('ace/mode/behaviour/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour', 'ace/mode/behaviour/cstyle'], function(require, exports, module) {
360
+ "use strict";
361
+
362
+ var oop = require("../../lib/oop");
363
+ var Behaviour = require("../behaviour").Behaviour;
364
+ var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
365
+
366
+ var XmlBehaviour = function () {
367
+
368
+ this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour
369
+
370
+ this.add("brackets", "insertion", function (state, action, editor, session, text) {
371
+ if (text == '<') {
372
+ var selection = editor.getSelectionRange();
373
+ var selected = session.doc.getTextRange(selection);
374
+ if (selected !== "") {
375
+ return false;
376
+ } else {
377
+ return {
378
+ text: '<>',
379
+ selection: [1, 1]
380
+ }
381
+ }
382
+ } else if (text == '>') {
383
+ var cursor = editor.getCursorPosition();
384
+ var line = session.doc.getLine(cursor.row);
385
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
386
+ if (rightChar == '>') { // need some kind of matching check here
387
+ return {
388
+ text: '',
389
+ selection: [1, 1]
390
+ }
391
+ }
392
+ } else if (text == "\n") {
393
+ var cursor = editor.getCursorPosition();
394
+ var line = session.doc.getLine(cursor.row);
395
+ var rightChars = line.substring(cursor.column, cursor.column + 2);
396
+ if (rightChars == '</') {
397
+ var indent = this.$getIndent(session.doc.getLine(cursor.row)) + session.getTabString();
398
+ var next_indent = this.$getIndent(session.doc.getLine(cursor.row));
399
+
400
+ return {
401
+ text: '\n' + indent + '\n' + next_indent,
402
+ selection: [1, indent.length, 1, indent.length]
403
+ }
404
+ }
405
+ }
406
+ });
407
+
408
+ }
409
+ oop.inherits(XmlBehaviour, Behaviour);
410
+
411
+ exports.XmlBehaviour = XmlBehaviour;
412
+ });/* vim:ts=4:sts=4:sw=4:
413
+ * ***** BEGIN LICENSE BLOCK *****
414
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
415
+ *
416
+ * The contents of this file are subject to the Mozilla Public License Version
417
+ * 1.1 (the "License"); you may not use this file except in compliance with
418
+ * the License. You may obtain a copy of the License at
419
+ * http://www.mozilla.org/MPL/
420
+ *
421
+ * Software distributed under the License is distributed on an "AS IS" basis,
422
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
423
+ * for the specific language governing rights and limitations under the
424
+ * License.
425
+ *
426
+ * The Original Code is Ajax.org Code Editor (ACE).
427
+ *
428
+ * The Initial Developer of the Original Code is
429
+ * Ajax.org B.V.
430
+ * Portions created by the Initial Developer are Copyright (C) 2010
431
+ * the Initial Developer. All Rights Reserved.
432
+ *
433
+ * Contributor(s):
434
+ * Chris Spencer <chris.ag.spencer AT googlemail DOT com>
435
+ *
436
+ * Alternatively, the contents of this file may be used under the terms of
437
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
438
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
439
+ * in which case the provisions of the GPL or the LGPL are applicable instead
440
+ * of those above. If you wish to allow use of your version of this file only
441
+ * under the terms of either the GPL or the LGPL, and not to allow others to
442
+ * use your version of this file under the terms of the MPL, indicate your
443
+ * decision by deleting the provisions above and replace them with the notice
444
+ * and other provisions required by the GPL or the LGPL. If you do not delete
445
+ * the provisions above, a recipient may use your version of this file under
446
+ * the terms of any one of the MPL, the GPL or the LGPL.
447
+ *
448
+ * ***** END LICENSE BLOCK ***** */
449
+
450
+ ace.define('ace/mode/behaviour/cstyle', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/mode/behaviour'], function(require, exports, module) {
451
+ "use strict";
452
+
453
+ var oop = require("../../lib/oop");
454
+ var Behaviour = require('../behaviour').Behaviour;
455
+
456
+ var CstyleBehaviour = function () {
457
+
458
+ this.add("braces", "insertion", function (state, action, editor, session, text) {
459
+ if (text == '{') {
460
+ var selection = editor.getSelectionRange();
461
+ var selected = session.doc.getTextRange(selection);
462
+ if (selected !== "") {
463
+ return {
464
+ text: '{' + selected + '}',
465
+ selection: false
466
+ };
467
+ } else {
468
+ return {
469
+ text: '{}',
470
+ selection: [1, 1]
471
+ };
472
+ }
473
+ } else if (text == '}') {
474
+ var cursor = editor.getCursorPosition();
475
+ var line = session.doc.getLine(cursor.row);
476
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
477
+ if (rightChar == '}') {
478
+ var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
479
+ if (matching !== null) {
480
+ return {
481
+ text: '',
482
+ selection: [1, 1]
483
+ };
484
+ }
485
+ }
486
+ } else if (text == "\n") {
487
+ var cursor = editor.getCursorPosition();
488
+ var line = session.doc.getLine(cursor.row);
489
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
490
+ if (rightChar == '}') {
491
+ var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1});
492
+ if (!openBracePos)
493
+ return null;
494
+
495
+ var indent = this.getNextLineIndent(state, line.substring(0, line.length - 1), session.getTabString());
496
+ var next_indent = this.$getIndent(session.doc.getLine(openBracePos.row));
497
+
498
+ return {
499
+ text: '\n' + indent + '\n' + next_indent,
500
+ selection: [1, indent.length, 1, indent.length]
501
+ };
502
+ }
503
+ }
504
+ });
505
+
506
+ this.add("braces", "deletion", function (state, action, editor, session, range) {
507
+ var selected = session.doc.getTextRange(range);
508
+ if (!range.isMultiLine() && selected == '{') {
509
+ var line = session.doc.getLine(range.start.row);
510
+ var rightChar = line.substring(range.end.column, range.end.column + 1);
511
+ if (rightChar == '}') {
512
+ range.end.column++;
513
+ return range;
514
+ }
515
+ }
516
+ });
517
+
518
+ this.add("parens", "insertion", function (state, action, editor, session, text) {
519
+ if (text == '(') {
520
+ var selection = editor.getSelectionRange();
521
+ var selected = session.doc.getTextRange(selection);
522
+ if (selected !== "") {
523
+ return {
524
+ text: '(' + selected + ')',
525
+ selection: false
526
+ };
527
+ } else {
528
+ return {
529
+ text: '()',
530
+ selection: [1, 1]
531
+ };
532
+ }
533
+ } else if (text == ')') {
534
+ var cursor = editor.getCursorPosition();
535
+ var line = session.doc.getLine(cursor.row);
536
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
537
+ if (rightChar == ')') {
538
+ var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
539
+ if (matching !== null) {
540
+ return {
541
+ text: '',
542
+ selection: [1, 1]
543
+ };
544
+ }
545
+ }
546
+ }
547
+ });
548
+
549
+ this.add("parens", "deletion", function (state, action, editor, session, range) {
550
+ var selected = session.doc.getTextRange(range);
551
+ if (!range.isMultiLine() && selected == '(') {
552
+ var line = session.doc.getLine(range.start.row);
553
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
554
+ if (rightChar == ')') {
555
+ range.end.column++;
556
+ return range;
557
+ }
558
+ }
559
+ });
560
+
561
+ this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
562
+ if (text == '"' || text == "'") {
563
+ var quote = text;
564
+ var selection = editor.getSelectionRange();
565
+ var selected = session.doc.getTextRange(selection);
566
+ if (selected !== "") {
567
+ return {
568
+ text: quote + selected + quote,
569
+ selection: false
570
+ };
571
+ } else {
572
+ var cursor = editor.getCursorPosition();
573
+ var line = session.doc.getLine(cursor.row);
574
+ var leftChar = line.substring(cursor.column-1, cursor.column);
575
+
576
+ // We're escaped.
577
+ if (leftChar == '\\') {
578
+ return null;
579
+ }
580
+
581
+ // Find what token we're inside.
582
+ var tokens = session.getTokens(selection.start.row, selection.start.row)[0].tokens;
583
+ var col = 0, token;
584
+ var quotepos = -1; // Track whether we're inside an open quote.
585
+
586
+ for (var x = 0; x < tokens.length; x++) {
587
+ token = tokens[x];
588
+ if (token.type == "string") {
589
+ quotepos = -1;
590
+ } else if (quotepos < 0) {
591
+ quotepos = token.value.indexOf(quote);
592
+ }
593
+ if ((token.value.length + col) > selection.start.column) {
594
+ break;
595
+ }
596
+ col += tokens[x].value.length;
597
+ }
598
+
599
+ // Try and be smart about when we auto insert.
600
+ 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)))) {
601
+ return {
602
+ text: quote + quote,
603
+ selection: [1,1]
604
+ };
605
+ } else if (token && token.type === "string") {
606
+ // Ignore input and move right one if we're typing over the closing quote.
607
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
608
+ if (rightChar == quote) {
609
+ return {
610
+ text: '',
611
+ selection: [1, 1]
612
+ };
613
+ }
614
+ }
615
+ }
616
+ }
617
+ });
618
+
619
+ this.add("string_dquotes", "deletion", function (state, action, editor, session, range) {
620
+ var selected = session.doc.getTextRange(range);
621
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
622
+ var line = session.doc.getLine(range.start.row);
623
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
624
+ if (rightChar == '"') {
625
+ range.end.column++;
626
+ return range;
627
+ }
628
+ }
629
+ });
630
+
631
+ };
632
+
633
+ oop.inherits(CstyleBehaviour, Behaviour);
634
+
635
+ exports.CstyleBehaviour = CstyleBehaviour;
636
+ });/* ***** BEGIN LICENSE BLOCK *****
637
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
638
+ *
639
+ * The contents of this file are subject to the Mozilla Public License Version
640
+ * 1.1 (the "License"); you may not use this file except in compliance with
641
+ * the License. You may obtain a copy of the License at
642
+ * http://www.mozilla.org/MPL/
643
+ *
644
+ * Software distributed under the License is distributed on an "AS IS" basis,
645
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
646
+ * for the specific language governing rights and limitations under the
647
+ * License.
648
+ *
649
+ * The Original Code is Ajax.org Code Editor (ACE).
650
+ *
651
+ * The Initial Developer of the Original Code is
652
+ * Ajax.org B.V.
653
+ * Portions created by the Initial Developer are Copyright (C) 2010
654
+ * the Initial Developer. All Rights Reserved.
655
+ *
656
+ * Contributor(s):
657
+ * Fabian Jakobs <fabian AT ajax DOT org>
658
+ *
659
+ * Alternatively, the contents of this file may be used under the terms of
660
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
661
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
662
+ * in which case the provisions of the GPL or the LGPL are applicable instead
663
+ * of those above. If you wish to allow use of your version of this file only
664
+ * under the terms of either the GPL or the LGPL, and not to allow others to
665
+ * use your version of this file under the terms of the MPL, indicate your
666
+ * decision by deleting the provisions above and replace them with the notice
667
+ * and other provisions required by the GPL or the LGPL. If you do not delete
668
+ * the provisions above, a recipient may use your version of this file under
669
+ * the terms of any one of the MPL, the GPL or the LGPL.
670
+ *
671
+ * ***** END LICENSE BLOCK ***** */
672
+
673
+ ace.define('ace/mode/folding/xml', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/lang', 'ace/range', 'ace/mode/folding/fold_mode', 'ace/token_iterator'], function(require, exports, module) {
674
+ "use strict";
675
+
676
+ var oop = require("../../lib/oop");
677
+ var lang = require("../../lib/lang");
678
+ var Range = require("../../range").Range;
679
+ var BaseFoldMode = require("./fold_mode").FoldMode;
680
+ var TokenIterator = require("../../token_iterator").TokenIterator;
681
+
682
+ var FoldMode = exports.FoldMode = function(voidElements) {
683
+ BaseFoldMode.call(this);
684
+ this.voidElements = voidElements || {};
685
+ };
686
+ oop.inherits(FoldMode, BaseFoldMode);
687
+
688
+ (function() {
689
+
690
+ this.getFoldWidget = function(session, foldStyle, row) {
691
+ var tag = this._getFirstTagInLine(session, row);
692
+
693
+ if (tag.closing)
694
+ return foldStyle == "markbeginend" ? "end" : "";
695
+
696
+ if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()])
697
+ return "";
698
+
699
+ if (tag.selfClosing)
700
+ return "";
701
+
702
+ if (tag.value.indexOf("/" + tag.tagName) !== -1)
703
+ return "";
704
+
705
+ return "start";
706
+ };
707
+
708
+ this._getFirstTagInLine = function(session, row) {
709
+ var tokens = session.getTokens(row, row)[0].tokens;
710
+ var value = "";
711
+ for (var i = 0; i < tokens.length; i++) {
712
+ var token = tokens[i];
713
+ if (token.type.indexOf("meta.tag") === 0)
714
+ value += token.value;
715
+ else
716
+ value += lang.stringRepeat(" ", token.value.length);
717
+ }
718
+
719
+ return this._parseTag(value);
720
+ };
721
+
722
+ this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/;
723
+ this._parseTag = function(tag) {
724
+
725
+ var match = this.tagRe.exec(tag);
726
+ var column = this.tagRe.lastIndex || 0;
727
+ this.tagRe.lastIndex = 0;
728
+
729
+ return {
730
+ value: tag,
731
+ match: match ? match[2] : "",
732
+ closing: match ? !!match[3] : false,
733
+ selfClosing: match ? !!match[5] || match[2] == "/>" : false,
734
+ tagName: match ? match[4] : "",
735
+ column: match[1] ? column + match[1].length : column
736
+ };
737
+ };
738
+
739
+ /*
740
+ * reads a full tag and places the iterator after the tag
741
+ */
742
+ this._readTagForward = function(iterator) {
743
+ var token = iterator.getCurrentToken();
744
+ if (!token)
745
+ return null;
746
+
747
+ var value = "";
748
+ var start;
749
+
750
+ do {
751
+ if (token.type.indexOf("meta.tag") === 0) {
752
+ if (!start) {
753
+ var start = {
754
+ row: iterator.getCurrentTokenRow(),
755
+ column: iterator.getCurrentTokenColumn()
756
+ };
757
+ }
758
+ value += token.value;
759
+ if (value.indexOf(">") !== -1) {
760
+ var tag = this._parseTag(value);
761
+ tag.start = start;
762
+ tag.end = {
763
+ row: iterator.getCurrentTokenRow(),
764
+ column: iterator.getCurrentTokenColumn() + token.value.length
765
+ };
766
+ iterator.stepForward();
767
+ return tag;
768
+ }
769
+ }
770
+ } while(token = iterator.stepForward());
771
+
772
+ return null;
773
+ };
774
+
775
+ this._readTagBackward = function(iterator) {
776
+ var token = iterator.getCurrentToken();
777
+ if (!token)
778
+ return null;
779
+
780
+ var value = "";
781
+ var end;
782
+
783
+ do {
784
+ if (token.type.indexOf("meta.tag") === 0) {
785
+ if (!end) {
786
+ end = {
787
+ row: iterator.getCurrentTokenRow(),
788
+ column: iterator.getCurrentTokenColumn() + token.value.length
789
+ };
790
+ }
791
+ value = token.value + value;
792
+ if (value.indexOf("<") !== -1) {
793
+ var tag = this._parseTag(value);
794
+ tag.end = end;
795
+ tag.start = {
796
+ row: iterator.getCurrentTokenRow(),
797
+ column: iterator.getCurrentTokenColumn()
798
+ };
799
+ iterator.stepBackward();
800
+ return tag;
801
+ }
802
+ }
803
+ } while(token = iterator.stepBackward());
804
+
805
+ return null;
806
+ };
807
+
808
+ this._pop = function(stack, tag) {
809
+ while (stack.length) {
810
+
811
+ var top = stack[stack.length-1];
812
+ if (!tag || top.tagName == tag.tagName) {
813
+ return stack.pop();
814
+ }
815
+ else if (this.voidElements[tag.tagName]) {
816
+ return;
817
+ }
818
+ else if (this.voidElements[top.tagName]) {
819
+ stack.pop();
820
+ continue;
821
+ } else {
822
+ return null;
823
+ }
824
+ }
825
+ };
826
+
827
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
828
+ var firstTag = this._getFirstTagInLine(session, row);
829
+
830
+ if (!firstTag.match)
831
+ return null;
832
+
833
+ var isBackward = firstTag.closing || firstTag.selfClosing;
834
+ var stack = [];
835
+ var tag;
836
+
837
+ if (!isBackward) {
838
+ var iterator = new TokenIterator(session, row, firstTag.column);
839
+ var start = {
840
+ row: row,
841
+ column: firstTag.column + firstTag.tagName.length + 2
842
+ };
843
+ while (tag = this._readTagForward(iterator)) {
844
+ if (tag.selfClosing) {
845
+ if (!stack.length) {
846
+ tag.start.column += tag.tagName.length + 2;
847
+ tag.end.column -= 2;
848
+ return Range.fromPoints(tag.start, tag.end);
849
+ } else
850
+ continue;
851
+ }
852
+
853
+ if (tag.closing) {
854
+ this._pop(stack, tag);
855
+ if (stack.length == 0)
856
+ return Range.fromPoints(start, tag.start);
857
+ }
858
+ else {
859
+ stack.push(tag)
860
+ }
861
+ }
862
+ }
863
+ else {
864
+ var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length);
865
+ var end = {
866
+ row: row,
867
+ column: firstTag.column
868
+ };
869
+
870
+ while (tag = this._readTagBackward(iterator)) {
871
+ if (tag.selfClosing) {
872
+ if (!stack.length) {
873
+ tag.start.column += tag.tagName.length + 2;
874
+ tag.end.column -= 2;
875
+ return Range.fromPoints(tag.start, tag.end);
876
+ } else
877
+ continue;
878
+ }
879
+
880
+ if (!tag.closing) {
881
+ this._pop(stack, tag);
882
+ if (stack.length == 0) {
883
+ tag.start.column += tag.tagName.length + 2;
884
+ return Range.fromPoints(tag.start, end);
885
+ }
886
+ }
887
+ else {
888
+ stack.push(tag)
889
+ }
890
+ }
891
+ }
892
+
893
+ };
894
+
895
+ }).call(FoldMode.prototype);
896
+
897
+ });/* ***** BEGIN LICENSE BLOCK *****
898
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
899
+ *
900
+ * The contents of this file are subject to the Mozilla Public License Version
901
+ * 1.1 (the "License"); you may not use this file except in compliance with
902
+ * the License. You may obtain a copy of the License at
903
+ * http://www.mozilla.org/MPL/
904
+ *
905
+ * Software distributed under the License is distributed on an "AS IS" basis,
906
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
907
+ * for the specific language governing rights and limitations under the
908
+ * License.
909
+ *
910
+ * The Original Code is Ajax.org Code Editor (ACE).
911
+ *
912
+ * The Initial Developer of the Original Code is
913
+ * Ajax.org B.V.
914
+ * Portions created by the Initial Developer are Copyright (C) 2010
915
+ * the Initial Developer. All Rights Reserved.
916
+ *
917
+ * Contributor(s):
918
+ * Fabian Jakobs <fabian AT ajax DOT org>
919
+ *
920
+ * Alternatively, the contents of this file may be used under the terms of
921
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
922
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
923
+ * in which case the provisions of the GPL or the LGPL are applicable instead
924
+ * of those above. If you wish to allow use of your version of this file only
925
+ * under the terms of either the GPL or the LGPL, and not to allow others to
926
+ * use your version of this file under the terms of the MPL, indicate your
927
+ * decision by deleting the provisions above and replace them with the notice
928
+ * and other provisions required by the GPL or the LGPL. If you do not delete
929
+ * the provisions above, a recipient may use your version of this file under
930
+ * the terms of any one of the MPL, the GPL or the LGPL.
931
+ *
932
+ * ***** END LICENSE BLOCK ***** */
933
+
934
+ ace.define('ace/mode/folding/fold_mode', ['require', 'exports', 'module' , 'ace/range'], function(require, exports, module) {
935
+ "use strict";
936
+
937
+ var Range = require("../../range").Range;
938
+
939
+ var FoldMode = exports.FoldMode = function() {};
940
+
941
+ (function() {
942
+
943
+ this.foldingStartMarker = null;
944
+ this.foldingStopMarker = null;
945
+
946
+ // must return "" if there's no fold, to enable caching
947
+ this.getFoldWidget = function(session, foldStyle, row) {
948
+ var line = session.getLine(row);
949
+ if (this.foldingStartMarker.test(line))
950
+ return "start";
951
+ if (foldStyle == "markbeginend"
952
+ && this.foldingStopMarker
953
+ && this.foldingStopMarker.test(line))
954
+ return "end";
955
+ return "";
956
+ };
957
+
958
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
959
+ return null;
960
+ };
961
+
962
+ this.indentationBlock = function(session, row, column) {
963
+ var re = /^\s*/;
964
+ var startRow = row;
965
+ var endRow = row;
966
+ var line = session.getLine(row);
967
+ var startColumn = column || line.length;
968
+ var startLevel = line.match(re)[0].length;
969
+ var maxRow = session.getLength()
970
+
971
+ while (++row < maxRow) {
972
+ line = session.getLine(row);
973
+ var level = line.match(re)[0].length;
974
+
975
+ if (level == line.length)
976
+ continue;
977
+
978
+ if (level <= startLevel)
979
+ break;
980
+
981
+ endRow = row;
982
+ }
983
+
984
+ if (endRow > startRow) {
985
+ var endColumn = session.getLine(endRow).length;
986
+ return new Range(startRow, startColumn, endRow, endColumn);
987
+ }
988
+ };
989
+
990
+ this.openingBracketBlock = function(session, bracket, row, column) {
991
+ var start = {row: row, column: column + 1};
992
+ var end = session.$findClosingBracket(bracket, start);
993
+ if (!end)
994
+ return;
995
+
996
+ var fw = session.foldWidgets[end.row];
997
+ if (fw == null)
998
+ fw = this.getFoldWidget(session, end.row);
999
+
1000
+ if (fw == "start") {
1001
+ end.row --;
1002
+ end.column = session.getLine(end.row).length;
1003
+ }
1004
+ return Range.fromPoints(start, end);
1005
+ };
1006
+
1007
+ }).call(FoldMode.prototype);
1008
+
1009
+ });