rel="lightbox" or rel="lightbox1" or rel="lightbox2" aso
onOk : function ()
{
if ( this.getValue() != '' ) { // this is my text field for rel attribute
linkElement = this.getDialog().linkElement;
linkElement.setAttribute( 'rel', this.getValue() );
}
}http://cksource.com/forums/viewtopic.php?f=11&t=22856http://cksource.com/forums/viewtopic.php?f=11&t=22833

Re: access to selection from external plugin - feature reque
It's specially important to note that the issue isn't the "editor selection", but also any new element that it's created in the dialog that you must adjust with your code.
Re: access to selection from external plugin - feature reque
(function() { CKEDITOR.plugins.add( 'linkonclick' ); CKEDITOR.on( 'dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; var editor = ev.editor; if ( dialogName == 'link' ) { var myLink; var infoTab = dialogDefinition.getContents('info'); infoTab.add( { type : 'text', id : 'onclickevent', label : 'onClick', 'default' : '', onShow : function () { myLink = CKEDITOR.plugins.link.getSelectedLink( editor ) || ''; if(myLink != '') { var clickEvt = myLink.getAttribute( 'data-cke-pa-onclick' ) || myLink.getAttribute( 'onclick' ); if(clickEvt != '') this.setValue( clickEvt ); else this.setValue( '' ); } }, /* commit : function( data ) { if ( !data.onclick ) data.onclick = {}; data.onclick = this.getValue(); }, // seems to have no effect */ onOk : function () { if ( this.getValue() != '' ) { //this.getDialog().commitContent( data ); // don't work //dialogDefinition.commitContent( data ); // don't work //sourceElement = this.getDialog().sourceElement; // would work if sourceElement exists in current dialog //sourceElement.setAttribute( 'data-cke-pa-onclick', this.getValue() ); } } }, 'browse'); } }); })();Re: access to selection from external plugin - feature reque
var textInput = { type : 'text', label : editor.lang.backgrounds.label, id : 'background', setup : function( selectedElement ) { this.setValue( selectedElement.getAttribute( 'background' ) ); }, commit : function( data, selectedElement ) { var element = selectedElement || data, value = this.getValue(); if ( value ) element.setAttribute( 'background', value ); else element.removeAttribute( 'background' ); } };Re: access to selection from external plugin - feature reque