Permalink
Browse files

Ckeditor now isolated engine

  • Loading branch information...
1 parent 3508625 commit cb810fb82f2d3f55206f4f7dc836fa316e9752eb @galetahub galetahub committed Jan 3, 2012
View
4 README.rdoc
@@ -18,6 +18,10 @@ Rails 3.1:
gem "ckeditor"
+in routes:
+
+ mount Ckeditor::Engine => '/ckeditor'
+
Rails <= 3.0:
gem "ckeditor", "3.6.3"
View
5 app/assets/javascripts/ckeditor/application.js
@@ -0,0 +1,5 @@
+//= require ckeditor/filebrowser/javascripts/jquery.min.js
+//= require ckeditor/filebrowser/javascripts/jquery.tmpl.min.js
+//= require ckeditor/filebrowser/javascripts/fileuploader.js
+//= require ckeditor/filebrowser/javascripts/rails.js
+//= require ckeditor/filebrowser/javascripts/application.js
View
6 app/assets/stylesheets/ckeditor/application.css
@@ -0,0 +1,6 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require ckeditor/filebrowser/stylesheets/uploader.css
+*/
View
2 app/views/ckeditor/shared/_asset.html.erb
@@ -1,5 +1,5 @@
<%= content_tag(:div, :id => dom_id(asset), :class => "gal-item", :"data-url" => asset.url_content) do %>
- <%= link_to image_tag("#{Ckeditor.relative_path}/ckeditor/filebrowser/images/gal_del.png",
+ <%= link_to image_tag("/assets/ckeditor/filebrowser/images/gal_del.png",
:title => I18n.t('ckeditor.buttons.delete')),
polymorphic_path(asset, :format => :json),
:remote => true,
View
2 app/views/ckeditor/shared/_asset_tmpl.html.erb
@@ -1,6 +1,6 @@
<script id="fileupload_tmpl" type="text/x-jquery-tmpl">
<div id="asset_${id}" class="gal-item" data-url="${url_content}">
- <%= link_to image_tag("#{Ckeditor.relative_path}/ckeditor/filebrowser/images/gal_del.png",
+ <%= link_to image_tag("/assets/ckeditor/filebrowser/images/gal_del.png",
:title => I18n.t('ckeditor.buttons.delete')),
"/ckeditor/${controller}/${id}.json",
:remote => true,
View
8 config/routes.rb
@@ -1,6 +1,4 @@
-Rails.application.routes.draw do
- namespace :ckeditor, :only => [:index, :create, :destroy] do
- resources :pictures
- resources :attachment_files
- end
+Ckeditor::Engine.routes.draw do
+ resources :pictures, :only => [:index, :create, :destroy]
+ resources :attachment_files, :only => [:index, :create, :destroy]
end
View
3 lib/ckeditor/engine.rb
@@ -1,7 +1,10 @@
require 'rails'
+require 'ckeditor'
module Ckeditor
class Engine < ::Rails::Engine
+ isolate_namespace Ckeditor
+
config.action_view.javascript_expansions[:ckeditor] = "ckeditor/ckeditor"
initializer "ckeditor.helpers" do
View
4 vendor/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css
@@ -53,7 +53,7 @@ body {
.gal-holder .gal-item .gal-upload-holder .add {
display: block;
color: #2e5aff;
- /*background: url(/javascripts/ckeditor/filebrowser/images/gal_add.png) no-repeat left center;*/
+ background: url(/assets/ckeditor/filebrowser/images/gal_add.png) no-repeat left center;
padding-left: 33px;
line-height: 25px;
text-decoration: none;
@@ -105,7 +105,7 @@ body {
}
.gal-more a {
color: #2e5aff;
- /*background: url(/javascripts/ckeditor/filebrowser/images/gal_more.gif) no-repeat left center;*/
+ background: url(/assets/ckeditor/filebrowser/images/gal_more.gif) no-repeat left center;
padding-left: 15px;
font-size: 14px;
text-decoration: none;

0 comments on commit cb810fb

Please sign in to comment.