Hi,
want to use HighSlide JS in our CMS and would like to ease the use of it.
But there is one problem: This is the first time I'm coding in JS, so it doesn't surprise that this code doesn't work..
That's why I'm asking you to help me, please.
HighSlide is an JS framework similiar to Lightbox and works needs the following piece of code to work:
<a href="[Link to image]" class="highslide" onclick="return hs.expand(this, {headingText:'Put Headline here ', captionText:'This contains caption text', slideshowGroup:'Name of image group'})"> <img src="[Link to thumbnail]" title="" /> </a>
To ease the use of it i added some new fields to the Link tab of fck_image dialog.
<div> <span>HighSlide:</span><br /> <span>Display this image in detail with HighSlide: <input type="checkbox" name="cmbHighSlideActiveValue" id="cmbHighSlideActiveValue" value="active" checked=""> </span> <br /> <span>Image-Group:</span> <br /> <input id="txtHighSlideGroup" style="WIDTH: 70%" type="text" /> </div> <div> <br /> <span>Headline:</span><br /> <input id="txtHighSlideHeading" style="WIDTH: 70%" type="text" /> </div> <div> <br /> <span>Caption:</span><br /> <input id="txtHighSlideCaption" style="WIDTH: 70%" type="text" /> </div>
The problem is, that we have to recognise heading, caption and image group values, so some people directed me to use regular expressions. When opening this dialog it should fill the new fields too, but it still doesn't and I don't find the bug, maybe you know what's wrong here?
Code in fck_image.js
[in if( oLink ) in LoadSelection function]
if( oLink.class === 'highslide' ) { GetE('cmbHighSlideActiveValue').checked = 'checked'; var sLinkOnClick = oLink.getAttribute( 'onClick' ); OnClickRE = "/return hs.expand(this, {headingText:'([a-zA-Z 0-9]*)', captionText:'([a-zA-Z 0-9]*)', slideshowGroup:'([a-zA-Z0-9]*)'})/"; OnClickValues = OnClickRE.exec( sLinkOnClick ); if (OnClickValues !== null) { GetE('txtHighSlideHeading').value = OnClickValues[0] ; GetE('txtHighSlideCaption').value = OnClickValues[1] ; GetE('txtHighSlideGroup').value = OnClickValues[2] ; } else { GetE('cmbHighSlideActiveValue').checked = ''; GetE('txtHighSlideHeading').value = '' ; GetE('txtHighSlideCaption').value = '' ; GetE('txtHighSlideGroup').value = '' ; } } else { GetE('cmbHighSlideActiveValue').checked = ''; GetE('cmbHighSlideGroupValue').value = ''; GetE('txtHighSlideHeading').value = ''; GetE('txtHighSlideCaption').value = ''; }
I hope you can help me with this little problem.
Best regards
Chris