Hi,
On 28 Aug 2018, at 09:49, Stéphane Laurière
<slauriere(a)xwiki.com> wrote:
Vincent Massol:
Hi Stephane,
On 28 Aug 2018, at 08:55, Stéphane Laurière
<slauriere(a)xwiki.com> wrote:
Hi all,
I would like to contribute an extension that will display page preview popovers when
hovering wiki links, similarly to what MediaWiki offers:
https://www.mediawiki.org/wiki/Page_Previews
https://blog.wikimedia.org/2018/05/09/page-previews-documentation/ Sounds nice.
Do you plan to implement it as a Rendering Transformation (similar to what the Glossary
app do) or as Javascript code?
Actually I had not considered the rendering transformation option. At first glance, plain
JavaScript code seems more lightweight to me without any downside but if you see pros for
using a transformation, please let me know.
The downsides of the Transformation approach are:
* currently requires the user to modify xwiki.properties and restart the wiki
* makes page rendering take longer when the transformation is active (tree traversal)
I also think that JS is better suited here than Transformation. I mentioned it to be
complete.
There's one issue with plain JavaScript at the
moment though: the Bootstrap popover feature in version 3.x adds a div next to the clicked
element. In our case, this means adding a div to the surrounding span.wikilink, which is
not allowed in HTML5. However, Bootstrap 4 popovers work differently: they're added as
direct childs of the body:
https://getbootstrap.com/docs/4.0/components/popovers/ so the
issue will be fixed once we migrate. What do you think? Can we live with a div in a span
for now?
That’s not valid HTML so not sure it’s a good idea.
Its name
could be 'application-page-preview-popover' - what do you think? As discussed with
Caty yesterday, the extension will use the Bootstrap popovers. Should you have any need or
suggestion, please let me know.
So it depends on the technology you wish to use. If
it’s a transformation, I would name it "transformation-preview”. If it’s JS/webjar, I
guess you’ll need a JSX object to load it so I guess "application-page-preview” would
be fine.
I see, but in any case, with or without a transformation, I think we will need some JS +
CSS code anyway, won't we?
Yes indeed
As far as I can see, the glossary extension is an
application containing a transformation, so we could go for
"application-page-preview" as well, with or without transformation, what do you
think?
Right, for Glossary the reason it was an “application” was because there’s an app :) Used
to define all the glossary items (one per page). It’s a FAQ-like app.
However "application-page-preview” is ok for me.
Thanks
-Vincent
Stéphane
Thanks
-Vincent
> If the name is ok, can I ask you for the creation of a repository and JIRA project?
>
> Stéphane
>
>
> --
> Stéphane Laurière
> XWiki
www.xwiki.com
> @slauriere
>
--
Stéphane Laurière
XWiki
www.xwiki.com
@slauriere