foxhound |
|
---|---|
On a test site I am working on I am trying to add Slimbox since the Sienna plugin does not work on 0.9.9 and to make it work I need to add the following code to all images I want to use Slimbox on: rel="lightbox".
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
|
Trustmaster |
|
---|---|
foxhound |
|
---|---|
I am not sure what you mean, I liked to the output explanation in my above post (I think, I have no idea what they are on about):
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />
|
Trustmaster |
|
---|---|
Sorry, I missed the link. It doesn't make the solution much easier though, I only partially understand what they mean and how it would help to allow the rel attribute to work :) Look at it the other way: CKEditor and HTML isn't claimed to be "better" or "more up2date". CKEditor is just extremely popular and has a lot (even too many) features. We bundle it by default because: a) non-tech people want WYSIWYG, b) CKE is known to be good for them and it has so many features. But it doesn't mean that it's the best. You can pick any markup parser and any editor you like most with Cotonti and if I were you I would do so ;) May the Source be with you!
|
Macik |
|
---|---|
There is another way that meet you needs. It's improvement of default Image dialog for adding Rel attribute. Here is the sample code for (ckeditor/lib/plugins/image/dialogs/image.js): { type : 'text', id : 'txtdlgGenRel', label : editor.lang.link.rel, 'default' : '', validate : function() { var regexValidRel = /^\w+$|^$/i; var aMatch = this.getValue().match(regexValidRel), isValid = !!(aMatch); if (!isValid) alert('Not allowed type of Rel'); return isValid; }, setup : function(type, element) { if (type == IMAGE) { var genRel = element.getAttribute('rel'); if (!genRel && element.$.prop('rel')) genRel = element.$.prop('rel'); this.setValue(genRel); var regexValidRel = /^\w+$|^$/i; var rel = element.$.prop('rel'); aMatchRel = (rel ? rel : '').match(regexValidRel); this.attributesInStyle = { rel : !!aMatchRel }; } }, commit : function(type, element) { if (type == IMAGE && (this.getValue() || this.isChanged())) { element.setAttribute('rel', this.getValue()); } } } Full code is here: http://www.cotonti.com/pastebin/170
https://github.com/macik
правильный хостинг — https://goo.gl/fjCa1F |