new WYSIWYG-Editor event Plugin: CKEDITOR!

Creating and modifying plugins.
Post Reply
User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Thu Aug 15, 2013 3:53 pm

ICE, what happened to this and about an answer in ckeditor forums?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Thu Sep 05, 2013 12:46 pm

I tried to fix these imageselectorplus galleries within both plugins now. Available via Spartacus tomorrow.

Even with adding a protectedSource mediainsert block, the example:

Code: Select all

        <mediainsert>
            <gallery name="MyHolidays/" />
            <media type="single" name="pict0034" />
            <media type="single" name="pict0032" />
            <media type="range" prefix="pict00" start="35" stop="52" />
        </mediainsert>
is making CKE reacting still quite sensitive, since you can put this in like this on first time without ckeditor reacting bad. It just saves that as a one-liner, which does not really matter.

Code: Select all

<mediainsert> <gallery name="MyHolidays/" /> <media type="single" name="pict0034" /> <media type="single" name="pict0032" /> <media prefix="pict00" start="35" stop="52" type="range" /> </mediainsert>
If you re-write it back to multiple lines with a second entry save, CKE will add ending media and gallery tags and removes the single tag trailings slashes. This is bad for the XML based restructure of imageselectorplus. So just keep it like first inserted, submitted and then given back and all will be well and untouched on future entry saves, if you keep the whitespaces between tags.

Imageselectorplus was changed to remove ending single tags and fix missing trailing slashes in mediainsert blocks, if that ever happens to occur via CKE.

If someone wants to investigate this in deep, why CKE is not leaving protectedSource blocks untouched by line change, attribute order change and automatically ending tags added, I would be pleased to know about it.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Thu Nov 21, 2013 11:56 am

Sorry for the delay.
I pushed an update to the ckeditor plugin [v.2.3.0]. This might take a day to show up on Spartacus.

Most of the inline js code went into 2 new files, which are:
  • cke_config.js - the custom config.js file, which now substitutes every config option to CKE
  • cke_plugin.js - the render and add button/plugin file, which loads the custom config file and now renders all backend textareas.
I added some new plugins, updated some others, upgraded to CKEDITOR v. 4.2.3, added some new options, fixed some issues, changed lang en/de files and tried to improve these protectedSource (and the upper restrictions to mediainsert) blocks.

Please read the ChangeLog. The About [?] button should now declare itself as CKEditor 4.2.3 (revision a8bf556). IF not, uninstall in plugin list and immediately install again (no need to do that physically!).
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

ICE
Regular
Posts: 239
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE » Thu Nov 21, 2013 11:58 am

TOP :!:
Thanks

ICE
Regular
Posts: 239
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE » Tue Dec 03, 2013 9:48 pm

I've now updated to the latest version and i have a problem ...
Chrome is displaying an error:

Uncaught SyntaxError: Unexpected token = cke_plugin.js:50

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Wed Dec 04, 2013 11:24 am

Ah thanks, I see that myself on Google Chrome (only). That is really odd!
This damn browser is a pain developing javascript. Firefox - my usual one - is running fine!

Chrome somehow complains running anonymous functions with jquery 1.8.3, which stops as an exception with this strange error message, on function starter lines. Its not only related to my cke_plugin file. I don't see what I can do about it on the fly, to help you, without saying: take Mozilla FireFox! :)

I will have to think about it, if it is a silent Chrome update being to strict, with include_preload.js - s9y jquery - s9y plugins with anonymous functions - include_postload.js, OR needs us to change to a better jquery version, OR needs a rewrite on my side. And that will take some time, I am sorry.

If anyone knows Chrome being picky on this and how to avoid, please just drop in.

Edit: The error is Uncaught SyntaxError: Unexpected token "=" not "= somefile", telling me that Chrome does not like javascript to set default values to function properties. Is that really true?

Edit2:
I assume, I am to much influenced by PHP! :) I'll give you a Spartacus update tomorrow! That is why I like Firefox. It is forgiving and much better orientated to life as it is...!

Edit3: OK Done!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

ICE
Regular
Posts: 239
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE » Wed Dec 04, 2013 2:47 pm

Whoaw ... thanks for debugging.
But this error is not Chrome specific, Internet Explorer 11 is affected too:

Code: Select all

   SCRIPT1006: ')' erwartet
   Datei: cke_plugin.js, Zeile: 50, Spalte: 28
I'm with Firefox from version 0.8 to now ... but ... Chrome is so much faster than Firefox, and also consumes less Ram ... imho ... :roll: :mrgreen:

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Wed Dec 04, 2013 4:52 pm

That is the same error. Strict javascript does not allow to set default values to function properties.

Uhhh - Google and MS together against FF - what a nightmare! :shock:
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

ICE
Regular
Posts: 239
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE » Wed Dec 04, 2013 5:09 pm

For me, the Internet Explorer does not matter, but I have many customers who use the Internet Explorer. I recommend daily to use another browser but ... You know ...

I have to check my sites with IE, Firefox and Chrome ... inclusive mobile browsers.

http://www.browser-statistik.de/marktanteile/ (Safari direkt nach Firefox???)
and
http://www.w3schools.com/browsers/browsers_stats.asp

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Wed Dec 04, 2013 5:58 pm

Yes, using Firefox is sadly somehow old school these days and Germany is an Island!
I know sites (in the US) which are visited nearly solely by mobiles only; Desktops are extremly rare and the ones using Firefox are just a handfull.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
yellowled
Regular
Posts: 7078
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by yellowled » Wed Dec 04, 2013 9:22 pm

I just experienced the same thing.

While I see you already pushed an update to Spartacus, I looked into the dev tools as well and realized I also get a 403 (Forbidden) for serendipity_define.js.php which isn't exclusive to Chrome, but also shows up in Firefox (man, finding that in FFs console is really hard if you're used to the Chrome dev tools …)

Could that be related to the JS error produced by CKE?

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by Timbalu » Wed Dec 04, 2013 10:00 pm

I don't know. Where exactly do you get this?
( ;-) I have the same problem when playing with chrome devtools...)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

ICE
Regular
Posts: 239
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE » Thu Dec 05, 2013 11:42 am

Works now! Big Thanks!

User avatar
yellowled
Regular
Posts: 7078
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany
Contact:

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by yellowled » Thu Dec 05, 2013 11:57 am

Timbalu wrote:I don't know. Where exactly do you get this?
Any time I try to start a CKE editor, I think.

So I just updated to 2.3.1, and it still doesn't work.

Code: Select all

Failed to load resource: the server responded with a status of 403 (Forbidden) http://domain.tld/serendipity_define.js.php
Uncaught SyntaxError: Unexpected string /plugins/serendipity_event_ckeditor/ckeditor/plugins/procurator/plugin.js?t=DAEB:12
Uncaught TypeError: Cannot read property 'icons' of null 
This is from Chrome's error console, it seems to work just fine in Firefox. I assume (but haven't tested) that these will also show up (and make the editor no work) in Safari and latest Opera (using webkit engine).

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

ICE
Regular
Posts: 239
Joined: Tue Jun 28, 2005 11:15 pm

Re: new WYSIWYG-Editor event Plugin: CKEDITOR!

Post by ICE » Thu Dec 05, 2013 12:02 pm

I don't know why ... installing ckeditor updates only work, if i delete the plugin directory by hand and make a new install. Before that, i've got a error message too an the textareas were hidden (in Chrome).

Now it works with Internet Explorer 11 and Chrome.

Post Reply