browsercms-artirix 4.0.0.rc1.art4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (754) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +5 -0
  3. data/COPYRIGHT.txt +27 -0
  4. data/GPL.txt +674 -0
  5. data/LICENSE.txt +165 -0
  6. data/README.markdown +45 -0
  7. data/app/assets/fonts/icomoon.dev.svg +61 -0
  8. data/app/assets/fonts/icomoon.eot +0 -0
  9. data/app/assets/fonts/icomoon.svg +61 -0
  10. data/app/assets/fonts/icomoon.ttf +0 -0
  11. data/app/assets/fonts/icomoon.woff +0 -0
  12. data/app/assets/images/ckeditor/plugins/delete_content/icons/deletecontent.png +0 -0
  13. data/app/assets/images/ckeditor/plugins/edit_content/icons/editcontent.png +0 -0
  14. data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentdown.png +0 -0
  15. data/app/assets/images/ckeditor/plugins/move_content/icons/movecontentup.png +0 -0
  16. data/app/assets/images/cms/administration/user_browser_bg.gif +0 -0
  17. data/app/assets/images/cms/arrow-down.png +0 -0
  18. data/app/assets/images/cms/arrow-up.png +0 -0
  19. data/app/assets/images/cms/bg.png +0 -0
  20. data/app/assets/images/cms/bl_curve.png +0 -0
  21. data/app/assets/images/cms/bottom_cap.png +0 -0
  22. data/app/assets/images/cms/bottom_cap_content.png +0 -0
  23. data/app/assets/images/cms/browse.gif +0 -0
  24. data/app/assets/images/cms/browser_media_logo.png +0 -0
  25. data/app/assets/images/cms/browsercms_logo.png +0 -0
  26. data/app/assets/images/cms/buttons/button.png +0 -0
  27. data/app/assets/images/cms/buttons/button_bg.png +0 -0
  28. data/app/assets/images/cms/buttons/button_cap.png +0 -0
  29. data/app/assets/images/cms/buttons/button_cap_h.png +0 -0
  30. data/app/assets/images/cms/buttons/button_cap_off.gif +0 -0
  31. data/app/assets/images/cms/buttons/button_cap_off_middle.gif +0 -0
  32. data/app/assets/images/cms/buttons/button_h.png +0 -0
  33. data/app/assets/images/cms/buttons/button_left_bg.png +0 -0
  34. data/app/assets/images/cms/buttons/button_off.png +0 -0
  35. data/app/assets/images/cms/buttons/button_off_middle.png +0 -0
  36. data/app/assets/images/cms/buttons/delete_x.png +0 -0
  37. data/app/assets/images/cms/buttons/delete_x_disabled.png +0 -0
  38. data/app/assets/images/cms/buttons/delete_x_h.png +0 -0
  39. data/app/assets/images/cms/buttons/sm_button.gif +0 -0
  40. data/app/assets/images/cms/buttons/sm_button_2.gif +0 -0
  41. data/app/assets/images/cms/buttons/sm_button_2_h.gif +0 -0
  42. data/app/assets/images/cms/buttons/sm_button_h.gif +0 -0
  43. data/app/assets/images/cms/cogs.png +0 -0
  44. data/app/assets/images/cms/containers/add.gif +0 -0
  45. data/app/assets/images/cms/containers/alpha.png +0 -0
  46. data/app/assets/images/cms/containers/beta.png +0 -0
  47. data/app/assets/images/cms/containers/delete.gif +0 -0
  48. data/app/assets/images/cms/containers/down.gif +0 -0
  49. data/app/assets/images/cms/containers/edit.gif +0 -0
  50. data/app/assets/images/cms/containers/up.gif +0 -0
  51. data/app/assets/images/cms/containers/view.gif +0 -0
  52. data/app/assets/images/cms/content_bg.gif +0 -0
  53. data/app/assets/images/cms/dashboard/bottom_cap.png +0 -0
  54. data/app/assets/images/cms/dashboard/bottom_cap_content.png +0 -0
  55. data/app/assets/images/cms/dashboard/header_bg.gif +0 -0
  56. data/app/assets/images/cms/dashboard/header_left_bg.gif +0 -0
  57. data/app/assets/images/cms/dashboard/home.png +0 -0
  58. data/app/assets/images/cms/dashboard/table_header_bg.gif +0 -0
  59. data/app/assets/images/cms/dashboard/top_cap.png +0 -0
  60. data/app/assets/images/cms/dashed.gif +0 -0
  61. data/app/assets/images/cms/datepicker/clear.gif +0 -0
  62. data/app/assets/images/cms/datepicker/close.gif +0 -0
  63. data/app/assets/images/cms/dk_button_l.gif +0 -0
  64. data/app/assets/images/cms/dk_button_r.gif +0 -0
  65. data/app/assets/images/cms/dot.png +0 -0
  66. data/app/assets/images/cms/draft_status.gif +0 -0
  67. data/app/assets/images/cms/file-uploading.gif +0 -0
  68. data/app/assets/images/cms/gray_long_bg.gif +0 -0
  69. data/app/assets/images/cms/home.png +0 -0
  70. data/app/assets/images/cms/icons/actions/add.png +0 -0
  71. data/app/assets/images/cms/icons/actions/config.png +0 -0
  72. data/app/assets/images/cms/icons/actions/connect.png +0 -0
  73. data/app/assets/images/cms/icons/actions/delete.png +0 -0
  74. data/app/assets/images/cms/icons/actions/down.png +0 -0
  75. data/app/assets/images/cms/icons/actions/edit.png +0 -0
  76. data/app/assets/images/cms/icons/actions/folder.png +0 -0
  77. data/app/assets/images/cms/icons/actions/folder_add.png +0 -0
  78. data/app/assets/images/cms/icons/actions/folder_delete.png +0 -0
  79. data/app/assets/images/cms/icons/actions/folder_edit.png +0 -0
  80. data/app/assets/images/cms/icons/actions/folder_move.png +0 -0
  81. data/app/assets/images/cms/icons/actions/folder_open.png +0 -0
  82. data/app/assets/images/cms/icons/actions/history.png +0 -0
  83. data/app/assets/images/cms/icons/actions/home.png +0 -0
  84. data/app/assets/images/cms/icons/actions/left.png +0 -0
  85. data/app/assets/images/cms/icons/actions/link.png +0 -0
  86. data/app/assets/images/cms/icons/actions/page.png +0 -0
  87. data/app/assets/images/cms/icons/actions/page_add.png +0 -0
  88. data/app/assets/images/cms/icons/actions/page_edit.png +0 -0
  89. data/app/assets/images/cms/icons/actions/page_move.png +0 -0
  90. data/app/assets/images/cms/icons/actions/redo.png +0 -0
  91. data/app/assets/images/cms/icons/actions/refresh.png +0 -0
  92. data/app/assets/images/cms/icons/actions/right.png +0 -0
  93. data/app/assets/images/cms/icons/actions/root_folder.png +0 -0
  94. data/app/assets/images/cms/icons/actions/root_link.png +0 -0
  95. data/app/assets/images/cms/icons/actions/root_page.png +0 -0
  96. data/app/assets/images/cms/icons/actions/undo.png +0 -0
  97. data/app/assets/images/cms/icons/actions/up.png +0 -0
  98. data/app/assets/images/cms/icons/actions/view.png +0 -0
  99. data/app/assets/images/cms/icons/file_types/doc.png +0 -0
  100. data/app/assets/images/cms/icons/file_types/file.png +0 -0
  101. data/app/assets/images/cms/icons/file_types/gif.png +0 -0
  102. data/app/assets/images/cms/icons/file_types/htm.png +0 -0
  103. data/app/assets/images/cms/icons/file_types/pdf.png +0 -0
  104. data/app/assets/images/cms/icons/file_types/ppt.png +0 -0
  105. data/app/assets/images/cms/icons/file_types/swf.png +0 -0
  106. data/app/assets/images/cms/icons/file_types/txt.png +0 -0
  107. data/app/assets/images/cms/icons/file_types/xls.png +0 -0
  108. data/app/assets/images/cms/icons/file_types/xml.png +0 -0
  109. data/app/assets/images/cms/icons/file_types/zip.png +0 -0
  110. data/app/assets/images/cms/icons/status/archived.gif +0 -0
  111. data/app/assets/images/cms/icons/status/draft.gif +0 -0
  112. data/app/assets/images/cms/icons/status/hidden.gif +0 -0
  113. data/app/assets/images/cms/icons/status/locked.gif +0 -0
  114. data/app/assets/images/cms/icons/status/published.gif +0 -0
  115. data/app/assets/images/cms/icons/status/unlocked.gif +0 -0
  116. data/app/assets/images/cms/icons/user.png +0 -0
  117. data/app/assets/images/cms/login_bg.jpg +0 -0
  118. data/app/assets/images/cms/login_bottom.jpg +0 -0
  119. data/app/assets/images/cms/login_top.gif +0 -0
  120. data/app/assets/images/cms/logo.png +0 -0
  121. data/app/assets/images/cms/lt_button_bg.gif +0 -0
  122. data/app/assets/images/cms/lt_button_l.gif +0 -0
  123. data/app/assets/images/cms/lt_button_r.gif +0 -0
  124. data/app/assets/images/cms/menu/block_cap_h.gif +0 -0
  125. data/app/assets/images/cms/menu/bottom_cap.png +0 -0
  126. data/app/assets/images/cms/menu/bottom_cap_menu.png +0 -0
  127. data/app/assets/images/cms/menu/bottom_cap_menu_first.png +0 -0
  128. data/app/assets/images/cms/menu/menu_header_first_bg.gif +0 -0
  129. data/app/assets/images/cms/menu/selected_block_cap.gif +0 -0
  130. data/app/assets/images/cms/menu/top_cap.png +0 -0
  131. data/app/assets/images/cms/menu/top_cap_menu_header.png +0 -0
  132. data/app/assets/images/cms/menu.png +0 -0
  133. data/app/assets/images/cms/menu_h.gif +0 -0
  134. data/app/assets/images/cms/menu_header.png +0 -0
  135. data/app/assets/images/cms/menu_open.png +0 -0
  136. data/app/assets/images/cms/menu_open_bg.gif +0 -0
  137. data/app/assets/images/cms/nav/on_bg.gif +0 -0
  138. data/app/assets/images/cms/nav.png +0 -0
  139. data/app/assets/images/cms/nav_admin.gif +0 -0
  140. data/app/assets/images/cms/nav_admin_h.gif +0 -0
  141. data/app/assets/images/cms/nav_admin_on.gif +0 -0
  142. data/app/assets/images/cms/nav_cap.png +0 -0
  143. data/app/assets/images/cms/nav_cap_h.gif +0 -0
  144. data/app/assets/images/cms/nav_content_library.gif +0 -0
  145. data/app/assets/images/cms/nav_content_library_h.gif +0 -0
  146. data/app/assets/images/cms/nav_content_library_on.gif +0 -0
  147. data/app/assets/images/cms/nav_dash.gif +0 -0
  148. data/app/assets/images/cms/nav_dash_h.gif +0 -0
  149. data/app/assets/images/cms/nav_dash_on.gif +0 -0
  150. data/app/assets/images/cms/nav_h.gif +0 -0
  151. data/app/assets/images/cms/nav_sitemap.gif +0 -0
  152. data/app/assets/images/cms/nav_sitemap_h.gif +0 -0
  153. data/app/assets/images/cms/nav_sitemap_on.gif +0 -0
  154. data/app/assets/images/cms/page_toolbar/page_toolbar_bg.gif +0 -0
  155. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_bg.gif +0 -0
  156. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif +0 -0
  157. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif +0 -0
  158. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif +0 -0
  159. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_l.gif +0 -0
  160. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif +0 -0
  161. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_l.gif +0 -0
  162. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_published_r.gif +0 -0
  163. data/app/assets/images/cms/page_toolbar/page_toolbar_inset_r.gif +0 -0
  164. data/app/assets/images/cms/page_toolbar/page_toolbar_l.gif +0 -0
  165. data/app/assets/images/cms/page_toolbar/page_toolbar_r.gif +0 -0
  166. data/app/assets/images/cms/page_toolbar/status_draft_bg.gif +0 -0
  167. data/app/assets/images/cms/page_toolbar/status_draft_l.gif +0 -0
  168. data/app/assets/images/cms/page_toolbar/status_l.gif +0 -0
  169. data/app/assets/images/cms/page_toolbar/status_published_bg.gif +0 -0
  170. data/app/assets/images/cms/page_toolbar/status_published_l.gif +0 -0
  171. data/app/assets/images/cms/page_toolbar/visual_editor_bg.gif +0 -0
  172. data/app/assets/images/cms/page_toolbar/visual_editor_end.gif +0 -0
  173. data/app/assets/images/cms/page_toolbar/visual_editor_r.gif +0 -0
  174. data/app/assets/images/cms/page_toolbar/visual_editor_state_bg.gif +0 -0
  175. data/app/assets/images/cms/pages/add_connectable.gif +0 -0
  176. data/app/assets/images/cms/pages/connect_connectable.gif +0 -0
  177. data/app/assets/images/cms/pages/container_border.gif +0 -0
  178. data/app/assets/images/cms/pages/container_border_l.gif +0 -0
  179. data/app/assets/images/cms/pages/container_border_r.gif +0 -0
  180. data/app/assets/images/cms/pages/delete_connectable.gif +0 -0
  181. data/app/assets/images/cms/pages/down_connectable.gif +0 -0
  182. data/app/assets/images/cms/pages/down_connectable_disabled.gif +0 -0
  183. data/app/assets/images/cms/pages/edit_connectable.gif +0 -0
  184. data/app/assets/images/cms/pages/edit_connectable_2.gif +0 -0
  185. data/app/assets/images/cms/pages/show_connectable.gif +0 -0
  186. data/app/assets/images/cms/pages/up_connectable.gif +0 -0
  187. data/app/assets/images/cms/pages/up_connectable_disabled.gif +0 -0
  188. data/app/assets/images/cms/pagination/first.gif +0 -0
  189. data/app/assets/images/cms/pagination/first_h.gif +0 -0
  190. data/app/assets/images/cms/pagination/input.gif +0 -0
  191. data/app/assets/images/cms/pagination/last.gif +0 -0
  192. data/app/assets/images/cms/pagination/last_h.gif +0 -0
  193. data/app/assets/images/cms/pagination/next.gif +0 -0
  194. data/app/assets/images/cms/pagination/next_h.gif +0 -0
  195. data/app/assets/images/cms/pagination/previous.gif +0 -0
  196. data/app/assets/images/cms/pagination/previous_h.gif +0 -0
  197. data/app/assets/images/cms/pencil.png +0 -0
  198. data/app/assets/images/cms/plus.png +0 -0
  199. data/app/assets/images/cms/published_status.gif +0 -0
  200. data/app/assets/images/cms/search.png +0 -0
  201. data/app/assets/images/cms/search_submit.gif +0 -0
  202. data/app/assets/images/cms/search_submit_h.gif +0 -0
  203. data/app/assets/images/cms/searchbox_gradient.gif +0 -0
  204. data/app/assets/images/cms/select_bg.gif +0 -0
  205. data/app/assets/images/cms/select_bg_2.gif +0 -0
  206. data/app/assets/images/cms/sitemap/bottom_cap.png +0 -0
  207. data/app/assets/images/cms/sitemap/buffer_caps.png +0 -0
  208. data/app/assets/images/cms/sitemap/contract.png +0 -0
  209. data/app/assets/images/cms/sitemap/corners.gif +0 -0
  210. data/app/assets/images/cms/sitemap/corners_hover.gif +0 -0
  211. data/app/assets/images/cms/sitemap/divider.gif +0 -0
  212. data/app/assets/images/cms/sitemap/expand.png +0 -0
  213. data/app/assets/images/cms/sitemap/gradient.gif +0 -0
  214. data/app/assets/images/cms/sitemap/gray_contract.png +0 -0
  215. data/app/assets/images/cms/sitemap/gray_expand.png +0 -0
  216. data/app/assets/images/cms/sitemap/no_contents.png +0 -0
  217. data/app/assets/images/cms/sitemap/site_root_cap.png +0 -0
  218. data/app/assets/images/cms/sitemap/tooltip.gif +0 -0
  219. data/app/assets/images/cms/sitemap/top_cap_content.png +0 -0
  220. data/app/assets/images/cms/solid.gif +0 -0
  221. data/app/assets/images/cms/table/bl.gif +0 -0
  222. data/app/assets/images/cms/table/br.gif +0 -0
  223. data/app/assets/images/cms/table/divider.gif +0 -0
  224. data/app/assets/images/cms/table/td_cap_first_h.gif +0 -0
  225. data/app/assets/images/cms/table/td_cap_first_s.gif +0 -0
  226. data/app/assets/images/cms/table/td_cap_last_h.gif +0 -0
  227. data/app/assets/images/cms/table/td_cap_last_s.gif +0 -0
  228. data/app/assets/images/cms/table/td_last_bg.gif +0 -0
  229. data/app/assets/images/cms/table/th_bg.gif +0 -0
  230. data/app/assets/images/cms/table/th_divider.gif +0 -0
  231. data/app/assets/images/cms/table/th_last_bg.gif +0 -0
  232. data/app/assets/images/cms/table/tl.gif +0 -0
  233. data/app/assets/images/cms/table/tr.gif +0 -0
  234. data/app/assets/images/cms/table/tr_bg.gif +0 -0
  235. data/app/assets/images/cms/toolbar_bg.png +0 -0
  236. data/app/assets/images/cms/top_cap.png +0 -0
  237. data/app/assets/images/cms/top_cap_content.png +0 -0
  238. data/app/assets/images/cms/top_cap_menu_header.png +0 -0
  239. data/app/assets/images/cms/user.png +0 -0
  240. data/app/assets/images/cms/user_search_submit.gif +0 -0
  241. data/app/assets/images/cms/usercontrols_bg.png +0 -0
  242. data/app/assets/images/cms/usercontrols_bg_cap.png +0 -0
  243. data/app/assets/javascripts/bcms/ckeditor.js +8 -0
  244. data/app/assets/javascripts/bcms/ckeditor_inline.js +23 -0
  245. data/app/assets/javascripts/bcms/ckeditor_load.js +54 -0
  246. data/app/assets/javascripts/bcms/ckeditor_standard_config.js +10 -0
  247. data/app/assets/javascripts/ckeditor/plugins/delete_content/plugin.js +36 -0
  248. data/app/assets/javascripts/ckeditor/plugins/edit_content/plugin.js +24 -0
  249. data/app/assets/javascripts/ckeditor/plugins/move_content/plugin.js +25 -0
  250. data/app/assets/javascripts/cms/ajax.js +60 -0
  251. data/app/assets/javascripts/cms/application.js +18 -0
  252. data/app/assets/javascripts/cms/attachment_manager.js +88 -0
  253. data/app/assets/javascripts/cms/content_library.js +121 -0
  254. data/app/assets/javascripts/cms/content_types.js +13 -0
  255. data/app/assets/javascripts/cms/core_library.js.erb +210 -0
  256. data/app/assets/javascripts/cms/form_builder.js +250 -0
  257. data/app/assets/javascripts/cms/namespace.js +2 -0
  258. data/app/assets/javascripts/cms/new_content_button.js +27 -0
  259. data/app/assets/javascripts/cms/page_editor.js +189 -0
  260. data/app/assets/javascripts/cms/page_toolbar.js +13 -0
  261. data/app/assets/javascripts/cms/site.js +2 -0
  262. data/app/assets/javascripts/cms/sitemap.js +219 -0
  263. data/app/assets/javascripts/cms/toolbar.js +21 -0
  264. data/app/assets/javascripts/cms/user.js +40 -0
  265. data/app/assets/javascripts/jquery.exists.js +5 -0
  266. data/app/assets/javascripts/jquery.taglist.js +157 -0
  267. data/app/assets/stylesheets/cms/_assets.scss +60 -0
  268. data/app/assets/stylesheets/cms/_base.scss +42 -0
  269. data/app/assets/stylesheets/cms/_cms-buttons.scss +73 -0
  270. data/app/assets/stylesheets/cms/_cms-forms.scss +70 -0
  271. data/app/assets/stylesheets/cms/_colors.scss +20 -0
  272. data/app/assets/stylesheets/cms/_dashboard.scss +25 -0
  273. data/app/assets/stylesheets/cms/_glyph.scss +60 -0
  274. data/app/assets/stylesheets/cms/_main-area.scss +62 -0
  275. data/app/assets/stylesheets/cms/_nav.scss +197 -0
  276. data/app/assets/stylesheets/cms/_sidebar.scss +64 -0
  277. data/app/assets/stylesheets/cms/_sitemap.scss +209 -0
  278. data/app/assets/stylesheets/cms/_submenu.scss +48 -0
  279. data/app/assets/stylesheets/cms/application.scss +49 -0
  280. data/app/assets/stylesheets/cms/core.scss +96 -0
  281. data/app/assets/stylesheets/cms/default-forms.scss +3 -0
  282. data/app/assets/stylesheets/cms/includes/_animation.scss +2 -0
  283. data/app/assets/stylesheets/cms/includes/_rem.scss +120 -0
  284. data/app/assets/stylesheets/cms/includes/animation/_animate.scss +31 -0
  285. data/app/assets/stylesheets/cms/includes/animation/_core.scss +127 -0
  286. data/app/assets/stylesheets/cms/includes/animation/_shared.scss +22 -0
  287. data/app/assets/stylesheets/cms/includes/animation/animate/_attention-seekers.scss +152 -0
  288. data/app/assets/stylesheets/cms/includes/animation/animate/_bouncing.scss +3 -0
  289. data/app/assets/stylesheets/cms/includes/animation/animate/_classes.scss +21 -0
  290. data/app/assets/stylesheets/cms/includes/animation/animate/_fading.scss +3 -0
  291. data/app/assets/stylesheets/cms/includes/animation/animate/_flippers.scss +87 -0
  292. data/app/assets/stylesheets/cms/includes/animation/animate/_lightspeed.scss +24 -0
  293. data/app/assets/stylesheets/cms/includes/animation/animate/_rotating.scss +3 -0
  294. data/app/assets/stylesheets/cms/includes/animation/animate/_specials.scss +42 -0
  295. data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-entrances.scss +68 -0
  296. data/app/assets/stylesheets/cms/includes/animation/animate/bouncing/_bouncing-exits.scss +60 -0
  297. data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-entrances.scss +86 -0
  298. data/app/assets/stylesheets/cms/includes/animation/animate/fading/_fading-exits.scss +86 -0
  299. data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-entrances.scss +58 -0
  300. data/app/assets/stylesheets/cms/includes/animation/animate/rotating/_rotating-exits.scss +58 -0
  301. data/app/assets/stylesheets/cms/page_content_editing.scss +4 -0
  302. data/app/assets/stylesheets/cms/page_editor.scss +4 -0
  303. data/app/assets/stylesheets/cms/style.scss +138 -0
  304. data/app/assets/stylesheets/cms/styles/_alerts.scss +150 -0
  305. data/app/assets/stylesheets/cms/styles/_base-grid.scss +299 -0
  306. data/app/assets/stylesheets/cms/styles/_buttons.scss +247 -0
  307. data/app/assets/stylesheets/cms/styles/_dropdown.scss +155 -0
  308. data/app/assets/stylesheets/cms/styles/_forms.scss +728 -0
  309. data/app/assets/stylesheets/cms/styles/_glyph.scss +86 -0
  310. data/app/assets/stylesheets/cms/styles/_images.scss +86 -0
  311. data/app/assets/stylesheets/cms/styles/_lists.scss +115 -0
  312. data/app/assets/stylesheets/cms/styles/_modal.scss +174 -0
  313. data/app/assets/stylesheets/cms/styles/_progress.scss +43 -0
  314. data/app/assets/stylesheets/cms/styles/_tables.scss +141 -0
  315. data/app/assets/stylesheets/cms/styles/_text.scss +134 -0
  316. data/app/controllers/cms/application_controller.rb +11 -0
  317. data/app/controllers/cms/attachments_controller.rb +48 -0
  318. data/app/controllers/cms/base_controller.rb +22 -0
  319. data/app/controllers/cms/cache_controller.rb +23 -0
  320. data/app/controllers/cms/categories_controller.rb +7 -0
  321. data/app/controllers/cms/category_types_controller.rb +12 -0
  322. data/app/controllers/cms/connectors_controller.rb +70 -0
  323. data/app/controllers/cms/content_block_controller.rb +361 -0
  324. data/app/controllers/cms/content_controller.rb +173 -0
  325. data/app/controllers/cms/content_types_controller.rb +14 -0
  326. data/app/controllers/cms/dashboard_controller.rb +13 -0
  327. data/app/controllers/cms/dynamic_views_controller.rb +81 -0
  328. data/app/controllers/cms/email_messages_controller.rb +21 -0
  329. data/app/controllers/cms/file_blocks_controller.rb +4 -0
  330. data/app/controllers/cms/form_entries_controller.rb +140 -0
  331. data/app/controllers/cms/form_fields_controller.rb +74 -0
  332. data/app/controllers/cms/forms_controller.rb +35 -0
  333. data/app/controllers/cms/groups_controller.rb +25 -0
  334. data/app/controllers/cms/home_controller.rb +10 -0
  335. data/app/controllers/cms/html_blocks_controller.rb +4 -0
  336. data/app/controllers/cms/image_blocks_controller.rb +4 -0
  337. data/app/controllers/cms/inline_content_controller.rb +50 -0
  338. data/app/controllers/cms/links_controller.rb +81 -0
  339. data/app/controllers/cms/page_components_controller.rb +20 -0
  340. data/app/controllers/cms/page_route_conditions_controller.rb +4 -0
  341. data/app/controllers/cms/page_route_options_controller.rb +58 -0
  342. data/app/controllers/cms/page_route_requirements_controller.rb +4 -0
  343. data/app/controllers/cms/page_routes_controller.rb +51 -0
  344. data/app/controllers/cms/pages_controller.rb +151 -0
  345. data/app/controllers/cms/passwords_controller.rb +22 -0
  346. data/app/controllers/cms/portlet_controller.rb +21 -0
  347. data/app/controllers/cms/portlets_controller.rb +35 -0
  348. data/app/controllers/cms/redirects_controller.rb +25 -0
  349. data/app/controllers/cms/resource_controller.rb +125 -0
  350. data/app/controllers/cms/routes_controller.rb +22 -0
  351. data/app/controllers/cms/section_nodes_controller.rb +24 -0
  352. data/app/controllers/cms/sections_controller.rb +100 -0
  353. data/app/controllers/cms/sessions_controller.rb +15 -0
  354. data/app/controllers/cms/sites/passwords_controller.rb +32 -0
  355. data/app/controllers/cms/sites/sessions_controller.rb +20 -0
  356. data/app/controllers/cms/tags_controller.rb +16 -0
  357. data/app/controllers/cms/tasks_controller.rb +56 -0
  358. data/app/controllers/cms/toolbar_controller.rb +18 -0
  359. data/app/controllers/cms/user_controller.rb +8 -0
  360. data/app/controllers/cms/users_controller.rb +125 -0
  361. data/app/controllers/tests/pretend_controller.rb +32 -0
  362. data/app/helpers/cms/application_helper.rb +258 -0
  363. data/app/helpers/cms/content_block_helper.rb +55 -0
  364. data/app/helpers/cms/content_types_helper.rb +4 -0
  365. data/app/helpers/cms/form_tag_helper.rb +36 -0
  366. data/app/helpers/cms/menu_helper.rb +167 -0
  367. data/app/helpers/cms/mobile_helper.rb +29 -0
  368. data/app/helpers/cms/nav_menu_helper.rb +23 -0
  369. data/app/helpers/cms/page_helper.rb +169 -0
  370. data/app/helpers/cms/path_helper.rb +113 -0
  371. data/app/helpers/cms/rendering_helper.rb +112 -0
  372. data/app/helpers/cms/section_nodes_helper.rb +112 -0
  373. data/app/helpers/cms/sites/authentication_helper.rb +25 -0
  374. data/app/helpers/cms/sites/devise_shim_helper.rb +31 -0
  375. data/app/helpers/cms/template_support.rb +18 -0
  376. data/app/helpers/cms/ui_elements_helper.rb +168 -0
  377. data/app/helpers/forgot_password_portlet_helper.rb +9 -0
  378. data/app/helpers/login_portlet_helper.rb +10 -0
  379. data/app/inputs/attachments_input.rb +14 -0
  380. data/app/inputs/cms_text_area_input.rb +10 -0
  381. data/app/inputs/date_picker_input.rb +8 -0
  382. data/app/inputs/file_picker_input.rb +75 -0
  383. data/app/inputs/name_input.rb +42 -0
  384. data/app/inputs/path_input.rb +18 -0
  385. data/app/inputs/tag_list_input.rb +3 -0
  386. data/app/inputs/template_editor_input.rb +24 -0
  387. data/app/inputs/text_editor_input.rb +19 -0
  388. data/app/models/cms/abstract_file_block.rb +50 -0
  389. data/app/models/cms/attachment.rb +267 -0
  390. data/app/models/cms/category.rb +56 -0
  391. data/app/models/cms/category_type.rb +43 -0
  392. data/app/models/cms/connector.rb +99 -0
  393. data/app/models/cms/content.rb +31 -0
  394. data/app/models/cms/content_type.rb +191 -0
  395. data/app/models/cms/dynamic_view.rb +81 -0
  396. data/app/models/cms/email_message.rb +63 -0
  397. data/app/models/cms/email_message_mailer.rb +12 -0
  398. data/app/models/cms/external_user.rb +60 -0
  399. data/app/models/cms/file_block.rb +19 -0
  400. data/app/models/cms/form.rb +47 -0
  401. data/app/models/cms/form_entry.rb +75 -0
  402. data/app/models/cms/form_field.rb +78 -0
  403. data/app/models/cms/group.rb +62 -0
  404. data/app/models/cms/group_permission.rb +12 -0
  405. data/app/models/cms/group_section.rb +9 -0
  406. data/app/models/cms/group_type.rb +16 -0
  407. data/app/models/cms/group_type_permission.rb +8 -0
  408. data/app/models/cms/guest_user.rb +57 -0
  409. data/app/models/cms/html_block.rb +38 -0
  410. data/app/models/cms/image_block.rb +23 -0
  411. data/app/models/cms/link.rb +20 -0
  412. data/app/models/cms/page.rb +437 -0
  413. data/app/models/cms/page_component.rb +43 -0
  414. data/app/models/cms/page_partial.rb +40 -0
  415. data/app/models/cms/page_route.rb +140 -0
  416. data/app/models/cms/page_route_condition.rb +5 -0
  417. data/app/models/cms/page_route_option.rb +7 -0
  418. data/app/models/cms/page_route_requirement.rb +5 -0
  419. data/app/models/cms/page_template.rb +45 -0
  420. data/app/models/cms/permission.rb +17 -0
  421. data/app/models/cms/persistent_user.rb +223 -0
  422. data/app/models/cms/portlet.rb +237 -0
  423. data/app/models/cms/redirect.rb +12 -0
  424. data/app/models/cms/search_filter.rb +18 -0
  425. data/app/models/cms/section.rb +224 -0
  426. data/app/models/cms/section_node.rb +144 -0
  427. data/app/models/cms/site.rb +45 -0
  428. data/app/models/cms/tag.rb +69 -0
  429. data/app/models/cms/tagging.rb +14 -0
  430. data/app/models/cms/task.rb +75 -0
  431. data/app/models/cms/templates.rb +31 -0
  432. data/app/models/cms/user.rb +43 -0
  433. data/app/models/cms/user_group_membership.rb +9 -0
  434. data/app/models/cms/view_context.rb +81 -0
  435. data/app/portlets/deprecated_placeholder.rb +12 -0
  436. data/app/portlets/dynamic_portlet.rb +7 -0
  437. data/app/portlets/email_page_portlet.rb +32 -0
  438. data/app/portlets/forgot_password_portlet.rb +15 -0
  439. data/app/portlets/helpers/cms/list_portlet_helper.rb +5 -0
  440. data/app/portlets/list_portlet.rb +40 -0
  441. data/app/portlets/login_portlet.rb +13 -0
  442. data/app/portlets/tag_cloud_portlet.rb +15 -0
  443. data/app/presenters/cms/user_presenter.rb +47 -0
  444. data/app/views/cms/application/_add_content_modal.html.erb +3 -0
  445. data/app/views/cms/application/_buttons.html.erb +7 -0
  446. data/app/views/cms/application/_exception.html.erb +6 -0
  447. data/app/views/cms/application/_form_errors.html.erb +7 -0
  448. data/app/views/cms/application/_form_with_buttons.html.erb +10 -0
  449. data/app/views/cms/application/_main_content.html.erb +3 -0
  450. data/app/views/cms/application/_main_with_sidebar.html.erb +8 -0
  451. data/app/views/cms/application/_mobile_toolbar.html.erb +16 -0
  452. data/app/views/cms/application/_page_title.html.erb +5 -0
  453. data/app/views/cms/application/_pagination.html.erb +26 -0
  454. data/app/views/cms/application/_row.html.erb +1 -0
  455. data/app/views/cms/application/_save_buttons.html.erb +7 -0
  456. data/app/views/cms/application/_sidebar_layout.html.erb +3 -0
  457. data/app/views/cms/application/_version.html.erb +23 -0
  458. data/app/views/cms/application/_version_conflict_diff.html.erb +11 -0
  459. data/app/views/cms/application/_version_conflict_error.html.erb +6 -0
  460. data/app/views/cms/attachments/_attachment.html.erb +16 -0
  461. data/app/views/cms/attachments/_attachment_manager.html.erb +39 -0
  462. data/app/views/cms/attachments/_attachment_table.html.erb +22 -0
  463. data/app/views/cms/attachments/_attachment_wrapper.html.erb +4 -0
  464. data/app/views/cms/attachments/_no_attachments_defined.html.erb +1 -0
  465. data/app/views/cms/cache/show.html.erb +7 -0
  466. data/app/views/cms/categories/_form.html.erb +27 -0
  467. data/app/views/cms/category_types/_form.html.erb +1 -0
  468. data/app/views/cms/connectors/new.html.erb +38 -0
  469. data/app/views/cms/content/editing_frame.html.erb +1 -0
  470. data/app/views/cms/content/no_page.html.erb +19 -0
  471. data/app/views/cms/content/show.html.erb +21 -0
  472. data/app/views/cms/content_block/_block_form.html.erb +15 -0
  473. data/app/views/cms/content_block/_buttonbar.html.erb +29 -0
  474. data/app/views/cms/content_block/_buttons.html.erb +13 -0
  475. data/app/views/cms/content_block/_hidden_fields.html.erb +13 -0
  476. data/app/views/cms/content_block/_sidebar.html.erb +36 -0
  477. data/app/views/cms/content_block/edit.html.erb +3 -0
  478. data/app/views/cms/content_block/index.html.erb +87 -0
  479. data/app/views/cms/content_block/new.html.erb +3 -0
  480. data/app/views/cms/content_block/render_block_in_main_container.html.erb +10 -0
  481. data/app/views/cms/content_block/show.html.erb +1 -0
  482. data/app/views/cms/content_block/show_in_isolation.html.erb +15 -0
  483. data/app/views/cms/content_block/versions.html.erb +24 -0
  484. data/app/views/cms/content_types/_order_field.html.erb +5 -0
  485. data/app/views/cms/content_types/index.html.erb +3 -0
  486. data/app/views/cms/dashboard/_page_drafts.html.erb +39 -0
  487. data/app/views/cms/dashboard/_tasks.html.erb +41 -0
  488. data/app/views/cms/dashboard/index.html.erb +13 -0
  489. data/app/views/cms/dynamic_views/_form.html.erb +9 -0
  490. data/app/views/cms/dynamic_views/edit.html.erb +2 -0
  491. data/app/views/cms/dynamic_views/index.html.erb +33 -0
  492. data/app/views/cms/dynamic_views/new.html.erb +2 -0
  493. data/app/views/cms/email_messages/index.html.erb +36 -0
  494. data/app/views/cms/email_messages/show.html.erb +50 -0
  495. data/app/views/cms/file_blocks/_form.html.erb +3 -0
  496. data/app/views/cms/file_blocks/_section_selector.html.erb +13 -0
  497. data/app/views/cms/file_blocks/render.html.erb +5 -0
  498. data/app/views/cms/forgot_password_mailer/reset_password.text.html.erb +3 -0
  499. data/app/views/cms/forgot_password_mailer/reset_password.text.plain.erb +3 -0
  500. data/app/views/cms/form_entries/_buttons.html.erb +2 -0
  501. data/app/views/cms/form_entries/_form.html.erb +7 -0
  502. data/app/views/cms/form_entries/_internal_form.html.erb +9 -0
  503. data/app/views/cms/form_entries/edit.html.erb +5 -0
  504. data/app/views/cms/form_entries/error.html.erb +3 -0
  505. data/app/views/cms/form_entries/index.html.erb +5 -0
  506. data/app/views/cms/form_entries/new.html.erb +5 -0
  507. data/app/views/cms/form_entries/show.html.erb +13 -0
  508. data/app/views/cms/form_entries/submit.html.erb +1 -0
  509. data/app/views/cms/form_fields/_form.html.erb +8 -0
  510. data/app/views/cms/form_fields/_select.html.erb +3 -0
  511. data/app/views/cms/form_fields/_text_area.html.erb +3 -0
  512. data/app/views/cms/form_fields/_text_field.html.erb +3 -0
  513. data/app/views/cms/form_fields/edit.html.erb +0 -0
  514. data/app/views/cms/form_fields/new.html.erb +26 -0
  515. data/app/views/cms/form_fields/preview.html.erb +16 -0
  516. data/app/views/cms/forms/_form.html.erb +67 -0
  517. data/app/views/cms/forms/render.html.erb +15 -0
  518. data/app/views/cms/forms/show.html.erb +6 -0
  519. data/app/views/cms/groups/_form.html.erb +38 -0
  520. data/app/views/cms/groups/_permissions.html.erb +14 -0
  521. data/app/views/cms/groups/_sections.html.erb +12 -0
  522. data/app/views/cms/groups/edit.html.erb +2 -0
  523. data/app/views/cms/groups/index.html.erb +36 -0
  524. data/app/views/cms/groups/new.html.erb +2 -0
  525. data/app/views/cms/html_blocks/_form.html.erb +3 -0
  526. data/app/views/cms/html_blocks/render.html.erb +1 -0
  527. data/app/views/cms/image_blocks/_form.html.erb +3 -0
  528. data/app/views/cms/image_blocks/render.html.erb +4 -0
  529. data/app/views/cms/links/_form.html.erb +8 -0
  530. data/app/views/cms/links/edit.html.erb +4 -0
  531. data/app/views/cms/links/new.html.erb +5 -0
  532. data/app/views/cms/menus/_menu.html.erb +9 -0
  533. data/app/views/cms/menus/_menu_item.html.erb +11 -0
  534. data/app/views/cms/page_components/_content.html.erb +18 -0
  535. data/app/views/cms/page_components/new.html.erb +12 -0
  536. data/app/views/cms/page_routes/_form.html.erb +12 -0
  537. data/app/views/cms/page_routes/edit.html.erb +2 -0
  538. data/app/views/cms/page_routes/index.html.erb +33 -0
  539. data/app/views/cms/page_routes/new.html.erb +2 -0
  540. data/app/views/cms/pages/_edit_content.html.erb +28 -0
  541. data/app/views/cms/pages/_form.html.erb +21 -0
  542. data/app/views/cms/pages/_main_form.html.erb +23 -0
  543. data/app/views/cms/pages/_simple_container.html.erb +8 -0
  544. data/app/views/cms/pages/edit.html.erb +2 -0
  545. data/app/views/cms/pages/new.html.erb +19 -0
  546. data/app/views/cms/pages/versions.html.erb +22 -0
  547. data/app/views/cms/passwords/new.html.erb +16 -0
  548. data/app/views/cms/redirects/_form.html.erb +7 -0
  549. data/app/views/cms/redirects/edit.html.erb +2 -0
  550. data/app/views/cms/redirects/index.html.erb +25 -0
  551. data/app/views/cms/redirects/new.html.erb +2 -0
  552. data/app/views/cms/routes/index.html.erb +35 -0
  553. data/app/views/cms/section_nodes/_children.html.erb +5 -0
  554. data/app/views/cms/section_nodes/_row_buttons.html.erb +11 -0
  555. data/app/views/cms/section_nodes/_section_node.html.erb +24 -0
  556. data/app/views/cms/section_nodes/_sitemap_buttons.html.erb +47 -0
  557. data/app/views/cms/section_nodes/_status.html.erb +5 -0
  558. data/app/views/cms/section_nodes/show.html.erb +9 -0
  559. data/app/views/cms/sections/_buttons.html.erb +6 -0
  560. data/app/views/cms/sections/_form.html.erb +30 -0
  561. data/app/views/cms/sections/edit.html.erb +4 -0
  562. data/app/views/cms/sections/new.html.erb +5 -0
  563. data/app/views/cms/sessions/new.html.erb +16 -0
  564. data/app/views/cms/shared/access_denied.html.erb +2 -0
  565. data/app/views/cms/shared/error.html.erb +40 -0
  566. data/app/views/cms/shared/error.xml.erb +8 -0
  567. data/app/views/cms/sites/_flash.html.erb +8 -0
  568. data/app/views/cms/sites/passwords/new.html.erb +2 -0
  569. data/app/views/cms/sites/sessions/new.html.erb +2 -0
  570. data/app/views/cms/tags/_form.html.erb +1 -0
  571. data/app/views/cms/tags/render.html.erb +52 -0
  572. data/app/views/cms/tasks/new.html.erb +22 -0
  573. data/app/views/cms/toolbar/_new_pages_menu.html.erb +10 -0
  574. data/app/views/cms/users/_form.html.erb +9 -0
  575. data/app/views/cms/users/_password.html.erb +2 -0
  576. data/app/views/cms/users/_user_fields.html.erb +7 -0
  577. data/app/views/cms/users/change_password.html.erb +12 -0
  578. data/app/views/cms/users/edit.html.erb +2 -0
  579. data/app/views/cms/users/index.html.erb +65 -0
  580. data/app/views/cms/users/new.html.erb +2 -0
  581. data/app/views/devise/confirmations/new.html.erb +16 -0
  582. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  583. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  584. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  585. data/app/views/devise/passwords/edit.html.erb +19 -0
  586. data/app/views/devise/passwords/new.html.erb +15 -0
  587. data/app/views/devise/registrations/edit.html.erb +28 -0
  588. data/app/views/devise/registrations/new.html.erb +18 -0
  589. data/app/views/devise/shared/_links.erb +25 -0
  590. data/app/views/devise/unlocks/new.html.erb +16 -0
  591. data/app/views/layouts/cms/_content_types.html.erb +13 -0
  592. data/app/views/layouts/cms/_footer.erb +4 -0
  593. data/app/views/layouts/cms/_head.html.erb +8 -0
  594. data/app/views/layouts/cms/_main_menu.html.erb +78 -0
  595. data/app/views/layouts/cms/application.html.erb +23 -0
  596. data/app/views/layouts/cms/content_page.html.erb +5 -0
  597. data/app/views/layouts/cms/page_editor.html.erb +90 -0
  598. data/app/views/portlets/deprecated_placeholders/_form.html.erb +1 -0
  599. data/app/views/portlets/deprecated_placeholders/render.html.erb +8 -0
  600. data/app/views/portlets/dynamic/_form.html.erb +3 -0
  601. data/app/views/portlets/email_page/_form.html.erb +5 -0
  602. data/app/views/portlets/email_page/render.html.erb +17 -0
  603. data/app/views/portlets/forgot_password/_form.html.erb +5 -0
  604. data/app/views/portlets/forgot_password/render.html.erb +2 -0
  605. data/app/views/portlets/list/_form.html.erb +33 -0
  606. data/app/views/portlets/list/_list.html.erb +6 -0
  607. data/app/views/portlets/list/_table.html.erb +13 -0
  608. data/app/views/portlets/list/render.html.erb +1 -0
  609. data/app/views/portlets/login/_form.html.erb +4 -0
  610. data/app/views/portlets/login/render.html.erb +10 -0
  611. data/app/views/portlets/portlets/_form.html.erb +20 -0
  612. data/app/views/portlets/tag_cloud/_form.html.erb +4 -0
  613. data/app/views/portlets/tag_cloud/render.html.erb +5 -0
  614. data/app/views/tests/pretend/open_with_layout.html.erb +5 -0
  615. data/bin/bcms +321 -0
  616. data/bin/browsercms +4 -0
  617. data/bin/rake +16 -0
  618. data/config/routes.rb +135 -0
  619. data/db/browsercms.seeds.rb +63 -0
  620. data/db/migrate/20080815014337_browsercms300.rb +287 -0
  621. data/db/migrate/20130327184912_browsercms400.rb +120 -0
  622. data/db/migrate/20150715173336_create_default_users.rb +12 -0
  623. data/db/seeds.rb +1 -0
  624. data/doc/README_FOR_APP +6 -0
  625. data/doc/design/blue_button.psd +0 -0
  626. data/doc/design/gray_box.psd +0 -0
  627. data/doc/design/main_nav.psd +0 -0
  628. data/doc/features/design_integration.md +45 -0
  629. data/doc/features/external_user.md +7 -0
  630. data/doc/features/form_builder.md +40 -0
  631. data/doc/features/simple_form_refactor.md +60 -0
  632. data/doc/performance_tuning_notes.md +12 -0
  633. data/doc/release_notes.md +837 -0
  634. data/doc/test_procedure.txt +141 -0
  635. data/lib/acts_as_list.rb +257 -0
  636. data/lib/browsercms-artirix.rb +1 -0
  637. data/lib/browsercms.rb +73 -0
  638. data/lib/cms/acts/cms_user.rb +131 -0
  639. data/lib/cms/acts/content_block.rb +61 -0
  640. data/lib/cms/acts/content_page.rb +90 -0
  641. data/lib/cms/acts.rb +7 -0
  642. data/lib/cms/admin_tab.rb +15 -0
  643. data/lib/cms/attachments/attachment_serving.rb +59 -0
  644. data/lib/cms/attachments/configuration.rb +88 -0
  645. data/lib/cms/authentication/controller.rb +120 -0
  646. data/lib/cms/authentication/test_password_strategy.rb +28 -0
  647. data/lib/cms/authentication.rb +4 -0
  648. data/lib/cms/authoring.rb +9 -0
  649. data/lib/cms/behaviors/archiving.rb +43 -0
  650. data/lib/cms/behaviors/attaching.rb +363 -0
  651. data/lib/cms/behaviors/categorizing.rb +31 -0
  652. data/lib/cms/behaviors/connecting.rb +141 -0
  653. data/lib/cms/behaviors/dynamic_attributes.rb +384 -0
  654. data/lib/cms/behaviors/flush_cache_on_change.rb +31 -0
  655. data/lib/cms/behaviors/hiding.rb +46 -0
  656. data/lib/cms/behaviors/namespacing.rb +15 -0
  657. data/lib/cms/behaviors/naming.rb +16 -0
  658. data/lib/cms/behaviors/publishing.rb +205 -0
  659. data/lib/cms/behaviors/rendering.rb +195 -0
  660. data/lib/cms/behaviors/searching.rb +45 -0
  661. data/lib/cms/behaviors/soft_deleting.rb +103 -0
  662. data/lib/cms/behaviors/taggable.rb +66 -0
  663. data/lib/cms/behaviors/userstamping.rb +42 -0
  664. data/lib/cms/behaviors/versioning.rb +360 -0
  665. data/lib/cms/behaviors.rb +34 -0
  666. data/lib/cms/caching.rb +62 -0
  667. data/lib/cms/commands/actions.rb +107 -0
  668. data/lib/cms/commands/to_version400.rb +10 -0
  669. data/lib/cms/concerns/can_be_addressable.rb +326 -0
  670. data/lib/cms/concerns/has_content_type.rb +46 -0
  671. data/lib/cms/concerns/ignores_publishing.rb +9 -0
  672. data/lib/cms/concerns.rb +7 -0
  673. data/lib/cms/configuration/configurable_template.rb +24 -0
  674. data/lib/cms/configuration/devise.rb +256 -0
  675. data/lib/cms/configuration.rb +79 -0
  676. data/lib/cms/configure_simple_form.rb +142 -0
  677. data/lib/cms/configure_simple_form_bootstrap.rb +58 -0
  678. data/lib/cms/content_filter.rb +18 -0
  679. data/lib/cms/content_page.rb +77 -0
  680. data/lib/cms/content_rendering_support.rb +114 -0
  681. data/lib/cms/controllers/admin_controller.rb +78 -0
  682. data/lib/cms/data_loader.rb +54 -0
  683. data/lib/cms/date_picker.rb +23 -0
  684. data/lib/cms/default_accessible.rb +13 -0
  685. data/lib/cms/domain_support.rb +38 -0
  686. data/lib/cms/engine.rb +135 -0
  687. data/lib/cms/engine_helper.rb +103 -0
  688. data/lib/cms/error_handling.rb +84 -0
  689. data/lib/cms/error_pages.rb +8 -0
  690. data/lib/cms/extensions/action_view/base.rb +13 -0
  691. data/lib/cms/extensions/active_model/name.rb +13 -0
  692. data/lib/cms/extensions/active_record/base.rb +37 -0
  693. data/lib/cms/extensions/active_record/connection_adapters/abstract/schema_statements.rb +94 -0
  694. data/lib/cms/extensions/active_record/errors.rb +12 -0
  695. data/lib/cms/extensions/active_support/cache/file_store.rb +9 -0
  696. data/lib/cms/extensions/hash.rb +11 -0
  697. data/lib/cms/extensions/integer.rb +16 -0
  698. data/lib/cms/extensions/nil.rb +19 -0
  699. data/lib/cms/extensions/string.rb +24 -0
  700. data/lib/cms/extensions.rb +5 -0
  701. data/lib/cms/form_builder/content_block_form_builder.rb +45 -0
  702. data/lib/cms/form_builder/default_input.rb +13 -0
  703. data/lib/cms/form_builder/deprecated_inputs.rb +40 -0
  704. data/lib/cms/form_builder/workflow_buttons.rb +38 -0
  705. data/lib/cms/installation_actions.rb +8 -0
  706. data/lib/cms/mobile_aware.rb +67 -0
  707. data/lib/cms/module.rb +36 -0
  708. data/lib/cms/module_installation.rb +31 -0
  709. data/lib/cms/polymorphic_single_table_inheritance.rb +19 -0
  710. data/lib/cms/publish_workflow.rb +26 -0
  711. data/lib/cms/responders/content_responder.rb +14 -0
  712. data/lib/cms/route_extensions.rb +157 -0
  713. data/lib/cms/users_service.rb +208 -0
  714. data/lib/cms/version.rb +11 -0
  715. data/lib/command_line.rb +39 -0
  716. data/lib/generators/browser_cms/demo_site/USAGE +3 -0
  717. data/lib/generators/browser_cms/demo_site/templates/demo.seeds.rb +249 -0
  718. data/lib/generators/browser_cms/demo_site/templates/demo_site.rake +14 -0
  719. data/lib/generators/browser_cms/demo_site/templates/logo.jpg +0 -0
  720. data/lib/generators/browser_cms/demo_site/templates/splash.jpg +0 -0
  721. data/lib/generators/browser_cms/demo_site/templates/style.css +257 -0
  722. data/lib/generators/browser_cms.rb +12 -0
  723. data/lib/generators/cms/content_block/USAGE +22 -0
  724. data/lib/generators/cms/content_block/content_block_generator.rb +103 -0
  725. data/lib/generators/cms/content_block/templates/_form.html.erb +27 -0
  726. data/lib/generators/cms/content_block/templates/application_controller.rb.erb +4 -0
  727. data/lib/generators/cms/content_block/templates/render.html.erb +23 -0
  728. data/lib/generators/cms/install/USAGE +8 -0
  729. data/lib/generators/cms/install/install_generator.rb +16 -0
  730. data/lib/generators/cms/portlet/USAGE +26 -0
  731. data/lib/generators/cms/portlet/portlet_generator.rb +38 -0
  732. data/lib/generators/cms/portlet/templates/_form.html.erb +5 -0
  733. data/lib/generators/cms/portlet/templates/portlet.rb +12 -0
  734. data/lib/generators/cms/portlet/templates/portlet_helper.rb +5 -0
  735. data/lib/generators/cms/portlet/templates/render.html.erb +1 -0
  736. data/lib/generators/cms/portlet/templates/unit_test.erb +9 -0
  737. data/lib/generators/cms/project/USAGE +1 -0
  738. data/lib/generators/cms/project/templates/COPYRIGHT.txt +23 -0
  739. data/lib/generators/cms/project/templates/GPL.txt +674 -0
  740. data/lib/generators/cms/project/templates/LICENSE.txt +165 -0
  741. data/lib/generators/cms/project/templates/USAGE +3 -0
  742. data/lib/generators/cms/project/templates/devise.rb.erb +7 -0
  743. data/lib/generators/cms/project/templates/gitignore.erb +11 -0
  744. data/lib/generators/cms/project/templates/install_generator.erb +21 -0
  745. data/lib/generators/cms/project/templates/module_tasks.rake +10 -0
  746. data/lib/generators/cms/template/USAGE +10 -0
  747. data/lib/generators/cms/template/template_generator.rb +29 -0
  748. data/lib/generators/cms/template/templates/template.erb +2 -0
  749. data/lib/sequence.rb +6 -0
  750. data/lib/tasks/cms.rake +23 -0
  751. data/lib/templates/active_record/model/model.rb +17 -0
  752. data/vendor/assets/javascripts/jquery.cookie.js +91 -0
  753. data/vendor/assets/javascripts/jquery.selectbox.js +209 -0
  754. metadata +1048 -0
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,3 @@
1
+ Installs <%= current_project %> into a project. Typically invoked indirectly via:
2
+
3
+ rails generate cms:install <%= current_project %>
@@ -0,0 +1,7 @@
1
+ # Configuration for Devise specific to your project.
2
+ # BrowserCMS has configured defaults for most other values.
3
+ Devise.setup do |config|
4
+
5
+ config.secret_key = '<%= SecureRandom.hex(64) %>'
6
+
7
+ end
@@ -0,0 +1,11 @@
1
+ coverage/**/*
2
+ .DS_Store
3
+ log/*.log
4
+ tmp/**/*
5
+ db/*.sqlite3
6
+ db/schema.rb
7
+ *.gem
8
+ .dotest
9
+ tmp/restart.txt
10
+ public/cache
11
+ Gemfile.lock
@@ -0,0 +1,21 @@
1
+ require 'cms/module_installation'
2
+
3
+ class <%= module_class %>::InstallGenerator < Cms::ModuleInstallation
4
+ add_migrations_directory_to_source_root __FILE__
5
+
6
+
7
+ def copy_migrations
8
+ rake '<%= current_project %>:install:migrations'
9
+ end
10
+
11
+ # Uncomment to add module specific seed data to a project.
12
+ #def add_seed_data_to_project
13
+ # copy_file "../<%= current_project %>.seeds.rb", "db/<%= current_project %>.seeds.rb"
14
+ # append_to_file "db/seeds.rb", "load File.expand_path('../<%= current_project %>.seeds.rb', __FILE__)\n"
15
+ #end
16
+
17
+ def add_routes
18
+ mount_engine(<%= module_class %>)
19
+ end
20
+
21
+ end
@@ -0,0 +1,10 @@
1
+ # Provides tasks to make developing BrowserCMS modules easier.
2
+ # Should not be packaged with the gem.
3
+ namespace :db do
4
+
5
+ # This copy of the core CMS task is necessary because Engines push all existing Rails tasks under app:db:install
6
+ desc 'Creates and populates the initial BrowserCMS database for a new project.'
7
+ task :install => %w{ db:create db:migrate db:seed }
8
+
9
+
10
+ end
@@ -0,0 +1,10 @@
1
+ Description:
2
+ Generates a basic page template in the project.
3
+
4
+ Example:
5
+ `rails generate template subpage`
6
+
7
+ A page template in html format using erb.
8
+ Template: app/views/layouts/templates/subpage.html.erb
9
+
10
+
@@ -0,0 +1,29 @@
1
+ module Cms
2
+ module Generators
3
+ class TemplateGenerator < Rails::Generators::NamedBase
4
+
5
+ source_root File.expand_path('../templates', __FILE__)
6
+ class_option :mobile, :type => :boolean, :default => false, :desc => "mobile?"
7
+
8
+ def create_template
9
+ if mobile?
10
+ subdir = 'mobile'
11
+ else
12
+ subdir = 'templates'
13
+ end
14
+ template_dir = "app/views/layouts/#{subdir}"
15
+ template 'template.erb', File.join(template_dir, "#{template_name}.html.erb")
16
+ end
17
+
18
+ private
19
+
20
+ def mobile?
21
+ options[:mobile]
22
+ end
23
+
24
+ def template_name
25
+ file_name
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,2 @@
1
+ <% require 'cms/templates' -%>
2
+ <%= Cms::Templates.default_body %>
data/lib/sequence.rb ADDED
@@ -0,0 +1,6 @@
1
+ class Sequence
2
+ @current_value = 0
3
+ def self.next
4
+ @current_value += 1
5
+ end
6
+ end
@@ -0,0 +1,23 @@
1
+ # Provides Rake tasks for BrowserCMS projects.
2
+
3
+ namespace :db do
4
+
5
+ desc "[BrowserCMS] Creates and populates the initial database for a new project."
6
+ task :install => ["db:create", "db:migrate", "db:seed"]
7
+
8
+ desc "[BrowserCMS] Drop, create and migrate the database"
9
+ task :reinstall => ["db:drop", "db:install"]
10
+
11
+ namespace :seed do
12
+
13
+ desc "[BrowserCMS] Loads just the seed data from db/browsercms.seeds.rb"
14
+ task :browsercms => :environment do
15
+ load File.join("db", "browsercms.seeds.rb")
16
+ end
17
+ end
18
+
19
+ end
20
+
21
+
22
+
23
+
@@ -0,0 +1,17 @@
1
+ <% module_namespacing do -%>
2
+ class <%= class_name %> < <%= parent_class_name.classify %>
3
+ <% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
4
+ belongs_to :<%= attribute.name %>
5
+ <% end -%>
6
+ <% # These are BrowserCMS specific extensions to the model generator. -%>
7
+ <% attributes.select {|attr| attr.type == :category }.each do |attribute| -%>
8
+ belongs_to_category
9
+ <% end -%>
10
+ <% attributes.select {|attr| attr.type == :attachment }.each do |attribute| -%>
11
+ has_attachment :<%= attribute.name %>
12
+ <% end -%>
13
+ <% attributes.select {|attr| attr.type == :attachments }.each do |attribute| -%>
14
+ has_many_attachments :<%= attribute.name %>
15
+ <% end -%>
16
+ end
17
+ <% end -%>
@@ -0,0 +1,91 @@
1
+ /*jslint browser: true */ /*global jQuery: true */
2
+
3
+ /**
4
+ * jQuery Cookie plugin
5
+ *
6
+ * Copyright (c) 2010 Klaus Hartl (stilbuero.de)
7
+ * Dual licensed under the MIT and GPL licenses:
8
+ * http://www.opensource.org/licenses/mit-license.php
9
+ * http://www.gnu.org/licenses/gpl.html
10
+ *
11
+ */
12
+
13
+ // TODO JsDoc
14
+
15
+ /**
16
+ * Create a cookie with the given key and value and other optional parameters.
17
+ *
18
+ * @example $.cookie('the_cookie', 'the_value');
19
+ * @desc Set the value of a cookie.
20
+ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
21
+ * @desc Create a cookie with all available options.
22
+ * @example $.cookie('the_cookie', 'the_value');
23
+ * @desc Create a session cookie.
24
+ * @example $.cookie('the_cookie', null);
25
+ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
26
+ * used when the cookie was set.
27
+ *
28
+ * @param String key The key of the cookie.
29
+ * @param String value The value of the cookie.
30
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
31
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
32
+ * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
33
+ * If set to null or omitted, the cookie will be a session cookie and will not be retained
34
+ * when the the browser exits.
35
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
36
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
37
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
38
+ * require a secure protocol (like HTTPS).
39
+ * @type undefined
40
+ *
41
+ * @name $.cookie
42
+ * @cat Plugins/Cookie
43
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
44
+ */
45
+
46
+ /**
47
+ * Get the value of a cookie with the given key.
48
+ *
49
+ * @example $.cookie('the_cookie');
50
+ * @desc Get the value of a cookie.
51
+ *
52
+ * @param String key The key of the cookie.
53
+ * @return The value of the cookie.
54
+ * @type String
55
+ *
56
+ * @name $.cookie
57
+ * @cat Plugins/Cookie
58
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
59
+ */
60
+ jQuery.cookie = function (key, value, options) {
61
+
62
+ // key and at least value given, set cookie...
63
+ if (arguments.length > 1 && String(value) !== "[object Object]") {
64
+ options = jQuery.extend({}, options);
65
+
66
+ if (value === null || value === undefined) {
67
+ options.expires = -1;
68
+ }
69
+
70
+ if (typeof options.expires === 'number') {
71
+ var days = options.expires, t = options.expires = new Date();
72
+ t.setDate(t.getDate() + days);
73
+ }
74
+
75
+ value = String(value);
76
+
77
+ return (document.cookie = [
78
+ encodeURIComponent(key), '=',
79
+ options.raw ? value : encodeURIComponent(value),
80
+ options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
81
+ options.path ? '; path=' + options.path : '',
82
+ options.domain ? '; domain=' + options.domain : '',
83
+ options.secure ? '; secure' : ''
84
+ ].join(''));
85
+ }
86
+
87
+ // key and possibly options given, get cookie...
88
+ options = value || {};
89
+ var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
90
+ return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
91
+ };
@@ -0,0 +1,209 @@
1
+ /*
2
+ * jQuery selectbox plugin
3
+ *
4
+ * Copyright (c) 2007 Sadri Sahraoui (brainfault.com)
5
+ * Licensed under the GPL license and MIT:
6
+ * http://www.opensource.org/licenses/GPL-license.php
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ *
9
+ * The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete)
10
+ *
11
+ * Revision: $Id$
12
+ * Version: 0.5
13
+ *
14
+ * Changelog :
15
+ * Version 0.5
16
+ * - separate css style for current selected element and hover element which solve the highlight issue
17
+ * Version 0.4
18
+ * - Fix width when the select is in a hidden div @Pawel Maziarz
19
+ * - Add a unique id for generated li to avoid conflict with other selects and empty values @Pawel Maziarz
20
+ */
21
+ jQuery.fn.extend({
22
+ selectbox: function(options) {
23
+ return this.each(function() {
24
+ new jQuery.SelectBox(this, options);
25
+ });
26
+ }
27
+ });
28
+
29
+
30
+ /* pawel maziarz: work around for ie logging */
31
+ if (!window.console) {
32
+ var console = {
33
+ log: function(msg) {
34
+ }
35
+ }
36
+ }
37
+ /* */
38
+
39
+ jQuery.SelectBox = function(selectobj, options) {
40
+
41
+ var opt = options || {};
42
+ opt.inputClass = opt.inputClass || "selectbox";
43
+ opt.containerClass = opt.containerClass || "selectbox-wrapper";
44
+ opt.hoverClass = opt.hoverClass || "current";
45
+ opt.currentClass = opt.selectedClass || "selected"
46
+ opt.debug = opt.debug || false;
47
+
48
+ var elm_id = selectobj.id;
49
+ var active = -1;
50
+ var inFocus = false;
51
+ var hasfocus = 0;
52
+ //jquery object for select element
53
+ var $select = $(selectobj);
54
+ // jquery container object
55
+ var $container = setupContainer(opt);
56
+ //jquery input object
57
+ var $input = setupInput(opt);
58
+ // hide select and append newly created elements
59
+ $select.hide().before($input).before($container);
60
+
61
+
62
+ init();
63
+
64
+ $input
65
+ .click(function(){
66
+ if (!inFocus) {
67
+ $container.toggle();
68
+ }
69
+ })
70
+ .focus(function(){
71
+ if ($container.not(':visible')) {
72
+ inFocus = true;
73
+ $container.show();
74
+ }
75
+ })
76
+ .keydown(function(event) {
77
+ switch(event.keyCode) {
78
+ case 38: // up
79
+ event.preventDefault();
80
+ moveSelect(-1);
81
+ break;
82
+ case 40: // down
83
+ event.preventDefault();
84
+ moveSelect(1);
85
+ break;
86
+ //case 9: // tab
87
+ case 13: // return
88
+ event.preventDefault(); // seems not working in mac !
89
+ $('li.'+opt.hoverClass).trigger('click');
90
+ break;
91
+ case 27: //escape
92
+ hideMe();
93
+ break;
94
+ }
95
+ })
96
+ .blur(function() {
97
+ if ($container.is(':visible') && hasfocus > 0 ) {
98
+ if(opt.debug) console.log('container visible and has focus')
99
+ } else {
100
+ hideMe();
101
+ }
102
+ });
103
+
104
+
105
+ function hideMe() {
106
+ hasfocus = 0;
107
+ $container.hide();
108
+ }
109
+
110
+ function init() {
111
+ $container.append(getSelectOptions($input.attr('id'))).hide();
112
+ var width = opt.width || $input.css('width');
113
+ $container.width(width);
114
+ }
115
+
116
+ function setupContainer(options) {
117
+ var container = document.createElement("div");
118
+ $container = $(container);
119
+ $container.attr('id', elm_id+'_container');
120
+ $container.addClass(options.containerClass);
121
+
122
+ return $container;
123
+ }
124
+
125
+ function setupInput(options) {
126
+ var input = document.createElement("input");
127
+ var $input = $(input);
128
+ $input.attr("id", elm_id+"_input");
129
+ $input.attr("type", "text");
130
+ $input.addClass(options.inputClass);
131
+ $input.attr("autocomplete", "off");
132
+ $input.attr("readonly", "readonly");
133
+ $input.attr("tabIndex", $select.attr("tabindex")); // "I" capital is important for ie
134
+
135
+ return $input;
136
+ }
137
+
138
+ function moveSelect(step) {
139
+ var lis = $("li", $container);
140
+ if (!lis) return;
141
+
142
+ active += step;
143
+
144
+ if (active < 0) {
145
+ active = 0;
146
+ } else if (active >= lis.size()) {
147
+ active = lis.size() - 1;
148
+ }
149
+
150
+ lis.removeClass(opt.hoverClass);
151
+
152
+ $(lis[active]).addClass(opt.hoverClass);
153
+ }
154
+
155
+ function setCurrent() {
156
+ var li = $("li."+opt.currentClass, $container).get(0);
157
+ var el = li.id.replace($select[0].id+'_input_','');
158
+ $select.val(el);
159
+ $select.change(); //trigger the change event for the select
160
+ $input.val($(li).html());
161
+ return true;
162
+ }
163
+
164
+ // select value
165
+ function getCurrentSelected() {
166
+ return $select.val();
167
+ }
168
+
169
+ // input value
170
+ function getCurrentValue() {
171
+ return $input.val();
172
+ }
173
+
174
+ function getSelectOptions(parentid) {
175
+ var select_options = new Array();
176
+ var ul = document.createElement('ul');
177
+ $select.children('option').each(function() {
178
+ var li = document.createElement('li');
179
+ li.setAttribute('id', parentid + '_' + $(this).val());
180
+ li.innerHTML = $(this).html();
181
+ if ($(this).is(':selected')) {
182
+ $input.val($(this).html());
183
+ $(li).addClass(opt.currentClass);
184
+ }
185
+ ul.appendChild(li);
186
+ $(li)
187
+ .mouseover(function(event) {
188
+ hasfocus = 1;
189
+ if (opt.debug) console.log('over on : '+this.id);
190
+ jQuery(event.target, $container).addClass(opt.hoverClass);
191
+ })
192
+ .mouseout(function(event) {
193
+ hasfocus = -1;
194
+ if (opt.debug) console.log('out on : '+this.id);
195
+ jQuery(event.target, $container).removeClass(opt.hoverClass);
196
+ })
197
+ .click(function(event) {
198
+ var fl = $('li.'+opt.hoverClass, $container).get(0);
199
+ if (opt.debug) console.log('click on :'+this.id);
200
+ $('li.'+opt.currentClass).removeClass(opt.currentClass);
201
+ $(this).addClass(opt.currentClass);
202
+ setCurrent();
203
+ hideMe();
204
+ });
205
+ });
206
+ return ul;
207
+ }
208
+
209
+ };