<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Thank you John for adding that.<br>
<br>
I should have mentioned though, that only want the previews to open
in a lightbox and the actual documents in a pop up.<br>
<br>
The reason for this browser compatibility. First of all, I have had
problems to get Adobe Reader to load in the light box (in Internet
Explorer of course), so clicking PDF links some times just results
in an empty light box window.<br>
<br>
Secondly I have lots of different video, audio, archive and document
files, and I prefer not to rely on Flash or Quicktime to deliver
them, because the first is unavailable in iOS, and the second is a
pain on windows.<br>
<br>
The solution you guided me towards handles just about every file
format I throw at it in a recent browser and lets the user decide
which plugins to install when needed. For example most recent
browsers streams MP4 natively, but IE closes the new window and
streams the file in WMP which is just fine. <br>
<br>
I know I could implement different viewers, but most handles large
PDF documents badly, and I would have to somehow sort out all the
unsupported document links, so I prefer nudging my user towards
updating their browsers, since most browsers auto-update nowadays
anyway.<br>
<br>
I say this after fiddling with shadowbox on my wordpress based site
though. I don't know about the lightbox EPrints uses. Does it handle
large PDF's and what browser plugins does it rely on?<br>
<br>
All the best!<br>
/Jacob<br>
<br>
<div class="moz-cite-prefix">On 13-08-2014 14:00, John Salter wrote:<br>
</div>
<blockquote
cite="mid:EMEW3|eb40dd948e7ce72cfa3ee38831f372b7q7CD7714eprints-tech-bounces|ecs.soton.ac.uk|7154BCBB8909D642AE6F44CA713DBC2009A4D2417D75@HERMES7.ds.leeds.ac.uk"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">:o)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">If
you want something more like your example (this type of
interface device is sometimes called a ‘modal window’, or
‘lightbox’), then take a look at:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">~/lib/static/javascript/auto/40_lightbox.js
(this gets compiled into e.g. auto-3.3.12.js).<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I
think you can force this behaviour in the EPrints interface
by adding a rel=”lightbox” to your link:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a
href=<a class="moz-txt-link-rfc2396E" href="http://your.repo/1/1.haslightboxThumbnailVersion/file.pdf">"http://your.repo/1/1.haslightboxThumbnailVersion/file.pdf"</a>
rel="lightbox">Preview</a><o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
- which will open the ‘lightbox’ size thumbnail – from the
href of the link.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hope
that helps too!<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">John<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"
lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"
lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
[<a class="moz-txt-link-freetext" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>] <b>On
Behalf Of </b>Jacob Wenzel<br>
<b>Sent:</b> 13 August 2014 12:41<br>
<b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br>
<b>Subject:</b> [EP-tech] Re: Script to open
a.ep_document_link in pop-up<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Ups, sorry
John, never mind :)<br>
<br>
I just needed:<br>
<br>
document.observe("dom:loaded", function() {<br>
links = $$("a.ep_document_link");<br>
links.each(function(link){<br>
link.observe("click", function(event){<br>
window.open(link.href,'','height=575,width=720');<br>
event.stop();<br>
});<br>
});<br>
});<br>
<br>
Thanks, it is perfect now!<br>
<br>
/Jacob.<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">On 13-08-2014 13:32, Jacob Wenzel wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Thanks a lot
John, both do work!<br>
<br>
Unfortunately they open a new tab and not a pop up, which
can be confusing for less tech-savvy users.<br>
<br>
Do you know, how I can pass attributes to the new window,
so I can specify height and width to the new window and
perhaps remove the menu bars?<br>
<br>
Preferably I would like my pop-ups to look like the one seen
on the embedded eprint at the bottom of the linked post
below, but any solution where the user sees the new window
popping up on top of the main site instead of switching tabs
would be acceptable.<br>
<a moz-do-not-send="true"
href="http://energiakademiet.dk/en/eve-fisher-lovmaessige-begraensninger-for-borgerstyret-energi/">http://energiakademiet.dk/en/eve-fisher-lovmaessige-begraensninger-for-borgerstyret-energi/</a><br>
<br>
Thanks again in advance! And I am sorry if this is basic
stuff, I am not very good with javascript in general, but I
really appreciate your help.<br>
<br>
/Jacob<o:p></o:p></p>
<div>
<p class="MsoNormal">On 12-08-2014 13:59, John Salter wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi
Jacob,</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">From
the snippet of Prototype below, it looks like you’re
defining a function ‘new_window_links’, but never
actually calling it?</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Does
this work (anonymous function):</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">document.observe("dom:loaded",
function() {</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
links = $$("a.ep_document_link");</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
links.each(function(link){</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
link.observe("click", function(event){</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
window.open(link.href);</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
event.stop();</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
});</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
});</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">});</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">or
this (same named function, specifically called):</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">document.observe("dom:loaded",
function() {</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
function new_window_links(){</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
links = $$("a.ep_document_link");</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
links.each(function(link){</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
link.observe("click", function(event){</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
window.open(link.href);</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
event.stop();</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
});</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
});</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
}</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">
new_window_links();</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">});</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I
haven’t tested either!</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">John</span><o:p></o:p></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"
lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"
lang="EN-US"> <a moz-do-not-send="true"
href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
[<a moz-do-not-send="true"
href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>]
<b>On Behalf Of </b>Jacob Wenzel<br>
<b>Sent:</b> 12 August 2014 12:35<br>
<b>To:</b> '<a moz-do-not-send="true"
href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a>'<br>
<b>Subject:</b> [EP-tech] Script to open
a.ep_document_link in pop-up</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Hi guys!<br>
<br>
Im trying to open document links - '<a
class="ep_ducument_link" href="...' - in a pop up window
(not a new tab), but I can't figure out how to do this in
prototype.<br>
<br>
In jquery i do this:<br>
<br>
<span style="color:#3366FF">jQuery(document).ready(function($)
{<br>
jQuery('a.ei_popup').live('click', function(){<br>
newwindow=window.open($(this).attr('href'),'','height=575,width=720');<br>
if (window.focus) {newwindow.focus()}<br>
return false;<br>
});<br>
});</span><br>
<br>
which does the trick.<br>
<br>
I am totally new to prototype, but I found this snippet,
that is supposed to do the same:<br>
<br>
<span style="color:red">document.observe("dom:loaded",
function() {<br>
function new_window_links(){<br>
links = $$("a.ep_document_link");<br>
links.each(function(link){<br>
link.observe("click", function(event){<br>
window.open(link.href);<br>
event.stop();<br>
});<br>
});<br>
}<br>
});</span><br>
<br>
But it doesn't do anything. I checked the source code, and
the code does load fine from 90_local.js.<br>
<br>
Thanks in advance, help and pointers will be greatly
appreciated.<br>
<br>
Have a nice day!<o:p></o:p></p>
<div>
<p class="MsoNormal">-- <o:p></o:p></p>
<p><strong><span style="color:#999999">Med venlig
hilsen/Best regards</span></strong><o:p></o:p></p>
<p><strong><span style="color:#999999">JACOB WENZEL</span></strong><b><span
style="color:#999999"><br>
<strong>Projektleder</strong></span></b><o:p></o:p></p>
<p><strong><span style="color:#999999">ENERGIAKADEMIET</span></strong><span
style="color:#999999"><br>
Strandengen 1<br>
8305 SAMSØ<br>
+45 60 61 15 97<br>
<a moz-do-not-send="true"
href="mailto:jw@energiakademiet.dk"><span
style="color:#999999;text-decoration:none">jw@energiakademiet.dk</span></a><br>
<a moz-do-not-send="true"
href="http://energiakademiet.dk"><span
style="color:#999999;text-decoration:none">www.energiakademiet.dk</span></a></span><o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>*** Options: <a moz-do-not-send="true" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><o:p></o:p></pre>
<pre>*** Archive: <a moz-do-not-send="true" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><o:p></o:p></pre>
<pre>*** EPrints community wiki: <a moz-do-not-send="true" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><o:p></o:p></pre>
<pre>*** EPrints developers Forum: <a moz-do-not-send="true" href="http://forum.eprints.org/">http://forum.eprints.org/</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
*** EPrints developers Forum: <a class="moz-txt-link-freetext" href="http://forum.eprints.org/">http://forum.eprints.org/</a>
</pre>
</blockquote>
<br>
</body>
</html>