Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2012 at 13:39 UTC
Updated:
30 Jul 2013 at 01:31 UTC
This module allows users to create online flipbooks using turn.js.
To use the module, you need to download a copy of turn.js to the libraries folder.
The modules creates a field display for viewing images as a flipbook, using turn.js.
Thsi module is for Drupal 7.
http://drupal.org/sandbox/michaellenahan/1798746
http://drupalcode.org/sandbox/michaellenahan/1798746.git
Comments
Comment #1
klausiWelcome,
please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxmichaellenahan1798746git
Comment #2
michielnugter commentedHi,
I took a look at the code and it could be improved at several places:
'width': should be width:Drupal.settings.turnjs.pageWidthComment #3
steffenrIn my opinion all those jQuery-Pageflip plugins are hard to handle for the end-user, cause not everybody is able to export PDFs to images in the correct sizes / correct resolutions etc.. That's why i often recommend using a flash-tool and putting the exported data on the web-server.
In most cases users just want to export an existing PDF as a page-flip for their website..
BUT - we could do better - turn.js is a really nice/slim plugin that would suite most needs if we improve the handling - based on the following content-type structure:
What do you think of this approach ?
Comment #4
klausiProject applications are tasks.
Comment #5
risse commentedHey,
I have now pushed a new commit, based on #2.
@SteffenR I noticed that there is already a module for automatically converting PDF to images: http://drupal.org/project/pdf_to_imagefield It should work with this module!
Comment #6
risse commentedComment #7
anthonylindsay commentedI just had a quick read through of your code and noticed that turnjs.js line 3 refers to exampleModule - probably does not affect the actual functionality, but should probably refer to your module.
Comment #8
risse commented@anthonylindsay, that issue has been fixed, thanks for noticing!
Comment #9
jnicola commentedOkay, doing a code review for you!
Installing and actually making it work:
So installing the module was a bit of a challenge. Your readme code actually has TWO explenations for how to install and where to install, one telling you to clone the turn.js repo... which puts it in a folder called turn.js, and above you say to put it in turnjs (line 7). Pick one, make sure it's right, and improve the clarity on this please!
From there, I set it up, uploaded some images, and went to see how it works. This must be a turn.js issue but... The images are shifted when you mouse over the page flipcorner. It's visually off. Please review if it's your code.
Ventral code review
Manual Code Review
Nothing bad or security wise sticks out to me. It's just got some wonky functionality and the readme needs a serious overhaul for extreme clarity!
Comment #10
nikro commentedHey Risse,
I've installed the module and went through the code. I liked the module, it's pretty light and gives and interesting functionality.
Here are my tips:
README.txt
You have a conflict in the file, please examine it and commit the correct changes.
Also I agree with jnicola regarding the installation process.
But your code is looking for the "turn.js" folder. I had /turnjs/turn.js/turn.js and it didn't see it.
turnjs.module
Line 53. Specify the correct comment (because you're actually implementing a hook there: hook_field_formatter_settings_form).
turnjs.js
You should specify a correct behavior name (not exampleModule).
Make a check if there's such a function named jQuery.turn() and also make a quick check for settings.turn values. Also don't be afraid to use $ instead of jQuery, because it's namespaced. Drop a line of comment in your js file and indent the lines correctly according to: JavaScript Drupal Standards.
General:
Images get always distorted, even if I use an image style. And just like jnicola wrote, I had reproduce the case of image shifting on a hover event.
Also I've noticed that when I disabled image styles, the turn.js picked the largest image and used it's width / height in the whole widget, which resulted in a huge turn.js widget (wider than my page/screen), I guess that's also an issue you have to look into.
I've noticed that first image (in double mode) is always displayed on the right side of the double layout, maybe you want to expose that into settings, so users can pick either one image is shown or both.
Good luck!
Comment #11
risse commentedHey Nikro and Jnicola,
Thank you for review!
I have now pushed an update regarding your comments.
Comment #12
sreynen commentedComment #13
kscheirerYou like a lot of whitespace! In general, Drupal prefers that you don't do that. That's very minor though, and the issues above refer to possible rendering bugs, but I'm sure the module's users will let you know :) RTBC from me.
--
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #14
michaellenahan commentedHi, I wanted to say thanks to Risse and put a note on this issue because we worked together on the original project and it's in my sandbox --- just want to make it clear that all the credit belongs to Risse, not me.
Comment #15
voughndutch commentedI'm going to give this a go on my local dev site. However does anybody think its possible for this module to display pages as views or furthermore views within views as a page in addition to the imagefield to PDF option? There is a module that user Luch developed that attempted to do this and sent for me to test called Booklet for views. It was based on the Moleskin Booklet using the Booklet jQuery plugin. I am not adept at Drupal module development however I am pretty good at testing. If anyone wants to give it look let me know the best way to get it to you. I'm not attempting to sidetrack the thread I just think that both modules can benefit somewhat if some ideas and code are shared.
Comment #16
kscheirerCode still looks good to me, and it's been over a month since RTBC.
Thanks for your contribution, Risse!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
----
Top Shelf Modules - Enterprise modules from the community for the community.