The forum operates in read-only mode. Please head to StackOverflow for support.
<div> <br /> <label for="isLightBox" ><input type="checkbox" value="lightbox[]" id="isLightBox" />Lightbox gallery</label> </div>
if ( oLink ) { var sLinkUrl = oLink.getAttribute( '_fcksavedurl' ) ; if ( sLinkUrl == null ) sLinkUrl = oLink.getAttribute('href',2) ; GetE('txtLnkUrl').value = sLinkUrl ; GetE('cmbLnkTarget').value = oLink.target ; // lightbox if (!oLink.rel || -1 == oLink.rel.indexOf('lightbox')) { GetE('isLightBox').checked = false; } else { GetE('isLightBox').checked = true; } }
if ( sLnkUrl.length == 0 ) { if ( oLink ) { FCK.ExecuteNamedCommand( 'Unlink' ) ; // lightbox if (-1 != oLink.rel.indexOf('lightbox')) { oLink.removeAttribute('rel'); } } } else { if ( oLink ) // Modifying an existent link. oLink.href = sLnkUrl ; else // Creating a new link. { dialog.Selection.EnsureSelection() ; if ( !bHasImage ) { oEditor.FCKSelection.SelectNode( oImage ) ; } oLink = oEditor.FCK.CreateLink( sLnkUrl )[0] ; if ( !bHasImage ) { oEditor.FCKSelection.SelectNode( oLink ) ; oEditor.FCKSelection.Collapse( false ) ; } } SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ; SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ; // lightbox if (GetE('isLightBox').checked) { SetAttribute( oLink, 'rel', GetE('isLightBox').value ) ; } else { if (-1 != oLink.rel.indexOf('lightbox')) { oLink.removeAttribute('rel'); } } }
<script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script> <script type="text/javascript" src="js/lightbox.js"></script> <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
Re: how i can integrate lightbox2 in the fckeditor
http://asten.ru/blog/programming/fckeditor-lightbox
Re: how i can integrate lightbox2 in the fckeditor
So here is the translation:
1. Open with an editor the file: /fckeditor/dialog/fck_image.html
Insert following code into it, after the line 190:
2. Open with an editor the file: /fckeditor/dialog/fck_image/fck_image.js
Replace following code into it, after the line 193:
if ( oLink ) { var sLinkUrl = oLink.getAttribute( '_fcksavedurl' ) ; if ( sLinkUrl == null ) sLinkUrl = oLink.getAttribute('href',2) ; GetE('txtLnkUrl').value = sLinkUrl ; GetE('cmbLnkTarget').value = oLink.target ; // lightbox if (!oLink.rel || -1 == oLink.rel.indexOf('lightbox')) { GetE('isLightBox').checked = false; } else { GetE('isLightBox').checked = true; } }3. Replace the code with this one:
if ( sLnkUrl.length == 0 ) { if ( oLink ) { FCK.ExecuteNamedCommand( 'Unlink' ) ; // lightbox if (-1 != oLink.rel.indexOf('lightbox')) { oLink.removeAttribute('rel'); } } } else { if ( oLink ) // Modifying an existent link. oLink.href = sLnkUrl ; else // Creating a new link. { dialog.Selection.EnsureSelection() ; if ( !bHasImage ) { oEditor.FCKSelection.SelectNode( oImage ) ; } oLink = oEditor.FCK.CreateLink( sLnkUrl )[0] ; if ( !bHasImage ) { oEditor.FCKSelection.SelectNode( oLink ) ; oEditor.FCKSelection.Collapse( false ) ; } } SetAttribute( oLink, '_fcksavedurl', sLnkUrl ) ; SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ; // lightbox if (GetE('isLightBox').checked) { SetAttribute( oLink, 'rel', GetE('isLightBox').value ) ; } else { if (-1 != oLink.rel.indexOf('lightbox')) { oLink.removeAttribute('rel'); } } }That's it for the script part.
4. add into <head> of html :
That's it!
Re: how i can integrate lightbox2 in the fckeditor
http://asten.ru/blog/programming/fckeditor-lightbox-eng
Re: how i can integrate lightbox2 in the fckeditor
kamil123_1980@tlen.pl
Re: how i can integrate lightbox2 in the fckeditor
ghostfights@gmail.com