CKEditor Global Config

Community Driven Extensions Project
Post Reply
lleontop
Posts: 14
Joined: 18 May 2012, 11:37

22 Oct 2012, 09:42

Hi!
I have an optimization problem with PE ckEditor and i would like some help in case somebody knows how to help me..
I have some pages with multiple ckEditors components in them (10-15 editors in average). Because the contents of ckEditor are Greek characters i need to configure the editors with this script found on an official ckEditor page..

Code: Select all

CKEDITOR.config.entities = false;
CKEDITOR.config.entities_latin = false;
CKEDITOR.on('instanceReady', function( ev ) {
	  var blockTags = ['div','h1','h2','h3','h4','h5','h6','p','pre','li','blockquote','ul','ol',
	  'table','thead','tbody','tfoot','td','th',];

	  for (var i = 0; i < blockTags.length; i++)
	  {
	     ev.editor.dataProcessor.writer.setRules( blockTags[i], {
	        indent : false,
	        breakBeforeOpen : true,
	        breakAfterOpen : false,
	        breakBeforeClose : false,
	        breakAfterClose : true
	     });
	  }
	});
Now the problem is this..The code above is a seperate js file in my resources..To configure all the editors i put customConfig="path/to/above/file" in each editor and everything works fine, but with the overhead that each editor does a GET request to get this file...So 10-15 requests to get the same file.. I tried to include this script globally with <h:outputScript /> but CKEDITOR results in undefined.. So i was wondering how can i make all editors "see" this config file if it is possible without overwriting the config.js in resources-ckEditor.jar and rebuilding it.. Is it somehow possible?

Thanks!
Primefaces 3.4
Mojarra 2.1.11
Shiro 1.2
Omnifaces 1.1
PF Extensions 0.5

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

22 Oct 2012, 11:10

No idea sorry.
YOu could catch the initialize behavior event on only one editor via pe:javascript and load your config file here.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

lleontop
Posts: 14
Joined: 18 May 2012, 11:37

22 Oct 2012, 12:01

Hey zoigl!
Thanks for the reply!!
Researching this issue a bit more i found that it's not that easy to have a global custom config in the actual ckEditor core..
So i don't think it's something on PFExt part as i first thought..
So i will leave it as is and deal with the overhead..
Primefaces 3.4
Mojarra 2.1.11
Shiro 1.2
Omnifaces 1.1
PF Extensions 0.5

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 6 guests