├── test ├── dummy │ ├── app │ │ ├── mailers │ │ │ └── .gitkeep │ │ ├── helpers │ │ │ ├── posts_helper.rb │ │ │ └── application_helper.rb │ │ ├── views │ │ │ ├── posts │ │ │ │ ├── new.html.erb │ │ │ │ ├── edit.html.erb │ │ │ │ ├── show.html.erb │ │ │ │ ├── index.html.erb │ │ │ │ └── _form.html.erb │ │ │ └── layouts │ │ │ │ └── application.html.erb │ │ ├── controllers │ │ │ ├── application_controller.rb │ │ │ └── posts_controller.rb │ │ ├── models │ │ │ └── post.rb │ │ └── assets │ │ │ ├── stylesheets │ │ │ ├── application.css │ │ │ └── scaffold.css │ │ │ └── javascripts │ │ │ └── application.js │ ├── lib │ │ └── assets │ │ │ └── .gitkeep │ ├── public │ │ ├── favicon.ico │ │ ├── 422.html │ │ ├── 404.html │ │ └── 500.html │ ├── config │ │ ├── mongoid.yml │ │ ├── routes.rb │ │ ├── environment.rb │ │ ├── locales │ │ │ └── en.yml │ │ ├── initializers │ │ │ ├── mime_types.rb │ │ │ ├── backtrace_silencers.rb │ │ │ ├── session_store.rb │ │ │ ├── ckeditor.rb │ │ │ ├── secret_token.rb │ │ │ ├── wrap_parameters.rb │ │ │ └── inflections.rb │ │ ├── boot.rb │ │ ├── database.yml │ │ └── environments │ │ │ ├── development.rb │ │ │ ├── test.rb │ │ │ └── production.rb │ ├── test │ │ └── fixtures │ │ │ └── files │ │ │ ├── rails.png │ │ │ └── rails.tar.gz │ ├── config.ru │ ├── Rakefile │ ├── script │ │ └── rails │ └── db │ │ └── migrate │ │ └── 20110623120047_create_posts.rb ├── orm │ ├── active_record.rb │ └── mongoid.rb ├── support │ ├── routes.txt │ ├── integration_case.rb │ ├── raw_post.rb │ ├── helpers.rb │ └── controller_hooks.rb ├── integration │ └── navigation_test.rb ├── models │ ├── picture_test.rb │ ├── attachment_file_test.rb │ └── utils_test.rb ├── test_helper.rb ├── functional │ └── posts_controller_test.rb ├── controllers │ ├── pictures_controller_test.rb │ └── attachment_files_controller_test.rb └── ckeditor_test.rb ├── lib ├── ckeditor │ ├── version.rb │ ├── hooks │ │ ├── formtastic.rb │ │ ├── simple_form.rb │ │ ├── pundit.rb │ │ └── cancan.rb │ ├── helpers │ │ ├── view_helper.rb │ │ ├── form_builder.rb │ │ ├── form_helper.rb │ │ └── controllers.rb │ ├── orm │ │ ├── active_record.rb │ │ ├── mongoid.rb │ │ └── base.rb │ ├── engine.rb │ ├── paginatable.rb │ ├── backend │ │ ├── dragonfly.rb │ │ ├── carrierwave.rb │ │ └── paperclip.rb │ ├── text_area.rb │ └── http.rb ├── generators │ └── ckeditor │ │ ├── templates │ │ ├── active_record │ │ │ ├── paperclip │ │ │ │ ├── ckeditor │ │ │ │ │ ├── asset.rb │ │ │ │ │ ├── attachment_file.rb │ │ │ │ │ └── picture.rb │ │ │ │ └── migration.rb │ │ │ ├── carrierwave │ │ │ │ ├── ckeditor │ │ │ │ │ ├── picture.rb │ │ │ │ │ ├── asset.rb │ │ │ │ │ └── attachment_file.rb │ │ │ │ └── migration.rb │ │ │ └── dragonfly │ │ │ │ ├── ckeditor │ │ │ │ ├── asset.rb │ │ │ │ ├── attachment_file.rb │ │ │ │ └── picture.rb │ │ │ │ └── migration.rb │ │ ├── mongoid │ │ │ ├── paperclip │ │ │ │ └── ckeditor │ │ │ │ │ ├── asset.rb │ │ │ │ │ ├── attachment_file.rb │ │ │ │ │ └── picture.rb │ │ │ └── carrierwave │ │ │ │ └── ckeditor │ │ │ │ ├── picture.rb │ │ │ │ ├── asset.rb │ │ │ │ └── attachment_file.rb │ │ ├── pundit_policy │ │ │ ├── picture_policy.rb │ │ │ └── attachment_file_policy.rb │ │ ├── base │ │ │ ├── dragonfly │ │ │ │ └── initializer.rb │ │ │ └── carrierwave │ │ │ │ └── uploaders │ │ │ │ ├── ckeditor_attachment_file_uploader.rb │ │ │ │ └── ckeditor_picture_uploader.rb │ │ └── ckeditor.rb │ │ ├── pundit_policy_generator.rb │ │ └── install_generator.rb └── tasks │ └── ckeditor.rake ├── vendor └── assets │ └── javascripts │ └── ckeditor │ ├── plugins │ ├── icons.png │ ├── icons_hidpi.png │ ├── image │ │ └── images │ │ │ └── noimage.png │ ├── link │ │ ├── images │ │ │ ├── anchor.png │ │ │ └── hidpi │ │ │ │ └── anchor.png │ │ └── dialogs │ │ │ └── anchor.js │ ├── smiley │ │ └── images │ │ │ ├── heart.gif │ │ │ ├── heart.png │ │ │ ├── kiss.gif │ │ │ ├── kiss.png │ │ │ ├── envelope.gif │ │ │ ├── envelope.png │ │ │ ├── angel_smile.gif │ │ │ ├── angel_smile.png │ │ │ ├── angry_smile.gif │ │ │ ├── angry_smile.png │ │ │ ├── cry_smile.gif │ │ │ ├── cry_smile.png │ │ │ ├── devil_smile.gif │ │ │ ├── devil_smile.png │ │ │ ├── lightbulb.gif │ │ │ ├── lightbulb.png │ │ │ ├── omg_smile.gif │ │ │ ├── omg_smile.png │ │ │ ├── sad_smile.gif │ │ │ ├── sad_smile.png │ │ │ ├── teeth_smile.gif │ │ │ ├── teeth_smile.png │ │ │ ├── thumbs_down.gif │ │ │ ├── thumbs_down.png │ │ │ ├── thumbs_up.gif │ │ │ ├── thumbs_up.png │ │ │ ├── wink_smile.gif │ │ │ ├── wink_smile.png │ │ │ ├── broken_heart.gif │ │ │ ├── broken_heart.png │ │ │ ├── regular_smile.gif │ │ │ ├── regular_smile.png │ │ │ ├── shades_smile.gif │ │ │ ├── shades_smile.png │ │ │ ├── tongue_smile.gif │ │ │ ├── tongue_smile.png │ │ │ ├── tounge_smile.gif │ │ │ ├── confused_smile.gif │ │ │ ├── confused_smile.png │ │ │ ├── embaressed_smile.gif │ │ │ ├── embarrassed_smile.gif │ │ │ ├── embarrassed_smile.png │ │ │ ├── whatchutalkingabout_smile.gif │ │ │ └── whatchutalkingabout_smile.png │ ├── magicline │ │ └── images │ │ │ ├── icon.png │ │ │ └── hidpi │ │ │ └── icon.png │ ├── flash │ │ └── images │ │ │ └── placeholder.png │ ├── forms │ │ ├── images │ │ │ └── hiddenfield.gif │ │ └── dialogs │ │ │ ├── hiddenfield.js │ │ │ ├── button.js │ │ │ ├── textarea.js │ │ │ ├── radio.js │ │ │ ├── form.js │ │ │ ├── checkbox.js │ │ │ └── textfield.js │ ├── iframe │ │ ├── images │ │ │ └── placeholder.png │ │ └── dialogs │ │ │ └── iframe.js │ ├── showblocks │ │ └── images │ │ │ ├── block_p.png │ │ │ ├── block_div.png │ │ │ ├── block_h1.png │ │ │ ├── block_h2.png │ │ │ ├── block_h3.png │ │ │ ├── block_h4.png │ │ │ ├── block_h5.png │ │ │ ├── block_h6.png │ │ │ ├── block_pre.png │ │ │ ├── block_address.png │ │ │ └── block_blockquote.png │ ├── about │ │ └── dialogs │ │ │ ├── logo_ckeditor.png │ │ │ ├── hidpi │ │ │ └── logo_ckeditor.png │ │ │ └── about.js │ ├── pagebreak │ │ └── images │ │ │ └── pagebreak.gif │ ├── templates │ │ ├── templates │ │ │ ├── images │ │ │ │ ├── template1.gif │ │ │ │ ├── template2.gif │ │ │ │ └── template3.gif │ │ │ └── default.js │ │ └── dialogs │ │ │ ├── templates.css │ │ │ └── templates.js │ ├── dialog │ │ └── dialogDefinition.js │ ├── preview │ │ └── preview.html │ ├── specialchar │ │ └── dialogs │ │ │ └── lang │ │ │ ├── _translationstatus.txt │ │ │ ├── ja.js │ │ │ └── zh-cn.js │ ├── a11yhelp │ │ └── dialogs │ │ │ ├── lang │ │ │ ├── _translationstatus.txt │ │ │ ├── zh-cn.js │ │ │ ├── zh.js │ │ │ └── ja.js │ │ │ └── a11yhelp.js │ ├── wsc │ │ ├── README.md │ │ ├── LICENSE.md │ │ └── dialogs │ │ │ ├── wsc.css │ │ │ ├── ciframe.html │ │ │ └── tmpFrameset.html │ ├── scayt │ │ ├── README.md │ │ ├── LICENSE.md │ │ └── dialogs │ │ │ └── toolbar.css │ └── liststyle │ │ └── dialogs │ │ └── liststyle.js │ ├── skins │ └── moono │ │ ├── icons.png │ │ ├── icons_hidpi.png │ │ ├── images │ │ ├── lock.png │ │ ├── arrow.png │ │ ├── close.png │ │ ├── lock-open.png │ │ ├── refresh.png │ │ └── hidpi │ │ │ ├── close.png │ │ │ ├── lock.png │ │ │ ├── refresh.png │ │ │ └── lock-open.png │ │ └── readme.md │ ├── config.js │ ├── README.md │ ├── contents.css │ └── adapters │ └── jquery.js ├── app ├── assets │ ├── javascripts │ │ └── ckeditor │ │ │ ├── filebrowser │ │ │ └── images │ │ │ │ ├── gal_add.jpg │ │ │ │ ├── gal_add.png │ │ │ │ ├── gal_del.png │ │ │ │ ├── gal_more.gif │ │ │ │ ├── preloader.gif │ │ │ │ └── thumbs │ │ │ │ ├── gz.gif │ │ │ │ ├── avi.gif │ │ │ │ ├── doc.gif │ │ │ │ ├── docx.gif │ │ │ │ ├── exe.gif │ │ │ │ ├── htm.gif │ │ │ │ ├── jpg.gif │ │ │ │ ├── mp3.gif │ │ │ │ ├── mpg.gif │ │ │ │ ├── pdf.gif │ │ │ │ ├── psd.gif │ │ │ │ ├── rar.gif │ │ │ │ ├── swf.gif │ │ │ │ ├── tar.gif │ │ │ │ ├── txt.gif │ │ │ │ ├── wmv.gif │ │ │ │ ├── xls.gif │ │ │ │ ├── xlsx.gif │ │ │ │ ├── zip.gif │ │ │ │ ├── unknown.gif │ │ │ │ └── ckfnothumb.gif │ │ │ ├── init.js.erb │ │ │ └── application.js │ └── stylesheets │ │ └── ckeditor │ │ └── application.css ├── helpers │ └── ckeditor │ │ └── application_helper.rb ├── views │ ├── ckeditor │ │ ├── pictures │ │ │ └── index.html.erb │ │ ├── attachment_files │ │ │ └── index.html.erb │ │ └── shared │ │ │ ├── _asset_tmpl.html.erb │ │ │ └── _asset.html.erb │ └── layouts │ │ └── ckeditor │ │ └── application.html.erb └── controllers │ └── ckeditor │ ├── pictures_controller.rb │ ├── attachment_files_controller.rb │ └── application_controller.rb ├── config ├── routes.rb └── locales │ ├── zh-CN.ckeditor.yml │ ├── zh-TW.ckeditor.yml │ ├── nl.ckeditor.yml │ ├── en.ckeditor.yml │ ├── pl.ckeditor.yml │ ├── cs.ckeditor.yml │ ├── de.ckeditor.yml │ ├── it.ckeditor.yml │ ├── el-GR.cdkeditor.yml │ ├── hu.ckeditor.yml │ ├── pt-BR.ckeditor.yml │ ├── sv-SE.ckeditor.yml │ ├── es.ckeditor.yml │ ├── ru.ckeditor.yml │ ├── pt-PT.ckeditor.yml │ ├── fr.ckeditor.yml │ └── uk.ckeditor.yml ├── CHANGES.md ├── .gitignore ├── Gemfile ├── ckeditor.gemspec ├── MIT-LICENSE └── Rakefile /test/dummy/app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dummy/lib/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dummy/public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dummy/app/helpers/posts_helper.rb: -------------------------------------------------------------------------------- 1 | module PostsHelper 2 | end 3 | -------------------------------------------------------------------------------- /test/dummy/config/mongoid.yml: -------------------------------------------------------------------------------- 1 | test: 2 | database: ckeditor-test-suite 3 | -------------------------------------------------------------------------------- /test/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /test/orm/active_record.rb: -------------------------------------------------------------------------------- 1 | ActiveRecord::Migrator.migrate(File.expand_path("../../dummy/db/migrate/", __FILE__)) 2 | -------------------------------------------------------------------------------- /test/support/routes.txt: -------------------------------------------------------------------------------- 1 | Dummy::Application.routes.draw do 2 | resources :posts 3 | root :to => "posts#index" 4 | end 5 | -------------------------------------------------------------------------------- /test/dummy/app/views/posts/new.html.erb: -------------------------------------------------------------------------------- 1 |

New post

2 | 3 | <%= render 'form' %> 4 | 5 | <%= link_to 'Back', posts_path %> 6 | -------------------------------------------------------------------------------- /lib/ckeditor/version.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Version 3 | GEM = "4.1.0".freeze 4 | EDITOR = "4.4.2".freeze 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /test/dummy/test/fixtures/files/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/test/dummy/test/fixtures/files/rails.png -------------------------------------------------------------------------------- /test/dummy/test/fixtures/files/rails.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/test/dummy/test/fixtures/files/rails.tar.gz -------------------------------------------------------------------------------- /test/orm/mongoid.rb: -------------------------------------------------------------------------------- 1 | class ActiveSupport::TestCase 2 | setup do 3 | Post.delete_all 4 | Ckeditor::Asset.delete_all 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/icons.png -------------------------------------------------------------------------------- /test/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery 3 | respond_to :html, :xml 4 | end 5 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/icons.png -------------------------------------------------------------------------------- /test/dummy/app/views/posts/edit.html.erb: -------------------------------------------------------------------------------- 1 |

Editing post

2 | 3 | <%= render 'form' %> 4 | 5 | <%= link_to 'Show', @post %> | 6 | <%= link_to 'Back', posts_path %> 7 | -------------------------------------------------------------------------------- /test/dummy/app/views/posts/show.html.erb: -------------------------------------------------------------------------------- 1 |

<%= notice %>

2 | 3 | 4 | <%= link_to 'Edit', edit_post_path(@post) %> | 5 | <%= link_to 'Back', posts_path %> 6 | -------------------------------------------------------------------------------- /test/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.routes.draw do 2 | resources :posts 3 | root :to => "posts#index" 4 | 5 | mount Ckeditor::Engine => '/ckeditor' 6 | end 7 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/icons_hidpi.png -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.jpg -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/gal_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/gal_add.png -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/gal_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/gal_del.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/icons_hidpi.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/lock.png -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/gal_more.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/preloader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/preloader.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/gz.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/arrow.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/close.png -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/avi.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/doc.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/docx.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/exe.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/htm.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/jpg.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mp3.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/mpg.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/pdf.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/psd.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/rar.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/swf.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/tar.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/txt.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/wmv.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xls.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/xlsx.gif -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/zip.gif -------------------------------------------------------------------------------- /test/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Dummy::Application 5 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/lock-open.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/refresh.png -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/unknown.gif -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Ckeditor::Engine.routes.draw do 2 | resources :pictures, :only => [:index, :create, :destroy] 3 | resources :attachment_files, :only => [:index, :create, :destroy] 4 | end 5 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/magicline/images/icon.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/close.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock.png -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/app/assets/javascripts/ckeditor/filebrowser/images/thumbs/ckfnothumb.gif -------------------------------------------------------------------------------- /test/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the rails application 5 | Dummy::Application.initialize! 6 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/link/images/hidpi/anchor.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/refresh.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/magicline/images/hidpi/icon.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tongue_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/skins/moono/images/hidpi/lock-open.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embarrassed_smile.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/hidpi/logo_ckeditor.png -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/asset.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Asset < ActiveRecord::Base 2 | include Ckeditor::Orm::ActiveRecord::AssetBase 3 | include Ckeditor::Backend::Paperclip 4 | end 5 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/asset.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Asset 2 | include Ckeditor::Orm::Mongoid::AssetBase 3 | include Mongoid::Paperclip 4 | include Ckeditor::Backend::Paperclip 5 | end 6 | -------------------------------------------------------------------------------- /test/integration/navigation_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class NavigationTest < ActiveSupport::IntegrationCase 4 | test "truth" do 5 | assert_kind_of Dummy::Application, Rails.application 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mattbrictson/ckeditor/master/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.png -------------------------------------------------------------------------------- /test/support/integration_case.rb: -------------------------------------------------------------------------------- 1 | # Define a bare test case to use with Capybara 2 | class ActiveSupport::IntegrationCase < ActiveSupport::TestCase 3 | include Capybara::DSL 4 | include Rails.application.routes.url_helpers 5 | end 6 | -------------------------------------------------------------------------------- /config/locales/zh-CN.ckeditor.yml: -------------------------------------------------------------------------------- 1 | zh-CN: 2 | ckeditor: 3 | page_title: "CKEditor - 文件管理" 4 | confirm_delete: "删除文件?" 5 | buttons: 6 | cancel: "取消" 7 | upload: "上传" 8 | delete: "删除" 9 | next: "下一个" 10 | -------------------------------------------------------------------------------- /config/locales/zh-TW.ckeditor.yml: -------------------------------------------------------------------------------- 1 | zh-TW: 2 | ckeditor: 3 | page_title: "CKEditor - 文件管理" 4 | confirm_delete: "删除文件?" 5 | buttons: 6 | cancel: "取消" 7 | upload: "上傳" 8 | delete: "删除" 9 | next: "下一個" 10 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # Ckeditor changelog 2 | 3 | ## Ckeditor 4.1.0 4 | 5 | * Update ckeditor to 4.4.2 Full Package version (72 Plugins, 24 Jun 2014) 6 | * Copy non-digested assets of ckeditor after assets precompile rake task 7 | * Starting gem changelog -------------------------------------------------------------------------------- /config/locales/nl.ckeditor.yml: -------------------------------------------------------------------------------- 1 | nl: 2 | ckeditor: 3 | page_title: "CKEditor Files Manager" 4 | confirm_delete: "Delete file?" 5 | buttons: 6 | cancel: "Cancel" 7 | upload: "Upload" 8 | delete: "Delete" 9 | next: "Next" -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/picture.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Picture < Ckeditor::Asset 2 | mount_uploader :data, CkeditorPictureUploader, :mount_on => :data_file_name 3 | 4 | def url_content 5 | url(:content) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | -------------------------------------------------------------------------------- /config/locales/en.ckeditor.yml: -------------------------------------------------------------------------------- 1 | en: 2 | ckeditor: 3 | page_title: "CKEditor Files Manager" 4 | confirm_delete: "Delete file?" 5 | buttons: 6 | cancel: "Cancel" 7 | upload: "Upload" 8 | delete: "Delete" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /config/locales/pl.ckeditor.yml: -------------------------------------------------------------------------------- 1 | pl: 2 | ckeditor: 3 | page_title: "CKEditor Menadżer Plików" 4 | confirm_delete: "Usunąć plik?" 5 | buttons: 6 | cancel: "Anuluj" 7 | upload: "Wyślij" 8 | delete: "Skasuj" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/preview/preview.html: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /config/locales/cs.ckeditor.yml: -------------------------------------------------------------------------------- 1 | cs: 2 | ckeditor: 3 | page_title: "CKEditor Správce souborů" 4 | confirm_delete: "Smazat soubor ?" 5 | buttons: 6 | cancel: "Zrušit" 7 | upload: "Nahrát" 8 | delete: "Smazat" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /config/locales/de.ckeditor.yml: -------------------------------------------------------------------------------- 1 | de: 2 | ckeditor: 3 | page_title: "CKEditor Dateimanager" 4 | confirm_delete: "Datei löschen?" 5 | buttons: 6 | cancel: "Abbrechen" 7 | upload: "Hochladen" 8 | delete: "Löschen" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /config/locales/it.ckeditor.yml: -------------------------------------------------------------------------------- 1 | it: 2 | ckeditor: 3 | page_title: "CKEditor Files Manager" 4 | confirm_delete: "Cancellare il file?" 5 | buttons: 6 | cancel: "Annulla" 7 | upload: "Carica" 8 | delete: "Elimina" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/picture.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Picture < Ckeditor::Asset 2 | mount_uploader :data, CkeditorPictureUploader, :mount_on => :data_file_name 3 | 4 | def url_content 5 | url(:content) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /config/locales/el-GR.cdkeditor.yml: -------------------------------------------------------------------------------- 1 | "el-GR": 2 | ckeditor: 3 | page_title: "CKEditor Διαχείρηση Αρχείων" 4 | confirm_delete: "Διαγραφή αρχείου;" 5 | buttons: 6 | cancel: "Ακύρωση" 7 | upload: "Μεταφόρτωση" 8 | delete: "Διαγραφή" 9 | next: "Next" -------------------------------------------------------------------------------- /config/locales/hu.ckeditor.yml: -------------------------------------------------------------------------------- 1 | hu: 2 | ckeditor: 3 | page_title: "CKEditor fájlkezelő" 4 | confirm_delete: "Biztosan töröljük a fájlt?" 5 | buttons: 6 | cancel: "Mégsem" 7 | upload: "Feltöltés" 8 | delete: "Törlés" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /config/locales/pt-BR.ckeditor.yml: -------------------------------------------------------------------------------- 1 | "pt-BR": 2 | ckeditor: 3 | page_title: "Gerenciador de arquivos do CKEditor" 4 | confirm_delete: "Apagar arquivo?" 5 | buttons: 6 | cancel: "Cancelar" 7 | upload: "Enviar" 8 | delete: "Apagar" 9 | next: "Next" -------------------------------------------------------------------------------- /config/locales/sv-SE.ckeditor.yml: -------------------------------------------------------------------------------- 1 | "sv-SE": 2 | ckeditor: 3 | page_title: "CKEditor filhanterare" 4 | confirm_delete: "Ta bort fil?" 5 | buttons: 6 | cancel: "Avbryt" 7 | upload: "Ladda upp" 8 | delete: "Ta bort" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/asset.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Asset 2 | include Ckeditor::Orm::Mongoid::AssetBase 3 | 4 | delegate :url, :current_path, :size, :content_type, :filename, :to => :data 5 | 6 | validates_presence_of :data 7 | end 8 | -------------------------------------------------------------------------------- /config/locales/es.ckeditor.yml: -------------------------------------------------------------------------------- 1 | es: 2 | ckeditor: 3 | page_title: "Administrador de Archivos CKEditor" 4 | confirm_delete: "¿Borrar archivo?" 5 | buttons: 6 | cancel: "Cancelar" 7 | upload: "Subir" 8 | delete: "Borrar" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /config/locales/ru.ckeditor.yml: -------------------------------------------------------------------------------- 1 | ru: 2 | ckeditor: 3 | page_title: "CKEditor Загрузка файлов" 4 | confirm_delete: "Удалить файл?" 5 | buttons: 6 | cancel: "Отмена" 7 | upload: "Загрузить" 8 | delete: "Удалить" 9 | next: "Показать еще" 10 | -------------------------------------------------------------------------------- /config/locales/pt-PT.ckeditor.yml: -------------------------------------------------------------------------------- 1 | "pt-PT": 2 | ckeditor: 3 | page_title: "Gestor de arquivos do CKEditor" 4 | confirm_delete: "Apagar arquivo?" 5 | buttons: 6 | cancel: "Cancelar" 7 | upload: "Enviar" 8 | delete: "Apagar" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/asset.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Asset < ActiveRecord::Base 2 | include Ckeditor::Orm::ActiveRecord::AssetBase 3 | 4 | delegate :url, :current_path, :content_type, :to => :data 5 | 6 | validates_presence_of :data 7 | end 8 | -------------------------------------------------------------------------------- /config/locales/fr.ckeditor.yml: -------------------------------------------------------------------------------- 1 | fr: 2 | ckeditor: 3 | page_title: "CKEditor - Gestionnaire de fichiers" 4 | confirm_delete: "Supprimer le fichier ?" 5 | buttons: 6 | cancel: "Annuler" 7 | upload: "Ajouter" 8 | delete: "Supprimer" 9 | next: "Next" 10 | -------------------------------------------------------------------------------- /config/locales/uk.ckeditor.yml: -------------------------------------------------------------------------------- 1 | uk: 2 | ckeditor: 3 | page_title: "CKEditor Завантаження файлів" 4 | confirm_delete: "Видалити файл?" 5 | buttons: 6 | cancel: "Відміна" 7 | upload: "Завантажити" 8 | delete: "Видалити" 9 | next: "Показати більше" 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle/ 2 | log/*.log 3 | pkg/ 4 | test/dummy/db/*.sqlite3 5 | test/dummy/db/schema.rb 6 | test/dummy/log/*.log 7 | test/dummy/log/ 8 | test/dummy/public/ckeditor_assets/ 9 | test/dummy/tmp/ 10 | test/tmp 11 | test/dummy/public/uploads/* 12 | *.swp 13 | .idea 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /lib/ckeditor/hooks/formtastic.rb: -------------------------------------------------------------------------------- 1 | require "formtastic" 2 | 3 | class CkeditorInput 4 | include ::Formtastic::Inputs::Base 5 | 6 | def to_html 7 | input_wrapping do 8 | label_html << 9 | builder.cktext_area(method, input_html_options) 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/asset.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Asset < ActiveRecord::Base 2 | include Ckeditor::Orm::ActiveRecord::AssetBase 3 | include Ckeditor::Backend::Dragonfly 4 | 5 | ckeditor_file_accessor :data 6 | validates_presence_of :data 7 | end 8 | -------------------------------------------------------------------------------- /test/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | gemfile = File.expand_path('../../../../Gemfile', __FILE__) 3 | 4 | if File.exist?(gemfile) 5 | ENV['BUNDLE_GEMFILE'] = gemfile 6 | require 'bundler' 7 | Bundler.setup 8 | end 9 | 10 | $:.unshift File.expand_path('../../../../lib', __FILE__) 11 | -------------------------------------------------------------------------------- /test/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Dummy::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/init.js.erb: -------------------------------------------------------------------------------- 1 | //= require_self 2 | //= require ckeditor/ckeditor 3 | 4 | (function() { 5 | if (typeof window['CKEDITOR_BASEPATH'] === "undefined" || window['CKEDITOR_BASEPATH'] === null) { 6 | window['CKEDITOR_BASEPATH'] = "<%= Ckeditor.base_path %>"; 7 | } 8 | }).call(this); 9 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/mongoid/carrierwave/ckeditor/attachment_file.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset 2 | mount_uploader :data, CkeditorAttachmentFileUploader, :mount_on => :data_file_name 3 | 4 | def url_thumb 5 | @url_thumb ||= Ckeditor::Utils.filethumb(filename) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/carrierwave/ckeditor/attachment_file.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset 2 | mount_uploader :data, CkeditorAttachmentFileUploader, :mount_on => :data_file_name 3 | 4 | def url_thumb 5 | @url_thumb ||= Ckeditor::Utils.filethumb(filename) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag "application" %> 6 | <%= csrf_meta_tags %> 7 | 8 | 9 | 10 | <%= yield %> 11 | 12 | <%= javascript_include_tag "application" %> 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/support/raw_post.rb: -------------------------------------------------------------------------------- 1 | module RawPost 2 | def raw_post(action, params, body, content_type = nil) 3 | @request.env['RAW_POST_DATA'] = body 4 | @request.env['CONTENT_TYPE'] = content_type 5 | response = post(action, params) 6 | @request.env.delete('RAW_POST_DATA') 7 | response 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /lib/ckeditor/helpers/view_helper.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Helpers 3 | module ViewHelper 4 | extend ActiveSupport::Concern 5 | 6 | def cktext_area_tag(name, content = nil, options = {}) 7 | TextArea.new(self, options).render_tag(name, content) 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/attachment_file.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset 2 | validates_property :format, :of => :data, :in => attachment_file_types unless attachment_file_types.empty? 3 | 4 | def url_thumb 5 | Ckeditor::Utils.filethumb(filename) 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/dummy/script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /lib/ckeditor/helpers/form_builder.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Helpers 3 | module FormBuilder 4 | extend ActiveSupport::Concern 5 | 6 | def cktext_area(method, options = {}) 7 | @template.send("cktext_area", @object_name, method, objectify_options(options)) 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/ckeditor/helpers/form_helper.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Helpers 3 | module FormHelper 4 | extend ActiveSupport::Concern 5 | 6 | def cktext_area(object_name, method, options = {}) 7 | TextArea.new(self, options).render_instance_tag(object_name, method) 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /test/dummy/db/migrate/20110623120047_create_posts.rb: -------------------------------------------------------------------------------- 1 | class CreatePosts < ActiveRecord::Migration 2 | def self.up 3 | create_table :posts do |t| 4 | t.string :title 5 | t.text :info 6 | t.text :content 7 | t.timestamps 8 | end 9 | end 10 | 11 | def self.down 12 | drop_table :posts 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/dummy/app/models/post.rb: -------------------------------------------------------------------------------- 1 | case CKEDITOR_ORM 2 | 3 | when :active_record 4 | class Post < ActiveRecord::Base 5 | validates_presence_of :title, :info, :content 6 | end 7 | 8 | when :mongoid 9 | class Post 10 | include Mongoid::Document 11 | field :title 12 | field :info 13 | field :content 14 | validates_presence_of :title, :info, :content 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /test/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | *= require_self 6 | *= require_tree . 7 | */ -------------------------------------------------------------------------------- /app/helpers/ckeditor/application_helper.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor::ApplicationHelper 2 | def assets_pipeline_enabled? 3 | if Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('4.0.0') 4 | defined?(Sprockets::Rails) 5 | elsif Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('3.0.0') 6 | Rails.application.config.assets.enabled 7 | else 8 | false 9 | end 10 | end 11 | end -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. 3 | * For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | CKEDITOR.editorConfig = function( config ) { 7 | // Define changes to default configuration here. For example: 8 | // config.language = 'fr'; 9 | // config.uiColor = '#AADC6E'; 10 | }; 11 | -------------------------------------------------------------------------------- /app/assets/javascripts/ckeditor/application.js: -------------------------------------------------------------------------------- 1 | //= require ckeditor/filebrowser/javascripts/jquery.min.js 2 | //= require ckeditor/filebrowser/javascripts/jquery.tmpl.min.js 3 | //= require ckeditor/filebrowser/javascripts/fileuploader.js 4 | //= require ckeditor/filebrowser/javascripts/jquery.endless-scroll.js 5 | //= require ckeditor/filebrowser/javascripts/rails.js 6 | //= require ckeditor/filebrowser/javascripts/application.js 7 | -------------------------------------------------------------------------------- /app/assets/stylesheets/ckeditor/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll automatically include all the stylesheets available in this directory 3 | * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at 4 | * the top of the compiled file, but it's generally better to create a new file per style scope. 5 | *= require ckeditor/filebrowser/stylesheets/uploader.css 6 | */ 7 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::PicturePolicy 2 | attr_reader :user, :picture 3 | 4 | def initialize(user, picture) 5 | @user = user 6 | @picture = picture 7 | end 8 | 9 | def index? 10 | true and ! @user.nil? 11 | end 12 | 13 | def create? 14 | true and ! @user.nil? 15 | end 16 | 17 | def destroy? 18 | @picture.assetable_id == @user.id 19 | end 20 | end -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/pundit_policy/attachment_file_policy.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFilePolicy 2 | attr_reader :user, :attachment 3 | 4 | def initialize(user, attachment) 5 | @user = user 6 | @attachment = attachment 7 | end 8 | 9 | def index? 10 | true and ! @user.nil? 11 | end 12 | 13 | def create? 14 | true and ! @user.nil? 15 | end 16 | 17 | def destroy? 18 | @attachment.assetable_id == @user.id 19 | end 20 | end -------------------------------------------------------------------------------- /test/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rails generate session_migration") 8 | # Dummy::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/dragonfly/ckeditor/picture.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Picture < Ckeditor::Asset 2 | validates_property :format, :of => :data, :in => image_file_types unless image_file_types.empty? 3 | validates_property :image?, :of => :data, :as => true, :message => :invalid 4 | 5 | def url_content 6 | data.thumb("800x800>").url 7 | end 8 | 9 | def url_thumb 10 | data.thumb("118x100#").url(url_thumb_options) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/tasks/ckeditor.rake: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | 3 | desc "Create nondigest versions of all ckeditor digest assets" 4 | task "assets:precompile" do 5 | fingerprint = /\-[0-9a-f]{32}\./ 6 | for file in Dir["public/assets/ckeditor/**/*"] 7 | next unless file =~ fingerprint 8 | nondigest = file.sub fingerprint, '.' 9 | if !File.exist?(nondigest) or File.mtime(file) > File.mtime(nondigest) 10 | FileUtils.cp file, nondigest, verbose: true, preserve: true 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/ckeditor.rb: -------------------------------------------------------------------------------- 1 | dir = File.join(Rails.root, "..", "..", "lib", "generators", "ckeditor", "templates") 2 | 3 | # Load the CKEditor initializer from the codebase. 4 | initializer = ERB.new(File.read(File.join(dir, "ckeditor.rb"))) 5 | options = { :orm => CKEDITOR_ORM } 6 | eval initializer.result(binding) 7 | 8 | # Also load the specific initializer for the selected backend. 9 | initializer = File.join(dir, "base", CKEDITOR_BACKEND.to_s, "initializer.rb") 10 | require initializer if File.exist?(initializer) 11 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | Dummy::Application.config.secret_token = 'b2bff8519e4dc66209a692e860c982629cc69af9fc6ef22f31179a8e7cf2ebce51918eba177661201d3af5bcdc51c83fcfa5ab3ec77e5f8d23138a9c73c75d80' 8 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | # 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # Disable root element in JSON by default. 12 | ActiveSupport.on_load(:active_record) do 13 | self.include_root_in_json = false 14 | end 15 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/attachment_file.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset 2 | has_mongoid_attached_file :data, 3 | :url => "/ckeditor_assets/attachments/:id/:filename", 4 | :path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename" 5 | 6 | validates_attachment_size :data, :less_than => 100.megabytes 7 | validates_attachment_presence :data 8 | 9 | def url_thumb 10 | @url_thumb ||= Ckeditor::Utils.filethumb(filename) 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /test/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into including all the files listed below. 2 | // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 3 | // be included in the compiled file accessible from http://example.com/assets/application.js 4 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 5 | // the compiled file. 6 | // 7 | //= require jquery 8 | //= require jquery_ujs 9 | //= require_tree . 10 | 11 | //= require ckeditor/init 12 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/attachment_file.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFile < Ckeditor::Asset 2 | has_attached_file :data, 3 | :url => "/ckeditor_assets/attachments/:id/:filename", 4 | :path => ":rails_root/public/ckeditor_assets/attachments/:id/:filename" 5 | 6 | validates_attachment_presence :data 7 | validates_attachment_size :data, :less_than => 100.megabytes 8 | do_not_validate_attachment_file_type :data 9 | 10 | def url_thumb 11 | @url_thumb ||= Ckeditor::Utils.filethumb(filename) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | # 12 | # These inflection rules are supported but not enabled by default: 13 | # ActiveSupport::Inflector.inflections do |inflect| 14 | # inflect.acronym 'RESTful' 15 | # end 16 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/mongoid/paperclip/ckeditor/picture.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Picture < Ckeditor::Asset 2 | has_mongoid_attached_file :data, 3 | :url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension", 4 | :path => ":rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension", 5 | :styles => { :content => '800>', :thumb => '118x100#' } 6 | 7 | validates_attachment_size :data, :less_than => 2.megabytes 8 | validates_attachment_presence :data 9 | 10 | def url_content 11 | url(:content) 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/models/picture_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PictureTest < ActiveSupport::TestCase 4 | def teardown 5 | @picture.destroy rescue nil 6 | end 7 | 8 | test "Set file content_type and size" do 9 | @picture = create_picture 10 | 11 | assert_equal "image/png", @picture.data_content_type 12 | assert_equal "rails.png", @picture.data_file_name 13 | assert_equal 6646, @picture.data_file_size 14 | assert @picture.url_thumb.include?('thumb_rails.png') 15 | 16 | if @picture.has_dimensions? 17 | assert_equal 50, @picture.width 18 | assert_equal 64, @picture.height 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /lib/ckeditor/orm/active_record.rb: -------------------------------------------------------------------------------- 1 | require 'ckeditor/orm/base' 2 | 3 | module Ckeditor 4 | module Orm 5 | module ActiveRecord 6 | module AssetBase 7 | def self.included(base) 8 | base.send(:include, Base::AssetBase::InstanceMethods) 9 | base.send(:extend, ClassMethods) 10 | end 11 | 12 | module ClassMethods 13 | def self.extended(base) 14 | base.class_eval do 15 | self.table_name = "ckeditor_assets" 16 | 17 | belongs_to :assetable, :polymorphic => true 18 | end 19 | end 20 | end 21 | end 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/paperclip/ckeditor/picture.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::Picture < Ckeditor::Asset 2 | has_attached_file :data, 3 | :url => "/ckeditor_assets/pictures/:id/:style_:basename.:extension", 4 | :path => ":rails_root/public/ckeditor_assets/pictures/:id/:style_:basename.:extension", 5 | :styles => { :content => '800>', :thumb => '118x100#' } 6 | 7 | validates_attachment_presence :data 8 | validates_attachment_size :data, :less_than => 2.megabytes 9 | validates_attachment_content_type :data, :content_type => /\Aimage/ 10 | 11 | def url_content 12 | url(:content) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: ":memory:" 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: ":memory:" 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: ":memory:" 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/pundit_policy_generator.rb: -------------------------------------------------------------------------------- 1 | require 'rails/generators' 2 | 3 | module Ckeditor 4 | module Generators 5 | class PunditPolicyGenerator < Rails::Generators::Base 6 | 7 | desc "Generates policy files for Pundit" 8 | 9 | def self.source_root 10 | @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates')) 11 | end 12 | 13 | # copy configuration 14 | def copy_policy_files 15 | [:picture, :attachment_file].each do |model_name| 16 | template "pundit_policy/#{model_name}_policy.rb", "app/policies/ckeditor/#{model_name}_policy.rb" 17 | end 18 | end 19 | 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/dummy/app/views/posts/index.html.erb: -------------------------------------------------------------------------------- 1 |

Listing posts

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | <% @posts.each do |post| %> 11 | 12 | 13 | 14 | 15 | 16 | <% end %> 17 |
<%= link_to 'Show', post %><%= link_to 'Edit', edit_post_path(post) %><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %>
18 | 19 |
20 | 21 | <%= link_to 'New Post', new_post_path %> 22 | 23 |

Text area test

24 | <%= cktext_area_tag("test_area", "Ckeditor") %> 25 | 26 |

Text area test with options

27 | <%= cktext_area_tag("content", "Ckeditor", :cols => 10, :rows => 20, :ckeditor => {:toolbar => 'Easy'}) %> 28 | -------------------------------------------------------------------------------- /test/models/attachment_file_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AttachmentFileTest < ActiveSupport::TestCase 4 | def teardown 5 | @attachment.destroy rescue nil 6 | end 7 | 8 | test "Set file content_type and size" do 9 | @attachment = create_attachment 10 | 11 | # TODO: fix filename parameterization 12 | if CKEDITOR_BACKEND == :paperclip 13 | assert_equal "rails_tar.gz", @attachment.data_file_name 14 | else 15 | assert_equal "rails.tar.gz", @attachment.data_file_name 16 | end 17 | 18 | assert_equal "application/x-gzip", @attachment.data_content_type 19 | assert_equal 6823, @attachment.data_file_size 20 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/gz.gif", @attachment.url_thumb 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

Maybe you tried to change something you didn't have access to.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /app/views/ckeditor/pictures/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <%= link_to I18n.t(:upload, :scope => [:ckeditor, :buttons]), 'javascript:void(0)', :class => "add" %> 5 |
6 |
7 | 8 |
9 | <%= render :partial => 'ckeditor/shared/asset', :collection => @pictures.scoped %> 10 |
11 | 12 | <% unless @pictures.last_page? %> 13 | 16 | <% end -%> 17 | 18 | 21 |
22 | -------------------------------------------------------------------------------- /test/support/helpers.rb: -------------------------------------------------------------------------------- 1 | require 'active_support/test_case' 2 | require 'action_dispatch/testing/test_process' 3 | 4 | class ActiveSupport::TestCase 5 | include ActionDispatch::TestProcess 6 | 7 | def new_attachment(data = nil) 8 | data ||= fixture_file_upload('files/rails.tar.gz', 'application/x-gzip') 9 | 10 | Ckeditor.attachment_file_model.new(:data => data) 11 | end 12 | 13 | def create_attachment(data = nil) 14 | attachment = new_attachment(data) 15 | attachment.save! 16 | attachment 17 | end 18 | 19 | def new_picture(data = nil) 20 | data ||= fixture_file_upload('files/rails.png', 'image/png') 21 | 22 | Ckeditor.picture_model.new(:data => data) 23 | end 24 | 25 | def create_picture(data = nil) 26 | picture = new_picture(data) 27 | picture.save! 28 | picture 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /app/views/ckeditor/attachment_files/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <%= link_to I18n.t(:upload, :scope => [:ckeditor, :buttons]), 'javascript:void(0)', :class => "add" %> 5 |
6 |
7 | 8 |
9 | <%= render :partial => 'ckeditor/shared/asset', :collection => @attachments.scoped %> 10 |
11 | 12 | <% unless @attachments.last_page? %> 13 | 16 | <% end -%> 17 | 18 | 21 |
22 | -------------------------------------------------------------------------------- /test/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

You may have mistyped the address or the page may have moved.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /test/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |

We've been notified about this issue and we'll take a look at it shortly.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/ckeditor/hooks/simple_form.rb: -------------------------------------------------------------------------------- 1 | require 'simple_form' 2 | 3 | module Ckeditor::Hooks::SimpleForm 4 | class CkeditorInput < ::SimpleForm::Inputs::Base 5 | def input(wrapper_options = nil) 6 | @builder.cktext_area(attribute_name, input_html_options) 7 | end 8 | end 9 | end 10 | 11 | ::SimpleForm::FormBuilder.map_type :ckeditor, :to => Ckeditor::Hooks::SimpleForm::CkeditorInput 12 | 13 | # TODO: remove this after a while, SimpleForm::FormBuilder#ckeditor is deprecated. 14 | class SimpleForm::FormBuilder 15 | def ckeditor(attribute_name, options={}, &block) 16 | warn "[DEPRECATION] calling f.ckeditor(:#{attribute_name}, ...) is deprecated, call f.input(:#{attribute_name}, :as => :ckeditor, #{options.to_s[1..-1]}) #{Kernel.caller.first}" 17 | options[:as] = :ckeditor 18 | self.input(attribute_name, options, &block) 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/_translationstatus.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 2 | For licensing, see LICENSE.md or http://ckeditor.com/license 3 | 4 | cs.js Found: 118 Missing: 0 5 | cy.js Found: 118 Missing: 0 6 | de.js Found: 118 Missing: 0 7 | el.js Found: 16 Missing: 102 8 | eo.js Found: 118 Missing: 0 9 | et.js Found: 31 Missing: 87 10 | fa.js Found: 24 Missing: 94 11 | fi.js Found: 23 Missing: 95 12 | fr.js Found: 118 Missing: 0 13 | hr.js Found: 23 Missing: 95 14 | it.js Found: 118 Missing: 0 15 | nb.js Found: 118 Missing: 0 16 | nl.js Found: 118 Missing: 0 17 | no.js Found: 118 Missing: 0 18 | tr.js Found: 118 Missing: 0 19 | ug.js Found: 39 Missing: 79 20 | zh-cn.js Found: 118 Missing: 0 21 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | gemspec 4 | 5 | gem "rails", "3.2.3" 6 | 7 | platforms :mri_18 do 8 | group :test do 9 | gem 'ruby-debug' 10 | gem 'SystemTimer' 11 | end 12 | end 13 | 14 | platforms :ruby do 15 | gem "sqlite3" 16 | 17 | group :development do 18 | gem "unicorn", "~> 4.0.1" 19 | end 20 | 21 | group :development, :test do 22 | gem "capybara", ">= 0.4.0" 23 | gem "mynyml-redgreen", "~> 0.7.1", :require => 'redgreen' 24 | end 25 | 26 | group :active_record do 27 | # gem "paperclip", "~> 3.0.3" 28 | gem 'paperclip', '~> 4.1.1' 29 | gem "carrierwave" 30 | gem "dragonfly" 31 | gem "mini_magick" 32 | end 33 | 34 | group :mongoid do 35 | gem "mongoid" 36 | gem "bson_ext" 37 | gem 'mongoid-paperclip', :require => 'mongoid_paperclip' 38 | gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid' 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /app/controllers/ckeditor/pictures_controller.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::PicturesController < Ckeditor::ApplicationController 2 | 3 | def index 4 | @pictures = Ckeditor.picture_adapter.find_all(ckeditor_pictures_scope) 5 | @pictures = Ckeditor::Paginatable.new(@pictures).page(params[:page]) 6 | 7 | respond_with(@pictures, :layout => @pictures.first_page?) 8 | end 9 | 10 | def create 11 | @picture = Ckeditor.picture_model.new 12 | respond_with_asset(@picture) 13 | end 14 | 15 | def destroy 16 | @picture.destroy 17 | respond_with(@picture, :location => pictures_path) 18 | end 19 | 20 | protected 21 | 22 | def find_asset 23 | @picture = Ckeditor.picture_adapter.get!(params[:id]) 24 | end 25 | 26 | def authorize_resource 27 | model = (@picture || Ckeditor.picture_model) 28 | @authorization_adapter.try(:authorize, params[:action], model) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /ckeditor.gemspec: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | $:.push File.expand_path("../lib", __FILE__) 3 | require "ckeditor/version" 4 | 5 | Gem::Specification.new do |s| 6 | s.name = "ckeditor" 7 | s.version = Ckeditor::Version::GEM.dup 8 | s.platform = Gem::Platform::RUBY 9 | s.summary = "Rails gem for easy integration ckeditor in your application" 10 | s.description = "CKEditor is a WYSIWYG editor to be used inside web pages" 11 | s.authors = ["Igor Galeta"] 12 | s.email = "galeta.igor@gmail.com" 13 | s.rubyforge_project = "ckeditor" 14 | s.homepage = "https://github.com/galetahub/ckeditor" 15 | 16 | s.files = Dir["{app,config,lib,vendor}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.md"] 17 | s.test_files = Dir["{test}/**/*"] 18 | s.extra_rdoc_files = ["README.md"] 19 | s.require_paths = ["lib"] 20 | 21 | s.add_dependency("mime-types") 22 | s.add_dependency("orm_adapter", "~> 0.5.0") 23 | end 24 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/paperclip/migration.rb: -------------------------------------------------------------------------------- 1 | class CreateCkeditorAssets < ActiveRecord::Migration 2 | def self.up 3 | create_table :ckeditor_assets do |t| 4 | t.string :data_file_name, :null => false 5 | t.string :data_content_type 6 | t.integer :data_file_size 7 | 8 | t.integer :assetable_id 9 | t.string :assetable_type, :limit => 30 10 | t.string :type, :limit => 30 11 | 12 | # Uncomment it to save images dimensions, if your need it 13 | t.integer :width 14 | t.integer :height 15 | 16 | t.timestamps 17 | end 18 | 19 | add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type" 20 | add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable" 21 | end 22 | 23 | def self.down 24 | drop_table :ckeditor_assets 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/carrierwave/migration.rb: -------------------------------------------------------------------------------- 1 | class CreateCkeditorAssets < ActiveRecord::Migration 2 | def self.up 3 | create_table :ckeditor_assets do |t| 4 | t.string :data_file_name, :null => false 5 | t.string :data_content_type 6 | t.integer :data_file_size 7 | 8 | t.integer :assetable_id 9 | t.string :assetable_type, :limit => 30 10 | t.string :type, :limit => 30 11 | 12 | # Uncomment it to save images dimensions, if your need it 13 | t.integer :width 14 | t.integer :height 15 | 16 | t.timestamps 17 | end 18 | 19 | add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type" 20 | add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable" 21 | end 22 | 23 | def self.down 24 | drop_table :ckeditor_assets 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /app/views/ckeditor/shared/_asset_tmpl.html.erb: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /test/dummy/app/views/posts/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for(@post) do |f| %> 2 | <% if @post.errors.any? %> 3 |
4 |

<%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:

5 | 6 | 11 |
12 | <% end %> 13 | 14 | <%= f.label :title %> 15 | <%= f.text_field :title %> 16 | 17 | <%= f.label :content %> 18 | <%= f.cktext_area :content, :ckeditor => { :width => 800, :height => 400 } %> 19 | 20 | <%= f.label :info %> 21 | <% if @post.new_record? %> 22 | <%= cktext_area :post, :info, :value => "Defaults info content", :id => "new_info_content" %> 23 | <% else %> 24 | <%= cktext_area :post, :info, :cols => 50, :rows => 70 %> 25 | <% end %> 26 | 27 |
28 | <%= f.submit %> 29 |
30 | <% end %> 31 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/active_record/dragonfly/migration.rb: -------------------------------------------------------------------------------- 1 | class CreateCkeditorAssets < ActiveRecord::Migration 2 | def self.up 3 | create_table :ckeditor_assets do |t| 4 | t.string :data_uid, :null => false 5 | t.string :data_name, :null => false 6 | t.string :data_mime_type 7 | t.integer :data_size 8 | 9 | t.integer :assetable_id 10 | t.string :assetable_type, :limit => 30 11 | t.string :type, :limit => 30 12 | 13 | # Uncomment these to save image dimensions, if your need them. 14 | t.integer :data_width 15 | t.integer :data_height 16 | 17 | t.timestamps 18 | end 19 | 20 | add_index "ckeditor_assets", ["assetable_type", "type", "assetable_id"], :name => "idx_ckeditor_assetable_type" 21 | add_index "ckeditor_assets", ["assetable_type", "assetable_id"], :name => "idx_ckeditor_assetable" 22 | end 23 | 24 | def self.down 25 | drop_table :ckeditor_assets 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/ckeditor/helpers/controllers.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Helpers 3 | module Controllers 4 | extend ActiveSupport::Concern 5 | 6 | protected 7 | 8 | def ckeditor_current_user 9 | instance_eval &Ckeditor.current_user_method 10 | end 11 | 12 | def ckeditor_authorize! 13 | instance_eval &Ckeditor.authorize_with 14 | end 15 | 16 | def ckeditor_before_create_asset(asset) 17 | asset.assetable = ckeditor_current_user if ckeditor_current_user 18 | return true 19 | end 20 | 21 | def ckeditor_pictures_scope(options = {}) 22 | ckeditor_filebrowser_scope(options) 23 | end 24 | 25 | def ckeditor_attachment_files_scope(options = {}) 26 | ckeditor_filebrowser_scope(options) 27 | end 28 | 29 | def ckeditor_filebrowser_scope(options = {}) 30 | { :order => [:id, :desc] }.merge(options) 31 | end 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /app/views/ckeditor/shared/_asset.html.erb: -------------------------------------------------------------------------------- 1 | <%= content_tag(:div, :id => dom_id(asset), :class => "gal-item", :"data-url" => image_path(asset.url_content)) do %> 2 | <%= link_to image_tag('ckeditor/filebrowser/images/gal_del.png', 3 | :title => I18n.t('ckeditor.buttons.delete')), 4 | polymorphic_path(asset, :format => :json), 5 | :remote => true, 6 | :method => :delete, 7 | :data => {:confirm => t('ckeditor.confirm_delete')}, 8 | :class => "fileupload-cancel gal-del" %> 9 | 10 |
11 |
<%= image_tag(asset.url_thumb, :title => asset.filename) %>
12 |
13 |
<%= asset.filename %>
14 |
15 |
<%= asset.format_created_at %>
16 |
<%= number_to_human_size(asset.size) if asset.size %>
17 |
18 |
19 |
20 | <% end %> 21 | -------------------------------------------------------------------------------- /test/models/utils_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class UtilsTest < ActiveSupport::TestCase 4 | test 'exists filethumb' do 5 | %w(avi doc docx exe gz htm jpg mp3 mpg pdf psd rar swf tar txt wmv xlsx zip).each do |ext| 6 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/#{ext}.gif", Ckeditor::Utils.filethumb("somefile.#{ext}") 7 | end 8 | 9 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/unknown.gif", Ckeditor::Utils.filethumb("somefile.ddd") 10 | end 11 | 12 | test 'wrong filethumb' do 13 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/unknown.gif", Ckeditor::Utils.filethumb("somefile.ddd") 14 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/unknown.gif", Ckeditor::Utils.filethumb("somefile") 15 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/unknown.gif", Ckeditor::Utils.filethumb("") 16 | assert_equal "/assets/ckeditor/filebrowser/images/thumbs/unknown.gif", Ckeditor::Utils.filethumb(nil) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /app/controllers/ckeditor/attachment_files_controller.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::AttachmentFilesController < Ckeditor::ApplicationController 2 | 3 | def index 4 | @attachments = Ckeditor.attachment_file_adapter.find_all(ckeditor_attachment_files_scope) 5 | @attachments = Ckeditor::Paginatable.new(@attachments).page(params[:page]) 6 | 7 | respond_with(@attachments, :layout => @attachments.first_page?) 8 | end 9 | 10 | def create 11 | @attachment = Ckeditor.attachment_file_model.new 12 | respond_with_asset(@attachment) 13 | end 14 | 15 | def destroy 16 | @attachment.destroy 17 | respond_with(@attachment, :location => attachment_files_path) 18 | end 19 | 20 | protected 21 | 22 | def find_asset 23 | @attachment = Ckeditor.attachment_file_adapter.get!(params[:id]) 24 | end 25 | 26 | def authorize_resource 27 | model = (@attachment || Ckeditor.attachment_file_model) 28 | @authorization_adapter.try(:authorize, params[:action], model) 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 2 | For licensing, see LICENSE.md or http://ckeditor.com/license 3 | 4 | cs.js Found: 30 Missing: 0 5 | cy.js Found: 30 Missing: 0 6 | da.js Found: 12 Missing: 18 7 | de.js Found: 30 Missing: 0 8 | el.js Found: 25 Missing: 5 9 | eo.js Found: 30 Missing: 0 10 | fa.js Found: 30 Missing: 0 11 | fi.js Found: 30 Missing: 0 12 | fr.js Found: 30 Missing: 0 13 | gu.js Found: 12 Missing: 18 14 | he.js Found: 30 Missing: 0 15 | it.js Found: 30 Missing: 0 16 | mk.js Found: 5 Missing: 25 17 | nb.js Found: 30 Missing: 0 18 | nl.js Found: 30 Missing: 0 19 | no.js Found: 30 Missing: 0 20 | pt-br.js Found: 30 Missing: 0 21 | ro.js Found: 6 Missing: 24 22 | tr.js Found: 30 Missing: 0 23 | ug.js Found: 27 Missing: 3 24 | vi.js Found: 6 Missing: 24 25 | zh-cn.js Found: 30 Missing: 0 26 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/wsc/README.md: -------------------------------------------------------------------------------- 1 | CKEditor WebSpellChecker Plugin 2 | =============================== 3 | 4 | This plugin brings Web Spell Checker (WSC) into CKEditor. 5 | 6 | WSC is "installation-less", using the web-services of [WebSpellChecker.net](http://www.webspellchecker.net/). It's an out of the box solution. 7 | 8 | Installation 9 | ------------ 10 | 11 | 1. Clone/copy this repository contents in a new "plugins/wsc" folder in your CKEditor installation. 12 | 2. Enable the "wsc" plugin in the CKEditor configuration file (config.js): 13 | 14 | config.extraPlugins = 'wsc'; 15 | 16 | That's all. WSC will appear on the editor toolbar and will be ready to use. 17 | 18 | License 19 | ------- 20 | 21 | Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html). 22 | 23 | See LICENSE.md for more information. 24 | 25 | Developed in cooperation with [WebSpellChecker.net](http://www.webspellchecker.net/). 26 | -------------------------------------------------------------------------------- /MIT-LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011 AIMBULANCE 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/scayt/README.md: -------------------------------------------------------------------------------- 1 | CKEditor SCAYT Plugin 2 | ===================== 3 | 4 | This plugin brings Spell Check As You Type (SCAYT) into up to CKEditor 4+. 5 | 6 | SCAYT is a "installation-less", using the web-services of [WebSpellChecker.net](http://www.webspellchecker.net/). It's an out of the box solution. 7 | 8 | Installation 9 | ------------ 10 | 11 | 1. Clone/copy this repository contents in a new "plugins/scayt" folder in your CKEditor installation. 12 | 2. Enable the "scayt" plugin in the CKEditor configuration file (config.js): 13 | 14 | config.extraPlugins = 'scayt'; 15 | 16 | That's all. SCAYT will appear on the editor toolbar and will be ready to use. 17 | 18 | License 19 | ------- 20 | 21 | Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html). 22 | 23 | See LICENSE.md for more information. 24 | 25 | Developed in cooperation with [WebSpellChecker.net](http://www.webspellchecker.net/). 26 | -------------------------------------------------------------------------------- /test/support/controller_hooks.rb: -------------------------------------------------------------------------------- 1 | module ControllerHooks 2 | def get(action, parameters = nil, session = nil, flash = nil) 3 | process_action(action, parameters, session, flash, "GET") 4 | end 5 | 6 | # Executes a request simulating POST HTTP method and set/volley the response 7 | def post(action, parameters = nil, session = nil, flash = nil) 8 | process_action(action, parameters, session, flash, "POST") 9 | end 10 | 11 | # Executes a request simulating PUT HTTP method and set/volley the response 12 | def put(action, parameters = nil, session = nil, flash = nil) 13 | process_action(action, parameters, session, flash, "PUT") 14 | end 15 | 16 | # Executes a request simulating DELETE HTTP method and set/volley the response 17 | def delete(action, parameters = nil, session = nil, flash = nil) 18 | process_action(action, parameters, session, flash, "DELETE") 19 | end 20 | 21 | private 22 | 23 | def process_action(action, parameters = nil, session = nil, flash = nil, method = "GET") 24 | parameters ||= {} 25 | process(action, parameters.merge!(:use_route => Ckeditor::Engine.engine_name), session, flash, method) 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /test/dummy/app/assets/stylesheets/scaffold.css: -------------------------------------------------------------------------------- 1 | body { background-color: #fff; color: #333; } 2 | 3 | body, p, ol, ul, td { 4 | font-family: verdana, arial, helvetica, sans-serif; 5 | font-size: 13px; 6 | line-height: 18px; 7 | } 8 | 9 | pre { 10 | background-color: #eee; 11 | padding: 10px; 12 | font-size: 11px; 13 | } 14 | 15 | a { color: #000; } 16 | a:visited { color: #666; } 17 | a:hover { color: #fff; background-color:#000; } 18 | 19 | div.field, div.actions { 20 | margin-bottom: 10px; 21 | } 22 | 23 | #notice { 24 | color: green; 25 | } 26 | 27 | .field_with_errors { 28 | padding: 2px; 29 | background-color: red; 30 | display: table; 31 | } 32 | 33 | #error_explanation { 34 | width: 450px; 35 | border: 2px solid red; 36 | padding: 7px; 37 | padding-bottom: 0; 38 | margin-bottom: 20px; 39 | background-color: #f0f0f0; 40 | } 41 | 42 | #error_explanation h2 { 43 | text-align: left; 44 | font-weight: bold; 45 | padding: 5px 5px 5px 15px; 46 | font-size: 12px; 47 | margin: -7px; 48 | margin-bottom: 0px; 49 | background-color: #c00; 50 | color: #fff; 51 | } 52 | 53 | #error_explanation ul li { 54 | font-size: 12px; 55 | list-style: square; 56 | } 57 | -------------------------------------------------------------------------------- /lib/ckeditor/orm/mongoid.rb: -------------------------------------------------------------------------------- 1 | require 'orm_adapter/adapters/mongoid' 2 | require 'ckeditor/orm/base' 3 | 4 | module Ckeditor 5 | module Orm 6 | module Mongoid 7 | module AssetBase 8 | def self.included(base) 9 | base.send(:include, ::Mongoid::Document) 10 | base.send(:include, ::Mongoid::Timestamps) 11 | base.send(:include, Base::AssetBase::InstanceMethods) 12 | base.send(:include, InstanceMethods) 13 | base.send(:extend, ClassMethods) 14 | end 15 | 16 | module InstanceMethods 17 | def type 18 | _type 19 | end 20 | 21 | def as_json_methods 22 | [:id, :type] + super 23 | end 24 | end 25 | 26 | module ClassMethods 27 | def self.extended(base) 28 | base.class_eval do 29 | field :data_content_type, :type => String 30 | field :data_file_size, :type => Integer 31 | field :width, :type => Integer 32 | field :height, :type => Integer 33 | 34 | belongs_to :assetable, :polymorphic => true 35 | end 36 | end 37 | end 38 | end 39 | end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /lib/ckeditor/orm/base.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Orm 3 | module Base 4 | module AssetBase 5 | module InstanceMethods 6 | def filename 7 | data_file_name 8 | end 9 | 10 | def size 11 | data_file_size 12 | end 13 | 14 | def has_dimensions? 15 | respond_to?(:width) && respond_to?(:height) 16 | end 17 | 18 | def image? 19 | Ckeditor::IMAGE_TYPES.include?(data_content_type) 20 | end 21 | 22 | def format_created_at 23 | self.created_at.strftime("%d.%m.%Y") 24 | end 25 | 26 | def url_content 27 | url 28 | end 29 | 30 | def url_thumb 31 | url(:thumb) 32 | end 33 | 34 | def as_json_methods 35 | [:url_content, :url_thumb, :size, :filename, :format_created_at] 36 | end 37 | 38 | def as_json(options = nil) 39 | options = { 40 | :methods => as_json_methods, 41 | :root => "asset" 42 | }.merge(options || {}) 43 | 44 | super options 45 | end 46 | end 47 | end 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/base/dragonfly/initializer.rb: -------------------------------------------------------------------------------- 1 | # Load Dragonfly for Rails if it isn't loaded already. 2 | require "dragonfly/rails/images" 3 | 4 | # Use a separate Dragonfly "app" for CKEditor. 5 | app = Dragonfly[:ckeditor] 6 | app.configure_with(:rails) 7 | app.configure_with(:imagemagick) 8 | 9 | # Define the ckeditor_file_accessor macro. 10 | app.define_macro(ActiveRecord::Base, :ckeditor_file_accessor) if defined?(ActiveRecord::Base) 11 | app.define_macro_on_include(Mongoid::Document, :ckeditor_file_accessor) if defined?(Mongoid::Document) 12 | 13 | app.configure do |c| 14 | # Store files in public/uploads/ckeditor. This is not 15 | # mandatory and the files don't even have to be stored under 16 | # public. If not storing under public then set server_root to nil. 17 | c.datastore.root_path = Rails.root.join("public", "uploads", "ckeditor", Rails.env).to_s 18 | c.datastore.server_root = Rails.root.join("public").to_s 19 | 20 | # Accept asset requests on /ckeditor_assets. Again, this is not 21 | # mandatory. Just be sure to include :job somewhere. 22 | c.url_format = "/uploads/ckeditor/:job/:basename.:format" 23 | end 24 | 25 | # Insert our Dragonfly "app" into the stack. 26 | Rails.application.middleware.insert_after Rack::Cache, Dragonfly::Middleware, :ckeditor 27 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_attachment_file_uploader.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | class CkeditorAttachmentFileUploader < CarrierWave::Uploader::Base 3 | include Ckeditor::Backend::CarrierWave 4 | 5 | # Include RMagick or ImageScience support: 6 | # include CarrierWave::RMagick 7 | # include CarrierWave::MiniMagick 8 | # include CarrierWave::ImageScience 9 | 10 | # Choose what kind of storage to use for this uploader: 11 | storage :file 12 | 13 | # Override the directory where uploaded files will be stored. 14 | # This is a sensible default for uploaders that are meant to be mounted: 15 | def store_dir 16 | "uploads/ckeditor/attachments/#{model.id}" 17 | end 18 | 19 | # Provide a default URL as a default if there hasn't been a file uploaded: 20 | # def default_url 21 | # "/images/fallback/" + [version_name, "default.png"].compact.join('_') 22 | # end 23 | 24 | # Process files as they are uploaded: 25 | # process :scale => [200, 300] 26 | # 27 | # def scale(width, height) 28 | # # do something 29 | # end 30 | 31 | # Add a white list of extensions which are allowed to be uploaded. 32 | # For images you might use something like this: 33 | def extension_white_list 34 | Ckeditor.attachment_file_types 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /app/controllers/ckeditor/application_controller.rb: -------------------------------------------------------------------------------- 1 | class Ckeditor::ApplicationController < ApplicationController 2 | respond_to :html, :json 3 | layout 'ckeditor/application' 4 | 5 | before_filter :find_asset, :only => [:destroy] 6 | before_filter :ckeditor_authorize! 7 | before_filter :authorize_resource 8 | 9 | protected 10 | 11 | def respond_with_asset(asset) 12 | file = params[:CKEditor].blank? ? params[:qqfile] : params[:upload] 13 | asset.data = Ckeditor::Http.normalize_param(file, request) 14 | 15 | callback = ckeditor_before_create_asset(asset) 16 | 17 | if callback && asset.save 18 | body = params[:CKEditor].blank? ? asset.to_json(:only=>[:id, :type]) : %Q"" 21 | 22 | render :text => body 23 | else 24 | if params[:CKEditor] 25 | render :text => %Q"" 28 | else 29 | render :nothing => true 30 | end 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /app/views/layouts/ckeditor/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <%= csrf_meta_tag %> 7 | <%= I18n.t('page_title', :scope => [:ckeditor]) %> 8 | 9 | <% if assets_pipeline_enabled? -%> 10 | <%= stylesheet_link_tag "ckeditor/application" %> 11 | <%= javascript_include_tag "ckeditor/application" %> 12 | <% else -%> 13 | 14 | <% ["jquery.js", "jquery.tmpl.js", "fileuploader.js", "rails.js", "application.js"].each do |js| -%> 15 | 16 | <% end -%> 17 | <% end -%> 18 | 19 | 25 | 26 | 27 | <%= yield %> 28 | <%= render :partial => 'ckeditor/shared/asset_tmpl' %> 29 | 30 | 31 | -------------------------------------------------------------------------------- /lib/ckeditor/engine.rb: -------------------------------------------------------------------------------- 1 | require 'rails' 2 | require 'ckeditor' 3 | 4 | module Ckeditor 5 | class Engine < ::Rails::Engine 6 | isolate_namespace Ckeditor 7 | 8 | initializer "ckeditor.assets_precompile", :group => :all do |app| 9 | app.config.assets.precompile += Ckeditor.assets 10 | end 11 | 12 | initializer "ckeditor.helpers" do 13 | ActiveSupport.on_load(:action_controller) do 14 | ActionController::Base.send :include, Ckeditor::Helpers::Controllers 15 | end 16 | 17 | ActiveSupport.on_load :action_view do 18 | ActionView::Base.send :include, Ckeditor::Helpers::ViewHelper 19 | ActionView::Base.send :include, Ckeditor::Helpers::FormHelper 20 | ActionView::Helpers::FormBuilder.send :include, Ckeditor::Helpers::FormBuilder 21 | end 22 | end 23 | 24 | initializer "ckeditor.hooks" do 25 | if Object.const_defined?("Formtastic") 26 | require "ckeditor/hooks/formtastic" 27 | end 28 | 29 | if Object.const_defined?("SimpleForm") 30 | require "ckeditor/hooks/simple_form" 31 | end 32 | 33 | if Object.const_defined?("CanCan") 34 | require "ckeditor/hooks/cancan" 35 | end 36 | 37 | if Object.const_defined?("Pundit") 38 | require "ckeditor/hooks/pundit" 39 | end 40 | end 41 | 42 | rake_tasks do 43 | load Ckeditor.root_path.join("lib/tasks/ckeditor.rake") 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /lib/ckeditor/paginatable.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | # Simple paginate relation 3 | class Paginatable 4 | attr_reader :limit_value, :offset_value 5 | 6 | def initialize(scope, options = {}) 7 | @scope = scope 8 | @limit_value = (options[:limit] || Ckeditor.default_per_page).to_i 9 | end 10 | 11 | def page(num = 1) 12 | @offset_value = limit_value * ([num.to_i, 1].max - 1) 13 | self 14 | end 15 | 16 | def scoped 17 | @scope.limit(limit_value).offset(offset_value) 18 | end 19 | 20 | # Next page number in the collection 21 | def next_page 22 | current_page + 1 unless last_page? 23 | end 24 | 25 | # Previous page number in the collection 26 | def prev_page 27 | current_page - 1 unless first_page? 28 | end 29 | 30 | # First page of the collection? 31 | def first_page? 32 | current_page == 1 33 | end 34 | 35 | # Last page of the collection? 36 | def last_page? 37 | current_page >= total_pages 38 | end 39 | 40 | # Total number of pages 41 | def total_pages 42 | (total_count.to_f / limit_value).ceil 43 | end 44 | 45 | # total item numbers of scope 46 | def total_count 47 | @total_count ||= @scope.count 48 | end 49 | 50 | # Current page number 51 | def current_page 52 | offset = (offset_value < 0 ? 0 : offset_value) 53 | (offset / limit_value) + 1 54 | end 55 | end 56 | end -------------------------------------------------------------------------------- /test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # Configure Rails Envinronment 2 | ENV["RAILS_ENV"] = "test" 3 | CKEDITOR_ORM = (ENV["CKEDITOR_ORM"] || :active_record).to_sym 4 | CKEDITOR_BACKEND = (ENV["CKEDITOR_BACKEND"] || :paperclip).to_sym 5 | 6 | puts "\n==> Ckeditor.orm = #{CKEDITOR_ORM.inspect}. CKEDITOR_ORM = (active_record|mongoid)" 7 | puts "\n==> Ckeditor.backend = #{CKEDITOR_BACKEND.inspect}. CKEDITOR_BACKEND = (paperclip|carrierwave|dragonfly)" 8 | 9 | require File.expand_path("../dummy/config/environment.rb", __FILE__) 10 | require "rails/test_help" 11 | require 'redgreen' 12 | 13 | ActionMailer::Base.delivery_method = :test 14 | ActionMailer::Base.perform_deliveries = true 15 | ActionMailer::Base.default_url_options[:host] = "test.com" 16 | 17 | Rails.backtrace_cleaner.remove_silencers! 18 | 19 | # Configure capybara for integration testing 20 | require "capybara/rails" 21 | Capybara.default_driver = :rack_test 22 | Capybara.default_selector = :css 23 | 24 | # Run specific orm operations 25 | require "orm/#{CKEDITOR_ORM}" 26 | 27 | # Load support files 28 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } 29 | 30 | # For generators 31 | require "rails/generators/test_case" 32 | require "generators/ckeditor/install_generator" 33 | 34 | # Run template migration for the selected backend 35 | if CKEDITOR_ORM == :active_record 36 | require "generators/ckeditor/templates/active_record/#{CKEDITOR_BACKEND}/migration.rb" 37 | CreateCkeditorAssets.new.up 38 | end 39 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.addTemplates("default",{imagesPath:CKEDITOR.getUrl(CKEDITOR.plugins.getPath("templates")+"templates/images/"),templates:[{title:"Image and Title",image:"template1.gif",description:"One main image with a title and text that surround the image.",html:'

Type the title here

Type the text here

'},{title:"Strange Template",image:"template2.gif",description:"A template that defines two colums, each one with a title, and some text.", 6 | html:'

Title 1

Title 2

Text 1Text 2

More text goes here.

'},{title:"Text and Table",image:"template3.gif",description:"A title with some text and a table.",html:'

Title goes here

Table title
   
   
   

Type the text here

'}]}); -------------------------------------------------------------------------------- /lib/ckeditor/backend/dragonfly.rb: -------------------------------------------------------------------------------- 1 | module Ckeditor 2 | module Backend 3 | module Dragonfly 4 | def self.included(base) 5 | base.send(:include, InstanceMethods) 6 | base.send(:extend, ClassMethods) 7 | end 8 | 9 | module ClassMethods 10 | def attachment_file_types 11 | @attachment_file_types ||= Ckeditor.attachment_file_types.map(&:to_sym).tap do |formats| 12 | # This is not ideal but Dragonfly doesn't return double 13 | # extensions. Having said that, the other backends 14 | # currently don't use attachment_file_types at all. 15 | [ :bz2, :gz, :lzma, :xz ].each do |f| 16 | formats << f if formats.include?("tar.#{f}".to_sym) 17 | end 18 | end 19 | end 20 | 21 | def image_file_types 22 | @image_file_types ||= Ckeditor.image_file_types.map(&:to_sym) 23 | end 24 | end 25 | 26 | module InstanceMethods 27 | delegate :url, :path, :size, :image?, :width, :height, :to => :data 28 | 29 | alias_attribute :data_file_name, :data_name 30 | alias_attribute :data_content_type, :data_mime_type 31 | alias_attribute :data_file_size, :data_size 32 | 33 | private 34 | 35 | def url_thumb_options 36 | if data.basename.present? 37 | { :basename => "thumb_#{data.basename}" } 38 | else 39 | {} 40 | end 41 | end 42 | end 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/README.md: -------------------------------------------------------------------------------- 1 | CKEditor 4 2 | ========== 3 | 4 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 5 | http://ckeditor.com - See LICENSE.md for license information. 6 | 7 | CKEditor is a text editor to be used inside web pages. It's not a replacement 8 | for desktop text editors like Word or OpenOffice, but a component to be used as 9 | part of web applications and websites. 10 | 11 | ## Documentation 12 | 13 | The full editor documentation is available online at the following address: 14 | http://docs.ckeditor.com 15 | 16 | ## Installation 17 | 18 | Installing CKEditor is an easy task. Just follow these simple steps: 19 | 20 | 1. **Download** the latest version from the CKEditor website: 21 | http://ckeditor.com. You should have already completed this step, but be 22 | sure you have the very latest version. 23 | 2. **Extract** (decompress) the downloaded file into the root of your website. 24 | 25 | **Note:** CKEditor is by default installed in the `ckeditor` folder. You can 26 | place the files in whichever you want though. 27 | 28 | ## Checking Your Installation 29 | 30 | The editor comes with a few sample pages that can be used to verify that 31 | installation proceeded properly. Take a look at the `samples` directory. 32 | 33 | To test your installation, just call the following page at your website: 34 | 35 | http:////samples/index.html 36 | 37 | For example: 38 | 39 | http://www.example.com/ckeditor/samples/index.html 40 | -------------------------------------------------------------------------------- /test/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger 20 | config.active_support.deprecation = :log 21 | 22 | # Only use best-standards-support built into browsers 23 | config.action_dispatch.best_standards_support = :builtin 24 | 25 | # Raise exception on mass assignment protection for Active Record models 26 | config.active_record.mass_assignment_sanitizer = :strict 27 | 28 | # Log the query plan for queries taking more than this (works 29 | # with SQLite, MySQL, and PostgreSQL) 30 | config.active_record.auto_explain_threshold_in_seconds = 0.5 31 | 32 | # Do not compress assets 33 | config.assets.compress = false 34 | 35 | # Expands the lines which load the assets 36 | config.assets.debug = true 37 | end 38 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/base/carrierwave/uploaders/ckeditor_picture_uploader.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | class CkeditorPictureUploader < CarrierWave::Uploader::Base 3 | include Ckeditor::Backend::CarrierWave 4 | 5 | # Include RMagick or ImageScience support: 6 | # include CarrierWave::RMagick 7 | include CarrierWave::MiniMagick 8 | # include CarrierWave::ImageScience 9 | 10 | # Choose what kind of storage to use for this uploader: 11 | storage :file 12 | 13 | # Override the directory where uploaded files will be stored. 14 | # This is a sensible default for uploaders that are meant to be mounted: 15 | def store_dir 16 | "uploads/ckeditor/pictures/#{model.id}" 17 | end 18 | 19 | # Provide a default URL as a default if there hasn't been a file uploaded: 20 | # def default_url 21 | # "/images/fallback/" + [version_name, "default.png"].compact.join('_') 22 | # end 23 | 24 | # Process files as they are uploaded: 25 | # process :scale => [200, 300] 26 | # 27 | # def scale(width, height) 28 | # # do something 29 | # end 30 | 31 | process :read_dimensions 32 | 33 | # Create different versions of your uploaded files: 34 | version :thumb do 35 | process :resize_to_fill => [118, 100] 36 | end 37 | 38 | version :content do 39 | process :resize_to_limit => [800, 800] 40 | end 41 | 42 | # Add a white list of extensions which are allowed to be uploaded. 43 | # For images you might use something like this: 44 | def extension_white_list 45 | Ckeditor.image_file_types 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /test/functional/posts_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PostsControllerTest < ActionController::TestCase 4 | def setup 5 | @post = Post.create!(:title => "test", :content => "content", :info => "info") 6 | end 7 | 8 | def teardown 9 | @post.destroy rescue nil 10 | end 11 | 12 | test "include javascripts" do 13 | get :index 14 | 15 | assert_select "script[src=/assets/application.js]" 16 | assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('test_area');!)) 17 | end 18 | 19 | test "pass text_area with options" do 20 | get :index 21 | 22 | assert_select "textarea#content[name=content][cols=10][rows=20]", "Ckeditor" 23 | assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('content', {"toolbar":"Easy"});!)) 24 | end 25 | 26 | test "form builder helper" do 27 | get :new 28 | 29 | assert_select "textarea#post_content[name='post[content]'][cols=40][rows=20]", "" 30 | assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('post_content', {"width":800,"height":400});!)) 31 | assert_select "textarea#new_info_content[name='post[info]'][cols=40][rows=20]", "Defaults info content" 32 | assert_select "script", Regexp.new(Regexp.escape(%q!CKEDITOR.replace('new_info_content');!)) 33 | end 34 | 35 | test "text_area value" do 36 | get :edit, :id => @post.id 37 | 38 | assert_select "textarea#post_content[name='post[content]'][cols=40][rows=20]", "content" 39 | assert_select "textarea#post_info[name='post[info]'][cols=50][rows=70]", "info" 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("about",function(a){var a=a.lang.about,b=CKEDITOR.plugins.get("about").path+"dialogs/"+(CKEDITOR.env.hidpi?"hidpi/":"")+"logo_ckeditor.png";return{title:CKEDITOR.env.ie?a.dlgTitle:a.title,minWidth:390,minHeight:230,contents:[{id:"tab1",label:"",title:"",expand:!0,padding:0,elements:[{type:"html",html:'

CKEditor '+CKEDITOR.version+" (revision "+CKEDITOR.revision+')
http://ckeditor.com

'+a.help.replace("$1",''+ 7 | a.userGuide+"")+"

"+a.moreInfo+'
http://ckeditor.com/about/license

'+a.copy.replace("$1",'CKSource - Frederico Knabben')+"

"}]}],buttons:[CKEDITOR.dialog.cancelButton]}}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/wsc/LICENSE.md: -------------------------------------------------------------------------------- 1 | Software License Agreement 2 | ========================== 3 | 4 | **CKEditor WSC Plugin** 5 | Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved. 6 | 7 | Licensed under the terms of any of the following licenses at your choice: 8 | 9 | * GNU General Public License Version 2 or later (the "GPL"): 10 | http://www.gnu.org/licenses/gpl.html 11 | 12 | * GNU Lesser General Public License Version 2.1 or later (the "LGPL"): 13 | http://www.gnu.org/licenses/lgpl.html 14 | 15 | * Mozilla Public License Version 1.1 or later (the "MPL"): 16 | http://www.mozilla.org/MPL/MPL-1.1.html 17 | 18 | You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. 19 | 20 | Sources of Intellectual Property Included in this plugin 21 | -------------------------------------------------------- 22 | 23 | Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission. 24 | 25 | Trademarks 26 | ---------- 27 | 28 | CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. 29 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | require 'rubygems' 3 | begin 4 | require 'bundler/setup' 5 | rescue LoadError 6 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks' 7 | end 8 | 9 | require 'rake' 10 | require 'rdoc/task' 11 | 12 | require 'rake/testtask' 13 | 14 | Rake::TestTask.new(:test) do |t| 15 | t.libs << 'lib' 16 | t.libs << 'test' 17 | t.pattern = 'test/**/*_test.rb' 18 | t.verbose = false 19 | end 20 | 21 | Rake::TestTask.new("test:controllers") do |t| 22 | t.libs << 'lib' 23 | t.libs << 'test' 24 | t.pattern = 'test/controllers/*_test.rb' 25 | t.verbose = false 26 | end 27 | 28 | Rake::TestTask.new("test:generators") do |t| 29 | t.libs << 'lib' 30 | t.libs << 'test' 31 | t.pattern = 'test/generators/*_test.rb' 32 | t.verbose = false 33 | end 34 | 35 | Rake::TestTask.new("test:integration") do |t| 36 | t.libs << 'lib' 37 | t.libs << 'test' 38 | t.pattern = 'test/integration/*_test.rb' 39 | t.verbose = false 40 | end 41 | 42 | Rake::TestTask.new("test:models") do |t| 43 | t.libs << 'lib' 44 | t.libs << 'test' 45 | t.pattern = 'test/models/*_test.rb' 46 | t.verbose = false 47 | end 48 | 49 | Rake::TestTask.new("test:functional") do |t| 50 | t.libs << 'lib' 51 | t.libs << 'test' 52 | t.pattern = 'test/functional/*_test.rb' 53 | t.verbose = false 54 | end 55 | 56 | task :default => :test 57 | 58 | RDoc::Task.new do |rdoc| 59 | rdoc.rdoc_dir = 'rdoc' 60 | rdoc.title = 'Ckeditor' 61 | rdoc.options << '--line-numbers' << '--inline-source' 62 | rdoc.rdoc_files.include('README.rdoc') 63 | rdoc.rdoc_files.include('lib/**/*.rb') 64 | end 65 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/scayt/LICENSE.md: -------------------------------------------------------------------------------- 1 | Software License Agreement 2 | ========================== 3 | 4 | **CKEditor SCAYT Plugin** 5 | Copyright © 2012, [CKSource](http://cksource.com) - Frederico Knabben. All rights reserved. 6 | 7 | Licensed under the terms of any of the following licenses at your choice: 8 | 9 | * GNU General Public License Version 2 or later (the "GPL"): 10 | http://www.gnu.org/licenses/gpl.html 11 | 12 | * GNU Lesser General Public License Version 2.1 or later (the "LGPL"): 13 | http://www.gnu.org/licenses/lgpl.html 14 | 15 | * Mozilla Public License Version 1.1 or later (the "MPL"): 16 | http://www.mozilla.org/MPL/MPL-1.1.html 17 | 18 | You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. 19 | 20 | Sources of Intellectual Property Included in this plugin 21 | -------------------------------------------------------- 22 | 23 | Where not otherwise indicated, all plugin content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, the plugin will incorporate work done by developers outside of CKSource with their express permission. 24 | 25 | Trademarks 26 | ---------- 27 | 28 | CKEditor is a trademark of CKSource - Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. 29 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("anchor",function(c){function d(a,b){return a.createFakeElement(a.document.createElement("a",{attributes:b}),"cke_anchor","anchor")}return{title:c.lang.link.anchor.title,minWidth:300,minHeight:60,onOk:function(){var a=CKEDITOR.tools.trim(this.getValueOf("info","txtName")),a={id:a,name:a,"data-cke-saved-name":a};if(this._.selectedElement)this._.selectedElement.data("cke-realelement")?(a=d(c,a),a.replace(this._.selectedElement),CKEDITOR.env.ie&&c.getSelection().selectElement(a)): 6 | this._.selectedElement.setAttributes(a);else{var b=c.getSelection(),b=b&&b.getRanges()[0];b.collapsed?(a=d(c,a),b.insertNode(a)):(CKEDITOR.env.ie&&9>CKEDITOR.env.version&&(a["class"]="cke_anchor"),a=new CKEDITOR.style({element:"a",attributes:a}),a.type=CKEDITOR.STYLE_INLINE,c.applyStyle(a))}},onHide:function(){delete this._.selectedElement},onShow:function(){var a=c.getSelection(),b=a.getSelectedElement(),d=b&&b.data("cke-realelement"),e=d?CKEDITOR.plugins.link.tryRestoreFakeAnchor(c,b):CKEDITOR.plugins.link.getSelectedLink(c); 7 | e&&(this._.selectedElement=e,this.setValueOf("info","txtName",e.data("cke-saved-name")||""),!d&&a.selectElement(e),b&&(this._.selectedElement=b));this.getContentElement("info","txtName").focus()},contents:[{id:"info",label:c.lang.link.anchor.title,accessKey:"I",elements:[{type:"text",id:"txtName",label:c.lang.link.anchor.name,required:!0,validate:function(){return!this.getValue()?(alert(c.lang.link.anchor.errorName),!1):!0}}]}]}}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.html or http://ckeditor.com/license 4 | */ 5 | 6 | html, body 7 | { 8 | background-color: transparent; 9 | margin: 0px; 10 | padding: 0px; 11 | } 12 | 13 | body 14 | { 15 | padding: 10px; 16 | } 17 | 18 | body, td, input, select, textarea 19 | { 20 | font-size: 11px; 21 | font-family: 'Microsoft Sans Serif' , Arial, Helvetica, Verdana; 22 | } 23 | 24 | .midtext 25 | { 26 | padding:0px; 27 | margin:10px; 28 | } 29 | 30 | .midtext p 31 | { 32 | padding:0px; 33 | margin:10px; 34 | } 35 | 36 | .Button 37 | { 38 | border: #737357 1px solid; 39 | color: #3b3b1f; 40 | background-color: #c7c78f; 41 | } 42 | 43 | .PopupTabArea 44 | { 45 | color: #737357; 46 | background-color: #e3e3c7; 47 | } 48 | 49 | .PopupTitleBorder 50 | { 51 | border-bottom: #d5d59d 1px solid; 52 | } 53 | .PopupTabEmptyArea 54 | { 55 | padding-left: 10px; 56 | border-bottom: #d5d59d 1px solid; 57 | } 58 | 59 | .PopupTab, .PopupTabSelected 60 | { 61 | border-right: #d5d59d 1px solid; 62 | border-top: #d5d59d 1px solid; 63 | border-left: #d5d59d 1px solid; 64 | padding: 3px 5px 3px 5px; 65 | color: #737357; 66 | } 67 | 68 | .PopupTab 69 | { 70 | margin-top: 1px; 71 | border-bottom: #d5d59d 1px solid; 72 | cursor: pointer; 73 | } 74 | 75 | .PopupTabSelected 76 | { 77 | font-weight: bold; 78 | cursor: default; 79 | padding-top: 4px; 80 | border-bottom: #f1f1e3 1px solid; 81 | background-color: #f1f1e3; 82 | } 83 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css: -------------------------------------------------------------------------------- 1 | a 2 | { 3 | text-decoration:none; 4 | padding: 2px 4px 4px 6px; 5 | display : block; 6 | border-width: 1px; 7 | border-style: solid; 8 | margin : 0px; 9 | } 10 | 11 | a.cke_scayt_toogle:hover, 12 | a.cke_scayt_toogle:focus, 13 | a.cke_scayt_toogle:active 14 | { 15 | border-color: #316ac5; 16 | background-color: #dff1ff; 17 | color : #000; 18 | cursor: pointer; 19 | margin : 0px; 20 | } 21 | a.cke_scayt_toogle { 22 | color : #316ac5; 23 | border-color: #fff; 24 | } 25 | .scayt_enabled a.cke_scayt_item { 26 | color : #316ac5; 27 | border-color: #fff; 28 | margin : 0px; 29 | } 30 | .scayt_disabled a.cke_scayt_item { 31 | color : gray; 32 | border-color : #fff; 33 | } 34 | .scayt_enabled a.cke_scayt_item:hover, 35 | .scayt_enabled a.cke_scayt_item:focus, 36 | .scayt_enabled a.cke_scayt_item:active 37 | { 38 | border-color: #316ac5; 39 | background-color: #dff1ff; 40 | color : #000; 41 | cursor: pointer; 42 | } 43 | .scayt_disabled a.cke_scayt_item:hover, 44 | .scayt_disabled a.cke_scayt_item:focus, 45 | .scayt_disabled a.cke_scayt_item:active 46 | { 47 | border-color: gray; 48 | background-color: #dff1ff; 49 | color : gray; 50 | cursor: no-drop; 51 | } 52 | .cke_scayt_set_on, .cke_scayt_set_off 53 | { 54 | display: none; 55 | } 56 | .scayt_enabled .cke_scayt_set_on 57 | { 58 | display: none; 59 | } 60 | .scayt_disabled .cke_scayt_set_on 61 | { 62 | display: inline; 63 | } 64 | .scayt_disabled .cke_scayt_set_off 65 | { 66 | display: none; 67 | } 68 | .scayt_enabled .cke_scayt_set_off 69 | { 70 | display: inline; 71 | } 72 | -------------------------------------------------------------------------------- /lib/generators/ckeditor/templates/ckeditor.rb: -------------------------------------------------------------------------------- 1 | # Use this hook to configure ckeditor 2 | Ckeditor.setup do |config| 3 | # ==> ORM configuration 4 | # Load and configure the ORM. Supports :active_record (default), :mongo_mapper and 5 | # :mongoid (bson_ext recommended) by default. Other ORMs may be 6 | # available as additional gems. 7 | require "ckeditor/orm/<%= options[:orm] %>" 8 | 9 | # Allowed image file types for upload. 10 | # Set to nil or [] (empty array) for all file types 11 | # By default: %w(jpg jpeg png gif tiff) 12 | # config.image_file_types = ["jpg", "jpeg", "png", "gif", "tiff"] 13 | 14 | # Allowed attachment file types for upload. 15 | # Set to nil or [] (empty array) for all file types 16 | # By default: %w(doc docx xls odt ods pdf rar zip tar tar.gz swf) 17 | # config.attachment_file_types = ["doc", "docx", "xls", "odt", "ods", "pdf", "rar", "zip", "tar", "swf"] 18 | 19 | # Setup authorization to be run as a before filter 20 | # By default: there is no authorization. 21 | # config.authorize_with :cancan 22 | 23 | # Asset model classes 24 | # config.picture_model { Ckeditor::Picture } 25 | # config.attachment_file_model { Ckeditor::AttachmentFile } 26 | 27 | # Paginate assets 28 | # By default: 24 29 | # config.default_per_page = 24 30 | 31 | # Customize ckeditor assets path 32 | # By default: nil 33 | # config.asset_path = "http://www.example.com/assets/ckeditor/" 34 | 35 | # To reduce the asset precompilation time, you can limit plugins and/or languages to those you need: 36 | # By default: nil (no limit) 37 | # config.assets_languages = ['en', 'uk'] 38 | # config.assets_plugins = ['image', 'smiley'] 39 | end 40 | -------------------------------------------------------------------------------- /test/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Configure static asset server for tests with Cache-Control for performance 11 | config.serve_static_assets = true 12 | config.static_cache_control = "public, max-age=3600" 13 | 14 | # Log error messages when you accidentally call methods on nil 15 | config.whiny_nils = true 16 | 17 | # Show full error reports and disable caching 18 | config.consider_all_requests_local = true 19 | config.action_controller.perform_caching = false 20 | 21 | # Raise exceptions instead of rendering exception templates 22 | config.action_dispatch.show_exceptions = false 23 | 24 | # Disable request forgery protection in test environment 25 | config.action_controller.allow_forgery_protection = false 26 | 27 | # Tell Action Mailer not to deliver emails to the real world. 28 | # The :test delivery method accumulates sent emails in the 29 | # ActionMailer::Base.deliveries array. 30 | config.action_mailer.delivery_method = :test 31 | 32 | # Raise exception on mass assignment protection for Active Record models 33 | config.active_record.mass_assignment_sanitizer = :strict 34 | 35 | # Print deprecation notices to the stderr 36 | config.active_support.deprecation = :stderr 37 | end 38 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("hiddenfield",function(d){return{title:d.lang.forms.hidden.title,hiddenField:null,minWidth:350,minHeight:110,onShow:function(){delete this.hiddenField;var a=this.getParentEditor(),b=a.getSelection(),c=b.getSelectedElement();c&&(c.data("cke-real-element-type")&&"hiddenfield"==c.data("cke-real-element-type"))&&(this.hiddenField=c,c=a.restoreRealElement(this.hiddenField),this.setupContent(c),b.selectElement(this.hiddenField))},onOk:function(){var a=this.getValueOf("info","_cke_saved_name"); 6 | this.getValueOf("info","value");var b=this.getParentEditor(),a=CKEDITOR.env.ie&&!(8<=CKEDITOR.document.$.documentMode)?b.document.createElement(''):b.document.createElement("input");a.setAttribute("type","hidden");this.commitContent(a);a=b.createFakeElement(a,"cke_hidden","hiddenfield");this.hiddenField?(a.replace(this.hiddenField),b.getSelection().selectElement(a)):b.insertElement(a);return!0},contents:[{id:"info",label:d.lang.forms.hidden.title,title:d.lang.forms.hidden.title, 7 | elements:[{id:"_cke_saved_name",type:"text",label:d.lang.forms.hidden.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.setAttribute("name",this.getValue()):a.removeAttribute("name")}},{id:"value",type:"text",label:d.lang.forms.hidden.value,"default":"",accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){this.getValue()?a.setAttribute("value",this.getValue()): 8 | a.removeAttribute("value")}}]}]}}); -------------------------------------------------------------------------------- /lib/ckeditor/text_area.rb: -------------------------------------------------------------------------------- 1 | require 'active_support' 2 | require 'action_view/helpers/tag_helper' 3 | require 'action_view/helpers/form_tag_helper' 4 | 5 | module Ckeditor 6 | class TextArea 7 | include ActionView::Helpers::TagHelper 8 | include ActionView::Helpers::FormTagHelper 9 | include ActionView::Helpers::JavaScriptHelper 10 | 11 | attr_reader :template, :options, :ck_options 12 | 13 | def initialize(template, options) 14 | @template = template 15 | @options = options.stringify_keys 16 | @ck_options = (@options.delete('ckeditor') || {}).stringify_keys 17 | end 18 | 19 | def render_instance_tag(object_name, method) 20 | tag = build_tag(object_name, method) 21 | tag.send(:add_default_name_and_id, options) if options['id'].blank? 22 | 23 | render tag.respond_to?(:to_text_area_tag) ? tag.to_text_area_tag(options) : tag.render 24 | end 25 | 26 | def render_tag(name, content) 27 | options['id'] = sanitize_to_id(options['id'] || name) 28 | 29 | render text_area_tag(name, content, options) 30 | end 31 | 32 | protected 33 | 34 | def render(input) 35 | output_buffer << input 36 | output_buffer << javascript_tag(Utils.js_replace(options['id'], ck_options)) 37 | output_buffer 38 | end 39 | 40 | def output_buffer 41 | @output_buffer ||= ActiveSupport::SafeBuffer.new 42 | end 43 | 44 | def build_tag(object_name, method) 45 | if defined?(ActionView::Base::Tags::TextArea) 46 | ActionView::Base::Tags::TextArea.new(object_name, method, template, options.symbolize_keys) 47 | else 48 | ActionView::Base::InstanceTag.new(object_name, method, template, options.delete('object')) 49 | end 50 | end 51 | end 52 | end -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("button",function(b){function d(a){var b=this.getValue();b?(a.attributes[this.id]=b,"name"==this.id&&(a.attributes["data-cke-saved-name"]=b)):(delete a.attributes[this.id],"name"==this.id&&delete a.attributes["data-cke-saved-name"])}return{title:b.lang.forms.button.title,minWidth:350,minHeight:150,onShow:function(){delete this.button;var a=this.getParentEditor().getSelection().getSelectedElement();a&&a.is("input")&&a.getAttribute("type")in{button:1,reset:1,submit:1}&&(this.button= 6 | a,this.setupContent(a))},onOk:function(){var a=this.getParentEditor(),b=this.button,d=!b,c=b?CKEDITOR.htmlParser.fragment.fromHtml(b.getOuterHtml()).children[0]:new CKEDITOR.htmlParser.element("input");this.commitContent(c);var e=new CKEDITOR.htmlParser.basicWriter;c.writeHtml(e);c=CKEDITOR.dom.element.createFromHtml(e.getHtml(),a.document);d?a.insertElement(c):(c.replace(b),a.getSelection().selectElement(c))},contents:[{id:"info",label:b.lang.forms.button.title,title:b.lang.forms.button.title,elements:[{id:"name", 7 | type:"text",label:b.lang.common.name,"default":"",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:d},{id:"value",type:"text",label:b.lang.forms.button.text,accessKey:"V","default":"",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:d},{id:"type",type:"select",label:b.lang.forms.button.type,"default":"button",accessKey:"T",items:[[b.lang.forms.button.typeBtn,"button"],[b.lang.forms.button.typeSbm,"submit"],[b.lang.forms.button.typeRst, 8 | "reset"]],setup:function(a){this.setValue(a.getAttribute("type")||"")},commit:d}]}]}}); -------------------------------------------------------------------------------- /lib/ckeditor/backend/carrierwave.rb: -------------------------------------------------------------------------------- 1 | require 'mime/types' 2 | require 'mini_magick' 3 | 4 | module Ckeditor 5 | module Backend 6 | module CarrierWave 7 | def self.included(base) 8 | base.send(:include, InstanceMethods) 9 | base.send(:extend, ClassMethods) 10 | end 11 | 12 | module ClassMethods 13 | def self.extended(base) 14 | base.class_eval do 15 | process :extract_content_type 16 | process :set_size 17 | end 18 | end 19 | end 20 | 21 | module InstanceMethods 22 | # process :strip 23 | def strip 24 | manipulate! do |img| 25 | img.strip 26 | img = yield(img) if block_given? 27 | img 28 | end 29 | end 30 | 31 | # process :quality => 85 32 | def quality(percentage) 33 | manipulate! do |img| 34 | img.quality(percentage) 35 | img = yield(img) if block_given? 36 | img 37 | end 38 | end 39 | 40 | def extract_content_type 41 | if file.content_type == 'application/octet-stream' || file.content_type.blank? 42 | content_type = MIME::Types.type_for(original_filename).first 43 | else 44 | content_type = file.content_type 45 | end 46 | 47 | model.data_content_type = content_type.to_s 48 | end 49 | 50 | def set_size 51 | model.data_file_size = file.size 52 | end 53 | 54 | def read_dimensions 55 | if model.image? && model.has_dimensions? 56 | magick = ::MiniMagick::Image.new(current_path) 57 | model.width, model.height = magick[:width], magick[:height] 58 | end 59 | end 60 | 61 | end 62 | end 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /test/controllers/pictures_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class PicturesControllerTest < ActionController::TestCase 4 | tests Ckeditor::PicturesController 5 | 6 | include RawPost 7 | include Ckeditor::Engine.routes.url_helpers 8 | include ControllerHooks 9 | 10 | def setup 11 | @image = fixture_file_upload('files/rails.png', 'image/png') 12 | end 13 | 14 | def teardown 15 | Ckeditor::Picture.destroy_all 16 | end 17 | 18 | test "index action" do 19 | get :index 20 | 21 | assert_equal 200, @response.status 22 | assert_template "ckeditor/pictures/index" 23 | end 24 | 25 | test "create action via filebrowser" do 26 | assert_difference 'Ckeditor::Picture.count' do 27 | post :create, :qqfile => @image 28 | end 29 | 30 | assert_equal 200, @response.status 31 | end 32 | 33 | test "create action via CKEditor upload form" do 34 | assert_difference 'Ckeditor::Picture.count' do 35 | post :create, :upload => @image, :CKEditor => 'ckeditor_field' 36 | end 37 | 38 | assert_equal 200, @response.status 39 | end 40 | 41 | test "create action via html5 upload" do 42 | assert_difference 'Ckeditor::Picture.count' do 43 | raw_post :create, { :qqfile => @image.original_filename }, @image.read, "image/png" 44 | end 45 | 46 | assert_equal 200, @response.status 47 | end 48 | 49 | test "invalid params for create action" do 50 | assert_no_difference 'Ckeditor::Picture.count' do 51 | post :create, :qqfile => nil 52 | end 53 | end 54 | 55 | test "destroy action via filebrowser" do 56 | @picture = Ckeditor::Picture.create :data => @image 57 | 58 | assert_difference 'Ckeditor::Picture.count', -1 do 59 | delete :destroy, :id => @picture.id 60 | end 61 | 62 | assert_equal 302, @response.status 63 | end 64 | end 65 | -------------------------------------------------------------------------------- /lib/ckeditor/backend/paperclip.rb: -------------------------------------------------------------------------------- 1 | require 'mime/types' 2 | 3 | module Ckeditor 4 | module Backend 5 | module Paperclip 6 | def self.included(base) 7 | base.send(:include, InstanceMethods) 8 | base.send(:extend, ClassMethods) 9 | end 10 | 11 | module ClassMethods 12 | def self.extended(base) 13 | base.class_eval do 14 | before_validation :extract_content_type 15 | before_create :read_dimensions, :parameterize_filename 16 | 17 | delegate :url, :path, :styles, :size, :content_type, :to => :data 18 | end 19 | end 20 | end 21 | 22 | module InstanceMethods 23 | def geometry 24 | @geometry ||= begin 25 | file = data.respond_to?(:queued_for_write) ? data.queued_for_write[:original] : data.to_file 26 | ::Paperclip::Geometry.from_file(file) 27 | end 28 | end 29 | 30 | protected 31 | 32 | def parameterize_filename 33 | unless data_file_name.blank? 34 | filename = Ckeditor::Utils.parameterize_filename(data_file_name) 35 | self.data.instance_write(:file_name, filename) 36 | end 37 | end 38 | 39 | def read_dimensions 40 | if image? && has_dimensions? 41 | self.width = geometry.width 42 | self.height = geometry.height 43 | end 44 | end 45 | 46 | # Extract content_type from filename using mime/types gem 47 | def extract_content_type 48 | if data_content_type == "application/octet-stream" && !data_file_name.blank? 49 | content_types = MIME::Types.type_for(data_file_name) 50 | self.data_content_type = content_types.first.to_s unless content_types.empty? 51 | end 52 | end 53 | end 54 | end 55 | end 56 | end 57 | -------------------------------------------------------------------------------- /test/controllers/attachment_files_controller_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class AttachmentFilesControllerTest < ActionController::TestCase 4 | tests Ckeditor::AttachmentFilesController 5 | 6 | include RawPost 7 | include ControllerHooks 8 | 9 | def setup 10 | @attachment = fixture_file_upload('files/rails.tar.gz', 'application/x-gzip') 11 | end 12 | 13 | def teardown 14 | Ckeditor::AttachmentFile.destroy_all 15 | end 16 | 17 | test "index action" do 18 | get :index 19 | 20 | assert_equal 200, @response.status 21 | assert_template "ckeditor/attachment_files/index" 22 | end 23 | 24 | test "create action via filebrowser" do 25 | assert_difference 'Ckeditor::AttachmentFile.count' do 26 | post :create, :qqfile => @attachment 27 | end 28 | 29 | assert_equal 200, @response.status 30 | end 31 | 32 | test "create action via CKEditor upload form" do 33 | assert_difference 'Ckeditor::AttachmentFile.count' do 34 | post :create, :upload => @attachment, :CKEditor => 'ckeditor_field' 35 | end 36 | 37 | assert_equal 200, @response.status 38 | end 39 | 40 | test "create action via html5 upload" do 41 | assert_difference 'Ckeditor::AttachmentFile.count' do 42 | raw_post :create, { :qqfile => @attachment.original_filename }, @attachment.read 43 | end 44 | 45 | assert_equal 200, @response.status 46 | end 47 | 48 | test "invalid params for create action" do 49 | assert_no_difference 'Ckeditor::AttachmentFile.count' do 50 | post :create, :qqfile => nil 51 | end 52 | end 53 | 54 | test "destroy action via filebrowser" do 55 | @attachment_file = Ckeditor::AttachmentFile.create :data => @attachment 56 | 57 | assert_difference 'Ckeditor::AttachmentFile.count', -1 do 58 | delete :destroy, :id => @attachment_file.id 59 | end 60 | 61 | assert_equal 302, @response.status 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("textarea",function(b){return{title:b.lang.forms.textarea.title,minWidth:350,minHeight:220,onShow:function(){delete this.textarea;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"textarea"==a.getName()&&(this.textarea=a,this.setupContent(a))},onOk:function(){var a,b=this.textarea,c=!b;c&&(a=this.getParentEditor(),b=a.document.createElement("textarea"));this.commitContent(b);c&&a.insertElement(b)},contents:[{id:"info",label:b.lang.forms.textarea.title,title:b.lang.forms.textarea.title, 6 | elements:[{id:"_cke_saved_name",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{type:"hbox",widths:["50%","50%"],children:[{id:"cols",type:"text",label:b.lang.forms.textarea.cols,"default":"",accessKey:"C",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed), 7 | setup:function(a){this.setValue(a.hasAttribute("cols")&&a.getAttribute("cols")||"")},commit:function(a){this.getValue()?a.setAttribute("cols",this.getValue()):a.removeAttribute("cols")}},{id:"rows",type:"text",label:b.lang.forms.textarea.rows,"default":"",accessKey:"R",style:"width:50px",validate:CKEDITOR.dialog.validate.integer(b.lang.common.validateNumberFailed),setup:function(a){this.setValue(a.hasAttribute("rows")&&a.getAttribute("rows")||"")},commit:function(a){this.getValue()?a.setAttribute("rows", 8 | this.getValue()):a.removeAttribute("rows")}}]},{id:"value",type:"textarea",label:b.lang.forms.textfield.value,"default":"",setup:function(a){this.setValue(a.$.defaultValue)},commit:function(a){a.$.value=a.$.defaultValue=this.getValue()}}]}]}}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | 6 | .cke_tpl_list 7 | { 8 | border: #dcdcdc 2px solid; 9 | background-color: #ffffff; 10 | overflow-y: auto; 11 | overflow-x: hidden; 12 | width: 100%; 13 | height: 220px; 14 | } 15 | 16 | .cke_tpl_item 17 | { 18 | margin: 5px; 19 | padding: 7px; 20 | border: #eeeeee 1px solid; 21 | *width: 88%; 22 | } 23 | 24 | .cke_tpl_preview 25 | { 26 | border-collapse: separate; 27 | text-indent:0; 28 | width: 100%; 29 | } 30 | .cke_tpl_preview td 31 | { 32 | padding: 2px; 33 | vertical-align: middle; 34 | } 35 | .cke_tpl_preview .cke_tpl_preview_img 36 | { 37 | width: 100px; 38 | } 39 | .cke_tpl_preview span 40 | { 41 | white-space: normal; 42 | } 43 | 44 | .cke_tpl_title 45 | { 46 | font-weight: bold; 47 | } 48 | 49 | .cke_tpl_list a:hover .cke_tpl_item, 50 | .cke_tpl_list a:focus .cke_tpl_item, 51 | .cke_tpl_list a:active .cke_tpl_item 52 | { 53 | border: #ff9933 1px solid; 54 | background-color: #fffacd; 55 | } 56 | 57 | .cke_tpl_list a:hover *, 58 | .cke_tpl_list a:focus *, 59 | .cke_tpl_list a:active * 60 | { 61 | cursor: pointer; 62 | } 63 | 64 | /* IE Quirks contextual selectors children will not get :hover transition until 65 | the hover style of the link itself contains certain CSS declarations. */ 66 | .cke_browser_quirks .cke_tpl_list a:active, 67 | .cke_browser_quirks .cke_tpl_list a:hover, 68 | .cke_browser_quirks .cke_tpl_list a:focus 69 | { 70 | background-position: 0 0; 71 | } 72 | 73 | .cke_hc .cke_tpl_list a:hover .cke_tpl_item, 74 | .cke_hc .cke_tpl_list a:focus .cke_tpl_item, 75 | .cke_hc .cke_tpl_list a:active .cke_tpl_item 76 | { 77 | border-width: 3px; 78 | } 79 | 80 | .cke_tpl_empty, .cke_tpl_loading 81 | { 82 | text-align: center; 83 | padding: 5px; 84 | } 85 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("radio",function(d){return{title:d.lang.forms.checkboxAndRadio.radioTitle,minWidth:350,minHeight:140,onShow:function(){delete this.radioButton;var a=this.getParentEditor().getSelection().getSelectedElement();a&&("input"==a.getName()&&"radio"==a.getAttribute("type"))&&(this.radioButton=a,this.setupContent(a))},onOk:function(){var a,b=this.radioButton,c=!b;c&&(a=this.getParentEditor(),b=a.document.createElement("input"),b.setAttribute("type","radio"));c&&a.insertElement(b);this.commitContent({element:b})}, 6 | contents:[{id:"info",label:d.lang.forms.checkboxAndRadio.radioTitle,title:d.lang.forms.checkboxAndRadio.radioTitle,elements:[{id:"name",type:"text",label:d.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"value",type:"text",label:d.lang.forms.checkboxAndRadio.value,"default":"", 7 | accessKey:"V",setup:function(a){this.setValue(a.getAttribute("value")||"")},commit:function(a){a=a.element;this.getValue()?a.setAttribute("value",this.getValue()):a.removeAttribute("value")}},{id:"checked",type:"checkbox",label:d.lang.forms.checkboxAndRadio.selected,"default":"",accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var b=a.element;if(CKEDITOR.env.ie){var c=b.getAttribute("checked"),e=!!this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('",d.document),b.copyAttributes(c,{type:1,checked:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c)}else this.getValue()?b.setAttribute("checked","checked"):b.removeAttribute("checked")}}]}]}}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 64 | 65 |

66 | 67 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("form",function(a){var d={action:1,id:1,method:1,enctype:1,target:1};return{title:a.lang.forms.form.title,minWidth:350,minHeight:200,onShow:function(){delete this.form;var b=this.getParentEditor().elementPath().contains("form",1);b&&(this.form=b,this.setupContent(b))},onOk:function(){var b,a=this.form,c=!a;c&&(b=this.getParentEditor(),a=b.document.createElement("form"),a.appendBogus());c&&b.insertElement(a);this.commitContent(a)},onLoad:function(){function a(b){this.setValue(b.getAttribute(this.id)|| 6 | "")}function e(a){this.getValue()?a.setAttribute(this.id,this.getValue()):a.removeAttribute(this.id)}this.foreach(function(c){d[c.id]&&(c.setup=a,c.commit=e)})},contents:[{id:"info",label:a.lang.forms.form.title,title:a.lang.forms.form.title,elements:[{id:"txtName",type:"text",label:a.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name", 7 | !1),a.removeAttribute("name"))}},{id:"action",type:"text",label:a.lang.forms.form.action,"default":"",accessKey:"T"},{type:"hbox",widths:["45%","55%"],children:[{id:"id",type:"text",label:a.lang.common.id,"default":"",accessKey:"I"},{id:"enctype",type:"select",label:a.lang.forms.form.encoding,style:"width:100%",accessKey:"E","default":"",items:[[""],["text/plain"],["multipart/form-data"],["application/x-www-form-urlencoded"]]}]},{type:"hbox",widths:["45%","55%"],children:[{id:"target",type:"select", 8 | label:a.lang.common.target,style:"width:100%",accessKey:"M","default":"",items:[[a.lang.common.notSet,""],[a.lang.common.targetNew,"_blank"],[a.lang.common.targetTop,"_top"],[a.lang.common.targetSelf,"_self"],[a.lang.common.targetParent,"_parent"]]},{id:"method",type:"select",label:a.lang.forms.form.method,accessKey:"M","default":"GET",items:[["GET","get"],["POST","post"]]}]}]}]}}); -------------------------------------------------------------------------------- /lib/ckeditor/hooks/pundit.rb: -------------------------------------------------------------------------------- 1 | require 'pundit' 2 | 3 | module Ckeditor 4 | module Hooks 5 | # This adapter is for the Pundit[https://github.com/elabs/pundit] authorization library. 6 | # You can create another adapter for different authorization behavior, just be certain it 7 | # responds to each of the public methods here. 8 | class PunditAuthorization 9 | 10 | include Ckeditor::Helpers::Controllers 11 | 12 | # See the +authorize_with+ config method for where the initialization happens. 13 | def initialize(controller) 14 | @controller = controller 15 | @controller.extend ControllerExtension 16 | end 17 | 18 | # This method is called in every controller action and should raise an exception 19 | # when the authorization fails. The first argument is the name of the controller 20 | # action as a symbol (:create, :destroy, etc.). The second argument is the actual model 21 | # instance if it is available. 22 | def authorize(action, model_object = nil) 23 | raise Pundit::NotAuthorizedError unless authorized?(action, model_object) 24 | end 25 | 26 | # This method is called primarily from the view to determine whether the given user 27 | # has access to perform the action on a given model. It should return true when authorized. 28 | # This takes the same arguments as +authorize+. The difference is that this will 29 | # return a boolean whereas +authorize+ will raise an exception when not authorized. 30 | def authorized?(action, model_object = nil) 31 | Pundit.policy(@controller.current_user_for_pundit, model_object).public_send(action + '?' ) if action 32 | end 33 | 34 | private 35 | 36 | module ControllerExtension 37 | def current_user_for_pundit 38 | # use ckeditor_current_user instead of default current_user so it works with 39 | # whatever current user method is defined with Ckeditor 40 | ckeditor_current_user 41 | end 42 | end 43 | end 44 | end 45 | end 46 | 47 | Ckeditor::AUTHORIZATION_ADAPTERS[:pundit] = Ckeditor::Hooks::PunditAuthorization 48 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("checkbox",function(d){return{title:d.lang.forms.checkboxAndRadio.checkboxTitle,minWidth:350,minHeight:140,onShow:function(){delete this.checkbox;var a=this.getParentEditor().getSelection().getSelectedElement();a&&"checkbox"==a.getAttribute("type")&&(this.checkbox=a,this.setupContent(a))},onOk:function(){var a,b=this.checkbox;b||(a=this.getParentEditor(),b=a.document.createElement("input"),b.setAttribute("type","checkbox"),a.insertElement(b));this.commitContent({element:b})},contents:[{id:"info", 6 | label:d.lang.forms.checkboxAndRadio.checkboxTitle,title:d.lang.forms.checkboxAndRadio.checkboxTitle,startupFocus:"txtName",elements:[{id:"txtName",type:"text",label:d.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){a=a.element;this.getValue()?a.data("cke-saved-name",this.getValue()):(a.data("cke-saved-name",!1),a.removeAttribute("name"))}},{id:"txtValue",type:"text",label:d.lang.forms.checkboxAndRadio.value, 7 | "default":"",accessKey:"V",setup:function(a){a=a.getAttribute("value");this.setValue(CKEDITOR.env.ie&&"on"==a?"":a)},commit:function(a){var b=a.element,c=this.getValue();c&&!(CKEDITOR.env.ie&&"on"==c)?b.setAttribute("value",c):CKEDITOR.env.ie?(c=new CKEDITOR.dom.element("input",b.getDocument()),b.copyAttributes(c,{value:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c):b.removeAttribute("value")}},{id:"cmbSelected",type:"checkbox",label:d.lang.forms.checkboxAndRadio.selected,"default":"", 8 | accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var b=a.element;if(CKEDITOR.env.ie){var c=!!b.getAttribute("checked"),e=!!this.getValue();c!=e&&(c=CKEDITOR.dom.element.createFromHtml('",d.document),b.copyAttributes(c,{type:1,checked:1}),c.replace(b),d.getSelection().selectElement(c),a.element=c)}else this.getValue()?b.setAttribute("checked","checked"):b.removeAttribute("checked")}}]}]}}); -------------------------------------------------------------------------------- /lib/ckeditor/hooks/cancan.rb: -------------------------------------------------------------------------------- 1 | require 'cancan' 2 | 3 | module Ckeditor 4 | module Hooks 5 | # This adapter is for the CanCan[https://github.com/ryanb/cancan] authorization library. 6 | # You can create another adapter for different authorization behavior, just be certain it 7 | # responds to each of the public methods here. 8 | class CanCanAuthorization 9 | # See the +authorize_with+ config method for where the initialization happens. 10 | def initialize(controller, ability = ::Ability) 11 | @controller = controller 12 | @controller.instance_variable_set '@ability', ability 13 | @controller.extend ControllerExtension 14 | @controller.current_ability.authorize! :access, :ckeditor 15 | end 16 | 17 | # This method is called in every controller action and should raise an exception 18 | # when the authorization fails. The first argument is the name of the controller 19 | # action as a symbol (:create, :destroy, etc.). The second argument is the actual model 20 | # instance if it is available. 21 | def authorize(action, model_object = nil) 22 | @controller.current_ability.authorize!(action.to_sym, model_object) if action 23 | end 24 | 25 | # This method is called primarily from the view to determine whether the given user 26 | # has access to perform the action on a given model. It should return true when authorized. 27 | # This takes the same arguments as +authorize+. The difference is that this will 28 | # return a boolean whereas +authorize+ will raise an exception when not authorized. 29 | def authorized?(action, model_object = nil) 30 | @controller.current_ability.can?(action.to_sym, model_object) if action 31 | end 32 | 33 | private 34 | 35 | module ControllerExtension 36 | def current_ability 37 | # use ckeditor_current_user instead of default current_user so it works with 38 | # whatever current user method is defined with Ckeditor 39 | @current_ability ||= @ability.new(ckeditor_current_user) 40 | end 41 | end 42 | end 43 | end 44 | end 45 | 46 | Ckeditor::AUTHORIZATION_ADAPTERS[:cancan] = Ckeditor::Hooks::CanCanAuthorization 47 | -------------------------------------------------------------------------------- /test/dummy/app/controllers/posts_controller.rb: -------------------------------------------------------------------------------- 1 | class PostsController < ApplicationController 2 | # GET /posts 3 | # GET /posts.xml 4 | def index 5 | @posts = Post.all 6 | 7 | respond_to do |format| 8 | format.html # index.html.erb 9 | format.xml { render :xml => @posts } 10 | end 11 | end 12 | 13 | # GET /posts/1 14 | # GET /posts/1.xml 15 | def show 16 | @post = Post.find(params[:id]) 17 | 18 | respond_to do |format| 19 | format.html # show.html.erb 20 | format.xml { render :xml => @post } 21 | end 22 | end 23 | 24 | # GET /posts/new 25 | # GET /posts/new.xml 26 | def new 27 | @post = Post.new 28 | 29 | respond_to do |format| 30 | format.html # new.html.erb 31 | format.xml { render :xml => @post } 32 | end 33 | end 34 | 35 | # GET /posts/1/edit 36 | def edit 37 | @post = Post.find(params[:id]) 38 | end 39 | 40 | # POST /posts 41 | # POST /posts.xml 42 | def create 43 | @post = Post.new(params[:post]) 44 | 45 | respond_to do |format| 46 | if @post.save 47 | format.html { redirect_to(@post, :notice => 'Post was successfully created.') } 48 | format.xml { render :xml => @post, :status => :created, :location => @post } 49 | else 50 | format.html { render :action => "new" } 51 | format.xml { render :xml => @post.errors, :status => :unprocessable_entity } 52 | end 53 | end 54 | end 55 | 56 | # PUT /posts/1 57 | # PUT /posts/1.xml 58 | def update 59 | @post = Post.find(params[:id]) 60 | 61 | respond_to do |format| 62 | if @post.update_attributes(params[:post]) 63 | format.html { redirect_to(@post, :notice => 'Post was successfully updated.') } 64 | format.xml { head :ok } 65 | else 66 | format.html { render :action => "edit" } 67 | format.xml { render :xml => @post.errors, :status => :unprocessable_entity } 68 | end 69 | end 70 | end 71 | 72 | # DELETE /posts/1 73 | # DELETE /posts/1.xml 74 | def destroy 75 | @post = Post.find(params[:id]) 76 | @post.destroy 77 | 78 | respond_to do |format| 79 | format.html { redirect_to(posts_url) } 80 | format.xml { head :ok } 81 | end 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ja.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang("specialchar","ja",{euro:"ユーロ記号",lsquo:"左シングル引用符",rsquo:"右シングル引用符",ldquo:"左ダブル引用符",rdquo:"右ダブル引用符",ndash:"半角ダッシュ",mdash:"全角ダッシュ",iexcl:"逆さ感嘆符",cent:"セント記号",pound:"ポンド記号",curren:"通貨記号",yen:"円記号",brvbar:"上下に分かれた縦棒",sect:"節記号",uml:"分音記号(ウムラウト)",copy:"著作権表示記号",ordf:"女性序数標識",laquo:" 始め二重山括弧引用記号",not:"論理否定記号",reg:"登録商標記号",macr:"長音符",deg:"度記号",sup2:"上つき2, 2乗",sup3:"上つき3, 3乗",acute:"揚音符",micro:"ミクロン記号",para:"段落記号",middot:"中黒",cedil:"セディラ",sup1:"上つき1",ordm:"男性序数標識",raquo:"終わり二重山括弧引用記号", 6 | frac14:"四分の一",frac12:"二分の一",frac34:"四分の三",iquest:"逆疑問符",Agrave:"抑音符つき大文字A",Aacute:"揚音符つき大文字A",Acirc:"曲折アクセントつき大文字A",Atilde:"チルダつき大文字A",Auml:"分音記号つき大文字A",Aring:"リングつき大文字A",AElig:"AとEの合字",Ccedil:"セディラつき大文字C",Egrave:"抑音符つき大文字E",Eacute:"揚音符つき大文字E",Ecirc:"曲折アクセントつき大文字E",Euml:"分音記号つき大文字E",Igrave:"抑音符つき大文字I",Iacute:"揚音符つき大文字I",Icirc:"曲折アクセントつき大文字I",Iuml:"分音記号つき大文字I",ETH:"[アイスランド語]大文字ETH",Ntilde:"チルダつき大文字N",Ograve:"抑音符つき大文字O",Oacute:"揚音符つき大文字O",Ocirc:"曲折アクセントつき大文字O",Otilde:"チルダつき大文字O",Ouml:" 分音記号つき大文字O", 7 | times:"乗算記号",Oslash:"打ち消し線つき大文字O",Ugrave:"抑音符つき大文字U",Uacute:"揚音符つき大文字U",Ucirc:"曲折アクセントつき大文字U",Uuml:"分音記号つき大文字U",Yacute:"揚音符つき大文字Y",THORN:"[アイスランド語]大文字THORN",szlig:"ドイツ語エスツェット",agrave:"抑音符つき小文字a",aacute:"揚音符つき小文字a",acirc:"曲折アクセントつき小文字a",atilde:"チルダつき小文字a",auml:"分音記号つき小文字a",aring:"リングつき小文字a",aelig:"aとeの合字",ccedil:"セディラつき小文字c",egrave:"抑音符つき小文字e",eacute:"揚音符つき小文字e",ecirc:"曲折アクセントつき小文字e",euml:"分音記号つき小文字e",igrave:"抑音符つき小文字i",iacute:"揚音符つき小文字i",icirc:"曲折アクセントつき小文字i",iuml:"分音記号つき小文字i",eth:"アイスランド語小文字eth", 8 | ntilde:"チルダつき小文字n",ograve:"抑音符つき小文字o",oacute:"揚音符つき小文字o",ocirc:"曲折アクセントつき小文字o",otilde:"チルダつき小文字o",ouml:"分音記号つき小文字o",divide:"除算記号",oslash:"打ち消し線つき小文字o",ugrave:"抑音符つき小文字u",uacute:"揚音符つき小文字u",ucirc:"曲折アクセントつき小文字u",uuml:"分音記号つき小文字u",yacute:"揚音符つき小文字y",thorn:"アイスランド語小文字thorn",yuml:"分音記号つき小文字y",OElig:"OとEの合字",oelig:"oとeの合字",372:"曲折アクセントつき大文字W",374:"曲折アクセントつき大文字Y",373:"曲折アクセントつき小文字w",375:"曲折アクセントつき小文字y",sbquo:"シングル下引用符",8219:"左右逆の左引用符",bdquo:"ダブル下引用符",hellip:"三点リーダ",trade:"商標記号",9658:"右黒三角ポインタ",bull:"黒丸", 9 | rarr:"右矢印",rArr:"右二重矢印",hArr:"左右二重矢印",diams:"ダイヤ",asymp:"漸近"}); -------------------------------------------------------------------------------- /lib/ckeditor/http.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | require 'digest/sha1' 3 | require 'mime/types' 4 | 5 | module Ckeditor 6 | module Http 7 | # Create tempfile from hash 8 | class UploadedFile 9 | attr_accessor :original_filename, :content_type, :tempfile, :headers 10 | 11 | def initialize(hash) 12 | @original_filename = hash[:filename] 13 | @content_type = hash[:type] 14 | @headers = hash[:head] 15 | @tempfile = hash[:tempfile] 16 | raise(ArgumentError, ':tempfile is required') unless @tempfile 17 | end 18 | 19 | def open 20 | @tempfile.open 21 | end 22 | 23 | def path 24 | @tempfile.path 25 | end 26 | 27 | def read(*args) 28 | @tempfile.read(*args) 29 | end 30 | 31 | def rewind 32 | @tempfile.rewind 33 | end 34 | 35 | def size 36 | @tempfile.size 37 | end 38 | end 39 | 40 | # Usage (paperclip example) 41 | # @asset.data = QqFile.new(params[:qqfile], request) 42 | class QqFile < ::Tempfile 43 | 44 | def initialize(filename, request, tmpdir = Dir::tmpdir) 45 | @original_filename = filename 46 | @request = request 47 | 48 | super Digest::SHA1.hexdigest(filename), tmpdir 49 | binmode 50 | fetch 51 | end 52 | 53 | def fetch 54 | self.write(body) 55 | self.rewind 56 | self 57 | end 58 | 59 | def original_filename 60 | @original_filename 61 | end 62 | 63 | def content_type 64 | types = MIME::Types.type_for(original_filename) 65 | types.empty? ? @request.content_type : types.first.to_s 66 | end 67 | 68 | def body 69 | if @request.raw_post.respond_to?(:force_encoding) 70 | @request.raw_post.force_encoding("UTF-8") 71 | else 72 | @request.raw_post 73 | end 74 | end 75 | end 76 | 77 | # Convert nested Hash to HashWithIndifferentAccess and replace 78 | # file upload hash with UploadedFile objects 79 | def self.normalize_param(*args) 80 | value = args.first 81 | if Hash === value && value.has_key?(:tempfile) 82 | UploadedFile.new(value) 83 | elsif value.is_a?(String) 84 | QqFile.new(*args) 85 | else 86 | value 87 | end 88 | end 89 | end 90 | end 91 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang("specialchar","zh-cn",{euro:"欧元符号",lsquo:"左单引号",rsquo:"右单引号",ldquo:"左双引号",rdquo:"右双引号",ndash:"短划线",mdash:"长划线",iexcl:"竖翻叹号",cent:"分币符号",pound:"英镑符号",curren:"货币符号",yen:"日元符号",brvbar:"间断条",sect:"节标记",uml:"分音符",copy:"版权所有标记",ordf:"阴性顺序指示符",laquo:"左指双尖引号",not:"非标记",reg:"注册标记",macr:"长音符",deg:"度标记",sup2:"上标二",sup3:"上标三",acute:"锐音符",micro:"微符",para:"段落标记",middot:"中间点",cedil:"下加符",sup1:"上标一",ordm:"阳性顺序指示符",raquo:"右指双尖引号",frac14:"普通分数四分之一",frac12:"普通分数二分之一",frac34:"普通分数四分之三",iquest:"竖翻问号", 6 | Agrave:"带抑音符的拉丁文大写字母 A",Aacute:"带锐音符的拉丁文大写字母 A",Acirc:"带扬抑符的拉丁文大写字母 A",Atilde:"带颚化符的拉丁文大写字母 A",Auml:"带分音符的拉丁文大写字母 A",Aring:"带上圆圈的拉丁文大写字母 A",AElig:"拉丁文大写字母 Ae",Ccedil:"带下加符的拉丁文大写字母 C",Egrave:"带抑音符的拉丁文大写字母 E",Eacute:"带锐音符的拉丁文大写字母 E",Ecirc:"带扬抑符的拉丁文大写字母 E",Euml:"带分音符的拉丁文大写字母 E",Igrave:"带抑音符的拉丁文大写字母 I",Iacute:"带锐音符的拉丁文大写字母 I",Icirc:"带扬抑符的拉丁文大写字母 I",Iuml:"带分音符的拉丁文大写字母 I",ETH:"拉丁文大写字母 Eth",Ntilde:"带颚化符的拉丁文大写字母 N",Ograve:"带抑音符的拉丁文大写字母 O",Oacute:"带锐音符的拉丁文大写字母 O",Ocirc:"带扬抑符的拉丁文大写字母 O",Otilde:"带颚化符的拉丁文大写字母 O", 7 | Ouml:"带分音符的拉丁文大写字母 O",times:"乘号",Oslash:"带粗线的拉丁文大写字母 O",Ugrave:"带抑音符的拉丁文大写字母 U",Uacute:"带锐音符的拉丁文大写字母 U",Ucirc:"带扬抑符的拉丁文大写字母 U",Uuml:"带分音符的拉丁文大写字母 U",Yacute:"带抑音符的拉丁文大写字母 Y",THORN:"拉丁文大写字母 Thorn",szlig:"拉丁文小写字母清音 S",agrave:"带抑音符的拉丁文小写字母 A",aacute:"带锐音符的拉丁文小写字母 A",acirc:"带扬抑符的拉丁文小写字母 A",atilde:"带颚化符的拉丁文小写字母 A",auml:"带分音符的拉丁文小写字母 A",aring:"带上圆圈的拉丁文小写字母 A",aelig:"拉丁文小写字母 Ae",ccedil:"带下加符的拉丁文小写字母 C",egrave:"带抑音符的拉丁文小写字母 E",eacute:"带锐音符的拉丁文小写字母 E",ecirc:"带扬抑符的拉丁文小写字母 E",euml:"带分音符的拉丁文小写字母 E",igrave:"带抑音符的拉丁文小写字母 I", 8 | iacute:"带锐音符的拉丁文小写字母 I",icirc:"带扬抑符的拉丁文小写字母 I",iuml:"带分音符的拉丁文小写字母 I",eth:"拉丁文小写字母 Eth",ntilde:"带颚化符的拉丁文小写字母 N",ograve:"带抑音符的拉丁文小写字母 O",oacute:"带锐音符的拉丁文小写字母 O",ocirc:"带扬抑符的拉丁文小写字母 O",otilde:"带颚化符的拉丁文小写字母 O",ouml:"带分音符的拉丁文小写字母 O",divide:"除号",oslash:"带粗线的拉丁文小写字母 O",ugrave:"带抑音符的拉丁文小写字母 U",uacute:"带锐音符的拉丁文小写字母 U",ucirc:"带扬抑符的拉丁文小写字母 U",uuml:"带分音符的拉丁文小写字母 U",yacute:"带抑音符的拉丁文小写字母 Y",thorn:"拉丁文小写字母 Thorn",yuml:"带分音符的拉丁文小写字母 Y",OElig:"拉丁文大写连字 Oe",oelig:"拉丁文小写连字 Oe",372:"带扬抑符的拉丁文大写字母 W",374:"带扬抑符的拉丁文大写字母 Y", 9 | 373:"带扬抑符的拉丁文小写字母 W",375:"带扬抑符的拉丁文小写字母 Y",sbquo:"单下 9 形引号",8219:"单高横翻 9 形引号",bdquo:"双下 9 形引号",hellip:"水平省略号",trade:"商标标志",9658:"实心右指指针",bull:"加重号",rarr:"向右箭头",rArr:"向右双线箭头",hArr:"左右双线箭头",diams:"实心方块纸牌",asymp:"约等于"}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang("a11yhelp","zh-cn",{title:"辅助功能说明",contents:"帮助内容。要关闭此对话框请按 ESC 键。",legend:[{name:"常规",items:[{name:"编辑器工具栏",legend:"按 ${toolbarFocus} 导航到工具栏,使用 TAB 键和 SHIFT+TAB 组合键移动到上一个和下一个工具栏组。使用左右箭头键移动到上一个和下一个工具栏按钮。按空格键或回车键以选中工具栏按钮。"},{name:"编辑器对话框",legend:"在对话框内,TAB 键移动到下一个字段,SHIFT + TAB 组合键移动到上一个字段,ENTER 键提交对话框,ESC 键取消对话框。对于有多选项卡的对话框,用ALT + F10来移到选项卡列表。然后用 TAB 键或者向右箭头来移动到下一个选项卡;SHIFT + TAB 组合键或者向左箭头移动到上一个选项卡。用 SPACE 键或者 ENTER 键选择选项卡。"},{name:"编辑器上下文菜单",legend:"用 ${contextMenu} 或者“应用程序键”打开上下文菜单。然后用 TAB 键或者下箭头键来移动到下一个菜单项;SHIFT + TAB 组合键或者上箭头键移动到上一个菜单项。用 SPACE 键或者 ENTER 键选择菜单项。用 SPACE 键,ENTER 键或者右箭头键打开子菜单。返回菜单用 ESC 键或者左箭头键。用 ESC 键关闭上下文菜单。"}, 6 | {name:"编辑器列表框",legend:"在列表框中,移到下一列表项用 TAB 键或者下箭头键。移到上一列表项用SHIFT + TAB 组合键或者上箭头键,用 SPACE 键或者 ENTER 键选择列表项。用 ESC 键收起列表框。"},{name:"编辑器元素路径栏",legend:"按 ${elementsPathFocus} 以导航到元素路径栏,使用 TAB 键或右箭头键选择下一个元素,使用 SHIFT+TAB 组合键或左箭头键选择上一个元素,按空格键或回车键以选定编辑器里的元素。"}]},{name:"命令",items:[{name:" 撤消命令",legend:"按 ${undo}"},{name:" 重做命令",legend:"按 ${redo}"},{name:" 加粗命令",legend:"按 ${bold}"},{name:" 倾斜命令",legend:"按 ${italic}"},{name:" 下划线命令",legend:"按 ${underline}"},{name:" 链接命令",legend:"按 ${link}"},{name:" 工具栏折叠命令",legend:"按 ${toolbarCollapse}"}, 7 | {name:"访问前一个焦点区域的命令",legend:"按 ${accessPreviousSpace} 访问^符号前最近的不可访问的焦点区域,例如:两个相邻的 HR 元素。重复此组合按键可以到达远处的焦点区域。"},{name:"访问下一个焦点区域命令",legend:"按 ${accessNextSpace} 以访问^符号后最近的不可访问的焦点区域。例如:两个相邻的 HR 元素。重复此组合按键可以到达远处的焦点区域。"},{name:"辅助功能帮助",legend:"按 ${a11yHelp}"}]}],backspace:"退格键",tab:"Tab 键",enter:"回车键",shift:"Shift 键",ctrl:"Ctrl 键",alt:"Alt 键",pause:"暂停键",capslock:"大写锁定键",escape:"Esc 键",pageUp:"上翻页键",pageDown:"下翻页键",end:"行尾键",home:"行首键",leftArrow:"向左箭头键",upArrow:"向上箭头键",rightArrow:"向右箭头键",downArrow:"向下箭头键", 8 | insert:"插入键","delete":"删除键",leftWindowKey:"左 WIN 键",rightWindowKey:"右 WIN 键",selectKey:"选择键",numpad0:"小键盘 0 键",numpad1:"小键盘 1 键",numpad2:"小键盘 2 键",numpad3:"小键盘 3 键",numpad4:"小键盘 4 键",numpad5:"小键盘 5 键",numpad6:"小键盘 6 键",numpad7:"小键盘 7 键",numpad8:"小键盘 8 键",numpad9:"小键盘 9 键",multiply:"星号键",add:"加号键",subtract:"减号键",decimalPoint:"小数点键",divide:"除号键",f1:"F1 键",f2:"F2 键",f3:"F3 键",f4:"F4 键",f5:"F5 键",f6:"F6 键",f7:"F7 键",f8:"F8 键",f9:"F9 键",f10:"F10 键",f11:"F11 键",f12:"F12 键",numLock:"数字锁定键",scrollLock:"滚动锁定键", 9 | semiColon:"分号键",equalSign:"等号键",comma:"逗号键",dash:"短划线键",period:"句号键",forwardSlash:"斜杠键",graveAccent:"重音符键",openBracket:"左中括号键",backSlash:"反斜杠键",closeBracket:"右中括号键",singleQuote:"单引号键"}); -------------------------------------------------------------------------------- /test/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb 3 | 4 | # Code is not reloaded between requests 5 | config.cache_classes = true 6 | 7 | # Full error reports are disabled and caching is turned on 8 | config.consider_all_requests_local = false 9 | config.action_controller.perform_caching = true 10 | 11 | # Disable Rails's static asset server (Apache or nginx will already do this) 12 | config.serve_static_assets = false 13 | 14 | # Compress JavaScripts and CSS 15 | config.assets.compress = true 16 | 17 | # Don't fallback to assets pipeline if a precompiled asset is missed 18 | config.assets.compile = false 19 | 20 | # Generate digests for assets URLs 21 | config.assets.digest = true 22 | 23 | # Defaults to Rails.root.join("public/assets") 24 | # config.assets.manifest = YOUR_PATH 25 | 26 | # Specifies the header that your server uses for sending files 27 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 28 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 29 | 30 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 31 | # config.force_ssl = true 32 | 33 | # See everything in the log (default is :info) 34 | # config.log_level = :debug 35 | 36 | # Prepend all log lines with the following tags 37 | # config.log_tags = [ :subdomain, :uuid ] 38 | 39 | # Use a different logger for distributed setups 40 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 41 | 42 | # Use a different cache store in production 43 | # config.cache_store = :mem_cache_store 44 | 45 | # Enable serving of images, stylesheets, and JavaScripts from an asset server 46 | # config.action_controller.asset_host = "http://assets.example.com" 47 | 48 | # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) 49 | # config.assets.precompile += %w( search.js ) 50 | 51 | # Disable delivery errors, bad email addresses will be ignored 52 | # config.action_mailer.raise_delivery_errors = false 53 | 54 | # Enable threaded mode 55 | # config.threadsafe! 56 | 57 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 58 | # the I18n.default_locale when a translation can not be found) 59 | config.i18n.fallbacks = true 60 | 61 | # Send deprecation notices to registered listeners 62 | config.active_support.deprecation = :notify 63 | 64 | # Log the query plan for queries taking more than this (works 65 | # with SQLite, MySQL, and PostgreSQL) 66 | # config.active_record.auto_explain_threshold_in_seconds = 0.5 67 | end 68 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/skins/moono/readme.md: -------------------------------------------------------------------------------- 1 | "Moono" Skin 2 | ==================== 3 | 4 | This skin has been chosen for the **default skin** of CKEditor 4.x, elected from the CKEditor 5 | [skin contest](http://ckeditor.com/blog/new_ckeditor_4_skin) and further shaped by 6 | the CKEditor team. "Moono" is maintained by the core developers. 7 | 8 | For more information about skins, please check the [CKEditor Skin SDK](http://docs.cksource.com/CKEditor_4.x/Skin_SDK) 9 | documentation. 10 | 11 | Features 12 | ------------------- 13 | "Moono" is a monochromatic skin, which offers a modern look coupled with gradients and transparency. 14 | It comes with the following features: 15 | 16 | - Chameleon feature with brightness, 17 | - high-contrast compatibility, 18 | - graphics source provided in SVG. 19 | 20 | Directory Structure 21 | ------------------- 22 | 23 | CSS parts: 24 | - **editor.css**: the main CSS file. It's simply loading several other files, for easier maintenance, 25 | - **mainui.css**: the file contains styles of entire editor outline structures, 26 | - **toolbar.css**: the file contains styles of the editor toolbar space (top), 27 | - **richcombo.css**: the file contains styles of the rich combo ui elements on toolbar, 28 | - **panel.css**: the file contains styles of the rich combo drop-down, it's not loaded 29 | until the first panel open up, 30 | - **elementspath.css**: the file contains styles of the editor elements path bar (bottom), 31 | - **menu.css**: the file contains styles of all editor menus including context menu and button drop-down, 32 | it's not loaded until the first menu open up, 33 | - **dialog.css**: the CSS files for the dialog UI, it's not loaded until the first dialog open, 34 | - **reset.css**: the file defines the basis of style resets among all editor UI spaces, 35 | - **preset.css**: the file defines the default styles of some UI elements reflecting the skin preference, 36 | - **editor_XYZ.css** and **dialog_XYZ.css**: browser specific CSS hacks. 37 | 38 | Other parts: 39 | - **skin.js**: the only JavaScript part of the skin that registers the skin, its browser specific files and its icons and defines the Chameleon feature, 40 | - **icons/**: contains all skin defined icons, 41 | - **images/**: contains a fill general used images, 42 | - **dev/**: contains SVG source of the skin icons. 43 | 44 | License 45 | ------- 46 | 47 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 48 | 49 | Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html). 50 | 51 | See LICENSE.md for more information. 52 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/contents.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | 6 | body 7 | { 8 | /* Font */ 9 | font-family: sans-serif, Arial, Verdana, "Trebuchet MS"; 10 | font-size: 12px; 11 | 12 | /* Text color */ 13 | color: #333; 14 | 15 | /* Remove the background color to make it transparent */ 16 | background-color: #fff; 17 | 18 | margin: 20px; 19 | } 20 | 21 | .cke_editable 22 | { 23 | font-size: 13px; 24 | line-height: 1.6; 25 | } 26 | 27 | blockquote 28 | { 29 | font-style: italic; 30 | font-family: Georgia, Times, "Times New Roman", serif; 31 | padding: 2px 0; 32 | border-style: solid; 33 | border-color: #ccc; 34 | border-width: 0; 35 | } 36 | 37 | .cke_contents_ltr blockquote 38 | { 39 | padding-left: 20px; 40 | padding-right: 8px; 41 | border-left-width: 5px; 42 | } 43 | 44 | .cke_contents_rtl blockquote 45 | { 46 | padding-left: 8px; 47 | padding-right: 20px; 48 | border-right-width: 5px; 49 | } 50 | 51 | a 52 | { 53 | color: #0782C1; 54 | } 55 | 56 | ol,ul,dl 57 | { 58 | /* IE7: reset rtl list margin. (#7334) */ 59 | *margin-right: 0px; 60 | /* preserved spaces for list items with text direction other than the list. (#6249,#8049)*/ 61 | padding: 0 40px; 62 | } 63 | 64 | h1,h2,h3,h4,h5,h6 65 | { 66 | font-weight: normal; 67 | line-height: 1.2; 68 | } 69 | 70 | hr 71 | { 72 | border: 0px; 73 | border-top: 1px solid #ccc; 74 | } 75 | 76 | img.right 77 | { 78 | border: 1px solid #ccc; 79 | float: right; 80 | margin-left: 15px; 81 | padding: 5px; 82 | } 83 | 84 | img.left 85 | { 86 | border: 1px solid #ccc; 87 | float: left; 88 | margin-right: 15px; 89 | padding: 5px; 90 | } 91 | 92 | pre 93 | { 94 | white-space: pre-wrap; /* CSS 2.1 */ 95 | word-wrap: break-word; /* IE7 */ 96 | -moz-tab-size: 4; 97 | -o-tab-size: 4; 98 | -webkit-tab-size: 4; 99 | tab-size: 4; 100 | } 101 | 102 | .marker 103 | { 104 | background-color: Yellow; 105 | } 106 | 107 | span[lang] 108 | { 109 | font-style: italic; 110 | } 111 | 112 | figure 113 | { 114 | text-align: center; 115 | border: solid 1px #ccc; 116 | border-radius: 2px; 117 | background: rgba(0,0,0,0.05); 118 | padding: 10px; 119 | margin: 10px 20px; 120 | display: inline-block; 121 | } 122 | 123 | figure > figcaption 124 | { 125 | text-align: center; 126 | display: block; /* For IE8 */ 127 | } 128 | 129 | a > img { 130 | padding: 1px; 131 | margin: 1px; 132 | border: none; 133 | outline: 1px solid #0782C1; 134 | } 135 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.dialog.add("a11yHelp",function(j){var a=j.lang.a11yhelp,l=CKEDITOR.tools.getNextId(),e={8:a.backspace,9:a.tab,13:a.enter,16:a.shift,17:a.ctrl,18:a.alt,19:a.pause,20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:a.end,36:a.home,37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:a["delete"],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8, 6 | 105:a.numpad9,106:a.multiply,107:a.add,109:a.subtract,110:a.decimalPoint,111:a.divide,112:a.f1,113:a.f2,114:a.f3,115:a.f4,116:a.f5,117:a.f6,118:a.f7,119:a.f8,120:a.f9,121:a.f10,122:a.f11,123:a.f12,144:a.numLock,145:a.scrollLock,186:a.semiColon,187:a.equalSign,188:a.comma,189:a.dash,190:a.period,191:a.forwardSlash,192:a.graveAccent,219:a.openBracket,220:a.backSlash,221:a.closeBracket,222:a.singleQuote};e[CKEDITOR.ALT]=a.alt;e[CKEDITOR.SHIFT]=a.shift;e[CKEDITOR.CTRL]=a.ctrl;var f=[CKEDITOR.ALT,CKEDITOR.SHIFT, 7 | CKEDITOR.CTRL],m=/\$\{(.*?)\}/g,p=function(){var a=j.keystrokeHandler.keystrokes,g={},c;for(c in a)g[a[c]]=c;return function(a,c){var b;if(g[c]){b=g[c];for(var h,i,k=[],d=0;d=h&&(b-=i,k.push(e[i]));k.push(e[b]||String.fromCharCode(b));b=k.join("+")}else b=a;return b}}();return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:j.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()}, 8 | html:function(){for(var e='
%1
'+a.contents+" ",g=[],c=a.legend,j=c.length,f=0;f%1
%2
".replace("%1",n.name).replace("%2",o))}g.push("

%1

%2
".replace("%1",b.name).replace("%2",h.join("")))}return e.replace("%1", 9 | g.join(""))}()+''}]}], 10 | buttons:[CKEDITOR.dialog.cancelButton]}}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang("a11yhelp","zh",{title:"輔助工具指南",contents:"說明內容。若要關閉此對話框請按「ESC」。",legend:[{name:"一般",items:[{name:"編輯器工具列",legend:"請按「${toolbarFocus}」以瀏覽工具列。\r\n利用「TAB」或「SHIFT+TAB」以便移動到下一個或前一個工具列群組。\r\n利用「→」或「←」以便移動到下一個或前一個工具列按鈕。\r\n請按下「空白鍵」或「ENTER」鍵啟動工具列按鈕。"},{name:"編輯器對話方塊",legend:"在對話框中,請按 TAB 鍵以便移動到下個欄位,請按 SHIFT + TAB 以便移動到前個欄位;請按 ENTER 以提交對話框資料,或按下 ESC 取消對話框。\r\n若是有多個頁框的對話框,請按 ALT + F10 以移動到頁框列表,並以 TAB 或是 → 方向鍵移動到下個頁框。以 SHIFT + TAB 或是 ← 方向鍵移動到前個頁框。按下 空白鍵 或是 ENTER 以選取頁框。"},{name:"編輯器內容功能表", 6 | legend:"請按下「${contextMenu}」或是「應用程式鍵」以開啟內容選單。以「TAB」或是「↓」鍵移動到下一個選單選項。以「SHIFT + TAB」或是「↑」鍵移動到上一個選單選項。按下「空白鍵」或是「ENTER」鍵以選取選單選項。以「空白鍵」或「ENTER」或「→」開啟目前選項之子選單。以「ESC」或「←」回到父選單。以「ESC」鍵關閉內容選單」。"},{name:"編輯器清單方塊",legend:"在列表中,請利用 TAB 或 ↓ 方向鍵以移動到下一個項目;或利用 SHIFT + TAB 或 ↑ 方向鍵移動到前一個項目。請按下 空白鍵 或是 ENTER 以選取項目。請按 ESC 關閉列表。"},{name:"編輯器元件路徑工具列",legend:"請按「${elementsPathFocus}」以瀏覽元素路徑工具列。\r\n利用「TAB」或「→」以便移動到下一個元素按鈕。\r\n利用「SHIFT+TAB」或「←」以便移動到前一個元素按鈕。\r\n請按下「空白鍵」或「ENTER」鍵選擇編輯器中的元素。"}]},{name:"命令",items:[{name:"復原命令", 7 | legend:"請按下「${undo}」"},{name:"重複命令",legend:"請按下「 ${redo}」"},{name:"粗體命令",legend:"請按下「${bold}」"},{name:"斜體",legend:"請按下「${italic}」"},{name:"底線命令",legend:"請按下「${underline}」"},{name:"連結",legend:"請按下「${link}」"},{name:"隱藏工具列",legend:"請按下「${toolbarCollapse}」"},{name:"存取前一個焦點空間命令",legend:"請按下 ${accessPreviousSpace} 以存取最近但無法靠近之插字符號前的焦點空間。舉例:二個相鄰的 HR 元素。\r\n重複按鍵以存取較遠的焦點空間。"},{name:"存取下一個焦點空間命令",legend:"請按下 ${accessNextSpace} 以存取最近但無法靠近之插字符號後的焦點空間。舉例:二個相鄰的 HR 元素。\r\n重複按鍵以存取較遠的焦點空間。"},{name:"協助工具說明",legend:"請按下「${a11yHelp}」"}]}], 8 | backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4", 9 | numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Open Bracket", 10 | backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"}); -------------------------------------------------------------------------------- /lib/generators/ckeditor/install_generator.rb: -------------------------------------------------------------------------------- 1 | require 'rails/generators' 2 | require 'rails/generators/migration' 3 | 4 | module Ckeditor 5 | module Generators 6 | class InstallGenerator < Rails::Generators::Base 7 | include Rails::Generators::Migration 8 | 9 | desc "Generates migration for Asset (Picture, AttachmentFile) models" 10 | 11 | # ORM configuration 12 | class_option :orm, :type => :string, :default => "active_record", 13 | :desc => "Backend processor for upload support" 14 | 15 | class_option :backend, :type => :string, :default => 'paperclip', 16 | :desc => "paperclip (default), carrierwave, or dragonfly" 17 | 18 | def self.source_root 19 | @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates')) 20 | end 21 | 22 | def self.next_migration_number(dirname) 23 | Time.now.strftime("%Y%m%d%H%M%S") 24 | end 25 | 26 | # copy configuration 27 | def copy_initializer 28 | template "ckeditor.rb", "config/initializers/ckeditor.rb" 29 | 30 | if backend == "dragonfly" 31 | template File.join("base", "dragonfly", "initializer.rb"), "config/initializers/ckeditor_dragonfly.rb" 32 | end 33 | end 34 | 35 | def mount_engine 36 | route "mount Ckeditor::Engine => '/ckeditor'" 37 | end 38 | 39 | def create_models 40 | [:asset, :picture, :attachment_file].each do |filename| 41 | template "#{generator_dir}/ckeditor/#{filename}.rb", 42 | File.join('app/models', ckeditor_dir, "#{filename}.rb") 43 | end 44 | 45 | if backend == "carrierwave" 46 | template "#{uploaders_dir}/uploaders/ckeditor_attachment_file_uploader.rb", 47 | File.join("app/uploaders", "ckeditor_attachment_file_uploader.rb") 48 | 49 | template "#{uploaders_dir}/uploaders/ckeditor_picture_uploader.rb", 50 | File.join("app/uploaders", "ckeditor_picture_uploader.rb") 51 | end 52 | end 53 | 54 | def create_ckeditor_migration 55 | if ["active_record"].include?(orm) 56 | migration_template "#{generator_dir}/migration.rb", File.join('db/migrate', "create_ckeditor_assets.rb") 57 | end 58 | end 59 | 60 | protected 61 | 62 | def ckeditor_dir 63 | 'ckeditor' 64 | end 65 | 66 | def generator_dir 67 | @generator_dir ||= [orm, backend].join('/') 68 | end 69 | 70 | def uploaders_dir 71 | @uploaders_dir ||= ['base', 'carrierwave'].join('/') 72 | end 73 | 74 | def orm 75 | (options[:orm] || "active_record").to_s 76 | end 77 | 78 | def backend 79 | (options[:backend] || "paperclip").to_s 80 | end 81 | end 82 | end 83 | end 84 | -------------------------------------------------------------------------------- /test/ckeditor_test.rb: -------------------------------------------------------------------------------- 1 | require 'test_helper' 2 | 3 | class CkeditorTest < ActiveSupport::TestCase 4 | def teardown 5 | Ckeditor.picture_model = nil 6 | Ckeditor.attachment_file_model = nil 7 | end 8 | 9 | test "truth" do 10 | assert_kind_of Module, Ckeditor 11 | end 12 | 13 | test 'setup block yields self' do 14 | Ckeditor.setup do |config| 15 | assert_equal Ckeditor, config 16 | end 17 | end 18 | 19 | test 'default picture model' do 20 | assert_equal Ckeditor.picture_model, Ckeditor::Picture 21 | end 22 | 23 | test 'configuration specifying picture model' do 24 | Ckeditor.setup do |config| 25 | config.picture_model = CustomPicture 26 | end 27 | assert_equal Ckeditor.picture_model, CustomPicture 28 | end 29 | 30 | test 'configuration specifying picture model using block' do 31 | Ckeditor.setup do |config| 32 | config.picture_model { CustomPicture } 33 | end 34 | assert_equal Ckeditor.picture_model, CustomPicture 35 | end 36 | 37 | test 'picture model adapter' do 38 | assert_equal Ckeditor.picture_adapter, Ckeditor::Picture.to_adapter 39 | end 40 | 41 | test 'default attachment file model' do 42 | assert_equal Ckeditor.attachment_file_model, Ckeditor::AttachmentFile 43 | end 44 | 45 | test 'configuration specifying attachment file model' do 46 | Ckeditor.setup do |config| 47 | config.attachment_file_model = CustomAttachmentFile 48 | end 49 | assert_equal Ckeditor.attachment_file_model, CustomAttachmentFile 50 | end 51 | 52 | test 'configuration specifying attachment file model using block' do 53 | Ckeditor.setup do |config| 54 | config.attachment_file_model { CustomAttachmentFile } 55 | end 56 | assert_equal Ckeditor.attachment_file_model, CustomAttachmentFile 57 | end 58 | 59 | test 'attachment file model adapter' do 60 | assert_equal Ckeditor.attachment_file_adapter, 61 | Ckeditor::AttachmentFile.to_adapter 62 | end 63 | 64 | test 'languages ingnore list' do 65 | Ckeditor.assets = nil 66 | Ckeditor.assets_languages = ['en', 'uk'] 67 | 68 | assert_equal Ckeditor.assets.include?('ckeditor/lang/ru.js'), false 69 | assert_equal Ckeditor.assets.include?('ckeditor/lang/uk.js'), true 70 | assert_equal Ckeditor.assets.include?('ckeditor/plugins/a11yhelp/dialogs/lang/bg.js'), false 71 | assert_equal Ckeditor.assets.include?('ckeditor/plugins/a11yhelp/dialogs/lang/uk.js'), true 72 | end 73 | 74 | test 'plugins ingnore list' do 75 | Ckeditor.assets = nil 76 | Ckeditor.assets_plugins = ['image'] 77 | 78 | assert_equal Ckeditor.assets.include?('ckeditor/plugins/table/dialogs/table.js'), false 79 | assert_equal Ckeditor.assets.include?('ckeditor/plugins/image/dialogs/image.js'), true 80 | end 81 | 82 | class CustomPicture; end 83 | class CustomAttachmentFile; end 84 | end 85 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | CKEDITOR.plugins.setLang("a11yhelp","ja",{title:"ユーザー補助の説明",contents:"ヘルプ このダイアログを閉じるには ESCを押してください。",legend:[{name:"全般",items:[{name:"エディターツールバー",legend:"${toolbarFocus} を押すとツールバーのオン/オフ操作ができます。カーソルをツールバーのグループで移動させるにはTabかSHIFT+Tabを押します。グループ内でカーソルを移動させるには、右カーソルか左カーソルを押します。スペースキーやエンターを押すとボタンを有効/無効にすることができます。"},{name:"編集ダイアログ",legend:"ダイヤログ内では、ダイアログの次の選択肢に移動するにはTabを押します。前の選択肢に移動するには、SHIFT+Tabを押します。ダイアログを決定するには、ENTERを押します。ESCでダイアログをキャンセルできます。複数のタブがあるダイアログではタブリストを操作するにはALT+F10を押します。次のタブに移動するにはTabか右カーソル、前のタブに戻るにはSHIFT+Tabか左カーソルです。タブページを決定するにはスペースもしくは、ENTERキーを押してください。"}, 6 | {name:"エディターのメニュー",legend:"${contextMenu} キーかAPPLICATION KEYを押すとコンテキストメニューが開きます。Tabか下カーソルでメニューのオプション選択が下に移動します。戻るには、SHIFT+Tabか上カーソルです。スペースもしくはENTERキーでメニューオプションを決定できます。現在選んでいるオプションのサブメニューを開くには、スペース、もしくは右カーソルを押します。サブメニューから親メニューに戻るには、ESCか左カーソルを押してください。ESCでコンテキストメニュー自体をキャンセルできます。"},{name:"エディターリストボックス",legend:"リストボックス内で移動するには、Tabか下カーソルで次のアイテムへ移動します。SHIFT+Tabで前のアイテムに戻ります。リストのオプションを選択するには、スペースもしくは、ENTERを押してください。リストボックスを閉じるには、ESCを押してください。"},{name:"エディター要素パスバー",legend:"${elementsPathFocus} を押すとエレメントパスバーを操作出来ます。Tabか右カーソルで次のエレメントを選択できます。前のエレメントを選択するには、SHIFT+Tabか左カーソルです。スペースもしくは、ENTERでエディタ内の対象エレメントを選択出来ます。"}]}, 7 | {name:"コマンド",items:[{name:"元に戻す",legend:"${undo} をクリック"},{name:"やり直し",legend:"${redo} をクリック"},{name:"太字",legend:"${bold} をクリック"},{name:"斜体 ",legend:"${italic} をクリック"},{name:"下線",legend:"${underline} をクリック"},{name:"リンク",legend:"${link} をクリック"},{name:"ツールバーを縮める",legend:"${toolbarCollapse} をクリック"},{name:"前のカーソル移動のできないポイントへ",legend:"${accessPreviousSpace} を押すとカーソルより前にあるカーソルキーで入り込めないスペースへ移動できます。例えば、HRエレメントが2つ接している場合などです。離れた場所へは、複数回キーを押します。"},{name:"次のカーソル移動のできないポイントへ",legend:"${accessNextSpace} を押すとカーソルより後ろにあるカーソルキーで入り込めないスペースへ移動できます。例えば、HRエレメントが2つ接している場合などです。離れた場所へは、複数回キーを押します。"}, 8 | {name:"ユーザー補助ヘルプ",legend:"${a11yHelp} をクリック"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"左矢印",upArrow:"上矢印",rightArrow:"右矢印",downArrow:"下矢印",insert:"Insert","delete":"Delete",leftWindowKey:"左Windowキー",rightWindowKey:"右のWindowキー",selectKey:"Select",numpad0:"Num 0",numpad1:"Num 1",numpad2:"Num 2",numpad3:"Num 3",numpad4:"Num 4",numpad5:"Num 5", 9 | numpad6:"Num 6",numpad7:"Num 7",numpad8:"Num 8",numpad9:"Num 9",multiply:"掛ける",add:"足す",subtract:"引く",decimalPoint:"小数点",divide:"割る",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"セミコロン",equalSign:"イコール記号",comma:"カンマ",dash:"ダッシュ",period:"ピリオド",forwardSlash:"フォワードスラッシュ",graveAccent:"グレイヴアクセント",openBracket:"開きカッコ",backSlash:"バックスラッシュ",closeBracket:"閉じカッコ",singleQuote:"シングルクォート"}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | (function(){CKEDITOR.dialog.add("templates",function(c){function o(a,b){var k=CKEDITOR.dom.element.createFromHtml('
'),d='';a.image&&b&&(d+='');d+='");k.on("click",function(){p(a.html)});return k}function p(a){var b=CKEDITOR.dialog.getCurrent();b.getValueOf("selectTpl","chkInsertOpt")?(c.fire("saveSnapshot"),c.setData(a,function(){b.hide();var a=c.createRange();a.moveToElementEditStart(c.editable());a.select();setTimeout(function(){c.fire("saveSnapshot")},0)})):(c.insertHtml(a),b.hide())}function i(a){var b=a.data.getTarget(), 7 | c=g.equals(b);if(c||g.contains(b)){var d=a.data.getKeystroke(),f=g.getElementsByTag("a"),e;if(f){if(c)e=f.getItem(0);else switch(d){case 40:e=b.getNext();break;case 38:e=b.getPrevious();break;case 13:case 32:b.fire("click")}e&&(e.focus(),a.data.preventDefault())}}}var h=CKEDITOR.plugins.get("templates");CKEDITOR.document.appendStyleSheet(CKEDITOR.getUrl(h.path+"dialogs/templates.css"));var g,h="cke_tpl_list_label_"+CKEDITOR.tools.getNextNumber(),f=c.lang.templates,l=c.config;return{title:c.lang.templates.title, 8 | minWidth:CKEDITOR.env.ie?440:400,minHeight:340,contents:[{id:"selectTpl",label:f.title,elements:[{type:"vbox",padding:5,children:[{id:"selectTplText",type:"html",html:""+f.selectPromptMsg+""},{id:"templatesList",type:"html",focus:!0,html:'
'+f.options+""},{id:"chkInsertOpt",type:"checkbox",label:f.insertOption, 9 | "default":l.templates_replaceContent}]}]}],buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("selectTpl","templatesList");g=a.getElement();CKEDITOR.loadTemplates(l.templates_files,function(){var b=(l.templates||"default").split(",");if(b.length){var c=g;c.setHtml("");for(var d=0,h=b.length;d'+f.emptyListMsg+"")});this._.element.on("keydown",i)},onHide:function(){this._.element.removeListener("keydown",i)}}})})(); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | (function(){function d(c,d){var b;try{b=c.getSelection().getRanges()[0]}catch(f){return null}b.shrink(CKEDITOR.SHRINK_TEXT);return c.elementPath(b.getCommonAncestor()).contains(d,1)}function e(c,e){var b=c.lang.liststyle;if("bulletedListStyle"==e)return{title:b.bulletedTitle,minWidth:300,minHeight:50,contents:[{id:"info",accessKey:"I",elements:[{type:"select",label:b.type,id:"type",align:"center",style:"width:150px",items:[[b.notset,""],[b.circle,"circle"],[b.disc,"disc"],[b.square,"square"]],setup:function(a){this.setValue(a.getStyle("list-style-type")|| 6 | h[a.getAttribute("type")]||a.getAttribute("type")||"")},commit:function(a){var b=this.getValue();b?a.setStyle("list-style-type",b):a.removeStyle("list-style-type")}}]}],onShow:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.setupContent(a)},onOk:function(){var a=this.getParentEditor();(a=d(a,"ul"))&&this.commitContent(a)}};if("numberedListStyle"==e){var g=[[b.notset,""],[b.lowerRoman,"lower-roman"],[b.upperRoman,"upper-roman"],[b.lowerAlpha,"lower-alpha"],[b.upperAlpha,"upper-alpha"], 7 | [b.decimal,"decimal"]];(!CKEDITOR.env.ie||7',b.document),c.copyAttributes(d,{type:1}),d.replace(c),a.element=d)}else c.setAttribute("type",this.getValue())}}]}]}}); -------------------------------------------------------------------------------- /vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved. 3 | For licensing, see LICENSE.md or http://ckeditor.com/license 4 | */ 5 | (function(){function c(b){var c=this instanceof CKEDITOR.ui.dialog.checkbox;b.hasAttribute(this.id)&&(b=b.getAttribute(this.id),c?this.setValue(e[this.id]["true"]==b.toLowerCase()):this.setValue(b))}function d(b){var c=""===this.getValue(),a=this instanceof CKEDITOR.ui.dialog.checkbox,d=this.getValue();c?b.removeAttribute(this.att||this.id):a?b.setAttribute(this.id,e[this.id][d]):b.setAttribute(this.att||this.id,d)}var e={scrolling:{"true":"yes","false":"no"},frameborder:{"true":"1","false":"0"}}; 6 | CKEDITOR.dialog.add("iframe",function(b){var f=b.lang.iframe,a=b.lang.common,e=b.plugins.dialogadvtab;return{title:f.title,minWidth:350,minHeight:260,onShow:function(){this.fakeImage=this.iframeNode=null;var a=this.getSelectedElement();a&&(a.data("cke-real-element-type")&&"iframe"==a.data("cke-real-element-type"))&&(this.fakeImage=a,this.iframeNode=a=b.restoreRealElement(a),this.setupContent(a))},onOk:function(){var a;a=this.fakeImage?this.iframeNode:new CKEDITOR.dom.element("iframe");var c={},d= 7 | {};this.commitContent(a,c,d);a=b.createFakeElement(a,"cke_iframe","iframe",!0);a.setAttributes(d);a.setStyles(c);this.fakeImage?(a.replace(this.fakeImage),b.getSelection().selectElement(a)):b.insertElement(a)},contents:[{id:"info",label:a.generalTab,accessKey:"I",elements:[{type:"vbox",padding:0,children:[{id:"src",type:"text",label:a.url,required:!0,validate:CKEDITOR.dialog.validate.notEmpty(f.noUrl),setup:c,commit:d}]},{type:"hbox",children:[{id:"width",type:"text",requiredContent:"iframe[width]", 8 | style:"width:100%",labelLayout:"vertical",label:a.width,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.width)),setup:c,commit:d},{id:"height",type:"text",requiredContent:"iframe[height]",style:"width:100%",labelLayout:"vertical",label:a.height,validate:CKEDITOR.dialog.validate.htmlLength(a.invalidHtmlLength.replace("%1",a.height)),setup:c,commit:d},{id:"align",type:"select",requiredContent:"iframe[align]","default":"",items:[[a.notSet,""],[a.alignLeft,"left"],[a.alignRight, 9 | "right"],[a.alignTop,"top"],[a.alignMiddle,"middle"],[a.alignBottom,"bottom"]],style:"width:100%",labelLayout:"vertical",label:a.align,setup:function(a,b){c.apply(this,arguments);if(b){var d=b.getAttribute("align");this.setValue(d&&d.toLowerCase()||"")}},commit:function(a,b,c){d.apply(this,arguments);this.getValue()&&(c.align=this.getValue())}}]},{type:"hbox",widths:["50%","50%"],children:[{id:"scrolling",type:"checkbox",requiredContent:"iframe[scrolling]",label:f.scrolling,setup:c,commit:d},{id:"frameborder", 10 | type:"checkbox",requiredContent:"iframe[frameborder]",label:f.border,setup:c,commit:d}]},{type:"hbox",widths:["50%","50%"],children:[{id:"name",type:"text",requiredContent:"iframe[name]",label:a.name,setup:c,commit:d},{id:"title",type:"text",requiredContent:"iframe[title]",label:a.advisoryTitle,setup:c,commit:d}]},{id:"longdesc",type:"text",requiredContent:"iframe[longdesc]",label:a.longDescr,setup:c,commit:d}]},e&&e.createAdvancedTab(b,{id:1,classes:1,styles:1},"iframe")]}})})(); --------------------------------------------------------------------------------