Giter VIP home page Giter VIP logo

ckeditor-rails's People

Contributors

afair avatar bricker avatar c0decracker avatar camilalm avatar davidenglishmusic avatar dcabo avatar drewda avatar eric1234 avatar joeadcock avatar jorgemanrubia avatar mgrunberg avatar miks avatar nitrodist avatar randoum avatar ryel avatar tbr00 avatar tsechingho avatar zoer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ckeditor-rails's Issues

Nothing in /vendor/assets after installing gem

I installed this using bundler and it says that v 0.0.5 is installed but when I add "//= require ckeditor-jquery" to the application.js I get this error:

couldn't find file 'ckeditor-jquery'

Install fail

After bundle install

ruby@debian:~/projects/bulkin$ rake update-ckeditor VERSION=4.0
rake aborted!
Don't know how to build task 'update-ckeditor'
/home/ruby/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in eval' /home/ruby/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in

'
(See full trace by running task with --trace)

"NetworkError: 404 Not Found - http:/bulkin.ru:3000/assets/ckeditor/init.js"

Can't get some toolbar buttons to show with Rails 4.2.2

I am customizing my toolbar like the following (my actual Rails version is 4.2.2, I tried this code in 4.2.0 and there is no problem)

config.toolbar = [
    [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
    [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ],
    ['Font', 'FontSize','superlink'],
    ['TextColor', 'BGColor'],
    '/',
    [ 'Bold', 'Italic', 'Underline', 'Strike' ],
    [ 'Undo', 'Redo' ],
    ['Link', 'Unlink']
];    

But some buttons are missing like 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'NumberedList', 'BulletedList' ...

PS: Also without customizing the toolbar, those buttons don't show up !!
Is this a bug ?

Thanks!

Sorry for disturbing again

I am pretty new to rails.now the ckeditor window has came.but i cant find image upload button when click the image button on tool box. plz help me

Advance thanks ...

Images Not Precompiled on Heroku

I'm deploying to Heroku, and for some reason, the icons are not showing up in the editor. I tried adding Ckeditor.assets to my list of precompiled assets, but it had no effect. I looked at the contents of that array, and I saw that it only contains the CSS and JS, not the images.

Any references to images result in a 404, and when I list the assets that are on the server, the images aren't there (neither with nor without a hash).

What's causing this? Is it a bug, or some configuration option that I'm missing?

cache problem of config.js

When first time deploy, the ckeditor-rails will create a digested config.js and no-digested config.js. The browser will cache the no-digested config.js while it hit by someone first time. If the content of config.js is changed again, the browser will still use the old no-digested config.js. This is a bug.

There are two ways to resolve this issue.

  • monkey patching the value of customConfig in ckeditor.js while compiling the ckeditor.js by parsing the asset manifest file.
  • overwrite the CKEDITOR.config.customConfig by rails asset file path helper in a js.erb file. The only consideration is where to put this file.

Limiting languages to precompile can have unexpected side effects

My config is like

Ckeditor::Rails.configure do |config|
  # default is nil for all languages, or set as %w[en zh]
  config.assets_languages = %w(en nl fr)

  # default is nil for all plugins,
  # or set as white list: %w[image link liststyle table tabletools]
  # or set as black list: config.default_plugins - %w[about a11yhelp]
  config.assets_plugins = %w(image link liststyle table tabletools pastefromword clipboard)

  # default is nil for all skins, or set as %w[moono]
  #config.assets_skins = %w(simple)
end

When loading my site with a locale of en-GB (although the I18n.locale is set to nl) it crashes with the following

Failed to load resource: the server responded with a status of 404 (Not Found) (https://www.radarwerk.be/assets/ckeditor/lang/en-gb.js?t=F7J9)
application-8f9c169d5aa34a687e102e32d9f95e62ac04221196e4dba7ce4916508c71bec1.js:89 Uncaught TypeError: Cannot set property 'dir' of undefined (https://www.radarwerk.be/assets/application-8f9c169d5aa34a687e102e32d9f95e62ac04221196e4dba7ce4916508c71bec1.js:89)

When I don't compile the language the user is in, I want it to fallback properly (first to the language independant language, then to en (same in this case)).
In the first place I want to use the language of the site in all honesty (nl)

Doubt

to make ckeditor to work we want to download or not.if we download means where to put.i have an issue.thats y i asking this.because i downloaded ckeditor from ckeditor .com but i dont include in the application.when i running my application ckeditor can viewable but it does not showing any buttons to upload image. can u help me..i am struggling 1 day with this error.and also my background change to yellow.without doing any advanced usage which is said by you.
Advance thanks

Assets should not be minimized/compressed

It's the job of the asset pipeline to minimize / compress / etc the source.

Among other things, we want uncompressed sources in development, in case we need stepping in the code...

Rails 4 support

I can do it, I just want to figure out how it needs to be done. The main problem is that with the Rails 4 asset pipeline, compiled assets must be referenced by their digested filename - so no longer can we access the CKEditor javascript/css files directly (which it does a lot), unless you turn on config.assets.compile, which I don't think people will be willing to do just for this library.

I propose a new object inside of the CKEDITOR object, assetPaths, which would be a manifest mapping any file that ckeditor.js is referencing directly to the corresponding digested asset:

CKEDITOR.assetPaths = {
  "config.js": "<%= asset_path('ckeditor/config.js') %>"
  "dialogs/templates.js": "<%= asset_path('ckeditor/dialogs/templates.js') %>"
  # ... etc
}

And then gsub the ckeditor.js file to replace any instance of, say, config.js, with CKEDITOR.assetPaths['config.js'] when pulling a new version.

I'm not 100% sold on this solution but it's the best I can come up with on a whim. The biggest problem is the gsubbing and suddenly having to keep a list of all the file references in ckeditor.js - something which could possibly change frequently. Can anybody think of something better? Maybe we could turn ckeditor.js into ckeditor.js.erb, and wrap every file reference in asset_path?

ckeditor not displaying until page reload

Hi tsechingho,
I'm using rails 4, bootstrap and ckeditor_rails.

Using the following in my _form view:

<%= f.text_area :content, :class => 'ckeditor' %>

results in a regular bootstrap flavored text_area the first time I visit new or edit. However, if I reload the page, it works. The text_area becomes fully ckeditor enabled.

I have tried loading js file (//= require ckeditor-jquery) before and after bootstrap but this has no effect.

Any ideas?

assets:precompile takes a long time

"Since version 4.1.3, non-digested assets of ckeditor-rails will simply be copied after digested assets were compiled."

I read the closed issues about the asset-pipeline in rails4 and Eric's solution.
Is this the reason why the task takes about 5 minutes during every deploy?

Integrating Code Snippet Plugin

I am trying to add the CodeSnippet plugin to CKEditor (installed in my Rails app using ckeditor-rails).

To do this, I first added the CodeSnippet plugin folder and all of its dependencies to the directory app > assets > javascripts > ckeditor > plugins (so my plugins folder contains folders for codesnippet, dialog, dialogui, lineutils, and widget).

I then updated my app/assets/javascripts/ckeditor/config.js.coffee to include the following:

CKEDITOR.editorConfig = (config) ->
  config.startupShowBorders = true
  config.resize_enabled = false
  config.scayt_autoStartup = true

  config.language = 'en'
  config.width = '445px'
  config.extraPlugins = 'widget,dialog,dialogui,lineutils,codesnippet'

  config.toolbar_Default = [
    { name: 'basicstyles', items: [ 'Bold','Italic','Underline', '-', 'NumberedList','BulletedList', 'Link','Unlink', 'CodeSnippet','RemoveFormat' ] }
  ]
  config.toolbar = 'Default'
  true

When I try to load a webpage with the CKEditor, I get the following errors in my javascript console:

Uncaught TypeError: undefined is not a function

referring to this line of widgets/plugin.js:

CKEDITOR.style.addCustomHandler( {

and the same error

Uncaught TypeError: undefined is not a function

referring to this line of codesnippets/plugin.js:

editor.addContentsCss( path + 'lib/highlight/styles/' + editor.config.codeSnippet_theme + '.css' );

Anyone able to configure this CKEditor to use the CodeSnippet plugin using this gem?

Stackoverflow question posted here: http://stackoverflow.com/questions/28119912/adding-codesnippet-plugin-to-ckeditor-in-rails-app

Problems with gem turbolinks

Hi, got issue with loading fckeditor when included gem turbolinks in project. While in inline mode works fine.

Sorry for bad English.

Default config overwrites custom one

I created my app/assets/javascripts/config.js.coffee like this:

CKEDITOR.editorConfig = (config) ->
config.docType = ''

When I start up my server in development env and access the page, I noticed that the default ckeditor/config.js always executes AFTER my custom one, and my config gets ignored.

Here is my application.js:

//= require jquery
//= require jquery_ujs
//= require ckeditor-jquery
//= require ckeditor/config
//= require_tree .

Turbo Sprockets + Overrides + Heroku Don't Play Nice

Using the ckeditor/override per the instructions to get asset hashes breaks when we use turbo sprockets. The override.js.erb isn't happy with calls to asset_path. If I remove turbo sprockets, it works, but then we get two sweeps of asset:precompile which takes forever.

       rake aborted!
       /tmp/build_df42e508-d471-4b83-a109-1006bcee772b/vendor/bundle/ruby/2.1.0/bundler/gems/ckeditor-fd8e29ee5036/app/assets/javascripts/ckeditor/init.js.erb has already been required
       (in /tmp/build_df42e508-d471-4b83-a109-1006bcee772b/vendor/bundle/ruby/2.1.0/bundler/gems/ckeditor-fd8e29ee5036/app/assets/javascripts/ckeditor/override.js.erb)

Config version

Hello,

This gem is set to Full version of CKEditor. How do I use the "Standard" version as well as the "Basic" version.

config.js.coffee overridden by template config.js when placed in mounted engine

I wish to provide a default configuration inside my Rails engine that mounting apps can implicitly accept (by not writing any CKEDITOR js in their application). However with the absence of app/assets/javascripts/ckeditor/config.js in the mounting app, the following config.js file is served after the engine's config.js.coffee and effectively overwrites the method definition:

/**
 * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */


CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here. For example:
    // config.language = 'fr';
    // config.uiColor = '#AADC6E';
};

Here's a screencap of the network requests in the Inspector panel:

network-requests

CKEdtiror assets not compiling (Rails 3.2.22 with 4.4.8)

When I deploy a rails 3.2.22 app using the ckeditor-rails gem everything was ok and the assets were compiled. But this no longer works with the latest release (4.4.8).

Test using

RAILS_ENV=development bundle exec rake assets:precompile

Icon positions are not correct in production

All notes are due to a Rails 4 App.

Everything is fine in development mode, but in production the background-position of all item icons are seem to be "shifted" (see picture below).

image

Inspecting the buttons with firebug led me to the following css-class, e.g. for the "bold"-button:

.cke_button__bold_icon {
background: url(icons.png) no-repeat 0 -32px !important;
}

This seems to collide with some other class, since disabling the class .cke_button__bold_icon solves the problem and lets the button look nice.

Can anyone reproduce this?

Best wishes,
Robin

How to customize the path of the .js and .css files in ckeditor?

Hi tsechingho,

I am running into this issue and hope you can provide some insights.
I am deploying my rails app as a WAR file in JBoss and the application is deployed under a path, say, /sytong/app.

When I accessed the deployed app, I saw that the .js and .css file path are generated like this (I masked the hostname with '<HOSTNAME>'):

<script type="text/javascript" src="http://<HOSTNAME>/assets/ckeditor/config.js?t=D5AC" style=""></script>

However, to make it work, the path should look like this (note the path /sytong/app before /assets)

<script type="text/javascript" src="http://<HOSTNAME>/sytong/app/assets/ckeditor/config.js?t=D5AC" style=""></script>

I have defined my relative path in production.rb:

config.relative_url_root = "/sytong/app"

I have tried to add this by overriding basepath.js.erb as you have mentioned in the README but I don't think my basepath.js.erb was actually used.

Would you have any suggestion for me in this case?
Thanks.

contents.css.scss does not override defaults in production (but contents.css does)

When I copied the default contents.css from source (with one simple change to set font-weight:bold for h1-h5) and saved it as

app/assets/stylesheets/ckeditor/contents.css.scss

it worked locally as expected. This is how the README suggests doing it. However when I deployed to production, my modified file did not override the defaults.

When I renamed

app/assets/stylesheets/ckeditor/contents.css.scss

to

app/assets/stylesheets/ckeditor/contents.css

(removing the .scss extension) it worked all the way through.

Rails 3.2.0
ckeditor_rails 4.1.1
I am using scss for other styles in the application, and that works OK.
Production settings are:

config.serve_static_assets = false
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true

Don't know how to build task 'update_ckeditor'

   rake update_ckeditor VERSION=4.2
   rake aborted!
   Don't know how to build task 'update_ckeditor'

I am getting this error. I want to implement inline editor. Can you help me in the same.

Routing Error

Hellow,
Am using ckeditor-rails for my app, I successfuly added the gem, installed, configured, and awesomely working, but when i click on browse button, the routing error displays on the screen, here am attaching the screenshot for reference,
routing error

and this is my optional configured config.js file details:-

CKEDITOR.editorConfig = function( config ) {
    config.filebrowserBrowseUrl = "/ckeditor/attachment_files";
    config.filebrowserImageBrowseLinkUrl = "/ckeditor/pictures";
    config.filebrowserImageBrowseUrl = "/ckeditor/pictures";
    config.filebrowserImageUploadUrl = "/ckeditor/pictures";
    config.filebrowserUploadUrl = "/ckeditor/attachment_files";  
    config.toolbar_basic = [
        [ 'Save', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord',
        '-', 'Undo', 'Redo' ],
        [ 'Bold', 'Italic', 'Underline',
        '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
        ['Smiley', 'Preview', 'Find', 'Replace', 'Link', 'Unlink', '-', 'Image' ],
        ['Table', 'Font', 'FontSize', '-', 'TextColor', 'BGColor', '-','Maximize']
    ];
    config.uiColor = "#eff4ff"
    config.toolbar = config.toolbar_basic;
};

My environment details: Ubuntu 12.04, ruby 1.9.3, rails 3.2.13.

Rake routes log:

   ckeditor_rails_engine        /ckeditor
   Ckeditor::Rails::Engine
   Routes for Ckeditor::Rails::Engine:

Please help me! many Thanks.. :)

this gem don't work in production

I upload my app to heroku, and the editors didn't shown
I started my app in production locally and the editors didnd't show up too...in development, they work well

Adding plugins

How do one add custom plugins to the ckeditor with this gem?

Spell Checker doesn't work

// Gemfile
gem 'ckeditor', '>= 4.0.0.rc1'

// config.js
CKEDITOR.editorConfig = function( config ){
config.skin = 'moono',
config.disableNativeSpellChecker = true,
config.scayt_autoStartup = true,
config.toolbar = [
[ 'Bold', 'Italic', 'Underline', 'Strike', 'Blockquote', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'SpellChecker', 'Scayt' ]
]
};

I have been testing many possible solutions, I think that it is a problem with v4.0

https://www.outsystems.com/NetworkForums/ViewTopic.aspx?TopicId=7033&Topic=CKEditor---Spell-Check-As-You-Type-(-SCAYT-)

http://devnet.kentico.com/FAQs/Content-Management/Enable-the-Spell-Check-As-You-Type-feature-by-defa.aspx

In here http://drupal.org/node/1870398 user called "vinmassaro " posted that if you set "Spell Check as You Type" on toolbar it work because the two type of spellcheck was compress in one button, but dosent work :S

This gem ignores asset host

Hey,

This gem ignores any asset host set.

One possible fix would be to add

base_path << ActionController::Base.asset_host

to basepath.js.erb

Error with posting iframe using "source"

I notice on the CKEditor demo pages that iframes only get embedded using the "Full featured" version and not the "Standard editor."

http://ckeditor.com/demo#full

With my install of ckeditor using ckeditor-rails, it seems like iframes cannot be added via the "Source" button. Is there any way to enable the Full Featured version of the ckeditor so I can add iframes via "Source"?

This is my config.js.coffee file:

CKEDITOR.editorConfig = (config) ->
config.startupShowBorders = true
config.resize_enabled = false
config.scayt_autoStartup = true

config.language = 'en'
config.width = '500px'

config.toolbar_Default = [
{ name: 'basicstyles', items: [ 'Bold','Italic','Underline','RemoveFormat', '-',
'NumberedList','BulletedList', '-',
'Link','Unlink', '-', 'Source' ] }
]
config.toolbar = 'Default'
true

Error

hi tsechingho,
i have cleared that "var" error with your help..after that.I have another error on the same basepath.js.coffee

SyntaxError: unexpected COMPARE.here is my file (basepath.js.coffee

<%
base_path = ' '
if ENV['PROJECT'] =~ /editor/i
base_path << "/#{Rails.root.basename.to_s}/"
end
base_path << Rails.application.config.assets.prefix
base_path << '/ckeditor/'
%>
CKEDITOR_BASEPATH = '<%= base_path %>'

HTML Tags showing up in Ruby view

Hi, I have a question, when I submit some text with the ckeditor and then go to the view, the text shows up with the html tags in the view. How do I get it to not show the tags? Thanks!

Subscript/Superscript button not found

I can't seem to add the superscript and subscript buttons to the toolbar. I've tried downloading the stylescombo plugin and setting removeButtons to empty string. The documentation says I just need to add it to the list of basic styles and it should appear. Anyone else getting this issue?

Invalid CSS after "..._footer{filter:": expected expression (e.g. 1px, bold), was "}" on assets precompile

Hi,

I am using ckeditor_rails (4.2.2). It is working fine. But it is not precompiling

assets.On this command it gives me error.

            rake assets:precompile                  

           Invalid CSS after "..._footer{filter:": expected expression (e.g. 1px, bold), was "}"
          (in /home/kashif/.rvm/gems/ruby-1.9.3-p392@met/gems/rich-         

          1.4.1/vendor/assets/ckeditor/ckeditor/skins/moono/dialog_iequirks.css)
           (sass):6

How i can precompile assets for production?

Thanks

support for active_admin - css namespacing

I'm trying to use ckeditor-rails with active_admin, it "works" fine but looks terrible, all the css is overridden by active_admin's styles. I've fiddled all evening to work around it but cannot find a way. (I know its possible because the galetahub/ckeditor gem does, but for other reasons i'm not using that gem).

apparently active_admin normalizes
body.active_admin * {...}

when i use firebug to remove the active_admin class from the < body > tag, the ckeditor tools look right, but of course the rest of the admin page is unstyled. Any suggestions please? if you have ideas that might require changes to ckeditor-rails i'll do it and send a pull request. Thanks!

ckeditor-rails and active_admin

ckeditor not showing up when deployed to heroku

The gem works great on my local machine in dev. But when I push to heroku the editor doesn't show up on my text area.

Ive used this gem before with no problems. This time though I customized it by adding the ckeditor folder in the assets/javascripts like directed in the readme. Could this be causing the issue? Any known way to fix it?

SCRIPT14: Not enough storage is available to complete this operation

If you use IE and see this message:

SCRIPT14: Not enough storage is available to complete this operation

here is one suggestion:

how to implement it?

  1. please copy vendor/assets/javascripts/ckeditor/ckeditor.js from ckeditor_rails gem to app/assets/javascripts/ckeditor/ckeditor.js of your project.

  2. find

if(this.$.createStyleSheet)this.$.createStyleSheet` 

and replace with

if(false)this.$.createStyleSheet
  1. cleanup cache of your browser and restart your server to see if it works.

honestly say, I don't try it for IE. But that's how rails assets pipeline works.

the new release v4.1 also has this piece of code. the bug may not be resolved by CKEDITOR team.

also see

Installation Issue

Maybe I'm a complete idiot from lack of sleep, but am I supposed to copy what's in /vendor by hand? Following instructions in the readme, I get a "couldn't find file 'ckeditor-jquery'" error and sure enough, it doesn't exist anywhere I can tell. I looked for a generator that might install it. Maybe I need a nap.

The included basepath.js.erb Always Overrides Custom basepath.js.erb

It seems that even if I add a custom basepath as described here, the basepath.js file included with the gem is always precompiled afterwards, overriding its value.

I include the custom file like this:

//= require ckeditor/basepath
//= require ckeditor-jquery

But looking at the generated application.js, though I can see the CKEDITOR_BASEPATH I define, the default basepath is included subsequently, overriding it.

It seems that even if I add my own basepath.js.erb file to javascript/ckeditor, the default basepath.js.erb file included with the gem is included after it, overriding the CKEDITOR_BASEPATH variable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.