ds-kitsune 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (372) hide show
  1. data/.gitignore +4 -0
  2. data/.specification +447 -0
  3. data/README.textile +16 -0
  4. data/Rakefile +30 -0
  5. data/VERSION +1 -0
  6. data/app/controllers/admin/kitsune/application_controller.rb +3 -0
  7. data/app/controllers/admin/kitsune/kitsune_controller.rb +87 -0
  8. data/app/controllers/admin/kitsune/kitsune_users_controller.rb +20 -0
  9. data/app/controllers/admin/kitsune/media_controller.rb +27 -0
  10. data/app/controllers/admin/kitsune/models_controller.rb +10 -0
  11. data/app/controllers/admin/kitsune/pages_controller.rb +35 -0
  12. data/app/controllers/admin/kitsune/records_controller.rb +98 -0
  13. data/app/controllers/admin/kitsune/sessions_controller.rb +23 -0
  14. data/app/controllers/kitsune_controller.rb +8 -0
  15. data/app/helpers/admin/kitsune/records_helper.rb +39 -0
  16. data/app/views/admin/kitsune/kitsune_users/index.html.haml +19 -0
  17. data/app/views/admin/kitsune/kitsune_users/new.html.haml +19 -0
  18. data/app/views/admin/kitsune/media/new.html.erb +49 -0
  19. data/app/views/admin/kitsune/models/index.html.haml +1 -0
  20. data/app/views/admin/kitsune/pages/_form.html.erb +13 -0
  21. data/app/views/admin/kitsune/pages/edit.html.erb +7 -0
  22. data/app/views/admin/kitsune/pages/index.html.erb +5 -0
  23. data/app/views/admin/kitsune/pages/new.html.erb +7 -0
  24. data/app/views/admin/kitsune/records/_form.html.haml +27 -0
  25. data/app/views/admin/kitsune/records/_list.html.haml +26 -0
  26. data/app/views/admin/kitsune/records/edit.html.haml +6 -0
  27. data/app/views/admin/kitsune/records/index.html.haml +13 -0
  28. data/app/views/admin/kitsune/records/new.html.haml +6 -0
  29. data/app/views/admin/kitsune/records/show.html.haml +11 -0
  30. data/app/views/admin/kitsune/sessions/new.html.haml +12 -0
  31. data/app/views/admin/kitsune/shared/_flashes.html.haml +6 -0
  32. data/app/views/kitsune/show.html.erb +8 -0
  33. data/app/views/kitsune/show.html.haml +5 -0
  34. data/app/views/layouts/admin/kitsune.html.erb +66 -0
  35. data/config/kitsune_routes.rb +21 -0
  36. data/doc/developers.html +38 -0
  37. data/generators/kitsune/USAGE +1 -0
  38. data/generators/kitsune/kitsune_generator.rb +67 -0
  39. data/generators/kitsune/lib/insert_commands.rb +31 -0
  40. data/generators/kitsune/templates/README +18 -0
  41. data/generators/kitsune/templates/VERSIONED_README +19 -0
  42. data/generators/kitsune/templates/images/back-arrow.gif +0 -0
  43. data/generators/kitsune/templates/images/bg.jpg +0 -0
  44. data/generators/kitsune/templates/images/box-shadow.png +0 -0
  45. data/generators/kitsune/templates/images/content-bg.gif +0 -0
  46. data/generators/kitsune/templates/images/form-bg.gif +0 -0
  47. data/generators/kitsune/templates/images/grey-btn.png +0 -0
  48. data/generators/kitsune/templates/images/header-bg.gif +0 -0
  49. data/generators/kitsune/templates/images/header-link.png +0 -0
  50. data/generators/kitsune/templates/images/nicEditorIcons.gif +0 -0
  51. data/generators/kitsune/templates/javascripts/jquery.js +19 -0
  52. data/generators/kitsune/templates/javascripts/kitsune_jquery.js +10 -0
  53. data/generators/kitsune/templates/javascripts/tiny_mce/langs/en.js +154 -0
  54. data/generators/kitsune/templates/javascripts/tiny_mce/license.txt +504 -0
  55. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  56. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  57. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +54 -0
  58. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
  59. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +5 -0
  60. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advhr/rule.htm +62 -0
  61. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  62. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  63. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +47 -0
  64. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/image.htm +237 -0
  65. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  66. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/js/image.js +443 -0
  67. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +43 -0
  68. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  69. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  70. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +58 -0
  71. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/js/advlink.js +528 -0
  72. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +52 -0
  73. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/advlink/link.htm +338 -0
  74. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  75. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +114 -0
  76. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  77. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +51 -0
  78. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  79. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +117 -0
  80. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  81. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +95 -0
  82. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  83. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +79 -0
  84. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  85. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +40 -0
  86. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/emotions.htm +40 -0
  87. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  88. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  89. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  90. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  91. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  92. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  93. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  94. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  95. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  96. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  97. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  98. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  99. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  100. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  101. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  102. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  103. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  104. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  105. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/dialog.htm +27 -0
  106. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
  107. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +81 -0
  108. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
  109. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/js/dialog.js +19 -0
  110. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/langs/en.js +3 -0
  111. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  112. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
  113. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  114. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +146 -0
  115. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +576 -0
  116. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +461 -0
  117. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  118. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  119. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +145 -0
  120. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -0
  121. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  122. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +51 -0
  123. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  124. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +632 -0
  125. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  126. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  127. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  128. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  129. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  130. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  131. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  132. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  133. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  134. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  135. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +80 -0
  136. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  137. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +209 -0
  138. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/css/content.css +6 -0
  139. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/css/media.css +16 -0
  140. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
  141. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +411 -0
  142. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/flash.gif +0 -0
  143. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/flv_player.swf +0 -0
  144. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/quicktime.gif +0 -0
  145. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/realmedia.gif +0 -0
  146. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/shockwave.gif +0 -0
  147. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/trans.gif +0 -0
  148. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +0 -0
  149. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/js/embed.js +73 -0
  150. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/js/media.js +630 -0
  151. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +103 -0
  152. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/media/media.htm +822 -0
  153. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  154. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +50 -0
  155. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  156. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +87 -0
  157. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/css/content.css +1 -0
  158. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  159. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +74 -0
  160. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +0 -0
  161. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +0 -0
  162. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  163. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +531 -0
  164. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  165. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  166. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  167. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/pastetext.htm +33 -0
  168. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/paste/pasteword.htm +27 -0
  169. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  170. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +50 -0
  171. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/example.html +28 -0
  172. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  173. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/preview/preview.html +17 -0
  174. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
  175. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +31 -0
  176. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/safari/blank.htm +1 -0
  177. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/safari/editor_plugin.js +1 -0
  178. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/safari/editor_plugin_src.js +438 -0
  179. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
  180. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +98 -0
  181. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  182. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  183. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +54 -0
  184. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +126 -0
  185. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  186. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +104 -0
  187. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  188. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  189. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +338 -0
  190. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  191. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/css/props.css +13 -0
  192. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
  193. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +52 -0
  194. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/js/props.js +641 -0
  195. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +63 -0
  196. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/style/props.htm +730 -0
  197. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  198. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +109 -0
  199. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/cell.htm +183 -0
  200. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/css/cell.css +17 -0
  201. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/css/row.css +25 -0
  202. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/css/table.css +13 -0
  203. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
  204. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +1202 -0
  205. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/cell.js +269 -0
  206. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/merge_cells.js +29 -0
  207. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/row.js +212 -0
  208. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/js/table.js +440 -0
  209. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  210. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/merge_cells.htm +37 -0
  211. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/row.htm +160 -0
  212. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/table/table.htm +192 -0
  213. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/blank.htm +12 -0
  214. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/css/template.css +23 -0
  215. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
  216. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +156 -0
  217. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/js/template.js +106 -0
  218. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  219. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/template/template.htm +38 -0
  220. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  221. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +73 -0
  222. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  223. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +95 -0
  224. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +148 -0
  225. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +148 -0
  226. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +153 -0
  227. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +148 -0
  228. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  229. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  230. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +169 -0
  231. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  232. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +136 -0
  233. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +169 -0
  234. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +25 -0
  235. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +25 -0
  236. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +123 -0
  237. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +25 -0
  238. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +60 -0
  239. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +231 -0
  240. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +59 -0
  241. data/generators/kitsune/templates/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  242. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/about.htm +56 -0
  243. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/anchor.htm +31 -0
  244. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
  245. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/color_picker.htm +75 -0
  246. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
  247. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1153 -0
  248. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/image.htm +85 -0
  249. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  250. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  251. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/about.js +72 -0
  252. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/anchor.js +37 -0
  253. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/charmap.js +325 -0
  254. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/color_picker.js +253 -0
  255. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/image.js +245 -0
  256. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/link.js +156 -0
  257. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/js/source_editor.js +62 -0
  258. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/langs/en.js +62 -0
  259. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +51 -0
  260. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/link.htm +63 -0
  261. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/content.css +32 -0
  262. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +116 -0
  263. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  264. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  265. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  266. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  267. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  268. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  269. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +214 -0
  270. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +32 -0
  271. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +115 -0
  272. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  273. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  274. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  275. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
  276. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  277. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  278. data/generators/kitsune/templates/javascripts/tiny_mce/themes/advanced/source_editor.htm +31 -0
  279. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/about.htm +56 -0
  280. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/anchor.htm +31 -0
  281. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/charmap.htm +53 -0
  282. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/color_picker.htm +75 -0
  283. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/editor_template.js +1153 -0
  284. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/editor_template_src.js +1153 -0
  285. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/image.htm +65 -0
  286. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/images.json +8 -0
  287. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/img/colorpicker.jpg +0 -0
  288. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/img/icons.gif +0 -0
  289. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/about.js +72 -0
  290. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/anchor.js +37 -0
  291. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/charmap.js +325 -0
  292. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/color_picker.js +253 -0
  293. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/image.js +260 -0
  294. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/link.js +156 -0
  295. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/js/source_editor.js +62 -0
  296. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/langs/en.js +62 -0
  297. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/langs/en_dlg.js +51 -0
  298. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/link.htm +63 -0
  299. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/content.css +32 -0
  300. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/dialog.css +184 -0
  301. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/buttons.png +0 -0
  302. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/items.gif +0 -0
  303. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/menu_arrow.gif +0 -0
  304. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/menu_check.gif +0 -0
  305. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/progress.gif +0 -0
  306. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/img/tabs.gif +0 -0
  307. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/default/ui.css +214 -0
  308. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/content.css +32 -0
  309. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/dialog.css +115 -0
  310. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/img/button_bg.png +0 -0
  311. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/img/button_bg_black.png +0 -0
  312. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/img/button_bg_silver.png +0 -0
  313. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/ui.css +215 -0
  314. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/ui_black.css +8 -0
  315. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/skins/o2k7/ui_silver.css +5 -0
  316. data/generators/kitsune/templates/javascripts/tiny_mce/themes/kitsune/source_editor.htm +31 -0
  317. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/editor_template.js +1 -0
  318. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/editor_template_src.js +85 -0
  319. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
  320. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/langs/en.js +11 -0
  321. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
  322. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  323. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  324. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  325. data/generators/kitsune/templates/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  326. data/generators/kitsune/templates/javascripts/tiny_mce/tiny_mce.js +1 -0
  327. data/generators/kitsune/templates/javascripts/tiny_mce/tiny_mce_popup.js +5 -0
  328. data/generators/kitsune/templates/javascripts/tiny_mce/tiny_mce_src.js +13231 -0
  329. data/generators/kitsune/templates/javascripts/tiny_mce/utils/editable_selects.js +69 -0
  330. data/generators/kitsune/templates/javascripts/tiny_mce/utils/form_utils.js +199 -0
  331. data/generators/kitsune/templates/javascripts/tiny_mce/utils/mctabs.js +76 -0
  332. data/generators/kitsune/templates/javascripts/tiny_mce/utils/validate.js +219 -0
  333. data/generators/kitsune/templates/javascripts/upload_maker.js +19 -0
  334. data/generators/kitsune/templates/kitsune_user.rb +3 -0
  335. data/generators/kitsune/templates/migrations/create_kitsune_users.rb +15 -0
  336. data/generators/kitsune/templates/migrations/create_pages.rb +16 -0
  337. data/generators/kitsune/templates/page.rb +3 -0
  338. data/generators/kitsune/templates/stylesheets/global.css +445 -0
  339. data/generators/kitsune/templates/stylesheets/ie.css +3 -0
  340. data/generators/kitsune_flat_files/kitsune_flat_files_generator.rb +8 -0
  341. data/generators/kitsune_flat_files/templates/index.html.erb +35 -0
  342. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/models/_form.html.erb +16 -0
  343. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/models/index.html.erb +2 -0
  344. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/_form.html.erb +13 -0
  345. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/edit.html.erb +7 -0
  346. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/index.html.erb +5 -0
  347. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/pages/new.html.erb +7 -0
  348. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/_form.html.erb +21 -0
  349. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/_list.html.erb +38 -0
  350. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/edit.html.erb +15 -0
  351. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/index.html.erb +13 -0
  352. data/generators/kitsune_flat_files/templates/views/erb/admin/kitsune/records/new.html.erb +8 -0
  353. data/generators/kitsune_flat_files/templates/views/erb/kitsune/show.html.erb +1 -0
  354. data/generators/kitsune_flat_files/templates/views/erb/layouts/admin/kitsune.html.erb +46 -0
  355. data/kitsune.gemspec +419 -0
  356. data/lib/kitsune/active_record.rb +36 -0
  357. data/lib/kitsune/builder.rb +236 -0
  358. data/lib/kitsune/extensions/routes.rb +15 -0
  359. data/lib/kitsune/faux_column.rb +8 -0
  360. data/lib/kitsune/form_helper_ext.rb +23 -0
  361. data/lib/kitsune/inspector.rb +268 -0
  362. data/lib/kitsune/layout.rb +15 -0
  363. data/lib/kitsune/mongo_mapper.rb +49 -0
  364. data/lib/kitsune/page.rb +70 -0
  365. data/lib/kitsune.rb +53 -0
  366. data/lib/kitsune_user.rb +49 -0
  367. data/rails/init.rb +7 -0
  368. data/test/builder_test.rb +9 -0
  369. data/test/inspector_test.rb +13 -0
  370. data/test/schema.rb +23 -0
  371. data/test/test_helper.rb +11 -0
  372. metadata +451 -0
@@ -0,0 +1,632 @@
1
+ /**
2
+ * $Id: editor_plugin_src.js 1150 2009-06-01 11:50:46Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+ (function() {
9
+ var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
10
+
11
+ tinymce.create('tinymce.plugins.InlinePopups', {
12
+ init : function(ed, url) {
13
+ // Replace window manager
14
+ ed.onBeforeRenderUI.add(function() {
15
+ ed.windowManager = new tinymce.InlineWindowManager(ed);
16
+ DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
17
+ });
18
+ },
19
+
20
+ getInfo : function() {
21
+ return {
22
+ longname : 'InlinePopups',
23
+ author : 'Moxiecode Systems AB',
24
+ authorurl : 'http://tinymce.moxiecode.com',
25
+ infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
26
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
27
+ };
28
+ }
29
+ });
30
+
31
+ tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
32
+ InlineWindowManager : function(ed) {
33
+ var t = this;
34
+
35
+ t.parent(ed);
36
+ t.zIndex = 300000;
37
+ t.count = 0;
38
+ t.windows = {};
39
+ },
40
+
41
+ open : function(f, p) {
42
+ var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u;
43
+
44
+ f = f || {};
45
+ p = p || {};
46
+
47
+ // Run native windows
48
+ if (!f.inline)
49
+ return t.parent(f, p);
50
+
51
+ // Only store selection if the type is a normal window
52
+ if (!f.type)
53
+ t.bookmark = ed.selection.getBookmark(1);
54
+
55
+ id = DOM.uniqueId();
56
+ vp = DOM.getViewPort();
57
+ f.width = parseInt(f.width || 320);
58
+ f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
59
+ f.min_width = parseInt(f.min_width || 150);
60
+ f.min_height = parseInt(f.min_height || 100);
61
+ f.max_width = parseInt(f.max_width || 2000);
62
+ f.max_height = parseInt(f.max_height || 2000);
63
+ f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
64
+ f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
65
+ f.movable = f.resizable = true;
66
+ p.mce_width = f.width;
67
+ p.mce_height = f.height;
68
+ p.mce_inline = true;
69
+ p.mce_window_id = id;
70
+ p.mce_auto_focus = f.auto_focus;
71
+
72
+ // Transpose
73
+ // po = DOM.getPos(ed.getContainer());
74
+ // f.left -= po.x;
75
+ // f.top -= po.y;
76
+
77
+ t.features = f;
78
+ t.params = p;
79
+ t.onOpen.dispatch(t, f, p);
80
+
81
+ if (f.type) {
82
+ opt += ' mceModal';
83
+
84
+ if (f.type)
85
+ opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);
86
+
87
+ f.resizable = false;
88
+ }
89
+
90
+ if (f.statusbar)
91
+ opt += ' mceStatusbar';
92
+
93
+ if (f.resizable)
94
+ opt += ' mceResizable';
95
+
96
+ if (f.minimizable)
97
+ opt += ' mceMinimizable';
98
+
99
+ if (f.maximizable)
100
+ opt += ' mceMaximizable';
101
+
102
+ if (f.movable)
103
+ opt += ' mceMovable';
104
+
105
+ // Create DOM objects
106
+ t._addAll(DOM.doc.body,
107
+ ['div', {id : id, 'class' : ed.settings.inlinepopups_skin || 'clearlooks2', style : 'width:100px;height:100px'},
108
+ ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
109
+ ['div', {id : id + '_top', 'class' : 'mceTop'},
110
+ ['div', {'class' : 'mceLeft'}],
111
+ ['div', {'class' : 'mceCenter'}],
112
+ ['div', {'class' : 'mceRight'}],
113
+ ['span', {id : id + '_title'}, f.title || '']
114
+ ],
115
+
116
+ ['div', {id : id + '_middle', 'class' : 'mceMiddle'},
117
+ ['div', {id : id + '_left', 'class' : 'mceLeft'}],
118
+ ['span', {id : id + '_content'}],
119
+ ['div', {id : id + '_right', 'class' : 'mceRight'}]
120
+ ],
121
+
122
+ ['div', {id : id + '_bottom', 'class' : 'mceBottom'},
123
+ ['div', {'class' : 'mceLeft'}],
124
+ ['div', {'class' : 'mceCenter'}],
125
+ ['div', {'class' : 'mceRight'}],
126
+ ['span', {id : id + '_status'}, 'Content']
127
+ ],
128
+
129
+ ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],
130
+ ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
131
+ ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
132
+ ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
133
+ ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
134
+ ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],
135
+ ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],
136
+ ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],
137
+ ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],
138
+ ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],
139
+ ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],
140
+ ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],
141
+ ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]
142
+ ]
143
+ ]
144
+ );
145
+
146
+ DOM.setStyles(id, {top : -10000, left : -10000});
147
+
148
+ // Fix gecko rendering bug, where the editors iframe messed with window contents
149
+ if (tinymce.isGecko)
150
+ DOM.setStyle(id, 'overflow', 'auto');
151
+
152
+ // Measure borders
153
+ if (!f.type) {
154
+ dw += DOM.get(id + '_left').clientWidth;
155
+ dw += DOM.get(id + '_right').clientWidth;
156
+ dh += DOM.get(id + '_top').clientHeight;
157
+ dh += DOM.get(id + '_bottom').clientHeight;
158
+ }
159
+
160
+ // Resize window
161
+ DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
162
+
163
+ u = f.url || f.file;
164
+ if (u) {
165
+ if (tinymce.relaxedDomain)
166
+ u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
167
+
168
+ u = tinymce._addVer(u);
169
+ }
170
+
171
+ if (!f.type) {
172
+ DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
173
+ DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
174
+ DOM.setAttrib(id + '_ifr', 'src', u);
175
+ } else {
176
+ DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
177
+
178
+ if (f.type == 'confirm')
179
+ DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
180
+
181
+ DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
182
+ DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
183
+ }
184
+
185
+ // Register events
186
+ mdf = Event.add(id, 'mousedown', function(e) {
187
+ var n = e.target, w, vp;
188
+
189
+ w = t.windows[id];
190
+ t.focus(id);
191
+
192
+ if (n.nodeName == 'A' || n.nodeName == 'a') {
193
+ if (n.className == 'mceMax') {
194
+ w.oldPos = w.element.getXY();
195
+ w.oldSize = w.element.getSize();
196
+
197
+ vp = DOM.getViewPort();
198
+
199
+ // Reduce viewport size to avoid scrollbars
200
+ vp.w -= 2;
201
+ vp.h -= 2;
202
+
203
+ w.element.moveTo(vp.x, vp.y);
204
+ w.element.resizeTo(vp.w, vp.h);
205
+ DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
206
+ DOM.addClass(id + '_wrapper', 'mceMaximized');
207
+ } else if (n.className == 'mceMed') {
208
+ // Reset to old size
209
+ w.element.moveTo(w.oldPos.x, w.oldPos.y);
210
+ w.element.resizeTo(w.oldSize.w, w.oldSize.h);
211
+ w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
212
+
213
+ DOM.removeClass(id + '_wrapper', 'mceMaximized');
214
+ } else if (n.className == 'mceMove')
215
+ return t._startDrag(id, e, n.className);
216
+ else if (DOM.hasClass(n, 'mceResize'))
217
+ return t._startDrag(id, e, n.className.substring(13));
218
+ }
219
+ });
220
+
221
+ clf = Event.add(id, 'click', function(e) {
222
+ var n = e.target;
223
+
224
+ t.focus(id);
225
+
226
+ if (n.nodeName == 'A' || n.nodeName == 'a') {
227
+ switch (n.className) {
228
+ case 'mceClose':
229
+ t.close(null, id);
230
+ return Event.cancel(e);
231
+
232
+ case 'mceButton mceOk':
233
+ case 'mceButton mceCancel':
234
+ f.button_func(n.className == 'mceButton mceOk');
235
+ return Event.cancel(e);
236
+ }
237
+ }
238
+ });
239
+
240
+ // Add window
241
+ w = t.windows[id] = {
242
+ id : id,
243
+ mousedown_func : mdf,
244
+ click_func : clf,
245
+ element : new Element(id, {blocker : 1, container : ed.getContainer()}),
246
+ iframeElement : new Element(id + '_ifr'),
247
+ features : f,
248
+ deltaWidth : dw,
249
+ deltaHeight : dh
250
+ };
251
+
252
+ w.iframeElement.on('focus', function() {
253
+ t.focus(id);
254
+ });
255
+
256
+ // Setup blocker
257
+ if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
258
+ DOM.add(DOM.doc.body, 'div', {
259
+ id : 'mceModalBlocker',
260
+ 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
261
+ style : {zIndex : t.zIndex - 1}
262
+ });
263
+
264
+ DOM.show('mceModalBlocker'); // Reduces flicker in IE
265
+ } else
266
+ DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
267
+
268
+ if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
269
+ DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
270
+
271
+ t.focus(id);
272
+ t._fixIELayout(id, 1);
273
+
274
+ // Focus ok button
275
+ if (DOM.get(id + '_ok'))
276
+ DOM.get(id + '_ok').focus();
277
+
278
+ t.count++;
279
+
280
+ return w;
281
+ },
282
+
283
+ focus : function(id) {
284
+ var t = this, w;
285
+
286
+ if (w = t.windows[id]) {
287
+ w.zIndex = this.zIndex++;
288
+ w.element.setStyle('zIndex', w.zIndex);
289
+ w.element.update();
290
+
291
+ id = id + '_wrapper';
292
+ DOM.removeClass(t.lastId, 'mceFocus');
293
+ DOM.addClass(id, 'mceFocus');
294
+ t.lastId = id;
295
+ }
296
+ },
297
+
298
+ _addAll : function(te, ne) {
299
+ var i, n, t = this, dom = tinymce.DOM;
300
+
301
+ if (is(ne, 'string'))
302
+ te.appendChild(dom.doc.createTextNode(ne));
303
+ else if (ne.length) {
304
+ te = te.appendChild(dom.create(ne[0], ne[1]));
305
+
306
+ for (i=2; i<ne.length; i++)
307
+ t._addAll(te, ne[i]);
308
+ }
309
+ },
310
+
311
+ _startDrag : function(id, se, ac) {
312
+ var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;
313
+
314
+ // Get positons and sizes
315
+ // cp = DOM.getPos(t.editor.getContainer());
316
+ cp = {x : 0, y : 0};
317
+ vp = DOM.getViewPort();
318
+
319
+ // Reduce viewport size to avoid scrollbars while dragging
320
+ vp.w -= 2;
321
+ vp.h -= 2;
322
+
323
+ sex = se.screenX;
324
+ sey = se.screenY;
325
+ dx = dy = dw = dh = 0;
326
+
327
+ // Handle mouse up
328
+ mu = Event.add(d, 'mouseup', function(e) {
329
+ Event.remove(d, 'mouseup', mu);
330
+ Event.remove(d, 'mousemove', mm);
331
+
332
+ if (eb)
333
+ eb.remove();
334
+
335
+ we.moveBy(dx, dy);
336
+ we.resizeBy(dw, dh);
337
+ sz = we.getSize();
338
+ DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
339
+ t._fixIELayout(id, 1);
340
+
341
+ return Event.cancel(e);
342
+ });
343
+
344
+ if (ac != 'Move')
345
+ startMove();
346
+
347
+ function startMove() {
348
+ if (eb)
349
+ return;
350
+
351
+ t._fixIELayout(id, 0);
352
+
353
+ // Setup event blocker
354
+ DOM.add(d.body, 'div', {
355
+ id : 'mceEventBlocker',
356
+ 'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
357
+ style : {zIndex : t.zIndex + 1}
358
+ });
359
+
360
+ if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
361
+ DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
362
+
363
+ eb = new Element('mceEventBlocker');
364
+ eb.update();
365
+
366
+ // Setup placeholder
367
+ p = we.getXY();
368
+ sz = we.getSize();
369
+ sx = cp.x + p.x - vp.x;
370
+ sy = cp.y + p.y - vp.y;
371
+ DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
372
+ ph = new Element('mcePlaceHolder');
373
+ };
374
+
375
+ // Handle mouse move/drag
376
+ mm = Event.add(d, 'mousemove', function(e) {
377
+ var x, y, v;
378
+
379
+ startMove();
380
+
381
+ x = e.screenX - sex;
382
+ y = e.screenY - sey;
383
+
384
+ switch (ac) {
385
+ case 'ResizeW':
386
+ dx = x;
387
+ dw = 0 - x;
388
+ break;
389
+
390
+ case 'ResizeE':
391
+ dw = x;
392
+ break;
393
+
394
+ case 'ResizeN':
395
+ case 'ResizeNW':
396
+ case 'ResizeNE':
397
+ if (ac == "ResizeNW") {
398
+ dx = x;
399
+ dw = 0 - x;
400
+ } else if (ac == "ResizeNE")
401
+ dw = x;
402
+
403
+ dy = y;
404
+ dh = 0 - y;
405
+ break;
406
+
407
+ case 'ResizeS':
408
+ case 'ResizeSW':
409
+ case 'ResizeSE':
410
+ if (ac == "ResizeSW") {
411
+ dx = x;
412
+ dw = 0 - x;
413
+ } else if (ac == "ResizeSE")
414
+ dw = x;
415
+
416
+ dh = y;
417
+ break;
418
+
419
+ case 'mceMove':
420
+ dx = x;
421
+ dy = y;
422
+ break;
423
+ }
424
+
425
+ // Boundary check
426
+ if (dw < (v = w.features.min_width - sz.w)) {
427
+ if (dx !== 0)
428
+ dx += dw - v;
429
+
430
+ dw = v;
431
+ }
432
+
433
+ if (dh < (v = w.features.min_height - sz.h)) {
434
+ if (dy !== 0)
435
+ dy += dh - v;
436
+
437
+ dh = v;
438
+ }
439
+
440
+ dw = Math.min(dw, w.features.max_width - sz.w);
441
+ dh = Math.min(dh, w.features.max_height - sz.h);
442
+ dx = Math.max(dx, vp.x - (sx + vp.x));
443
+ dy = Math.max(dy, vp.y - (sy + vp.y));
444
+ dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
445
+ dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
446
+
447
+ // Move if needed
448
+ if (dx + dy !== 0) {
449
+ if (sx + dx < 0)
450
+ dx = 0;
451
+
452
+ if (sy + dy < 0)
453
+ dy = 0;
454
+
455
+ ph.moveTo(sx + dx, sy + dy);
456
+ }
457
+
458
+ // Resize if needed
459
+ if (dw + dh !== 0)
460
+ ph.resizeTo(sz.w + dw, sz.h + dh);
461
+
462
+ return Event.cancel(e);
463
+ });
464
+
465
+ return Event.cancel(se);
466
+ },
467
+
468
+ resizeBy : function(dw, dh, id) {
469
+ var w = this.windows[id];
470
+
471
+ if (w) {
472
+ w.element.resizeBy(dw, dh);
473
+ w.iframeElement.resizeBy(dw, dh);
474
+ }
475
+ },
476
+
477
+ close : function(win, id) {
478
+ var t = this, w, d = DOM.doc, ix = 0, fw, id;
479
+
480
+ id = t._findId(id || win);
481
+
482
+ // Probably not inline
483
+ if (!t.windows[id]) {
484
+ t.parent(win);
485
+ return;
486
+ }
487
+
488
+ t.count--;
489
+
490
+ if (t.count == 0)
491
+ DOM.remove('mceModalBlocker');
492
+
493
+ if (w = t.windows[id]) {
494
+ t.onClose.dispatch(t);
495
+ Event.remove(d, 'mousedown', w.mousedownFunc);
496
+ Event.remove(d, 'click', w.clickFunc);
497
+ Event.clear(id);
498
+ Event.clear(id + '_ifr');
499
+
500
+ DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
501
+ w.element.remove();
502
+ delete t.windows[id];
503
+
504
+ // Find front most window and focus that
505
+ each (t.windows, function(w) {
506
+ if (w.zIndex > ix) {
507
+ fw = w;
508
+ ix = w.zIndex;
509
+ }
510
+ });
511
+
512
+ if (fw)
513
+ t.focus(fw.id);
514
+ }
515
+ },
516
+
517
+ setTitle : function(w, ti) {
518
+ var e;
519
+
520
+ w = this._findId(w);
521
+
522
+ if (e = DOM.get(w + '_title'))
523
+ e.innerHTML = DOM.encode(ti);
524
+ },
525
+
526
+ alert : function(txt, cb, s) {
527
+ var t = this, w;
528
+
529
+ w = t.open({
530
+ title : t,
531
+ type : 'alert',
532
+ button_func : function(s) {
533
+ if (cb)
534
+ cb.call(s || t, s);
535
+
536
+ t.close(null, w.id);
537
+ },
538
+ content : DOM.encode(t.editor.getLang(txt, txt)),
539
+ inline : 1,
540
+ width : 400,
541
+ height : 130
542
+ });
543
+ },
544
+
545
+ confirm : function(txt, cb, s) {
546
+ var t = this, w;
547
+
548
+ w = t.open({
549
+ title : t,
550
+ type : 'confirm',
551
+ button_func : function(s) {
552
+ if (cb)
553
+ cb.call(s || t, s);
554
+
555
+ t.close(null, w.id);
556
+ },
557
+ content : DOM.encode(t.editor.getLang(txt, txt)),
558
+ inline : 1,
559
+ width : 400,
560
+ height : 130
561
+ });
562
+ },
563
+
564
+ // Internal functions
565
+
566
+ _findId : function(w) {
567
+ var t = this;
568
+
569
+ if (typeof(w) == 'string')
570
+ return w;
571
+
572
+ each(t.windows, function(wo) {
573
+ var ifr = DOM.get(wo.id + '_ifr');
574
+
575
+ if (ifr && w == ifr.contentWindow) {
576
+ w = wo.id;
577
+ return false;
578
+ }
579
+ });
580
+
581
+ return w;
582
+ },
583
+
584
+ _fixIELayout : function(id, s) {
585
+ var w, img;
586
+
587
+ if (!tinymce.isIE6)
588
+ return;
589
+
590
+ // Fixes the bug where hover flickers and does odd things in IE6
591
+ each(['n','s','w','e','nw','ne','sw','se'], function(v) {
592
+ var e = DOM.get(id + '_resize_' + v);
593
+
594
+ DOM.setStyles(e, {
595
+ width : s ? e.clientWidth : '',
596
+ height : s ? e.clientHeight : '',
597
+ cursor : DOM.getStyle(e, 'cursor', 1)
598
+ });
599
+
600
+ DOM.setStyle(id + "_bottom", 'bottom', '-1px');
601
+
602
+ e = 0;
603
+ });
604
+
605
+ // Fixes graphics glitch
606
+ if (w = this.windows[id]) {
607
+ // Fixes rendering bug after resize
608
+ w.element.hide();
609
+ w.element.show();
610
+
611
+ // Forced a repaint of the window
612
+ //DOM.get(id).style.filter = '';
613
+
614
+ // IE has a bug where images used in CSS won't get loaded
615
+ // sometimes when the cache in the browser is disabled
616
+ // This fix tries to solve it by loading the images using the image object
617
+ each(DOM.select('div,a', id), function(e, i) {
618
+ if (e.currentStyle.backgroundImage != 'none') {
619
+ img = new Image();
620
+ img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
621
+ }
622
+ });
623
+
624
+ DOM.get(id).style.filter = '';
625
+ }
626
+ }
627
+ });
628
+
629
+ // Register plugin
630
+ tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
631
+ })();
632
+