Re: [xwiki-users] Use image popup as default behavior

2016-08-17 Thread Vincent Massol
Hi Mario,

> On 17 Aug 2016, at 10:34, Mario  wrote:
> 
> vmassol wrote
>> I’m not exactly sure what you’re looking after
> 
> I want the image to open as a popup / overlay as seen in e.g. wikipedia.
> 
> vmassol wrote
>> The following seems to do what you want:
>> image:myimage.png||width=“100"]]>>attach:myimage.png]]
>> It’ll display the image resized to a width of 100 pixels and when clicked
>> it’ll display the image in full.
> 
> This is kind of a compromise as it enables image manipulation in WYSIWYG but
> two issues remain: when clicking the image you leave the actual wiki page
> (which is inconvenient) and for each image file the user is pasting in the
> editor he has to create the attachment link afterwards. But its easier than
> using Macros.

That’s a good point. It would be interesting to allow plugging different ways 
of rendering images.

Actually this is already possible but requires some technical knowledge. We 
have a XHTMLImageRenderer component role. Right now we offer a default 
implementation in the DefaultXHTMLImageRenderer class.

To be more precise we have different renderers depending on the type of the 
image (icon, datauri, standard, etc). The standard impl is in 
DefaultXHTMLImageTypeRenderer (which implements the XHTMLImageTypeRenderer 
role).

So technically, if you want to change how images are rendered all you need to 
do is develop your own component that implements the XHTMLImageTypeRenderer 
role, package that as a JAR and deploy it in your xwiki instance (by making 
sure you set a higher priority than 1000 for your component). See 
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents for more 
details.

Now it would be nice if we could provide an implementation that does something 
similar to what wikipedia does and that could be configured from the Admin UI.

> Is it possible to configure CKEditor so that when pasting an image file (via
> Ctrl+V from the clipboard) the editor is inserting
> image:myimage.png||width=“100"]]>>attach:myimage.png]] ? I guess we'd
> have to dig into its source code for this feature?

I don’t know if that’s possible but using a custom XHTML Renderer for images 
might be simpler IMO and would allow you to do exactly what you want to have.

You could open a jira issue as an “idea” type maybe. It would be nice to know 
what other xwiki devs think about the idea above.

Thanks
-Vincent

> Thank you
> 
> 
> 
> --
> View this message in context: 
> http://xwiki.475771.n2.nabble.com/Use-image-popup-as-default-behavior-tp7600684p7600691.html
> Sent from the XWiki- Users mailing list archive at Nabble.com.

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Use image popup as default behavior

2016-08-17 Thread Mario
vmassol wrote
> I’m not exactly sure what you’re looking after

I want the image to open as a popup / overlay as seen in e.g. wikipedia.

vmassol wrote
> The following seems to do what you want:
> image:myimage.png||width=“100"]]>>attach:myimage.png]]
> It’ll display the image resized to a width of 100 pixels and when clicked
> it’ll display the image in full.

This is kind of a compromise as it enables image manipulation in WYSIWYG but
two issues remain: when clicking the image you leave the actual wiki page
(which is inconvenient) and for each image file the user is pasting in the
editor he has to create the attachment link afterwards. But its easier than
using Macros.

Is it possible to configure CKEditor so that when pasting an image file (via
Ctrl+V from the clipboard) the editor is inserting
image:myimage.png||width=“100"]]>>attach:myimage.png]] ? I guess we'd
have to dig into its source code for this feature?

Thank you



--
View this message in context: 
http://xwiki.475771.n2.nabble.com/Use-image-popup-as-default-behavior-tp7600684p7600691.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Use image popup as default behavior

2016-08-17 Thread Vincent Massol
Hi,

> On 17 Aug 2016, at 09:21, Hofstätter Mario 
>  wrote:
> 
> The default xwiki image syntax does not provide the ability to click an image 
> to enlarge it.

I’m not exactly sure what you’re looking after. By xwiki image syntax I assume 
you’re talking about wiki markup.

The following seems to do what you want:

image:myimage.png||width=“100"]]>>attach:myimage.png]]

It’ll display the image resized to a width of 100 pixels and when clicked it’ll 
display the image in full.

Thanks
-Vincent

> There seem to be two extensions that provide this feature:
> 
> -  Lightbox Macro
> 
> -  Thumbnail Macro
> 
> But using a macro for this is not an option because:
> 
> -  they need to be inserted manually in CKEditor (no copy paste into 
> browser)
> 
> -  you have to type in the image attachment name (no autocomplete)
> 
> -  It is not possible to resize the macro (image) visually in 
> CKEditor, you have to type in the desired image width
> 
> -  Both macros do not have an option for horizontal alignment (e.g. 
> right)
> 
> -  Lightbox Macro seems buggy in CKEditor, its killing content below 
> the macro
> 
> This is a major issue for us, we have to provide our users as much WYSIWYG 
> handling as possible.
> What are our options? Is it possible to replace the default syntax ckeditor 
> is using for images and provide it with a code template so it uses for 
> example the Thumbnail Macro?
> Am I missing some awesome extension?
> 
> Thank you in advance
> Mario
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users