<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    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 class="moz-txt-link-freetext" 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<br>
    <br>
    <div class="moz-cite-prefix">On 12-08-2014 13:59, John Salter wrote:<br>
    </div>
    <blockquote
cite="mid:EMEW3|56e9c12d655873042537dd20b7b362b4q7BD0u14eprints-tech-bounces|ecs.soton.ac.uk|7154BCBB8909D642AE6F44CA713DBC2009A4D2417D6A@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;}
/* 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;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi

            Jacob,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">From

            the snippet of Prototype below, it looks like you’re
            defining a function ‘new_window_links’, but never actually
            calling it?<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Does

            this work (anonymous function):<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">document.observe("dom:loaded",

            function() {<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">   

            links = $$("a.ep_document_link");<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">   

            links.each(function(link){<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">       

            link.observe("click", function(event){<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">           

            window.open(link.href);<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">           

            event.stop();<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">       

            });<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">   

            });<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">});<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">or

            this (same named function, specifically called):<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">document.observe("dom:loaded",

            function() {<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">   

            function new_window_links(){<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">     

            links = $$("a.ep_document_link");<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">     

            links.each(function(link){<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">       

            link.observe("click", function(event){<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">         

            window.open(link.href);<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">         

            event.stop();<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">       

            });<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">     

            });<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">   

            }<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">   

            new_window_links();<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">});<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I
            haven’t tested either!<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">John<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;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:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"
                  lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;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> 12 August 2014 12:35<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] 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">Hi guys!<br>
          <br>
          Im trying to open document links - '&lt;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><span style="color:#999999"><o:p></o:p></span></p>
          <p><strong><span style="color:#999999">JACOB WENZEL</span></strong><b><span
                style="color:#999999"><br>
                <strong>Projektleder</strong></span></b><span
              style="color:#999999"><o:p></o:p></span></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><o:p></o:p></span></p>
        </div>
      </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>