Skip to content
Browse files

Remove Jeweler/old CMS and Rails files.

* Remove all jeweler dependencies (use bundler)
* Installing the module should copy seed data.
* Fix html_safe bugs.
* Remove copied core CMS files (no longer necessary)
* Remove Rails 2.x script files
* Update dependencies for project.
* Remove Rails 3.x upgrade plugin
  • Loading branch information...
1 parent 41ae2a6 commit d19a20600f85ef2b6056b9a67aa3ce9692742017 @peakpg peakpg committed Jan 13, 2012
Showing with 71 additions and 15,423 deletions.
  1. +0 −3 Gemfile
  2. +38 −41 Gemfile.lock
  3. +0 −4 VERSION.yml
  4. +2 −2 app/views/portlets/news_archive/render.html.erb
  5. +1 −1 app/views/portlets/news_article/render.html.erb
  6. +23 −39 bcms_news.gemspec
  7. +3 −0 lib/bcms_news/version.rb
  8. +4 −0 lib/generators/bcms_news/install/install_generator.rb
  9. BIN public/images/cms/administration/user_browser_bg.gif
  10. BIN public/images/cms/bg.png
  11. BIN public/images/cms/bl_curve.png
  12. BIN public/images/cms/bottom_cap.png
  13. BIN public/images/cms/bottom_cap_content.png
  14. BIN public/images/cms/browse.gif
  15. BIN public/images/cms/browser_media_logo.png
  16. BIN public/images/cms/browsercms_logo.png
  17. BIN public/images/cms/buttons/button.png
  18. BIN public/images/cms/buttons/button_bg.png
  19. BIN public/images/cms/buttons/button_cap.png
  20. BIN public/images/cms/buttons/button_cap_h.png
  21. BIN public/images/cms/buttons/button_cap_off.gif
  22. BIN public/images/cms/buttons/button_h.png
  23. BIN public/images/cms/buttons/button_off.png
  24. BIN public/images/cms/buttons/delete_x.png
  25. BIN public/images/cms/buttons/delete_x_disabled.png
  26. BIN public/images/cms/buttons/delete_x_h.png
  27. BIN public/images/cms/buttons/sm_button.gif
  28. BIN public/images/cms/buttons/sm_button_2.gif
  29. BIN public/images/cms/buttons/sm_button_2_h.gif
  30. BIN public/images/cms/buttons/sm_button_h.gif
  31. BIN public/images/cms/containers/add.gif
  32. BIN public/images/cms/containers/alpha.png
  33. BIN public/images/cms/containers/beta.png
  34. BIN public/images/cms/containers/delete.gif
  35. BIN public/images/cms/containers/down.gif
  36. BIN public/images/cms/containers/edit.gif
  37. BIN public/images/cms/containers/up.gif
  38. BIN public/images/cms/containers/view.gif
  39. BIN public/images/cms/content_bg.gif
  40. BIN public/images/cms/dashboard/bottom_cap.png
  41. BIN public/images/cms/dashboard/bottom_cap_content.png
  42. BIN public/images/cms/dashboard/header_bg.gif
  43. BIN public/images/cms/dashboard/header_left_bg.gif
  44. BIN public/images/cms/dashboard/table_header_bg.gif
  45. BIN public/images/cms/dashboard/top_cap.png
  46. BIN public/images/cms/dashed.gif
  47. BIN public/images/cms/datepicker/clear.gif
  48. BIN public/images/cms/datepicker/close.gif
  49. BIN public/images/cms/dk_button_l.gif
  50. BIN public/images/cms/dk_button_r.gif
  51. BIN public/images/cms/dot.png
  52. BIN public/images/cms/draft_status.gif
  53. BIN public/images/cms/gray_long_bg.gif
  54. BIN public/images/cms/icons/actions/add.png
  55. BIN public/images/cms/icons/actions/config.png
  56. BIN public/images/cms/icons/actions/connect.png
  57. BIN public/images/cms/icons/actions/delete.png
  58. BIN public/images/cms/icons/actions/down.png
  59. BIN public/images/cms/icons/actions/edit.png
  60. BIN public/images/cms/icons/actions/folder.png
  61. BIN public/images/cms/icons/actions/folder_add.png
  62. BIN public/images/cms/icons/actions/folder_delete.png
  63. BIN public/images/cms/icons/actions/folder_edit.png
  64. BIN public/images/cms/icons/actions/folder_move.png
  65. BIN public/images/cms/icons/actions/folder_open.png
  66. BIN public/images/cms/icons/actions/history.png
  67. BIN public/images/cms/icons/actions/home.png
  68. BIN public/images/cms/icons/actions/left.png
  69. BIN public/images/cms/icons/actions/link.png
  70. BIN public/images/cms/icons/actions/page.png
  71. BIN public/images/cms/icons/actions/page_add.png
  72. BIN public/images/cms/icons/actions/page_edit.png
  73. BIN public/images/cms/icons/actions/page_move.png
  74. BIN public/images/cms/icons/actions/redo.png
  75. BIN public/images/cms/icons/actions/refresh.png
  76. BIN public/images/cms/icons/actions/right.png
  77. BIN public/images/cms/icons/actions/root_folder.png
  78. BIN public/images/cms/icons/actions/root_link.png
  79. BIN public/images/cms/icons/actions/root_page.png
  80. BIN public/images/cms/icons/actions/undo.png
  81. BIN public/images/cms/icons/actions/up.png
  82. BIN public/images/cms/icons/actions/view.png
  83. BIN public/images/cms/icons/file_types/doc.png
  84. BIN public/images/cms/icons/file_types/file.png
  85. BIN public/images/cms/icons/file_types/gif.png
  86. BIN public/images/cms/icons/file_types/htm.png
  87. BIN public/images/cms/icons/file_types/pdf.png
  88. BIN public/images/cms/icons/file_types/ppt.png
  89. BIN public/images/cms/icons/file_types/swf.png
  90. BIN public/images/cms/icons/file_types/txt.png
  91. BIN public/images/cms/icons/file_types/xls.png
  92. BIN public/images/cms/icons/file_types/xml.png
  93. BIN public/images/cms/icons/file_types/zip.png
  94. BIN public/images/cms/icons/status/archived.gif
  95. BIN public/images/cms/icons/status/draft.gif
  96. BIN public/images/cms/icons/status/hidden.gif
  97. BIN public/images/cms/icons/status/locked.gif
  98. BIN public/images/cms/icons/status/published.gif
  99. BIN public/images/cms/icons/status/unlocked.gif
  100. BIN public/images/cms/icons/user.png
  101. BIN public/images/cms/login_bg.jpg
  102. BIN public/images/cms/login_bottom.jpg
  103. BIN public/images/cms/login_top.gif
  104. BIN public/images/cms/lt_button_bg.gif
  105. BIN public/images/cms/lt_button_l.gif
  106. BIN public/images/cms/lt_button_r.gif
  107. BIN public/images/cms/menu.png
  108. BIN public/images/cms/menu/block_cap_h.gif
  109. BIN public/images/cms/menu/bottom_cap.png
  110. BIN public/images/cms/menu/bottom_cap_menu.png
  111. BIN public/images/cms/menu/bottom_cap_menu_first.png
  112. BIN public/images/cms/menu/menu_header_first_bg.gif
  113. BIN public/images/cms/menu/selected_block_cap.gif
  114. BIN public/images/cms/menu/top_cap.png
  115. BIN public/images/cms/menu/top_cap_menu_header.png
  116. BIN public/images/cms/menu_h.gif
  117. BIN public/images/cms/menu_header.png
  118. BIN public/images/cms/menu_open.png
  119. BIN public/images/cms/menu_open_bg.gif
  120. BIN public/images/cms/nav.png
  121. BIN public/images/cms/nav/on_bg.gif
  122. BIN public/images/cms/nav_cap.png
  123. BIN public/images/cms/nav_cap_h.gif
  124. BIN public/images/cms/nav_h.gif
  125. BIN public/images/cms/page_toolbar/page_toolbar_bg.gif
  126. BIN public/images/cms/page_toolbar/page_toolbar_inset_bg.gif
  127. BIN public/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif
  128. BIN public/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif
  129. BIN public/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif
  130. BIN public/images/cms/page_toolbar/page_toolbar_inset_l.gif
  131. BIN public/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif
  132. BIN public/images/cms/page_toolbar/page_toolbar_inset_published_l.gif
  133. BIN public/images/cms/page_toolbar/page_toolbar_inset_published_r.gif
  134. BIN public/images/cms/page_toolbar/page_toolbar_inset_r.gif
  135. BIN public/images/cms/page_toolbar/page_toolbar_l.gif
  136. BIN public/images/cms/page_toolbar/page_toolbar_r.gif
  137. BIN public/images/cms/page_toolbar/status_draft_bg.gif
  138. BIN public/images/cms/page_toolbar/status_draft_l.gif
  139. BIN public/images/cms/page_toolbar/status_l.gif
  140. BIN public/images/cms/page_toolbar/status_published_bg.gif
  141. BIN public/images/cms/page_toolbar/status_published_l.gif
  142. BIN public/images/cms/page_toolbar/visual_editor_bg.gif
  143. BIN public/images/cms/page_toolbar/visual_editor_end.gif
  144. BIN public/images/cms/page_toolbar/visual_editor_r.gif
  145. BIN public/images/cms/page_toolbar/visual_editor_state_bg.gif
  146. BIN public/images/cms/pages/add_connectable.gif
  147. BIN public/images/cms/pages/connect_connectable.gif
  148. BIN public/images/cms/pages/container_border.gif
  149. BIN public/images/cms/pages/container_border_l.gif
  150. BIN public/images/cms/pages/container_border_r.gif
  151. BIN public/images/cms/pages/delete_connectable.gif
  152. BIN public/images/cms/pages/down_connectable.gif
  153. BIN public/images/cms/pages/down_connectable_disabled.gif
  154. BIN public/images/cms/pages/edit_connectable.gif
  155. BIN public/images/cms/pages/edit_connectable_2.gif
  156. BIN public/images/cms/pages/show_connectable.gif
  157. BIN public/images/cms/pages/up_connectable.gif
  158. BIN public/images/cms/pages/up_connectable_disabled.gif
  159. BIN public/images/cms/pagination/first.gif
  160. BIN public/images/cms/pagination/first_h.gif
  161. BIN public/images/cms/pagination/input.gif
  162. BIN public/images/cms/pagination/last.gif
  163. BIN public/images/cms/pagination/last_h.gif
  164. BIN public/images/cms/pagination/next.gif
  165. BIN public/images/cms/pagination/next_h.gif
  166. BIN public/images/cms/pagination/previous.gif
  167. BIN public/images/cms/pagination/previous_h.gif
  168. BIN public/images/cms/published_status.gif
  169. BIN public/images/cms/search.png
  170. BIN public/images/cms/search_submit.gif
  171. BIN public/images/cms/search_submit_h.gif
  172. BIN public/images/cms/searchbox_gradient.gif
  173. BIN public/images/cms/select_bg.gif
  174. BIN public/images/cms/select_bg_2.gif
  175. BIN public/images/cms/sitemap/bottom_cap.png
  176. BIN public/images/cms/sitemap/buffer_caps.png
  177. BIN public/images/cms/sitemap/contract.png
  178. BIN public/images/cms/sitemap/corners.gif
  179. BIN public/images/cms/sitemap/corners_hover.gif
  180. BIN public/images/cms/sitemap/divider.gif
  181. BIN public/images/cms/sitemap/expand.png
  182. BIN public/images/cms/sitemap/gradient.gif
  183. BIN public/images/cms/sitemap/gray_contract.png
  184. BIN public/images/cms/sitemap/gray_expand.png
  185. BIN public/images/cms/sitemap/no_contents.png
  186. BIN public/images/cms/sitemap/site_root_cap.png
  187. BIN public/images/cms/sitemap/tooltip.gif
  188. BIN public/images/cms/sitemap/top_cap_content.png
  189. BIN public/images/cms/solid.gif
  190. BIN public/images/cms/table/bl.gif
  191. BIN public/images/cms/table/br.gif
  192. BIN public/images/cms/table/divider.gif
  193. BIN public/images/cms/table/td_cap_first_h.gif
  194. BIN public/images/cms/table/td_cap_first_s.gif
  195. BIN public/images/cms/table/td_cap_last_h.gif
  196. BIN public/images/cms/table/td_cap_last_s.gif
  197. BIN public/images/cms/table/td_last_bg.gif
  198. BIN public/images/cms/table/th_bg.gif
  199. BIN public/images/cms/table/th_divider.gif
  200. BIN public/images/cms/table/th_last_bg.gif
  201. BIN public/images/cms/table/tl.gif
  202. BIN public/images/cms/table/tr.gif
  203. BIN public/images/cms/table/tr_bg.gif
  204. BIN public/images/cms/thickbox/loadingAnimation.gif
  205. BIN public/images/cms/thickbox/macFFBgHack.png
  206. BIN public/images/cms/toolbar_bg.png
  207. BIN public/images/cms/top_cap.png
  208. BIN public/images/cms/top_cap_content.png
  209. BIN public/images/cms/top_cap_menu_header.png
  210. BIN public/images/cms/user_search_submit.gif
  211. BIN public/images/cms/usercontrols_bg.png
  212. BIN public/images/cms/usercontrols_bg_cap.png
  213. BIN public/images/rails.png
  214. +0 −2 public/javascripts/application.js
  215. +0 −148 public/javascripts/cms/application.js
  216. +0 −56 public/javascripts/cms/editor.js
  217. +0 −426 public/javascripts/cms/sitemap.js
  218. +0 −965 public/javascripts/controls.js
  219. +0 −974 public/javascripts/dragdrop.js
  220. +0 −1,123 public/javascripts/effects.js
  221. +0 −591 public/javascripts/jquery-ui.js
  222. +0 −211 public/javascripts/jquery.contextMenu.js
  223. +0 −96 public/javascripts/jquery.cookie.js
  224. +0 −119 public/javascripts/jquery.dimensions.js
  225. +0 −11 public/javascripts/jquery.js
  226. +0 −209 public/javascripts/jquery.selectbox-0.5.js
  227. +0 −136 public/javascripts/jquery.taglist.js
  228. +0 −10 public/javascripts/jquery.thickbox.js
  229. +0 −6,001 public/javascripts/prototype.js
  230. +0 −175 public/javascripts/rails.js
  231. +0 −5 public/robots.txt
  232. +0 −1 public/site/customconfig.js
  233. 0 public/stylesheets/.gitkeep
  234. +0 −91 public/stylesheets/cms/administration.css
  235. +0 −166 public/stylesheets/cms/application.css
  236. +0 −26 public/stylesheets/cms/block.css
  237. +0 −111 public/stylesheets/cms/buttons.css
  238. +0 −138 public/stylesheets/cms/content_library.css
  239. +0 −4 public/stylesheets/cms/content_types.css
  240. +0 −118 public/stylesheets/cms/dashboard.css
  241. +0 −156 public/stylesheets/cms/data_table.css
  242. +0 −73 public/stylesheets/cms/date_picker.css
  243. +0 −269 public/stylesheets/cms/form_layout.css
  244. +0 −61 public/stylesheets/cms/jquery.contextMenu.css
  245. +0 −78 public/stylesheets/cms/login.css
  246. +0 −116 public/stylesheets/cms/menu.css
  247. +0 −111 public/stylesheets/cms/nav.css
  248. +0 −135 public/stylesheets/cms/page_toolbar.css
  249. +0 −46 public/stylesheets/cms/reset.css
  250. +0 −56 public/stylesheets/cms/selectbox.css
  251. +0 −374 public/stylesheets/cms/sitemap.css
  252. +0 −18 public/stylesheets/cms/taglist.css
  253. +0 −163 public/stylesheets/cms/thickbox.css
  254. +0 −4 script/about
  255. +0 −3 script/console
  256. +0 −3 script/dbconsole
  257. +0 −3 script/destroy
  258. +0 −3 script/generate
  259. +0 −3 script/performance/benchmarker
  260. +0 −3 script/performance/profiler
  261. +0 −3 script/plugin
  262. +0 −3 script/runner
  263. +0 −3 script/server
  264. +0 −9 test/performance/browsing_test.rb
  265. +0 −1 todo.txt
  266. 0 vendor/plugins/.gitkeep
  267. +0 −20 vendor/plugins/rails_upgrade/MIT-LICENSE
  268. +0 −20 vendor/plugins/rails_upgrade/README
  269. +0 −22 vendor/plugins/rails_upgrade/Rakefile
  270. +0 −2 vendor/plugins/rails_upgrade/init.rb
  271. +0 −38 vendor/plugins/rails_upgrade/install.rb
  272. +0 −472 vendor/plugins/rails_upgrade/lib/application_checker.rb
  273. +0 −95 vendor/plugins/rails_upgrade/lib/gemfile_generator.rb
  274. +0 −51 vendor/plugins/rails_upgrade/lib/new_configuration_generator.rb
  275. 0 vendor/plugins/rails_upgrade/lib/rails_upgrade.rb
  276. +0 −349 vendor/plugins/rails_upgrade/lib/routes_upgrader.rb
  277. +0 −78 vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake
  278. +0 −293 vendor/plugins/rails_upgrade/test/application_checker_test.rb
  279. +0 −72 vendor/plugins/rails_upgrade/test/gemfile_generator_test.rb
  280. +0 −63 vendor/plugins/rails_upgrade/test/new_configuration_generator_test.rb
  281. +0 −142 vendor/plugins/rails_upgrade/test/routes_upgrader_test.rb
  282. +0 −5 vendor/plugins/rails_upgrade/test/test_helper.rb
  283. +0 −1 vendor/plugins/rails_upgrade/uninstall.rb
View
3 Gemfile
@@ -1,12 +1,9 @@
source 'http://rubygems.org'
-# gem 'rails', '3.0.3'
-# gem 'browsercms', '3.3.0'
gemspec
# Gem Environments
group :development do
gem "mysql"
- gem 'jeweler'
end
View
79 Gemfile.lock
@@ -1,91 +1,88 @@
PATH
remote: .
specs:
- bcms_news (1.2.2)
- browsercms (>= 3.3.0)
+ bcms_news (1.2.3)
+ browsercms (~> 3.3.0)
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
- actionmailer (3.0.9)
- actionpack (= 3.0.9)
+ actionmailer (3.0.11)
+ actionpack (= 3.0.11)
mail (~> 2.2.19)
- actionpack (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
+ actionpack (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
- activemodel (3.0.9)
- activesupport (= 3.0.9)
+ activemodel (3.0.11)
+ activesupport (= 3.0.11)
builder (~> 2.1.2)
i18n (~> 0.5.0)
- activerecord (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
+ activerecord (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
arel (~> 2.0.10)
tzinfo (~> 0.3.23)
- activeresource (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
- activesupport (3.0.9)
+ activeresource (3.0.11)
+ activemodel (= 3.0.11)
+ activesupport (= 3.0.11)
+ activesupport (3.0.11)
arel (2.0.10)
- browsercms (3.3.1)
+ browsercms (3.3.2)
rails (~> 3.0.7)
term-ansicolor
builder (2.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
- git (1.2.5)
i18n (0.5.0)
- jeweler (1.5.2)
- bundler (~> 1.0.0)
- git (>= 1.2.5)
- rake
+ json (1.6.4)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.16)
+ mime-types (1.17.2)
mysql (2.8.1)
- polyglot (0.3.1)
- rack (1.2.3)
+ polyglot (0.3.3)
+ rack (1.2.5)
rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.9)
- actionmailer (= 3.0.9)
- actionpack (= 3.0.9)
- activerecord (= 3.0.9)
- activeresource (= 3.0.9)
- activesupport (= 3.0.9)
+ rails (3.0.11)
+ actionmailer (= 3.0.11)
+ actionpack (= 3.0.11)
+ activerecord (= 3.0.11)
+ activeresource (= 3.0.11)
+ activesupport (= 3.0.11)
bundler (~> 1.0)
- railties (= 3.0.9)
- railties (3.0.9)
- actionpack (= 3.0.9)
- activesupport (= 3.0.9)
+ railties (= 3.0.11)
+ railties (3.0.11)
+ actionpack (= 3.0.11)
+ activesupport (= 3.0.11)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.4)
- rake (0.8.7)
- rdoc (3.8)
- term-ansicolor (1.0.5)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ term-ansicolor (1.0.7)
thor (0.14.6)
- treetop (1.4.9)
+ treetop (1.4.10)
+ polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.29)
+ tzinfo (0.3.31)
PLATFORMS
ruby
DEPENDENCIES
bcms_news!
- jeweler
mysql
View
4 VERSION.yml
@@ -1,4 +0,0 @@
----
-:major: 1
-:minor: 2
-:patch: 0
View
4 app/views/portlets/news_archive/render.html.erb
@@ -9,9 +9,9 @@
<span class="release-date"><b><%= article.release_date.to_s(:long) %></b></span><br/>
<% end %>
- <%= link_to "<b>#{h(article.name)}</b>", news_article_path(article.route_params) %><br/>
+ <b><%= link_to article.name, news_article_path(article.route_params) %></b><br/>
<% unless article.summary.blank? -%>
- <p><%=h article.summary %></p>
+ <p><%= article.summary %></p>
<% end %>
</div>
<% end %>
View
2 app/views/portlets/news_article/render.html.erb
@@ -1,7 +1,7 @@
<% if @news_article -%>
<% page_title @news_article.name %>
<h2><%=h @news_article.name %></h2>
- <p><%= @news_article.body %></p>
+ <p><%= @news_article.body.html_safe %></p>
<% else -%>
<b>Missing required parameter</b><br/>
This portlet expects a request parameter 'news_article_id'. Be sure the calling page provides it.
View
62 bcms_news.gemspec
@@ -1,54 +1,38 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "bcms_news/version"
+
Gem::Specification.new do |s|
s.name = %q{bcms_news}
- s.version = "1.2.2"
+ s.version = BcmsNews::VERSION
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["BrowserMedia"]
- s.date = %q{2011-05-23}
s.description = %q{The News Module for BrowserCMS}
s.email = %q{github@browsermedia.com}
s.extra_rdoc_files = [
"LICENSE.txt",
"README.markdown"
]
- s.files = [
- "app/controllers/cms/news_articles_controller.rb",
- "app/controllers/news_articles_controller.rb",
- "app/models/news_article.rb",
- "app/portlets/news_archive_portlet.rb",
- "app/portlets/news_article_portlet.rb",
- "app/portlets/recent_news_portlet.rb",
- "app/views/cms/news_articles/_form.html.erb",
- "app/views/cms/news_articles/render.html.erb",
- "app/views/news_articles/index.rss.builder",
- "app/views/portlets/news_archive/_form.html.erb",
- "app/views/portlets/news_archive/render.html.erb",
- "app/views/portlets/news_article/_form.html.erb",
- "app/views/portlets/news_article/render.html.erb",
- "app/views/portlets/recent_news/_form.html.erb",
- "app/views/portlets/recent_news/render.html.erb",
- "db/migrate/20090410193313_create_news_articles.rb",
- "lib/bcms_news.rb",
- "lib/bcms_news/engine.rb",
- "lib/bcms_news/routes.rb",
- "lib/generators/bcms_news/install/USAGE",
- "lib/generators/bcms_news/install/install_generator.rb"
- ]
- s.homepage = %q{http://browsercms.org}
+ s.files += Dir["app/**/*"]
+ s.files += Dir["db/migrate/[0-9]*_create_news_articles.rb"]
+ s.files += Dir["db/bcms_news.seeds.rb"]
+ s.files += Dir["lib/**/*"]
+ s.files += Dir["Gemfile", "LICENSE.txt", "COPYRIGHT.txt", "GPL.txt" ]
+ s.files -= Dir['config/**/*',
+ 'public/**/*',
+ 'config.ru',
+ 'script/**/*',
+ 'app/controllers/application_controller.rb',
+ 'app/helpers/application_helper.rb',
+ 'app/layouts/templates/**/*',
+ 'lib/tasks/*']
+ s.homepage = %q{https://github.com/browsermedia/bcms_news}
s.require_paths = ["lib"]
- s.rubyforge_project = %q{browsercms}
- s.rubygems_version = %q{1.7.2}
+ s.rubyforge_project = s.name
s.summary = %q{The News Module for BrowserCMS}
- s.test_files = [
- "test/integration/news_articles_test.rb",
- "test/performance/browsing_test.rb",
- "test/test_helper.rb",
- "test/unit/news_article_test.rb",
- "test/unit/recent_news_portlet_test.rb"
- ]
-
-
- s.add_dependency(%q<browsercms>, [">= 3.3.0"])
+ s.test_files = Dir["test/**/*"]
+
+ s.add_dependency(%q<browsercms>, ["~> 3.3.0"])
end
View
3 lib/bcms_news/version.rb
@@ -0,0 +1,3 @@
+module BcmsNews
+ VERSION = "1.2.3"
+end
View
4 lib/generators/bcms_news/install/install_generator.rb
@@ -5,4 +5,8 @@ class BcmsNews::InstallGenerator < Cms::ModuleInstallation
copy_migration_file '20090410193313_create_news_articles.rb'
+ def add_seed_data_to_project
+ copy_file "../bcms_news.seeds.rb", "db/bcms_news.seeds.rb"
+ append_to_file "db/seeds.rb", "load File.expand_path('../bcms_news.seeds.rb', __FILE__)"
+ end
end
View
BIN public/images/cms/administration/user_browser_bg.gif
Deleted file not rendered
View
BIN public/images/cms/bg.png
Deleted file not rendered
View
BIN public/images/cms/bl_curve.png
Deleted file not rendered
View
BIN public/images/cms/bottom_cap.png
Deleted file not rendered
View
BIN public/images/cms/bottom_cap_content.png
Deleted file not rendered
View
BIN public/images/cms/browse.gif
Deleted file not rendered
View
BIN public/images/cms/browser_media_logo.png
Deleted file not rendered
View
BIN public/images/cms/browsercms_logo.png
Deleted file not rendered
View
BIN public/images/cms/buttons/button.png
Deleted file not rendered
View
BIN public/images/cms/buttons/button_bg.png
Deleted file not rendered
View
BIN public/images/cms/buttons/button_cap.png
Deleted file not rendered
View
BIN public/images/cms/buttons/button_cap_h.png
Deleted file not rendered
View
BIN public/images/cms/buttons/button_cap_off.gif
Deleted file not rendered
View
BIN public/images/cms/buttons/button_h.png
Deleted file not rendered
View
BIN public/images/cms/buttons/button_off.png
Deleted file not rendered
View
BIN public/images/cms/buttons/delete_x.png
Deleted file not rendered
View
BIN public/images/cms/buttons/delete_x_disabled.png
Deleted file not rendered
View
BIN public/images/cms/buttons/delete_x_h.png
Deleted file not rendered
View
BIN public/images/cms/buttons/sm_button.gif
Deleted file not rendered
View
BIN public/images/cms/buttons/sm_button_2.gif
Deleted file not rendered
View
BIN public/images/cms/buttons/sm_button_2_h.gif
Deleted file not rendered
View
BIN public/images/cms/buttons/sm_button_h.gif
Deleted file not rendered
View
BIN public/images/cms/containers/add.gif
Deleted file not rendered
View
BIN public/images/cms/containers/alpha.png
Deleted file not rendered
View
BIN public/images/cms/containers/beta.png
Deleted file not rendered
View
BIN public/images/cms/containers/delete.gif
Diff not rendered.
View
BIN public/images/cms/containers/down.gif
Diff not rendered.
View
BIN public/images/cms/containers/edit.gif
Diff not rendered.
View
BIN public/images/cms/containers/up.gif
Diff not rendered.
View
BIN public/images/cms/containers/view.gif
Diff not rendered.
View
BIN public/images/cms/content_bg.gif
Diff not rendered.
View
BIN public/images/cms/dashboard/bottom_cap.png
Diff not rendered.
View
BIN public/images/cms/dashboard/bottom_cap_content.png
Diff not rendered.
View
BIN public/images/cms/dashboard/header_bg.gif
Diff not rendered.
View
BIN public/images/cms/dashboard/header_left_bg.gif
Diff not rendered.
View
BIN public/images/cms/dashboard/table_header_bg.gif
Diff not rendered.
View
BIN public/images/cms/dashboard/top_cap.png
Diff not rendered.
View
BIN public/images/cms/dashed.gif
Diff not rendered.
View
BIN public/images/cms/datepicker/clear.gif
Diff not rendered.
View
BIN public/images/cms/datepicker/close.gif
Diff not rendered.
View
BIN public/images/cms/dk_button_l.gif
Diff not rendered.
View
BIN public/images/cms/dk_button_r.gif
Diff not rendered.
View
BIN public/images/cms/dot.png
Diff not rendered.
View
BIN public/images/cms/draft_status.gif
Diff not rendered.
View
BIN public/images/cms/gray_long_bg.gif
Diff not rendered.
View
BIN public/images/cms/icons/actions/add.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/config.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/connect.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/delete.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/down.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/edit.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/folder.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/folder_add.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/folder_delete.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/folder_edit.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/folder_move.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/folder_open.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/history.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/home.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/left.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/link.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/page.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/page_add.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/page_edit.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/page_move.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/redo.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/refresh.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/right.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/root_folder.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/root_link.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/root_page.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/undo.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/up.png
Diff not rendered.
View
BIN public/images/cms/icons/actions/view.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/doc.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/file.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/gif.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/htm.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/pdf.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/ppt.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/swf.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/txt.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/xls.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/xml.png
Diff not rendered.
View
BIN public/images/cms/icons/file_types/zip.png
Diff not rendered.
View
BIN public/images/cms/icons/status/archived.gif
Diff not rendered.
View
BIN public/images/cms/icons/status/draft.gif
Diff not rendered.
View
BIN public/images/cms/icons/status/hidden.gif
Diff not rendered.
View
BIN public/images/cms/icons/status/locked.gif
Diff not rendered.
View
BIN public/images/cms/icons/status/published.gif
Diff not rendered.
View
BIN public/images/cms/icons/status/unlocked.gif
Diff not rendered.
View
BIN public/images/cms/icons/user.png
Diff not rendered.
View
BIN public/images/cms/login_bg.jpg
Diff not rendered.
View
BIN public/images/cms/login_bottom.jpg
Diff not rendered.
View
BIN public/images/cms/login_top.gif
Diff not rendered.
View
BIN public/images/cms/lt_button_bg.gif
Diff not rendered.
View
BIN public/images/cms/lt_button_l.gif
Diff not rendered.
View
BIN public/images/cms/lt_button_r.gif
Diff not rendered.
View
BIN public/images/cms/menu.png
Diff not rendered.
View
BIN public/images/cms/menu/block_cap_h.gif
Diff not rendered.
View
BIN public/images/cms/menu/bottom_cap.png
Diff not rendered.
View
BIN public/images/cms/menu/bottom_cap_menu.png
Diff not rendered.
View
BIN public/images/cms/menu/bottom_cap_menu_first.png
Diff not rendered.
View
BIN public/images/cms/menu/menu_header_first_bg.gif
Diff not rendered.
View
BIN public/images/cms/menu/selected_block_cap.gif
Diff not rendered.
View
BIN public/images/cms/menu/top_cap.png
Diff not rendered.
View
BIN public/images/cms/menu/top_cap_menu_header.png
Diff not rendered.
View
BIN public/images/cms/menu_h.gif
Diff not rendered.
View
BIN public/images/cms/menu_header.png
Diff not rendered.
View
BIN public/images/cms/menu_open.png
Diff not rendered.
View
BIN public/images/cms/menu_open_bg.gif
Diff not rendered.
View
BIN public/images/cms/nav.png
Diff not rendered.
View
BIN public/images/cms/nav/on_bg.gif
Diff not rendered.
View
BIN public/images/cms/nav_cap.png
Diff not rendered.
View
BIN public/images/cms/nav_cap_h.gif
Diff not rendered.
View
BIN public/images/cms/nav_h.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_draft_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_draft_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_draft_r.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_published_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_published_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_published_r.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_inset_r.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/page_toolbar_r.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/status_draft_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/status_draft_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/status_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/status_published_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/status_published_l.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/visual_editor_bg.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/visual_editor_end.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/visual_editor_r.gif
Diff not rendered.
View
BIN public/images/cms/page_toolbar/visual_editor_state_bg.gif
Diff not rendered.
View
BIN public/images/cms/pages/add_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/connect_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/container_border.gif
Diff not rendered.
View
BIN public/images/cms/pages/container_border_l.gif
Diff not rendered.
View
BIN public/images/cms/pages/container_border_r.gif
Diff not rendered.
View
BIN public/images/cms/pages/delete_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/down_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/down_connectable_disabled.gif
Diff not rendered.
View
BIN public/images/cms/pages/edit_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/edit_connectable_2.gif
Diff not rendered.
View
BIN public/images/cms/pages/show_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/up_connectable.gif
Diff not rendered.
View
BIN public/images/cms/pages/up_connectable_disabled.gif
Diff not rendered.
View
BIN public/images/cms/pagination/first.gif
Diff not rendered.
View
BIN public/images/cms/pagination/first_h.gif
Diff not rendered.
View
BIN public/images/cms/pagination/input.gif
Diff not rendered.
View
BIN public/images/cms/pagination/last.gif
Diff not rendered.
View
BIN public/images/cms/pagination/last_h.gif
Diff not rendered.
View
BIN public/images/cms/pagination/next.gif
Diff not rendered.
View
BIN public/images/cms/pagination/next_h.gif
Diff not rendered.
View
BIN public/images/cms/pagination/previous.gif
Diff not rendered.
View
BIN public/images/cms/pagination/previous_h.gif
Diff not rendered.
View
BIN public/images/cms/published_status.gif
Diff not rendered.
View
BIN public/images/cms/search.png
Diff not rendered.
View
BIN public/images/cms/search_submit.gif
Diff not rendered.
View
BIN public/images/cms/search_submit_h.gif
Diff not rendered.
View
BIN public/images/cms/searchbox_gradient.gif
Diff not rendered.
View
BIN public/images/cms/select_bg.gif
Diff not rendered.
View
BIN public/images/cms/select_bg_2.gif
Diff not rendered.
View
BIN public/images/cms/sitemap/bottom_cap.png
Diff not rendered.
View
BIN public/images/cms/sitemap/buffer_caps.png
Diff not rendered.
View
BIN public/images/cms/sitemap/contract.png
Diff not rendered.
View
BIN public/images/cms/sitemap/corners.gif
Diff not rendered.
View
BIN public/images/cms/sitemap/corners_hover.gif
Diff not rendered.
View
BIN public/images/cms/sitemap/divider.gif
Diff not rendered.
View
BIN public/images/cms/sitemap/expand.png
Diff not rendered.
View
BIN public/images/cms/sitemap/gradient.gif
Diff not rendered.
View
BIN public/images/cms/sitemap/gray_contract.png
Diff not rendered.
View
BIN public/images/cms/sitemap/gray_expand.png
Diff not rendered.
View
BIN public/images/cms/sitemap/no_contents.png
Diff not rendered.
View
BIN public/images/cms/sitemap/site_root_cap.png
Diff not rendered.
View
BIN public/images/cms/sitemap/tooltip.gif
Diff not rendered.
View
BIN public/images/cms/sitemap/top_cap_content.png
Diff not rendered.
View
BIN public/images/cms/solid.gif
Diff not rendered.
View
BIN public/images/cms/table/bl.gif
Diff not rendered.
View
BIN public/images/cms/table/br.gif
Diff not rendered.
View
BIN public/images/cms/table/divider.gif
Diff not rendered.
View
BIN public/images/cms/table/td_cap_first_h.gif
Diff not rendered.
View
BIN public/images/cms/table/td_cap_first_s.gif
Diff not rendered.
View
BIN public/images/cms/table/td_cap_last_h.gif
Diff not rendered.
View
BIN public/images/cms/table/td_cap_last_s.gif
Diff not rendered.
View
BIN public/images/cms/table/td_last_bg.gif
Diff not rendered.
View
BIN public/images/cms/table/th_bg.gif
Diff not rendered.
View
BIN public/images/cms/table/th_divider.gif
Diff not rendered.
View
BIN public/images/cms/table/th_last_bg.gif
Diff not rendered.
View
BIN public/images/cms/table/tl.gif
Diff not rendered.
View
BIN public/images/cms/table/tr.gif
Diff not rendered.
View
BIN public/images/cms/table/tr_bg.gif
Diff not rendered.
View
BIN public/images/cms/thickbox/loadingAnimation.gif
Diff not rendered.
View
BIN public/images/cms/thickbox/macFFBgHack.png
Diff not rendered.
View
BIN public/images/cms/toolbar_bg.png
Diff not rendered.
View
BIN public/images/cms/top_cap.png
Diff not rendered.
View
BIN public/images/cms/top_cap_content.png
Diff not rendered.
View
BIN public/images/cms/top_cap_menu_header.png
Diff not rendered.
View
BIN public/images/cms/user_search_submit.gif
Diff not rendered.
View
BIN public/images/cms/usercontrols_bg.png
Diff not rendered.
View
BIN public/images/cms/usercontrols_bg_cap.png
Diff not rendered.
View
BIN public/images/rails.png
Diff not rendered.
View
2 public/javascripts/application.js
@@ -1,2 +0,0 @@
-// Place your application-specific JavaScript functions and classes here
-// This file is automatically included by javascript_include_tag :defaults
View
148 public/javascripts/cms/application.js
@@ -1,148 +0,0 @@
-//CMS related functions
-jQuery(function($) {
-
- //It would be cool if these were added to the real jQuery
- //You can call this a few ways:
- //createElement('p') => "<p/>"
- //createElement('p','hi') => "<p>hi</p>"
- //createElement('p', {align: 'center'}) => "<p align="center"/>"
- //createElement('p','hi',{align: 'center'}) => "<p align="center">hi</p>"
- $.createElement = function(tag_name, tag_value, tag_attrs) {
- var name = tag_name
- if(typeof tag_value == "object") {
- var value = null
- var attrs = tag_value
- } else {
- var value = tag_value
- var attrs = tag_attrs
- }
- var element = $(document.createElement(tag_name))
- if(attrs) {
- $.each(attrs, function(k,v) {
- element.attr(k,v)
- })
- }
- if(value) {
- element.html(value)
- }
- return element
- }
-
- var sanitizationRegexes = [[/\s/, "_"], [/[&+()]/, "-"], [/[=?!'"{}\[\]#<>%]/, ""]]
-
- $.cms = {
- sanitizeFileName: function(s) {
- var split = s.split(/\/|\\/)
- s = split[split.length-1]
- $.each(sanitizationRegexes, function(i,e){
- var r = new RegExp(e[0].source, 'g')
- s = s.replace(r, e[1])
- })
- return s;
- },
- slug: function(s) {
- return $.trim(s.toLowerCase().replace(/\W+/g, ' ')).replace(/\ +/g, '-')
- },
- showNotice: function(msg) {
- $('#message').removeClass('error').addClass('notice').html(msg).parent().show().animate({opacity: 1.0}, 3000).fadeOut("normal")
- },
- showError: function(msg) {
- $('#message').removeClass('notice').addClass('error').html(msg).parent().show().animate({opacity: 1.0}, 3000).fadeOut("normal")
- },
- attachEventHandlers: function(context) {
- $('a.button', context).click(function(){if($(this).hasClass('disabled')) return false;});
- $('a.http_post, a.http_put, a.http_delete', context).click(function() {
- if($(this).hasClass('disabled')) return false;
- if($(this).hasClass('confirm_with_title') ? confirm(this.title) : true) {
-
- // Create the form
- var f = document.createElement('form')
- f.style.display = 'none'
- this.parentNode.appendChild(f)
- f.method = "POST"
- f.action = this.href
- $(f).attr('target', $(this).attr('target'))
-
- //Create the _method hidden input
- var m = document.createElement('input')
- var http_method = $(this).attr('class').match(/http_([^ ]*)/)[1]
- $(m).attr('type', 'hidden').attr('name', '_method').attr('value', http_method)
- f.appendChild(m)
-
- //Create the authenticity_token hidden input
- if($.cms.authenticity_token && $.cms.authenticity_token != '') {
- var m = document.createElement('input')
- $(m).attr('type', 'hidden').attr('name', 'authenticity_token').attr('value', $.cms.authenticity_token)
- f.appendChild(m)
- }
-
- f.submit()
- }
- return false
- })
- }
- }
-
- $.cms.attachEventHandlers(document);
-
- $('#message.notice').parent().show().animate({opacity: 1.0}, 3000).fadeOut("normal")
- $('#message.error').parent().show().animate({opacity: 1.0}, 3000).fadeOut("normal")
-
-})
-
-//CookieSet allows us to treat one cookie value as a set of values
-jQuery(function($) {
-
- var sep = '|'
-
- $.cookieSet = {
- //Treats the cookie as an array
- add: function(name, value, options) {
- this.remove(name, value, options)
- var set = this.get(name)
- if(set) {
- set.push(value)
- } else {
- var set = [value]
- }
- $.cookie(name, set.join(sep), options)
- return this.get(name)
- },
-
- get: function(name) {
- var val = $.cookie(name)
- if(val) {
- return val.split(sep)
- } else {
- return null
- }
- },
-
- remove: function(name, value, options) {
- var set = this.get(name)
- if(set) {
- var arr = []
- $.each(set, function() {
- if(this != value+'') {
- arr.push(this)
- }
- })
- $.cookie(name, arr.join(sep), options)
- return this.get(name)
- } else {
- return null
- }
- },
-
- //Treats the cookie as an array
- contains: function(name, value) {
- var set = this.get(name)
- if(set) {
- return $.inArray(value+'', set) > -1
- } else {
- return false
- }
- }
- }
-
-})
View
56 public/javascripts/cms/editor.js
@@ -1,56 +0,0 @@
-jQuery(function($){
- $('textarea.editor').each(function(e){
- if(editorEnabled()) {
- loadEditor(this.id)
- }
- });
-})
-
-function editorEnabled() {
- return $.cookie('editorEnabled') ? $.cookie('editorEnabled') == "true" : true
-}
-
-function disableEditor(id) {
- if(typeof(FCKeditorAPI) != "undefined" && FCKeditorAPI.GetInstance(id) != null) {
-
- //Prevent FCK from copying the value from the WYSIWYG to the textarea
- FCKeditorAPI.GetInstance(id).LinkedField = null
-
- $('#'+id).val(FCKeditorAPI.GetInstance(id).GetHTML()).show()
- $('#'+id+'___Frame').hide()
- $.cookie('editorEnabled', false, { expires: 90, path: '/' })
- }
-}
-
-function enableEditor(id) {
- if(typeof(FCKeditorAPI) != "undefined" && FCKeditorAPI.GetInstance(id) != null) {
- FCKeditorAPI.GetInstance(id).SetHTML($('#'+id).val())
- $('#'+id).hide()
- $('#'+id+'___Frame').show()
- $.cookie('editorEnabled', true, { expires: 90, path: '/' })
- }
-}
-
-function toggleEditor(id, status) {
- loadEditor(id)
- if(status == 'Simple Text' || status.value == 'disabled'){
- disableEditor(id)
- } else {
- enableEditor(id)
- }
-}
-
-function loadEditor(id) {
- if(typeof(FCKeditorAPI) == "undefined" || FCKeditorAPI.GetInstance(id) == null) {
- var editor = new FCKeditor(id)
- editor.BasePath = "/fckeditor/"
- editor.ToolbarSet = 'CMS'
- editor.Width = 598
- editor.Height = 400
- editor.ReplaceTextarea()
- $.cookie('editorEnabled', true, { expires: 90, path: '/' })
- return true
- } else {
- return false
- }
-}
View
426 public/javascripts/cms/sitemap.js
@@ -1,426 +0,0 @@
-jQuery(function($){
-
- //----- Helper Functions -----------------------------------------------------
- //In all of this code, we are defining functions that we use later
- //None of this actually manipulates the DOM in any way
-
- //This is used to get the id part of an elementId
- //For example, if you have section_node_5,
- //you pass this 'section_node_5', 'section_node'
- //and this returns 5
- var getId = function(elementId, s) {
- return elementId.replace(s,'')
- }
-
- var addHoverToSectionNodes = function() {
- $('#sitemap div.roundedcorners').hover(
- function() { $(this).find('table.section_node').addClass('hover'); $(this).addClass('over')},
- function() { $(this).find('table.section_node').removeClass('hover'); $(this).removeClass('over')}
- )
- }
-
- var disableButtons = function() {
- $('a.button').addClass('disabled').click(function(){return false})
- }
-
- var makeMovableRowsDraggable = function() {
- $('#sitemap table.movable').draggable({
- revert: 'invalid',
- revertDuration: 200,
- helper: 'clone',
- delay: 200,
- start: function(event, ui) {
- ui.helper.removeClass('hover').removeClass('selected')
- }
- })
- }
-
- var jsonPost = function(url, params) {
- if($.cms.authenticity_token && $.cms.authenticity_token != '') {
- params['authenticity_token'] = $.cms.authenticity_token
- }
- $.post(url, params,
- function(data){
- if(data.success) {
- $.cms.showNotice(data.message)
- } else {
- $.cms.showError(data.message)
- }
- }, "json"
- );
- }
-
- var moveSectionNode = function(sectionNodeId, move, otherSectionNodeId) {
- var url = '/cms/section_nodes/'+sectionNodeId+'/move_'+move
- var params = { _method: "PUT", section_node_id: otherSectionNodeId }
- jsonPost(url, params)
- }
-
- var moveSectionNodeToRoot = function(sectionNodeId, rootSectionId) {
- var url = '/cms/section_nodes/'+sectionNodeId+'/move_to_root'
- var params = { _method: "PUT", section_id: rootSectionId }
- jsonPost(url, params)
- }
-
- var nodeOnDrop = function(e, ui) {
- //Remove any drop zone highlights still hanging out
- $('#sitemap td.drop-before, #sitemap td.node, #sitemap td.drop-after').removeClass('drop-over')
-
- //Get the object and the id for the src (what we are droping)
- //and the dest (where we are dropping)
- var src = ui.draggable.parents('ul:first') //The UL the TD is in
- var sid = getId(src[0].id, 'section_node_')
- var dest = $(this).parents('ul:first') //The UL the drop zone is in
- var did = getId(dest[0].id, 'section_node_')
-
- //If the src is a descendant of the dest, then forget it
- if(src == dest || $.inArray(src[0], dest.parents()) > -1) {
- return true;
- }
-
- if(dest.hasClass('root')) {
- src.insertAfter(dest)
- makeRootlet(src);
- var rid = getId(dest[0].id, 'root_')
- moveSectionNodeToRoot(sid, rid)
- //Move to a section if the drop zone is the section
- } else {
- unMakeRootlet(src);
- if($(this).hasClass('node') && $(this).hasClass('section')) {
- makeExpandable(dest);
- var move = 'to_end'
- dest.find('li:first').append(src)
- openSection(dest[0])
- //If the drop zone is directly after an open section,
- //move this to the beginning of the section
- } else if($(this).hasClass('drop-after') && dest.find('table:first img.folder-open').length > 0) {
- var move = 'to_beginning'
- src.insertAfter(dest.find('table:first'))
- } else {
- //insert before or after, based on the class of the drop zone
- if (dest.hasClass('rootlet')) {
- makeRootlet(src);
- }
-
- if($(this).hasClass('drop-before')) {
- var move = 'before'
- src.insertBefore(dest)
- } else {
- var move = 'after'
- src.insertAfter(dest)
- }
-
- }
- //Make the ajax call
- moveSectionNode(sid, move, did)
-
- }
-
- //Make the thing we are dropping be selected
- selectSectionNode(src)
-
- }
-
- var makeExpandable = function(dest) {
- var dest_toggle = dest.find('td.node:first img:first');
- dest_toggle.removeClass('no_folder_toggle');
- dest_toggle.addClass('folder_toggle');
- dest_toggle.click(toggleSectionOnClick);
- if (dest_toggle.hasClass('large')){
- dest_toggle.attr('src','/images/cms/sitemap/gray_contract.png');
- } else {
- dest_toggle.attr('src','/images/cms/sitemap/contract.png');
- }
- }
-
- var makeRootlet = function(src) {
- src.addClass('rootlet')
- var src_icon = src.find('td.node:first img:last')
- var src_icon_src = src_icon.attr('src')
- if(src_icon_src.indexOf('/root_') == -1) {
- src_icon.attr('src',src_icon_src.replace(/\/([^/]+\.png).*/, '/root_$1'))
- }
- }
-
- var unMakeRootlet = function (src) {
- src.removeClass('rootlet')
- var src_icon = src.find('td.node:first img:last')
- var src_icon_src = src_icon.attr('src')
- if (src_icon_src.indexOf('/root_') > -1) {
- src_icon.attr('src',src_icon_src.replace(/\/root_([^/]+\.png).*/, '/$1'))
- }
- }
-
- var enableDropZones = function() {
- $('#sitemap td.drop-before, #sitemap td.node, #sitemap td.drop-after').droppable({
- accept: 'table',
- tolerance: 'pointer',
- over: function(e, ui) {
- $(this).addClass('drop-over')
- },
- out: function(e, ui) {
- $(this).removeClass('drop-over')
- },
- drop: nodeOnDrop
- });
- }
-
- var clearSelectedSectionNode = function() {
- disableButtons()
- $('#sitemap table.section_node').removeClass('selected');
- $('.roundedcorners').removeClass('on')
- }
-
- var selectSectionNode = function(sectionNode) {
- clearSelectedSectionNode(sectionNode)
- enableButtonsForSectionNode(sectionNode)
- $(sectionNode).find('table:first').addClass('selected');
- $(sectionNode).find('div.roundedcorners:first').addClass('on')
- }
-
- var isSectionEmpty = function(id) {
- return $('#section_'+id).parents('li:first').find('ul').length == 0
- }
-
- var enableButtonsForSectionNode = function(sectionNode) {
- enableButtonsForNode($(sectionNode).find('td.node')[0])
- }
-
- var enableButtonsForNode = function(node) {
- var id = getId(node.id, /(section|page|link)_/)
- if($(node).hasClass('section')) {
- enableButtonsForSection(id)
- } else if($(node).hasClass('page')) {
- enableButtonsForPage(id)
- } else if($(node).hasClass('link')) {
- enableButtonsForLink(id)
- }
- }
-
- var enableButtonsForSection = function(id) {
- $('#properties-button')
- .removeClass('disabled')
- .attr('href','/cms/sections/'+id+'/edit')
- .unbind('click')
- .click(function(){return true})
-
- $('#add-page-button')
- .removeClass('disabled')
- .attr('href','/cms/sections/'+id+'/pages/new')
- .unbind('click')
- .click(function(){return true})
-
- $('#add-section-button')
- .removeClass('disabled')
- .attr('href','/cms/sections/new?section_id='+id)
- .unbind('click')
- .click(function(){return true})
-
- $('#add-link-button')
- .removeClass('disabled')
- .attr('href','/cms/sections/'+id+'/links/new')
- .unbind('click')
- .click(function(){return true})
-
- if(isSectionEmpty(id)) {
- $('#delete-button')
- .removeClass('disabled')
- .attr('href','/cms/sections/'+id+'.json')
- .unbind('click')
- .click(function(){
- if(confirm('Are you sure you want to delete this section?')) {
- var params = { _method: "DELETE" }
- if($.cms.authenticity_token && $.cms.authenticity_token != '') {
- params['authenticity_token'] = $.cms.authenticity_token
- }
- $.post($(this).attr('href'), params,
- function(data){
- if(data.success) {
- $.cms.showNotice(data.message)
- } else {
- $.cms.showError(data.message)
- }
- }, "json");
- $('#section_'+id).parents('ul.section_node:first').remove()
- }
- return false;
- })
- } else {
- $('#delete-button').addClass('disabled').unbind('click').click(function(){ return false})
- }
-
- }
-
- var enableButtonsForPage = function(id) {
- $('#edit-button')
- .removeClass('disabled')
- .attr('href','/cms/pages/'+id)
- .unbind('click')
- .click(function(){return true})
-
- $('#properties-button')
- .removeClass('disabled')
- .attr('href','/cms/pages/'+id+'/edit')
- .unbind('click')
- .click(function(){return true})
-
- $('#delete-button')
- .removeClass('disabled')
- .attr('href','/cms/pages/'+id+'.json')
- .unbind('click')
- .click(function(){
- if(confirm('Are you sure you want to delete this page?')) {
- var params = { _method: "DELETE" }
- if($.cms.authenticity_token && $.cms.authenticity_token != '') {
- params['authenticity_token'] = $.cms.authenticity_token
- }
- $.post($(this).attr('href'), params,
- function(data){
- if(data.success) {
- $.cms.showNotice(data.message)
- } else {
- $.cms.showError(data.message)
- }
- }, "json");
- $('#page_'+id).parents('ul.section_node:first').remove()
- }
- return false;
- })
- }
-
- var enableButtonsForLink = function(id) {
- $('#properties-button')
- .removeClass('disabled')
- .attr('href','/cms/links/'+id+'/edit')
- .unbind('click')
- .click(function(){return true})
-
- $('#delete-button')
- .removeClass('disabled')
- .attr('href','/cms/links/'+id+'.json')
- .unbind('click')
- .click(function(){
- if(confirm('Are you sure you want to delete this link?')) {
- var params = { _method: "DELETE" }
- if($.cms.authenticity_token && $.cms.authenticity_token != '') {
- params['authenticity_token'] = $.cms.authenticity_token
- }
- $.post($(this).attr('href'), params,
- function(data){
- if(data.success) {
- $.cms.showNotice(data.message)
- } else {
- $.cms.showError(data.message)
- }
- }, "json");
- $('#link_'+id).parents('ul.section_node:first').remove()
- }
- return false;
- })
-
- }
-
- var openSection = function(sectionNode) {
- var id = getId(sectionNode.id, 'section_node_')
-
- //Remember to re-open this section
- $.cookieSet.add('openSectionNodes', id, {path: '/'})
-
- $(sectionNode).addClass('open')
- $(sectionNode).find('li:first > ul').show();
- var img = $(sectionNode).find('li:first table:first img.folder_toggle');
- if (img.hasClass('large')){
- img.attr('src','/images/cms/sitemap/gray_contract.png').addClass("folder-open")
- } else {
- img.attr('src','/images/cms/sitemap/contract.png').addClass("folder-open")
- }
- }
-
- var closeSection = function(sectionNode) {
- var id = getId(sectionNode.id, 'section_node_')
-
- //Remove this section from the set of open nodes
- $.cookieSet.remove('openSectionNodes', id, {path: '/'})
-
- //close this
- $(sectionNode).removeClass('open')
- $(sectionNode).find('li:first > ul').hide()
- var img = $(sectionNode).find('li:first table:first img.folder_toggle');
- if (img.hasClass('large')){
- img.attr('src','/images/cms/sitemap/gray_expand.png').removeClass("folder-open")
- } else {
- img.attr('src','/images/cms/sitemap/expand.png').removeClass("folder-open")
- }
- }
-
- var sectionNodeIsOpen = function(sectionNode) {
- return $(sectionNode).find('li:first table:first img.folder-open').length
- }
-
- var nodeOnClick = function() {
-
- var selected = $(this).hasClass('selected')
- clearSelectedSectionNode()
- $(this).addClass('selected')
-
- var node = $(this).find('td.node')[0]
- var id = getId(node.id, /(section|page|link)_/)
- var sectionNode = $(this).parents('ul:first')[0]
-
- selectSectionNode(sectionNode)
- }
-
- var toggleSectionOnClick = function() {
- var sectionNode = $(this).parents('ul:first')[0]
- if(sectionNodeIsOpen(sectionNode)) {
- closeSection(sectionNode)
- } else {
- openSection(sectionNode)
- }
- }
-
- var nodeOnDoubleClick = function() {
- if($('#edit-button').hasClass('disabled')) {
- //$('#properties-button').click()
- location.href = $('#properties-button')[0].href
- } else {
- //$('#edit-button').click()
- location.href = $('#edit-button')[0].href
- }
- }
-
- var addNodeOnClick = function() {
- $('#sitemap table.section_node').click(nodeOnClick).dblclick(nodeOnDoubleClick)
- }
-
- var addToggleSectionOnClick = function(){
- $('#sitemap img.folder_toggle').click(toggleSectionOnClick);