browsercmsi 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1493) hide show
  1. data/LICENSE.txt +165 -0
  2. data/README.markdown +56 -0
  3. data/app/controllers/application_controller.rb +14 -0
  4. data/app/controllers/cms/application_controller.rb +68 -0
  5. data/app/controllers/cms/attachments_controller.rb +11 -0
  6. data/app/controllers/cms/base_controller.rb +21 -0
  7. data/app/controllers/cms/cache_controller.rb +22 -0
  8. data/app/controllers/cms/categories_controller.rb +5 -0
  9. data/app/controllers/cms/category_types_controller.rb +5 -0
  10. data/app/controllers/cms/connectors_controller.rb +63 -0
  11. data/app/controllers/cms/content_block_controller.rb +289 -0
  12. data/app/controllers/cms/content_controller.rb +176 -0
  13. data/app/controllers/cms/content_types_controller.rb +7 -0
  14. data/app/controllers/cms/dashboard_controller.rb +10 -0
  15. data/app/controllers/cms/dynamic_views_controller.rb +65 -0
  16. data/app/controllers/cms/email_messages_controller.rb +14 -0
  17. data/app/controllers/cms/error_handling.rb +25 -0
  18. data/app/controllers/cms/file_blocks_controller.rb +2 -0
  19. data/app/controllers/cms/groups_controller.rb +26 -0
  20. data/app/controllers/cms/home_controller.rb +5 -0
  21. data/app/controllers/cms/html_blocks_controller.rb +2 -0
  22. data/app/controllers/cms/image_blocks_controller.rb +2 -0
  23. data/app/controllers/cms/links_controller.rb +66 -0
  24. data/app/controllers/cms/locales_controller.rb +12 -0
  25. data/app/controllers/cms/page_route_conditions_controller.rb +2 -0
  26. data/app/controllers/cms/page_route_options_controller.rb +56 -0
  27. data/app/controllers/cms/page_route_requirements_controller.rb +2 -0
  28. data/app/controllers/cms/page_routes_controller.rb +45 -0
  29. data/app/controllers/cms/pages_controller.rb +137 -0
  30. data/app/controllers/cms/portlet_controller.rb +12 -0
  31. data/app/controllers/cms/portlets_controller.rb +40 -0
  32. data/app/controllers/cms/redirects_controller.rb +19 -0
  33. data/app/controllers/cms/resource_controller.rb +108 -0
  34. data/app/controllers/cms/routes_controller.rb +23 -0
  35. data/app/controllers/cms/section_nodes_controller.rb +40 -0
  36. data/app/controllers/cms/sections_controller.rb +130 -0
  37. data/app/controllers/cms/sessions_controller.rb +71 -0
  38. data/app/controllers/cms/tags_controller.rb +12 -0
  39. data/app/controllers/cms/tasks_controller.rb +52 -0
  40. data/app/controllers/cms/toolbar_controller.rb +12 -0
  41. data/app/controllers/cms/users_controller.rb +100 -0
  42. data/app/controllers/tests/pretend_controller.rb +32 -0
  43. data/app/helpers/application_helper.rb +5 -0
  44. data/app/helpers/cms/application_helper.rb +155 -0
  45. data/app/helpers/cms/form_builder.rb +178 -0
  46. data/app/helpers/cms/form_tag_helper.rb +32 -0
  47. data/app/helpers/cms/menu_helper.rb +169 -0
  48. data/app/helpers/cms/page_helper.rb +92 -0
  49. data/app/helpers/cms/path_helper.rb +48 -0
  50. data/app/helpers/cms/rendering_helper.rb +42 -0
  51. data/app/helpers/cms/section_nodes_helper.rb +13 -0
  52. data/app/helpers/cms/template_support.rb +21 -0
  53. data/app/models/abstract_file_block.rb +17 -0
  54. data/app/models/attachment.rb +193 -0
  55. data/app/models/category.rb +49 -0
  56. data/app/models/category_type.rb +42 -0
  57. data/app/models/connector.rb +80 -0
  58. data/app/models/content_type.rb +95 -0
  59. data/app/models/content_type_group.rb +3 -0
  60. data/app/models/dynamic_view.rb +80 -0
  61. data/app/models/email_message.rb +31 -0
  62. data/app/models/email_message_mailer.rb +11 -0
  63. data/app/models/file_block.rb +21 -0
  64. data/app/models/forgot_password_mailer.rb +12 -0
  65. data/app/models/group.rb +41 -0
  66. data/app/models/group_permission.rb +7 -0
  67. data/app/models/group_section.rb +4 -0
  68. data/app/models/group_type.rb +12 -0
  69. data/app/models/group_type_permission.rb +4 -0
  70. data/app/models/guest_user.rb +53 -0
  71. data/app/models/html_block.rb +40 -0
  72. data/app/models/image_block.rb +22 -0
  73. data/app/models/link.rb +35 -0
  74. data/app/models/page.rb +276 -0
  75. data/app/models/page_partial.rb +22 -0
  76. data/app/models/page_route.rb +58 -0
  77. data/app/models/page_route_condition.rb +2 -0
  78. data/app/models/page_route_option.rb +3 -0
  79. data/app/models/page_route_requirement.rb +2 -0
  80. data/app/models/page_template.rb +31 -0
  81. data/app/models/permission.rb +10 -0
  82. data/app/models/portlet.rb +167 -0
  83. data/app/models/redirect.rb +4 -0
  84. data/app/models/section.rb +155 -0
  85. data/app/models/section_node.rb +93 -0
  86. data/app/models/site.rb +41 -0
  87. data/app/models/tag.rb +62 -0
  88. data/app/models/tagging.rb +9 -0
  89. data/app/models/task.rb +76 -0
  90. data/app/models/templates.rb +31 -0
  91. data/app/models/user.rb +169 -0
  92. data/app/models/user_group_membership.rb +4 -0
  93. data/app/portlets/dynamic_portlet.rb +7 -0
  94. data/app/portlets/email_page_portlet.rb +24 -0
  95. data/app/portlets/forgot_password_portlet.rb +29 -0
  96. data/app/portlets/login_portlet.rb +10 -0
  97. data/app/portlets/reset_password_portlet.rb +28 -0
  98. data/app/portlets/tag_cloud_portlet.rb +13 -0
  99. data/app/views/cms/blocks/_hidden_fields.html.erb +10 -0
  100. data/app/views/cms/blocks/_toolbar.html.erb +9 -0
  101. data/app/views/cms/blocks/_toolbar_for_collection.html.erb +26 -0
  102. data/app/views/cms/blocks/_toolbar_for_member.html.erb +38 -0
  103. data/app/views/cms/blocks/edit.html.erb +30 -0
  104. data/app/views/cms/blocks/index.html.erb +128 -0
  105. data/app/views/cms/blocks/new.html.erb +21 -0
  106. data/app/views/cms/blocks/show.html.erb +43 -0
  107. data/app/views/cms/blocks/usages.html.erb +44 -0
  108. data/app/views/cms/blocks/versions.html.erb +90 -0
  109. data/app/views/cms/cache/show.html.erb +12 -0
  110. data/app/views/cms/categories/_form.html.erb +36 -0
  111. data/app/views/cms/category_types/_form.html.erb +1 -0
  112. data/app/views/cms/connectors/new.html.erb +71 -0
  113. data/app/views/cms/content/no_page.html.erb +37 -0
  114. data/app/views/cms/content/show.html.erb +21 -0
  115. data/app/views/cms/content_types/index.html.erb +14 -0
  116. data/app/views/cms/dashboard/_page_drafts.html.erb +49 -0
  117. data/app/views/cms/dashboard/_tasks.html.erb +54 -0
  118. data/app/views/cms/dashboard/index.html.erb +15 -0
  119. data/app/views/cms/dynamic_views/_form.html.erb +11 -0
  120. data/app/views/cms/dynamic_views/edit.html.erb +3 -0
  121. data/app/views/cms/dynamic_views/index.html.erb +53 -0
  122. data/app/views/cms/dynamic_views/new.html.erb +3 -0
  123. data/app/views/cms/email_messages/index.html.erb +39 -0
  124. data/app/views/cms/email_messages/show.html.erb +57 -0
  125. data/app/views/cms/file_blocks/_form.html.erb +30 -0
  126. data/app/views/cms/file_blocks/render.html.erb +5 -0
  127. data/app/views/cms/forgot_password_mailer/reset_password.text.html.erb +3 -0
  128. data/app/views/cms/forgot_password_mailer/reset_password.text.plain.erb +3 -0
  129. data/app/views/cms/form_builder/_cms_check_box.html.erb +7 -0
  130. data/app/views/cms/form_builder/_cms_date_picker.html.erb +12 -0
  131. data/app/views/cms/form_builder/_cms_datetime_select.html.erb +12 -0
  132. data/app/views/cms/form_builder/_cms_drop_down.html.erb +12 -0
  133. data/app/views/cms/form_builder/_cms_fancy_drop_down.html.erb +9 -0
  134. data/app/views/cms/form_builder/_cms_file_field.html.erb +36 -0
  135. data/app/views/cms/form_builder/_cms_instructions.html.erb +4 -0
  136. data/app/views/cms/form_builder/_cms_tag_list.html.erb +15 -0
  137. data/app/views/cms/form_builder/_cms_template_editor.html.erb +8 -0
  138. data/app/views/cms/form_builder/_cms_text_area.html.erb +13 -0
  139. data/app/views/cms/form_builder/_cms_text_editor.html.erb +18 -0
  140. data/app/views/cms/form_builder/_cms_text_field.html.erb +12 -0
  141. data/app/views/cms/groups/_form.html.erb +45 -0
  142. data/app/views/cms/groups/_permissions.html.erb +37 -0
  143. data/app/views/cms/groups/_sections.html.erb +19 -0
  144. data/app/views/cms/groups/edit.html.erb +4 -0
  145. data/app/views/cms/groups/index.html.erb +58 -0
  146. data/app/views/cms/groups/new.html.erb +4 -0
  147. data/app/views/cms/html_blocks/_form.html.erb +3 -0
  148. data/app/views/cms/html_blocks/render.html.erb +1 -0
  149. data/app/views/cms/image_blocks/_form.html.erb +30 -0
  150. data/app/views/cms/image_blocks/render.html.erb +1 -0
  151. data/app/views/cms/links/_form.html.erb +13 -0
  152. data/app/views/cms/links/destroy.js.rjs +2 -0
  153. data/app/views/cms/links/edit.html.erb +14 -0
  154. data/app/views/cms/links/new.html.erb +15 -0
  155. data/app/views/cms/menus/_menu.html.erb +9 -0
  156. data/app/views/cms/menus/_menu_item.html.erb +11 -0
  157. data/app/views/cms/page_routes/_form.html.erb +11 -0
  158. data/app/views/cms/page_routes/edit.html.erb +3 -0
  159. data/app/views/cms/page_routes/index.html.erb +56 -0
  160. data/app/views/cms/page_routes/new.html.erb +3 -0
  161. data/app/views/cms/page_routes/show.html.erb +14 -0
  162. data/app/views/cms/pages/_edit_connector.html.erb +27 -0
  163. data/app/views/cms/pages/_edit_container.html.erb +11 -0
  164. data/app/views/cms/pages/_form.html.erb +46 -0
  165. data/app/views/cms/pages/edit.html.erb +23 -0
  166. data/app/views/cms/pages/new.html.erb +33 -0
  167. data/app/views/cms/pages/versions.html.erb +91 -0
  168. data/app/views/cms/redirects/_form.html.erb +15 -0
  169. data/app/views/cms/redirects/edit.html.erb +3 -0
  170. data/app/views/cms/redirects/index.html.erb +50 -0
  171. data/app/views/cms/redirects/new.html.erb +3 -0
  172. data/app/views/cms/routes/index.html.erb +40 -0
  173. data/app/views/cms/section_nodes/_link.html.erb +11 -0
  174. data/app/views/cms/section_nodes/_node.html.erb +34 -0
  175. data/app/views/cms/section_nodes/_page.html.erb +14 -0
  176. data/app/views/cms/section_nodes/_section.html.erb +12 -0
  177. data/app/views/cms/section_nodes/_section_node.html.erb +10 -0
  178. data/app/views/cms/section_nodes/index.html.erb +31 -0
  179. data/app/views/cms/sections/_form.html.erb +59 -0
  180. data/app/views/cms/sections/_page.html.erb +4 -0
  181. data/app/views/cms/sections/_section.html.erb +8 -0
  182. data/app/views/cms/sections/destroy.js.rjs +2 -0
  183. data/app/views/cms/sections/edit.html.erb +10 -0
  184. data/app/views/cms/sections/file_browser.xml.builder +14 -0
  185. data/app/views/cms/sections/index.html.erb +23 -0
  186. data/app/views/cms/sections/new.html.erb +21 -0
  187. data/app/views/cms/sessions/new.html.erb +32 -0
  188. data/app/views/cms/shared/_admin_sidebar.html.erb +30 -0
  189. data/app/views/cms/shared/_exception.html.erb +6 -0
  190. data/app/views/cms/shared/_pagination.html.erb +31 -0
  191. data/app/views/cms/shared/_version_conflict_diff.html.erb +11 -0
  192. data/app/views/cms/shared/_version_conflict_error.html.erb +8 -0
  193. data/app/views/cms/shared/access_denied.html.erb +3 -0
  194. data/app/views/cms/shared/error.html.erb +40 -0
  195. data/app/views/cms/tags/_form.html.erb +1 -0
  196. data/app/views/cms/tags/render.html.erb +53 -0
  197. data/app/views/cms/tasks/new.html.erb +36 -0
  198. data/app/views/cms/toolbar/index.html.erb +1 -0
  199. data/app/views/cms/users/_form.html.erb +12 -0
  200. data/app/views/cms/users/_groups.html.erb +12 -0
  201. data/app/views/cms/users/_password.html.erb +8 -0
  202. data/app/views/cms/users/_toolbar.html.erb +22 -0
  203. data/app/views/cms/users/_user_fields.html.erb +20 -0
  204. data/app/views/cms/users/change_password.html.erb +21 -0
  205. data/app/views/cms/users/edit.html.erb +16 -0
  206. data/app/views/cms/users/index.html.erb +62 -0
  207. data/app/views/cms/users/new.html.erb +13 -0
  208. data/app/views/cms/users/show.html.erb +50 -0
  209. data/app/views/layouts/_cms_toolbar.html.erb +59 -0
  210. data/app/views/layouts/_page_toolbar.html.erb +118 -0
  211. data/app/views/layouts/application.html.erb +11 -0
  212. data/app/views/layouts/cms/_footer.erb +4 -0
  213. data/app/views/layouts/cms/_head.html.erb +22 -0
  214. data/app/views/layouts/cms/administration.html.erb +51 -0
  215. data/app/views/layouts/cms/application.html.erb +25 -0
  216. data/app/views/layouts/cms/content_library.html.erb +94 -0
  217. data/app/views/layouts/cms/dashboard.html.erb +16 -0
  218. data/app/views/layouts/cms/login.html.erb +30 -0
  219. data/app/views/layouts/cms/section_nodes.html.erb +20 -0
  220. data/app/views/layouts/cms/thickbox.html.erb +24 -0
  221. data/app/views/layouts/cms/toolbar.html.erb +23 -0
  222. data/app/views/portlets/dynamic/_form.html.erb +3 -0
  223. data/app/views/portlets/email_page/_form.html.erb +7 -0
  224. data/app/views/portlets/email_page/render.html.erb +17 -0
  225. data/app/views/portlets/forgot_password/_form.html.erb +7 -0
  226. data/app/views/portlets/forgot_password/render.html.erb +14 -0
  227. data/app/views/portlets/login/_form.html.erb +7 -0
  228. data/app/views/portlets/login/render.html.erb +27 -0
  229. data/app/views/portlets/portlets/_form.html.erb +19 -0
  230. data/app/views/portlets/reset_password/_form.html.erb +5 -0
  231. data/app/views/portlets/reset_password/render.html.erb +24 -0
  232. data/app/views/portlets/tag_cloud/_form.html.erb +4 -0
  233. data/app/views/portlets/tag_cloud/render.html.erb +5 -0
  234. data/app/views/tests/pretend/open_with_layout.html.erb +5 -0
  235. data/bin/bcmsi +6 -0
  236. data/bin/browsercmsi +76 -0
  237. data/browsercmsi.gemspec +1526 -0
  238. data/config/locales/bcms/en/behaviors.yml +22 -0
  239. data/config/locales/bcms/en/bootstrap.yml +30 -0
  240. data/config/locales/bcms/en/controllers.yml +76 -0
  241. data/config/locales/bcms/en/helpers.yml +13 -0
  242. data/config/locales/bcms/en/js.yml +7 -0
  243. data/config/locales/bcms/en/models.yml +146 -0
  244. data/config/locales/bcms/en/portlets.yml +10 -0
  245. data/config/locales/bcms/en/views/cms/blocks.yml +68 -0
  246. data/config/locales/bcms/en/views/cms/cache.yml +7 -0
  247. data/config/locales/bcms/en/views/cms/categories.yml +10 -0
  248. data/config/locales/bcms/en/views/cms/connectors.yml +10 -0
  249. data/config/locales/bcms/en/views/cms/content.yml +5 -0
  250. data/config/locales/bcms/en/views/cms/content_types.yml +4 -0
  251. data/config/locales/bcms/en/views/cms/dashboard.yml +18 -0
  252. data/config/locales/bcms/en/views/cms/dynamic_views.yml +18 -0
  253. data/config/locales/bcms/en/views/cms/email_messages.yml +18 -0
  254. data/config/locales/bcms/en/views/cms/forgot_password_mailer.yml +10 -0
  255. data/config/locales/bcms/en/views/cms/form_builder.yml +6 -0
  256. data/config/locales/bcms/en/views/cms/groups.yml +34 -0
  257. data/config/locales/bcms/en/views/cms/links.yml +14 -0
  258. data/config/locales/bcms/en/views/cms/page_routes.yml +28 -0
  259. data/config/locales/bcms/en/views/cms/pages.yml +39 -0
  260. data/config/locales/bcms/en/views/cms/redirects.yml +19 -0
  261. data/config/locales/bcms/en/views/cms/routes.yml +10 -0
  262. data/config/locales/bcms/en/views/cms/section_nodes.yml +15 -0
  263. data/config/locales/bcms/en/views/cms/sections.yml +23 -0
  264. data/config/locales/bcms/en/views/cms/sessions.yml +7 -0
  265. data/config/locales/bcms/en/views/cms/shared.yml +39 -0
  266. data/config/locales/bcms/en/views/cms/tags.yml +5 -0
  267. data/config/locales/bcms/en/views/cms/tasks.yml +8 -0
  268. data/config/locales/bcms/en/views/cms/users.yml +48 -0
  269. data/config/locales/bcms/en/views/layouts/cms/content_library.yml +8 -0
  270. data/config/locales/bcms/en/views/layouts/cms/footer.yml +5 -0
  271. data/config/locales/bcms/en/views/layouts/cms_toolbar.yml +4 -0
  272. data/config/locales/bcms/en/views/layouts/page_toolbar.yml +23 -0
  273. data/config/locales/bcms/en/views/portlets.yml +57 -0
  274. data/config/locales/bcms/es/behaviors.yml +22 -0
  275. data/config/locales/bcms/es/bootstrap.yml +29 -0
  276. data/config/locales/bcms/es/controllers.yml +77 -0
  277. data/config/locales/bcms/es/helpers.yml +12 -0
  278. data/config/locales/bcms/es/js.yml +7 -0
  279. data/config/locales/bcms/es/models.yml +146 -0
  280. data/config/locales/bcms/es/portlets.yml +10 -0
  281. data/config/locales/bcms/es/views/cms/blocks.yml +68 -0
  282. data/config/locales/bcms/es/views/cms/cache.yml +9 -0
  283. data/config/locales/bcms/es/views/cms/categories.yml +11 -0
  284. data/config/locales/bcms/es/views/cms/connectors.yml +10 -0
  285. data/config/locales/bcms/es/views/cms/content.yml +5 -0
  286. data/config/locales/bcms/es/views/cms/content_types.yml +6 -0
  287. data/config/locales/bcms/es/views/cms/dashboard.yml +18 -0
  288. data/config/locales/bcms/es/views/cms/dynamic_views.yml +19 -0
  289. data/config/locales/bcms/es/views/cms/email_messages.yml +18 -0
  290. data/config/locales/bcms/es/views/cms/forgot_password_mailer.yml +11 -0
  291. data/config/locales/bcms/es/views/cms/form_builder.yml +6 -0
  292. data/config/locales/bcms/es/views/cms/groups.yml +36 -0
  293. data/config/locales/bcms/es/views/cms/links.yml +14 -0
  294. data/config/locales/bcms/es/views/cms/page_routes.yml +30 -0
  295. data/config/locales/bcms/es/views/cms/pages.yml +39 -0
  296. data/config/locales/bcms/es/views/cms/redirects.yml +19 -0
  297. data/config/locales/bcms/es/views/cms/routes.yml +9 -0
  298. data/config/locales/bcms/es/views/cms/section_nodes.yml +15 -0
  299. data/config/locales/bcms/es/views/cms/sections.yml +25 -0
  300. data/config/locales/bcms/es/views/cms/sessions.yml +7 -0
  301. data/config/locales/bcms/es/views/cms/shared.yml +41 -0
  302. data/config/locales/bcms/es/views/cms/tags.yml +7 -0
  303. data/config/locales/bcms/es/views/cms/tasks.yml +8 -0
  304. data/config/locales/bcms/es/views/cms/users.yml +47 -0
  305. data/config/locales/bcms/es/views/layouts/cms/content_library.yml +8 -0
  306. data/config/locales/bcms/es/views/layouts/cms/footer.yml +5 -0
  307. data/config/locales/bcms/es/views/layouts/cms_toolbar.yml +4 -0
  308. data/config/locales/bcms/es/views/layouts/page_toolbar.yml +23 -0
  309. data/config/locales/bcms/es/views/portlets.yml +57 -0
  310. data/db/demo/data.rb +97 -0
  311. data/db/demo/page_partials/_footer.html.erb +6 -0
  312. data/db/demo/page_partials/_header.html.erb +24 -0
  313. data/db/demo/page_templates/home_page.html.erb +49 -0
  314. data/db/demo/page_templates/sub_page.html.erb +37 -0
  315. data/db/migrate/20080815014337_browsercms_3_0_0.rb +274 -0
  316. data/db/migrate/20081114172307_load_seed_data.rb +63 -0
  317. data/db/migrate/20091109175123_browsercms_3_0_5.rb +9 -0
  318. data/doc/app/classes/AbstractFileBlock.html +172 -0
  319. data/doc/app/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html +293 -0
  320. data/doc/app/classes/ActiveRecord.html +105 -0
  321. data/doc/app/classes/ActiveSupport/Cache/FileStore.html +146 -0
  322. data/doc/app/classes/ActiveSupport/Cache.html +111 -0
  323. data/doc/app/classes/ActiveSupport.html +111 -0
  324. data/doc/app/classes/ActsAsList/ClassMethods.html +202 -0
  325. data/doc/app/classes/ActsAsList/InstanceMethods.html +534 -0
  326. data/doc/app/classes/ActsAsList.html +147 -0
  327. data/doc/app/classes/ApplicationController.html +119 -0
  328. data/doc/app/classes/ApplicationHelper.html +116 -0
  329. data/doc/app/classes/Attachment.html +726 -0
  330. data/doc/app/classes/Category.html +230 -0
  331. data/doc/app/classes/CategoryType.html +214 -0
  332. data/doc/app/classes/Cms/Acts/ContentBlock/MacroMethods/InstanceMethods.html +140 -0
  333. data/doc/app/classes/Cms/Acts/ContentBlock/MacroMethods.html +165 -0
  334. data/doc/app/classes/Cms/Acts/ContentBlock.html +146 -0
  335. data/doc/app/classes/Cms/Acts/ContentPage/ClassMethods.html +188 -0
  336. data/doc/app/classes/Cms/Acts/ContentPage.html +187 -0
  337. data/doc/app/classes/Cms/Acts.html +116 -0
  338. data/doc/app/classes/Cms/ApplicationController.html +369 -0
  339. data/doc/app/classes/Cms/ApplicationHelper.html +698 -0
  340. data/doc/app/classes/Cms/AttachmentsController.html +154 -0
  341. data/doc/app/classes/Cms/Authentication/Controller.html +700 -0
  342. data/doc/app/classes/Cms/Authentication/Model/ClassMethods.html +246 -0
  343. data/doc/app/classes/Cms/Authentication/Model/InstanceMethods.html +412 -0
  344. data/doc/app/classes/Cms/Authentication/Model.html +165 -0
  345. data/doc/app/classes/Cms/Authentication.html +116 -0
  346. data/doc/app/classes/Cms/BaseController.html +113 -0
  347. data/doc/app/classes/Cms/Behaviors/Archiving/InstanceMethods.html +220 -0
  348. data/doc/app/classes/Cms/Behaviors/Archiving/MacroMethods.html +175 -0
  349. data/doc/app/classes/Cms/Behaviors/Archiving.html +147 -0
  350. data/doc/app/classes/Cms/Behaviors/Attaching/InstanceMethods.html +670 -0
  351. data/doc/app/classes/Cms/Behaviors/Attaching/MacroMethods.html +188 -0
  352. data/doc/app/classes/Cms/Behaviors/Attaching.html +160 -0
  353. data/doc/app/classes/Cms/Behaviors/Categorizing/ClassMethods.html +105 -0
  354. data/doc/app/classes/Cms/Behaviors/Categorizing/InstanceMethods.html +140 -0
  355. data/doc/app/classes/Cms/Behaviors/Categorizing/MacroMethods.html +178 -0
  356. data/doc/app/classes/Cms/Behaviors/Categorizing.html +148 -0
  357. data/doc/app/classes/Cms/Behaviors/ClassMethods.html +272 -0
  358. data/doc/app/classes/Cms/Behaviors/Connecting/ClassMethods.html +188 -0
  359. data/doc/app/classes/Cms/Behaviors/Connecting/InstanceMethods.html +312 -0
  360. data/doc/app/classes/Cms/Behaviors/Connecting/MacroMethods.html +184 -0
  361. data/doc/app/classes/Cms/Behaviors/Connecting.html +148 -0
  362. data/doc/app/classes/Cms/Behaviors/DynamicAttributes/InstanceMethods.html +181 -0
  363. data/doc/app/classes/Cms/Behaviors/DynamicAttributes/MacroMethods.html +243 -0
  364. data/doc/app/classes/Cms/Behaviors/DynamicAttributes.html +285 -0
  365. data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange/InstanceMethods.html +142 -0
  366. data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange/MacroMethods.html +175 -0
  367. data/doc/app/classes/Cms/Behaviors/FlushCacheOnChange.html +178 -0
  368. data/doc/app/classes/Cms/Behaviors/Hiding/ClassMethods.html +105 -0
  369. data/doc/app/classes/Cms/Behaviors/Hiding/InstanceMethods.html +220 -0
  370. data/doc/app/classes/Cms/Behaviors/Hiding/MacroMethods.html +176 -0
  371. data/doc/app/classes/Cms/Behaviors/Hiding.html +148 -0
  372. data/doc/app/classes/Cms/Behaviors/InstanceMethods.html +287 -0
  373. data/doc/app/classes/Cms/Behaviors/Pagination/ClassMethods.html +252 -0
  374. data/doc/app/classes/Cms/Behaviors/Pagination/Collection.html +437 -0
  375. data/doc/app/classes/Cms/Behaviors/Pagination/InvalidPage.html +146 -0
  376. data/doc/app/classes/Cms/Behaviors/Pagination.html +151 -0
  377. data/doc/app/classes/Cms/Behaviors/Publishing/ClassMethods.html +105 -0
  378. data/doc/app/classes/Cms/Behaviors/Publishing/InstanceMethods.html +333 -0
  379. data/doc/app/classes/Cms/Behaviors/Publishing/MacroMethods.html +191 -0
  380. data/doc/app/classes/Cms/Behaviors/Publishing.html +179 -0
  381. data/doc/app/classes/Cms/Behaviors/Rendering/MacroMethods.html +186 -0
  382. data/doc/app/classes/Cms/Behaviors/Rendering.html +176 -0
  383. data/doc/app/classes/Cms/Behaviors/Searching/ClassMethods.html +164 -0
  384. data/doc/app/classes/Cms/Behaviors/Searching/MacroMethods.html +188 -0
  385. data/doc/app/classes/Cms/Behaviors/Searching.html +147 -0
  386. data/doc/app/classes/Cms/Behaviors/SoftDeleting/ClassMethods.html +217 -0
  387. data/doc/app/classes/Cms/Behaviors/SoftDeleting/InstanceMethods.html +247 -0
  388. data/doc/app/classes/Cms/Behaviors/SoftDeleting/MacroMethods.html +205 -0
  389. data/doc/app/classes/Cms/Behaviors/SoftDeleting.html +148 -0
  390. data/doc/app/classes/Cms/Behaviors/Taggable/ClassMethods.html +164 -0
  391. data/doc/app/classes/Cms/Behaviors/Taggable/InstanceMethods.html +198 -0
  392. data/doc/app/classes/Cms/Behaviors/Taggable/MacroMethods.html +182 -0
  393. data/doc/app/classes/Cms/Behaviors/Taggable.html +148 -0
  394. data/doc/app/classes/Cms/Behaviors/Userstamping/ClassMethods.html +105 -0
  395. data/doc/app/classes/Cms/Behaviors/Userstamping/InstanceMethods.html +143 -0
  396. data/doc/app/classes/Cms/Behaviors/Userstamping/MacroMethods.html +181 -0
  397. data/doc/app/classes/Cms/Behaviors/Userstamping.html +148 -0
  398. data/doc/app/classes/Cms/Behaviors/Versioning/ClassMethods.html +237 -0
  399. data/doc/app/classes/Cms/Behaviors/Versioning/InstanceMethods.html +713 -0
  400. data/doc/app/classes/Cms/Behaviors/Versioning/MacroMethods.html +290 -0
  401. data/doc/app/classes/Cms/Behaviors/Versioning.html +148 -0
  402. data/doc/app/classes/Cms/Behaviors.html +235 -0
  403. data/doc/app/classes/Cms/CacheController.html +174 -0
  404. data/doc/app/classes/Cms/Caching.html +171 -0
  405. data/doc/app/classes/Cms/CategoriesController.html +148 -0
  406. data/doc/app/classes/Cms/CategoryTypesController.html +148 -0
  407. data/doc/app/classes/Cms/ConnectorsController.html +215 -0
  408. data/doc/app/classes/Cms/ContentBlockController.html +1221 -0
  409. data/doc/app/classes/Cms/ContentController.html +240 -0
  410. data/doc/app/classes/Cms/ContentRenderingSupport.html +222 -0
  411. data/doc/app/classes/Cms/ContentTypesController.html +148 -0
  412. data/doc/app/classes/Cms/DashboardController.html +152 -0
  413. data/doc/app/classes/Cms/DataLoader.html +182 -0
  414. data/doc/app/classes/Cms/DomainSupport.html +166 -0
  415. data/doc/app/classes/Cms/DynamicViewsController.html +359 -0
  416. data/doc/app/classes/Cms/EmailMessagesController.html +172 -0
  417. data/doc/app/classes/Cms/ErrorHandling.html +199 -0
  418. data/doc/app/classes/Cms/Errors/AccessDenied.html +146 -0
  419. data/doc/app/classes/Cms/Errors.html +111 -0
  420. data/doc/app/classes/Cms/Extensions/ActionView/Base.html +141 -0
  421. data/doc/app/classes/Cms/Extensions/ActionView.html +111 -0
  422. data/doc/app/classes/Cms/Extensions/ActiveRecord/Base.html +144 -0
  423. data/doc/app/classes/Cms/Extensions/ActiveRecord/Errors.html +140 -0
  424. data/doc/app/classes/Cms/Extensions/ActiveRecord.html +116 -0
  425. data/doc/app/classes/Cms/Extensions/Hash.html +175 -0
  426. data/doc/app/classes/Cms/Extensions/Integer.html +146 -0
  427. data/doc/app/classes/Cms/Extensions/NilClass.html +212 -0
  428. data/doc/app/classes/Cms/Extensions/String.html +212 -0
  429. data/doc/app/classes/Cms/Extensions.html +140 -0
  430. data/doc/app/classes/Cms/FileBlocksController.html +113 -0
  431. data/doc/app/classes/Cms/FormBuilder.html +480 -0
  432. data/doc/app/classes/Cms/FormTagHelper.html +245 -0
  433. data/doc/app/classes/Cms/GroupsController.html +225 -0
  434. data/doc/app/classes/Cms/HomeController.html +148 -0
  435. data/doc/app/classes/Cms/HtmlBlocksController.html +113 -0
  436. data/doc/app/classes/Cms/ImageBlocksController.html +113 -0
  437. data/doc/app/classes/Cms/LinksController.html +343 -0
  438. data/doc/app/classes/Cms/MenuHelper.html +375 -0
  439. data/doc/app/classes/Cms/PageHelper.html +379 -0
  440. data/doc/app/classes/Cms/PageRouteConditionsController.html +113 -0
  441. data/doc/app/classes/Cms/PageRouteOptionsController.html +355 -0
  442. data/doc/app/classes/Cms/PageRouteRequirementsController.html +113 -0
  443. data/doc/app/classes/Cms/PageRoutesController.html +284 -0
  444. data/doc/app/classes/Cms/PagesController.html +333 -0
  445. data/doc/app/classes/Cms/PathHelper.html +268 -0
  446. data/doc/app/classes/Cms/PortletController.html +150 -0
  447. data/doc/app/classes/Cms/PortletsController.html +301 -0
  448. data/doc/app/classes/Cms/RedirectsController.html +172 -0
  449. data/doc/app/classes/Cms/RenderingHelper.html +214 -0
  450. data/doc/app/classes/Cms/ResourceController.html +616 -0
  451. data/doc/app/classes/Cms/Routes.html +311 -0
  452. data/doc/app/classes/Cms/RoutesController.html +164 -0
  453. data/doc/app/classes/Cms/SectionNodesController.html +272 -0
  454. data/doc/app/classes/Cms/SectionNodesHelper.html +145 -0
  455. data/doc/app/classes/Cms/SectionsController.html +566 -0
  456. data/doc/app/classes/Cms/SessionsController.html +299 -0
  457. data/doc/app/classes/Cms/TagsController.html +176 -0
  458. data/doc/app/classes/Cms/TasksController.html +221 -0
  459. data/doc/app/classes/Cms/TemplateSupport.html +185 -0
  460. data/doc/app/classes/Cms/ToolbarController.html +153 -0
  461. data/doc/app/classes/Cms/UsersController.html +381 -0
  462. data/doc/app/classes/Cms.html +771 -0
  463. data/doc/app/classes/CommandLine.html +226 -0
  464. data/doc/app/classes/Connector.html +354 -0
  465. data/doc/app/classes/ContentType.html +448 -0
  466. data/doc/app/classes/ContentTypeGroup.html +111 -0
  467. data/doc/app/classes/DynamicPortlet.html +148 -0
  468. data/doc/app/classes/DynamicView.html +408 -0
  469. data/doc/app/classes/EmailMessage.html +228 -0
  470. data/doc/app/classes/EmailMessageMailer.html +150 -0
  471. data/doc/app/classes/EmailPagePortlet.html +184 -0
  472. data/doc/app/classes/FileBlock.html +202 -0
  473. data/doc/app/classes/ForgotPasswordMailer.html +151 -0
  474. data/doc/app/classes/ForgotPasswordPortlet.html +162 -0
  475. data/doc/app/classes/Group.html +222 -0
  476. data/doc/app/classes/GroupPermission.html +111 -0
  477. data/doc/app/classes/GroupSection.html +111 -0
  478. data/doc/app/classes/GroupType.html +111 -0
  479. data/doc/app/classes/GroupTypePermission.html +111 -0
  480. data/doc/app/classes/GuestUser.html +392 -0
  481. data/doc/app/classes/HtmlBlock.html +170 -0
  482. data/doc/app/classes/ImageBlock.html +202 -0
  483. data/doc/app/classes/InitialData.html +171 -0
  484. data/doc/app/classes/Link.html +249 -0
  485. data/doc/app/classes/LoginPortlet.html +151 -0
  486. data/doc/app/classes/Page.html +954 -0
  487. data/doc/app/classes/PagePartial.html +201 -0
  488. data/doc/app/classes/PageRoute.html +335 -0
  489. data/doc/app/classes/PageRouteCondition.html +113 -0
  490. data/doc/app/classes/PageRouteOption.html +111 -0
  491. data/doc/app/classes/PageRouteRequirement.html +113 -0
  492. data/doc/app/classes/PageTemplate.html +260 -0
  493. data/doc/app/classes/Permission.html +111 -0
  494. data/doc/app/classes/Portlet.html +810 -0
  495. data/doc/app/classes/Redirect.html +111 -0
  496. data/doc/app/classes/ResetPasswordPortlet.html +169 -0
  497. data/doc/app/classes/Section.html +637 -0
  498. data/doc/app/classes/SectionNode.html +410 -0
  499. data/doc/app/classes/Sequence.html +146 -0
  500. data/doc/app/classes/Site.html +253 -0
  501. data/doc/app/classes/Tag.html +292 -0
  502. data/doc/app/classes/TagCloudPortlet.html +176 -0
  503. data/doc/app/classes/Tagging.html +146 -0
  504. data/doc/app/classes/Task.html +288 -0
  505. data/doc/app/classes/Templates.html +151 -0
  506. data/doc/app/classes/Tests/PretendController.html +275 -0
  507. data/doc/app/classes/Tests.html +107 -0
  508. data/doc/app/classes/User.html +757 -0
  509. data/doc/app/classes/UserGroupMembership.html +111 -0
  510. data/doc/app/created.rid +1 -0
  511. data/doc/app/files/app/controllers/application_controller_rb.html +109 -0
  512. data/doc/app/files/app/controllers/cms/application_controller_rb.html +101 -0
  513. data/doc/app/files/app/controllers/cms/attachments_controller_rb.html +101 -0
  514. data/doc/app/files/app/controllers/cms/base_controller_rb.html +101 -0
  515. data/doc/app/files/app/controllers/cms/cache_controller_rb.html +101 -0
  516. data/doc/app/files/app/controllers/cms/categories_controller_rb.html +101 -0
  517. data/doc/app/files/app/controllers/cms/category_types_controller_rb.html +101 -0
  518. data/doc/app/files/app/controllers/cms/connectors_controller_rb.html +101 -0
  519. data/doc/app/files/app/controllers/cms/content_block_controller_rb.html +107 -0
  520. data/doc/app/files/app/controllers/cms/content_controller_rb.html +101 -0
  521. data/doc/app/files/app/controllers/cms/content_types_controller_rb.html +101 -0
  522. data/doc/app/files/app/controllers/cms/dashboard_controller_rb.html +101 -0
  523. data/doc/app/files/app/controllers/cms/dynamic_views_controller_rb.html +101 -0
  524. data/doc/app/files/app/controllers/cms/email_messages_controller_rb.html +101 -0
  525. data/doc/app/files/app/controllers/cms/error_handling_rb.html +101 -0
  526. data/doc/app/files/app/controllers/cms/file_blocks_controller_rb.html +101 -0
  527. data/doc/app/files/app/controllers/cms/groups_controller_rb.html +101 -0
  528. data/doc/app/files/app/controllers/cms/home_controller_rb.html +101 -0
  529. data/doc/app/files/app/controllers/cms/html_blocks_controller_rb.html +101 -0
  530. data/doc/app/files/app/controllers/cms/image_blocks_controller_rb.html +101 -0
  531. data/doc/app/files/app/controllers/cms/links_controller_rb.html +101 -0
  532. data/doc/app/files/app/controllers/cms/page_route_conditions_controller_rb.html +101 -0
  533. data/doc/app/files/app/controllers/cms/page_route_options_controller_rb.html +101 -0
  534. data/doc/app/files/app/controllers/cms/page_route_requirements_controller_rb.html +101 -0
  535. data/doc/app/files/app/controllers/cms/page_routes_controller_rb.html +101 -0
  536. data/doc/app/files/app/controllers/cms/pages_controller_rb.html +101 -0
  537. data/doc/app/files/app/controllers/cms/portlet_controller_rb.html +101 -0
  538. data/doc/app/files/app/controllers/cms/portlets_controller_rb.html +101 -0
  539. data/doc/app/files/app/controllers/cms/redirects_controller_rb.html +101 -0
  540. data/doc/app/files/app/controllers/cms/resource_controller_rb.html +108 -0
  541. data/doc/app/files/app/controllers/cms/routes_controller_rb.html +101 -0
  542. data/doc/app/files/app/controllers/cms/section_nodes_controller_rb.html +101 -0
  543. data/doc/app/files/app/controllers/cms/sections_controller_rb.html +101 -0
  544. data/doc/app/files/app/controllers/cms/sessions_controller_rb.html +107 -0
  545. data/doc/app/files/app/controllers/cms/tags_controller_rb.html +101 -0
  546. data/doc/app/files/app/controllers/cms/tasks_controller_rb.html +101 -0
  547. data/doc/app/files/app/controllers/cms/toolbar_controller_rb.html +101 -0
  548. data/doc/app/files/app/controllers/cms/users_controller_rb.html +101 -0
  549. data/doc/app/files/app/controllers/tests/pretend_controller_rb.html +112 -0
  550. data/doc/app/files/app/helpers/application_helper_rb.html +112 -0
  551. data/doc/app/files/app/helpers/cms/application_helper_rb.html +107 -0
  552. data/doc/app/files/app/helpers/cms/form_builder_rb.html +108 -0
  553. data/doc/app/files/app/helpers/cms/form_tag_helper_rb.html +101 -0
  554. data/doc/app/files/app/helpers/cms/menu_helper_rb.html +101 -0
  555. data/doc/app/files/app/helpers/cms/page_helper_rb.html +101 -0
  556. data/doc/app/files/app/helpers/cms/path_helper_rb.html +101 -0
  557. data/doc/app/files/app/helpers/cms/rendering_helper_rb.html +111 -0
  558. data/doc/app/files/app/helpers/cms/section_nodes_helper_rb.html +101 -0
  559. data/doc/app/files/app/helpers/cms/template_support_rb.html +108 -0
  560. data/doc/app/files/app/models/abstract_file_block_rb.html +101 -0
  561. data/doc/app/files/app/models/attachment_rb.html +109 -0
  562. data/doc/app/files/app/models/category_rb.html +101 -0
  563. data/doc/app/files/app/models/category_type_rb.html +101 -0
  564. data/doc/app/files/app/models/connector_rb.html +101 -0
  565. data/doc/app/files/app/models/content_type_group_rb.html +101 -0
  566. data/doc/app/files/app/models/content_type_rb.html +101 -0
  567. data/doc/app/files/app/models/dynamic_view_rb.html +101 -0
  568. data/doc/app/files/app/models/email_message_mailer_rb.html +101 -0
  569. data/doc/app/files/app/models/email_message_rb.html +101 -0
  570. data/doc/app/files/app/models/file_block_rb.html +101 -0
  571. data/doc/app/files/app/models/forgot_password_mailer_rb.html +101 -0
  572. data/doc/app/files/app/models/group_permission_rb.html +101 -0
  573. data/doc/app/files/app/models/group_rb.html +110 -0
  574. data/doc/app/files/app/models/group_section_rb.html +101 -0
  575. data/doc/app/files/app/models/group_type_permission_rb.html +101 -0
  576. data/doc/app/files/app/models/group_type_rb.html +101 -0
  577. data/doc/app/files/app/models/guest_user_rb.html +114 -0
  578. data/doc/app/files/app/models/html_block_rb.html +101 -0
  579. data/doc/app/files/app/models/image_block_rb.html +101 -0
  580. data/doc/app/files/app/models/link_rb.html +101 -0
  581. data/doc/app/files/app/models/page_partial_rb.html +101 -0
  582. data/doc/app/files/app/models/page_rb.html +101 -0
  583. data/doc/app/files/app/models/page_route_condition_rb.html +101 -0
  584. data/doc/app/files/app/models/page_route_option_rb.html +101 -0
  585. data/doc/app/files/app/models/page_route_rb.html +101 -0
  586. data/doc/app/files/app/models/page_route_requirement_rb.html +101 -0
  587. data/doc/app/files/app/models/page_template_rb.html +101 -0
  588. data/doc/app/files/app/models/permission_rb.html +101 -0
  589. data/doc/app/files/app/models/portlet_rb.html +101 -0
  590. data/doc/app/files/app/models/redirect_rb.html +101 -0
  591. data/doc/app/files/app/models/section_node_rb.html +101 -0
  592. data/doc/app/files/app/models/section_rb.html +101 -0
  593. data/doc/app/files/app/models/site_rb.html +101 -0
  594. data/doc/app/files/app/models/tag_rb.html +101 -0
  595. data/doc/app/files/app/models/tagging_rb.html +101 -0
  596. data/doc/app/files/app/models/task_rb.html +101 -0
  597. data/doc/app/files/app/models/templates_rb.html +108 -0
  598. data/doc/app/files/app/models/user_group_membership_rb.html +101 -0
  599. data/doc/app/files/app/models/user_rb.html +108 -0
  600. data/doc/app/files/app/portlets/dynamic_portlet_rb.html +101 -0
  601. data/doc/app/files/app/portlets/email_page_portlet_rb.html +101 -0
  602. data/doc/app/files/app/portlets/forgot_password_portlet_rb.html +108 -0
  603. data/doc/app/files/app/portlets/login_portlet_rb.html +101 -0
  604. data/doc/app/files/app/portlets/reset_password_portlet_rb.html +101 -0
  605. data/doc/app/files/app/portlets/tag_cloud_portlet_rb.html +101 -0
  606. data/doc/app/files/doc/README_FOR_APP.html +128 -0
  607. data/doc/app/files/lib/acts_as_list_rb.html +101 -0
  608. data/doc/app/files/lib/browsercms_rb.html +113 -0
  609. data/doc/app/files/lib/cms/acts/content_block_rb.html +101 -0
  610. data/doc/app/files/lib/cms/acts/content_page_rb.html +125 -0
  611. data/doc/app/files/lib/cms/authentication/controller_rb.html +161 -0
  612. data/doc/app/files/lib/cms/authentication/model_rb.html +101 -0
  613. data/doc/app/files/lib/cms/behaviors/archiving_rb.html +101 -0
  614. data/doc/app/files/lib/cms/behaviors/attaching_rb.html +101 -0
  615. data/doc/app/files/lib/cms/behaviors/categorizing_rb.html +101 -0
  616. data/doc/app/files/lib/cms/behaviors/connecting_rb.html +101 -0
  617. data/doc/app/files/lib/cms/behaviors/dynamic_attributes_rb.html +101 -0
  618. data/doc/app/files/lib/cms/behaviors/flush_cache_on_change_rb.html +101 -0
  619. data/doc/app/files/lib/cms/behaviors/hiding_rb.html +101 -0
  620. data/doc/app/files/lib/cms/behaviors/pagination_rb.html +107 -0
  621. data/doc/app/files/lib/cms/behaviors/publishing_rb.html +101 -0
  622. data/doc/app/files/lib/cms/behaviors/rendering_rb.html +101 -0
  623. data/doc/app/files/lib/cms/behaviors/searching_rb.html +101 -0
  624. data/doc/app/files/lib/cms/behaviors/soft_deleting_rb.html +101 -0
  625. data/doc/app/files/lib/cms/behaviors/taggable_rb.html +101 -0
  626. data/doc/app/files/lib/cms/behaviors/userstamping_rb.html +101 -0
  627. data/doc/app/files/lib/cms/behaviors/versioning_rb.html +101 -0
  628. data/doc/app/files/lib/cms/behaviors_rb.html +147 -0
  629. data/doc/app/files/lib/cms/caching_rb.html +101 -0
  630. data/doc/app/files/lib/cms/content_rendering_support_rb.html +108 -0
  631. data/doc/app/files/lib/cms/data_loader_rb.html +101 -0
  632. data/doc/app/files/lib/cms/domain_support_rb.html +108 -0
  633. data/doc/app/files/lib/cms/extensions/action_view/base_rb.html +101 -0
  634. data/doc/app/files/lib/cms/extensions/active_record/base_rb.html +101 -0
  635. data/doc/app/files/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements_rb.html +101 -0
  636. data/doc/app/files/lib/cms/extensions/active_record/errors_rb.html +101 -0
  637. data/doc/app/files/lib/cms/extensions/active_support/cache/file_store_rb.html +101 -0
  638. data/doc/app/files/lib/cms/extensions/hash_rb.html +101 -0
  639. data/doc/app/files/lib/cms/extensions/integer_rb.html +101 -0
  640. data/doc/app/files/lib/cms/extensions/nil_rb.html +101 -0
  641. data/doc/app/files/lib/cms/extensions/string_rb.html +101 -0
  642. data/doc/app/files/lib/cms/extensions_rb.html +101 -0
  643. data/doc/app/files/lib/cms/init_rb.html +108 -0
  644. data/doc/app/files/lib/cms/routes_rb.html +101 -0
  645. data/doc/app/files/lib/cms/version_rb.html +107 -0
  646. data/doc/app/files/lib/command_line_rb.html +101 -0
  647. data/doc/app/files/lib/initial_data_rb.html +101 -0
  648. data/doc/app/files/lib/sequence_rb.html +101 -0
  649. data/doc/app/fr_class_index.html +218 -0
  650. data/doc/app/fr_file_index.html +164 -0
  651. data/doc/app/fr_method_index.html +787 -0
  652. data/doc/app/index.html +24 -0
  653. data/doc/app/rdoc-style.css +208 -0
  654. data/doc/guides/html/authentication.html +201 -0
  655. data/doc/guides/html/build_it_yourself.html +178 -0
  656. data/doc/guides/html/building_modules.html +249 -0
  657. data/doc/guides/html/building_templates.html +507 -0
  658. data/doc/guides/html/content_blocks.html +477 -0
  659. data/doc/guides/html/customizing_browsercms.html +173 -0
  660. data/doc/guides/html/deployment_guide.html +207 -0
  661. data/doc/guides/html/files/javascripts/code_highlighter.js +188 -0
  662. data/doc/guides/html/files/javascripts/guides.js +7 -0
  663. data/doc/guides/html/files/javascripts/highlighters.js +90 -0
  664. data/doc/guides/html/files/stylesheets/main.css +441 -0
  665. data/doc/guides/html/files/stylesheets/reset.css +43 -0
  666. data/doc/guides/html/files/stylesheets/style.css +13 -0
  667. data/doc/guides/html/files/stylesheets/syntax.css +31 -0
  668. data/doc/guides/html/getting_started.html +216 -0
  669. data/doc/guides/html/images/bg.png +0 -0
  670. data/doc/guides/html/images/bottom_cap.png +0 -0
  671. data/doc/guides/html/images/browsercms_logo.png +0 -0
  672. data/doc/guides/html/images/content_blocks/add_field_to_form.png +0 -0
  673. data/doc/guides/html/images/content_blocks/add_second_block.png +0 -0
  674. data/doc/guides/html/images/dot.png +0 -0
  675. data/doc/guides/html/images/icons/README +5 -0
  676. data/doc/guides/html/images/icons/callouts/1.png +0 -0
  677. data/doc/guides/html/images/icons/callouts/10.png +0 -0
  678. data/doc/guides/html/images/icons/callouts/11.png +0 -0
  679. data/doc/guides/html/images/icons/callouts/12.png +0 -0
  680. data/doc/guides/html/images/icons/callouts/13.png +0 -0
  681. data/doc/guides/html/images/icons/callouts/14.png +0 -0
  682. data/doc/guides/html/images/icons/callouts/15.png +0 -0
  683. data/doc/guides/html/images/icons/callouts/2.png +0 -0
  684. data/doc/guides/html/images/icons/callouts/3.png +0 -0
  685. data/doc/guides/html/images/icons/callouts/4.png +0 -0
  686. data/doc/guides/html/images/icons/callouts/5.png +0 -0
  687. data/doc/guides/html/images/icons/callouts/6.png +0 -0
  688. data/doc/guides/html/images/icons/callouts/7.png +0 -0
  689. data/doc/guides/html/images/icons/callouts/8.png +0 -0
  690. data/doc/guides/html/images/icons/callouts/9.png +0 -0
  691. data/doc/guides/html/images/icons/caution.png +0 -0
  692. data/doc/guides/html/images/icons/example.png +0 -0
  693. data/doc/guides/html/images/icons/home.png +0 -0
  694. data/doc/guides/html/images/icons/important.png +0 -0
  695. data/doc/guides/html/images/icons/next.png +0 -0
  696. data/doc/guides/html/images/icons/note.png +0 -0
  697. data/doc/guides/html/images/icons/prev.png +0 -0
  698. data/doc/guides/html/images/icons/tip.png +0 -0
  699. data/doc/guides/html/images/icons/up.png +0 -0
  700. data/doc/guides/html/images/icons/warning.png +0 -0
  701. data/doc/guides/html/images/nfl_sitemap.png +0 -0
  702. data/doc/guides/html/images/top_cap.png +0 -0
  703. data/doc/guides/html/images/top_cap_content.png +0 -0
  704. data/doc/guides/html/index.html +177 -0
  705. data/doc/guides/html/installing_modules.html +189 -0
  706. data/doc/guides/html/portlets.html +238 -0
  707. data/doc/guides/html/user_guide.html +275 -0
  708. data/doc/guides/html/writing_guides.html +164 -0
  709. data/lib/acts_as_list.rb +256 -0
  710. data/lib/browsercms.rb +12 -0
  711. data/lib/cms/acts/content_block.rb +31 -0
  712. data/lib/cms/acts/content_page.rb +69 -0
  713. data/lib/cms/authentication/controller.rb +214 -0
  714. data/lib/cms/authentication/model.rb +116 -0
  715. data/lib/cms/behaviors/archiving.rb +43 -0
  716. data/lib/cms/behaviors/attaching.rb +184 -0
  717. data/lib/cms/behaviors/categorizing.rb +31 -0
  718. data/lib/cms/behaviors/connecting.rb +99 -0
  719. data/lib/cms/behaviors/dynamic_attributes.rb +367 -0
  720. data/lib/cms/behaviors/flush_cache_on_change.rb +33 -0
  721. data/lib/cms/behaviors/hiding.rb +46 -0
  722. data/lib/cms/behaviors/pagination.rb +209 -0
  723. data/lib/cms/behaviors/publishing.rb +123 -0
  724. data/lib/cms/behaviors/rendering.rb +164 -0
  725. data/lib/cms/behaviors/searching.rb +49 -0
  726. data/lib/cms/behaviors/soft_deleting.rb +77 -0
  727. data/lib/cms/behaviors/taggable.rb +57 -0
  728. data/lib/cms/behaviors/userstamping.rb +37 -0
  729. data/lib/cms/behaviors/versioning.rb +273 -0
  730. data/lib/cms/behaviors.rb +33 -0
  731. data/lib/cms/caching.rb +20 -0
  732. data/lib/cms/content_rendering_support.rb +96 -0
  733. data/lib/cms/data_loader.rb +28 -0
  734. data/lib/cms/domain_support.rb +20 -0
  735. data/lib/cms/extensions/action_view/base.rb +13 -0
  736. data/lib/cms/extensions/active_record/base.rb +16 -0
  737. data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +88 -0
  738. data/lib/cms/extensions/active_record/errors.rb +12 -0
  739. data/lib/cms/extensions/active_support/cache/file_store.rb +9 -0
  740. data/lib/cms/extensions/hash.rb +21 -0
  741. data/lib/cms/extensions/integer.rb +16 -0
  742. data/lib/cms/extensions/nil.rb +19 -0
  743. data/lib/cms/extensions/string.rb +19 -0
  744. data/lib/cms/extensions.rb +4 -0
  745. data/lib/cms/init.rb +118 -0
  746. data/lib/cms/routes.rb +140 -0
  747. data/lib/cms/version.rb +6 -0
  748. data/lib/command_line.rb +39 -0
  749. data/lib/initial_data.rb +30 -0
  750. data/lib/sequence.rb +6 -0
  751. data/lib/tasks/cms.rake +41 -0
  752. data/lib/tasks/db.rake +71 -0
  753. data/lib/tasks/dev.rake +20 -0
  754. data/public/bcms/ckeditor/ckeditor.js +108 -0
  755. data/public/bcms/ckeditor/config.js +18 -0
  756. data/public/bcms/ckeditor/core/_bootstrap.js +64 -0
  757. data/public/bcms/ckeditor/core/ajax.js +143 -0
  758. data/public/bcms/ckeditor/core/ckeditor.js +96 -0
  759. data/public/bcms/ckeditor/core/ckeditor_base.js +190 -0
  760. data/public/bcms/ckeditor/core/ckeditor_basic.js +241 -0
  761. data/public/bcms/ckeditor/core/command.js +70 -0
  762. data/public/bcms/ckeditor/core/commanddefinition.js +72 -0
  763. data/public/bcms/ckeditor/core/config.js +287 -0
  764. data/public/bcms/ckeditor/core/dom/document.js +210 -0
  765. data/public/bcms/ckeditor/core/dom/documentfragment.js +49 -0
  766. data/public/bcms/ckeditor/core/dom/domobject.js +204 -0
  767. data/public/bcms/ckeditor/core/dom/element.js +1384 -0
  768. data/public/bcms/ckeditor/core/dom/elementpath.js +104 -0
  769. data/public/bcms/ckeditor/core/dom/event.js +137 -0
  770. data/public/bcms/ckeditor/core/dom/node.js +649 -0
  771. data/public/bcms/ckeditor/core/dom/nodelist.js +23 -0
  772. data/public/bcms/ckeditor/core/dom/range.js +1668 -0
  773. data/public/bcms/ckeditor/core/dom/text.js +123 -0
  774. data/public/bcms/ckeditor/core/dom/walker.js +411 -0
  775. data/public/bcms/ckeditor/core/dom/window.js +96 -0
  776. data/public/bcms/ckeditor/core/dom.js +21 -0
  777. data/public/bcms/ckeditor/core/dtd.js +200 -0
  778. data/public/bcms/ckeditor/core/editor.js +650 -0
  779. data/public/bcms/ckeditor/core/editor_basic.js +178 -0
  780. data/public/bcms/ckeditor/core/env.js +219 -0
  781. data/public/bcms/ckeditor/core/event.js +335 -0
  782. data/public/bcms/ckeditor/core/eventInfo.js +120 -0
  783. data/public/bcms/ckeditor/core/focusmanager.js +123 -0
  784. data/public/bcms/ckeditor/core/htmlparser/basicwriter.js +140 -0
  785. data/public/bcms/ckeditor/core/htmlparser/cdata.js +44 -0
  786. data/public/bcms/ckeditor/core/htmlparser/comment.js +59 -0
  787. data/public/bcms/ckeditor/core/htmlparser/element.js +196 -0
  788. data/public/bcms/ckeditor/core/htmlparser/filter.js +233 -0
  789. data/public/bcms/ckeditor/core/htmlparser/fragment.js +434 -0
  790. data/public/bcms/ckeditor/core/htmlparser/text.js +55 -0
  791. data/public/bcms/ckeditor/core/htmlparser.js +212 -0
  792. data/public/bcms/ckeditor/core/imagecacher.js +58 -0
  793. data/public/bcms/ckeditor/core/lang.js +147 -0
  794. data/public/bcms/ckeditor/core/loader.js +238 -0
  795. data/public/bcms/ckeditor/core/plugindefinition.js +66 -0
  796. data/public/bcms/ckeditor/core/plugins.js +82 -0
  797. data/public/bcms/ckeditor/core/resourcemanager.js +233 -0
  798. data/public/bcms/ckeditor/core/scriptloader.js +194 -0
  799. data/public/bcms/ckeditor/core/skins.js +185 -0
  800. data/public/bcms/ckeditor/core/test.js +184 -0
  801. data/public/bcms/ckeditor/core/themes.js +18 -0
  802. data/public/bcms/ckeditor/core/tools.js +531 -0
  803. data/public/bcms/ckeditor/core/ui.js +106 -0
  804. data/public/bcms/ckeditor/core/xml.js +165 -0
  805. data/public/bcms/ckeditor/editor.js +51 -0
  806. data/public/bcms/ckeditor/lang/_languages.js +82 -0
  807. data/public/bcms/ckeditor/lang/_translationstatus.txt +59 -0
  808. data/public/bcms/ckeditor/lang/af.js +674 -0
  809. data/public/bcms/ckeditor/lang/ar.js +674 -0
  810. data/public/bcms/ckeditor/lang/bg.js +674 -0
  811. data/public/bcms/ckeditor/lang/bn.js +674 -0
  812. data/public/bcms/ckeditor/lang/bs.js +674 -0
  813. data/public/bcms/ckeditor/lang/ca.js +674 -0
  814. data/public/bcms/ckeditor/lang/cs.js +674 -0
  815. data/public/bcms/ckeditor/lang/da.js +674 -0
  816. data/public/bcms/ckeditor/lang/de.js +674 -0
  817. data/public/bcms/ckeditor/lang/el.js +674 -0
  818. data/public/bcms/ckeditor/lang/en-au.js +674 -0
  819. data/public/bcms/ckeditor/lang/en-ca.js +674 -0
  820. data/public/bcms/ckeditor/lang/en-uk.js +674 -0
  821. data/public/bcms/ckeditor/lang/en.js +674 -0
  822. data/public/bcms/ckeditor/lang/eo.js +674 -0
  823. data/public/bcms/ckeditor/lang/es.js +674 -0
  824. data/public/bcms/ckeditor/lang/et.js +674 -0
  825. data/public/bcms/ckeditor/lang/eu.js +674 -0
  826. data/public/bcms/ckeditor/lang/fa.js +674 -0
  827. data/public/bcms/ckeditor/lang/fi.js +674 -0
  828. data/public/bcms/ckeditor/lang/fo.js +674 -0
  829. data/public/bcms/ckeditor/lang/fr-ca.js +674 -0
  830. data/public/bcms/ckeditor/lang/fr.js +674 -0
  831. data/public/bcms/ckeditor/lang/gl.js +674 -0
  832. data/public/bcms/ckeditor/lang/gu.js +674 -0
  833. data/public/bcms/ckeditor/lang/he.js +674 -0
  834. data/public/bcms/ckeditor/lang/hi.js +674 -0
  835. data/public/bcms/ckeditor/lang/hr.js +674 -0
  836. data/public/bcms/ckeditor/lang/hu.js +674 -0
  837. data/public/bcms/ckeditor/lang/is.js +674 -0
  838. data/public/bcms/ckeditor/lang/it.js +674 -0
  839. data/public/bcms/ckeditor/lang/ja.js +674 -0
  840. data/public/bcms/ckeditor/lang/km.js +674 -0
  841. data/public/bcms/ckeditor/lang/ko.js +674 -0
  842. data/public/bcms/ckeditor/lang/lt.js +674 -0
  843. data/public/bcms/ckeditor/lang/lv.js +674 -0
  844. data/public/bcms/ckeditor/lang/mn.js +674 -0
  845. data/public/bcms/ckeditor/lang/ms.js +674 -0
  846. data/public/bcms/ckeditor/lang/nb.js +674 -0
  847. data/public/bcms/ckeditor/lang/nl.js +674 -0
  848. data/public/bcms/ckeditor/lang/no.js +674 -0
  849. data/public/bcms/ckeditor/lang/pl.js +674 -0
  850. data/public/bcms/ckeditor/lang/pt-br.js +674 -0
  851. data/public/bcms/ckeditor/lang/pt.js +674 -0
  852. data/public/bcms/ckeditor/lang/ro.js +674 -0
  853. data/public/bcms/ckeditor/lang/ru.js +674 -0
  854. data/public/bcms/ckeditor/lang/sk.js +674 -0
  855. data/public/bcms/ckeditor/lang/sl.js +674 -0
  856. data/public/bcms/ckeditor/lang/sr-latn.js +674 -0
  857. data/public/bcms/ckeditor/lang/sr.js +674 -0
  858. data/public/bcms/ckeditor/lang/sv.js +674 -0
  859. data/public/bcms/ckeditor/lang/th.js +674 -0
  860. data/public/bcms/ckeditor/lang/tr.js +674 -0
  861. data/public/bcms/ckeditor/lang/uk.js +674 -0
  862. data/public/bcms/ckeditor/lang/vi.js +674 -0
  863. data/public/bcms/ckeditor/lang/zh-cn.js +674 -0
  864. data/public/bcms/ckeditor/lang/zh.js +674 -0
  865. data/public/bcms/ckeditor/plugins/about/dialogs/about.js +73 -0
  866. data/public/bcms/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  867. data/public/bcms/ckeditor/plugins/about/plugin.js +22 -0
  868. data/public/bcms/ckeditor/plugins/basicstyles/plugin.js +50 -0
  869. data/public/bcms/ckeditor/plugins/blockquote/plugin.js +301 -0
  870. data/public/bcms/ckeditor/plugins/button/plugin.js +264 -0
  871. data/public/bcms/ckeditor/plugins/clipboard/dialogs/paste.js +167 -0
  872. data/public/bcms/ckeditor/plugins/clipboard/plugin.js +208 -0
  873. data/public/bcms/ckeditor/plugins/colorbutton/plugin.js +202 -0
  874. data/public/bcms/ckeditor/plugins/contextmenu/plugin.js +178 -0
  875. data/public/bcms/ckeditor/plugins/dialog/dialogDefinition.js +315 -0
  876. data/public/bcms/ckeditor/plugins/dialog/plugin.js +2742 -0
  877. data/public/bcms/ckeditor/plugins/dialogui/plugin.js +1319 -0
  878. data/public/bcms/ckeditor/plugins/domiterator/plugin.js +354 -0
  879. data/public/bcms/ckeditor/plugins/editingblock/plugin.js +236 -0
  880. data/public/bcms/ckeditor/plugins/elementspath/plugin.js +182 -0
  881. data/public/bcms/ckeditor/plugins/enterkey/plugin.js +324 -0
  882. data/public/bcms/ckeditor/plugins/entities/plugin.js +200 -0
  883. data/public/bcms/ckeditor/plugins/fakeobjects/plugin.js +111 -0
  884. data/public/bcms/ckeditor/plugins/filebrowser/plugin.js +383 -0
  885. data/public/bcms/ckeditor/plugins/find/dialogs/find.js +843 -0
  886. data/public/bcms/ckeditor/plugins/find/plugin.js +46 -0
  887. data/public/bcms/ckeditor/plugins/flash/dialogs/flash.js +682 -0
  888. data/public/bcms/ckeditor/plugins/flash/images/placeholder.png +0 -0
  889. data/public/bcms/ckeditor/plugins/flash/plugin.js +165 -0
  890. data/public/bcms/ckeditor/plugins/floatpanel/plugin.js +325 -0
  891. data/public/bcms/ckeditor/plugins/font/plugin.js +227 -0
  892. data/public/bcms/ckeditor/plugins/format/plugin.js +191 -0
  893. data/public/bcms/ckeditor/plugins/forms/dialogs/button.js +135 -0
  894. data/public/bcms/ckeditor/plugins/forms/dialogs/checkbox.js +138 -0
  895. data/public/bcms/ckeditor/plugins/forms/dialogs/form.js +177 -0
  896. data/public/bcms/ckeditor/plugins/forms/dialogs/hiddenfield.js +91 -0
  897. data/public/bcms/ckeditor/plugins/forms/dialogs/radio.js +135 -0
  898. data/public/bcms/ckeditor/plugins/forms/dialogs/select.js +541 -0
  899. data/public/bcms/ckeditor/plugins/forms/dialogs/textarea.js +114 -0
  900. data/public/bcms/ckeditor/plugins/forms/dialogs/textfield.js +193 -0
  901. data/public/bcms/ckeditor/plugins/forms/plugin.js +193 -0
  902. data/public/bcms/ckeditor/plugins/horizontalrule/plugin.js +35 -0
  903. data/public/bcms/ckeditor/plugins/htmldataprocessor/plugin.js +373 -0
  904. data/public/bcms/ckeditor/plugins/htmlwriter/plugin.js +289 -0
  905. data/public/bcms/ckeditor/plugins/iframedialog/plugin.js +136 -0
  906. data/public/bcms/ckeditor/plugins/image/dialogs/image.js +1225 -0
  907. data/public/bcms/ckeditor/plugins/image/plugin.js +64 -0
  908. data/public/bcms/ckeditor/plugins/indent/plugin.js +323 -0
  909. data/public/bcms/ckeditor/plugins/justify/plugin.js +164 -0
  910. data/public/bcms/ckeditor/plugins/keystrokes/plugin.js +217 -0
  911. data/public/bcms/ckeditor/plugins/link/dialogs/anchor.js +98 -0
  912. data/public/bcms/ckeditor/plugins/link/dialogs/link.js +1217 -0
  913. data/public/bcms/ckeditor/plugins/link/images/anchor.gif +0 -0
  914. data/public/bcms/ckeditor/plugins/link/plugin.js +188 -0
  915. data/public/bcms/ckeditor/plugins/list/plugin.js +570 -0
  916. data/public/bcms/ckeditor/plugins/listblock/plugin.js +231 -0
  917. data/public/bcms/ckeditor/plugins/maximize/plugin.js +267 -0
  918. data/public/bcms/ckeditor/plugins/menu/plugin.js +377 -0
  919. data/public/bcms/ckeditor/plugins/menubutton/plugin.js +93 -0
  920. data/public/bcms/ckeditor/plugins/newpage/plugin.js +65 -0
  921. data/public/bcms/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  922. data/public/bcms/ckeditor/plugins/pagebreak/plugin.js +96 -0
  923. data/public/bcms/ckeditor/plugins/panel/plugin.js +330 -0
  924. data/public/bcms/ckeditor/plugins/panelbutton/plugin.js +140 -0
  925. data/public/bcms/ckeditor/plugins/pastefromword/dialogs/pastefromword.js +307 -0
  926. data/public/bcms/ckeditor/plugins/pastefromword/plugin.js +54 -0
  927. data/public/bcms/ckeditor/plugins/pastetext/dialogs/pastetext.js +65 -0
  928. data/public/bcms/ckeditor/plugins/pastetext/plugin.js +142 -0
  929. data/public/bcms/ckeditor/plugins/popup/plugin.js +62 -0
  930. data/public/bcms/ckeditor/plugins/preview/plugin.js +97 -0
  931. data/public/bcms/ckeditor/plugins/print/plugin.js +41 -0
  932. data/public/bcms/ckeditor/plugins/removeformat/plugin.js +132 -0
  933. data/public/bcms/ckeditor/plugins/resize/plugin.js +115 -0
  934. data/public/bcms/ckeditor/plugins/richcombo/plugin.js +357 -0
  935. data/public/bcms/ckeditor/plugins/save/plugin.js +55 -0
  936. data/public/bcms/ckeditor/plugins/scayt/dialogs/options.js +494 -0
  937. data/public/bcms/ckeditor/plugins/scayt/dialogs/toolbar.css +71 -0
  938. data/public/bcms/ckeditor/plugins/scayt/plugin.js +511 -0
  939. data/public/bcms/ckeditor/plugins/selection/plugin.js +1072 -0
  940. data/public/bcms/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  941. data/public/bcms/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  942. data/public/bcms/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  943. data/public/bcms/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  944. data/public/bcms/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  945. data/public/bcms/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  946. data/public/bcms/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  947. data/public/bcms/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  948. data/public/bcms/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  949. data/public/bcms/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  950. data/public/bcms/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  951. data/public/bcms/ckeditor/plugins/showblocks/plugin.js +153 -0
  952. data/public/bcms/ckeditor/plugins/smiley/dialogs/smiley.js +219 -0
  953. data/public/bcms/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  954. data/public/bcms/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  955. data/public/bcms/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  956. data/public/bcms/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  957. data/public/bcms/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  958. data/public/bcms/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  959. data/public/bcms/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  960. data/public/bcms/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  961. data/public/bcms/ckeditor/plugins/smiley/images/heart.gif +0 -0
  962. data/public/bcms/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  963. data/public/bcms/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  964. data/public/bcms/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  965. data/public/bcms/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  966. data/public/bcms/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  967. data/public/bcms/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  968. data/public/bcms/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  969. data/public/bcms/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  970. data/public/bcms/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  971. data/public/bcms/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  972. data/public/bcms/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  973. data/public/bcms/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  974. data/public/bcms/ckeditor/plugins/smiley/plugin.js +74 -0
  975. data/public/bcms/ckeditor/plugins/sourcearea/plugin.js +185 -0
  976. data/public/bcms/ckeditor/plugins/specialchar/dialogs/specialchar.js +362 -0
  977. data/public/bcms/ckeditor/plugins/specialchar/plugin.js +29 -0
  978. data/public/bcms/ckeditor/plugins/styles/plugin.js +1242 -0
  979. data/public/bcms/ckeditor/plugins/stylescombo/plugin.js +295 -0
  980. data/public/bcms/ckeditor/plugins/stylescombo/styles/default.js +85 -0
  981. data/public/bcms/ckeditor/plugins/tab/plugin.js +266 -0
  982. data/public/bcms/ckeditor/plugins/table/dialogs/table.js +550 -0
  983. data/public/bcms/ckeditor/plugins/table/plugin.js +70 -0
  984. data/public/bcms/ckeditor/plugins/tabletools/dialogs/tableCell.js +328 -0
  985. data/public/bcms/ckeditor/plugins/tabletools/plugin.js +701 -0
  986. data/public/bcms/ckeditor/plugins/templates/dialogs/templates.js +170 -0
  987. data/public/bcms/ckeditor/plugins/templates/plugin.js +99 -0
  988. data/public/bcms/ckeditor/plugins/templates/templates/default.js +94 -0
  989. data/public/bcms/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  990. data/public/bcms/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  991. data/public/bcms/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  992. data/public/bcms/ckeditor/plugins/toolbar/plugin.js +412 -0
  993. data/public/bcms/ckeditor/plugins/uicolor/dialogs/uicolor.js +203 -0
  994. data/public/bcms/ckeditor/plugins/uicolor/lang/en.js +15 -0
  995. data/public/bcms/ckeditor/plugins/uicolor/plugin.js +35 -0
  996. data/public/bcms/ckeditor/plugins/uicolor/uicolor.gif +0 -0
  997. data/public/bcms/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  998. data/public/bcms/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  999. data/public/bcms/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  1000. data/public/bcms/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  1001. data/public/bcms/ckeditor/plugins/uicolor/yui/assets/yui.css +15 -0
  1002. data/public/bcms/ckeditor/plugins/uicolor/yui/yui.js +71 -0
  1003. data/public/bcms/ckeditor/plugins/undo/plugin.js +490 -0
  1004. data/public/bcms/ckeditor/plugins/wsc/dialogs/ciframe.html +49 -0
  1005. data/public/bcms/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +52 -0
  1006. data/public/bcms/ckeditor/plugins/wsc/dialogs/wsc.css +83 -0
  1007. data/public/bcms/ckeditor/plugins/wsc/dialogs/wsc.js +169 -0
  1008. data/public/bcms/ckeditor/plugins/wsc/plugin.js +32 -0
  1009. data/public/bcms/ckeditor/plugins/wysiwygarea/plugin.js +636 -0
  1010. data/public/bcms/ckeditor/skins/kama/dialog.css +742 -0
  1011. data/public/bcms/ckeditor/skins/kama/editor.css +21 -0
  1012. data/public/bcms/ckeditor/skins/kama/elementspath.css +68 -0
  1013. data/public/bcms/ckeditor/skins/kama/icons.css +309 -0
  1014. data/public/bcms/ckeditor/skins/kama/icons.png +0 -0
  1015. data/public/bcms/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  1016. data/public/bcms/ckeditor/skins/kama/images/dialog_sides.png +0 -0
  1017. data/public/bcms/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  1018. data/public/bcms/ckeditor/skins/kama/images/mini.gif +0 -0
  1019. data/public/bcms/ckeditor/skins/kama/images/noimage.png +0 -0
  1020. data/public/bcms/ckeditor/skins/kama/images/sprites.png +0 -0
  1021. data/public/bcms/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  1022. data/public/bcms/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  1023. data/public/bcms/ckeditor/skins/kama/mainui.css +139 -0
  1024. data/public/bcms/ckeditor/skins/kama/menu.css +179 -0
  1025. data/public/bcms/ckeditor/skins/kama/panel.css +203 -0
  1026. data/public/bcms/ckeditor/skins/kama/presets.css +49 -0
  1027. data/public/bcms/ckeditor/skins/kama/reset.css +78 -0
  1028. data/public/bcms/ckeditor/skins/kama/richcombo.css +260 -0
  1029. data/public/bcms/ckeditor/skins/kama/skin.js +291 -0
  1030. data/public/bcms/ckeditor/skins/kama/templates.css +71 -0
  1031. data/public/bcms/ckeditor/skins/kama/toolbar.css +384 -0
  1032. data/public/bcms/ckeditor/skins/office2003/dialog.css +643 -0
  1033. data/public/bcms/ckeditor/skins/office2003/editor.css +21 -0
  1034. data/public/bcms/ckeditor/skins/office2003/elementspath.css +68 -0
  1035. data/public/bcms/ckeditor/skins/office2003/icons.css +309 -0
  1036. data/public/bcms/ckeditor/skins/office2003/icons.png +0 -0
  1037. data/public/bcms/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
  1038. data/public/bcms/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
  1039. data/public/bcms/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
  1040. data/public/bcms/ckeditor/skins/office2003/images/mini.gif +0 -0
  1041. data/public/bcms/ckeditor/skins/office2003/images/noimage.png +0 -0
  1042. data/public/bcms/ckeditor/skins/office2003/images/sprites.png +0 -0
  1043. data/public/bcms/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
  1044. data/public/bcms/ckeditor/skins/office2003/mainui.css +97 -0
  1045. data/public/bcms/ckeditor/skins/office2003/menu.css +175 -0
  1046. data/public/bcms/ckeditor/skins/office2003/panel.css +198 -0
  1047. data/public/bcms/ckeditor/skins/office2003/presets.css +49 -0
  1048. data/public/bcms/ckeditor/skins/office2003/reset.css +78 -0
  1049. data/public/bcms/ckeditor/skins/office2003/richcombo.css +279 -0
  1050. data/public/bcms/ckeditor/skins/office2003/skin.js +77 -0
  1051. data/public/bcms/ckeditor/skins/office2003/templates.css +71 -0
  1052. data/public/bcms/ckeditor/skins/office2003/toolbar.css +442 -0
  1053. data/public/bcms/ckeditor/skins/v2/dialog.css +653 -0
  1054. data/public/bcms/ckeditor/skins/v2/editor.css +21 -0
  1055. data/public/bcms/ckeditor/skins/v2/elementspath.css +68 -0
  1056. data/public/bcms/ckeditor/skins/v2/icons.css +309 -0
  1057. data/public/bcms/ckeditor/skins/v2/icons.png +0 -0
  1058. data/public/bcms/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
  1059. data/public/bcms/ckeditor/skins/v2/images/dialog_sides.png +0 -0
  1060. data/public/bcms/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
  1061. data/public/bcms/ckeditor/skins/v2/images/mini.gif +0 -0
  1062. data/public/bcms/ckeditor/skins/v2/images/noimage.png +0 -0
  1063. data/public/bcms/ckeditor/skins/v2/images/sprites.png +0 -0
  1064. data/public/bcms/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
  1065. data/public/bcms/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
  1066. data/public/bcms/ckeditor/skins/v2/mainui.css +112 -0
  1067. data/public/bcms/ckeditor/skins/v2/menu.css +178 -0
  1068. data/public/bcms/ckeditor/skins/v2/panel.css +198 -0
  1069. data/public/bcms/ckeditor/skins/v2/presets.css +50 -0
  1070. data/public/bcms/ckeditor/skins/v2/reset.css +78 -0
  1071. data/public/bcms/ckeditor/skins/v2/richcombo.css +275 -0
  1072. data/public/bcms/ckeditor/skins/v2/skin.js +73 -0
  1073. data/public/bcms/ckeditor/skins/v2/templates.css +71 -0
  1074. data/public/bcms/ckeditor/skins/v2/toolbar.css +399 -0
  1075. data/public/bcms/ckeditor/tests/_assets/sample.css +4 -0
  1076. data/public/bcms/ckeditor/tests/_assets/sample.js +1 -0
  1077. data/public/bcms/ckeditor/tests/_assets/sample.txt +1 -0
  1078. data/public/bcms/ckeditor/tests/_assets/sample.xml +5 -0
  1079. data/public/bcms/ckeditor/tests/_assets/sample_xml.txt +5 -0
  1080. data/public/bcms/ckeditor/tests/core/_editor/custom_config_1.js +10 -0
  1081. data/public/bcms/ckeditor/tests/core/_editor/custom_config_2.js +9 -0
  1082. data/public/bcms/ckeditor/tests/core/ajax.html +163 -0
  1083. data/public/bcms/ckeditor/tests/core/bootstrap.html +66 -0
  1084. data/public/bcms/ckeditor/tests/core/ckeditor.html +160 -0
  1085. data/public/bcms/ckeditor/tests/core/dom/document.html +126 -0
  1086. data/public/bcms/ckeditor/tests/core/dom/documentfragment.html +292 -0
  1087. data/public/bcms/ckeditor/tests/core/dom/element.html +637 -0
  1088. data/public/bcms/ckeditor/tests/core/dom/node.html +164 -0
  1089. data/public/bcms/ckeditor/tests/core/dom/range.html +2411 -0
  1090. data/public/bcms/ckeditor/tests/core/dom/text.html +128 -0
  1091. data/public/bcms/ckeditor/tests/core/dom/walker.html +340 -0
  1092. data/public/bcms/ckeditor/tests/core/dom/window.html +53 -0
  1093. data/public/bcms/ckeditor/tests/core/editor.html +123 -0
  1094. data/public/bcms/ckeditor/tests/core/env.html +52 -0
  1095. data/public/bcms/ckeditor/tests/core/event.html +487 -0
  1096. data/public/bcms/ckeditor/tests/core/htmlparser/fragment.html +188 -0
  1097. data/public/bcms/ckeditor/tests/core/htmlparser/htmlparser.html +91 -0
  1098. data/public/bcms/ckeditor/tests/core/plugins/myplugins/sample/my_plugin.js +3 -0
  1099. data/public/bcms/ckeditor/tests/core/plugins.html +45 -0
  1100. data/public/bcms/ckeditor/tests/core/scriptloader.html +52 -0
  1101. data/public/bcms/ckeditor/tests/core/tools.html +170 -0
  1102. data/public/bcms/ckeditor/tests/core/xml.html +150 -0
  1103. data/public/bcms/ckeditor/tests/plugins/domiterator/domiterator.html +236 -0
  1104. data/public/bcms/ckeditor/tests/plugins/htmldataprocessor/htmldataprocessor.html +386 -0
  1105. data/public/bcms/ckeditor/tests/plugins/link/link.html +123 -0
  1106. data/public/bcms/ckeditor/tests/plugins/list/list.html +217 -0
  1107. data/public/bcms/ckeditor/tests/plugins/selection/selection.html +49 -0
  1108. data/public/bcms/ckeditor/tests/plugins/styles/styles.html +596 -0
  1109. data/public/bcms/ckeditor/tests/test.css +81 -0
  1110. data/public/bcms/ckeditor/tests/test.js +93 -0
  1111. data/public/bcms/ckeditor/tests/testall.html +114 -0
  1112. data/public/bcms/ckeditor/tests/yuitest.js +75 -0
  1113. data/public/bcms/ckeditor/themes/default/theme.js +232 -0
  1114. data/public/images/cms/administration/user_browser_bg.gif +0 -0
  1115. data/public/images/cms/bg.png +0 -0
  1116. data/public/images/cms/bl_curve.png +0 -0
  1117. data/public/images/cms/bottom_cap.png +0 -0
  1118. data/public/images/cms/bottom_cap_content.png +0 -0
  1119. data/public/images/cms/browse.gif +0 -0
  1120. data/public/images/cms/browser_media_logo.png +0 -0
  1121. data/public/images/cms/browsercms_logo.png +0 -0
  1122. data/public/images/cms/buttons/button.png +0 -0
  1123. data/public/images/cms/buttons/button_bg.png +0 -0
  1124. data/public/images/cms/buttons/button_cap.png +0 -0
  1125. data/public/images/cms/buttons/button_cap_h.png +0 -0
  1126. data/public/images/cms/buttons/button_cap_off.gif +0 -0
  1127. data/public/images/cms/buttons/button_cap_off_middle.gif +0 -0
  1128. data/public/images/cms/buttons/button_h.png +0 -0
  1129. data/public/images/cms/buttons/button_left_bg.png +0 -0
  1130. data/public/images/cms/buttons/button_off.png +0 -0
  1131. data/public/images/cms/buttons/button_off_middle.png +0 -0
  1132. data/public/images/cms/buttons/delete_x.png +0 -0
  1133. data/public/images/cms/buttons/delete_x_disabled.png +0 -0
  1134. data/public/images/cms/buttons/delete_x_h.png +0 -0
  1135. data/public/images/cms/buttons/sm_button.gif +0 -0
  1136. data/public/images/cms/buttons/sm_button_2.gif +0 -0
  1137. data/public/images/cms/buttons/sm_button_2_h.gif +0 -0
  1138. data/public/images/cms/buttons/sm_button_h.gif +0 -0
  1139. data/public/images/cms/containers/add.gif +0 -0
  1140. data/public/images/cms/containers/alpha.png +0 -0
  1141. data/public/images/cms/containers/beta.png +0 -0
  1142. data/public/images/cms/containers/delete.gif +0 -0
  1143. data/public/images/cms/containers/down.gif +0 -0
  1144. data/public/images/cms/containers/edit.gif +0 -0
  1145. data/public/images/cms/containers/up.gif +0 -0
  1146. data/public/images/cms/containers/view.gif +0 -0
  1147. data/public/images/cms/content_bg.gif +0 -0
  1148. data/public/images/cms/dashboard/bottom_cap.png +0 -0
  1149. data/public/images/cms/dashboard/bottom_cap_content.png +0 -0
  1150. data/public/images/cms/dashboard/header_bg.gif +0 -0
  1151. data/public/images/cms/dashboard/header_left_bg.gif +0 -0
  1152. data/public/images/cms/dashboard/table_header_bg.gif +0 -0
  1153. data/public/images/cms/dashboard/top_cap.png +0 -0
  1154. data/public/images/cms/dashed.gif +0 -0
  1155. data/public/images/cms/datepicker/clear.gif +0 -0
  1156. data/public/images/cms/datepicker/close.gif +0 -0
  1157. data/public/images/cms/dk_button_l.gif +0 -0
  1158. data/public/images/cms/dk_button_r.gif +0 -0
  1159. data/public/images/cms/dot.png +0 -0
  1160. data/public/images/cms/draft_status.gif +0 -0
  1161. data/public/images/cms/gray_long_bg.gif +0 -0
  1162. data/public/images/cms/icons/actions/add.png +0 -0
  1163. data/public/images/cms/icons/actions/config.png +0 -0
  1164. data/public/images/cms/icons/actions/connect.png +0 -0
  1165. data/public/images/cms/icons/actions/delete.png +0 -0
  1166. data/public/images/cms/icons/actions/down.png +0 -0
  1167. data/public/images/cms/icons/actions/edit.png +0 -0
  1168. data/public/images/cms/icons/actions/folder.png +0 -0
  1169. data/public/images/cms/icons/actions/folder_add.png +0 -0
  1170. data/public/images/cms/icons/actions/folder_delete.png +0 -0
  1171. data/public/images/cms/icons/actions/folder_edit.png +0 -0
  1172. data/public/images/cms/icons/actions/folder_move.png +0 -0
  1173. data/public/images/cms/icons/actions/folder_open.png +0 -0
  1174. data/public/images/cms/icons/actions/history.png +0 -0
  1175. data/public/images/cms/icons/actions/home.png +0 -0
  1176. data/public/images/cms/icons/actions/left.png +0 -0
  1177. data/public/images/cms/icons/actions/link.png +0 -0
  1178. data/public/images/cms/icons/actions/page.png +0 -0
  1179. data/public/images/cms/icons/actions/page_add.png +0 -0
  1180. data/public/images/cms/icons/actions/page_edit.png +0 -0
  1181. data/public/images/cms/icons/actions/page_move.png +0 -0
  1182. data/public/images/cms/icons/actions/redo.png +0 -0
  1183. data/public/images/cms/icons/actions/refresh.png +0 -0
  1184. data/public/images/cms/icons/actions/right.png +0 -0
  1185. data/public/images/cms/icons/actions/root_folder.png +0 -0
  1186. data/public/images/cms/icons/actions/root_link.png +0 -0
  1187. data/public/images/cms/icons/actions/root_page.png +0 -0
  1188. data/public/images/cms/icons/actions/undo.png +0 -0
  1189. data/public/images/cms/icons/actions/up.png +0 -0
  1190. data/public/images/cms/icons/actions/view.png +0 -0
  1191. data/public/images/cms/icons/file_types/doc.png +0 -0
  1192. data/public/images/cms/icons/file_types/file.png +0 -0
  1193. data/public/images/cms/icons/file_types/gif.png +0 -0
  1194. data/public/images/cms/icons/file_types/htm.png +0 -0
  1195. data/public/images/cms/icons/file_types/pdf.png +0 -0
  1196. data/public/images/cms/icons/file_types/ppt.png +0 -0
  1197. data/public/images/cms/icons/file_types/swf.png +0 -0
  1198. data/public/images/cms/icons/file_types/txt.png +0 -0
  1199. data/public/images/cms/icons/file_types/xls.png +0 -0
  1200. data/public/images/cms/icons/file_types/xml.png +0 -0
  1201. data/public/images/cms/icons/file_types/zip.png +0 -0
  1202. data/public/images/cms/icons/status/archived.gif +0 -0
  1203. data/public/images/cms/icons/status/draft.gif +0 -0
  1204. data/public/images/cms/icons/status/hidden.gif +0 -0
  1205. data/public/images/cms/icons/status/locked.gif +0 -0
  1206. data/public/images/cms/icons/status/published.gif +0 -0
  1207. data/public/images/cms/icons/status/unlocked.gif +0 -0
  1208. data/public/images/cms/icons/user.png +0 -0
  1209. data/public/images/cms/locales/en/nav_admin.gif +0 -0
  1210. data/public/images/cms/locales/en/nav_admin_h.gif +0 -0
  1211. data/public/images/cms/locales/en/nav_admin_on.gif +0 -0
  1212. data/public/images/cms/locales/en/nav_content_library.gif +0 -0
  1213. data/public/images/cms/locales/en/nav_content_library_h.gif +0 -0
  1214. data/public/images/cms/locales/en/nav_content_library_on.gif +0 -0
  1215. data/public/images/cms/locales/en/nav_dash.gif +0 -0
  1216. data/public/images/cms/locales/en/nav_dash_h.gif +0 -0
  1217. data/public/images/cms/locales/en/nav_dash_on.gif +0 -0
  1218. data/public/images/cms/locales/en/nav_sitemap.gif +0 -0
  1219. data/public/images/cms/locales/en/nav_sitemap_h.gif +0 -0
  1220. data/public/images/cms/locales/en/nav_sitemap_on.gif +0 -0
  1221. data/public/images/cms/locales/es/nav_admin.gif +0 -0
  1222. data/public/images/cms/locales/es/nav_admin_h.gif +0 -0
  1223. data/public/images/cms/locales/es/nav_admin_on.gif +0 -0
  1224. data/public/images/cms/locales/es/nav_content_library.gif +0 -0
  1225. data/public/images/cms/locales/es/nav_content_library_h.gif +0 -0
  1226. data/public/images/cms/locales/es/nav_content_library_on.gif +0 -0
  1227. data/public/images/cms/locales/es/nav_dash.gif +0 -0
  1228. data/public/images/cms/locales/es/nav_dash_h.gif +0 -0
  1229. data/public/images/cms/locales/es/nav_dash_on.gif +0 -0
  1230. data/public/images/cms/locales/es/nav_sitemap.gif +0 -0
  1231. data/public/images/cms/locales/es/nav_sitemap_h.gif +0 -0
  1232. data/public/images/cms/locales/es/nav_sitemap_on.gif +0 -0
  1233. data/public/images/cms/login_bg.jpg +0 -0
  1234. data/public/images/cms/login_bottom.jpg +0 -0
  1235. data/public/images/cms/login_top.gif +0 -0
  1236. data/public/images/cms/lt_button_bg.gif +0 -0
  1237. data/public/images/cms/lt_button_l.gif +0 -0
  1238. data/public/images/cms/lt_button_r.gif +0 -0
  1239. data/public/images/cms/menu/block_cap_h.gif +0 -0
  1240. data/public/images/cms/menu/bottom_cap.png +0 -0
  1241. data/public/images/cms/menu/bottom_cap_menu.png +0 -0
  1242. data/public/images/cms/menu/bottom_cap_menu_first.png +0 -0
  1243. data/public/images/cms/menu/menu_header_first_bg.gif +0 -0
  1244. data/public/images/cms/menu/selected_block_cap.gif +0 -0
  1245. data/public/images/cms/menu/top_cap.png +0 -0
  1246. data/public/images/cms/menu/top_cap_menu_header.png +0 -0
  1247. data/public/images/cms/menu.png +0 -0
  1248. data/public/images/cms/menu_h.gif +0 -0
  1249. data/public/images/cms/menu_header.png +0 -0
  1250. data/public/images/cms/menu_open.png +0 -0
  1251. data/public/images/cms/menu_open_bg.gif +0 -0
  1252. data/public/images/cms/nav/on_bg.gif +0 -0
  1253. data/public/images/cms/nav.png +0 -0
  1254. data/public/images/cms/nav_admin.gif +0 -0
  1255. data/public/images/cms/nav_admin_h.gif +0 -0
  1256. data/public/images/cms/nav_admin_on.gif +0 -0
  1257. data/public/images/cms/nav_cap.png +0 -0
  1258. data/public/images/cms/nav_cap_h.gif +0 -0
  1259. data/public/images/cms/nav_content_library.gif +0 -0
  1260. data/public/images/cms/nav_content_library_h.gif +0 -0
  1261. data/public/images/cms/nav_content_library_on.gif +0 -0
  1262. data/public/images/cms/nav_dash.gif +0 -0
  1263. data/public/images/cms/nav_dash_h.gif +0 -0
  1264. data/public/images/cms/nav_dash_on.gif +0 -0
  1265. data/public/images/cms/nav_h.gif +0 -0
  1266. data/public/images/cms/nav_sitemap.gif +0 -0
  1267. data/public/images/cms/nav_sitemap_h.gif +0 -0
  1268. data/public/images/cms/nav_sitemap_on.gif +0 -0
  1269. data/public/images/cms/page_toolbar/page_toolbar_bg.gif +0 -0
  1270. data/public/images/cms/page_toolbar/page_toolbar_inset_bg.gif +0 -0
  1271. data/public/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif +0 -0
  1272. data/public/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif +0 -0
  1273. data/public/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif +0 -0
  1274. data/public/images/cms/page_toolbar/page_toolbar_inset_l.gif +0 -0
  1275. data/public/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif +0 -0
  1276. data/public/images/cms/page_toolbar/page_toolbar_inset_published_l.gif +0 -0
  1277. data/public/images/cms/page_toolbar/page_toolbar_inset_published_r.gif +0 -0
  1278. data/public/images/cms/page_toolbar/page_toolbar_inset_r.gif +0 -0
  1279. data/public/images/cms/page_toolbar/page_toolbar_l.gif +0 -0
  1280. data/public/images/cms/page_toolbar/page_toolbar_r.gif +0 -0
  1281. data/public/images/cms/page_toolbar/status_draft_bg.gif +0 -0
  1282. data/public/images/cms/page_toolbar/status_draft_l.gif +0 -0
  1283. data/public/images/cms/page_toolbar/status_l.gif +0 -0
  1284. data/public/images/cms/page_toolbar/status_published_bg.gif +0 -0
  1285. data/public/images/cms/page_toolbar/status_published_l.gif +0 -0
  1286. data/public/images/cms/page_toolbar/visual_editor_bg.gif +0 -0
  1287. data/public/images/cms/page_toolbar/visual_editor_end.gif +0 -0
  1288. data/public/images/cms/page_toolbar/visual_editor_r.gif +0 -0
  1289. data/public/images/cms/page_toolbar/visual_editor_state_bg.gif +0 -0
  1290. data/public/images/cms/pages/add_connectable.gif +0 -0
  1291. data/public/images/cms/pages/connect_connectable.gif +0 -0
  1292. data/public/images/cms/pages/container_border.gif +0 -0
  1293. data/public/images/cms/pages/container_border_l.gif +0 -0
  1294. data/public/images/cms/pages/container_border_r.gif +0 -0
  1295. data/public/images/cms/pages/delete_connectable.gif +0 -0
  1296. data/public/images/cms/pages/down_connectable.gif +0 -0
  1297. data/public/images/cms/pages/down_connectable_disabled.gif +0 -0
  1298. data/public/images/cms/pages/edit_connectable.gif +0 -0
  1299. data/public/images/cms/pages/edit_connectable_2.gif +0 -0
  1300. data/public/images/cms/pages/show_connectable.gif +0 -0
  1301. data/public/images/cms/pages/up_connectable.gif +0 -0
  1302. data/public/images/cms/pages/up_connectable_disabled.gif +0 -0
  1303. data/public/images/cms/pagination/first.gif +0 -0
  1304. data/public/images/cms/pagination/first_h.gif +0 -0
  1305. data/public/images/cms/pagination/input.gif +0 -0
  1306. data/public/images/cms/pagination/last.gif +0 -0
  1307. data/public/images/cms/pagination/last_h.gif +0 -0
  1308. data/public/images/cms/pagination/next.gif +0 -0
  1309. data/public/images/cms/pagination/next_h.gif +0 -0
  1310. data/public/images/cms/pagination/previous.gif +0 -0
  1311. data/public/images/cms/pagination/previous_h.gif +0 -0
  1312. data/public/images/cms/published_status.gif +0 -0
  1313. data/public/images/cms/search.png +0 -0
  1314. data/public/images/cms/search_submit.gif +0 -0
  1315. data/public/images/cms/search_submit_h.gif +0 -0
  1316. data/public/images/cms/searchbox_gradient.gif +0 -0
  1317. data/public/images/cms/select_bg.gif +0 -0
  1318. data/public/images/cms/select_bg_2.gif +0 -0
  1319. data/public/images/cms/sitemap/bottom_cap.png +0 -0
  1320. data/public/images/cms/sitemap/buffer_caps.png +0 -0
  1321. data/public/images/cms/sitemap/contract.png +0 -0
  1322. data/public/images/cms/sitemap/corners.gif +0 -0
  1323. data/public/images/cms/sitemap/corners_hover.gif +0 -0
  1324. data/public/images/cms/sitemap/divider.gif +0 -0
  1325. data/public/images/cms/sitemap/expand.png +0 -0
  1326. data/public/images/cms/sitemap/gradient.gif +0 -0
  1327. data/public/images/cms/sitemap/gray_contract.png +0 -0
  1328. data/public/images/cms/sitemap/gray_expand.png +0 -0
  1329. data/public/images/cms/sitemap/no_contents.png +0 -0
  1330. data/public/images/cms/sitemap/site_root_cap.png +0 -0
  1331. data/public/images/cms/sitemap/tooltip.gif +0 -0
  1332. data/public/images/cms/sitemap/top_cap_content.png +0 -0
  1333. data/public/images/cms/solid.gif +0 -0
  1334. data/public/images/cms/table/bl.gif +0 -0
  1335. data/public/images/cms/table/br.gif +0 -0
  1336. data/public/images/cms/table/divider.gif +0 -0
  1337. data/public/images/cms/table/td_cap_first_h.gif +0 -0
  1338. data/public/images/cms/table/td_cap_first_s.gif +0 -0
  1339. data/public/images/cms/table/td_cap_last_h.gif +0 -0
  1340. data/public/images/cms/table/td_cap_last_s.gif +0 -0
  1341. data/public/images/cms/table/td_last_bg.gif +0 -0
  1342. data/public/images/cms/table/th_bg.gif +0 -0
  1343. data/public/images/cms/table/th_divider.gif +0 -0
  1344. data/public/images/cms/table/th_last_bg.gif +0 -0
  1345. data/public/images/cms/table/tl.gif +0 -0
  1346. data/public/images/cms/table/tr.gif +0 -0
  1347. data/public/images/cms/table/tr_bg.gif +0 -0
  1348. data/public/images/cms/thickbox/loadingAnimation.gif +0 -0
  1349. data/public/images/cms/thickbox/macFFBgHack.png +0 -0
  1350. data/public/images/cms/toolbar_bg.png +0 -0
  1351. data/public/images/cms/top_cap.png +0 -0
  1352. data/public/images/cms/top_cap_content.png +0 -0
  1353. data/public/images/cms/top_cap_menu_header.png +0 -0
  1354. data/public/images/cms/user_search_submit.gif +0 -0
  1355. data/public/images/cms/usercontrols_bg.png +0 -0
  1356. data/public/images/cms/usercontrols_bg_cap.png +0 -0
  1357. data/public/javascripts/cms/application.js +148 -0
  1358. data/public/javascripts/cms/content_library.js +36 -0
  1359. data/public/javascripts/cms/sitemap.js +438 -0
  1360. data/public/javascripts/jquery-ui.js +591 -0
  1361. data/public/javascripts/jquery.contextMenu.js +211 -0
  1362. data/public/javascripts/jquery.cookie.js +96 -0
  1363. data/public/javascripts/jquery.dimensions.js +119 -0
  1364. data/public/javascripts/jquery.js +11 -0
  1365. data/public/javascripts/jquery.selectbox-0.5.js +209 -0
  1366. data/public/javascripts/jquery.taglist.js +136 -0
  1367. data/public/javascripts/jquery.thickbox.js +10 -0
  1368. data/public/site/customconfig.js +1 -0
  1369. data/public/stylesheets/cms/administration.css +91 -0
  1370. data/public/stylesheets/cms/application.css +166 -0
  1371. data/public/stylesheets/cms/block.css +26 -0
  1372. data/public/stylesheets/cms/buttons.css +120 -0
  1373. data/public/stylesheets/cms/content_library.css +139 -0
  1374. data/public/stylesheets/cms/content_types.css +4 -0
  1375. data/public/stylesheets/cms/dashboard.css +118 -0
  1376. data/public/stylesheets/cms/data_table.css +156 -0
  1377. data/public/stylesheets/cms/date_picker.css +73 -0
  1378. data/public/stylesheets/cms/form_layout.css +279 -0
  1379. data/public/stylesheets/cms/jquery.contextMenu.css +61 -0
  1380. data/public/stylesheets/cms/login.css +78 -0
  1381. data/public/stylesheets/cms/menu.css +116 -0
  1382. data/public/stylesheets/cms/nav.css +99 -0
  1383. data/public/stylesheets/cms/page_toolbar.css +135 -0
  1384. data/public/stylesheets/cms/reset.css +46 -0
  1385. data/public/stylesheets/cms/selectbox.css +56 -0
  1386. data/public/stylesheets/cms/sitemap.css +390 -0
  1387. data/public/stylesheets/cms/taglist.css +18 -0
  1388. data/public/stylesheets/cms/thickbox.css +163 -0
  1389. data/public/themes/blue_steel/images/logo.jpg +0 -0
  1390. data/public/themes/blue_steel/images/splash.jpg +0 -0
  1391. data/public/themes/blue_steel/stylesheets/style.css +257 -0
  1392. data/rails/init.rb +3 -0
  1393. data/rails_generators/browser_cms/USAGE +2 -0
  1394. data/rails_generators/browser_cms/browser_cms_generator.rb +35 -0
  1395. data/rails_generators/browser_cms/templates/README +1 -0
  1396. data/rails_generators/browser_cms_demo_site/USAGE +1 -0
  1397. data/rails_generators/browser_cms_demo_site/browser_cms_demo_site_generator.rb +63 -0
  1398. data/rails_generators/browser_cms_demo_site/templates/migration.rb +21 -0
  1399. data/rails_generators/content_block/USAGE +32 -0
  1400. data/rails_generators/content_block/content_block_generator.rb +69 -0
  1401. data/rails_generators/content_block/templates/_form.html.erb +22 -0
  1402. data/rails_generators/content_block/templates/content_block.rb +27 -0
  1403. data/rails_generators/content_block/templates/controller.rb +2 -0
  1404. data/rails_generators/content_block/templates/functional_test.erb +11 -0
  1405. data/rails_generators/content_block/templates/migration.rb +38 -0
  1406. data/rails_generators/content_block/templates/render.html.erb +14 -0
  1407. data/rails_generators/content_block/templates/unit_test.erb +9 -0
  1408. data/rails_generators/portlet/USAGE +39 -0
  1409. data/rails_generators/portlet/portlet_generator.rb +35 -0
  1410. data/rails_generators/portlet/templates/_form.html.erb +5 -0
  1411. data/rails_generators/portlet/templates/portlet.rb +10 -0
  1412. data/rails_generators/portlet/templates/portlet_helper.rb +5 -0
  1413. data/rails_generators/portlet/templates/render.html.erb +1 -0
  1414. data/rails_generators/portlet/templates/unit_test.erb +9 -0
  1415. data/rails_generators/template/USAGE +10 -0
  1416. data/rails_generators/template/template_generator.rb +18 -0
  1417. data/rails_generators/template/templates/template.erb +3 -0
  1418. data/templates/blank.rb +46 -0
  1419. data/templates/demo.rb +38 -0
  1420. data/templates/module.rb +956 -0
  1421. data/test/custom_assertions.rb +68 -0
  1422. data/test/factories.rb +109 -0
  1423. data/test/functional/cms/cache_controller_test.rb +14 -0
  1424. data/test/functional/cms/categories_controller_test.rb +25 -0
  1425. data/test/functional/cms/connectors_controller_test.rb +60 -0
  1426. data/test/functional/cms/content_block_controller_test.rb +120 -0
  1427. data/test/functional/cms/content_controller_test.rb +434 -0
  1428. data/test/functional/cms/content_types_controller_test.rb +18 -0
  1429. data/test/functional/cms/dashboard_controller_test.rb +16 -0
  1430. data/test/functional/cms/dynamic_views_controller_test.rb +28 -0
  1431. data/test/functional/cms/file_blocks_controller_test.rb +51 -0
  1432. data/test/functional/cms/groups_controller_test.rb +50 -0
  1433. data/test/functional/cms/home_controller_test.rb +156 -0
  1434. data/test/functional/cms/html_blocks_controller_test.rb +163 -0
  1435. data/test/functional/cms/image_blocks_controller_test.rb +75 -0
  1436. data/test/functional/cms/links_controller_test.rb +148 -0
  1437. data/test/functional/cms/pages_controller_test.rb +227 -0
  1438. data/test/functional/cms/portlets_controller_test.rb +67 -0
  1439. data/test/functional/cms/section_nodes_controller_test.rb +84 -0
  1440. data/test/functional/cms/sections_controller_test.rb +225 -0
  1441. data/test/functional/cms/sessions_controller_test.rb +76 -0
  1442. data/test/functional/cms/toolbar_controller_test.rb +64 -0
  1443. data/test/functional/cms/users_controller_test.rb +231 -0
  1444. data/test/functional/tests/pretend_controller_test.rb +54 -0
  1445. data/test/integration/cms/ckeditor_test.rb +27 -0
  1446. data/test/integration/cms/password_management_test.rb +56 -0
  1447. data/test/integration/login_test.rb +14 -0
  1448. data/test/test_helper.rb +175 -0
  1449. data/test/test_logging.rb +67 -0
  1450. data/test/unit/behaviors/attaching_test.rb +359 -0
  1451. data/test/unit/behaviors/dynamic_attributes_test.rb +38 -0
  1452. data/test/unit/behaviors/publishable_test.rb +53 -0
  1453. data/test/unit/behaviors/searching_test.rb +102 -0
  1454. data/test/unit/behaviors/taggable_test.rb +109 -0
  1455. data/test/unit/extensions/active_record/base_test.rb +10 -0
  1456. data/test/unit/extensions/hash_test.rb +17 -0
  1457. data/test/unit/extensions/integer_test.rb +10 -0
  1458. data/test/unit/helpers/application_helper_test.rb +77 -0
  1459. data/test/unit/helpers/form_builder_test.rb +36 -0
  1460. data/test/unit/helpers/menu_helper_test.rb +239 -0
  1461. data/test/unit/helpers/page_helper_test.rb +65 -0
  1462. data/test/unit/helpers/path_helper_test.rb +57 -0
  1463. data/test/unit/lib/acts_as_content_page_test.rb +72 -0
  1464. data/test/unit/lib/cms/authentication/controller_test.rb +20 -0
  1465. data/test/unit/lib/cms_domain_support_test.rb +43 -0
  1466. data/test/unit/lib/command_line_test.rb +70 -0
  1467. data/test/unit/lib/content_block_test.rb +203 -0
  1468. data/test/unit/lib/content_rendering_support_test.rb +40 -0
  1469. data/test/unit/lib/generators_test.rb +40 -0
  1470. data/test/unit/lib/routes_test.rb +57 -0
  1471. data/test/unit/models/attachment_test.rb +96 -0
  1472. data/test/unit/models/category_test.rb +40 -0
  1473. data/test/unit/models/category_type_test.rb +8 -0
  1474. data/test/unit/models/connector_test.rb +152 -0
  1475. data/test/unit/models/content_type_test.rb +56 -0
  1476. data/test/unit/models/email_page_portlet_test.rb +14 -0
  1477. data/test/unit/models/file_block_test.rb +211 -0
  1478. data/test/unit/models/group_test.rb +13 -0
  1479. data/test/unit/models/html_block_test.rb +102 -0
  1480. data/test/unit/models/link_test.rb +8 -0
  1481. data/test/unit/models/page_partial_test.rb +29 -0
  1482. data/test/unit/models/page_route_test.rb +29 -0
  1483. data/test/unit/models/page_template_test.rb +40 -0
  1484. data/test/unit/models/page_test.rb +726 -0
  1485. data/test/unit/models/permission_test.rb +10 -0
  1486. data/test/unit/models/portlet_test.rb +69 -0
  1487. data/test/unit/models/section_node_test.rb +92 -0
  1488. data/test/unit/models/sections_test.rb +164 -0
  1489. data/test/unit/models/site_test.rb +50 -0
  1490. data/test/unit/models/task_test.rb +141 -0
  1491. data/test/unit/models/user_test.rb +342 -0
  1492. data/test/unit/schema_statements_test.rb +41 -0
  1493. metadata +1552 -0
@@ -0,0 +1,2742 @@
1
+ /*
2
+ Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview The floating dialog plugin.
8
+ */
9
+
10
+ CKEDITOR.plugins.add( 'dialog',
11
+ {
12
+ requires : [ 'dialogui' ]
13
+ });
14
+
15
+ /**
16
+ * No resize for this dialog.
17
+ * @constant
18
+ */
19
+ CKEDITOR.DIALOG_RESIZE_NONE = 0;
20
+
21
+ /**
22
+ * Only allow horizontal resizing for this dialog, disable vertical resizing.
23
+ * @constant
24
+ */
25
+ CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
26
+
27
+ /**
28
+ * Only allow vertical resizing for this dialog, disable horizontal resizing.
29
+ * @constant
30
+ */
31
+ CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
32
+
33
+ /*
34
+ * Allow the dialog to be resized in both directions.
35
+ * @constant
36
+ */
37
+ CKEDITOR.DIALOG_RESIZE_BOTH = 3;
38
+
39
+ (function()
40
+ {
41
+ function isTabVisible( tabId )
42
+ {
43
+ return !!this._.tabs[ tabId ][ 0 ].$.offsetHeight;
44
+ }
45
+
46
+ function getPreviousVisibleTab()
47
+ {
48
+ var tabId = this._.currentTabId,
49
+ length = this._.tabIdList.length,
50
+ tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId ) + length;
51
+
52
+ for ( var i = tabIndex - 1 ; i > tabIndex - length ; i-- )
53
+ {
54
+ if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) )
55
+ return this._.tabIdList[ i % length ];
56
+ }
57
+
58
+ return null;
59
+ }
60
+
61
+ function getNextVisibleTab()
62
+ {
63
+ var tabId = this._.currentTabId,
64
+ length = this._.tabIdList.length,
65
+ tabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, tabId );
66
+
67
+ for ( var i = tabIndex + 1 ; i < tabIndex + length ; i++ )
68
+ {
69
+ if ( isTabVisible.call( this, this._.tabIdList[ i % length ] ) )
70
+ return this._.tabIdList[ i % length ];
71
+ }
72
+
73
+ return null;
74
+ }
75
+
76
+ // Stores dialog related data from skin definitions. e.g. margin sizes.
77
+ var skinData = {};
78
+
79
+ /**
80
+ * This is the base class for runtime dialog objects. An instance of this
81
+ * class represents a single named dialog for a single editor instance.
82
+ * @param {Object} editor The editor which created the dialog.
83
+ * @param {String} dialogName The dialog's registered name.
84
+ * @constructor
85
+ * @example
86
+ * var dialogObj = new CKEDITOR.dialog( editor, 'smiley' );
87
+ */
88
+ CKEDITOR.dialog = function( editor, dialogName )
89
+ {
90
+ // Load the dialog definition.
91
+ var definition = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
92
+ if ( !definition )
93
+ {
94
+ console.log( 'Error: The dialog "' + dialogName + '" is not defined.' );
95
+ return;
96
+ }
97
+
98
+ // Completes the definition with the default values.
99
+ definition = CKEDITOR.tools.extend( definition( editor ), defaultDialogDefinition );
100
+
101
+ // Clone a functionally independent copy for this dialog.
102
+ definition = CKEDITOR.tools.clone( definition );
103
+
104
+ // Create a complex definition object, extending it with the API
105
+ // functions.
106
+ definition = new definitionObject( this, definition );
107
+
108
+ // Fire the "dialogDefinition" event, making it possible to customize
109
+ // the dialog definition.
110
+ this.definition = definition = CKEDITOR.fire( 'dialogDefinition',
111
+ {
112
+ name : dialogName,
113
+ definition : definition
114
+ }
115
+ , editor ).definition;
116
+
117
+ var doc = CKEDITOR.document;
118
+
119
+ var themeBuilt = editor.theme.buildDialog( editor );
120
+
121
+ // Initialize some basic parameters.
122
+ this._ =
123
+ {
124
+ editor : editor,
125
+ element : themeBuilt.element,
126
+ name : dialogName,
127
+ contentSize : { width : 0, height : 0 },
128
+ size : { width : 0, height : 0 },
129
+ updateSize : false,
130
+ contents : {},
131
+ buttons : {},
132
+ accessKeyMap : {},
133
+
134
+ // Initialize the tab and page map.
135
+ tabs : {},
136
+ tabIdList : [],
137
+ currentTabId : null,
138
+ currentTabIndex : null,
139
+ pageCount : 0,
140
+ lastTab : null,
141
+ tabBarMode : false,
142
+
143
+ // Initialize the tab order array for input widgets.
144
+ focusList : [],
145
+ currentFocusIndex : 0,
146
+ hasFocus : false
147
+ };
148
+
149
+ this.parts = themeBuilt.parts;
150
+
151
+ // Set the startup styles for the dialog, avoiding it enlarging the
152
+ // page size on the dialog creation.
153
+ this.parts.dialog.setStyles(
154
+ {
155
+ position : CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed',
156
+ top : 0,
157
+ left: 0,
158
+ visibility : 'hidden'
159
+ });
160
+
161
+ // Call the CKEDITOR.event constructor to initialize this instance.
162
+ CKEDITOR.event.call( this );
163
+
164
+ // Initialize load, show, hide, ok and cancel events.
165
+ if ( definition.onLoad )
166
+ this.on( 'load', definition.onLoad );
167
+
168
+ if ( definition.onShow )
169
+ this.on( 'show', definition.onShow );
170
+
171
+ if ( definition.onHide )
172
+ this.on( 'hide', definition.onHide );
173
+
174
+ if ( definition.onOk )
175
+ {
176
+ this.on( 'ok', function( evt )
177
+ {
178
+ if ( definition.onOk.call( this, evt ) === false )
179
+ evt.data.hide = false;
180
+ });
181
+ }
182
+
183
+ if ( definition.onCancel )
184
+ {
185
+ this.on( 'cancel', function( evt )
186
+ {
187
+ if ( definition.onCancel.call( this, evt ) === false )
188
+ evt.data.hide = false;
189
+ });
190
+ }
191
+
192
+ var me = this;
193
+
194
+ // Iterates over all items inside all content in the dialog, calling a
195
+ // function for each of them.
196
+ var iterContents = function( func )
197
+ {
198
+ var contents = me._.contents,
199
+ stop = false;
200
+
201
+ for ( var i in contents )
202
+ {
203
+ for ( var j in contents[i] )
204
+ {
205
+ stop = func.call( this, contents[i][j] );
206
+ if ( stop )
207
+ return;
208
+ }
209
+ }
210
+ };
211
+
212
+ this.on( 'ok', function( evt )
213
+ {
214
+ iterContents( function( item )
215
+ {
216
+ if ( item.validate )
217
+ {
218
+ var isValid = item.validate( this );
219
+
220
+ if ( typeof isValid == 'string' )
221
+ {
222
+ alert( isValid );
223
+ isValid = false;
224
+ }
225
+
226
+ if ( isValid === false )
227
+ {
228
+ if ( item.select )
229
+ item.select();
230
+ else
231
+ item.focus();
232
+
233
+ evt.data.hide = false;
234
+ evt.stop();
235
+ return true;
236
+ }
237
+ }
238
+ });
239
+ }, this, null, 0 );
240
+
241
+ this.on( 'cancel', function( evt )
242
+ {
243
+ iterContents( function( item )
244
+ {
245
+ if ( item.isChanged() )
246
+ {
247
+ if ( !confirm( editor.lang.common.confirmCancel ) )
248
+ evt.data.hide = false;
249
+ return true;
250
+ }
251
+ });
252
+ }, this, null, 0 );
253
+
254
+ this.parts.close.on( 'click', function( evt )
255
+ {
256
+ if ( this.fire( 'cancel', { hide : true } ).hide !== false )
257
+ this.hide();
258
+ }, this );
259
+
260
+ function changeFocus( forward )
261
+ {
262
+ var focusList = me._.focusList,
263
+ offset = forward ? 1 : -1;
264
+ if ( focusList.length < 1 )
265
+ return;
266
+
267
+ var currentIndex = ( me._.currentFocusIndex + offset + focusList.length ) % focusList.length;
268
+ while ( !focusList[ currentIndex ].isFocusable() )
269
+ {
270
+ currentIndex = ( currentIndex + offset + focusList.length ) % focusList.length;
271
+ if ( currentIndex == me._.currentFocusIndex )
272
+ break;
273
+ }
274
+ focusList[ currentIndex ].focus();
275
+ }
276
+
277
+ function focusKeydownHandler( evt )
278
+ {
279
+ // If I'm not the top dialog, ignore.
280
+ if ( me != CKEDITOR.dialog._.currentTop )
281
+ return;
282
+
283
+ var keystroke = evt.data.getKeystroke(),
284
+ processed = false;
285
+ if ( keystroke == 9 || keystroke == CKEDITOR.SHIFT + 9 )
286
+ {
287
+ var shiftPressed = ( keystroke == CKEDITOR.SHIFT + 9 );
288
+
289
+ // Handling Tab and Shift-Tab.
290
+ if ( me._.tabBarMode )
291
+ {
292
+ // Change tabs.
293
+ var nextId = shiftPressed ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me );
294
+ me.selectPage( nextId );
295
+ me._.tabs[ nextId ][ 0 ].focus();
296
+ }
297
+ else
298
+ {
299
+ // Change the focus of inputs.
300
+ changeFocus( !shiftPressed );
301
+ }
302
+
303
+ processed = true;
304
+ }
305
+ else if ( keystroke == CKEDITOR.ALT + 121 && !me._.tabBarMode )
306
+ {
307
+ // Alt-F10 puts focus into the current tab item in the tab bar.
308
+ me._.tabBarMode = true;
309
+ me._.tabs[ me._.currentTabId ][ 0 ].focus();
310
+ processed = true;
311
+ }
312
+ else if ( ( keystroke == 37 || keystroke == 39 ) && me._.tabBarMode )
313
+ {
314
+ // Arrow keys - used for changing tabs.
315
+ nextId = ( keystroke == 37 ? getPreviousVisibleTab.call( me ) : getNextVisibleTab.call( me ) );
316
+ me.selectPage( nextId );
317
+ me._.tabs[ nextId ][ 0 ].focus();
318
+ processed = true;
319
+ }
320
+
321
+ if ( processed )
322
+ {
323
+ evt.stop();
324
+ evt.data.preventDefault();
325
+ }
326
+ }
327
+
328
+ // Add the dialog keyboard handlers.
329
+ this.on( 'show', function()
330
+ {
331
+ CKEDITOR.document.on( 'keydown', focusKeydownHandler, this, null, 0 );
332
+
333
+ if ( CKEDITOR.env.ie6Compat )
334
+ {
335
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
336
+ coverDoc.on( 'keydown', focusKeydownHandler, this, null, 0 );
337
+ }
338
+ } );
339
+ this.on( 'hide', function()
340
+ {
341
+ CKEDITOR.document.removeListener( 'keydown', focusKeydownHandler );
342
+ } );
343
+ this.on( 'iframeAdded', function( evt )
344
+ {
345
+ var doc = new CKEDITOR.dom.document( evt.data.iframe.$.contentWindow.document );
346
+ doc.on( 'keydown', focusKeydownHandler, this, null, 0 );
347
+ } );
348
+
349
+ // Auto-focus logic in dialog.
350
+ this.on( 'show', function()
351
+ {
352
+ if ( !this._.hasFocus )
353
+ {
354
+ this._.currentFocusIndex = -1;
355
+ changeFocus( true );
356
+
357
+ /*
358
+ * IE BUG: If the initial focus went into a non-text element (e.g. button),
359
+ * then IE would still leave the caret inside the editing area.
360
+ */
361
+ if ( this._.editor.mode == 'wysiwyg' && CKEDITOR.env.ie )
362
+ {
363
+ var $selection = editor.document.$.selection,
364
+ $range = $selection.createRange();
365
+
366
+ if ( $range )
367
+ {
368
+ if ( $range.parentElement && $range.parentElement().ownerDocument == editor.document.$
369
+ || $range.item && $range.item( 0 ).ownerDocument == editor.document.$ )
370
+ {
371
+ var $myRange = document.body.createTextRange();
372
+ $myRange.moveToElementText( this.getElement().getFirst().$ );
373
+ $myRange.collapse( true );
374
+ $myRange.select();
375
+ }
376
+ }
377
+ }
378
+ }
379
+ }, this, null, 0xffffffff );
380
+
381
+ // IE6 BUG: Text fields and text areas are only half-rendered the first time the dialog appears in IE6 (#2661).
382
+ // This is still needed after [2708] and [2709] because text fields in hidden TR tags are still broken.
383
+ if ( CKEDITOR.env.ie6Compat )
384
+ {
385
+ this.on( 'load', function( evt )
386
+ {
387
+ var outer = this.getElement(),
388
+ inner = outer.getFirst();
389
+ inner.remove();
390
+ inner.appendTo( outer );
391
+ }, this );
392
+ }
393
+
394
+ initDragAndDrop( this );
395
+ initResizeHandles( this );
396
+
397
+ // Insert the title.
398
+ ( new CKEDITOR.dom.text( definition.title, CKEDITOR.document ) ).appendTo( this.parts.title );
399
+
400
+ // Insert the tabs and contents.
401
+ for ( var i = 0 ; i < definition.contents.length ; i++ )
402
+ this.addPage( definition.contents[i] );
403
+
404
+ var tabRegex = /cke_dialog_tab(\s|$|_)/,
405
+ tabOuterRegex = /cke_dialog_tab(\s|$)/;
406
+ this.parts['tabs'].on( 'click', function( evt )
407
+ {
408
+ var target = evt.data.getTarget(), firstNode = target, id, page;
409
+
410
+ // If we aren't inside a tab, bail out.
411
+ if ( !( tabRegex.test( target.$.className ) || target.getName() == 'a' ) )
412
+ return;
413
+
414
+ // Find the outer <td> container of the tab.
415
+ id = target.$.id.substr( 0, target.$.id.lastIndexOf( '_' ) );
416
+ this.selectPage( id );
417
+
418
+ if ( this._.tabBarMode )
419
+ {
420
+ this._.tabBarMode = false;
421
+ this._.currentFocusIndex = -1;
422
+ changeFocus( true );
423
+ }
424
+
425
+ evt.data.preventDefault();
426
+ }, this );
427
+
428
+ // Insert buttons.
429
+ var buttonsHtml = [],
430
+ buttons = CKEDITOR.dialog._.uiElementBuilders.hbox.build( this,
431
+ {
432
+ type : 'hbox',
433
+ className : 'cke_dialog_footer_buttons',
434
+ widths : [],
435
+ children : definition.buttons
436
+ }, buttonsHtml ).getChild();
437
+ this.parts.footer.setHtml( buttonsHtml.join( '' ) );
438
+
439
+ for ( i = 0 ; i < buttons.length ; i++ )
440
+ this._.buttons[ buttons[i].id ] = buttons[i];
441
+
442
+ CKEDITOR.skins.load( editor, 'dialog' );
443
+ };
444
+
445
+ // Focusable interface. Use it via dialog.addFocusable.
446
+ function Focusable( dialog, element, index ) {
447
+ this.element = element;
448
+ this.focusIndex = index;
449
+ this.isFocusable = function()
450
+ {
451
+ return true;
452
+ };
453
+ this.focus = function()
454
+ {
455
+ dialog._.currentFocusIndex = this.focusIndex;
456
+ this.element.focus();
457
+ };
458
+ // Bind events
459
+ element.on( 'keydown', function( e )
460
+ {
461
+ if ( e.data.getKeystroke() in { 32:1, 13:1 } )
462
+ this.fire( 'click' );
463
+ } );
464
+ element.on( 'focus', function()
465
+ {
466
+ this.fire( 'mouseover' );
467
+ } );
468
+ element.on( 'blur', function()
469
+ {
470
+ this.fire( 'mouseout' );
471
+ } );
472
+ }
473
+
474
+ CKEDITOR.dialog.prototype =
475
+ {
476
+ /**
477
+ * Resizes the dialog.
478
+ * @param {Number} width The width of the dialog in pixels.
479
+ * @param {Number} height The height of the dialog in pixels.
480
+ * @function
481
+ * @example
482
+ * dialogObj.resize( 800, 640 );
483
+ */
484
+ resize : (function()
485
+ {
486
+ return function( width, height )
487
+ {
488
+ if ( this._.contentSize && this._.contentSize.width == width && this._.contentSize.height == height )
489
+ return;
490
+
491
+ CKEDITOR.dialog.fire( 'resize',
492
+ {
493
+ dialog : this,
494
+ skin : this._.editor.skinName,
495
+ width : width,
496
+ height : height
497
+ }, this._.editor );
498
+
499
+ this._.contentSize = { width : width, height : height };
500
+ this._.updateSize = true;
501
+ };
502
+ })(),
503
+
504
+ /**
505
+ * Gets the current size of the dialog in pixels.
506
+ * @returns {Object} An object with "width" and "height" properties.
507
+ * @example
508
+ * var width = dialogObj.getSize().width;
509
+ */
510
+ getSize : function()
511
+ {
512
+ if ( !this._.updateSize )
513
+ return this._.size;
514
+ var element = this._.element.getFirst();
515
+ var size = this._.size = { width : element.$.offsetWidth || 0, height : element.$.offsetHeight || 0};
516
+
517
+ // If either the offsetWidth or offsetHeight is 0, the element isn't visible.
518
+ this._.updateSize = !size.width || !size.height;
519
+
520
+ return size;
521
+ },
522
+
523
+ /**
524
+ * Moves the dialog to an (x, y) coordinate relative to the window.
525
+ * @function
526
+ * @param {Number} x The target x-coordinate.
527
+ * @param {Number} y The target y-coordinate.
528
+ * @example
529
+ * dialogObj.move( 10, 40 );
530
+ */
531
+ move : (function()
532
+ {
533
+ var isFixed;
534
+ return function( x, y )
535
+ {
536
+ // The dialog may be fixed positioned or absolute positioned. Ask the
537
+ // browser what is the current situation first.
538
+ var element = this._.element.getFirst();
539
+ if ( isFixed === undefined )
540
+ isFixed = element.getComputedStyle( 'position' ) == 'fixed';
541
+
542
+ if ( isFixed && this._.position && this._.position.x == x && this._.position.y == y )
543
+ return;
544
+
545
+ // Save the current position.
546
+ this._.position = { x : x, y : y };
547
+
548
+ // If not fixed positioned, add scroll position to the coordinates.
549
+ if ( !isFixed )
550
+ {
551
+ var scrollPosition = CKEDITOR.document.getWindow().getScrollPosition();
552
+ x += scrollPosition.x;
553
+ y += scrollPosition.y;
554
+ }
555
+
556
+ element.setStyles(
557
+ {
558
+ 'left' : ( x > 0 ? x : 0 ) + 'px',
559
+ 'top' : ( y > 0 ? y : 0 ) + 'px'
560
+ });
561
+ };
562
+ })(),
563
+
564
+ /**
565
+ * Gets the dialog's position in the window.
566
+ * @returns {Object} An object with "x" and "y" properties.
567
+ * @example
568
+ * var dialogX = dialogObj.getPosition().x;
569
+ */
570
+ getPosition : function(){ return CKEDITOR.tools.extend( {}, this._.position ); },
571
+
572
+ /**
573
+ * Shows the dialog box.
574
+ * @example
575
+ * dialogObj.show();
576
+ */
577
+ show : function()
578
+ {
579
+ if ( this._.editor.mode == 'wysiwyg' && CKEDITOR.env.ie )
580
+ this._.editor.getSelection().lock();
581
+
582
+ // Insert the dialog's element to the root document.
583
+ var element = this._.element;
584
+ var definition = this.definition;
585
+ if ( !( element.getParent() && element.getParent().equals( CKEDITOR.document.getBody() ) ) )
586
+ element.appendTo( CKEDITOR.document.getBody() );
587
+ else
588
+ return;
589
+
590
+ // FIREFOX BUG: Fix vanishing caret for Firefox 2 or Gecko 1.8.
591
+ if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 )
592
+ {
593
+ var dialogElement = this.parts.dialog;
594
+ dialogElement.setStyle( 'position', 'absolute' );
595
+ setTimeout( function()
596
+ {
597
+ dialogElement.setStyle( 'position', 'fixed' );
598
+ }, 0 );
599
+ }
600
+
601
+
602
+ // First, set the dialog to an appropriate size.
603
+ this.resize( definition.minWidth, definition.minHeight );
604
+
605
+ // Select the first tab by default.
606
+ this.selectPage( this.definition.contents[0].id );
607
+
608
+ // Reset all inputs back to their default value.
609
+ this.reset();
610
+
611
+ // Set z-index.
612
+ if ( CKEDITOR.dialog._.currentZIndex === null )
613
+ CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex;
614
+ this._.element.getFirst().setStyle( 'z-index', CKEDITOR.dialog._.currentZIndex += 10 );
615
+
616
+ // Maintain the dialog ordering and dialog cover.
617
+ // Also register key handlers if first dialog.
618
+ if ( CKEDITOR.dialog._.currentTop === null )
619
+ {
620
+ CKEDITOR.dialog._.currentTop = this;
621
+ this._.parentDialog = null;
622
+ addCover( this._.editor );
623
+
624
+ CKEDITOR.document.on( 'keydown', accessKeyDownHandler );
625
+ CKEDITOR.document.on( 'keyup', accessKeyUpHandler );
626
+ }
627
+ else
628
+ {
629
+ this._.parentDialog = CKEDITOR.dialog._.currentTop;
630
+ var parentElement = this._.parentDialog.getElement().getFirst();
631
+ parentElement.$.style.zIndex -= Math.floor( this._.editor.config.baseFloatZIndex / 2 );
632
+ CKEDITOR.dialog._.currentTop = this;
633
+ }
634
+
635
+ // Register the Esc hotkeys.
636
+ registerAccessKey( this, this, '\x1b', null, function()
637
+ {
638
+ this.getButton( 'cancel' ) && this.getButton( 'cancel' ).click();
639
+ } );
640
+
641
+ // Reset the hasFocus state.
642
+ this._.hasFocus = false;
643
+
644
+ // Rearrange the dialog to the middle of the window.
645
+ CKEDITOR.tools.setTimeout( function()
646
+ {
647
+ var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();
648
+ var dialogSize = this.getSize();
649
+
650
+ // We're using definition size for initial position because of
651
+ // offten corrupted data in offsetWidth at this point. (#4084)
652
+ this.move( ( viewSize.width - definition.minWidth ) / 2, ( viewSize.height - dialogSize.height ) / 2 );
653
+
654
+ this.parts.dialog.setStyle( 'visibility', '' );
655
+
656
+ // Execute onLoad for the first show.
657
+ this.fireOnce( 'load', {} );
658
+ this.fire( 'show', {} );
659
+
660
+ // Save the initial values of the dialog.
661
+ this.foreach( function( contentObj ) { contentObj.setInitValue && contentObj.setInitValue(); } );
662
+
663
+ },
664
+ 100, this );
665
+ },
666
+
667
+ /**
668
+ * Executes a function for each UI element.
669
+ * @param {Function} fn Function to execute for each UI element.
670
+ * @returns {CKEDITOR.dialog} The current dialog object.
671
+ */
672
+ foreach : function( fn )
673
+ {
674
+ for ( var i in this._.contents )
675
+ {
676
+ for ( var j in this._.contents[i] )
677
+ fn( this._.contents[i][j]);
678
+ }
679
+ return this;
680
+ },
681
+
682
+ /**
683
+ * Resets all input values in the dialog.
684
+ * @example
685
+ * dialogObj.reset();
686
+ * @returns {CKEDITOR.dialog} The current dialog object.
687
+ */
688
+ reset : (function()
689
+ {
690
+ var fn = function( widget ){ if ( widget.reset ) widget.reset(); };
691
+ return function(){ this.foreach( fn ); return this; };
692
+ })(),
693
+
694
+ setupContent : function()
695
+ {
696
+ var args = arguments;
697
+ this.foreach( function( widget )
698
+ {
699
+ if ( widget.setup )
700
+ widget.setup.apply( widget, args );
701
+ });
702
+ },
703
+
704
+ commitContent : function()
705
+ {
706
+ var args = arguments;
707
+ this.foreach( function( widget )
708
+ {
709
+ if ( widget.commit )
710
+ widget.commit.apply( widget, args );
711
+ });
712
+ },
713
+
714
+ /**
715
+ * Hides the dialog box.
716
+ * @example
717
+ * dialogObj.hide();
718
+ */
719
+ hide : function()
720
+ {
721
+ this.fire( 'hide', {} );
722
+
723
+ // Remove the dialog's element from the root document.
724
+ var element = this._.element;
725
+ if ( !element.getParent() )
726
+ return;
727
+
728
+ element.remove();
729
+ this.parts.dialog.setStyle( 'visibility', 'hidden' );
730
+
731
+ // Unregister all access keys associated with this dialog.
732
+ unregisterAccessKey( this );
733
+
734
+ // Maintain dialog ordering and remove cover if needed.
735
+ if ( !this._.parentDialog )
736
+ removeCover();
737
+ else
738
+ {
739
+ var parentElement = this._.parentDialog.getElement().getFirst();
740
+ parentElement.setStyle( 'z-index', parseInt( parentElement.$.style.zIndex, 10 ) + Math.floor( this._.editor.config.baseFloatZIndex / 2 ) );
741
+ }
742
+ CKEDITOR.dialog._.currentTop = this._.parentDialog;
743
+
744
+ // Deduct or clear the z-index.
745
+ if ( !this._.parentDialog )
746
+ {
747
+ CKEDITOR.dialog._.currentZIndex = null;
748
+
749
+ // Remove access key handlers.
750
+ CKEDITOR.document.removeListener( 'keydown', accessKeyDownHandler );
751
+ CKEDITOR.document.removeListener( 'keyup', accessKeyUpHandler );
752
+
753
+ var editor = this._.editor;
754
+ editor.focus();
755
+
756
+ if ( editor.mode == 'wysiwyg' && CKEDITOR.env.ie )
757
+ editor.getSelection().unlock( true );
758
+ }
759
+ else
760
+ CKEDITOR.dialog._.currentZIndex -= 10;
761
+
762
+
763
+ // Reset the initial values of the dialog.
764
+ this.foreach( function( contentObj ) { contentObj.resetInitValue && contentObj.resetInitValue(); } );
765
+ },
766
+
767
+ /**
768
+ * Adds a tabbed page into the dialog.
769
+ * @param {Object} contents Content definition.
770
+ * @example
771
+ */
772
+ addPage : function( contents )
773
+ {
774
+ var pageHtml = [],
775
+ titleHtml = contents.label ? ' title="' + CKEDITOR.tools.htmlEncode( contents.label ) + '"' : '',
776
+ elements = contents.elements,
777
+ vbox = CKEDITOR.dialog._.uiElementBuilders.vbox.build( this,
778
+ {
779
+ type : 'vbox',
780
+ className : 'cke_dialog_page_contents',
781
+ children : contents.elements,
782
+ expand : !!contents.expand,
783
+ padding : contents.padding,
784
+ style : contents.style || 'width: 100%; height: 100%;'
785
+ }, pageHtml );
786
+
787
+ // Create the HTML for the tab and the content block.
788
+ var page = CKEDITOR.dom.element.createFromHtml( pageHtml.join( '' ) );
789
+ var tab = CKEDITOR.dom.element.createFromHtml( [
790
+ '<a class="cke_dialog_tab"',
791
+ ( this._.pageCount > 0 ? ' cke_last' : 'cke_first' ),
792
+ titleHtml,
793
+ ( !!contents.hidden ? ' style="display:none"' : '' ),
794
+ ' id="', contents.id + '_', CKEDITOR.tools.getNextNumber(), '"' +
795
+ ' href="javascript:void(0)"',
796
+ ' hidefocus="true">',
797
+ contents.label,
798
+ '</a>'
799
+ ].join( '' ) );
800
+
801
+ // If only a single page exist, a different style is used in the central pane.
802
+ if ( this._.pageCount === 0 )
803
+ this.parts.dialog.addClass( 'cke_single_page' );
804
+ else
805
+ this.parts.dialog.removeClass( 'cke_single_page' );
806
+
807
+ // Take records for the tabs and elements created.
808
+ this._.tabs[ contents.id ] = [ tab, page ];
809
+ this._.tabIdList.push( contents.id );
810
+ this._.pageCount++;
811
+ this._.lastTab = tab;
812
+
813
+ var contentMap = this._.contents[ contents.id ] = {},
814
+ cursor,
815
+ children = vbox.getChild();
816
+
817
+ while ( ( cursor = children.shift() ) )
818
+ {
819
+ contentMap[ cursor.id ] = cursor;
820
+ if ( typeof( cursor.getChild ) == 'function' )
821
+ children.push.apply( children, cursor.getChild() );
822
+ }
823
+
824
+ // Attach the DOM nodes.
825
+
826
+ page.setAttribute( 'name', contents.id );
827
+ page.appendTo( this.parts.contents );
828
+
829
+ tab.unselectable();
830
+ this.parts.tabs.append( tab );
831
+
832
+ // Add access key handlers if access key is defined.
833
+ if ( contents.accessKey )
834
+ {
835
+ registerAccessKey( this, this, 'CTRL+' + contents.accessKey,
836
+ tabAccessKeyDown, tabAccessKeyUp );
837
+ this._.accessKeyMap[ 'CTRL+' + contents.accessKey ] = contents.id;
838
+ }
839
+ },
840
+
841
+ /**
842
+ * Activates a tab page in the dialog by its id.
843
+ * @param {String} id The id of the dialog tab to be activated.
844
+ * @example
845
+ * dialogObj.selectPage( 'tab_1' );
846
+ */
847
+ selectPage : function( id )
848
+ {
849
+ // Hide the non-selected tabs and pages.
850
+ for ( var i in this._.tabs )
851
+ {
852
+ var tab = this._.tabs[i][0],
853
+ page = this._.tabs[i][1];
854
+ if ( i != id )
855
+ {
856
+ tab.removeClass( 'cke_dialog_tab_selected' );
857
+ page.hide();
858
+ }
859
+ }
860
+
861
+ var selected = this._.tabs[id];
862
+ selected[0].addClass( 'cke_dialog_tab_selected' );
863
+ selected[1].show();
864
+ this._.currentTabId = id;
865
+ this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id );
866
+ },
867
+
868
+ /**
869
+ * Hides a page's tab away from the dialog.
870
+ * @param {String} id The page's Id.
871
+ * @example
872
+ * dialog.hidePage( 'tab_3' );
873
+ */
874
+ hidePage : function( id )
875
+ {
876
+ var tab = this._.tabs[id] && this._.tabs[id][0];
877
+ if ( !tab )
878
+ return;
879
+ tab.hide();
880
+ },
881
+
882
+ /**
883
+ * Unhides a page's tab.
884
+ * @param {String} id The page's Id.
885
+ * @example
886
+ * dialog.showPage( 'tab_2' );
887
+ */
888
+ showPage : function( id )
889
+ {
890
+ var tab = this._.tabs[id] && this._.tabs[id][0];
891
+ if ( !tab )
892
+ return;
893
+ tab.show();
894
+ },
895
+
896
+ /**
897
+ * Gets the root DOM element of the dialog.
898
+ * @returns {CKEDITOR.dom.element} The &lt;span&gt; element containing this dialog.
899
+ * @example
900
+ * var dialogElement = dialogObj.getElement().getFirst();
901
+ * dialogElement.setStyle( 'padding', '5px' );
902
+ */
903
+ getElement : function()
904
+ {
905
+ return this._.element;
906
+ },
907
+
908
+ /**
909
+ * Gets the name of the dialog.
910
+ * @returns {String} The name of this dialog.
911
+ * @example
912
+ * var dialogName = dialogObj.getName();
913
+ */
914
+ getName : function()
915
+ {
916
+ return this._.name;
917
+ },
918
+
919
+ /**
920
+ * Gets a dialog UI element object from a dialog page.
921
+ * @param {String} pageId id of dialog page.
922
+ * @param {String} elementId id of UI element.
923
+ * @example
924
+ * @returns {CKEDITOR.ui.dialog.uiElement} The dialog UI element.
925
+ */
926
+ getContentElement : function( pageId, elementId )
927
+ {
928
+ return this._.contents[pageId][elementId];
929
+ },
930
+
931
+ /**
932
+ * Gets the value of a dialog UI element.
933
+ * @param {String} pageId id of dialog page.
934
+ * @param {String} elementId id of UI element.
935
+ * @example
936
+ * @returns {Object} The value of the UI element.
937
+ */
938
+ getValueOf : function( pageId, elementId )
939
+ {
940
+ return this.getContentElement( pageId, elementId ).getValue();
941
+ },
942
+
943
+ /**
944
+ * Sets the value of a dialog UI element.
945
+ * @param {String} pageId id of the dialog page.
946
+ * @param {String} elementId id of the UI element.
947
+ * @param {Object} value The new value of the UI element.
948
+ * @example
949
+ */
950
+ setValueOf : function( pageId, elementId, value )
951
+ {
952
+ return this.getContentElement( pageId, elementId ).setValue( value );
953
+ },
954
+
955
+ /**
956
+ * Gets the UI element of a button in the dialog's button row.
957
+ * @param {String} id The id of the button.
958
+ * @example
959
+ * @returns {CKEDITOR.ui.dialog.button} The button object.
960
+ */
961
+ getButton : function( id )
962
+ {
963
+ return this._.buttons[ id ];
964
+ },
965
+
966
+ /**
967
+ * Simulates a click to a dialog button in the dialog's button row.
968
+ * @param {String} id The id of the button.
969
+ * @example
970
+ * @returns The return value of the dialog's "click" event.
971
+ */
972
+ click : function( id )
973
+ {
974
+ return this._.buttons[ id ].click();
975
+ },
976
+
977
+ /**
978
+ * Disables a dialog button.
979
+ * @param {String} id The id of the button.
980
+ * @example
981
+ */
982
+ disableButton : function( id )
983
+ {
984
+ return this._.buttons[ id ].disable();
985
+ },
986
+
987
+ /**
988
+ * Enables a dialog button.
989
+ * @param {String} id The id of the button.
990
+ * @example
991
+ */
992
+ enableButton : function( id )
993
+ {
994
+ return this._.buttons[ id ].enable();
995
+ },
996
+
997
+ /**
998
+ * Gets the number of pages in the dialog.
999
+ * @returns {Number} Page count.
1000
+ */
1001
+ getPageCount : function()
1002
+ {
1003
+ return this._.pageCount;
1004
+ },
1005
+
1006
+ /**
1007
+ * Gets the editor instance which opened this dialog.
1008
+ * @returns {CKEDITOR.editor} Parent editor instances.
1009
+ */
1010
+ getParentEditor : function()
1011
+ {
1012
+ return this._.editor;
1013
+ },
1014
+
1015
+ /**
1016
+ * Gets the element that was selected when opening the dialog, if any.
1017
+ * @returns {CKEDITOR.dom.element} The element that was selected, or null.
1018
+ */
1019
+ getSelectedElement : function()
1020
+ {
1021
+ return this.getParentEditor().getSelection().getSelectedElement();
1022
+ },
1023
+
1024
+ /**
1025
+ * Adds element to dialog's focusable list.
1026
+ *
1027
+ * @param {CKEDITOR.dom.element} element
1028
+ * @param {Number} [index]
1029
+ */
1030
+ addFocusable: function( element, index ) {
1031
+ if ( typeof index == 'undefined' )
1032
+ {
1033
+ index = this._.focusList.length;
1034
+ this._.focusList.push( new Focusable( this, element, index ) );
1035
+ }
1036
+ else
1037
+ {
1038
+ this._.focusList.splice( index, 0, new Focusable( this, element, index ) );
1039
+ for ( var i = index + 1 ; i < this._.focusList.length ; i++ )
1040
+ this._.focusList[ i ].focusIndex++;
1041
+ }
1042
+ }
1043
+ };
1044
+
1045
+ CKEDITOR.tools.extend( CKEDITOR.dialog,
1046
+ /**
1047
+ * @lends CKEDITOR.dialog
1048
+ */
1049
+ {
1050
+ /**
1051
+ * Registers a dialog.
1052
+ * @param {String} name The dialog's name.
1053
+ * @param {Function|String} dialogDefinition
1054
+ * A function returning the dialog's definition, or the URL to the .js file holding the function.
1055
+ * The function should accept an argument "editor" which is the current editor instance, and
1056
+ * return an object conforming to {@link CKEDITOR.dialog.dialogDefinition}.
1057
+ * @example
1058
+ * @see CKEDITOR.dialog.dialogDefinition
1059
+ */
1060
+ add : function( name, dialogDefinition )
1061
+ {
1062
+ // Avoid path registration from multiple instances override definition.
1063
+ if ( !this._.dialogDefinitions[name]
1064
+ || typeof dialogDefinition == 'function' )
1065
+ this._.dialogDefinitions[name] = dialogDefinition;
1066
+ },
1067
+
1068
+ exists : function( name )
1069
+ {
1070
+ return !!this._.dialogDefinitions[ name ];
1071
+ },
1072
+
1073
+ getCurrent : function()
1074
+ {
1075
+ return CKEDITOR.dialog._.currentTop;
1076
+ },
1077
+
1078
+ /**
1079
+ * The default OK button for dialogs. Fires the "ok" event and closes the dialog if the event succeeds.
1080
+ * @static
1081
+ * @field
1082
+ * @example
1083
+ * @type Function
1084
+ */
1085
+ okButton : (function()
1086
+ {
1087
+ var retval = function( editor, override )
1088
+ {
1089
+ override = override || {};
1090
+ return CKEDITOR.tools.extend( {
1091
+ id : 'ok',
1092
+ type : 'button',
1093
+ label : editor.lang.common.ok,
1094
+ 'class' : 'cke_dialog_ui_button_ok',
1095
+ onClick : function( evt )
1096
+ {
1097
+ var dialog = evt.data.dialog;
1098
+ if ( dialog.fire( 'ok', { hide : true } ).hide !== false )
1099
+ dialog.hide();
1100
+ }
1101
+ }, override, true );
1102
+ };
1103
+ retval.type = 'button';
1104
+ retval.override = function( override )
1105
+ {
1106
+ return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); },
1107
+ { type : 'button' }, true );
1108
+ };
1109
+ return retval;
1110
+ })(),
1111
+
1112
+ /**
1113
+ * The default cancel button for dialogs. Fires the "cancel" event and closes the dialog if no UI element value changed.
1114
+ * @static
1115
+ * @field
1116
+ * @example
1117
+ * @type Function
1118
+ */
1119
+ cancelButton : (function()
1120
+ {
1121
+ var retval = function( editor, override )
1122
+ {
1123
+ override = override || {};
1124
+ return CKEDITOR.tools.extend( {
1125
+ id : 'cancel',
1126
+ type : 'button',
1127
+ label : editor.lang.common.cancel,
1128
+ 'class' : 'cke_dialog_ui_button_cancel',
1129
+ onClick : function( evt )
1130
+ {
1131
+ var dialog = evt.data.dialog;
1132
+ if ( dialog.fire( 'cancel', { hide : true } ).hide !== false )
1133
+ dialog.hide();
1134
+ }
1135
+ }, override, true );
1136
+ };
1137
+ retval.type = 'button';
1138
+ retval.override = function( override )
1139
+ {
1140
+ return CKEDITOR.tools.extend( function( editor ){ return retval( editor, override ); },
1141
+ { type : 'button' }, true );
1142
+ };
1143
+ return retval;
1144
+ })(),
1145
+
1146
+ /**
1147
+ * Registers a dialog UI element.
1148
+ * @param {String} typeName The name of the UI element.
1149
+ * @param {Function} builder The function to build the UI element.
1150
+ * @example
1151
+ */
1152
+ addUIElement : function( typeName, builder )
1153
+ {
1154
+ this._.uiElementBuilders[ typeName ] = builder;
1155
+ }
1156
+ });
1157
+
1158
+ CKEDITOR.dialog._ =
1159
+ {
1160
+ uiElementBuilders : {},
1161
+
1162
+ dialogDefinitions : {},
1163
+
1164
+ currentTop : null,
1165
+
1166
+ currentZIndex : null
1167
+ };
1168
+
1169
+ // "Inherit" (copy actually) from CKEDITOR.event.
1170
+ CKEDITOR.event.implementOn( CKEDITOR.dialog );
1171
+ CKEDITOR.event.implementOn( CKEDITOR.dialog.prototype, true );
1172
+
1173
+ var defaultDialogDefinition =
1174
+ {
1175
+ resizable : CKEDITOR.DIALOG_RESIZE_NONE,
1176
+ minWidth : 600,
1177
+ minHeight : 400,
1178
+ buttons : [ CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton ]
1179
+ };
1180
+
1181
+ // Tool function used to return an item from an array based on its id
1182
+ // property.
1183
+ var getById = function( array, id, recurse )
1184
+ {
1185
+ for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
1186
+ {
1187
+ if ( item.id == id )
1188
+ return item;
1189
+ if ( recurse && item[ recurse ] )
1190
+ {
1191
+ var retval = getById( item[ recurse ], id, recurse ) ;
1192
+ if ( retval )
1193
+ return retval;
1194
+ }
1195
+ }
1196
+ return null;
1197
+ };
1198
+
1199
+ // Tool function used to add an item into an array.
1200
+ var addById = function( array, newItem, nextSiblingId, recurse, nullIfNotFound )
1201
+ {
1202
+ if ( nextSiblingId )
1203
+ {
1204
+ for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
1205
+ {
1206
+ if ( item.id == nextSiblingId )
1207
+ {
1208
+ array.splice( i, 0, newItem );
1209
+ return newItem;
1210
+ }
1211
+
1212
+ if ( recurse && item[ recurse ] )
1213
+ {
1214
+ var retval = addById( item[ recurse ], newItem, nextSiblingId, recurse, true );
1215
+ if ( retval )
1216
+ return retval;
1217
+ }
1218
+ }
1219
+
1220
+ if ( nullIfNotFound )
1221
+ return null;
1222
+ }
1223
+
1224
+ array.push( newItem );
1225
+ return newItem;
1226
+ };
1227
+
1228
+ // Tool function used to remove an item from an array based on its id.
1229
+ var removeById = function( array, id, recurse )
1230
+ {
1231
+ for ( var i = 0, item ; ( item = array[ i ] ) ; i++ )
1232
+ {
1233
+ if ( item.id == id )
1234
+ return array.splice( i, 1 );
1235
+ if ( recurse && item[ recurse ] )
1236
+ {
1237
+ var retval = removeById( item[ recurse ], id, recurse );
1238
+ if ( retval )
1239
+ return retval;
1240
+ }
1241
+ }
1242
+ return null;
1243
+ };
1244
+
1245
+ /**
1246
+ * This class is not really part of the API. It is the "definition" property value
1247
+ * passed to "dialogDefinition" event handlers.
1248
+ * @constructor
1249
+ * @name CKEDITOR.dialog.dialogDefinitionObject
1250
+ * @extends CKEDITOR.dialog.dialogDefinition
1251
+ * @example
1252
+ * CKEDITOR.on( 'dialogDefinition', function( evt )
1253
+ * {
1254
+ * var definition = evt.data.definition;
1255
+ * var content = definition.getContents( 'page1' );
1256
+ * ...
1257
+ * } );
1258
+ */
1259
+ var definitionObject = function( dialog, dialogDefinition )
1260
+ {
1261
+ // TODO : Check if needed.
1262
+ this.dialog = dialog;
1263
+
1264
+ // Transform the contents entries in contentObjects.
1265
+ var contents = dialogDefinition.contents;
1266
+ for ( var i = 0, content ; ( content = contents[i] ) ; i++ )
1267
+ contents[ i ] = new contentObject( dialog, content );
1268
+
1269
+ CKEDITOR.tools.extend( this, dialogDefinition );
1270
+ };
1271
+
1272
+ definitionObject.prototype =
1273
+ /** @lends CKEDITOR.dialog.dialogDefinitionObject.prototype */
1274
+ {
1275
+ /**
1276
+ * Gets a content definition.
1277
+ * @param {String} id The id of the content definition.
1278
+ * @returns {CKEDITOR.dialog.contentDefinition} The content definition
1279
+ * matching id.
1280
+ */
1281
+ getContents : function( id )
1282
+ {
1283
+ return getById( this.contents, id );
1284
+ },
1285
+
1286
+ /**
1287
+ * Gets a button definition.
1288
+ * @param {String} id The id of the button definition.
1289
+ * @returns {CKEDITOR.dialog.buttonDefinition} The button definition
1290
+ * matching id.
1291
+ */
1292
+ getButton : function( id )
1293
+ {
1294
+ return getById( this.buttons, id );
1295
+ },
1296
+
1297
+ /**
1298
+ * Adds a content definition object under this dialog definition.
1299
+ * @param {CKEDITOR.dialog.contentDefinition} contentDefinition The
1300
+ * content definition.
1301
+ * @param {String} [nextSiblingId] The id of an existing content
1302
+ * definition which the new content definition will be inserted
1303
+ * before. Omit if the new content definition is to be inserted as
1304
+ * the last item.
1305
+ * @returns {CKEDITOR.dialog.contentDefinition} The inserted content
1306
+ * definition.
1307
+ */
1308
+ addContents : function( contentDefinition, nextSiblingId )
1309
+ {
1310
+ return addById( this.contents, contentDefinition, nextSiblingId );
1311
+ },
1312
+
1313
+ /**
1314
+ * Adds a button definition object under this dialog definition.
1315
+ * @param {CKEDITOR.dialog.buttonDefinition} buttonDefinition The
1316
+ * button definition.
1317
+ * @param {String} [nextSiblingId] The id of an existing button
1318
+ * definition which the new button definition will be inserted
1319
+ * before. Omit if the new button definition is to be inserted as
1320
+ * the last item.
1321
+ * @returns {CKEDITOR.dialog.buttonDefinition} The inserted button
1322
+ * definition.
1323
+ */
1324
+ addButton : function( buttonDefinition, nextSiblingId )
1325
+ {
1326
+ return addById( this.buttons, buttonDefinition, nextSiblingId );
1327
+ },
1328
+
1329
+ /**
1330
+ * Removes a content definition from this dialog definition.
1331
+ * @param {String} id The id of the content definition to be removed.
1332
+ * @returns {CKEDITOR.dialog.contentDefinition} The removed content
1333
+ * definition.
1334
+ */
1335
+ removeContents : function( id )
1336
+ {
1337
+ removeById( this.contents, id );
1338
+ },
1339
+
1340
+ /**
1341
+ * Removes a button definition from the dialog definition.
1342
+ * @param {String} id The id of the button definition to be removed.
1343
+ * @returns {CKEDITOR.dialog.buttonDefinition} The removed button
1344
+ * definition.
1345
+ */
1346
+ removeButton : function( id )
1347
+ {
1348
+ removeById( this.buttons, id );
1349
+ }
1350
+ };
1351
+
1352
+ /**
1353
+ * This class is not really part of the API. It is the template of the
1354
+ * objects representing content pages inside the
1355
+ * CKEDITOR.dialog.dialogDefinitionObject.
1356
+ * @constructor
1357
+ * @name CKEDITOR.dialog.contentDefinitionObject
1358
+ * @example
1359
+ * CKEDITOR.on( 'dialogDefinition', function( evt )
1360
+ * {
1361
+ * var definition = evt.data.definition;
1362
+ * var content = definition.getContents( 'page1' );
1363
+ * content.remove( 'textInput1' );
1364
+ * ...
1365
+ * } );
1366
+ */
1367
+ function contentObject( dialog, contentDefinition )
1368
+ {
1369
+ this._ =
1370
+ {
1371
+ dialog : dialog
1372
+ };
1373
+
1374
+ CKEDITOR.tools.extend( this, contentDefinition );
1375
+ }
1376
+
1377
+ contentObject.prototype =
1378
+ /** @lends CKEDITOR.dialog.contentDefinitionObject.prototype */
1379
+ {
1380
+ /**
1381
+ * Gets a UI element definition under the content definition.
1382
+ * @param {String} id The id of the UI element definition.
1383
+ * @returns {CKEDITOR.dialog.uiElementDefinition}
1384
+ */
1385
+ get : function( id )
1386
+ {
1387
+ return getById( this.elements, id, 'children' );
1388
+ },
1389
+
1390
+ /**
1391
+ * Adds a UI element definition to the content definition.
1392
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition The
1393
+ * UI elemnet definition to be added.
1394
+ * @param {String} nextSiblingId The id of an existing UI element
1395
+ * definition which the new UI element definition will be inserted
1396
+ * before. Omit if the new button definition is to be inserted as
1397
+ * the last item.
1398
+ * @returns {CKEDITOR.dialog.uiElementDefinition} The element
1399
+ * definition inserted.
1400
+ */
1401
+ add : function( elementDefinition, nextSiblingId )
1402
+ {
1403
+ return addById( this.elements, elementDefinition, nextSiblingId, 'children' );
1404
+ },
1405
+
1406
+ /**
1407
+ * Removes a UI element definition from the content definition.
1408
+ * @param {String} id The id of the UI element definition to be
1409
+ * removed.
1410
+ * @returns {CKEDITOR.dialog.uiElementDefinition} The element
1411
+ * definition removed.
1412
+ * @example
1413
+ */
1414
+ remove : function( id )
1415
+ {
1416
+ removeById( this.elements, id, 'children' );
1417
+ }
1418
+ };
1419
+
1420
+ function initDragAndDrop( dialog )
1421
+ {
1422
+ var lastCoords = null,
1423
+ abstractDialogCoords = null,
1424
+ element = dialog.getElement().getFirst(),
1425
+ editor = dialog.getParentEditor(),
1426
+ magnetDistance = editor.config.dialog_magnetDistance,
1427
+ margins = skinData[ editor.skinName ].margins || [ 0, 0, 0, 0 ];
1428
+
1429
+ function mouseMoveHandler( evt )
1430
+ {
1431
+ var dialogSize = dialog.getSize(),
1432
+ viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
1433
+ x = evt.data.$.screenX,
1434
+ y = evt.data.$.screenY,
1435
+ dx = x - lastCoords.x,
1436
+ dy = y - lastCoords.y,
1437
+ realX, realY;
1438
+
1439
+ lastCoords = { x : x, y : y };
1440
+ abstractDialogCoords.x += dx;
1441
+ abstractDialogCoords.y += dy;
1442
+
1443
+ if ( abstractDialogCoords.x + margins[3] < magnetDistance )
1444
+ realX = - margins[3];
1445
+ else if ( abstractDialogCoords.x - margins[1] > viewPaneSize.width - dialogSize.width - magnetDistance )
1446
+ realX = viewPaneSize.width - dialogSize.width + margins[1];
1447
+ else
1448
+ realX = abstractDialogCoords.x;
1449
+
1450
+ if ( abstractDialogCoords.y + margins[0] < magnetDistance )
1451
+ realY = - margins[0];
1452
+ else if ( abstractDialogCoords.y - margins[2] > viewPaneSize.height - dialogSize.height - magnetDistance )
1453
+ realY = viewPaneSize.height - dialogSize.height + margins[2];
1454
+ else
1455
+ realY = abstractDialogCoords.y;
1456
+
1457
+ dialog.move( realX, realY );
1458
+
1459
+ evt.data.preventDefault();
1460
+ }
1461
+
1462
+ function mouseUpHandler( evt )
1463
+ {
1464
+ CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
1465
+ CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
1466
+
1467
+ if ( CKEDITOR.env.ie6Compat )
1468
+ {
1469
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1470
+ coverDoc.removeListener( 'mousemove', mouseMoveHandler );
1471
+ coverDoc.removeListener( 'mouseup', mouseUpHandler );
1472
+ }
1473
+ }
1474
+
1475
+ dialog.parts.title.on( 'mousedown', function( evt )
1476
+ {
1477
+ dialog._.updateSize = true;
1478
+
1479
+ lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
1480
+
1481
+ CKEDITOR.document.on( 'mousemove', mouseMoveHandler );
1482
+ CKEDITOR.document.on( 'mouseup', mouseUpHandler );
1483
+ abstractDialogCoords = dialog.getPosition();
1484
+
1485
+ if ( CKEDITOR.env.ie6Compat )
1486
+ {
1487
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1488
+ coverDoc.on( 'mousemove', mouseMoveHandler );
1489
+ coverDoc.on( 'mouseup', mouseUpHandler );
1490
+ }
1491
+
1492
+ evt.data.preventDefault();
1493
+ }, dialog );
1494
+ }
1495
+
1496
+ function initResizeHandles( dialog )
1497
+ {
1498
+ var definition = dialog.definition,
1499
+ minWidth = definition.minWidth || 0,
1500
+ minHeight = definition.minHeight || 0,
1501
+ resizable = definition.resizable,
1502
+ margins = skinData[ dialog.getParentEditor().skinName ].margins || [ 0, 0, 0, 0 ];
1503
+
1504
+ function topSizer( coords, dy )
1505
+ {
1506
+ coords.y += dy;
1507
+ }
1508
+
1509
+ function rightSizer( coords, dx )
1510
+ {
1511
+ coords.x2 += dx;
1512
+ }
1513
+
1514
+ function bottomSizer( coords, dy )
1515
+ {
1516
+ coords.y2 += dy;
1517
+ }
1518
+
1519
+ function leftSizer( coords, dx )
1520
+ {
1521
+ coords.x += dx;
1522
+ }
1523
+
1524
+ var lastCoords = null,
1525
+ abstractDialogCoords = null,
1526
+ magnetDistance = dialog._.editor.config.magnetDistance,
1527
+ parts = [ 'tl', 't', 'tr', 'l', 'r', 'bl', 'b', 'br' ];
1528
+
1529
+ function mouseDownHandler( evt )
1530
+ {
1531
+ var partName = evt.listenerData.part, size = dialog.getSize();
1532
+ abstractDialogCoords = dialog.getPosition();
1533
+ CKEDITOR.tools.extend( abstractDialogCoords,
1534
+ {
1535
+ x2 : abstractDialogCoords.x + size.width,
1536
+ y2 : abstractDialogCoords.y + size.height
1537
+ } );
1538
+ lastCoords = { x : evt.data.$.screenX, y : evt.data.$.screenY };
1539
+
1540
+ CKEDITOR.document.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
1541
+ CKEDITOR.document.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
1542
+
1543
+ if ( CKEDITOR.env.ie6Compat )
1544
+ {
1545
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1546
+ coverDoc.on( 'mousemove', mouseMoveHandler, dialog, { part : partName } );
1547
+ coverDoc.on( 'mouseup', mouseUpHandler, dialog, { part : partName } );
1548
+ }
1549
+
1550
+ evt.data.preventDefault();
1551
+ }
1552
+
1553
+ function mouseMoveHandler( evt )
1554
+ {
1555
+ var x = evt.data.$.screenX,
1556
+ y = evt.data.$.screenY,
1557
+ dx = x - lastCoords.x,
1558
+ dy = y - lastCoords.y,
1559
+ viewPaneSize = CKEDITOR.document.getWindow().getViewPaneSize(),
1560
+ partName = evt.listenerData.part;
1561
+
1562
+ if ( partName.search( 't' ) != -1 )
1563
+ topSizer( abstractDialogCoords, dy );
1564
+ if ( partName.search( 'l' ) != -1 )
1565
+ leftSizer( abstractDialogCoords, dx );
1566
+ if ( partName.search( 'b' ) != -1 )
1567
+ bottomSizer( abstractDialogCoords, dy );
1568
+ if ( partName.search( 'r' ) != -1 )
1569
+ rightSizer( abstractDialogCoords, dx );
1570
+
1571
+ lastCoords = { x : x, y : y };
1572
+
1573
+ var realX, realY, realX2, realY2;
1574
+
1575
+ if ( abstractDialogCoords.x + margins[3] < magnetDistance )
1576
+ realX = - margins[3];
1577
+ else if ( partName.search( 'l' ) != -1 && abstractDialogCoords.x2 - abstractDialogCoords.x < minWidth + magnetDistance )
1578
+ realX = abstractDialogCoords.x2 - minWidth;
1579
+ else
1580
+ realX = abstractDialogCoords.x;
1581
+
1582
+ if ( abstractDialogCoords.y + margins[0] < magnetDistance )
1583
+ realY = - margins[0];
1584
+ else if ( partName.search( 't' ) != -1 && abstractDialogCoords.y2 - abstractDialogCoords.y < minHeight + magnetDistance )
1585
+ realY = abstractDialogCoords.y2 - minHeight;
1586
+ else
1587
+ realY = abstractDialogCoords.y;
1588
+
1589
+ if ( abstractDialogCoords.x2 - margins[1] > viewPaneSize.width - magnetDistance )
1590
+ realX2 = viewPaneSize.width + margins[1] ;
1591
+ else if ( partName.search( 'r' ) != -1 && abstractDialogCoords.x2 - abstractDialogCoords.x < minWidth + magnetDistance )
1592
+ realX2 = abstractDialogCoords.x + minWidth;
1593
+ else
1594
+ realX2 = abstractDialogCoords.x2;
1595
+
1596
+ if ( abstractDialogCoords.y2 - margins[2] > viewPaneSize.height - magnetDistance )
1597
+ realY2= viewPaneSize.height + margins[2] ;
1598
+ else if ( partName.search( 'b' ) != -1 && abstractDialogCoords.y2 - abstractDialogCoords.y < minHeight + magnetDistance )
1599
+ realY2 = abstractDialogCoords.y + minHeight;
1600
+ else
1601
+ realY2 = abstractDialogCoords.y2 ;
1602
+
1603
+ dialog.move( realX, realY );
1604
+ dialog.resize( realX2 - realX, realY2 - realY );
1605
+
1606
+ evt.data.preventDefault();
1607
+ }
1608
+
1609
+ function mouseUpHandler( evt )
1610
+ {
1611
+ CKEDITOR.document.removeListener( 'mouseup', mouseUpHandler );
1612
+ CKEDITOR.document.removeListener( 'mousemove', mouseMoveHandler );
1613
+
1614
+ if ( CKEDITOR.env.ie6Compat )
1615
+ {
1616
+ var coverDoc = coverElement.getChild( 0 ).getFrameDocument();
1617
+ coverDoc.removeListener( 'mouseup', mouseUpHandler );
1618
+ coverDoc.removeListener( 'mousemove', mouseMoveHandler );
1619
+ }
1620
+ }
1621
+
1622
+ // TODO : Simplify the resize logic, having just a single resize grip <div>.
1623
+ // var widthTest = /[lr]/,
1624
+ // heightTest = /[tb]/;
1625
+ // for ( var i = 0 ; i < parts.length ; i++ )
1626
+ // {
1627
+ // var element = dialog.parts[ parts[i] + '_resize' ];
1628
+ // if ( resizable == CKEDITOR.DIALOG_RESIZE_NONE ||
1629
+ // resizable == CKEDITOR.DIALOG_RESIZE_HEIGHT && widthTest.test( parts[i] ) ||
1630
+ // resizable == CKEDITOR.DIALOG_RESIZE_WIDTH && heightTest.test( parts[i] ) )
1631
+ // {
1632
+ // element.hide();
1633
+ // continue;
1634
+ // }
1635
+ // element.on( 'mousedown', mouseDownHandler, dialog, { part : parts[i] } );
1636
+ // }
1637
+ }
1638
+
1639
+ var resizeCover;
1640
+ var coverElement;
1641
+
1642
+ var addCover = function( editor )
1643
+ {
1644
+ var win = CKEDITOR.document.getWindow();
1645
+
1646
+ if ( !coverElement )
1647
+ {
1648
+ var html = [
1649
+ '<div style="position: ', ( CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed' ),
1650
+ '; z-index: ', editor.config.baseFloatZIndex,
1651
+ '; top: 0px; left: 0px; ',
1652
+ 'background-color: ', editor.config.dialog_backgroundCoverColor,
1653
+ '" id="cke_dialog_background_cover">'
1654
+ ];
1655
+
1656
+
1657
+ if ( CKEDITOR.env.ie6Compat )
1658
+ {
1659
+ // Support for custom document.domain in IE.
1660
+ var isCustomDomain = CKEDITOR.env.isCustomDomain();
1661
+
1662
+ html.push(
1663
+ '<iframe' +
1664
+ ' hidefocus="true"' +
1665
+ ' frameborder="0"' +
1666
+ ' id="cke_dialog_background_iframe"' +
1667
+ ' src="javascript:' );
1668
+
1669
+ html.push(
1670
+ isCustomDomain ?
1671
+ 'void((function(){' +
1672
+ 'document.open();' +
1673
+ 'document.domain=\'' + document.domain + '\';' +
1674
+ 'document.close();' +
1675
+ '})())'
1676
+ :
1677
+ '\'\'' );
1678
+
1679
+ html.push(
1680
+ '"' +
1681
+ ' style="' +
1682
+ 'position:absolute;' +
1683
+ 'left:0;' +
1684
+ 'top:0;' +
1685
+ 'width:100%;' +
1686
+ 'height: 100%;' +
1687
+ 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)">' +
1688
+ '</iframe>' );
1689
+ }
1690
+
1691
+ html.push( '</div>' );
1692
+
1693
+ coverElement = CKEDITOR.dom.element.createFromHtml( html.join( '' ) );
1694
+ }
1695
+
1696
+ var element = coverElement;
1697
+
1698
+ var resizeFunc = function()
1699
+ {
1700
+ var size = win.getViewPaneSize();
1701
+ element.setStyles(
1702
+ {
1703
+ width : size.width + 'px',
1704
+ height : size.height + 'px'
1705
+ } );
1706
+ };
1707
+
1708
+ var scrollFunc = function()
1709
+ {
1710
+ var pos = win.getScrollPosition(),
1711
+ cursor = CKEDITOR.dialog._.currentTop;
1712
+ element.setStyles(
1713
+ {
1714
+ left : pos.x + 'px',
1715
+ top : pos.y + 'px'
1716
+ });
1717
+
1718
+ do
1719
+ {
1720
+ var dialogPos = cursor.getPosition();
1721
+ cursor.move( dialogPos.x, dialogPos.y );
1722
+ } while( ( cursor = cursor._.parentDialog ) );
1723
+ };
1724
+
1725
+ resizeCover = resizeFunc;
1726
+ win.on( 'resize', resizeFunc );
1727
+ resizeFunc();
1728
+ if ( CKEDITOR.env.ie6Compat )
1729
+ {
1730
+ // IE BUG: win.$.onscroll assignment doesn't work.. it must be window.onscroll.
1731
+ // So we need to invent a really funny way to make it work.
1732
+ var myScrollHandler = function()
1733
+ {
1734
+ scrollFunc();
1735
+ arguments.callee.prevScrollHandler.apply( this, arguments );
1736
+ };
1737
+ win.$.setTimeout( function()
1738
+ {
1739
+ myScrollHandler.prevScrollHandler = window.onscroll || function(){};
1740
+ window.onscroll = myScrollHandler;
1741
+ }, 0 );
1742
+ scrollFunc();
1743
+ }
1744
+ element.setOpacity( editor.config.dialog_backgroundCoverOpacity );
1745
+ element.appendTo( CKEDITOR.document.getBody() );
1746
+ };
1747
+
1748
+ var removeCover = function()
1749
+ {
1750
+ if ( !coverElement )
1751
+ return;
1752
+
1753
+ var win = CKEDITOR.document.getWindow();
1754
+ coverElement.remove();
1755
+ win.removeListener( 'resize', resizeCover );
1756
+
1757
+ if ( CKEDITOR.env.ie6Compat )
1758
+ {
1759
+ win.$.setTimeout( function()
1760
+ {
1761
+ var prevScrollHandler = window.onscroll && window.onscroll.prevScrollHandler;
1762
+ window.onscroll = prevScrollHandler || null;
1763
+ }, 0 );
1764
+ }
1765
+ resizeCover = null;
1766
+ };
1767
+
1768
+ var accessKeyProcessors = {};
1769
+
1770
+ var accessKeyDownHandler = function( evt )
1771
+ {
1772
+ var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey,
1773
+ alt = evt.data.$.altKey,
1774
+ shift = evt.data.$.shiftKey,
1775
+ key = String.fromCharCode( evt.data.$.keyCode ),
1776
+ keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];
1777
+
1778
+ if ( !keyProcessor || !keyProcessor.length )
1779
+ return;
1780
+
1781
+ keyProcessor = keyProcessor[keyProcessor.length - 1];
1782
+ keyProcessor.keydown && keyProcessor.keydown.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key );
1783
+ evt.data.preventDefault();
1784
+ };
1785
+
1786
+ var accessKeyUpHandler = function( evt )
1787
+ {
1788
+ var ctrl = evt.data.$.ctrlKey || evt.data.$.metaKey,
1789
+ alt = evt.data.$.altKey,
1790
+ shift = evt.data.$.shiftKey,
1791
+ key = String.fromCharCode( evt.data.$.keyCode ),
1792
+ keyProcessor = accessKeyProcessors[( ctrl ? 'CTRL+' : '' ) + ( alt ? 'ALT+' : '') + ( shift ? 'SHIFT+' : '' ) + key];
1793
+
1794
+ if ( !keyProcessor || !keyProcessor.length )
1795
+ return;
1796
+
1797
+ keyProcessor = keyProcessor[keyProcessor.length - 1];
1798
+ keyProcessor.keyup && keyProcessor.keyup.call( keyProcessor.uiElement, keyProcessor.dialog, keyProcessor.key );
1799
+ evt.data.preventDefault();
1800
+ };
1801
+
1802
+ var registerAccessKey = function( uiElement, dialog, key, downFunc, upFunc )
1803
+ {
1804
+ var procList = accessKeyProcessors[key] || ( accessKeyProcessors[key] = [] );
1805
+ procList.push( {
1806
+ uiElement : uiElement,
1807
+ dialog : dialog,
1808
+ key : key,
1809
+ keyup : upFunc || uiElement.accessKeyUp,
1810
+ keydown : downFunc || uiElement.accessKeyDown
1811
+ } );
1812
+ };
1813
+
1814
+ var unregisterAccessKey = function( obj )
1815
+ {
1816
+ for ( var i in accessKeyProcessors )
1817
+ {
1818
+ var list = accessKeyProcessors[i];
1819
+ for ( var j = list.length - 1 ; j >= 0 ; j-- )
1820
+ {
1821
+ if ( list[j].dialog == obj || list[j].uiElement == obj )
1822
+ list.splice( j, 1 );
1823
+ }
1824
+ if ( list.length === 0 )
1825
+ delete accessKeyProcessors[i];
1826
+ }
1827
+ };
1828
+
1829
+ var tabAccessKeyUp = function( dialog, key )
1830
+ {
1831
+ if ( dialog._.accessKeyMap[key] )
1832
+ dialog.selectPage( dialog._.accessKeyMap[key] );
1833
+ };
1834
+
1835
+ var tabAccessKeyDown = function( dialog, key )
1836
+ {
1837
+ };
1838
+
1839
+ (function()
1840
+ {
1841
+ CKEDITOR.ui.dialog =
1842
+ {
1843
+ /**
1844
+ * The base class of all dialog UI elements.
1845
+ * @constructor
1846
+ * @param {CKEDITOR.dialog} dialog Parent dialog object.
1847
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element
1848
+ * definition. Accepted fields:
1849
+ * <ul>
1850
+ * <li><strong>id</strong> (Required) The id of the UI element. See {@link
1851
+ * CKEDITOR.dialog#getContentElement}</li>
1852
+ * <li><strong>type</strong> (Required) The type of the UI element. The
1853
+ * value to this field specifies which UI element class will be used to
1854
+ * generate the final widget.</li>
1855
+ * <li><strong>title</strong> (Optional) The popup tooltip for the UI
1856
+ * element.</li>
1857
+ * <li><strong>hidden</strong> (Optional) A flag that tells if the element
1858
+ * should be initially visible.</li>
1859
+ * <li><strong>className</strong> (Optional) Additional CSS class names
1860
+ * to add to the UI element. Separated by space.</li>
1861
+ * <li><strong>style</strong> (Optional) Additional CSS inline styles
1862
+ * to add to the UI element. A semicolon (;) is required after the last
1863
+ * style declaration.</li>
1864
+ * <li><strong>accessKey</strong> (Optional) The alphanumeric access key
1865
+ * for this element. Access keys are automatically prefixed by CTRL.</li>
1866
+ * <li><strong>on*</strong> (Optional) Any UI element definition field that
1867
+ * starts with <em>on</em> followed immediately by a capital letter and
1868
+ * probably more letters is an event handler. Event handlers may be further
1869
+ * divided into registered event handlers and DOM event handlers. Please
1870
+ * refer to {@link CKEDITOR.ui.dialog.uiElement#registerEvents} and
1871
+ * {@link CKEDITOR.ui.dialog.uiElement#eventProcessors} for more
1872
+ * information.</li>
1873
+ * </ul>
1874
+ * @param {Array} htmlList
1875
+ * List of HTML code to be added to the dialog's content area.
1876
+ * @param {Function|String} nodeNameArg
1877
+ * A function returning a string, or a simple string for the node name for
1878
+ * the root DOM node. Default is 'div'.
1879
+ * @param {Function|Object} stylesArg
1880
+ * A function returning an object, or a simple object for CSS styles applied
1881
+ * to the DOM node. Default is empty object.
1882
+ * @param {Function|Object} attributesArg
1883
+ * A fucntion returning an object, or a simple object for attributes applied
1884
+ * to the DOM node. Default is empty object.
1885
+ * @param {Function|String} contentsArg
1886
+ * A function returning a string, or a simple string for the HTML code inside
1887
+ * the root DOM node. Default is empty string.
1888
+ * @example
1889
+ */
1890
+ uiElement : function( dialog, elementDefinition, htmlList, nodeNameArg, stylesArg, attributesArg, contentsArg )
1891
+ {
1892
+ if ( arguments.length < 4 )
1893
+ return;
1894
+
1895
+ var nodeName = ( nodeNameArg.call ? nodeNameArg( elementDefinition ) : nodeNameArg ) || 'div',
1896
+ html = [ '<', nodeName, ' ' ],
1897
+ styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {},
1898
+ attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {},
1899
+ innerHTML = ( contentsArg && contentsArg.call ? contentsArg( dialog, elementDefinition ) : contentsArg ) || '',
1900
+ domId = this.domId = attributes.id || CKEDITOR.tools.getNextNumber() + '_uiElement',
1901
+ id = this.id = elementDefinition.id,
1902
+ i;
1903
+
1904
+ // Set the id, a unique id is required for getElement() to work.
1905
+ attributes.id = domId;
1906
+
1907
+ // Set the type and definition CSS class names.
1908
+ var classes = {};
1909
+ if ( elementDefinition.type )
1910
+ classes[ 'cke_dialog_ui_' + elementDefinition.type ] = 1;
1911
+ if ( elementDefinition.className )
1912
+ classes[ elementDefinition.className ] = 1;
1913
+ var attributeClasses = ( attributes['class'] && attributes['class'].split ) ? attributes['class'].split( ' ' ) : [];
1914
+ for ( i = 0 ; i < attributeClasses.length ; i++ )
1915
+ {
1916
+ if ( attributeClasses[i] )
1917
+ classes[ attributeClasses[i] ] = 1;
1918
+ }
1919
+ var finalClasses = [];
1920
+ for ( i in classes )
1921
+ finalClasses.push( i );
1922
+ attributes['class'] = finalClasses.join( ' ' );
1923
+
1924
+ // Set the popup tooltop.
1925
+ if ( elementDefinition.title )
1926
+ attributes.title = elementDefinition.title;
1927
+
1928
+ // Write the inline CSS styles.
1929
+ var styleStr = ( elementDefinition.style || '' ).split( ';' );
1930
+ for ( i in styles )
1931
+ styleStr.push( i + ':' + styles[i] );
1932
+ if ( elementDefinition.hidden )
1933
+ styleStr.push( 'display:none' );
1934
+ for ( i = styleStr.length - 1 ; i >= 0 ; i-- )
1935
+ {
1936
+ if ( styleStr[i] === '' )
1937
+ styleStr.splice( i, 1 );
1938
+ }
1939
+ if ( styleStr.length > 0 )
1940
+ attributes.style = ( attributes.style ? ( attributes.style + '; ' ) : '' ) + styleStr.join( '; ' );
1941
+
1942
+ // Write the attributes.
1943
+ for ( i in attributes )
1944
+ html.push( i + '="' + CKEDITOR.tools.htmlEncode( attributes[i] ) + '" ');
1945
+
1946
+ // Write the content HTML.
1947
+ html.push( '>', innerHTML, '</', nodeName, '>' );
1948
+
1949
+ // Add contents to the parent HTML array.
1950
+ htmlList.push( html.join( '' ) );
1951
+
1952
+ ( this._ || ( this._ = {} ) ).dialog = dialog;
1953
+
1954
+ // Override isChanged if it is defined in element definition.
1955
+ if ( typeof( elementDefinition.isChanged ) == 'boolean' )
1956
+ this.isChanged = function(){ return elementDefinition.isChanged; };
1957
+ if ( typeof( elementDefinition.isChanged ) == 'function' )
1958
+ this.isChanged = elementDefinition.isChanged;
1959
+
1960
+ // Add events.
1961
+ CKEDITOR.event.implementOn( this );
1962
+
1963
+ this.registerEvents( elementDefinition );
1964
+ if ( this.accessKeyUp && this.accessKeyDown && elementDefinition.accessKey )
1965
+ registerAccessKey( this, dialog, 'CTRL+' + elementDefinition.accessKey );
1966
+
1967
+ var me = this;
1968
+ dialog.on( 'load', function()
1969
+ {
1970
+ if ( me.getInputElement() )
1971
+ {
1972
+ me.getInputElement().on( 'focus', function()
1973
+ {
1974
+ dialog._.tabBarMode = false;
1975
+ dialog._.hasFocus = true;
1976
+ me.fire( 'focus' );
1977
+ }, me );
1978
+ }
1979
+ } );
1980
+
1981
+ // Register the object as a tab focus if it can be included.
1982
+ if ( this.keyboardFocusable )
1983
+ {
1984
+ this.focusIndex = dialog._.focusList.push( this ) - 1;
1985
+ this.on( 'focus', function()
1986
+ {
1987
+ dialog._.currentFocusIndex = me.focusIndex;
1988
+ } );
1989
+ }
1990
+
1991
+ // Completes this object with everything we have in the
1992
+ // definition.
1993
+ CKEDITOR.tools.extend( this, elementDefinition );
1994
+ },
1995
+
1996
+ /**
1997
+ * Horizontal layout box for dialog UI elements, auto-expends to available width of container.
1998
+ * @constructor
1999
+ * @extends CKEDITOR.ui.dialog.uiElement
2000
+ * @param {CKEDITOR.dialog} dialog
2001
+ * Parent dialog object.
2002
+ * @param {Array} childObjList
2003
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
2004
+ * container.
2005
+ * @param {Array} childHtmlList
2006
+ * Array of HTML code that correspond to the HTML output of all the
2007
+ * objects in childObjList.
2008
+ * @param {Array} htmlList
2009
+ * Array of HTML code that this element will output to.
2010
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
2011
+ * The element definition. Accepted fields:
2012
+ * <ul>
2013
+ * <li><strong>widths</strong> (Optional) The widths of child cells.</li>
2014
+ * <li><strong>height</strong> (Optional) The height of the layout.</li>
2015
+ * <li><strong>padding</strong> (Optional) The padding width inside child
2016
+ * cells.</li>
2017
+ * <li><strong>align</strong> (Optional) The alignment of the whole layout
2018
+ * </li>
2019
+ * </ul>
2020
+ * @example
2021
+ */
2022
+ hbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
2023
+ {
2024
+ if ( arguments.length < 4 )
2025
+ return;
2026
+
2027
+ this._ || ( this._ = {} );
2028
+
2029
+ var children = this._.children = childObjList,
2030
+ widths = elementDefinition && elementDefinition.widths || null,
2031
+ height = elementDefinition && elementDefinition.height || null,
2032
+ styles = {},
2033
+ i;
2034
+ /** @ignore */
2035
+ var innerHTML = function()
2036
+ {
2037
+ var html = [ '<tbody><tr class="cke_dialog_ui_hbox">' ];
2038
+ for ( i = 0 ; i < childHtmlList.length ; i++ )
2039
+ {
2040
+ var className = 'cke_dialog_ui_hbox_child',
2041
+ styles = [];
2042
+ if ( i === 0 )
2043
+ className = 'cke_dialog_ui_hbox_first';
2044
+ if ( i == childHtmlList.length - 1 )
2045
+ className = 'cke_dialog_ui_hbox_last';
2046
+ html.push( '<td class="', className, '" ' );
2047
+ if ( widths )
2048
+ {
2049
+ if ( widths[i] )
2050
+ styles.push( 'width:' + CKEDITOR.tools.cssLength( widths[i] ) );
2051
+ }
2052
+ else
2053
+ styles.push( 'width:' + Math.floor( 100 / childHtmlList.length ) + '%' );
2054
+ if ( height )
2055
+ styles.push( 'height:' + CKEDITOR.tools.cssLength( height ) );
2056
+ if ( elementDefinition && elementDefinition.padding != undefined )
2057
+ styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) );
2058
+ if ( styles.length > 0 )
2059
+ html.push( 'style="' + styles.join('; ') + '" ' );
2060
+ html.push( '>', childHtmlList[i], '</td>' );
2061
+ }
2062
+ html.push( '</tr></tbody>' );
2063
+ return html.join( '' );
2064
+ };
2065
+
2066
+ CKEDITOR.ui.dialog.uiElement.call(
2067
+ this,
2068
+ dialog,
2069
+ elementDefinition || { type : 'hbox' },
2070
+ htmlList,
2071
+ 'table',
2072
+ styles,
2073
+ elementDefinition && elementDefinition.align && { align : elementDefinition.align } || null,
2074
+ innerHTML );
2075
+ },
2076
+
2077
+ /**
2078
+ * Vertical layout box for dialog UI elements.
2079
+ * @constructor
2080
+ * @extends CKEDITOR.ui.dialog.hbox
2081
+ * @param {CKEDITOR.dialog} dialog
2082
+ * Parent dialog object.
2083
+ * @param {Array} childObjList
2084
+ * Array of {@link CKEDITOR.ui.dialog.uiElement} objects inside this
2085
+ * container.
2086
+ * @param {Array} childHtmlList
2087
+ * Array of HTML code that correspond to the HTML output of all the
2088
+ * objects in childObjList.
2089
+ * @param {Array} htmlList
2090
+ * Array of HTML code that this element will output to.
2091
+ * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
2092
+ * The element definition. Accepted fields:
2093
+ * <ul>
2094
+ * <li><strong>width</strong> (Optional) The width of the layout.</li>
2095
+ * <li><strong>heights</strong> (Optional) The heights of individual cells.
2096
+ * </li>
2097
+ * <li><strong>align</strong> (Optional) The alignment of the layout.</li>
2098
+ * <li><strong>padding</strong> (Optional) The padding width inside child
2099
+ * cells.</li>
2100
+ * <li><strong>expand</strong> (Optional) Whether the layout should expand
2101
+ * vertically to fill its container.</li>
2102
+ * </ul>
2103
+ * @example
2104
+ */
2105
+ vbox : function( dialog, childObjList, childHtmlList, htmlList, elementDefinition )
2106
+ {
2107
+ if (arguments.length < 3 )
2108
+ return;
2109
+
2110
+ this._ || ( this._ = {} );
2111
+
2112
+ var children = this._.children = childObjList,
2113
+ width = elementDefinition && elementDefinition.width || null,
2114
+ heights = elementDefinition && elementDefinition.heights || null;
2115
+ /** @ignore */
2116
+ var innerHTML = function()
2117
+ {
2118
+ var html = [ '<table cellspacing="0" border="0" ' ];
2119
+ html.push( 'style="' );
2120
+ if ( elementDefinition && elementDefinition.expand )
2121
+ html.push( 'height:100%;' );
2122
+ html.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ), ';' );
2123
+ html.push( '"' );
2124
+ html.push( 'align="', CKEDITOR.tools.htmlEncode(
2125
+ ( elementDefinition && elementDefinition.align ) || ( dialog.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right' ) ), '" ' );
2126
+
2127
+ html.push( '><tbody>' );
2128
+ for ( var i = 0 ; i < childHtmlList.length ; i++ )
2129
+ {
2130
+ var styles = [];
2131
+ html.push( '<tr><td ' );
2132
+ if ( width )
2133
+ styles.push( 'width:' + CKEDITOR.tools.cssLength( width || '100%' ) );
2134
+ if ( heights )
2135
+ styles.push( 'height:' + CKEDITOR.tools.cssLength( heights[i] ) );
2136
+ else if ( elementDefinition && elementDefinition.expand )
2137
+ styles.push( 'height:' + Math.floor( 100 / childHtmlList.length ) + '%' );
2138
+ if ( elementDefinition && elementDefinition.padding != undefined )
2139
+ styles.push( 'padding:' + CKEDITOR.tools.cssLength( elementDefinition.padding ) );
2140
+ if ( styles.length > 0 )
2141
+ html.push( 'style="', styles.join( '; ' ), '" ' );
2142
+ html.push( ' class="cke_dialog_ui_vbox_child">', childHtmlList[i], '</td></tr>' );
2143
+ }
2144
+ html.push( '</tbody></table>' );
2145
+ return html.join( '' );
2146
+ };
2147
+ CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition || { type : 'vbox' }, htmlList, 'div', null, null, innerHTML );
2148
+ }
2149
+ };
2150
+ })();
2151
+
2152
+ CKEDITOR.ui.dialog.uiElement.prototype =
2153
+ {
2154
+ /**
2155
+ * Gets the root DOM element of this dialog UI object.
2156
+ * @returns {CKEDITOR.dom.element} Root DOM element of UI object.
2157
+ * @example
2158
+ * uiElement.getElement().hide();
2159
+ */
2160
+ getElement : function()
2161
+ {
2162
+ return CKEDITOR.document.getById( this.domId );
2163
+ },
2164
+
2165
+ /**
2166
+ * Gets the DOM element that the user inputs values.
2167
+ * This function is used by setValue(), getValue() and focus(). It should
2168
+ * be overrided in child classes where the input element isn't the root
2169
+ * element.
2170
+ * @returns {CKEDITOR.dom.element} The element where the user input values.
2171
+ * @example
2172
+ * var rawValue = textInput.getInputElement().$.value;
2173
+ */
2174
+ getInputElement : function()
2175
+ {
2176
+ return this.getElement();
2177
+ },
2178
+
2179
+ /**
2180
+ * Gets the parent dialog object containing this UI element.
2181
+ * @returns {CKEDITOR.dialog} Parent dialog object.
2182
+ * @example
2183
+ * var dialog = uiElement.getDialog();
2184
+ */
2185
+ getDialog : function()
2186
+ {
2187
+ return this._.dialog;
2188
+ },
2189
+
2190
+ /**
2191
+ * Sets the value of this dialog UI object.
2192
+ * @param {Object} value The new value.
2193
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2194
+ * @example
2195
+ * uiElement.setValue( 'Dingo' );
2196
+ */
2197
+ setValue : function( value )
2198
+ {
2199
+ this.getInputElement().setValue( value );
2200
+ this.fire( 'change', { value : value } );
2201
+ return this;
2202
+ },
2203
+
2204
+ /**
2205
+ * Gets the current value of this dialog UI object.
2206
+ * @returns {Object} The current value.
2207
+ * @example
2208
+ * var myValue = uiElement.getValue();
2209
+ */
2210
+ getValue : function()
2211
+ {
2212
+ return this.getInputElement().getValue();
2213
+ },
2214
+
2215
+ /**
2216
+ * Tells whether the UI object's value has changed.
2217
+ * @returns {Boolean} true if changed, false if not changed.
2218
+ * @example
2219
+ * if ( uiElement.isChanged() )
2220
+ * &nbsp;&nbsp;confirm( 'Value changed! Continue?' );
2221
+ */
2222
+ isChanged : function()
2223
+ {
2224
+ // Override in input classes.
2225
+ return false;
2226
+ },
2227
+
2228
+ /**
2229
+ * Selects the parent tab of this element. Usually called by focus() or overridden focus() methods.
2230
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2231
+ * @example
2232
+ * focus : function()
2233
+ * {
2234
+ * this.selectParentTab();
2235
+ * // do something else.
2236
+ * }
2237
+ */
2238
+ selectParentTab : function()
2239
+ {
2240
+ var element = this.getInputElement(),
2241
+ cursor = element,
2242
+ tabId;
2243
+ while ( ( cursor = cursor.getParent() ) && cursor.$.className.search( 'cke_dialog_page_contents' ) == -1 )
2244
+ { /*jsl:pass*/ }
2245
+
2246
+ // Some widgets don't have parent tabs (e.g. OK and Cancel buttons).
2247
+ if ( !cursor )
2248
+ return this;
2249
+
2250
+ tabId = cursor.getAttribute( 'name' );
2251
+ // Avoid duplicate select.
2252
+ if ( this._.dialog._.currentTabId != tabId )
2253
+ this._.dialog.selectPage( tabId );
2254
+ return this;
2255
+ },
2256
+
2257
+ /**
2258
+ * Puts the focus to the UI object. Switches tabs if the UI object isn't in the active tab page.
2259
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2260
+ * @example
2261
+ * uiElement.focus();
2262
+ */
2263
+ focus : function()
2264
+ {
2265
+ this.selectParentTab().getInputElement().focus();
2266
+ return this;
2267
+ },
2268
+
2269
+ /**
2270
+ * Registers the on* event handlers defined in the element definition.
2271
+ * The default behavior of this function is:
2272
+ * <ol>
2273
+ * <li>
2274
+ * If the on* event is defined in the class's eventProcesors list,
2275
+ * then the registration is delegated to the corresponding function
2276
+ * in the eventProcessors list.
2277
+ * </li>
2278
+ * <li>
2279
+ * If the on* event is not defined in the eventProcessors list, then
2280
+ * register the event handler under the corresponding DOM event of
2281
+ * the UI element's input DOM element (as defined by the return value
2282
+ * of {@link CKEDITOR.ui.dialog.uiElement#getInputElement}).
2283
+ * </li>
2284
+ * </ol>
2285
+ * This function is only called at UI element instantiation, but can
2286
+ * be overridded in child classes if they require more flexibility.
2287
+ * @param {CKEDITOR.dialog.uiElementDefinition} definition The UI element
2288
+ * definition.
2289
+ * @returns {CKEDITOR.dialog.uiElement} The current UI element.
2290
+ * @example
2291
+ */
2292
+ registerEvents : function( definition )
2293
+ {
2294
+ var regex = /^on([A-Z]\w+)/,
2295
+ match;
2296
+
2297
+ var registerDomEvent = function( uiElement, dialog, eventName, func )
2298
+ {
2299
+ dialog.on( 'load', function()
2300
+ {
2301
+ uiElement.getInputElement().on( eventName, func, uiElement );
2302
+ });
2303
+ };
2304
+
2305
+ for ( var i in definition )
2306
+ {
2307
+ if ( !( match = i.match( regex ) ) )
2308
+ continue;
2309
+ if ( this.eventProcessors[i] )
2310
+ this.eventProcessors[i].call( this, this._.dialog, definition[i] );
2311
+ else
2312
+ registerDomEvent( this, this._.dialog, match[1].toLowerCase(), definition[i] );
2313
+ }
2314
+
2315
+ return this;
2316
+ },
2317
+
2318
+ /**
2319
+ * The event processor list used by
2320
+ * {@link CKEDITOR.ui.dialog.uiElement#getInputElement} at UI element
2321
+ * instantiation. The default list defines three on* events:
2322
+ * <ol>
2323
+ * <li>onLoad - Called when the element's parent dialog opens for the
2324
+ * first time</li>
2325
+ * <li>onShow - Called whenever the element's parent dialog opens.</li>
2326
+ * <li>onHide - Called whenever the element's parent dialog closes.</li>
2327
+ * </ol>
2328
+ * @field
2329
+ * @type Object
2330
+ * @example
2331
+ * // This connects the 'click' event in CKEDITOR.ui.dialog.button to onClick
2332
+ * // handlers in the UI element's definitions.
2333
+ * CKEDITOR.ui.dialog.button.eventProcessors = CKEDITOR.tools.extend( {},
2334
+ * &nbsp;&nbsp;CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
2335
+ * &nbsp;&nbsp;{ onClick : function( dialog, func ) { this.on( 'click', func ); } },
2336
+ * &nbsp;&nbsp;true );
2337
+ */
2338
+ eventProcessors :
2339
+ {
2340
+ onLoad : function( dialog, func )
2341
+ {
2342
+ dialog.on( 'load', func, this );
2343
+ },
2344
+
2345
+ onShow : function( dialog, func )
2346
+ {
2347
+ dialog.on( 'show', func, this );
2348
+ },
2349
+
2350
+ onHide : function( dialog, func )
2351
+ {
2352
+ dialog.on( 'hide', func, this );
2353
+ }
2354
+ },
2355
+
2356
+ /**
2357
+ * The default handler for a UI element's access key down event, which
2358
+ * tries to put focus to the UI element.<br />
2359
+ * Can be overridded in child classes for more sophisticaed behavior.
2360
+ * @param {CKEDITOR.dialog} dialog The parent dialog object.
2361
+ * @param {String} key The key combination pressed. Since access keys
2362
+ * are defined to always include the CTRL key, its value should always
2363
+ * include a 'CTRL+' prefix.
2364
+ * @example
2365
+ */
2366
+ accessKeyDown : function( dialog, key )
2367
+ {
2368
+ this.focus();
2369
+ },
2370
+
2371
+ /**
2372
+ * The default handler for a UI element's access key up event, which
2373
+ * does nothing.<br />
2374
+ * Can be overridded in child classes for more sophisticated behavior.
2375
+ * @param {CKEDITOR.dialog} dialog The parent dialog object.
2376
+ * @param {String} key The key combination pressed. Since access keys
2377
+ * are defined to always include the CTRL key, its value should always
2378
+ * include a 'CTRL+' prefix.
2379
+ * @example
2380
+ */
2381
+ accessKeyUp : function( dialog, key )
2382
+ {
2383
+ },
2384
+
2385
+ /**
2386
+ * Disables a UI element.
2387
+ * @example
2388
+ */
2389
+ disable : function()
2390
+ {
2391
+ var element = this.getInputElement();
2392
+ element.setAttribute( 'disabled', 'true' );
2393
+ element.addClass( 'cke_disabled' );
2394
+ },
2395
+
2396
+ /**
2397
+ * Enables a UI element.
2398
+ * @example
2399
+ */
2400
+ enable : function()
2401
+ {
2402
+ var element = this.getInputElement();
2403
+ element.removeAttribute( 'disabled' );
2404
+ element.removeClass( 'cke_disabled' );
2405
+ },
2406
+
2407
+ /**
2408
+ * Determines whether an UI element is enabled or not.
2409
+ * @returns {Boolean} Whether the UI element is enabled.
2410
+ * @example
2411
+ */
2412
+ isEnabled : function()
2413
+ {
2414
+ return !this.getInputElement().getAttribute( 'disabled' );
2415
+ },
2416
+
2417
+ /**
2418
+ * Determines whether an UI element is visible or not.
2419
+ * @returns {Boolean} Whether the UI element is visible.
2420
+ * @example
2421
+ */
2422
+ isVisible : function()
2423
+ {
2424
+ return !!this.getInputElement().$.offsetHeight;
2425
+ },
2426
+
2427
+ /**
2428
+ * Determines whether an UI element is focus-able or not.
2429
+ * Focus-able is defined as being both visible and enabled.
2430
+ * @returns {Boolean} Whether the UI element can be focused.
2431
+ * @example
2432
+ */
2433
+ isFocusable : function()
2434
+ {
2435
+ if ( !this.isEnabled() || !this.isVisible() )
2436
+ return false;
2437
+ return true;
2438
+ }
2439
+ };
2440
+
2441
+ CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
2442
+ /**
2443
+ * @lends CKEDITOR.ui.dialog.hbox.prototype
2444
+ */
2445
+ {
2446
+ /**
2447
+ * Gets a child UI element inside this container.
2448
+ * @param {Array|Number} indices An array or a single number to indicate the child's
2449
+ * position in the container's descendant tree. Omit to get all the children in an array.
2450
+ * @returns {Array|CKEDITOR.ui.dialog.uiElement} Array of all UI elements in the container
2451
+ * if no argument given, or the specified UI element if indices is given.
2452
+ * @example
2453
+ * var checkbox = hbox.getChild( [0,1] );
2454
+ * checkbox.setValue( true );
2455
+ */
2456
+ getChild : function( indices )
2457
+ {
2458
+ // If no arguments, return a clone of the children array.
2459
+ if ( arguments.length < 1 )
2460
+ return this._.children.concat();
2461
+
2462
+ // If indices isn't array, make it one.
2463
+ if ( !indices.splice )
2464
+ indices = [ indices ];
2465
+
2466
+ // Retrieve the child element according to tree position.
2467
+ if ( indices.length < 2 )
2468
+ return this._.children[ indices[0] ];
2469
+ else
2470
+ return ( this._.children[ indices[0] ] && this._.children[ indices[0] ].getChild ) ?
2471
+ this._.children[ indices[0] ].getChild( indices.slice( 1, indices.length ) ) :
2472
+ null;
2473
+ }
2474
+ }, true );
2475
+
2476
+ CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox();
2477
+
2478
+
2479
+
2480
+ (function()
2481
+ {
2482
+ var commonBuilder = {
2483
+ build : function( dialog, elementDefinition, output )
2484
+ {
2485
+ var children = elementDefinition.children,
2486
+ child,
2487
+ childHtmlList = [],
2488
+ childObjList = [];
2489
+ for ( var i = 0 ; ( i < children.length && ( child = children[i] ) ) ; i++ )
2490
+ {
2491
+ var childHtml = [];
2492
+ childHtmlList.push( childHtml );
2493
+ childObjList.push( CKEDITOR.dialog._.uiElementBuilders[ child.type ].build( dialog, child, childHtml ) );
2494
+ }
2495
+ return new CKEDITOR.ui.dialog[elementDefinition.type]( dialog, childObjList, childHtmlList, output, elementDefinition );
2496
+ }
2497
+ };
2498
+
2499
+ CKEDITOR.dialog.addUIElement( 'hbox', commonBuilder );
2500
+ CKEDITOR.dialog.addUIElement( 'vbox', commonBuilder );
2501
+ })();
2502
+
2503
+ /**
2504
+ * Generic dialog command. It opens a specific dialog when executed.
2505
+ * @constructor
2506
+ * @augments CKEDITOR.commandDefinition
2507
+ * @param {string} dialogName The name of the dialog to open when executing
2508
+ * this command.
2509
+ * @example
2510
+ * // Register the "link" command, which opens the "link" dialog.
2511
+ * editor.addCommand( 'link', <b>new CKEDITOR.dialogCommand( 'link' )</b> );
2512
+ */
2513
+ CKEDITOR.dialogCommand = function( dialogName )
2514
+ {
2515
+ this.dialogName = dialogName;
2516
+ };
2517
+
2518
+ CKEDITOR.dialogCommand.prototype =
2519
+ {
2520
+ /** @ignore */
2521
+ exec : function( editor )
2522
+ {
2523
+ editor.openDialog( this.dialogName );
2524
+ },
2525
+ // Dialog commands just open a dialog ui, thus require no undo logic,
2526
+ // undo support should dedicate to specific dialog implementation.
2527
+ canUndo: false
2528
+ };
2529
+
2530
+ (function()
2531
+ {
2532
+ var notEmptyRegex = /^([a]|[^a])+$/,
2533
+ integerRegex = /^\d*$/,
2534
+ numberRegex = /^\d*(?:\.\d+)?$/;
2535
+
2536
+ CKEDITOR.VALIDATE_OR = 1;
2537
+ CKEDITOR.VALIDATE_AND = 2;
2538
+
2539
+ CKEDITOR.dialog.validate =
2540
+ {
2541
+ functions : function()
2542
+ {
2543
+ return function()
2544
+ {
2545
+ /**
2546
+ * It's important for validate functions to be able to accept the value
2547
+ * as argument in addition to this.getValue(), so that it is possible to
2548
+ * combine validate functions together to make more sophisticated
2549
+ * validators.
2550
+ */
2551
+ var value = this && this.getValue ? this.getValue() : arguments[0];
2552
+
2553
+ var msg = undefined,
2554
+ relation = CKEDITOR.VALIDATE_AND,
2555
+ functions = [], i;
2556
+
2557
+ for ( i = 0 ; i < arguments.length ; i++ )
2558
+ {
2559
+ if ( typeof( arguments[i] ) == 'function' )
2560
+ functions.push( arguments[i] );
2561
+ else
2562
+ break;
2563
+ }
2564
+
2565
+ if ( i < arguments.length && typeof( arguments[i] ) == 'string' )
2566
+ {
2567
+ msg = arguments[i];
2568
+ i++;
2569
+ }
2570
+
2571
+ if ( i < arguments.length && typeof( arguments[i]) == 'number' )
2572
+ relation = arguments[i];
2573
+
2574
+ var passed = ( relation == CKEDITOR.VALIDATE_AND ? true : false );
2575
+ for ( i = 0 ; i < functions.length ; i++ )
2576
+ {
2577
+ if ( relation == CKEDITOR.VALIDATE_AND )
2578
+ passed = passed && functions[i]( value );
2579
+ else
2580
+ passed = passed || functions[i]( value );
2581
+ }
2582
+
2583
+ if ( !passed )
2584
+ {
2585
+ if ( msg !== undefined )
2586
+ alert( msg );
2587
+ if ( this && ( this.select || this.focus ) )
2588
+ ( this.select || this.focus )();
2589
+ return false;
2590
+ }
2591
+
2592
+ return true;
2593
+ };
2594
+ },
2595
+
2596
+ regex : function( regex, msg )
2597
+ {
2598
+ /*
2599
+ * Can be greatly shortened by deriving from functions validator if code size
2600
+ * turns out to be more important than performance.
2601
+ */
2602
+ return function()
2603
+ {
2604
+ var value = this && this.getValue ? this.getValue() : arguments[0];
2605
+ if ( !regex.test( value ) )
2606
+ {
2607
+ if ( msg !== undefined )
2608
+ alert( msg );
2609
+ if ( this && ( this.select || this.focus ) )
2610
+ {
2611
+ if ( this.select )
2612
+ this.select();
2613
+ else
2614
+ this.focus();
2615
+ }
2616
+ return false;
2617
+ }
2618
+ return true;
2619
+ };
2620
+ },
2621
+
2622
+ notEmpty : function( msg )
2623
+ {
2624
+ return this.regex( notEmptyRegex, msg );
2625
+ },
2626
+
2627
+ integer : function( msg )
2628
+ {
2629
+ return this.regex( integerRegex, msg );
2630
+ },
2631
+
2632
+ 'number' : function( msg )
2633
+ {
2634
+ return this.regex( numberRegex, msg );
2635
+ },
2636
+
2637
+ equals : function( value, msg )
2638
+ {
2639
+ return this.functions( function( val ){ return val == value; }, msg );
2640
+ },
2641
+
2642
+ notEqual : function( value, msg )
2643
+ {
2644
+ return this.functions( function( val ){ return val != value; }, msg );
2645
+ }
2646
+ };
2647
+ })();
2648
+
2649
+ // Grab the margin data from skin definition and store it away.
2650
+ CKEDITOR.skins.add = ( function()
2651
+ {
2652
+ var original = CKEDITOR.skins.add;
2653
+ return function( skinName, skinDefinition )
2654
+ {
2655
+ skinData[ skinName ] = { margins : skinDefinition.margins };
2656
+ return original.apply( this, arguments );
2657
+ };
2658
+ } )();
2659
+ })();
2660
+
2661
+ // Extend the CKEDITOR.editor class with dialog specific functions.
2662
+ CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
2663
+ /** @lends CKEDITOR.editor.prototype */
2664
+ {
2665
+ /**
2666
+ * Loads and opens a registered dialog.
2667
+ * @param {String} dialogName The registered name of the dialog.
2668
+ * @see CKEDITOR.dialog.add
2669
+ * @example
2670
+ * CKEDITOR.instances.editor1.openDialog( 'smiley' );
2671
+ * @returns {CKEDITOR.dialog} The dialog object corresponding to the dialog displayed. null if the dialog name is not registered.
2672
+ */
2673
+ openDialog : function( dialogName )
2674
+ {
2675
+ var dialogDefinitions = CKEDITOR.dialog._.dialogDefinitions[ dialogName ];
2676
+
2677
+ // If the dialogDefinition is already loaded, open it immediately.
2678
+ if ( typeof dialogDefinitions == 'function' )
2679
+ {
2680
+ var storedDialogs = this._.storedDialogs ||
2681
+ ( this._.storedDialogs = {} );
2682
+
2683
+ var dialog = storedDialogs[ dialogName ] ||
2684
+ ( storedDialogs[ dialogName ] = new CKEDITOR.dialog( this, dialogName ) );
2685
+
2686
+ dialog.show();
2687
+
2688
+ return dialog;
2689
+ }
2690
+ else if ( dialogDefinitions == 'failed' )
2691
+ throw new Error( '[CKEDITOR.dialog.openDialog] Dialog "' + dialogName + '" failed when loading definition.' );
2692
+
2693
+ // Not loaded? Load the .js file first.
2694
+ var body = CKEDITOR.document.getBody(),
2695
+ cursor = body.$.style.cursor,
2696
+ me = this;
2697
+
2698
+ body.setStyle( 'cursor', 'wait' );
2699
+ CKEDITOR.scriptLoader.load( CKEDITOR.getUrl( dialogDefinitions ), function()
2700
+ {
2701
+ // In case of plugin error, mark it as loading failed.
2702
+ if ( typeof CKEDITOR.dialog._.dialogDefinitions[ dialogName ] != 'function' )
2703
+ CKEDITOR.dialog._.dialogDefinitions[ dialogName ] = 'failed';
2704
+ me.openDialog( dialogName );
2705
+ body.setStyle( 'cursor', cursor );
2706
+ } );
2707
+
2708
+ return null;
2709
+ }
2710
+ });
2711
+
2712
+ // Dialog related configurations.
2713
+
2714
+ /**
2715
+ * The color of the dialog background cover. It should be a valid CSS color
2716
+ * string.
2717
+ * @type String
2718
+ * @default white
2719
+ * @example
2720
+ * config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';
2721
+ */
2722
+ CKEDITOR.config.dialog_backgroundCoverColor = 'white';
2723
+
2724
+ /**
2725
+ * The opacity of the dialog background cover. It should be a number within the
2726
+ * range [0.0, 1.0].
2727
+ * @type Number
2728
+ * @default 0.5
2729
+ * @example
2730
+ * config.dialog_backgroundCoverOpacity = 0.7;
2731
+ */
2732
+ CKEDITOR.config.dialog_backgroundCoverOpacity = 0.5;
2733
+
2734
+ /**
2735
+ * The distance of magnetic borders used in moving and resizing dialogs,
2736
+ * measured in pixels.
2737
+ * @type Number
2738
+ * @default 20
2739
+ * @example
2740
+ * config.dialog_magnetDistance = 30;
2741
+ */
2742
+ CKEDITOR.config.dialog_magnetDistance = 20;