noodall-ui 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (542) hide show
  1. data/.document +5 -0
  2. data/.gitignore +29 -0
  3. data/Gemfile +29 -0
  4. data/Gemfile.lock +205 -0
  5. data/LICENSE +20 -0
  6. data/README.rdoc +17 -0
  7. data/Rakefile +17 -0
  8. data/app/controllers/noodall/admin/assets_controller.rb +241 -0
  9. data/app/controllers/noodall/admin/base_controller.rb +8 -0
  10. data/app/controllers/noodall/admin/components_controller.rb +22 -0
  11. data/app/controllers/noodall/admin/groups_controller.rb +11 -0
  12. data/app/controllers/noodall/admin/nodes_controller.rb +159 -0
  13. data/app/controllers/noodall/nodes_controller.rb +41 -0
  14. data/app/helpers/noodall/admin/assets_helper.rb +15 -0
  15. data/app/helpers/noodall/admin/base_helper.rb +14 -0
  16. data/app/helpers/noodall/admin/nodes_helper.rb +37 -0
  17. data/app/helpers/noodall/components_helper.rb +38 -0
  18. data/app/helpers/noodall/layout_helper.rb +25 -0
  19. data/app/helpers/noodall/nodes_helper.rb +72 -0
  20. data/app/models/asset.rb +103 -0
  21. data/app/views/layouts/noodall_admin.html.erb +66 -0
  22. data/app/views/noodall/admin/assets/_browser.html.erb +28 -0
  23. data/app/views/noodall/admin/assets/_form.html.erb +54 -0
  24. data/app/views/noodall/admin/assets/_menu.html.erb +8 -0
  25. data/app/views/noodall/admin/assets/_show.html.erb +48 -0
  26. data/app/views/noodall/admin/assets/_tags.html.erb +13 -0
  27. data/app/views/noodall/admin/assets/add.html.erb +10 -0
  28. data/app/views/noodall/admin/assets/form.html.erb +12 -0
  29. data/app/views/noodall/admin/assets/form.js.erb +2 -0
  30. data/app/views/noodall/admin/assets/index.html.erb +65 -0
  31. data/app/views/noodall/admin/assets/index.js.erb +1 -0
  32. data/app/views/noodall/admin/assets/show.html.erb +3 -0
  33. data/app/views/noodall/admin/assets/show.js.erb +1 -0
  34. data/app/views/noodall/admin/assets/tags.html.erb +3 -0
  35. data/app/views/noodall/admin/assets/tags.js.erb +1 -0
  36. data/app/views/noodall/admin/components/_component.erb +0 -0
  37. data/app/views/noodall/admin/nodes/_body.html.erb +5 -0
  38. data/app/views/noodall/admin/nodes/_branch.html.erb +10 -0
  39. data/app/views/noodall/admin/nodes/_home.html.erb +27 -0
  40. data/app/views/noodall/admin/nodes/_slot_form.html.erb +16 -0
  41. data/app/views/noodall/admin/nodes/change_template.html.erb +38 -0
  42. data/app/views/noodall/admin/nodes/index.html.erb +69 -0
  43. data/app/views/noodall/admin/nodes/new.html.erb +30 -0
  44. data/app/views/noodall/admin/nodes/show.html.erb +144 -0
  45. data/app/views/noodall/admin/nodes/tree.html.erb +3 -0
  46. data/app/views/noodall/admin/nodes/tree.js.erb +2 -0
  47. data/app/views/noodall/components/_component.erb +0 -0
  48. data/app/views/noodall/nodes/search.html.erb +14 -0
  49. data/app/views/noodall/nodes/sitemap.html.erb +3 -0
  50. data/app/views/noodall/nodes/sitemap.xml.rxml +22 -0
  51. data/config/application.rb +29 -0
  52. data/config/boot.rb +13 -0
  53. data/config/cucumber.yml +8 -0
  54. data/config/database.yml +14 -0
  55. data/config/environment.rb +5 -0
  56. data/config/environments/development.rb +30 -0
  57. data/config/environments/production.rb +50 -0
  58. data/config/environments/test.rb +35 -0
  59. data/config/locales/en.yml +5 -0
  60. data/config.ru +4 -0
  61. data/demo/controllers/application_controller.rb +22 -0
  62. data/demo/initializers/dragonfly.rb +1 -0
  63. data/demo/initializers/mongo_mapper.rb +13 -0
  64. data/demo/initializers/noodall.rb +2 -0
  65. data/demo/initializers/secret_token.rb +7 -0
  66. data/demo/initializers/session_store.rb +8 -0
  67. data/demo/models/gallery.rb +17 -0
  68. data/demo/models/page_a.rb +9 -0
  69. data/demo/models/page_b.rb +4 -0
  70. data/demo/models/page_c.rb +7 -0
  71. data/demo/models/promo.rb +22 -0
  72. data/demo/models/user.rb +12 -0
  73. data/demo/routes.rb +3 -0
  74. data/demo/seeds.rb +8 -0
  75. data/demo/views/admin/components/_gallery.html.erb +49 -0
  76. data/demo/views/admin/components/_promo.html.erb +34 -0
  77. data/demo/views/admin/nodes/_page_a.html.erb +47 -0
  78. data/demo/views/admin/nodes/_page_b.html.erb +35 -0
  79. data/demo/views/admin/nodes/_page_c.html.erb +35 -0
  80. data/demo/views/components/_gallery.html.erb +23 -0
  81. data/demo/views/components/_promo.html.erb +5 -0
  82. data/demo/views/layouts/application.html.erb +121 -0
  83. data/demo/views/nodes/page_a.html.erb +14 -0
  84. data/demo/views/nodes/page_b.html.erb +9 -0
  85. data/demo/views/nodes/page_c.html.erb +12 -0
  86. data/features/change_templates.feature +25 -0
  87. data/features/content_templates.feature +18 -0
  88. data/features/gallery_component.feature +22 -0
  89. data/features/manage_assets.feature +28 -0
  90. data/features/manage_content_tree.feature +42 -0
  91. data/features/preview.feature +8 -0
  92. data/features/promo_component.feature +18 -0
  93. data/features/publish_content.feature +28 -0
  94. data/features/search.feature +12 -0
  95. data/features/sitemap.feature +9 -0
  96. data/features/step_definitions/asset_steps.rb +66 -0
  97. data/features/step_definitions/cms_node_steps.rb +126 -0
  98. data/features/step_definitions/component_steps.rb +137 -0
  99. data/features/step_definitions/content_steps.rb +187 -0
  100. data/features/step_definitions/date_select_steps.rb +39 -0
  101. data/features/step_definitions/groups_access_steps.rb +92 -0
  102. data/features/step_definitions/node_steps.rb +25 -0
  103. data/features/step_definitions/preview_steps.rb +7 -0
  104. data/features/step_definitions/pubish_content_steps.rb +45 -0
  105. data/features/step_definitions/search_steps.rb +21 -0
  106. data/features/step_definitions/sign_in_steps.rb +3 -0
  107. data/features/step_definitions/web_steps.rb +219 -0
  108. data/features/support/env.rb +52 -0
  109. data/features/support/logo.png +0 -0
  110. data/features/support/paths.rb +56 -0
  111. data/generators/component/USAGE +8 -0
  112. data/generators/component/component_generator.rb +35 -0
  113. data/generators/component/lib/insert_commands.rb +61 -0
  114. data/generators/component/templates/admin_template.html.erb +50 -0
  115. data/generators/component/templates/factory.rb +5 -0
  116. data/generators/component/templates/model.rb +8 -0
  117. data/generators/component/templates/template.html.erb +41 -0
  118. data/generators/node/USAGE +8 -0
  119. data/generators/node/lib/insert_commands.rb +47 -0
  120. data/generators/node/node_generator.rb +35 -0
  121. data/generators/node/templates/admin_template.html.erb +49 -0
  122. data/generators/node/templates/factory.rb +5 -0
  123. data/generators/node/templates/model.rb +11 -0
  124. data/generators/node/templates/template.html.erb +41 -0
  125. data/generators/node_features/USAGE +8 -0
  126. data/generators/node_features/node_features_generator.rb +16 -0
  127. data/lib/generators/noodall/node/USAGE +8 -0
  128. data/lib/generators/noodall/node/node_generator.rb +21 -0
  129. data/lib/generators/noodall/node/templates/admin_template.html.erb +52 -0
  130. data/lib/generators/noodall/node/templates/factory.rb +8 -0
  131. data/lib/generators/noodall/node/templates/model.rb +13 -0
  132. data/lib/generators/noodall/node/templates/template.html.erb +12 -0
  133. data/lib/noodall/canable.rb +1 -0
  134. data/lib/noodall/dragonfly.rb +23 -0
  135. data/lib/noodall/engine.rb +13 -0
  136. data/lib/noodall/permalinks.rb +12 -0
  137. data/lib/noodall/routes.rb +45 -0
  138. data/lib/noodall/ui/version.rb +5 -0
  139. data/lib/noodall/ui.rb +17 -0
  140. data/lib/noodall/video_thumbnail_encoder.rb +31 -0
  141. data/lib/noodall-ui.rb +6 -0
  142. data/lib/tasks/cucumber.rake +53 -0
  143. data/log/.gitignore +0 -0
  144. data/noodall-ui.gemspec +28 -0
  145. data/public/favicon.ico +0 -0
  146. data/public/images/admin/add-small.png +0 -0
  147. data/public/images/admin/add.png +0 -0
  148. data/public/images/admin/add_file.gif +0 -0
  149. data/public/images/admin/advanced.gif +0 -0
  150. data/public/images/admin/back.png +0 -0
  151. data/public/images/admin/cancel-small.gif +0 -0
  152. data/public/images/admin/cancel.gif +0 -0
  153. data/public/images/admin/change-bg.gif +0 -0
  154. data/public/images/admin/change.gif +0 -0
  155. data/public/images/admin/check.png +0 -0
  156. data/public/images/admin/clear.gif +0 -0
  157. data/public/images/admin/close.png +0 -0
  158. data/public/images/admin/create.gif +0 -0
  159. data/public/images/admin/delete.gif +0 -0
  160. data/public/images/admin/delete.png +0 -0
  161. data/public/images/admin/doc-icon.png +0 -0
  162. data/public/images/admin/document.png +0 -0
  163. data/public/images/admin/down.png +0 -0
  164. data/public/images/admin/download.png +0 -0
  165. data/public/images/admin/draft.gif +0 -0
  166. data/public/images/admin/draft.png +0 -0
  167. data/public/images/admin/edit.gif +0 -0
  168. data/public/images/admin/edit.png +0 -0
  169. data/public/images/admin/image.png +0 -0
  170. data/public/images/admin/image_small.png +0 -0
  171. data/public/images/admin/info-white.png +0 -0
  172. data/public/images/admin/info.png +0 -0
  173. data/public/images/admin/media.gif +0 -0
  174. data/public/images/admin/nav-2.gif +0 -0
  175. data/public/images/admin/nav.gif +0 -0
  176. data/public/images/admin/next.png +0 -0
  177. data/public/images/admin/no-type-icon.png +0 -0
  178. data/public/images/admin/pagination.gif +0 -0
  179. data/public/images/admin/pdf-icon.png +0 -0
  180. data/public/images/admin/prev.png +0 -0
  181. data/public/images/admin/preview.gif +0 -0
  182. data/public/images/admin/publish.gif +0 -0
  183. data/public/images/admin/remove.gif +0 -0
  184. data/public/images/admin/reset.gif +0 -0
  185. data/public/images/admin/select_image.gif +0 -0
  186. data/public/images/admin/select_images.gif +0 -0
  187. data/public/images/admin/set.gif +0 -0
  188. data/public/images/admin/sort.png +0 -0
  189. data/public/images/admin/tag.png +0 -0
  190. data/public/images/admin/templates/article-page.gif +0 -0
  191. data/public/images/admin/templates/articles-list.gif +0 -0
  192. data/public/images/admin/templates/course-page.gif +0 -0
  193. data/public/images/admin/templates/event-page.gif +0 -0
  194. data/public/images/admin/templates/events-list.gif +0 -0
  195. data/public/images/admin/templates/home.gif +0 -0
  196. data/public/images/admin/templates/landing-page.gif +0 -0
  197. data/public/images/admin/templates/page-a.gif +0 -0
  198. data/public/images/admin/templates/page-b.gif +0 -0
  199. data/public/images/admin/templates/school-landing-page.gif +0 -0
  200. data/public/images/admin/templates/study-landing-page.gif +0 -0
  201. data/public/images/admin/top-level.png +0 -0
  202. data/public/images/admin/top-level_small.png +0 -0
  203. data/public/images/admin/txt-icon.png +0 -0
  204. data/public/images/admin/uncheck.png +0 -0
  205. data/public/images/admin/up.png +0 -0
  206. data/public/images/admin/update.gif +0 -0
  207. data/public/images/admin/upload.png +0 -0
  208. data/public/images/admin/video.png +0 -0
  209. data/public/images/admin/view.png +0 -0
  210. data/public/images/admin/xls-icon.png +0 -0
  211. data/public/images/fancybox/blank.gif +0 -0
  212. data/public/images/fancybox/fancy_close.png +0 -0
  213. data/public/images/fancybox/fancy_loading.png +0 -0
  214. data/public/images/fancybox/fancy_nav_left.png +0 -0
  215. data/public/images/fancybox/fancy_nav_right.png +0 -0
  216. data/public/images/fancybox/fancy_shadow_e.png +0 -0
  217. data/public/images/fancybox/fancy_shadow_n.png +0 -0
  218. data/public/images/fancybox/fancy_shadow_ne.png +0 -0
  219. data/public/images/fancybox/fancy_shadow_nw.png +0 -0
  220. data/public/images/fancybox/fancy_shadow_s.png +0 -0
  221. data/public/images/fancybox/fancy_shadow_se.png +0 -0
  222. data/public/images/fancybox/fancy_shadow_sw.png +0 -0
  223. data/public/images/fancybox/fancy_shadow_w.png +0 -0
  224. data/public/images/fancybox/fancy_title_left.png +0 -0
  225. data/public/images/fancybox/fancy_title_main.png +0 -0
  226. data/public/images/fancybox/fancy_title_over.png +0 -0
  227. data/public/images/fancybox/fancy_title_right.png +0 -0
  228. data/public/images/fancybox/fancybox-x.png +0 -0
  229. data/public/images/fancybox/fancybox-y.png +0 -0
  230. data/public/images/fancybox/fancybox.png +0 -0
  231. data/public/images/plupload/backgrounds.gif +0 -0
  232. data/public/images/plupload/buttons-disabled.png +0 -0
  233. data/public/images/plupload/buttons.png +0 -0
  234. data/public/images/plupload/delete.gif +0 -0
  235. data/public/images/plupload/done.gif +0 -0
  236. data/public/images/plupload/error.gif +0 -0
  237. data/public/images/plupload/throbber.gif +0 -0
  238. data/public/images/plupload/transp50.png +0 -0
  239. data/public/javascripts/admin/application.js +586 -0
  240. data/public/javascripts/admin/asset_edit.js +30 -0
  241. data/public/javascripts/admin/assets.js +98 -0
  242. data/public/javascripts/admin/gotham.font.js +20 -0
  243. data/public/javascripts/admin/jquery.jqtransform.js +366 -0
  244. data/public/javascripts/admin/nodes.js +30 -0
  245. data/public/javascripts/admin/tiny_mce_config.js +118 -0
  246. data/public/javascripts/ajaxify.js +20 -0
  247. data/public/javascripts/application.js +37 -0
  248. data/public/javascripts/carousel.lite.js +1 -0
  249. data/public/javascripts/cufon-yui.js +8 -0
  250. data/public/javascripts/fancybox.js +1078 -0
  251. data/public/javascripts/plupload/gears_init.js +86 -0
  252. data/public/javascripts/plupload/jquery.plupload.queue.min.js +1 -0
  253. data/public/javascripts/plupload/plupload.flash.swf +0 -0
  254. data/public/javascripts/plupload/plupload.full.min.js +1 -0
  255. data/public/javascripts/plupload/plupload.silverlight.xap +0 -0
  256. data/public/javascripts/rails.js +132 -0
  257. data/public/javascripts/tiny_mce/jquery.tinymce.js +1 -0
  258. data/public/javascripts/tiny_mce/langs/en.js +169 -0
  259. data/public/javascripts/tiny_mce/license.txt +504 -0
  260. data/public/javascripts/tiny_mce/plugins/advhr/css/advhr.css +5 -0
  261. data/public/javascripts/tiny_mce/plugins/advhr/editor_plugin.js +1 -0
  262. data/public/javascripts/tiny_mce/plugins/advhr/editor_plugin_src.js +57 -0
  263. data/public/javascripts/tiny_mce/plugins/advhr/js/rule.js +43 -0
  264. data/public/javascripts/tiny_mce/plugins/advhr/langs/en_dlg.js +5 -0
  265. data/public/javascripts/tiny_mce/plugins/advhr/rule.htm +57 -0
  266. data/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css +13 -0
  267. data/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js +1 -0
  268. data/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js +50 -0
  269. data/public/javascripts/tiny_mce/plugins/advimage/image.htm +232 -0
  270. data/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif +0 -0
  271. data/public/javascripts/tiny_mce/plugins/advimage/js/image.js +443 -0
  272. data/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js +43 -0
  273. data/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css +8 -0
  274. data/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js +1 -0
  275. data/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js +61 -0
  276. data/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js +528 -0
  277. data/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js +52 -0
  278. data/public/javascripts/tiny_mce/plugins/advlink/link.htm +333 -0
  279. data/public/javascripts/tiny_mce/plugins/advlist/editor_plugin.js +1 -0
  280. data/public/javascripts/tiny_mce/plugins/advlist/editor_plugin_src.js +154 -0
  281. data/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +1 -0
  282. data/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +117 -0
  283. data/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js +1 -0
  284. data/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js +422 -0
  285. data/public/javascripts/tiny_mce/plugins/autosave/langs/en.js +4 -0
  286. data/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js +1 -0
  287. data/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js +120 -0
  288. data/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js +1 -0
  289. data/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js +127 -0
  290. data/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js +1 -0
  291. data/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js +82 -0
  292. data/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js +1 -0
  293. data/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js +43 -0
  294. data/public/javascripts/tiny_mce/plugins/emotions/emotions.htm +40 -0
  295. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif +0 -0
  296. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif +0 -0
  297. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif +0 -0
  298. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif +0 -0
  299. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif +0 -0
  300. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif +0 -0
  301. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif +0 -0
  302. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif +0 -0
  303. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif +0 -0
  304. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif +0 -0
  305. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif +0 -0
  306. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif +0 -0
  307. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif +0 -0
  308. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif +0 -0
  309. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif +0 -0
  310. data/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif +0 -0
  311. data/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js +22 -0
  312. data/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js +20 -0
  313. data/public/javascripts/tiny_mce/plugins/example/dialog.htm +22 -0
  314. data/public/javascripts/tiny_mce/plugins/example/editor_plugin.js +1 -0
  315. data/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js +84 -0
  316. data/public/javascripts/tiny_mce/plugins/example/img/example.gif +0 -0
  317. data/public/javascripts/tiny_mce/plugins/example/js/dialog.js +19 -0
  318. data/public/javascripts/tiny_mce/plugins/example/langs/en.js +3 -0
  319. data/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js +3 -0
  320. data/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css +182 -0
  321. data/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js +1 -0
  322. data/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin_src.js +149 -0
  323. data/public/javascripts/tiny_mce/plugins/fullpage/fullpage.htm +571 -0
  324. data/public/javascripts/tiny_mce/plugins/fullpage/js/fullpage.js +471 -0
  325. data/public/javascripts/tiny_mce/plugins/fullpage/langs/en_dlg.js +85 -0
  326. data/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +1 -0
  327. data/public/javascripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js +148 -0
  328. data/public/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +109 -0
  329. data/public/javascripts/tiny_mce/plugins/iespell/editor_plugin.js +1 -0
  330. data/public/javascripts/tiny_mce/plugins/iespell/editor_plugin_src.js +54 -0
  331. data/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +1 -0
  332. data/public/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +635 -0
  333. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif +0 -0
  334. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif +0 -0
  335. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif +0 -0
  336. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif +0 -0
  337. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif +0 -0
  338. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif +0 -0
  339. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif +0 -0
  340. data/public/javascripts/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css +90 -0
  341. data/public/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -0
  342. data/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin.js +1 -0
  343. data/public/javascripts/tiny_mce/plugins/insertdatetime/editor_plugin_src.js +83 -0
  344. data/public/javascripts/tiny_mce/plugins/layer/editor_plugin.js +1 -0
  345. data/public/javascripts/tiny_mce/plugins/layer/editor_plugin_src.js +212 -0
  346. data/public/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin.js +1 -0
  347. data/public/javascripts/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +136 -0
  348. data/public/javascripts/tiny_mce/plugins/media/css/content.css +6 -0
  349. data/public/javascripts/tiny_mce/plugins/media/css/media.css +16 -0
  350. data/public/javascripts/tiny_mce/plugins/media/editor_plugin.js +1 -0
  351. data/public/javascripts/tiny_mce/plugins/media/editor_plugin_src.js +414 -0
  352. data/public/javascripts/tiny_mce/plugins/media/img/flash.gif +0 -0
  353. data/public/javascripts/tiny_mce/plugins/media/img/flv_player.swf +0 -0
  354. data/public/javascripts/tiny_mce/plugins/media/img/quicktime.gif +0 -0
  355. data/public/javascripts/tiny_mce/plugins/media/img/realmedia.gif +0 -0
  356. data/public/javascripts/tiny_mce/plugins/media/img/shockwave.gif +0 -0
  357. data/public/javascripts/tiny_mce/plugins/media/img/trans.gif +0 -0
  358. data/public/javascripts/tiny_mce/plugins/media/img/windowsmedia.gif +0 -0
  359. data/public/javascripts/tiny_mce/plugins/media/js/embed.js +73 -0
  360. data/public/javascripts/tiny_mce/plugins/media/js/media.js +630 -0
  361. data/public/javascripts/tiny_mce/plugins/media/langs/en_dlg.js +103 -0
  362. data/public/javascripts/tiny_mce/plugins/media/media.htm +817 -0
  363. data/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin.js +1 -0
  364. data/public/javascripts/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +53 -0
  365. data/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin.js +1 -0
  366. data/public/javascripts/tiny_mce/plugins/noneditable/editor_plugin_src.js +90 -0
  367. data/public/javascripts/tiny_mce/plugins/pagebreak/css/content.css +1 -0
  368. data/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin.js +1 -0
  369. data/public/javascripts/tiny_mce/plugins/pagebreak/editor_plugin_src.js +77 -0
  370. data/public/javascripts/tiny_mce/plugins/pagebreak/img/pagebreak.gif +0 -0
  371. data/public/javascripts/tiny_mce/plugins/pagebreak/img/trans.gif +0 -0
  372. data/public/javascripts/tiny_mce/plugins/paste/editor_plugin.js +1 -0
  373. data/public/javascripts/tiny_mce/plugins/paste/editor_plugin_src.js +929 -0
  374. data/public/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -0
  375. data/public/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -0
  376. data/public/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +5 -0
  377. data/public/javascripts/tiny_mce/plugins/paste/pastetext.htm +27 -0
  378. data/public/javascripts/tiny_mce/plugins/paste/pasteword.htm +21 -0
  379. data/public/javascripts/tiny_mce/plugins/preview/editor_plugin.js +1 -0
  380. data/public/javascripts/tiny_mce/plugins/preview/editor_plugin_src.js +53 -0
  381. data/public/javascripts/tiny_mce/plugins/preview/example.html +28 -0
  382. data/public/javascripts/tiny_mce/plugins/preview/jscripts/embed.js +73 -0
  383. data/public/javascripts/tiny_mce/plugins/preview/preview.html +17 -0
  384. data/public/javascripts/tiny_mce/plugins/print/editor_plugin.js +1 -0
  385. data/public/javascripts/tiny_mce/plugins/print/editor_plugin_src.js +34 -0
  386. data/public/javascripts/tiny_mce/plugins/save/editor_plugin.js +1 -0
  387. data/public/javascripts/tiny_mce/plugins/save/editor_plugin_src.js +101 -0
  388. data/public/javascripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +6 -0
  389. data/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin.js +1 -0
  390. data/public/javascripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js +57 -0
  391. data/public/javascripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +130 -0
  392. data/public/javascripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +16 -0
  393. data/public/javascripts/tiny_mce/plugins/searchreplace/searchreplace.htm +99 -0
  394. data/public/javascripts/tiny_mce/plugins/spellchecker/css/content.css +1 -0
  395. data/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin.js +1 -0
  396. data/public/javascripts/tiny_mce/plugins/spellchecker/editor_plugin_src.js +341 -0
  397. data/public/javascripts/tiny_mce/plugins/spellchecker/img/wline.gif +0 -0
  398. data/public/javascripts/tiny_mce/plugins/style/css/props.css +13 -0
  399. data/public/javascripts/tiny_mce/plugins/style/editor_plugin.js +1 -0
  400. data/public/javascripts/tiny_mce/plugins/style/editor_plugin_src.js +55 -0
  401. data/public/javascripts/tiny_mce/plugins/style/js/props.js +641 -0
  402. data/public/javascripts/tiny_mce/plugins/style/langs/en_dlg.js +63 -0
  403. data/public/javascripts/tiny_mce/plugins/style/props.htm +726 -0
  404. data/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin.js +1 -0
  405. data/public/javascripts/tiny_mce/plugins/tabfocus/editor_plugin_src.js +112 -0
  406. data/public/javascripts/tiny_mce/plugins/table/cell.htm +178 -0
  407. data/public/javascripts/tiny_mce/plugins/table/css/cell.css +17 -0
  408. data/public/javascripts/tiny_mce/plugins/table/css/row.css +25 -0
  409. data/public/javascripts/tiny_mce/plugins/table/css/table.css +13 -0
  410. data/public/javascripts/tiny_mce/plugins/table/editor_plugin.js +1 -0
  411. data/public/javascripts/tiny_mce/plugins/table/editor_plugin_src.js +1118 -0
  412. data/public/javascripts/tiny_mce/plugins/table/js/cell.js +286 -0
  413. data/public/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -0
  414. data/public/javascripts/tiny_mce/plugins/table/js/row.js +237 -0
  415. data/public/javascripts/tiny_mce/plugins/table/js/table.js +449 -0
  416. data/public/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +74 -0
  417. data/public/javascripts/tiny_mce/plugins/table/merge_cells.htm +32 -0
  418. data/public/javascripts/tiny_mce/plugins/table/row.htm +155 -0
  419. data/public/javascripts/tiny_mce/plugins/table/table.htm +187 -0
  420. data/public/javascripts/tiny_mce/plugins/template/blank.htm +12 -0
  421. data/public/javascripts/tiny_mce/plugins/template/css/template.css +23 -0
  422. data/public/javascripts/tiny_mce/plugins/template/editor_plugin.js +1 -0
  423. data/public/javascripts/tiny_mce/plugins/template/editor_plugin_src.js +159 -0
  424. data/public/javascripts/tiny_mce/plugins/template/js/template.js +106 -0
  425. data/public/javascripts/tiny_mce/plugins/template/langs/en_dlg.js +15 -0
  426. data/public/javascripts/tiny_mce/plugins/template/template.htm +32 -0
  427. data/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin.js +1 -0
  428. data/public/javascripts/tiny_mce/plugins/visualchars/editor_plugin_src.js +76 -0
  429. data/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin.js +1 -0
  430. data/public/javascripts/tiny_mce/plugins/wordcount/editor_plugin_src.js +98 -0
  431. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/abbr.htm +141 -0
  432. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/acronym.htm +141 -0
  433. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/attributes.htm +148 -0
  434. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/cite.htm +141 -0
  435. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/attributes.css +11 -0
  436. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/css/popup.css +9 -0
  437. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/del.htm +161 -0
  438. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +1 -0
  439. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +144 -0
  440. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/ins.htm +161 -0
  441. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/abbr.js +28 -0
  442. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/acronym.js +28 -0
  443. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/attributes.js +126 -0
  444. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/cite.js +28 -0
  445. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/del.js +63 -0
  446. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/element_common.js +231 -0
  447. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/js/ins.js +62 -0
  448. data/public/javascripts/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js +32 -0
  449. data/public/javascripts/tiny_mce/themes/advanced/about.htm +54 -0
  450. data/public/javascripts/tiny_mce/themes/advanced/anchor.htm +26 -0
  451. data/public/javascripts/tiny_mce/themes/advanced/charmap.htm +53 -0
  452. data/public/javascripts/tiny_mce/themes/advanced/color_picker.htm +73 -0
  453. data/public/javascripts/tiny_mce/themes/advanced/editor_template.js +1 -0
  454. data/public/javascripts/tiny_mce/themes/advanced/editor_template_src.js +1167 -0
  455. data/public/javascripts/tiny_mce/themes/advanced/image.htm +80 -0
  456. data/public/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
  457. data/public/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
  458. data/public/javascripts/tiny_mce/themes/advanced/js/about.js +72 -0
  459. data/public/javascripts/tiny_mce/themes/advanced/js/anchor.js +37 -0
  460. data/public/javascripts/tiny_mce/themes/advanced/js/charmap.js +335 -0
  461. data/public/javascripts/tiny_mce/themes/advanced/js/color_picker.js +253 -0
  462. data/public/javascripts/tiny_mce/themes/advanced/js/image.js +245 -0
  463. data/public/javascripts/tiny_mce/themes/advanced/js/link.js +156 -0
  464. data/public/javascripts/tiny_mce/themes/advanced/js/source_editor.js +62 -0
  465. data/public/javascripts/tiny_mce/themes/advanced/langs/en.js +62 -0
  466. data/public/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +51 -0
  467. data/public/javascripts/tiny_mce/themes/advanced/link.htm +58 -0
  468. data/public/javascripts/tiny_mce/themes/advanced/skins/default/content.css +35 -0
  469. data/public/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -0
  470. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
  471. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
  472. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
  473. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
  474. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
  475. data/public/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
  476. data/public/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +213 -0
  477. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +35 -0
  478. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +116 -0
  479. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
  480. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
  481. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
  482. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +215 -0
  483. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +8 -0
  484. data/public/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -0
  485. data/public/javascripts/tiny_mce/themes/advanced/source_editor.htm +26 -0
  486. data/public/javascripts/tiny_mce/themes/simple/editor_template.js +1 -0
  487. data/public/javascripts/tiny_mce/themes/simple/editor_template_src.js +85 -0
  488. data/public/javascripts/tiny_mce/themes/simple/img/icons.gif +0 -0
  489. data/public/javascripts/tiny_mce/themes/simple/langs/en.js +11 -0
  490. data/public/javascripts/tiny_mce/themes/simple/skins/default/content.css +25 -0
  491. data/public/javascripts/tiny_mce/themes/simple/skins/default/ui.css +32 -0
  492. data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/content.css +17 -0
  493. data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png +0 -0
  494. data/public/javascripts/tiny_mce/themes/simple/skins/o2k7/ui.css +35 -0
  495. data/public/javascripts/tiny_mce/tiny_mce.js +1 -0
  496. data/public/javascripts/tiny_mce/tiny_mce_popup.js +5 -0
  497. data/public/javascripts/tiny_mce/tiny_mce_src.js +13134 -0
  498. data/public/javascripts/tiny_mce/utils/editable_selects.js +70 -0
  499. data/public/javascripts/tiny_mce/utils/form_utils.js +200 -0
  500. data/public/javascripts/tiny_mce/utils/mctabs.js +77 -0
  501. data/public/javascripts/tiny_mce/utils/validate.js +220 -0
  502. data/public/stylesheets/admin/fancybox.css +341 -0
  503. data/public/stylesheets/admin/forms.css +520 -0
  504. data/public/stylesheets/admin/handheld.css +6 -0
  505. data/public/stylesheets/admin/ie.css +118 -0
  506. data/public/stylesheets/admin/ie6.css +23 -0
  507. data/public/stylesheets/admin/ie8.css +16 -0
  508. data/public/stylesheets/admin/layout.css +723 -0
  509. data/public/stylesheets/admin/print.css +27 -0
  510. data/public/stylesheets/admin/reset.css +81 -0
  511. data/public/stylesheets/admin/skin.css +698 -0
  512. data/public/stylesheets/admin/tinymce.css +2 -0
  513. data/public/stylesheets/admin/typography.css +207 -0
  514. data/public/stylesheets/ellipsis.xml +15 -0
  515. data/public/stylesheets/fancybox.css +313 -0
  516. data/public/stylesheets/forms.css +7 -0
  517. data/public/stylesheets/ie.css +12 -0
  518. data/public/stylesheets/ie8.css +8 -0
  519. data/public/stylesheets/layout.css +31 -0
  520. data/public/stylesheets/plupload.queue.css +181 -0
  521. data/public/stylesheets/reset.css +84 -0
  522. data/public/stylesheets/sass/forms.scss +7 -0
  523. data/public/stylesheets/sass/ie.scss +12 -0
  524. data/public/stylesheets/sass/ie8.scss +8 -0
  525. data/public/stylesheets/sass/layout.scss +45 -0
  526. data/public/stylesheets/sass/skin.scss +35 -0
  527. data/public/stylesheets/sass/typography.scss +162 -0
  528. data/public/stylesheets/skin.css +22 -0
  529. data/public/stylesheets/typography.css +162 -0
  530. data/script/cucumber +10 -0
  531. data/script/rails +6 -0
  532. data/spec/factories/asset.rb +16 -0
  533. data/spec/factories/component.rb +9 -0
  534. data/spec/factories/node.rb +15 -0
  535. data/spec/factories/user.rb +5 -0
  536. data/spec/files/beef.png +0 -0
  537. data/spec/files/get_video.flv +0 -0
  538. data/spec/files/test.pdf +0 -0
  539. data/spec/noodall-ui_spec.rb +9 -0
  540. data/spec/spec_helper.rb +4 -0
  541. data/tmp/.gitignore +0 -0
  542. metadata +685 -0
@@ -0,0 +1,1167 @@
1
+ /**
2
+ * editor_template_src.js
3
+ *
4
+ * Copyright 2009, Moxiecode Systems AB
5
+ * Released under LGPL License.
6
+ *
7
+ * License: http://tinymce.moxiecode.com/license
8
+ * Contributing: http://tinymce.moxiecode.com/contributing
9
+ */
10
+
11
+ (function(tinymce) {
12
+ var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
13
+
14
+ // Tell it to load theme specific language pack(s)
15
+ tinymce.ThemeManager.requireLangPack('advanced');
16
+
17
+ tinymce.create('tinymce.themes.AdvancedTheme', {
18
+ sizes : [8, 10, 12, 14, 18, 24, 36],
19
+
20
+ // Control name lookup, format: title, command
21
+ controls : {
22
+ bold : ['bold_desc', 'Bold'],
23
+ italic : ['italic_desc', 'Italic'],
24
+ underline : ['underline_desc', 'Underline'],
25
+ strikethrough : ['striketrough_desc', 'Strikethrough'],
26
+ justifyleft : ['justifyleft_desc', 'JustifyLeft'],
27
+ justifycenter : ['justifycenter_desc', 'JustifyCenter'],
28
+ justifyright : ['justifyright_desc', 'JustifyRight'],
29
+ justifyfull : ['justifyfull_desc', 'JustifyFull'],
30
+ bullist : ['bullist_desc', 'InsertUnorderedList'],
31
+ numlist : ['numlist_desc', 'InsertOrderedList'],
32
+ outdent : ['outdent_desc', 'Outdent'],
33
+ indent : ['indent_desc', 'Indent'],
34
+ cut : ['cut_desc', 'Cut'],
35
+ copy : ['copy_desc', 'Copy'],
36
+ paste : ['paste_desc', 'Paste'],
37
+ undo : ['undo_desc', 'Undo'],
38
+ redo : ['redo_desc', 'Redo'],
39
+ link : ['link_desc', 'mceLink'],
40
+ unlink : ['unlink_desc', 'unlink'],
41
+ image : ['image_desc', 'mceImage'],
42
+ cleanup : ['cleanup_desc', 'mceCleanup'],
43
+ help : ['help_desc', 'mceHelp'],
44
+ code : ['code_desc', 'mceCodeEditor'],
45
+ hr : ['hr_desc', 'InsertHorizontalRule'],
46
+ removeformat : ['removeformat_desc', 'RemoveFormat'],
47
+ sub : ['sub_desc', 'subscript'],
48
+ sup : ['sup_desc', 'superscript'],
49
+ forecolor : ['forecolor_desc', 'ForeColor'],
50
+ forecolorpicker : ['forecolor_desc', 'mceForeColor'],
51
+ backcolor : ['backcolor_desc', 'HiliteColor'],
52
+ backcolorpicker : ['backcolor_desc', 'mceBackColor'],
53
+ charmap : ['charmap_desc', 'mceCharMap'],
54
+ visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
55
+ anchor : ['anchor_desc', 'mceInsertAnchor'],
56
+ newdocument : ['newdocument_desc', 'mceNewDocument'],
57
+ blockquote : ['blockquote_desc', 'mceBlockQuote']
58
+ },
59
+
60
+ stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
61
+
62
+ init : function(ed, url) {
63
+ var t = this, s, v, o;
64
+
65
+ t.editor = ed;
66
+ t.url = url;
67
+ t.onResolveName = new tinymce.util.Dispatcher(this);
68
+
69
+ // Default settings
70
+ t.settings = s = extend({
71
+ theme_advanced_path : true,
72
+ theme_advanced_toolbar_location : 'bottom',
73
+ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
74
+ theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
75
+ theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
76
+ theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
77
+ theme_advanced_toolbar_align : "center",
78
+ theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
79
+ theme_advanced_more_colors : 1,
80
+ theme_advanced_row_height : 23,
81
+ theme_advanced_resize_horizontal : 1,
82
+ theme_advanced_resizing_use_cookie : 1,
83
+ theme_advanced_font_sizes : "1,2,3,4,5,6,7",
84
+ readonly : ed.settings.readonly
85
+ }, ed.settings);
86
+
87
+ // Setup default font_size_style_values
88
+ if (!s.font_size_style_values)
89
+ s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";
90
+
91
+ if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {
92
+ s.font_size_style_values = tinymce.explode(s.font_size_style_values);
93
+ s.font_size_classes = tinymce.explode(s.font_size_classes || '');
94
+
95
+ // Parse string value
96
+ o = {};
97
+ ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;
98
+ each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {
99
+ var cl;
100
+
101
+ if (k == v && v >= 1 && v <= 7) {
102
+ k = v + ' (' + t.sizes[v - 1] + 'pt)';
103
+ cl = s.font_size_classes[v - 1];
104
+ v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
105
+ }
106
+
107
+ if (/^\s*\./.test(v))
108
+ cl = v.replace(/\./g, '');
109
+
110
+ o[k] = cl ? {'class' : cl} : {fontSize : v};
111
+ });
112
+
113
+ s.theme_advanced_font_sizes = o;
114
+ }
115
+
116
+ if ((v = s.theme_advanced_path_location) && v != 'none')
117
+ s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
118
+
119
+ if (s.theme_advanced_statusbar_location == 'none')
120
+ s.theme_advanced_statusbar_location = 0;
121
+
122
+ // Init editor
123
+ ed.onInit.add(function() {
124
+ if (!ed.settings.readonly)
125
+ ed.onNodeChange.add(t._nodeChanged, t);
126
+
127
+ if (ed.settings.content_css !== false)
128
+ ed.dom.loadCSS(ed.baseURI.toAbsolute("themes/advanced/skins/" + ed.settings.skin + "/content.css"));
129
+ });
130
+
131
+ ed.onSetProgressState.add(function(ed, b, ti) {
132
+ var co, id = ed.id, tb;
133
+
134
+ if (b) {
135
+ t.progressTimer = setTimeout(function() {
136
+ co = ed.getContainer();
137
+ co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
138
+ tb = DOM.get(ed.id + '_tbl');
139
+
140
+ DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
141
+ DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
142
+ }, ti || 0);
143
+ } else {
144
+ DOM.remove(id + '_blocker');
145
+ DOM.remove(id + '_progress');
146
+ clearTimeout(t.progressTimer);
147
+ }
148
+ });
149
+
150
+ DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");
151
+
152
+ if (s.skin_variant)
153
+ DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
154
+ },
155
+
156
+ createControl : function(n, cf) {
157
+ var cd, c;
158
+
159
+ if (c = cf.createControl(n))
160
+ return c;
161
+
162
+ switch (n) {
163
+ case "styleselect":
164
+ return this._createStyleSelect();
165
+
166
+ case "formatselect":
167
+ return this._createBlockFormats();
168
+
169
+ case "fontselect":
170
+ return this._createFontSelect();
171
+
172
+ case "fontsizeselect":
173
+ return this._createFontSizeSelect();
174
+
175
+ case "forecolor":
176
+ return this._createForeColorMenu();
177
+
178
+ case "backcolor":
179
+ return this._createBackColorMenu();
180
+ }
181
+
182
+ if ((cd = this.controls[n]))
183
+ return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
184
+ },
185
+
186
+ execCommand : function(cmd, ui, val) {
187
+ var f = this['_' + cmd];
188
+
189
+ if (f) {
190
+ f.call(this, ui, val);
191
+ return true;
192
+ }
193
+
194
+ return false;
195
+ },
196
+
197
+ _importClasses : function(e) {
198
+ var ed = this.editor, ctrl = ed.controlManager.get('styleselect');
199
+
200
+ if (ctrl.getLength() == 0) {
201
+ each(ed.dom.getClasses(), function(o, idx) {
202
+ var name = 'style_' + idx;
203
+
204
+ ed.formatter.register(name, {
205
+ inline : 'span',
206
+ classes : o['class'],
207
+ selector : '*'
208
+ });
209
+
210
+ ctrl.add(o['class'], name);
211
+ });
212
+ }
213
+ },
214
+
215
+ _createStyleSelect : function(n) {
216
+ var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;
217
+
218
+ // Setup style select box
219
+ ctrl = ctrlMan.createListBox('styleselect', {
220
+ title : 'advanced.style_select',
221
+ onselect : function(name) {
222
+ ed.execCommand('mceToggleFormat', false, name);
223
+
224
+ return false; // No auto select
225
+ }
226
+ });
227
+
228
+ // Handle specified format
229
+ ed.onInit.add(function() {
230
+ var counter = 0, formats = ed.getParam('style_formats');
231
+
232
+ if (formats) {
233
+ each(formats, function(fmt) {
234
+ var name, keys = 0;
235
+
236
+ each(fmt, function() {keys++;});
237
+
238
+ if (keys > 1) {
239
+ name = fmt.name = fmt.name || 'style_' + (counter++);
240
+ ed.formatter.register(name, fmt);
241
+ ctrl.add(fmt.title, name);
242
+ } else
243
+ ctrl.add(fmt.title);
244
+ });
245
+ } else {
246
+ each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {
247
+ var name;
248
+
249
+ if (val) {
250
+ name = 'style_' + (counter++);
251
+
252
+ ed.formatter.register(name, {
253
+ inline : 'span',
254
+ classes : val
255
+ });
256
+
257
+ ctrl.add(t.editor.translate(key), name);
258
+ }
259
+ });
260
+ }
261
+ });
262
+
263
+ // Auto import classes if the ctrl box is empty
264
+ if (ctrl.getLength() == 0) {
265
+ ctrl.onPostRender.add(function(ed, n) {
266
+ if (!ctrl.NativeListBox) {
267
+ Event.add(n.id + '_text', 'focus', t._importClasses, t);
268
+ Event.add(n.id + '_text', 'mousedown', t._importClasses, t);
269
+ Event.add(n.id + '_open', 'focus', t._importClasses, t);
270
+ Event.add(n.id + '_open', 'mousedown', t._importClasses, t);
271
+ } else
272
+ Event.add(n.id, 'focus', t._importClasses, t);
273
+ });
274
+ }
275
+
276
+ return ctrl;
277
+ },
278
+
279
+ _createFontSelect : function() {
280
+ var c, t = this, ed = t.editor;
281
+
282
+ c = ed.controlManager.createListBox('fontselect', {
283
+ title : 'advanced.fontdefault',
284
+ onselect : function(v) {
285
+ ed.execCommand('FontName', false, v);
286
+ return false; // No auto select
287
+ }
288
+ });
289
+
290
+ if (c) {
291
+ each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {
292
+ c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});
293
+ });
294
+ }
295
+
296
+ return c;
297
+ },
298
+
299
+ _createFontSizeSelect : function() {
300
+ var t = this, ed = t.editor, c, i = 0, cl = [];
301
+
302
+ c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
303
+ if (v.fontSize)
304
+ ed.execCommand('FontSize', false, v.fontSize);
305
+ else {
306
+ each(t.settings.theme_advanced_font_sizes, function(v, k) {
307
+ if (v['class'])
308
+ cl.push(v['class']);
309
+ });
310
+
311
+ ed.editorCommands._applyInlineStyle('span', {'class' : v['class']}, {check_classes : cl});
312
+ }
313
+
314
+ return false; // No auto select
315
+ }});
316
+
317
+ if (c) {
318
+ each(t.settings.theme_advanced_font_sizes, function(v, k) {
319
+ var fz = v.fontSize;
320
+
321
+ if (fz >= 1 && fz <= 7)
322
+ fz = t.sizes[parseInt(fz) - 1] + 'pt';
323
+
324
+ c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});
325
+ });
326
+ }
327
+
328
+ return c;
329
+ },
330
+
331
+ _createBlockFormats : function() {
332
+ var c, fmts = {
333
+ p : 'advanced.paragraph',
334
+ address : 'advanced.address',
335
+ pre : 'advanced.pre',
336
+ h1 : 'advanced.h1',
337
+ h2 : 'advanced.h2',
338
+ h3 : 'advanced.h3',
339
+ h4 : 'advanced.h4',
340
+ h5 : 'advanced.h5',
341
+ h6 : 'advanced.h6',
342
+ div : 'advanced.div',
343
+ blockquote : 'advanced.blockquote',
344
+ code : 'advanced.code',
345
+ dt : 'advanced.dt',
346
+ dd : 'advanced.dd',
347
+ samp : 'advanced.samp'
348
+ }, t = this;
349
+
350
+ c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', cmd : 'FormatBlock'});
351
+ if (c) {
352
+ each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
353
+ c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
354
+ });
355
+ }
356
+
357
+ return c;
358
+ },
359
+
360
+ _createForeColorMenu : function() {
361
+ var c, t = this, s = t.settings, o = {}, v;
362
+
363
+ if (s.theme_advanced_more_colors) {
364
+ o.more_colors_func = function() {
365
+ t._mceColorPicker(0, {
366
+ color : c.value,
367
+ func : function(co) {
368
+ c.setColor(co);
369
+ }
370
+ });
371
+ };
372
+ }
373
+
374
+ if (v = s.theme_advanced_text_colors)
375
+ o.colors = v;
376
+
377
+ if (s.theme_advanced_default_foreground_color)
378
+ o.default_color = s.theme_advanced_default_foreground_color;
379
+
380
+ o.title = 'advanced.forecolor_desc';
381
+ o.cmd = 'ForeColor';
382
+ o.scope = this;
383
+
384
+ c = t.editor.controlManager.createColorSplitButton('forecolor', o);
385
+
386
+ return c;
387
+ },
388
+
389
+ _createBackColorMenu : function() {
390
+ var c, t = this, s = t.settings, o = {}, v;
391
+
392
+ if (s.theme_advanced_more_colors) {
393
+ o.more_colors_func = function() {
394
+ t._mceColorPicker(0, {
395
+ color : c.value,
396
+ func : function(co) {
397
+ c.setColor(co);
398
+ }
399
+ });
400
+ };
401
+ }
402
+
403
+ if (v = s.theme_advanced_background_colors)
404
+ o.colors = v;
405
+
406
+ if (s.theme_advanced_default_background_color)
407
+ o.default_color = s.theme_advanced_default_background_color;
408
+
409
+ o.title = 'advanced.backcolor_desc';
410
+ o.cmd = 'HiliteColor';
411
+ o.scope = this;
412
+
413
+ c = t.editor.controlManager.createColorSplitButton('backcolor', o);
414
+
415
+ return c;
416
+ },
417
+
418
+ renderUI : function(o) {
419
+ var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
420
+
421
+ n = p = DOM.create('span', {id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
422
+
423
+ if (!DOM.boxModel)
424
+ n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
425
+
426
+ n = sc = DOM.add(n, 'table', {id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
427
+ n = tb = DOM.add(n, 'tbody');
428
+
429
+ switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
430
+ case "rowlayout":
431
+ ic = t._rowLayout(s, tb, o);
432
+ break;
433
+
434
+ case "customlayout":
435
+ ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
436
+ break;
437
+
438
+ default:
439
+ ic = t._simpleLayout(s, tb, o, p);
440
+ }
441
+
442
+ n = o.targetNode;
443
+
444
+ // Add classes to first and last TRs
445
+ nl = DOM.stdMode ? sc.getElementsByTagName('tr') : sc.rows; // Quick fix for IE 8
446
+ DOM.addClass(nl[0], 'mceFirst');
447
+ DOM.addClass(nl[nl.length - 1], 'mceLast');
448
+
449
+ // Add classes to first and last TDs
450
+ each(DOM.select('tr', tb), function(n) {
451
+ DOM.addClass(n.firstChild, 'mceFirst');
452
+ DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');
453
+ });
454
+
455
+ if (DOM.get(s.theme_advanced_toolbar_container))
456
+ DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
457
+ else
458
+ DOM.insertAfter(p, n);
459
+
460
+ Event.add(ed.id + '_path_row', 'click', function(e) {
461
+ e = e.target;
462
+
463
+ if (e.nodeName == 'A') {
464
+ t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));
465
+
466
+ return Event.cancel(e);
467
+ }
468
+ });
469
+ /*
470
+ if (DOM.get(ed.id + '_path_row')) {
471
+ Event.add(ed.id + '_tbl', 'mouseover', function(e) {
472
+ var re;
473
+
474
+ e = e.target;
475
+
476
+ if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
477
+ re = DOM.get(ed.id + '_path_row');
478
+ t.lastPath = re.innerHTML;
479
+ DOM.setHTML(re, e.parentNode.title);
480
+ }
481
+ });
482
+
483
+ Event.add(ed.id + '_tbl', 'mouseout', function(e) {
484
+ if (t.lastPath) {
485
+ DOM.setHTML(ed.id + '_path_row', t.lastPath);
486
+ t.lastPath = 0;
487
+ }
488
+ });
489
+ }
490
+ */
491
+
492
+ if (!ed.getParam('accessibility_focus'))
493
+ Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
494
+
495
+ if (s.theme_advanced_toolbar_location == 'external')
496
+ o.deltaHeight = 0;
497
+
498
+ t.deltaHeight = o.deltaHeight;
499
+ o.targetNode = null;
500
+
501
+ return {
502
+ iframeContainer : ic,
503
+ editorContainer : ed.id + '_parent',
504
+ sizeContainer : sc,
505
+ deltaHeight : o.deltaHeight
506
+ };
507
+ },
508
+
509
+ getInfo : function() {
510
+ return {
511
+ longname : 'Advanced theme',
512
+ author : 'Moxiecode Systems AB',
513
+ authorurl : 'http://tinymce.moxiecode.com',
514
+ version : tinymce.majorVersion + "." + tinymce.minorVersion
515
+ }
516
+ },
517
+
518
+ resizeBy : function(dw, dh) {
519
+ var e = DOM.get(this.editor.id + '_tbl');
520
+
521
+ this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
522
+ },
523
+
524
+ resizeTo : function(w, h) {
525
+ var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
526
+
527
+ // Boundery fix box
528
+ w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
529
+ h = Math.max(s.theme_advanced_resizing_min_height || 100, h);
530
+ w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
531
+ h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
532
+
533
+ // Resize iframe and container
534
+ DOM.setStyle(e, 'height', '');
535
+ DOM.setStyle(ifr, 'height', h);
536
+
537
+ if (s.theme_advanced_resize_horizontal) {
538
+ DOM.setStyle(e, 'width', '');
539
+ DOM.setStyle(ifr, 'width', w);
540
+
541
+ // Make sure that the size is never smaller than the over all ui
542
+ if (w < e.clientWidth)
543
+ DOM.setStyle(ifr, 'width', e.clientWidth);
544
+ }
545
+ },
546
+
547
+ destroy : function() {
548
+ var id = this.editor.id;
549
+
550
+ Event.clear(id + '_resize');
551
+ Event.clear(id + '_path_row');
552
+ Event.clear(id + '_external_close');
553
+ },
554
+
555
+ // Internal functions
556
+
557
+ _simpleLayout : function(s, tb, o, p) {
558
+ var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
559
+
560
+ if (s.readonly) {
561
+ n = DOM.add(tb, 'tr');
562
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
563
+ return ic;
564
+ }
565
+
566
+ // Create toolbar container at top
567
+ if (lo == 'top')
568
+ t._addToolbars(tb, o);
569
+
570
+ // Create external toolbar
571
+ if (lo == 'external') {
572
+ n = c = DOM.create('div', {style : 'position:relative'});
573
+ n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
574
+ DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
575
+ n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
576
+ etb = DOM.add(n, 'tbody');
577
+
578
+ if (p.firstChild.className == 'mceOldBoxModel')
579
+ p.firstChild.appendChild(c);
580
+ else
581
+ p.insertBefore(c, p.firstChild);
582
+
583
+ t._addToolbars(etb, o);
584
+
585
+ ed.onMouseUp.add(function() {
586
+ var e = DOM.get(ed.id + '_external');
587
+ DOM.show(e);
588
+
589
+ DOM.hide(lastExtID);
590
+
591
+ var f = Event.add(ed.id + '_external_close', 'click', function() {
592
+ DOM.hide(ed.id + '_external');
593
+ Event.remove(ed.id + '_external_close', 'click', f);
594
+ });
595
+
596
+ DOM.show(e);
597
+ DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
598
+
599
+ // Fixes IE rendering bug
600
+ DOM.hide(e);
601
+ DOM.show(e);
602
+ e.style.filter = '';
603
+
604
+ lastExtID = ed.id + '_external';
605
+
606
+ e = null;
607
+ });
608
+ }
609
+
610
+ if (sl == 'top')
611
+ t._addStatusBar(tb, o);
612
+
613
+ // Create iframe container
614
+ if (!s.theme_advanced_toolbar_container) {
615
+ n = DOM.add(tb, 'tr');
616
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
617
+ }
618
+
619
+ // Create toolbar container at bottom
620
+ if (lo == 'bottom')
621
+ t._addToolbars(tb, o);
622
+
623
+ if (sl == 'bottom')
624
+ t._addStatusBar(tb, o);
625
+
626
+ return ic;
627
+ },
628
+
629
+ _rowLayout : function(s, tb, o) {
630
+ var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;
631
+
632
+ dc = s.theme_advanced_containers_default_class || '';
633
+ da = s.theme_advanced_containers_default_align || 'center';
634
+
635
+ each(explode(s.theme_advanced_containers || ''), function(c, i) {
636
+ var v = s['theme_advanced_container_' + c] || '';
637
+
638
+ switch (v.toLowerCase()) {
639
+ case 'mceeditor':
640
+ n = DOM.add(tb, 'tr');
641
+ n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
642
+ break;
643
+
644
+ case 'mceelementpath':
645
+ t._addStatusBar(tb, o);
646
+ break;
647
+
648
+ default:
649
+ a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();
650
+ a = 'mce' + t._ufirst(a);
651
+
652
+ n = DOM.add(DOM.add(tb, 'tr'), 'td', {
653
+ 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da
654
+ });
655
+
656
+ to = cf.createToolbar("toolbar" + i);
657
+ t._addControls(v, to);
658
+ DOM.setHTML(n, to.renderHTML());
659
+ o.deltaHeight -= s.theme_advanced_row_height;
660
+ }
661
+ });
662
+
663
+ return ic;
664
+ },
665
+
666
+ _addControls : function(v, tb) {
667
+ var t = this, s = t.settings, di, cf = t.editor.controlManager;
668
+
669
+ if (s.theme_advanced_disable && !t._disabled) {
670
+ di = {};
671
+
672
+ each(explode(s.theme_advanced_disable), function(v) {
673
+ di[v] = 1;
674
+ });
675
+
676
+ t._disabled = di;
677
+ } else
678
+ di = t._disabled;
679
+
680
+ each(explode(v), function(n) {
681
+ var c;
682
+
683
+ if (di && di[n])
684
+ return;
685
+
686
+ // Compatiblity with 2.x
687
+ if (n == 'tablecontrols') {
688
+ each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
689
+ n = t.createControl(n, cf);
690
+
691
+ if (n)
692
+ tb.add(n);
693
+ });
694
+
695
+ return;
696
+ }
697
+
698
+ c = t.createControl(n, cf);
699
+
700
+ if (c)
701
+ tb.add(c);
702
+ });
703
+ },
704
+
705
+ _addToolbars : function(c, o) {
706
+ var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a;
707
+
708
+ a = s.theme_advanced_toolbar_align.toLowerCase();
709
+ a = 'mce' + t._ufirst(a);
710
+
711
+ n = DOM.add(DOM.add(c, 'tr'), 'td', {'class' : 'mceToolbar ' + a});
712
+
713
+ if (!ed.getParam('accessibility_focus'))
714
+ h.push(DOM.createHTML('a', {href : '#', onfocus : 'tinyMCE.get(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
715
+
716
+ h.push(DOM.createHTML('a', {href : '#', accesskey : 'q', title : ed.getLang("advanced.toolbar_focus")}, '<!-- IE -->'));
717
+
718
+ // Create toolbar and add the controls
719
+ for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
720
+ tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
721
+
722
+ if (s['theme_advanced_buttons' + i + '_add'])
723
+ v += ',' + s['theme_advanced_buttons' + i + '_add'];
724
+
725
+ if (s['theme_advanced_buttons' + i + '_add_before'])
726
+ v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
727
+
728
+ t._addControls(v, tb);
729
+
730
+ //n.appendChild(n = tb.render());
731
+ h.push(tb.renderHTML());
732
+
733
+ o.deltaHeight -= s.theme_advanced_row_height;
734
+ }
735
+
736
+ h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
737
+ DOM.setHTML(n, h.join(''));
738
+ },
739
+
740
+ _addStatusBar : function(tb, o) {
741
+ var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
742
+
743
+ n = DOM.add(tb, 'tr');
744
+ n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'});
745
+ n = DOM.add(n, 'div', {id : ed.id + '_path_row'}, s.theme_advanced_path ? ed.translate('advanced.path') + ': ' : '&#160;');
746
+ DOM.add(n, 'a', {href : '#', accesskey : 'x'});
747
+
748
+ if (s.theme_advanced_resizing) {
749
+ DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});
750
+
751
+ if (s.theme_advanced_resizing_use_cookie) {
752
+ ed.onPostRender.add(function() {
753
+ var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
754
+
755
+ if (!o)
756
+ return;
757
+
758
+ t.resizeTo(o.cw, o.ch);
759
+ });
760
+ }
761
+
762
+ ed.onPostRender.add(function() {
763
+ Event.add(ed.id + '_resize', 'mousedown', function(e) {
764
+ var mouseMoveHandler1, mouseMoveHandler2,
765
+ mouseUpHandler1, mouseUpHandler2,
766
+ startX, startY, startWidth, startHeight, width, height, ifrElm;
767
+
768
+ function resizeOnMove(e) {
769
+ width = startWidth + (e.screenX - startX);
770
+ height = startHeight + (e.screenY - startY);
771
+
772
+ t.resizeTo(width, height);
773
+ };
774
+
775
+ function endResize(e) {
776
+ // Stop listening
777
+ Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
778
+ Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
779
+ Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
780
+ Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
781
+
782
+ // Store away the size
783
+ if (s.theme_advanced_resizing_use_cookie) {
784
+ Cookie.setHash("TinyMCE_" + ed.id + "_size", {
785
+ cw : width,
786
+ ch : height
787
+ });
788
+ }
789
+ };
790
+
791
+ e.preventDefault();
792
+
793
+ // Get the current rect size
794
+ startX = e.screenX;
795
+ startY = e.screenY;
796
+ ifrElm = DOM.get(t.editor.id + '_ifr');
797
+ startWidth = width = ifrElm.clientWidth;
798
+ startHeight = height = ifrElm.clientHeight;
799
+
800
+ // Register envent handlers
801
+ mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
802
+ mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
803
+ mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
804
+ mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
805
+ });
806
+ });
807
+ }
808
+
809
+ o.deltaHeight -= 21;
810
+ n = tb = null;
811
+ },
812
+
813
+ _nodeChanged : function(ed, cm, n, co, ob) {
814
+ var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, formatNames, matches;
815
+
816
+ tinymce.each(t.stateControls, function(c) {
817
+ cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
818
+ });
819
+
820
+ function getParent(name) {
821
+ var i, parents = ob.parents, func = name;
822
+
823
+ if (typeof(name) == 'string') {
824
+ func = function(node) {
825
+ return node.nodeName == name;
826
+ };
827
+ }
828
+
829
+ for (i = 0; i < parents.length; i++) {
830
+ if (func(parents[i]))
831
+ return parents[i];
832
+ }
833
+ };
834
+
835
+ cm.setActive('visualaid', ed.hasVisual);
836
+ cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
837
+ cm.setDisabled('redo', !ed.undoManager.hasRedo());
838
+ cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
839
+
840
+ p = getParent('A');
841
+ if (c = cm.get('link')) {
842
+ if (!p || !p.name) {
843
+ c.setDisabled(!p && co);
844
+ c.setActive(!!p);
845
+ }
846
+ }
847
+
848
+ if (c = cm.get('unlink')) {
849
+ c.setDisabled(!p && co);
850
+ c.setActive(!!p && !p.name);
851
+ }
852
+
853
+ if (c = cm.get('anchor')) {
854
+ c.setActive(!!p && p.name);
855
+ }
856
+
857
+ p = getParent('IMG');
858
+ if (c = cm.get('image'))
859
+ c.setActive(!!p && n.className.indexOf('mceItem') == -1);
860
+
861
+ if (c = cm.get('styleselect')) {
862
+ t._importClasses();
863
+
864
+ formatNames = [];
865
+ each(c.items, function(item) {
866
+ formatNames.push(item.value);
867
+ });
868
+
869
+ matches = ed.formatter.matchAll(formatNames);
870
+ c.select(matches[0]);
871
+ }
872
+
873
+ if (c = cm.get('formatselect')) {
874
+ p = getParent(DOM.isBlock);
875
+
876
+ if (p)
877
+ c.select(p.nodeName.toLowerCase());
878
+ }
879
+
880
+ // Find out current fontSize, fontFamily and fontClass
881
+ getParent(function(n) {
882
+ if (n.nodeName === 'SPAN') {
883
+ if (!cl && n.className)
884
+ cl = n.className;
885
+
886
+ if (!fz && n.style.fontSize)
887
+ fz = n.style.fontSize;
888
+
889
+ if (!fn && n.style.fontFamily)
890
+ fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
891
+ }
892
+
893
+ return false;
894
+ });
895
+
896
+ if (c = cm.get('fontselect')) {
897
+ c.select(function(v) {
898
+ return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;
899
+ });
900
+ }
901
+
902
+ // Select font size
903
+ if (c = cm.get('fontsizeselect')) {
904
+ // Use computed style
905
+ if (s.theme_advanced_runtime_fontsize && !fz && !cl)
906
+ fz = ed.dom.getStyle(n, 'fontSize', true);
907
+
908
+ c.select(function(v) {
909
+ if (v.fontSize && v.fontSize === fz)
910
+ return true;
911
+
912
+ if (v['class'] && v['class'] === cl)
913
+ return true;
914
+ });
915
+ }
916
+
917
+ if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
918
+ p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
919
+ DOM.setHTML(p, '');
920
+
921
+ getParent(function(n) {
922
+ var na = n.nodeName.toLowerCase(), u, pi, ti = '';
923
+
924
+ /*if (n.getAttribute('_mce_bogus'))
925
+ return;
926
+ */
927
+ // Ignore non element and hidden elements
928
+ if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
929
+ return;
930
+
931
+ // Fake name
932
+ if (v = DOM.getAttrib(n, 'mce_name'))
933
+ na = v;
934
+
935
+ // Handle prefix
936
+ if (tinymce.isIE && n.scopeName !== 'HTML')
937
+ na = n.scopeName + ':' + na;
938
+
939
+ // Remove internal prefix
940
+ na = na.replace(/mce\:/g, '');
941
+
942
+ // Handle node name
943
+ switch (na) {
944
+ case 'b':
945
+ na = 'strong';
946
+ break;
947
+
948
+ case 'i':
949
+ na = 'em';
950
+ break;
951
+
952
+ case 'img':
953
+ if (v = DOM.getAttrib(n, 'src'))
954
+ ti += 'src: ' + v + ' ';
955
+
956
+ break;
957
+
958
+ case 'a':
959
+ if (v = DOM.getAttrib(n, 'name')) {
960
+ ti += 'name: ' + v + ' ';
961
+ na += '#' + v;
962
+ }
963
+
964
+ if (v = DOM.getAttrib(n, 'href'))
965
+ ti += 'href: ' + v + ' ';
966
+
967
+ break;
968
+
969
+ case 'font':
970
+ if (v = DOM.getAttrib(n, 'face'))
971
+ ti += 'font: ' + v + ' ';
972
+
973
+ if (v = DOM.getAttrib(n, 'size'))
974
+ ti += 'size: ' + v + ' ';
975
+
976
+ if (v = DOM.getAttrib(n, 'color'))
977
+ ti += 'color: ' + v + ' ';
978
+
979
+ break;
980
+
981
+ case 'span':
982
+ if (v = DOM.getAttrib(n, 'style'))
983
+ ti += 'style: ' + v + ' ';
984
+
985
+ break;
986
+ }
987
+
988
+ if (v = DOM.getAttrib(n, 'id'))
989
+ ti += 'id: ' + v + ' ';
990
+
991
+ if (v = n.className) {
992
+ v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
993
+
994
+ if (v) {
995
+ ti += 'class: ' + v + ' ';
996
+
997
+ if (DOM.isBlock(n) || na == 'img' || na == 'span')
998
+ na += '.' + v;
999
+ }
1000
+ }
1001
+
1002
+ na = na.replace(/(html:)/g, '');
1003
+ na = {name : na, node : n, title : ti};
1004
+ t.onResolveName.dispatch(t, na);
1005
+ ti = na.title;
1006
+ na = na.name;
1007
+
1008
+ //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
1009
+ pi = DOM.create('a', {'href' : "javascript:;", onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
1010
+
1011
+ if (p.hasChildNodes()) {
1012
+ p.insertBefore(DOM.doc.createTextNode(' \u00bb '), p.firstChild);
1013
+ p.insertBefore(pi, p.firstChild);
1014
+ } else
1015
+ p.appendChild(pi);
1016
+ }, ed.getBody());
1017
+ }
1018
+ },
1019
+
1020
+ // Commands gets called by execCommand
1021
+
1022
+ _sel : function(v) {
1023
+ this.editor.execCommand('mceSelectNodeDepth', false, v);
1024
+ },
1025
+
1026
+ _mceInsertAnchor : function(ui, v) {
1027
+ var ed = this.editor;
1028
+
1029
+ ed.windowManager.open({
1030
+ url : tinymce.baseURL + '/themes/advanced/anchor.htm',
1031
+ width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
1032
+ height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
1033
+ inline : true
1034
+ }, {
1035
+ theme_url : this.url
1036
+ });
1037
+ },
1038
+
1039
+ _mceCharMap : function() {
1040
+ var ed = this.editor;
1041
+
1042
+ ed.windowManager.open({
1043
+ url : tinymce.baseURL + '/themes/advanced/charmap.htm',
1044
+ width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
1045
+ height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
1046
+ inline : true
1047
+ }, {
1048
+ theme_url : this.url
1049
+ });
1050
+ },
1051
+
1052
+ _mceHelp : function() {
1053
+ var ed = this.editor;
1054
+
1055
+ ed.windowManager.open({
1056
+ url : tinymce.baseURL + '/themes/advanced/about.htm',
1057
+ width : 480,
1058
+ height : 380,
1059
+ inline : true
1060
+ }, {
1061
+ theme_url : this.url
1062
+ });
1063
+ },
1064
+
1065
+ _mceColorPicker : function(u, v) {
1066
+ var ed = this.editor;
1067
+
1068
+ v = v || {};
1069
+
1070
+ ed.windowManager.open({
1071
+ url : tinymce.baseURL + '/themes/advanced/color_picker.htm',
1072
+ width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
1073
+ height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
1074
+ close_previous : false,
1075
+ inline : true
1076
+ }, {
1077
+ input_color : v.color,
1078
+ func : v.func,
1079
+ theme_url : this.url
1080
+ });
1081
+ },
1082
+
1083
+ _mceCodeEditor : function(ui, val) {
1084
+ var ed = this.editor;
1085
+
1086
+ ed.windowManager.open({
1087
+ url : tinymce.baseURL + '/themes/advanced/source_editor.htm',
1088
+ width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
1089
+ height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
1090
+ inline : true,
1091
+ resizable : true,
1092
+ maximizable : true
1093
+ }, {
1094
+ theme_url : this.url
1095
+ });
1096
+ },
1097
+
1098
+ _mceImage : function(ui, val) {
1099
+ var ed = this.editor;
1100
+
1101
+ // Internal image object like a flash placeholder
1102
+ if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
1103
+ return;
1104
+
1105
+ ed.windowManager.open({
1106
+ url : tinymce.baseURL + '/themes/advanced/image.htm',
1107
+ width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
1108
+ height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
1109
+ inline : true
1110
+ }, {
1111
+ theme_url : this.url
1112
+ });
1113
+ },
1114
+
1115
+ _mceLink : function(ui, val) {
1116
+ var ed = this.editor;
1117
+
1118
+ ed.windowManager.open({
1119
+ url : tinymce.baseURL + '/themes/advanced/link.htm',
1120
+ width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
1121
+ height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
1122
+ inline : true
1123
+ }, {
1124
+ theme_url : this.url
1125
+ });
1126
+ },
1127
+
1128
+ _mceNewDocument : function() {
1129
+ var ed = this.editor;
1130
+
1131
+ ed.windowManager.confirm('advanced.newdocument', function(s) {
1132
+ if (s)
1133
+ ed.execCommand('mceSetContent', false, '');
1134
+ });
1135
+ },
1136
+
1137
+ _mceForeColor : function() {
1138
+ var t = this;
1139
+
1140
+ this._mceColorPicker(0, {
1141
+ color: t.fgColor,
1142
+ func : function(co) {
1143
+ t.fgColor = co;
1144
+ t.editor.execCommand('ForeColor', false, co);
1145
+ }
1146
+ });
1147
+ },
1148
+
1149
+ _mceBackColor : function() {
1150
+ var t = this;
1151
+
1152
+ this._mceColorPicker(0, {
1153
+ color: t.bgColor,
1154
+ func : function(co) {
1155
+ t.bgColor = co;
1156
+ t.editor.execCommand('HiliteColor', false, co);
1157
+ }
1158
+ });
1159
+ },
1160
+
1161
+ _ufirst : function(s) {
1162
+ return s.substring(0, 1).toUpperCase() + s.substring(1);
1163
+ }
1164
+ });
1165
+
1166
+ tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
1167
+ }(tinymce));