devlabnet / SlideShow

SlideShow Plugin for CKEditor
16 stars 18 forks source link

Adding the plugin to an existin CKEditor #1

Closed KeepSmilin closed 11 years ago

KeepSmilin commented 11 years ago

I am using a CKEditor 4.0 in opencart. The version I am using uses "codemirror'. I followed the instruction for install, I was abe to create a slideshow and to visualize it on a page but when returning in edit mode the 'slideshow' object disappeared from editor. I tried new builds from the CKEditor site to replace the one I had but none of them worked. I guess the problem is somehow tied to 'codemirror', config.js, and some allowed content feature, but I did not find the fix. Any idea?

cricri042 commented 11 years ago

Hi, Yep, it may be a problem with the "advanced Content Filter" , I agree that I didn't really understand how to deal with it !! What you can do is try to put the following line in the ckeditor config.js file (the file who is in the ckeditor directory, I don't know if it works when putting it in plugins config.je files) : "CKEDITOR.config.allowedContent = true;" This line just say to ckeditor to avoid any filtering, so, just add it and try again, if it works then, the problem is coming from the filtering process, if not, no luck !! (and I don't know what can be done) Hoping it's help, let me know about the results.

-Christian

KeepSmilin commented 11 years ago

Hi,

Thanks for your reply.

I already tried to add config.allowedContent = true; inside the function CKEDITOR.config ... along with the other statements that existed plus the ones you suggested for install. What happened is that when I tried to edit the page containing the slideshow the editor contained the images only without the slideshow object. Really don’t now what else to try. Any other idea?

Liviu

From: cricri042 Sent: Friday, August 23, 2013 4:51 AM To: cricri042/SlideShow Cc: KeepSmilin Subject: Re: [SlideShow] Adding the plugin to an existin CKEditor (#1)

Hi, Yep, it may be a problem with the "advanced Content Filter" , I agree that I didn't really understand how to deal with it !! What you can do is try to put the following line in the ckeditor config.js file (the file who is in the ckeditor directory, I don't know if it works when putting it in plugins config.je files) : "CKEDITOR.config.allowedContent = true;" This line just say to ckeditor to avoid any filtering, so, just add it and try again, if it works then, the problem is coming from the filtering process, if not, no luck !! (and I don't know what can be done) Hoping it's help, let me know about the results.

-Christian

— Reply to this email directly or view it on GitHub.

KeepSmilin commented 11 years ago

I am also suspecting that ‘codemirror’ is responsible for something in this. Did you ever try a build including ‘codemirror’?

Liviu

From: cricri042 Sent: Friday, August 23, 2013 4:51 AM To: cricri042/SlideShow Cc: KeepSmilin Subject: Re: [SlideShow] Adding the plugin to an existin CKEditor (#1)

Hi, Yep, it may be a problem with the "advanced Content Filter" , I agree that I didn't really understand how to deal with it !! What you can do is try to put the following line in the ckeditor config.js file (the file who is in the ckeditor directory, I don't know if it works when putting it in plugins config.je files) : "CKEDITOR.config.allowedContent = true;" This line just say to ckeditor to avoid any filtering, so, just add it and try again, if it works then, the problem is coming from the filtering process, if not, no luck !! (and I don't know what can be done) Hoping it's help, let me know about the results.

-Christian

— Reply to this email directly or view it on GitHub.

cricri042 commented 11 years ago

Hi Liviu, No, I didn't try it with 'code mirror', will have to, but I'm quite overloaded these days !!. Anyway, I have two more question 1) Does the preview of the slide show work correctly (I mean, do you see the slide show working in the preview panel) ? 2) When you say that "when trying to edit, the editor contains only the images, and not the slide show object". Are these images like a list (I mean like html tag ul/li, with some bullet ?. If yes, then I suspect that something went wrong when loading jquery for the slide show (because internally, slide show images are like a list, and ad-gallery JavaScript is dealing with that to run). So if something goes wrong with java, the display result is just the images, displayed like a list !!. In this case, can you check, if you got JavaScript errors in the JavaScript console ? Let me know

-Christian

KeepSmilin commented 11 years ago

I really appreciate your feedback. I’ll try to be as clear as I can to help you understand my tests.

  1. I am using an opencart version 1.5.5.1 loaded with a CKEditor 4.0 version which includes ‘codemirror’.
  2. I am using this particular version because it accepts and do not reset (scrap) in ‘source’ end the code that I am using to insert the JW Player (video player that I am using on my site). The config.js includes the following lines:

CKEDITOR.editorConfig = function( config ) { // Define changes to default configuration here. // For the complete reference: // http://docs.ckeditor.com/#!/api/CKEDITOR.config config.filebrowserWindowWidth = '800'; config.filebrowserWindowHeight = '500'; config.resize_enabled = false; config.htmlEncodeOutput = false; config.entities = false; config.extraPlugins = 'codemirror'; config.codemirror_theme = 'blackboard';

  1. In this configuration, what I did was to: a. Add your plugin to the plugin directory as provided under a new created folder ‘slideshow’ b. Add in the CKEditor.Config function three lines from your directives:

config.extraPlugins = 'slideshow';config.filebrowserImageBrowseUrl = '/kcfinder/browse.php?type=images';config.filebrowserImageUploadUrl = '/kcfinder/upload.php?type=images';bellow the existing lines.

  1. With tis configuration I have opened a new page to edit. I have inserted the slideshow object, inserted the images from server, tested preview and then save it.
  2. In browser I called the new created window (which is dynamically created in opencart) and I enjoyed the new slideshow as it was expected to be.
  3. I returned in back end and opened the page to edit it. The slideshow object wasn’t there anymore and the editor refused to accept any input. Cancelling page edit did kept the created page with slideshow even after clearing all caches.
  4. I suspected something about allowedContent and therefore I’ve added the line config.allowedContent = true; in the above function CKEDITOR.editorConfig. 8 I’ve returned to edit the page and then I got the images in editor as a bulleted list. In the front end (page) the images were present but no more slideshow.

Hope this helps to comprehension. Please let me now if you reach any conclusion.

Have a great weekend!

Liviu

From: cricri042 Sent: Friday, August 23, 2013 11:21 AM To: cricri042/SlideShow Cc: KeepSmilin Subject: Re: [SlideShow] Adding the plugin to an existin CKEditor (#1)

Hi Liviu, No, I didn't try it with 'code mirror', will have to, but I'm quite overloaded these days !!. Anyway, I have two more question 1) Does the preview of the slide show work correctly (I mean, do you see the slide show working in the preview panel) ? 2) When you say that "when trying to edit, the editor contains only the images, and not the slide show object". Are these images like a list (I mean like html tag ul/li, with some bullet ?. If yes, then I suspect that something went wrong when loading jquery for the slide show (because internally, slide show images are like a list, and ad-gallery JavaScript is dealing with that to run). So if something goes wrong with java, the display result is just the images, displayed like a list !!. In this case, can you check, if you got JavaScript errors in the JavaScript console ? Let me know

-Christian

— Reply to this email directly or view it on GitHub.

KeepSmilin commented 11 years ago

Closed but unsolved?!

cricri042 commented 11 years ago

Hi Liviu, Did you close something ? On my side, I closed nothing, I tried the plugin with code mirror, tried to buils a demo, saving the ckeditor results in a database and getting back the edited result, everything is working well. So, for me the problem is not closed, I just delaying my charge on this, bec

KeepSmilin commented 11 years ago

Still working to make it function in OpenCart. Before your plugin, I am not able to make functioning a ckeditor 4.2 in OpenCart, in a bilingual environment. With the version I am using based on 4.0 I am able to create the slideshow but when toggling from source to wysiwyg the code is disappearing and the editor block. Maybe you could send me your last build that is functioning to try it in OpenCart. On the OpenCart side did not find yet anyone interested in this topic.

cricri042 commented 11 years ago

Hi, If the code is disappearing when toggling from source to WYSIWYG, it' as I said probably a problem with the filtering content editor, and in this case I don't see what can happened (and by the way I don't have a miracle solution except the "config.allowedContent = true;" command in the is file (but it seems you tried that!). Concerning the last version, the version located on github (or in the download package) on ckeditor site is the last one. Really don't see what can happen.

-Christian

KeepSmilin commented 11 years ago

Thanks for your reply. It seems that ckeditor versions above 4.0 are confusing more than one (me in the first place). It seems also that it has problems with OpenCart installations that have more than one language installed. The version Full Version 4.0 installed on my site is build with codemirror and won't accept slideshow plugin with all tricks I have tried. 4.0 full version is no longer available to try without codemirror and 4.2 is not functioning with OC. I will continue to explore this issue and keep in touch.