Hi Zhaolin,
On Fri, Nov 13, 2009 at 7:36 PM, Zhaolin Feng <kingsimba0511(a)gmail.com>wrote;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}}
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?
I'm not sure. I think this is caused by the fact that the JS code gets
executed and the WYSIWYG retrieves and stores the HTML output generated by
the lightbox on the fly.
A potential solution could be for you to edit your code pages in wiki
edition mode and then to include them in other pages using the
{{include document="MyCodePage"}}
macro so that they don't get executed in your current page in WYSIWYG
edition mode.
Let me know if it works.
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?
Could be an optional parameter of the image syntax.
In the meanwhile you could write a {{lightbox}} macro using the wiki macro
creation feature. It would be very easy to use for your users.
Guillaume
--
-- Currahee! We stand alone together!
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Guillaume Lerouge
Product Manager - XWiki SAS
Skype: wikibc
Twitter: glerouge
http://guillaumelerouge.com/