matt: ideally, yes, once i can find out how to do so - CKEditor is a bit different than Tiny in this.
The current version we have allows these params:
stylesCombo_stylesSet
The "styles definition set" to load into the styles combo. The styles may be defined in the page containing the editor, or can be loaded on demand from an external file when opening the styles combo for the fist time. In the second case, if this setting contains only a name, the styles definition file will be loaded from the "styles" folder inside the stylescombo plugin folder. Otherwise, this setting has the "name:url" syntax, making it possible to set the URL from which loading the styles file.
The file looks like this:
CKEDITOR.addStylesSet('default',[{name:'Blue Title',element:'h3',styles:{color:'Blue'}},{name:'Red Title',element:'h3',styles:{color:'Red'}},{name:'Marker: Yellow',element:'span',styles:{'background-color':'Yellow'}},{name:'Marker: Green',element:'span',styles:{'background-color':'Lime'}},{name:'Big',element:'big'},{name:'Small',element:'small'},{name:'Typewriter',element:'tt'},{name:'Computer Code',element:'code'},{name:'Keyboard Phrase',element:'kbd'},{name:'Sample Text',element:'samp'},{name:'Variable',element:'var'},{name:'Deleted Text',element:'del'},{name:'Inserted Text',element:'ins'},{name:'Cited Work',element:'cite'},{name:'Inline Quotation',element:'q'},{name:'Language: RTL',element:'span',attributes:{dir:'rtl'}},{name:'Language: LTR',element:'span',attributes:{dir:'ltr'}},{name:'Image on Left',element:'img',attributes:{style:'padding: 5px; margin-right: 5px',border:'2',align:'left'}},{name:'Image on Right',element:'img',attributes:{style:'padding: 5px; margin-left: 5px',border:'2',align:'right'}}]);
So I’m trying to figure out how to integrate that via a property. There are a few ideas, and I’d love feedback on them:
1. Currently you could just set that property to an absolute URL: mystyles:
http://mysite.com/assets/js/ckstyles/styles.js that points to a styles definition JS file. This already works like this with the plugin property.
2. We could have a custom property of some sort that in some kind of formatting could define things, but that gets hard as these are pretty dynamic JS structures.
I prefer 1, as it requires no more work. What do you think?