Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
PopUpViewer - how to?
Avatar
Elvin #1
Member since Aug 2014 · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: PopUpViewer - how to?
Hello

I would like to display an image, and when clicking on it, to popup the image instead of opening it in a new blank page.

I followed the syntax given on the pluggin page, and arrived to this:

{{popup>test.jpg}}

The result: a red link considered as an intra-link to a new topic called "test.jpg". On the new page, the title is "This topic does not exist yet"... any idea?

PS: I work with DokuWikiStick, a portable version of DokuWiki, so it work locally on a USB stick. my image is stored here: dokuwiki\data\media\test.jpg
This post was edited on 2014-08-17, 20:50 by Elvin.
Avatar
yinken #2
Member since Aug 2014 · 37 posts
Group memberships: Members
Show profile · Link to this post
The gallery plugin can also be used to place only one image (instead of all images in the namespace) on your page if you link directly to said image.

And if you activate the lightbox option, you'll get an image pop-up:

{{gallery>yourimage.jpg?lightbox}}

This might be what you are looking for.
Avatar
Elvin #3
Member since Aug 2014 · 3 posts
Group memberships: Members
Show profile · Link to this post
Thanks a lot, that was exactly what i was looking for! :)
Avatar
gamma #4
Member since Sep 2006 · 123 posts · Location: Berlin
Group memberships: Members
Show profile · Link to this post
Your initial syntax should have worked as well if you had the popupviewer plugin installed. Can you check that again and see if there were any other errors, like JavaSCript errors? The image does exist I guess?
Avatar
walker #5
Member since Aug 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
New user - just installed the Popupviewer.  What is the directory structure that the plugin uses to find the referenced file; it seems to go off and search but never finds the file an .html file.  I have defaulted by putting it in the data directory w/the other media files.
-
To activate JavaScript in the .html do I just have to include;
<popupscript>
/* JavaScript */
</popupscript>

or uncomment it as;
<popupscript>
 JavaScript
</popupscript>

in the .html file, and is location important?


Thanks in advance

Walker
Avatar
turnermm (Moderator) #6
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
In reply to post #4
TypeError: offsetElement.naturalWidth is not a function
http://<server>/binky/lib/exe/js.php?tseed=771a94f0d94426e8be73d87ecd92086f
Line 32753       

width = offsetElement.naturalWidth() || offsetElement.width();
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
walker #7
Member since Aug 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
Answered my own question - is a page from the WIKI not a random .html page - duhhh!

That works but loads the page in the bottom right hand corner and just the top left hand corner of the page?  I saw a fix somewhere on the docuwiki wiki or this forum - - but can't find it again - arggg.
-
And I am now assuming that my JavaScrip simply goes between the to tags
<popupscript>
...
</popupscript>

Thanks

Walker
Avatar
gamma #8
Member since Sep 2006 · 123 posts · Location: Berlin
Group memberships: Members
Show profile · Link to this post
In reply to post #6
Quote by turnermm on 2014-09-02, 17:09:
TypeError: offsetElement.naturalWidth is not a function
http://<server>/binky/lib/exe/js.php?tseed=771a94f0d94426e8be73d87ecd92086f
Line 32753       

width = offsetElement.naturalWidth() || offsetElement.width();

Yoru're using one of the latest versions of DW, right? I pushed an update that should fix this. It is possible this worked on my side since I have another plugin that already had this function. Will try to make unit tests as well ;)
Avatar
turnermm (Moderator) #9
Member since Oct 2009 · 4812 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
Using Ponder Stibbons.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
walker #10
Member since Aug 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
JavaScript
I can't seem to get JavaScript to work on pages 'popped up' with the pulgin.  The page appears as expected, but the JavaScript dose not seem to work, though the HTML seems to be fine.

I have put the code between the
<popupscript>
. . .
</popupscript>

I tried adding <SCRIPT LANGUAGE="JavaScript">
</SCRIPT> 
around the code - dose not seem to still work.

JavaScript is allowed and inline scripts works in other pages.

Using the latest version of DW and your plugin, Windows 7 is my OS, running on Chrome browser.

Thanks in advance

Walker
Avatar
walker #11
Member since Aug 2014 · 4 posts
Group memberships: Members
Show profile · Link to this post
OK so I may be slow but the documentation is scatchy for new comers.

To enable the javascript in the popup page must have

<popupscript>
/* JavaScript */
</popupscript>

at the top of the page to be popped up.

Inside the block HTML tags you put your scrips -

<HTML>
  <script>
     you fave script here

     .....

   </script>
 
and your HTML code here

......

</HTML>

So got things to work -

Still a great plugin -

Thanks

Walker
Avatar
jl.alice #12
Member since Sep 2014 · 11 posts
Group memberships: Members
Show profile · Link to this post
Subject: keepOpen does not work
"keepOpen" option does not keep popup page open if clicking link in it
Popupviewer php script renders {{popup>test2?keepOpen}} as:

<a style="border: 1px solid #ccc; padding: 0 3px;" href="/doku.php?id=wiki:test2" data-popupviewer="{&quot;width&quot;:&quot;keepopen&quot;,&quot;id&quot;:&quot;wiki:test2&quot;}" class="wikilink1" >test2</a>

I suppose the popupviewer js script does not get parameters from "data-popupviewer=".
I do not know programming, maybe the problem is somewhere in viewer.php about the line 146.

I tried new installation of dokuwiki and old version of the popupviewer plug-in (of 2016-06) - the problem is the same.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-04-06, 04:15:05 (UTC +02:00)