[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Re: Script to open a.ep_document_link in pop-up



:o)

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:
~/lib/static/javascript/auto/40_lightbox.js (this gets compiled into e.g. auto-3.3.12.js).

I think you can force this behaviour in the EPrints interface by adding a rel=?lightbox? to your link:
<a href="http://your.repo/1/1.haslightboxThumbnailVersion/file.pdf"; rel="lightbox">Preview</a>

- which will open the ?lightbox? size thumbnail ? from the href of the link.

Hope that helps too!
Cheers,
John


From: eprints-tech-bounces at ecs.soton.ac.uk [mailto:eprints-tech-bounces at ecs.soton.ac.uk] On Behalf Of Jacob Wenzel
Sent: 13 August 2014 12:41
To: eprints-tech at ecs.soton.ac.uk
Subject: [EP-tech] Re: Script to open a.ep_document_link in pop-up

Ups, sorry John, never mind :)

I just needed:

document.observe("dom:loaded", function() {
    links = $$("a.ep_document_link");
    links.each(function(link){
        link.observe("click", function(event){
            window.open(link.href,'','height=575,width=720');
            event.stop();
        });
    });
});

Thanks, it is perfect now!

/Jacob.

On 13-08-2014 13:32, Jacob Wenzel wrote:
Thanks a lot John, both do work!

Unfortunately they open a new tab and not a pop up, which can be confusing for less tech-savvy users.

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?

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.
http://energiakademiet.dk/en/eve-fisher-lovmaessige-begraensninger-for-borgerstyret-energi/

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.

/Jacob
On 12-08-2014 13:59, John Salter wrote:
Hi Jacob,