I think this is a Moodle-first. A multi-platform PDF pop-up when a PDF resource link is clicked. But I could be wrong.

Re: I think this is a Moodle-first. A multi-platform PDF pop-up when a PDF resource link is clicked. But I could be wrong.

by Frankie Kam -
Number of replies: 2
Picture of Plugin developers

Eureka, at last! 

Finally. I stumbled upon this 3-year old Moodle.org forum post/thread. Using the information in it and Shadowbox Javascript library, I enabled the PDF popup for Essential theme ...



...and 
Pioneer theme! 


What this means is that I have found out how to enable PDF popups for almost all Moodle.org available themes.Tested and working on my trusty PC laptop and my iPad Air!

Many thanks to Mary Evans for guiding David Choi through the steps to enable Shadowbox Javascript library in Moodle. This weekend I'll be creating another blog post on how you can do this too.

Regards
Frankie Kam, Malaysia

In reply to Frankie Kam

Re: I think this is a Moodle-first. A multi-platform PDF pop-up when a PDF resource link is clicked. But I could be wrong.

by Frankie Kam -
Picture of Plugin developers

Hiya All

I have done it. The PDF.js viewer pop-up (inside a ShadowBox window) now works with all these themes: Aardvark, Academi, Archaius, BCU, Campus, Clean, Contemporary, Crisp, Dynamic, Educacionbe, Eguru, Elegance, Essential, Evolve-D, More, Pioneer, Rocket, Roshnilite, Simple, Shoehorn, Squared, and most probably all other themes as well.

Sharing the 'solution' with all:
http://moodurian.blogspot.my/2015/11/view-pdf-files-in-pop-up-window-in.html

My hack on the /course/renderer.php works on a coursepage where all the lecturer did was to drag and drop PDF files. By default, the PDF file resouce's Display setting is 'Automatic'. If the lecturer had earlier set every PDF file resource's Display to 'pop-up', then the ShadowBox/FancyBox pop-up will NOT work. In such a case, the lecturer would have to change the Display setting to 'Automatic' just to enjoy the Lightbox-like PDF pop-up. Something I want to avoid. No admin or lecturer would want to manually change 100s of PDF file resource Display settings.  It's too much work. My point is that I tried hard to create a silver bullet that would automatically open PDF file resoures in pop-ups, regardless of the 'Display' setting value. Failed.  I achieved only 50% since only PDF file resources with 'Display' setting kept as the default 'Automatic' value would show up in Lightbox-like pop-up window. 

My next step is to see if I can avoid hacking the code. Perhaps by applying course render over-ridding, or by using Generico or VideoEasy (?).

Cheers,
Frankie Kam, Malaysia

Average of ratings: Useful (1)
In reply to Frankie Kam

Re: I think this is a Moodle-first. A multi-platform PDF pop-up when a PDF resource link is clicked. But I could be wrong.

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Frankie,

I think this is brilliant and have thought so since seeing it at Mini iMoot 2015.

It is completely possible to add this as an extra with on / off setting in a theme without changing any of the core code.  And is on my to-do list to try!  I do notice that there is no mention of the pdf.js installation in the web-root?

Cheers,

Gareth