Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Amy Editor - initial commit (taken roughly from SVN repos)

  • Loading branch information...
commit b34f4450885587f0b942021baffdcc0b6dcdae38 1 parent 34e311d
Petr Krontorad authored
Showing with 32,909 additions and 0 deletions.
  1. BIN  amy_editor/branches/air/Amy Editor.air
  2. +14 −0 amy_editor/branches/air/AmyEditor-app.xml
  3. +96 −0 amy_editor/branches/air/AmyEditor.html
  4. +3 −0  amy_editor/branches/air/build.sh
  5. +1 −0  amy_editor/branches/air/client
  6. +1 −0  amy_editor/branches/air/mm
  7. +3 −0  amy_editor/branches/air/run.sh
  8. +1 −0  amy_editor/branches/rails/INSTALL_AMY
  9. +211 −0 amy_editor/branches/rails/README
  10. +10 −0 amy_editor/branches/rails/Rakefile
  11. +567 −0 amy_editor/branches/rails/app/controllers/amy_controller.rb
  12. +124 −0 amy_editor/branches/rails/app/controllers/amy_project_manager_controller.rb
  13. +53 −0 amy_editor/branches/rails/app/controllers/amy_rexec_controller.rb
  14. +7 −0 amy_editor/branches/rails/app/controllers/application.rb
  15. +15 −0 amy_editor/branches/rails/app/controllers/chap_controller.rb
  16. +61 −0 amy_editor/branches/rails/app/controllers/projects/playground_controller.rb
  17. +2 −0  amy_editor/branches/rails/app/helpers/amy_helper.rb
  18. +3 −0  amy_editor/branches/rails/app/helpers/application_helper.rb
  19. +2 −0  amy_editor/branches/rails/app/helpers/chap_helper.rb
  20. +2 −0  amy_editor/branches/rails/app/helpers/projects/playground_helper.rb
  21. +17 −0 amy_editor/branches/rails/app/views/amy/index.rhtml
  22. +20 −0 amy_editor/branches/rails/app/views/chap/index.rhtml
  23. +27 −0 amy_editor/branches/rails/app/views/layouts/amy.rhtml
  24. +19 −0 amy_editor/branches/rails/app/views/layouts/chap.rhtml
  25. +1 −0  amy_editor/branches/rails/app/views/projects/playground/index.rhtml
  26. +39 −0 amy_editor/branches/rails/config/boot.rb
  27. +58 −0 amy_editor/branches/rails/config/database.yml
  28. +60 −0 amy_editor/branches/rails/config/environment.rb
  29. +21 −0 amy_editor/branches/rails/config/environments/development.rb
  30. +18 −0 amy_editor/branches/rails/config/environments/production.rb
  31. +19 −0 amy_editor/branches/rails/config/environments/test.rb
  32. +23 −0 amy_editor/branches/rails/config/routes.rb
  33. +1 −0  amy_editor/branches/rails/data/amy_support/amy_default
  34. +1 −0  amy_editor/branches/rails/data/playground_test_data
  35. +13 −0 amy_editor/branches/rails/db/migrate/001_setup_amy_editor.rb
  36. +7 −0 amy_editor/branches/rails/db/schema.rb
  37. +1 −0  amy_editor/branches/rails/db/setup_amy_editor.sql
  38. +23 −0 amy_editor/branches/rails/doc/README_FOR_APP
  39. +40 −0 amy_editor/branches/rails/public/.htaccess
  40. +30 −0 amy_editor/branches/rails/public/404.html
  41. +30 −0 amy_editor/branches/rails/public/500.html
  42. +1 −0  amy_editor/branches/rails/public/contents
  43. +10 −0 amy_editor/branches/rails/public/dispatch.cgi
  44. +24 −0 amy_editor/branches/rails/public/dispatch.fcgi
  45. +10 −0 amy_editor/branches/rails/public/dispatch.rb
  46. +1 −0  amy_editor/branches/rails/public/favicon.ico
  47. BIN  amy_editor/branches/rails/public/images/rails.png
  48. +277 −0 amy_editor/branches/rails/public/index.html
  49. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.bundles.js
  50. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.collaboration.js
  51. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.commands.js
  52. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.js
  53. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.projects.js
  54. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.ui.js
  55. +1 −0  amy_editor/branches/rails/public/javascripts/amy/controller.user.js
  56. +1 −0  amy_editor/branches/rails/public/javascripts/amy/helper.js
  57. +1 −0  amy_editor/branches/rails/public/javascripts/amy/locale.js
  58. +1 −0  amy_editor/branches/rails/public/javascripts/amy/model.bundles.js
  59. +1 −0  amy_editor/branches/rails/public/javascripts/amy/model.collaboration.js
  60. +1 −0  amy_editor/branches/rails/public/javascripts/amy/model.js
  61. +1 −0  amy_editor/branches/rails/public/javascripts/amy/model.projects.js
  62. +1 −0  amy_editor/branches/rails/public/javascripts/amy/model.user.js
  63. +1 −0  amy_editor/branches/rails/public/javascripts/amy/view.js
  64. +1 −0  amy_editor/branches/rails/public/javascripts/amy/wizards.js
  65. +2 −0  amy_editor/branches/rails/public/javascripts/application.js
  66. +833 −0 amy_editor/branches/rails/public/javascripts/controls.js
  67. +942 −0 amy_editor/branches/rails/public/javascripts/dragdrop.js
  68. +1,088 −0 amy_editor/branches/rails/public/javascripts/effects.js
  69. +1 −0  amy_editor/branches/rails/public/javascripts/fry
  70. +2,515 −0 amy_editor/branches/rails/public/javascripts/prototype.js
  71. +1 −0  amy_editor/branches/rails/public/mm
  72. +1 −0  amy_editor/branches/rails/public/robots.txt
  73. +3 −0  amy_editor/branches/rails/script/about
  74. +3 −0  amy_editor/branches/rails/script/breakpointer
  75. +3 −0  amy_editor/branches/rails/script/console
  76. +3 −0  amy_editor/branches/rails/script/destroy
  77. +3 −0  amy_editor/branches/rails/script/generate
  78. +3 −0  amy_editor/branches/rails/script/performance/benchmarker
  79. +3 −0  amy_editor/branches/rails/script/performance/profiler
  80. +3 −0  amy_editor/branches/rails/script/plugin
  81. +3 −0  amy_editor/branches/rails/script/process/inspector
  82. +3 −0  amy_editor/branches/rails/script/process/reaper
  83. +3 −0  amy_editor/branches/rails/script/process/spawner
  84. +3 −0  amy_editor/branches/rails/script/runner
  85. +3 −0  amy_editor/branches/rails/script/server
  86. +18 −0 amy_editor/branches/rails/test/functional/amy_controller_test.rb
  87. +18 −0 amy_editor/branches/rails/test/functional/chap_controller_test.rb
  88. +18 −0 amy_editor/branches/rails/test/functional/projects/playground_controller_test.rb
  89. +28 −0 amy_editor/branches/rails/test/test_helper.rb
  90. BIN  amy_editor/branches/rails/tmp/sessions/1205534776792020c5fd18d1221a0b07
  91. BIN  amy_editor/branches/rails/tmp/sessions/1205534999d3059d6463a97413068c1c
  92. BIN  amy_editor/branches/rails/tmp/sessions/120557444895c3d0f0d648e4608878a5
  93. BIN  amy_editor/branches/rails/tmp/sessions/ruby_sess.8709384b540c31db
  94. BIN  amy_editor/branches/rails/tmp/sessions/ruby_sess.c8a9a38e216bc6b4
  95. BIN  amy_editor/branches/rails/tmp/sessions/ruby_sess.e376bb6fe0f326d7
  96. BIN  amy_editor/branches/rails/tmp/sessions/ruby_sess.e6f1d47f1d3757e1
  97. BIN  amy_editor/branches/rails/tmp/sessions/ruby_sess.e967f88dfe3c4e26
  98. +1 −0  amy_editor/branches/rails/vendor/plugins/amy
  99. +1 −0  amy_editor/branches/rails/vendor/plugins/fry
  100. +19 −0 amy_editor/branches/rails/vendor/plugins/output_compression/LICENSE
  101. +10 −0 amy_editor/branches/rails/vendor/plugins/output_compression/README
  102. +22 −0 amy_editor/branches/rails/vendor/plugins/output_compression/Rakefile
  103. +2 −0  amy_editor/branches/rails/vendor/plugins/output_compression/init.rb
  104. +66 −0 amy_editor/branches/rails/vendor/plugins/output_compression/lib/output_compression.rb
  105. +4 −0 amy_editor/branches/rails/vendor/plugins/output_compression/tasks/output_compression_tasks.rake
  106. +8 −0 amy_editor/branches/rails/vendor/plugins/output_compression/test/output_compression_test.rb
  107. +322 −0 amy_editor/trunk/_manuals/amy-manual.txt
  108. +53 −0 amy_editor/trunk/_manuals/dev-manual.txt
  109. +17 −0 amy_editor/trunk/_migrations/comm-protocol.txt
  110. +56 −0 amy_editor/trunk/_migrations/mysql_test.sql
  111. +1,040 −0 amy_editor/trunk/_migrations/setup_amy_editor.sql
  112. +292 −0 amy_editor/trunk/_migrations/setup_amy_editor_mysql.sql
  113. +39 −0 amy_editor/trunk/_migrations/update.sql
  114. +166 −0 amy_editor/trunk/_test_data/PrintFromButton.java
  115. +5 −0 amy_editor/trunk/_test_data/ahoj.rb
  116. +30 −0 amy_editor/trunk/_test_data/another/404.html
  117. +277 −0 amy_editor/trunk/_test_data/another/index.html
  118. +96 −0 amy_editor/trunk/_test_data/another/test-mvc-ac.searchbox.js
  119. +8 −0 amy_editor/trunk/_test_data/application.js
  120. +13 −0 amy_editor/trunk/_test_data/c#/ActorController.cs
  121. +15 −0 amy_editor/trunk/_test_data/c#/EnemyActorController.cs
  122. +15 −0 amy_editor/trunk/_test_data/c#/PlayerActorController.cs
  123. +2,509 −0 amy_editor/trunk/_test_data/c/mmdf.c
  124. +1,363 −0 amy_editor/trunk/_test_data/c/mtx.c
  125. +92 −0 amy_editor/trunk/_test_data/c/nl_ami.c
  126. +80 −0 amy_editor/trunk/_test_data/c/os_ami.c
  127. +833 −0 amy_editor/trunk/_test_data/controls.js
  128. +53 −0 amy_editor/trunk/_test_data/dav_controller.rb
  129. +1 −0  amy_editor/trunk/_test_data/empty.txt
  130. +98 −0 amy_editor/trunk/_test_data/my_application/OffScreenCanvas3D.java
  131. +163 −0 amy_editor/trunk/_test_data/my_application/OffScreenTest.java
  132. +78 −0 amy_editor/trunk/_test_data/my_application/OnScreenCanvas3D.java
  133. +243 −0 amy_editor/trunk/_test_data/my_application/doc/classes/facebook.php
  134. +102 −0 amy_editor/trunk/_test_data/my_application/doc/classes/facebook_desktop.php
  135. +582 −0 amy_editor/trunk/_test_data/my_application/doc/classes/facebookapi_php5_restlib.php
  136. +549 −0 amy_editor/trunk/_test_data/my_application/doc/texy/syntax.texy
  137. +942 −0 amy_editor/trunk/_test_data/my_application/dragdrop.js
  138. +1,088 −0 amy_editor/trunk/_test_data/my_application/effects.js
  139. +42 −0 amy_editor/trunk/_test_data/my_application/entrance_controller.rb
  140. +7 −0 amy_editor/trunk/_test_data/my_application/rbies/application.rb
  141. +10 −0 amy_editor/trunk/_test_data/my_application/rbies/test_controller.rb
  142. BIN  amy_editor/trunk/_test_data/pictures/PC220001.jpg
  143. BIN  amy_editor/trunk/_test_data/pictures/PC230014.jpg
  144. BIN  amy_editor/trunk/_test_data/pictures/PC230017.jpg
  145. BIN  amy_editor/trunk/_test_data/pictures/PC230035.jpg
  146. BIN  amy_editor/trunk/_test_data/pictures/PC250073.jpg
  147. BIN  amy_editor/trunk/_test_data/pictures/PC250082.jpg
  148. BIN  amy_editor/trunk/_test_data/pictures/PC260117.jpg
  149. BIN  amy_editor/trunk/_test_data/pictures/PC260145.jpg
  150. BIN  amy_editor/trunk/_test_data/pictures/a.png
  151. BIN  amy_editor/trunk/_test_data/pictures/b.png
  152. BIN  amy_editor/trunk/_test_data/pictures/c.png
  153. BIN  amy_editor/trunk/_test_data/pictures/d.png
  154. BIN  amy_editor/trunk/_test_data/pictures/e.png
  155. BIN  amy_editor/trunk/_test_data/pictures/f.png
  156. BIN  amy_editor/trunk/_test_data/pictures/flake-demo-website-logo.jpg
  157. BIN  amy_editor/trunk/_test_data/pictures/loading.gif
  158. BIN  amy_editor/trunk/_test_data/pictures/q.png
  159. BIN  amy_editor/trunk/_test_data/pictures/r.png
  160. BIN  amy_editor/trunk/_test_data/pictures/rails.png
  161. BIN  amy_editor/trunk/_test_data/pictures/rails_mirrored.png
  162. BIN  amy_editor/trunk/_test_data/pictures/rails_playground.png
  163. BIN  amy_editor/trunk/_test_data/pictures/s.png
  164. BIN  amy_editor/trunk/_test_data/pictures/t.png
  165. BIN  amy_editor/trunk/_test_data/pictures/u.png
  166. BIN  amy_editor/trunk/_test_data/pictures/v.png
  167. BIN  amy_editor/trunk/_test_data/pictures/w.png
  168. BIN  amy_editor/trunk/_test_data/pictures/x.png
  169. +14 −0 amy_editor/trunk/_test_data/share_space.rb
  170. +270 −0 amy_editor/trunk/_test_data/shared.dep.php
  171. +29 −0 amy_editor/trunk/_test_data/simple.htm
  172. +7 −0 amy_editor/trunk/_test_data/stuff/application.rb
  173. +10 −0 amy_editor/trunk/_test_data/stuff/test_controller.rb
  174. +549 −0 amy_editor/trunk/_test_data/syntax.texy
  175. +277 −0 amy_editor/trunk/_test_data/welcome.html
  176. +121 −0 amy_editor/trunk/amy.php
  177. +106 −0 amy_editor/trunk/amy_facebook.php
  178. +190 −0 amy_editor/trunk/amy_frame.php
  179. +77 −0 amy_editor/trunk/amy_frame_custom.php
  180. +243 −0 amy_editor/trunk/api/embed/amy.php
  181. +70 −0 amy_editor/trunk/api/embed/amy_style.php
  182. +63 −0 amy_editor/trunk/api/embed/test_bug.html
  183. +99 −0 amy_editor/trunk/api/embed/test_eamy.html
  184. +6 −0 amy_editor/trunk/api/embed/test_eamy_submit_handler.php
  185. +100 −0 amy_editor/trunk/api/embed/test_texy.html
  186. +1 −0  amy_editor/trunk/api/offline/bundle_markup.js
  187. +1 −0  amy_editor/trunk/api/offline/bundle_python.js
  188. +5 −0 amy_editor/trunk/api/offline/create_package.php
  189. +32 −0 amy_editor/trunk/api/offline/eamy.js
  190. +348 −0 amy_editor/trunk/api/offline/eamy/bundle_markup.js
  191. +262 −0 amy_editor/trunk/api/offline/eamy/bundle_python.js
  192. BIN  amy_editor/trunk/api/offline/eamy/chap-bg-sidebar.gif
  193. BIN  amy_editor/trunk/api/offline/eamy/chap-bookmark-default.gif
  194. BIN  amy_editor/trunk/api/offline/eamy/chap-folding-expand-inner.gif
  195. BIN  amy_editor/trunk/api/offline/eamy/chap-folding-expand.gif
  196. BIN  amy_editor/trunk/api/offline/eamy/chap-folding-start.gif
  197. BIN  amy_editor/trunk/api/offline/eamy/chap-folding-stop.gif
  198. BIN  amy_editor/trunk/api/offline/eamy/chap-wrapped-row.gif
  199. +8,143 −0 amy_editor/trunk/api/offline/eamy/eamy.js
  200. +55 −0 amy_editor/trunk/api/offline/eamy/style.css
  201. BIN  amy_editor/trunk/api/offline/eamy/tabpane.button.close_invert.gif
  202. BIN  amy_editor/trunk/api/offline/eamy/void.gif
  203. +1 −0  amy_editor/trunk/api/offline/eamy_obf.js
  204. +32 −0 amy_editor/trunk/api/offline/package_templates/eamy_js-header.txt
  205. +169 −0 amy_editor/trunk/api/offline/test_offline.html
  206. +66 −0 amy_editor/trunk/api/offline/test_offline_markup.html
  207. BIN  amy_editor/trunk/api/offline/yuicompressor-2.3.5.jar
  208. +20 −0 amy_editor/trunk/api/rails_plugin/amy/LICENSE
  209. +9 −0 amy_editor/trunk/api/rails_plugin/amy/README
  210. +28 −0 amy_editor/trunk/api/rails_plugin/amy/Rakefile
  211. +28 −0 amy_editor/trunk/api/rails_plugin/amy/init.rb
  212. +7 −0 amy_editor/trunk/api/rails_plugin/amy/install.rb
  213. +69 −0 amy_editor/trunk/api/rails_plugin/amy/lib/abstract_application_controller.rb
  214. +231 −0 amy_editor/trunk/api/rails_plugin/amy/lib/abstract_project_controller.rb
  215. +191 −0 amy_editor/trunk/api/rails_plugin/amy/lib/base.rb
  216. +221 −0 amy_editor/trunk/api/rails_plugin/amy/lib/bundle.rb
  217. +64 −0 amy_editor/trunk/api/rails_plugin/amy/lib/helpers.rb
  218. +22 −0 amy_editor/trunk/api/rails_plugin/amy/lib/logger.rb
  219. +80 −0 amy_editor/trunk/api/rails_plugin/amy/lib/projects/abstract_resource_manager.rb
  220. +96 −0 amy_editor/trunk/api/rails_plugin/amy/lib/projects/file_resource_manager.rb
  221. +255 −0 amy_editor/trunk/api/rails_plugin/amy/lib/projects/remote_project.rb
  222. +19 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/dav_client.rb
  223. +19 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/ftp_client.rb
  224. +19 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/google.rb
  225. +17 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/mail.rb
  226. +88 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/mysql.rb
  227. +94 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/pg.rb
  228. +142 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/simple_http.rb
  229. +14 −0 amy_editor/trunk/api/rails_plugin/amy/lib/support/yaml.rb
  230. +244 −0 amy_editor/trunk/api/rails_plugin/amy/lib/user.rb
  231. +24 −0 amy_editor/trunk/api/rails_plugin/amy/lib/util.rb
  232. +8 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/info.amBundle
  233. +5 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/keymaps/Mac.amKeymap
  234. +5 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/keymaps/Windows.amKeymap
  235. +31 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/keymaps/default.amKeymap
  236. +18 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/languages/cpp.amLanguage
  237. +18 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/languages/csharp.amLanguage
  238. +25 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/languages/default.amLanguage
  239. +6 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/menus/bundle.amMenu
  240. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/class.amSnippet
  241. +9 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/class.amSnippetDef
  242. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/dowhileloop.amSnippet
  243. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/dowhileloop.amSnippetDef
  244. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/forloop.amSnippet
  245. +4 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/forloop.amSnippetDef
  246. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/group.amGroup
  247. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/ifcondition.amSnippet
  248. +4 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/ifcondition.amSnippetDef
  249. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/namespace.amSnippet
  250. +4 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/namespace.amSnippetDef
  251. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/struct.amSnippet
  252. +4 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/struct.amSnippetDef
  253. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/templatetypename.amSnippet
  254. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/templatetypename.amSnippetDef
  255. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/typedef.amSnippet
  256. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/declarations/typedef.amSnippetDef
  257. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/endif.amSnippet
  258. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/endif.amSnippetDef
  259. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/fprintf.amSnippet
  260. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/fprintf.amSnippetDef
  261. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/1begin1end.amSnippet
  262. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/1begin1end.amSnippetDef
  263. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/group.amGroup
  264. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/headerincludeguard.amSnippet
  265. +6 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/headerincludeguard.amSnippetDef
  266. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/main.amSnippet
  267. +5 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/main.amSnippetDef
  268. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/readfileintovector.amSnippet
  269. +8 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/idioms/readfileintovector.amSnippetDef
  270. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/ifndefdefineendif.amSnippet
  271. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/ifndefdefineendif.amSnippetDef
  272. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/include.amSnippet
  273. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/include.amSnippetDef
  274. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/pragmamark.amSnippet
  275. +6 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/pragmamark.amSnippetDef
  276. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/printf.amSnippet
  277. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/printf.amSnippetDef
  278. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/stdmap.amSnippet
  279. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/stdmap.amSnippetDef
  280. +3 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/stdvector.amSnippet
  281. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/c/snippets/stdvector.amSnippetDef
  282. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/encoding/base64decode.amCommand
  283. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/encoding/base64decode.amCommandDef
  284. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/encoding/base64encode.amCommand
  285. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/encoding/base64encode.amCommandDef
  286. +1 −0  amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/encoding/group.amGroup
  287. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/google_search.amCommand
  288. +16 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/google_search.amCommandDef
  289. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/reversetext.amCommand
  290. +8 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/reversetext.amCommandDef
  291. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/taggenerator.amCommand
  292. +8 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/taggenerator.amCommandDef
  293. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/tooltippie.amCommand
  294. +8 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/tooltippie.amCommandDef
  295. +7 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/xml_validate.amCommand
  296. +11 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/commands/xml_validate.amCommandDef
  297. +8 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/info.amBundle
  298. +98 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/keymaps/Mac.amKeymap
  299. +88 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/keymaps/Windows.amKeymap
  300. +111 −0 amy_editor/trunk/api/rails_plugin/amy/support/bundles/default/keymaps/default.amKeymap
Sorry, we could not display the entire diff because too many files (2,564) changed.
BIN  amy_editor/branches/air/Amy Editor.air
View
Binary file not shown
14 amy_editor/branches/air/AmyEditor-app.xml
View
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://ns.adobe.com/air/application/1.0.M4"
+ appId="com.april-child.dev.AmyEditor" version="1.0">
+ <name>Amy Editor</name>
+ <description>Collaborative editor for web developers.</description>
+ <copyright>Copyright (c)2007 Petr Krontorád, All rights reserved.</copyright>
+ <rootContent systemChrome="standard" transparent="false" width="1000" height="700">AmyEditor.html</rootContent>
+ <icon>
+ <image16x16>mm/i/icon-16.png</image16x16>
+ <image32x32>mm/i/icon-32.png</image32x32>
+ <image48x48>mm/i/icon-48.png</image48x48>
+ <image128x128>mm/i/icon-128.png</image128x128>
+ </icon>
+</application>
96 amy_editor/branches/air/AmyEditor.html
View
@@ -0,0 +1,96 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <meta name="Author" content="All: Petr Krontorad, April-Child.com" />
+ <meta name="Copyright" content="Petr Krontorad, April-Child.com (http://www.april-child.com)" />
+
+ <title>Amy - collaborative web text editor for developers</title>
+
+ <link href="client/fry/mm/style/ac.ui.css" rel="stylesheet" type="text/css" />
+ <link href="client/fry/mm/style/theme/apple/theme-apple.css" rel="stylesheet" type="text/css" />
+ <link href="mm/style/amy.css" rel="stylesheet" type="text/css" />
+
+ <script type="text/javascript">
+
+ function apollo_init()
+ {
+
+ }
+
+ // reserving `amy` namespace
+ var amy = {};
+ // client application configuration for Fry Library
+ var client =
+ {
+ conf:
+ {
+ locale:'en',
+ progid:'amy-1.0b-apollo',
+ fry:
+ {
+ backendURL:'http://amy.imac/amy-backend.php',
+ theme:'apple'
+ }
+ },
+
+ onload:function()
+ {
+ }
+
+ };
+
+ </script>
+ <script type="text/javascript" src="client/fry/ac.fry.apollo.js"></script>
+
+ <script type="text/javascript" loader="true" src="client/fry/ac.fry.js"></script>
+
+ <script type="text/javascript" src="client/fry/ac.fry.data.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.xml.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.ui.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.ui.support.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.ui.widget.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.mvc.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.data.calendar.js"></script>
+ <script type="text/javascript" src="client/fry/ac.fry.ui.form.js"></script>
+
+ <script type="text/javascript" src="client/fry/widget/ac.tabpane.js"></script>
+ <script type="text/javascript" src="client/fry/widget/ac.menu.js"></script>
+ <script type="text/javascript" src="client/fry/widget/ac.searchbox.js"></script>
+ <script type="text/javascript" src="client/fry/widget/ac.tree.js"></script>
+ <script type="text/javascript" src="client/fry/widget/ac.window.js"></script>
+
+ <script type="text/javascript" src="client/fry/chap/ac.chap.js"></script>
+ <script type="text/javascript" src="client/fry/chap/ac.chap.view.js"></script>
+ <script type="text/javascript" src="client/fry/chap/ac.chap.settings.js"></script>
+
+ <script type="text/javascript" src="client/locale.js"></script>
+ <script type="text/javascript" src="client/helper.js"></script>
+ <script type="text/javascript" src="client/model.js"></script>
+ <script type="text/javascript" src="client/view.js"></script>
+ <script type="text/javascript" src="client/controller.js"></script>
+
+
+
+ <style type="text/css">
+ .acw-chap pre, .acw-chap pre span, span.acw-char-check, .acw-chap .selection-area div
+ {
+ font:11px 'Courier', monospaced;
+ }
+ </style>
+
+ </head>
+ <body onload="apollo_init()">
+
+ <div id="splash">
+ <div class="c">
+ <div>
+ <h1>Amy - collaborative web text editor for developers</h1>
+ </div>
+ <em>Loading, please wait...</em>
+ </div>
+ </div>
+ </body>
+</html>
3  amy_editor/branches/air/build.sh
View
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+adt -package "Amy Editor.air" AmyEditor-app.xml AmyEditor.html client mm
1  amy_editor/branches/air/client
View
1  amy_editor/branches/air/mm
View
3  amy_editor/branches/air/run.sh
View
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+adl AmyEditor-app.xml
1  amy_editor/branches/rails/INSTALL_AMY
View
@@ -0,0 +1 @@
+Please refer to the standard Rails doc/README_FOR_APP file for more information.
211 amy_editor/branches/rails/README
View
@@ -0,0 +1,211 @@
+== Welcome to Rails
+
+Rails is a web-application and persistence framework that includes everything
+needed to create database-backed web-applications according to the
+Model-View-Control pattern of separation. This pattern splits the view (also
+called the presentation) into "dumb" templates that are primarily responsible
+for inserting pre-built data in between HTML tags. The model contains the
+"smart" domain objects (such as Account, Product, Person, Post) that holds all
+the business logic and knows how to persist themselves to a database. The
+controller handles the incoming requests (such as Save New Account, Update
+Product, Show Post) by manipulating the model and directing data to the view.
+
+In Rails, the model is handled by what's called an object-relational mapping
+layer entitled Active Record. This layer allows you to present the data from
+database rows as objects and embellish these data objects with business logic
+methods. You can read more about Active Record in
+link:files/vendor/rails/activerecord/README.html.
+
+The controller and view are handled by the Action Pack, which handles both
+layers by its two parts: Action View and Action Controller. These two layers
+are bundled in a single package due to their heavy interdependence. This is
+unlike the relationship between the Active Record and Action Pack that is much
+more separate. Each of these packages can be used independently outside of
+Rails. You can read more about Action Pack in
+link:files/vendor/rails/actionpack/README.html.
+
+
+== Getting started
+
+1. At the command prompt, start a new rails application using the rails command
+ and your application name. Ex: rails myapp
+ (If you've downloaded rails in a complete tgz or zip, this step is already done)
+2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
+3. Go to http://localhost:3000/ and get "Welcome aboard: You’re riding the Rails!"
+4. Follow the guidelines to start developing your application
+
+
+== Web Servers
+
+By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise
+Rails will use the WEBrick, the webserver that ships with Ruby. When you run script/server,
+Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures
+that you can always get up and running quickly.
+
+Mongrel is a Ruby-based webserver with a C-component (which requires compilation) that is
+suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
+getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
+More info at: http://mongrel.rubyforge.org
+
+If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than
+Mongrel and WEBrick and also suited for production use, but requires additional
+installation and currently only works well on OS X/Unix (Windows users are encouraged
+to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from
+http://www.lighttpd.net.
+
+And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby
+web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not
+for production.
+
+But of course its also possible to run Rails on any platform that supports FCGI.
+Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
+please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
+
+
+== Debugging Rails
+
+Sometimes your application goes wrong. Fortunately there are a lot of tools that
+will help you debug it and get it back on the rails.
+
+First area to check is the application log files. Have "tail -f" commands running
+on the server.log and development.log. Rails will automatically display debugging
+and runtime information to these files. Debugging info will also be shown in the
+browser on requests from 127.0.0.1.
+
+You can also log your own messages directly into the log file from your code using
+the Ruby logger class from inside your controllers. Example:
+
+ class WeblogController < ActionController::Base
+ def destroy
+ @weblog = Weblog.find(params[:id])
+ @weblog.destroy
+ logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
+ end
+ end
+
+The result will be a message in your log file along the lines of:
+
+ Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
+
+More information on how to use the logger is at http://www.ruby-doc.org/core/
+
+Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
+
+* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
+* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
+
+These two online (and free) books will bring you up to speed on the Ruby language
+and also on programming in general.
+
+
+== Breakpoints
+
+Breakpoint support is available through the script/breakpointer client. This
+means that you can break out of execution at any point in the code, investigate
+and change the model, AND then resume execution! Example:
+
+ class WeblogController < ActionController::Base
+ def index
+ @posts = Post.find(:all)
+ breakpoint "Breaking out from the list"
+ end
+ end
+
+So the controller will accept the action, run the first line, then present you
+with a IRB prompt in the breakpointer window. Here you can do things like:
+
+Executing breakpoint "Breaking out from the list" at .../webrick_server.rb:16 in 'breakpoint'
+
+ >> @posts.inspect
+ => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
+ #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
+ >> @posts.first.title = "hello from a breakpoint"
+ => "hello from a breakpoint"
+
+...and even better is that you can examine how your runtime objects actually work:
+
+ >> f = @posts.first
+ => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
+ >> f.
+ Display all 152 possibilities? (y or n)
+
+Finally, when you're ready to resume execution, you press CTRL-D
+
+
+== Console
+
+You can interact with the domain model by starting the console through <tt>script/console</tt>.
+Here you'll have all parts of the application configured, just like it is when the
+application is running. You can inspect domain models, change values, and save to the
+database. Starting the script without arguments will launch it in the development environment.
+Passing an argument will specify a different environment, like <tt>script/console production</tt>.
+
+To reload your controllers and models after launching the console run <tt>reload!</tt>
+
+To reload your controllers and models after launching the console run <tt>reload!</tt>
+
+
+
+== Description of contents
+
+app
+ Holds all the code that's specific to this particular application.
+
+app/controllers
+ Holds controllers that should be named like weblogs_controller.rb for
+ automated URL mapping. All controllers should descend from ApplicationController
+ which itself descends from ActionController::Base.
+
+app/models
+ Holds models that should be named like post.rb.
+ Most models will descend from ActiveRecord::Base.
+
+app/views
+ Holds the template files for the view that should be named like
+ weblogs/index.rhtml for the WeblogsController#index action. All views use eRuby
+ syntax.
+
+app/views/layouts
+ Holds the template files for layouts to be used with views. This models the common
+ header/footer method of wrapping views. In your views, define a layout using the
+ <tt>layout :default</tt> and create a file named default.rhtml. Inside default.rhtml,
+ call <% yield %> to render the view using this layout.
+
+app/helpers
+ Holds view helpers that should be named like weblogs_helper.rb. These are generated
+ for you automatically when using script/generate for controllers. Helpers can be used to
+ wrap functionality for your views into methods.
+
+config
+ Configuration files for the Rails environment, the routing map, the database, and other dependencies.
+
+components
+ Self-contained mini-applications that can bundle together controllers, models, and views.
+
+db
+ Contains the database schema in schema.rb. db/migrate contains all
+ the sequence of Migrations for your schema.
+
+doc
+ This directory is where your application documentation will be stored when generated
+ using <tt>rake doc:app</tt>
+
+lib
+ Application specific libraries. Basically, any kind of custom code that doesn't
+ belong under controllers, models, or helpers. This directory is in the load path.
+
+public
+ The directory available for the web server. Contains subdirectories for images, stylesheets,
+ and javascripts. Also contains the dispatchers and the default HTML files. This should be
+ set as the DOCUMENT_ROOT of your web server.
+
+script
+ Helper scripts for automation and generation.
+
+test
+ Unit and functional tests along with fixtures. When using the script/generate scripts, template
+ test files will be generated for you and placed in this directory.
+
+vendor
+ External libraries that the application depends on. Also includes the plugins subdirectory.
+ This directory is in the load path.
10 amy_editor/branches/rails/Rakefile
View
@@ -0,0 +1,10 @@
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require(File.join(File.dirname(__FILE__), 'config', 'boot'))
+
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+
+require 'tasks/rails'
567 amy_editor/branches/rails/app/controllers/amy_controller.rb
View
@@ -0,0 +1,567 @@
+#++
+# ------------------------------------------------------------------------------------------
+# == Amy Editor ==
+# Collaborative Text and Source Code Editor for Developers
+#
+# Built on the technologies developed and maintained by April-Child.com
+# Copyright (c)2007,2008 Petr Krontorad, April-Child.com.
+#
+# Author: Petr Krontorad, petr@krontorad.com
+#
+# All rights reserved.
+# *------------------------------------------------------------------------------------------
+#
+# Main controller
+#
+# *------------------------------------------------------------------------------------------
+#--
+
+
+
+class AmyController < Amy::AbstractApplicationController
+
+ def load_settings
+ path = File.join(amy_support_path, "/settings/#{strip_filename(@params['name'])}.amSettings")
+ set_result YAML::load(File.open(path))
+ end
+
+ def list_themes
+ themes_path = File.join(amy_support_path, '/themes/')
+ return raise_error("There is no themes directory available.") unless File.directory?(themes_path)
+ themes = []
+ Dir.foreach(themes_path) do |f|
+ next unless '.amTheme' == f[-8..-1]
+ yaml = YAML::load(File.open(themes_path + f))
+ yaml['id'] = f[0..-9]
+ themes << yaml
+ end
+ set_result themes
+ end
+
+ def list_bundles
+ begin
+ set_result amy_list_bundles
+ rescue => e
+ raise_error "There is no bundles directory available."
+ end
+ end
+
+ def load_bundle
+ bundle = amy_load_bundle(@params['id'], 'default', request.env['HTTP_USER_AGENT'].match(/intosh/).nil? ? 'Windows':'Mac', :yaml)
+ set_result bundle.dump_definition
+ end
+
+ def load_language_definition_source
+ lang_path = amy_support_path + "/bundles/#{@params['language_id'].sub('_', '/languages/')}.amLanguage"
+ return set_result(File.read(lang_path)) if File.exist?(lang_path)
+ raise_error "Language definition not found for `#{@params['language_id']}'."
+ end
+end
+
+__END__
+
+
+ class AmyController extends ACBackend
+ {
+ protected $resourceManager = null;
+ protected $configuration = null;
+ protected $connection = null;
+ protected $user = null;
+
+ public function __construct($configuration = array())
+ {
+ $this->configuration = $configuration;
+ $this->configuration['original-support-path'] = $this->configuration['support-path'];
+ try
+ {
+ $session = new AmySession($configuration);
+ $session->authorize();
+ $this->user = new AmyUser($configuration);
+ $this->user->load_from_session($session);
+ }
+ catch (Exception $e)
+ {
+ // echo $e->getMessage();
+ }
+ try
+ {
+ if (null === $this->user)
+ {
+ $this->user = new AmyUser($configuration);
+ $this->user->make_default();
+ $this->user->create_session();
+ }
+ $this->configuration['support-path'] .= '/' . $this->user->service . '_' . $this->user->username . '/';
+ }
+ catch (Exception $e)
+ {
+ $this->configuration['support-path'] .= '/amy_default/';
+ }
+ }
+
+
+ private function fail_not_authenticated()
+ {
+ if ($this->user->is_default())
+ {
+ self::raiseError('Not authenticated.');
+ }
+ }
+ # _______ user management
+
+ public function on_user_sign_in($pars)
+ {
+ try
+ {
+ $user = new AmyUser($this->configuration);
+ $user->authorize($pars['username'], $pars['password'], 'amy');
+ $user->create_session();
+ self::setResult($user);
+ }
+ catch (Exception $e)
+ {
+ self::raiseError('Unable to login: ' . $e->getMessage());
+ }
+ }
+
+ public function on_user_sign_out($pars)
+ {
+ $user = new AmyUser($this->configuration);
+ $user->make_default();
+ $user->create_session();
+ self::setResult(true);
+ }
+
+ public function on_user_register($pars)
+ {
+ $user = new AmyUser($this->configuration);
+ try
+ {
+ $user->register($pars['username'], $pars['password'], 'amy', $pars);
+ $user->create_session();
+ }
+ catch (Exception $e)
+ {
+ self::raiseError('Unable to register: ' . $e->getMessage());
+ }
+ self::setResult($user);
+ }
+
+ public function on_user_change_picture($pars)
+ {
+ $this->fail_not_authenticated();
+ $this->user->credentials['picture'] = $pars['url'];
+ $this->user->save();
+ self::setResult($this->user);
+ }
+
+ public function on_user_find_relations($pars)
+ {
+ $this->fail_not_authenticated();
+ if (false === $res = Pg::find('SELECT * FROM amy.user_find_relations(' . $this->user->userId . ')'))
+ {
+ self::raiseError('Cannot acquire user relations.');
+ }
+ $data = array();
+ while (false !== $row = pg_fetch_assoc($res))
+ {
+ $data[] = $row;
+ }
+ self::setResult($data);
+ }
+
+ public function on_user_update_relation($pars)
+ {
+ $this->fail_not_authenticated();
+ $original_email = Pg::quote_literal(trim($pars['original_email']));
+ $email = Pg::quote_literal(trim($pars['email']));
+ $nickname = Pg::quote_literal(trim($pars['nickname']));
+ if (false === $row = Pg::find_first('SELECT * FROM amy.user_update_relation(' . $this->user->userId . ", '$original_email', '$nickname', '$email')"))
+ {
+ self::raiseError('Error updating relation: ' . Pg::last_error());
+ }
+ self::setResult($row);
+ }
+
+ public function on_user_remove_relation($pars)
+ {
+ $this->fail_not_authenticated();
+ $user_id = $pars['user_id'];
+ if (is_numeric($user_id) && 0 < $user_id)
+ {
+ $res = Pg::find('SELECT amy.user_delete_relation(' . $this->user->userId . ", $user_id)");
+ }
+ else
+ {
+ $email = Pg::quote_literal(trim($pars['email']));
+ $res = Pg::find('SELECT amy.user_delete_relation(' . $this->user->userId . ", '$email')");
+ }
+ if (false === $res)
+ {
+ self::raiseError('Error removing relation: ' . Pg::last_error());
+ }
+ self::setResult(true);
+ }
+
+ # _______ resources management
+
+ #public
+
+ public function on_download_resource($pars)
+ {
+ header('Content-type: text/plain');
+ header('Content-Disposition: attachment; filename="'.$pars['filename'].'"');
+ header('Content-length: ' . strlen($pars['content']));
+ echo $pars['content'];
+ exit();
+ }
+
+ # _______ preferences & bundles support
+
+ #private
+
+ private function getFilenameByName($name)
+ {
+ $filename = strtolower(preg_replace('/[^a-zA-Z0-9]/', '', $name));
+ if ( '' == $filename )
+ {
+ $filename = 'snippet';
+ }
+ return $filename;
+ }
+
+
+ public function on_save_bundle_snippets($pars)
+ {
+ $bundle_id = $this->stripFileName($pars['id']);
+ $data = $pars['data'];
+ if ( is_array($data) )
+ {
+ $files = array();
+ $snippets_dir = $this->configuration['support-path'].'/bundles/'.$bundle_id.'/snippets/';
+ foreach ($data as $snippet_xml)
+ {
+ $snippet = new SimpleXMLElement($snippet_xml);
+ $filename = trim((string)$snippet->filename);
+ $snippet_path = $snippets_dir.$filename.'.amSnippet';
+ if ( '' == $filename || !file_exists($snippet_path) )
+ {
+ $filename = $this->getFilenameByName((string)$snippet->name);
+ }
+ $snippet_path = $snippets_dir.$filename.'.amSnippet';
+ $yaml_contents = " name: '".str_replace("'", "\\'", (string)$snippet->name)."'\n";
+ $yaml_contents .= " key_activation: '".str_replace("'", "\\'", (string)$snippet->key_activation)."'\n";
+ $yaml_contents .= " tab_activation: '".str_replace("'", "\\'", (string)$snippet->tab_activation)."'\n";
+
+ $files[$snippet_path] = array($yaml_contents, (string)$snippet->index, $filename);
+ $files[$snippet_path.'Def'] = (string)$snippet->code;
+ }
+ // cleaning snippets directory
+ if ( false !== $d = opendir($snippets_dir) )
+ {
+ while ( false !== $f = readdir($d) )
+ {
+ if ( '.' != $f && '..' != $f )
+ {
+ unlink($snippets_dir.$f);
+ }
+ }
+ closedir($d);
+ }
+ $result = array();
+ // saving new files
+ foreach ($files as $path=>$content)
+ {
+ if ( is_array($content) )
+ {
+ $index = $content[1];
+ $filename = $content[2];
+ $content = $content[0];
+ $result[] = array('index'=>$index, 'filename'=>$filename);
+ }
+ file_put_contents($path, $content);
+ chmod($path, 0666);
+ }
+ //print_r($files);die();
+ self::setResult($result);
+ }
+ self::raiseError('Invalid data posted.');
+ }
+
+ public function on_delete_bundle_snippet($pars)
+ {
+ $bundle_id = $this->stripFileName($pars['id']);
+ $filename = $this->stripFileName($pars['filename']);
+ $snippets_dir = $this->configuration['support-path'].'/bundles/'.$bundle_id.'/snippets/';
+ $snippet_path = $snippets_dir.$filename.'.amSnippet';
+ if ( file_exists($snippet_path) )
+ {
+ unlink($snippet_path);
+ unlink($snippet_path.'Def');
+ self::setResult(true);
+ }
+ self::raiseError('Snippet not found.');
+ }
+
+ public function on_save_bundle_commands($pars)
+ {
+ $bundle_id = $this->stripFileName($pars['id']);
+ $data = $pars['data'];
+ if ( is_array($data) )
+ {
+ $commands_dir = $this->configuration['support-path'].'/bundles/'.$bundle_id.'/commands/';
+ $files = array();
+ foreach ($data as $command_xml)
+ {
+ $command = new SimpleXMLElement($command_xml);
+ $filename = trim((string)$command->filename);
+ $command_path = $commands_dir.$filename.'.amCommand';
+ if ( '' == $filename || !file_exists($command_path) )
+ {
+ $filename = $this->getFilenameByName((string)$command->name);
+ }
+ $command_path = $commands_dir.$filename.'.amCommand';
+ $yaml_contents = " name: '".str_replace("'", "\\'", (string)$command->name)."'\n";
+ $yaml_contents .= " key_activation: '".str_replace("'", "\\'", (string)$command->key_activation)."'\n";
+ $yaml_contents .= " tab_activation: '".str_replace("'", "\\'", (string)$command->tab_activation)."'\n";
+ $yaml_contents .= " input_type: '".str_replace("'", "\\'", (string)$command->input_type)."'\n";
+ $yaml_contents .= " input_type_or: '".str_replace("'", "\\'", (string)$command->input_type_or)."'\n";
+ $yaml_contents .= " output_type: '".str_replace("'", "\\'", (string)$command->output_type)."'\n";
+ $yaml_contents .= " script_env: '".str_replace("'", "\\'", (string)$command->script_env)."'\n";
+
+ $files[$command_path] = array($yaml_contents, (string)$command->index, $filename);
+ $files[$command_path.'Def'] = (string)$command->code;
+ }
+ // cleaning commands directory
+ if ( false !== $d = opendir($commands_dir) )
+ {
+ while ( false !== $f = readdir($d) )
+ {
+ if ( '.' != $f && '..' != $f )
+ {
+ unlink($commands_dir.$f);
+ }
+ }
+ closedir($d);
+ }
+ $result = array();
+ // saving new files
+ foreach ($files as $path=>$content)
+ {
+ if ( is_array($content) )
+ {
+ $index = $content[1];
+ $filename = $content[2];
+ $content = $content[0];
+ $result[] = array('index'=>$index, 'filename'=>$filename);
+ }
+ file_put_contents($path, $content);
+ chmod($path, 0666);
+ }
+ //print_r($files);die();
+ self::setResult($result);
+ }
+ self::raiseError('Invalid data posted.');
+ }
+
+ public function on_delete_bundle_command($pars)
+ {
+ $bundle_id = $this->stripFileName($pars['id']);
+ $filename = $this->stripFileName($pars['filename']);
+ $commands_dir = $this->configuration['support-path'].'/bundles/'.$bundle_id.'/commands/';
+ $command_path = $commands_dir.$filename.'.amCommand';
+ if ( file_exists($command_path) )
+ {
+ unlink($command_path);
+ unlink($command_path.'Def');
+ self::setResult(true);
+ }
+ self::raiseError('Command not found.');
+ }
+
+
+ # _______ collaboration
+
+ #public
+
+ public function on_collaboration_invite($pars)
+ {
+ try
+ {
+ if ('' == $pars['url'] && isset($pars['content']))
+ {
+ // resource not in the project tree
+ $content = $pars['content'];
+ }
+ else
+ {
+ $content = AmyRemoteProject::load_resource($pars['url'], $pars['ticket'], $pars['path']);
+ }
+ if (false === $row = Pg::find_first("SELECT * FROM amy.coll_create(" . $this->user->userId. ", '" . Pg::quote_literal($pars['url']) . "', '" . Pg::quote_literal($pars['path']) . "', '" . Pg::quote_literal($content) . "', '" . Pg::quote_literal($pars['email']) . "', '" . Pg::quote_literal($pars['permission']) . "', '" . Pg::quote_literal($pars['message']) . "', '3:00:00')") )
+ {
+ self::raiseError('Unable to invite: ' . Pg::last_error());
+ }
+ $mail = new Mail($this->user->credentials['email'], $pars['email']);
+ $body = <<<BODY
+Hello, {$this->user->credentials['nickname']} has invited you to collaborate on the document `{$pars['path']}' via the Amy Editor.
+
+----------------------------
+{$pars['message']}
+----------------------------
+
+You can either visit the link http://www.april-child.com/amy/amy.php?invitation_code={$row['invitation_hash']} or (if you have already Amy Editor open) go to the File > Collaboration > Accept ... menu and enter the code: {$row['invitation_hash']}
+
+Cheers,
+Amy Editor.
+BODY;
+ $mail->send('Amy Editor - Invitation to collaboration on ' . $pars['path'], $body);
+ self::setResult($row);
+ }
+ catch (Exception $e)
+ {
+ self::raiseError($e->getMessage());
+ }
+ }
+
+ public function on_collaboration_accept($pars)
+ {
+ if ( false === $row = Pg::find_first("SELECT * FROM amy.coll_accept(" . $this->user->userId. ", '" . Pg::quote_literal($pars['hash']) . "')") )
+ {
+ self::raiseError('Unable to accept: ' . Pg::last_error());
+ }
+ self::setResult($row);
+ }
+
+ public function on_collaboration_stop($pars)
+ {
+ if ( false === $row = Pg::find_first("SELECT * FROM amy.coll_stop(" . Pg::quote_literal($pars['collaborator_id']) . ")") )
+ {
+ self::raiseError('Unable to stop properly: ' . Pg::last_error());
+ }
+ self::setResult(true);
+ }
+
+ public function on_collaboration_get_unread_messages($pars)
+ {
+ $pre_ids = explode(',', $pars['receiver_ids']);
+ $ids = array();
+ foreach ( $pre_ids as $id )
+ {
+ $ids[] = Pg::quote_literal($id);
+ }
+ # checking/reviving existing collaborations
+ if (false === $res = Pg::find('SELECT amy.coll_check_collaborations(ARRAY[' . implode(',', $ids) . '])'))
+ {
+ self::raiseError('Unable to proceed: ' . Pg::last_error());
+ }
+ if (false === $res = Pg::find('SELECT * FROM amy.coll_unread_messages WHERE collaborator_receiver_id IN ('.implode(',', $ids).')'))
+ {
+ self::raiseError('Unable to proceed: ' . Pg::last_error());
+ }
+ $messages = array();
+ while ( false !== $r = @pg_fetch_assoc($res) )
+ {
+ $r['params'] = Pg::parse_array_string($r['params']);
+ $messages[] = $r;
+ }
+ self::setResult($messages);
+ }
+
+ public function on_collaboration_handle_message($pars)
+ {
+ $response = true;
+ if ( 'call' == $pars['routine'] )
+ {
+ $sql = 'SELECT * FROM amy.coll_handle_message('.Pg::quote_literal($pars['collaborator_id']).','.Pg::quote_literal($pars['id']).',';
+ if ( is_array($pars['pars']) )
+ {
+ $n = sizeof($pars['pars']);
+ for ( $i=0; $i<$n; $i++ )
+ {
+ $pars['pars'][$i] = Pg::quote_literal($pars['pars'][$i]);
+ }
+ $sql .= "ARRAY['".implode("','", $pars['pars'])."'])";
+ }
+ else
+ {
+ $sql .= 'NULL)';
+ }
+ if ( false === $res = Pg::find($sql) )
+ {
+ self::raiseError('Unable to handle message: ' . Pg::last_error());
+ // self::raiseError('Unable to handle. ' . $sql . '. ' . Pg::last_error());
+ }
+ $row = pg_fetch_row($res);
+// print_r($row);die();
+ $row = Pg::parse_array_string($row[0]);
+ $response = array();
+// print_r($row);die();
+ foreach ($row as $i=>$value)
+ {
+ $response[] = array('key' => $i, 'value' => $value);
+ }
+ }
+ else
+ {
+ Pg::find('SELECT amy.coll_delete_message('.Pg::quote_literal($pars['id']).')');
+ }
+ self::setResult($response);
+ }
+
+ public function on_collaboration_handle_transactions($pars)
+ {
+ $colls = $pars['colls'];
+ if ( !is_array($colls) )
+ {
+ self::raiseError('Invalid data received.');
+ }
+ $response = array();
+ $n = sizeof($colls);
+ for ( $i=0; $i<$n; $i++ )
+ {
+ $coll = explode('|', $colls[$i]);
+ $document_id = Pg::quote_literal($coll[0]);
+ $collaborator_id = Pg::quote_literal($coll[1]);
+ $last_transid = Pg::quote_literal($coll[2]);
+ unset($coll[0]);
+ unset($coll[1]);
+ unset($coll[2]);
+ $log = Pg::quote_literal(str_replace('\\', '\\\\', implode('|', $coll)));
+
+ $coll_response = array();
+ if ( false !== $res = Pg::find("SELECT * FROM amy.coll_handle_transactions($document_id, $collaborator_id, $last_transid, '$log')") )
+ {
+ while ( false !== $r = pg_fetch_assoc($res) )
+ {
+ $coll_response[] = $r;
+ }
+ }
+ else
+ {
+ $coll_response = Pg::last_error();
+ }
+ $response[] = array('document_id'=>$document_id, 'transactions'=>$coll_response);
+ }
+ self::setResult($response);
+ }
+
+ }
+
+ // _______ end callback function
+ function end_amy_request()
+ {
+ Pg::close_connection();
+ }
+
+ // _______ launcher
+ try
+ {
+ $action = new AmyController($_AMY_CONF);
+ $action->process($_REQUEST['a'], new AmyLogger, 'end_amy_request');
+ }
+ catch ( Exception $e )
+ {
+ AmyController::raiseError( $e->getMessage() );
+ }
+
+?>
124 amy_editor/branches/rails/app/controllers/amy_project_manager_controller.rb
View
@@ -0,0 +1,124 @@
+#++
+# ------------------------------------------------------------------------------------------
+# == Amy Editor ==
+# Collaborative Text and Source Code Editor for Developers
+#
+# Built on the technologies developed and maintained by April-Child.com
+# Copyright (c)2007,2008 Petr Krontorad, April-Child.com.
+#
+# Author: Petr Krontorad, petr@krontorad.com
+#
+# All rights reserved.
+# *------------------------------------------------------------------------------------------
+#
+# Project manager controller
+#
+# *------------------------------------------------------------------------------------------
+#--
+
+require 'uri'
+
+class AmyProjectManagerController < Amy::AbstractApplicationController
+
+ before_filter :check_if_local_access_preferred
+
+ private
+ def check_if_local_access_preferred
+ host = request.env['HTTP_X_FORWARDED_HOST'] ? request.env['HTTP_X_FORWARDED_HOST'] : request.env['HTTP_HOST']
+ unless host.index(':')
+ host = host + ':80'
+ end
+ host = host.split(':')
+ project_url = URI.parse(@params['url'])
+ if host[0] == project_url.host && host[1].to_i == project_url.port
+ Amy::Projects::RemoteProject.set_for_local_access
+ else
+ Amy::Projects::RemoteProject.set_for_remote_access
+ end
+ true
+ end
+
+ public
+
+ def project_check
+ begin
+ set_result Amy::Projects::RemoteProject.new(@params['url'])
+ rescue => e
+ raise_error "Project could not been loaded due an error: `#{e}'."
+ end
+ end
+
+ def project_authenticate
+ begin
+ set_result Amy::Projects::RemoteProject.authenticate(@params['url'], @params['username'], @params['password'])
+ rescue => e
+ raise_error "Project could not been authenticated due an error: `#{e}'"
+ end
+ end
+
+ def project_open
+ begin
+ set_result Amy::Projects::RemoteProject.open(@params['url'], @params['ticket'])
+ rescue => e
+ raise_error "Project could not been opened due an error: `#{e}'"
+ end
+ end
+
+ def project_create_folder_resource
+ begin
+ result = Amy::Projects::RemoteProject.create_folder_resource(@params['url'], @params['ticket'], @params['path'], @params['label'])
+ if result[:flush]
+ response.content_type = 'text/xml; charset=UTF-8'
+ return render(:text => result[:content])
+ end
+ set_result result[:content]
+ rescue => e
+ raise_error "Project folder resource `#{@params['label']}' at `#{@params['path']}' could not been created due an error: `#{e}'."
+ end
+ end
+
+ def project_create_resource
+ begin
+ result = Amy::Projects::RemoteProject.create_resource(@params['url'], @params['ticket'], @params['path'], @params['label'], @params['content'])
+ if result[:flush]
+ response.content_type = 'text/xml; charset=UTF-8'
+ return render(:text => result[:content])
+ end
+ set_result result[:content]
+ rescue => e
+ raise_error "Project resource `#{@params['label']}' at `#{@params['path']}' could not been created due an error: `#{e}'."
+ end
+ end
+
+ def project_load_resource
+ begin
+ result = Amy::Projects::RemoteProject.load_resource(@params['url'], @params['ticket'], @params['path'])
+ if result[:flush]
+ response.content_type = 'text/xml; charset=UTF-8'
+ return render(:text => result[:content])
+ end
+ set_result result[:content]
+ rescue => e
+ raise_error "Project resource at `#{@params['path']}' could not been loaded due an error: `#{e}'."
+ end
+ end
+
+ def project_preview_resource
+ begin
+ resource = Amy::Projects::RemoteProject.preview_resource(@params['url'], @params['ticket'], @params['path'])
+ response.content_type = resource[:content_type]
+ return render(:text => resource[:content])
+ rescue => e
+ raise_error "Project resource preview at `#{@params['path']}' could not been loaded due an error: `#{e}'."
+ end
+ end
+
+ def project_save_resource
+ begin
+ set_result Amy::Projects::RemoteProject.save_resource(@params['url'], @params['ticket'], @params['path'], @params['content'])
+ rescue => e
+ raise_error "Project resource at `#{@params['path']}' could not been saved due an error: `#{e}'."
+ end
+ end
+
+end
53 amy_editor/branches/rails/app/controllers/amy_rexec_controller.rb
View
@@ -0,0 +1,53 @@
+
+class AmyRexecController < Amy::AbstractApplicationController
+
+ def google_search
+ set_result(Amy::Google.search(@params['query']))
+ end
+
+ def run
+ bundle_id = strip_filename(@params['bundle'])
+ scriptname = strip_filename(@params['script'])
+ script_path = amy_support_path + '/bundles/' + bundle_id + '/scripts/' + scriptname + '.rb';
+ return raise_error("Script not found.") unless File.exist?(script_path)
+ begin
+ load script_path
+ run_script(self, @params)
+ rescue => e
+ return raise_error("Error while running the script.");
+ end
+ end
+
+ def command
+ bundle_id = strip_filename(@params['bundle'])
+ command = @params['command'].gsub('..', '')
+ command_path = amy_support_path + '/bundles/' + bundle_id + '/commands/' + command + '.amCommandDef'
+ return raise_error("Command not found.") unless File.exist?(command_path)
+ begin
+ load command_path
+ run_command(self, @params['text'], params)
+ rescue => e
+ return raise_error("Error while executing command: `#{e}'")
+ end
+ end
+
+ def import(bundle_id, library_name)
+ bundle_id = strip_filename(bundle_id)
+ library_name = strip_filename(library_name)
+ path = amy_support_path + '/bundles/' + bundle_id + '/libs/' + library_name + '.rb'
+ return raise_error("Imported library not found.") unless File.exist?(path)
+ begin
+ load path
+ rescue => e
+ return raise_error("Error while importing library.")
+ end
+ end
+
+ def ok(result)
+ set_result result
+ end
+
+ def fail(error)
+ raise_error error
+ end
+end
7 amy_editor/branches/rails/app/controllers/application.rb
View
@@ -0,0 +1,7 @@
+# Filters added to this controller apply to all controllers in the application.
+# Likewise, all the methods added will be available for all controllers.
+
+class ApplicationController < ActionController::Base
+ # Pick a unique cookie name to distinguish our session data from others'
+ session :session_key => '_your_session_id'
+end
15 amy_editor/branches/rails/app/controllers/chap_controller.rb
View
@@ -0,0 +1,15 @@
+class ChapController < ApplicationController
+ act_as_amy
+ act_as_fry
+
+ def get_application_files
+ %w(fry/chap/ac.chap.js fry/chap/ac.chap.view.js fry/chap/ac.chap.settings.js)
+ end
+
+
+ def index
+ @editor = amy_create_editing_component :theme => 'Black', :bundle => 'ruby', :language => 'default', :host_os => (request.env['HTTP_USER_AGENT'].match(/intosh/).nil? ? 'Windows' : 'Mac')
+ # @editor = amy_create_editing_component :theme => 'LAZY', :bundle => 'ruby', :language => 'default', :host_os => (request.env['HTTP_USER_AGENT'].match(/intosh/).nil? ? 'Windows' : 'Mac')
+ end
+
+end
61 amy_editor/branches/rails/app/controllers/projects/playground_controller.rb
View
@@ -0,0 +1,61 @@
+
+class Projects::PlaygroundController < Amy::AbstractProjectController
+
+ def project_conf
+ {
+ :name => 'Amy Playground',
+ :protocol_version => '1.0',
+ :authentication_scheme => 'anyone',
+ :authentication_params => ''
+ }
+ end
+
+ def setup_resource_manager
+ @resource_manager = Amy::Projects::FileResourceManager.new :basepath => File.join(RAILS_ROOT, 'data/playground_test_data'), :omit_files => /^\./
+ end
+
+ def authenticate_user(username, password)
+ 'open-ticket'
+ end
+
+ def is_authenticated(ticket)
+ true
+ end
+
+ def can_user_create(ticket, uri)
+ true
+ end
+
+ def can_user_read(ticket, uri)
+ true
+ end
+
+ def can_user_write(ticket, uri)
+ true
+ end
+
+ def new_collection_resource(ticket, path, label)
+ setup_resource_manager
+ @resource_manager.create_collection(path, label)
+ end
+
+ def new_resource(ticket, path, label, content)
+ setup_resource_manager
+ @resource_manager.create(path, label, content)
+ end
+
+ def get_resource(ticket, path, act_as_preview=false)
+ setup_resource_manager
+ content = @resource_manager.load(path)
+ return content unless act_as_preview
+ render :text => content
+ response.content_type = @resource_manager.content_type(path)
+ end
+
+ def set_resource(ticket, path, content)
+ setup_resource_manager
+ @resource_manager.save(path, content)
+ end
+
+
+end
2  amy_editor/branches/rails/app/helpers/amy_helper.rb
View
@@ -0,0 +1,2 @@
+module AmyHelper
+end
3  amy_editor/branches/rails/app/helpers/application_helper.rb
View
@@ -0,0 +1,3 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+end
2  amy_editor/branches/rails/app/helpers/chap_helper.rb
View
@@ -0,0 +1,2 @@
+module ChapHelper
+end
2  amy_editor/branches/rails/app/helpers/projects/playground_helper.rb
View
@@ -0,0 +1,2 @@
+module Projects::PlaygroundHelper
+end
17 amy_editor/branches/rails/app/views/amy/index.rhtml
View
@@ -0,0 +1,17 @@
+<script type="text/javascript">
+client.conf.user = {
+ id: '<%= @amy_user.user_id %>',
+ username: '<%= @amy_user.username %>',
+ service: '<%= @amy_user.service %>',
+ credentials: {
+ <% @amy_user.credentials.each do |key, value| %>
+ <%= key + ":'#{value}'," %>
+ <% end %>
+ _void:true},
+}
+client.conf.defaultProjectUrl = '<%= @default_project_url %>';
+client.conf.masquerade = '<%= @masquerade %>';
+client.conf.collaboration = {
+ hash: '<%= @collaboration_hash %>'
+}
+</script>
20 amy_editor/branches/rails/app/views/chap/index.rhtml
View
@@ -0,0 +1,20 @@
+<%= render_amy_editing_component @editor %>
+
+<script type="text/javascript">
+client.onstart = function()
+{
+ init_chap_component();
+ var source = 'class Hello\n\tdef world\n\t\tputs "Say hello!"\n\tend\nend';
+
+ var chap = $new(ac.chap.Window, {language:ac.chap.lang.RubyDefault, keymap:ac.chap.RubyKeyMap});
+ $('editor').t('');
+ <%= render_amy_addview @editor, :node => 'editor', :tabelator => ' ' %>
+ chap.setSnippets(ac.chap.getRubySnippets());
+ chap.show();
+ chap.edit(source);
+ // console.log(chap);
+}
+</script>
+
+<div id="editor" style="width:700px;height:600px;border:1px solid black">
+</div>
27 amy_editor/branches/rails/app/views/layouts/amy.rhtml
View
@@ -0,0 +1,27 @@
+<%= fry_mvc_app @app_options %>
+
+<div id="splash">
+ <h1>Amy Editor 1.0</h1>
+ <p>A Collaborative Text and Source Code Editor for Developers.</p>
+ <strong>.</strong>
+ <p style="text-align:right;font-size:0.9em;display:none">Written and designed by Petr Krontorád</p>
+</div>
+
+<div id="no-js-notice">
+ If you see this message, your browser cannot run the editor at the moment. Please make sure your browser settings does not prohibit use of JavaScript.
+</div>
+<script type="text/javascript">
+ var notice = document.getElementById('no-js-notice');
+ notice.parentNode.removeChild(notice);
+</script>
+
+<div id="no-support-notice" style="display:none">
+ Your browser cannot run the editor. Please use one of the following: Safari, Firefox or any browser based on these (Camino, ...). If you are courageous though, you may <a href="javascript:client.onstart(true)">launch the editor here</a>, but please be warned, there are probably some unresolved issues in the various state of annoyance that might prevent using some parts of the editor...
+</div>
+
+ <!-- serves only for saving files to disk -->
+ <iframe name="_download" style="visibility:hidden" id="_download" src="about:blank"></iframe>
+
+ <%= yield %>
+
+<%= fry_mvc_app :end => true %>
19 amy_editor/branches/rails/app/views/layouts/chap.rhtml
View
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>Chap Text-Editing control - demo</title>
+ <%= fry_include :client_conf => true %>
+ <%= fry_include :loader => true, :backend_controller => '/chap' %>
+
+</head>
+
+<body>
+
+ <%= yield %>
+
+</body>
+</html>
1  amy_editor/branches/rails/app/views/projects/playground/index.rhtml
View
@@ -0,0 +1 @@
+<h1>Hello, this is a Amy Playground project</h1>
39 amy_editor/branches/rails/config/boot.rb
View
@@ -0,0 +1,39 @@
+# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
+
+RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
+
+unless defined?(Rails::Initializer)
+ if File.directory?("#{RAILS_ROOT}/vendor/rails")
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+ else
+ require 'rubygems'
+
+ rails_gem_version =
+ if defined? RAILS_GEM_VERSION
+ RAILS_GEM_VERSION
+ else
+ File.read("#{File.dirname(__FILE__)}/environment.rb") =~ /^[^#]*RAILS_GEM_VERSION\s+=\s+'([\d.]+)'/
+ $1
+ end
+
+ if rails_gem_version
+ rails_gem = Gem.cache.search('rails', "=#{rails_gem_version}.0").sort_by { |g| g.version.version }.last
+
+ if rails_gem
+ gem "rails", "=#{rails_gem.version.version}"
+ require rails_gem.full_gem_path + '/lib/initializer'
+ else
+ STDERR.puts %(Cannot find gem for Rails =#{rails_gem_version}.0:
+ Install the missing gem with 'gem install -v=#{rails_gem_version} rails', or
+ change environment.rb to define RAILS_GEM_VERSION with your desired version.
+ )
+ exit 1
+ end
+ else
+ gem "rails"
+ require 'initializer'
+ end
+ end
+
+ Rails::Initializer.run(:set_load_path)
+end
58 amy_editor/branches/rails/config/database.yml
View
@@ -0,0 +1,58 @@
+# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
+#
+# Install the MySQL driver:
+# gem install mysql
+# On MacOS X:
+# gem install mysql -- --include=/usr/local/lib
+# On Windows:
+# gem install mysql
+# Choose the win32 build.
+# Install MySQL and put its /bin directory on your path.
+#
+# And be sure to use new-style password hashing:
+# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
+
+
+# Amy runs on PostgreSQL, please fill out the following section:
+amy_editor:
+ # adapter: postgresql
+ # database: amy_editor_development
+ # encoding: unicode
+ # username: p
+ # password:
+
+ adapter: mysql
+ database: amy_editor
+ username: root
+ password: whoa
+ encoding: utf8
+ host: localhost
+
+
+# This is your standard configuration, Amy won't interfere with that:
+development:
+ adapter: mysql
+ database: yourapp_development
+ username: root
+ password:
+ encoding: utf8
+ host: localhost
+
+# Warning: The database defined as 'test' will be erased and
+# re-generated from your development database when you run 'rake'.
+# Do not set this db to the same as development or production.
+test:
+ adapter: mysql
+ database: yourapp_test
+ username: root
+ password:
+ encoding: utf8
+ host: localhost
+
+production:
+ adapter: mysql
+ database: yourapp_production
+ username: root
+ password:
+ encoding: utf8
+ host: localhost
60 amy_editor/branches/rails/config/environment.rb
View
@@ -0,0 +1,60 @@
+# Be sure to restart your web server when you modify this file.
+
+# Uncomment below to force Rails into production mode when
+# you don't control web/app server and can't set it the proper way
+# ENV['RAILS_ENV'] ||= 'production'
+
+# Specifies gem version of Rails to use when vendor/rails is not present
+RAILS_GEM_VERSION = '1.2.5' unless defined? RAILS_GEM_VERSION
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+
+Rails::Initializer.run do |config|
+ # Settings in config/environments/* take precedence over those specified here
+
+ # Skip frameworks you're not going to use (only works if using vendor/rails)
+ # config.frameworks -= [ :action_web_service, :action_mailer ]
+
+ # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
+ # config.plugins = %W( exception_notification ssl_requirement )
+
+ # Add additional load paths for your own custom dirs
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
+
+ # Force all environments to use the same logger level
+ # (by default production uses :info, the others :debug)
+ # config.log_level = :debug
+
+ # Use the database for sessions instead of the file system
+ # (create the session table with 'rake db:sessions:create')
+ # config.action_controller.session_store = :active_record_store
+
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Activate observers that should always be running
+ # config.active_record.observers = :cacher, :garbage_collector
+
+ # Make Active Record use UTC-base instead of local time
+ # config.active_record.default_timezone = :utc
+
+ # Add new inflection rules using the following format
+ # (all these examples are active by default):
+ # Inflector.inflections do |inflect|
+ # inflect.plural /^(ox)$/i, '\1en'
+ # inflect.singular /^(ox)en/i, '\1'
+ # inflect.irregular 'person', 'people'
+ # inflect.uncountable %w( fish sheep )
+ # end
+
+ # See Rails::Configuration for more options
+end
+
+# Add new mime types for use in respond_to blocks:
+# Mime::Type.register "text/richtext", :rtf
+# Mime::Type.register "application/x-mobile", :mobile
+
+# Include your application configuration below
21 amy_editor/branches/rails/config/environments/development.rb
View
@@ -0,0 +1,21 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# In the development environment your application's code is reloaded on
+# every request. This slows down response time but is perfect for development
+# since you don't have to restart the webserver when you make code changes.
+config.cache_classes = false
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Enable the breakpoint server that script/breakpointer connects to
+config.breakpoint_server = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = false
+config.action_view.cache_template_extensions = false
+config.action_view.debug_rjs = true
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false
18 amy_editor/branches/rails/config/environments/production.rb
View
@@ -0,0 +1,18 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The production environment is meant for finished, "live" apps.
+# Code is not reloaded between requests
+config.cache_classes = true
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
+# Full error reports are disabled and caching is turned on
+config.action_controller.consider_all_requests_local = false
+config.action_controller.perform_caching = true
+
+# Enable serving of images, stylesheets, and javascripts from an asset server
+# config.action_controller.asset_host = "http://assets.example.com"
+
+# Disable delivery errors, bad email addresses will be ignored
+# config.action_mailer.raise_delivery_errors = false
19 amy_editor/branches/rails/config/environments/test.rb
View
@@ -0,0 +1,19 @@
+# Settings specified here will take precedence over those in config/environment.rb
+
+# The test environment is used exclusively to run your application's
+# test suite. You never need to work with it otherwise. Remember that
+# your test database is "scratch space" for the test suite and is wiped
+# and recreated between test runs. Don't rely on the data there!
+config.cache_classes = true
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching = false
+
+# Tell ActionMailer not to deliver emails to the real world.
+# The :test delivery method accumulates sent emails in the
+# ActionMailer::Base.deliveries array.
+config.action_mailer.delivery_method = :test
23 amy_editor/branches/rails/config/routes.rb
View
@@ -0,0 +1,23 @@
+ActionController::Routing::Routes.draw do |map|
+ # The priority is based upon order of creation: first created -> highest priority.
+
+ # Sample of regular route:
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # You can have the root of your site routed by hooking up ''
+ # -- just remember to delete public/index.html.
+ # map.connect '', :controller => "welcome"
+
+ # Allow downloading Web Service WSDL as a file with an extension
+ # instead of a file named 'wsdl'
+ map.connect ':controller/service.wsdl', :action => 'wsdl'
+
+ # Install the default route as the lowest priority.
+ map.connect ':controller/:action/:id.:format'
+ map.connect ':controller/:action/:id'
+end
1  amy_editor/branches/rails/data/amy_support/amy_default
View
1  amy_editor/branches/rails/data/playground_test_data
View
13 amy_editor/branches/rails/db/migrate/001_setup_amy_editor.rb
View
@@ -0,0 +1,13 @@
+class SetupAmyEditor < ActiveRecord::Migration
+ def self.up
+ ActiveRecord::Base.establish_connection 'amy_editor'
+ execute File.read(File.join(RAILS_ROOT, 'db/setup_amy_editor.sql'))
+ ActiveRecord::Base.establish_connection 'development'
+ end
+
+ def self.down
+ ActiveRecord::Base.establish_connection 'amy_editor'
+ execute 'DROP SCHEMA amy CASCADE'
+ ActiveRecord::Base.establish_connection 'development'
+ end
+end
7 amy_editor/branches/rails/db/schema.rb
View
@@ -0,0 +1,7 @@
+# This file is autogenerated. Instead of editing this file, please use the
+# migrations feature of ActiveRecord to incrementally modify your database, and
+# then regenerate this schema definition.
+
+ActiveRecord::Schema.define(:version => 1) do
+
+end
1  amy_editor/branches/rails/db/setup_amy_editor.sql
View
23 amy_editor/branches/rails/doc/README_FOR_APP
View
@@ -0,0 +1,23 @@
+Amy Editor
+==========
+
+Installation
+------------
+
+Edit config/database.yml file, you can leave your definition, Amy Editor will use its own section:
+
+amy_editor:
+ adapter: postgresql
+ database: amy_editor_development
+ encoding: unicode
+ username: p
+ password:
+
+In order to create new database, enter: createdb amy_editor_development -E UTF8, where amy_editor_development will be replaced with your name (if needed).
+
+You can see, Amy Editor can use different database, you don't have to integrate it into existing schema. But you can, Amy tables and stored procedures all reside in its own `amy' schema, it's very unlikely you have already used this. Amy also doesn't use any Rails ActiveRecord features, it has its own simple PostgreSQL adapter and attempts to NOT clash with your existing application in any way. It's not that I don't like AR or Rails, it's designed this way solely for smooth integration purposes.
+
+Run rake db:migrate, this will create new `amy' scheme in your database (specified in amy_editor section of database.yml file).
+
+You are set. Start mongrel `mongrel_rails start' or any server you use and point your browser at the http://localhost:3000/amy location (by default).
+
40 amy_editor/branches/rails/public/.htaccess
View
@@ -0,0 +1,40 @@
+# General Apache options
+AddHandler fastcgi-script .fcgi
+AddHandler cgi-script .cgi
+Options +FollowSymLinks +ExecCGI
+
+# If you don't want Rails to look in certain directories,
+# use the following rewrite rules so that Apache won't rewrite certain requests
+#
+# Example:
+# RewriteCond %{REQUEST_URI} ^/notrails.*
+# RewriteRule .* - [L]
+
+# Redirect all requests not available on the filesystem to Rails
+# By default the cgi dispatcher is used which is very slow
+#
+# For better performance replace the dispatcher with the fastcgi one
+#
+# Example:
+# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
+RewriteEngine On
+
+# If your Rails application is accessed via an Alias directive,
+# then you MUST also set the RewriteBase in this htaccess file.
+#
+# Example:
+# Alias /myrailsapp /path/to/myrailsapp/public
+# RewriteBase /myrailsapp
+
+RewriteRule ^$ index.html [QSA]
+RewriteRule ^([^.]+)$ $1.html [QSA]
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
+
+# In case Rails experiences terminal errors
+# Instead of displaying this message you can supply a file here which will be rendered instead
+#
+# Example:
+# ErrorDocument 500 /500.html
+
+ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
30 amy_editor/branches/rails/public/404.html
View
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>The page you were looking for doesn't exist (404)</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/404.html -->
+ <div class="dialog">
+ <h1>The page you were looking for doesn't exist.</h1>
+ <p>You may have mistyped the address or the page may have moved.</p>
+ </div>
+</body>
+</html>
30 amy_editor/branches/rails/public/500.html
View
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>We're sorry, but something went wrong</title>
+ <style type="text/css">
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
+ div.dialog {
+ width: 25em;
+ padding: 0 4em;
+ margin: 4em auto 0 auto;
+ border: 1px solid #ccc;
+ border-right-color: #999;
+ border-bottom-color: #999;
+ }
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
+ </style>
+</head>
+
+<body>
+ <!-- This file lives in public/500.html -->
+ <div class="dialog">
+ <h1>We're sorry, but something went wrong.</h1>
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
+ </div>
+</body>
+</html>
1  amy_editor/branches/rails/public/contents
View
10 amy_editor/branches/rails/public/dispatch.cgi
View
@@ -0,0 +1,10 @@
+#!/usr/local/bin/ruby
+
+require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
+
+# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
+# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
+require "dispatcher"
+
+ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
+Dispatcher.dispatch
24 amy_editor/branches/rails/public/dispatch.fcgi
View
@@ -0,0 +1,24 @@
+#!/usr/local/bin/ruby
+#
+# You may specify the path to the FastCGI crash log (a log of unhandled
+# exceptions which forced the FastCGI instance to exit, great for debugging)
+# and the number of requests to process before running garbage collection.
+#
+# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
+# and the GC period is nil (turned off). A reasonable number of requests
+# could range from 10-100 depending on the memory footprint of your app.
+#
+# Example:
+# # Default log path, normal GC behavior.
+# RailsFCGIHandler.process!
+#
+# # Default log path, 50 requests between GC.
+# RailsFCGIHandler.process! nil, 50
+#
+# # Custom log path, normal GC behavior.
+# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
+#
+require File.dirname(__FILE__) + "/../config/environment"
+require 'fcgi_handler'
+
+RailsFCGIHandler.process!
10 amy_editor/branches/rails/public/dispatch.rb
View
@@ -0,0 +1,10 @@
+#!/usr/local/bin/ruby
+
+require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
+
+# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
+# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
+require "dispatcher"
+
+ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
+Dispatcher.dispatch
1  amy_editor/branches/rails/public/favicon.ico
View
BIN  amy_editor/branches/rails/public/images/rails.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
277 amy_editor/branches/rails/public/index.html
View
@@ -0,0 +1,277 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>Ruby on Rails: Welcome aboard</title>
+ <style type="text/css" media="screen">
+ body {
+ margin: 0;
+ margin-bottom: 25px;
+ padding: 0;
+ background-color: #f0f0f0;
+ font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
+ font-size: 13px;
+ color: #333;
+ }
+
+ h1 {
+ font-size: 28px;
+ color: #000;
+ }
+
+ a {color: #03c}
+ a:hover {
+ background-color: #03c;
+ color: white;
+ text-decoration: none;
+ }
+
+
+ #page {
+ background-color: #f0f0f0;
+ width: 750px;
+ margin: 0;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ #content {
+ float: left;
+ background-color: white;
+ border: 3px solid #aaa;
+ border-top: none;
+ padding: 25px;
+ width: 500px;
+ }
+
+ #sidebar {
+ float: right;
+ width: 175px;
+ }
+
+ #footer {
+ clear: both;
+ }
+
+
+ #header, #about, #getting-started {
+ padding-left: 75px;
+ padding-right: 30px;
+ }
+
+
+ #header {
+ background-image: url("images/rails.png");
+ background-repeat: no-repeat;
+ background-position: top left;
+ height: 64px;
+ }
+ #header h1, #header h2 {margin: 0}
+ #header h2 {
+ color: #888;
+ font-weight: normal;
+ font-size: 16px;
+ }
+
+
+ #about h3 {
+ margin: 0;
+ margin-bottom: 10px;
+ font-size: 14px;
+ }
+
+ #about-content {
+ background-color: #ffd;
+ border: 1px solid #fc0;
+ margin-left: -11px;
+ }
+ #about-content table {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size: 11px;
+ border-collapse: collapse;
+ }
+ #about-content td {
+ padding: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ }
+ #about-content td.name {color: #555}
+ #about-content td.value {color: #000}
+
+ #about-content.failure {
+ background-color: #fcc;
+ border: 1px solid #f00;
+ }
+ #about-content.failure p {
+ margin: 0;
+ padding: 10px;
+ }
+
+
+ #getting-started {
+ border-top: 1px solid #ccc;
+ margin-top: 25px;
+ padding-top: 15px;
+ }
+ #getting-started h1 {
+ margin: 0;
+ font-size: 20px;
+ }
+ #getting-started h2 {
+ margin: 0;
+ font-size: 14px;
+ font-weight: normal;
+ color: #333;
+ margin-bottom: 25px;
+ }
+ #getting-started ol {
+ margin-left: 0;
+ padding-left: 0;
+ }
+ #getting-started li {
+ font-size: 18px;
+ color: #888;
+ margin-bottom: 25px;
+ }
+ #getting-started li h2 {
+ margin: 0;
+ font-weight: