Hi Zhaolin,

On Fri, Nov 13, 2009 at 7:36 PM, Zhaolin Feng <[email protected]>wrote:

> I'm trying to use
> http://code.xwiki.org/xwiki/bin/view/Applications/LightboxApplication,
> but encountered an issue with the WYSIWYG editor.
>
> When I input the following code in the SOURCE mode and afterward
> switch to WYSIWYG mode and then switch back, some garbage is appended
> at the end.
> {{velocity output="false"}}
> $xwiki.jsfx.use("js/scriptaculous/scriptaculous.js")
> $xwiki.ssx.use("XWiki.Lightbox")
> $xwiki.jsx.use("XWiki.Lightbox")
> {{/velocity}}
>

Actually there's a simple fix for your issue: simply add the following check
before your code:

{{velocity output="false"}}
#if($context.action != 'edit')
$xwiki.jsfx.use("js/scriptaculous/scriptaculous.js")
$xwiki.ssx.use("XWiki.Lightbox")
$xwiki.jsx.use("XWiki.Lightbox")
#end
{{/velocity}}

And it will work fine.

Guillaume



> Switching back to SOURCE mode, it becomes:
>
> {{velocity output="false"}}
> $xwiki.jsfx.use("js/scriptaculous/scriptaculous.js")
> $xwiki.ssx.use("XWiki.Lightbox")
> $xwiki.jsx.use("XWiki.Lightbox")
> {{/velocity}}
>
> (% id="overlay" style="display: none;" %)
> (((
>
> )))
>
> (% id="lightbox" style="display: none;" %)
> (((
> (% id="outerImageContainer" style="width: 250px; height: 250px;" %)
> (((
> (% id="imageContainer" %)
> (((
> (% id="hoverNav" %)
> (((
> [[#||id="prevLink"]][[#||id="nextLink"]]
> )))
>
> (% id="loading" %)
> (((
>
> [[image:/xwiki/bin/download/XWiki/Lightbox/loading.gif]][[#||id="loadingLink"]]
> )))
> )))
> )))
>
> (% id="imageDataContainer" %)
> (((
> (% id="imageData" %)
> (((
> (% id="imageDetails" %)
> (((
>
> )))
>
> (% id="bottomNav" %)
> (((
>
> [[image:/xwiki/bin/download/XWiki/Lightbox/closelabel.gif]][[#||id="bottomNavClose"]]
> )))
> )))
> )))
> )))
>
> Question1 : Do you have any idea how to fix it?
> Question2 : A suggestion. Lightbox is really a great extension. So I
> think the standard [[image:picture.png||width="25" height="25"]]
> should do something similar. WDYT?
>
> --
> -- Currahee! We stand alone together!
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>



-- 
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to