This module enables forms on the core Block configuration pages with select options for a parallax scrolling effect. Options include No Effect, Same Direction, and Opposite Direction. Background image is currently set with CSS.

Future updates will include image field that will upload an image and generate a CSS file with the appropriate background-images for each block with an applied image.

Drupal Repo:

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/mattcoker/2213071.git parallax_block
cd parallax_block

BitBucket Git Repo: https://bitbucket.org/mattcoker/parallax-block

Link to Sandbox Project: https://drupal.org/sandbox/mattcoker/2213071

PAreview.sh: http://pareview.sh/pareview/httpgitdrupalorgsandboxmattcoker2213071git

=============

PAReview: Reviewed 3 modules

https://drupal.org/node/2221631#comment-8862907
https://drupal.org/node/2237631#comment-8862885
https://drupal.org/node/2281943#comment-8862837

Comments

gaetanp’s picture

Status: Needs review » Reviewed & tested by the community

Look clean and simple.
Maybe you could add some inline comments, but the code is quite self-explenatory.

mattcoker’s picture

Updated with new inline comments throughout .install, .js and .module files with additional details about flow of module.

mattcoker’s picture

Is there anything further I can do to advance this sandbox to a full project other than become a module reviewer/tester? I have not received any input since I made some documentation changes to the module and the status initially changed.

mattcoker’s picture

Priority: Normal » Major
mattcoker’s picture

Priority: Major » Normal
mattcoker’s picture

Priority: Normal » Major
mattcoker’s picture

Can someone please tell me what is holding this module up from being approved?

ergonlogic’s picture

Hi Matt,

This looks like a neat module, providing a pretty striking visual effect.

It seems that the core File field is required, but not declared as a dependency. You might also want to consider adding a .gitignore, so that you don't include files such as .DS_Store.

Here are a couple (very minor) issues raised by the coder_review:

parallax_block.module
Line 38: Functions should be called with no spaces between the function name and opening parentheses [style_function_spacing]
    $form['settings']['parallax'] = array (
Line 82: Arrays should be formatted with a space separating each element and assignment operator [style_array_spacing]
      '#description'=> t('This field is the CSS value for the background size of this parallax item.
Acceptable values are None, Cover, Contain, or percentages/pixels in the form of "200px" and "200%".
If the effect is not working, try altering this value.'), parallax_block.js File: @file block missing (Drupal Docs) [comment_docblock_file]

None of those should be considered blockers to accepting this application, imho. They're simply typos, in otherwise very clean code.

As for the delay in getting your application approved, you might want to check out the "Review bonus" page. Priority is given to those that, in turn, help reviewing others' applications.

mattcoker’s picture

Cleaned up all of the issues I could find through PAReview, and fixed some issues with unset values.

Also have reviewed three modules for PAReview Bonues.

mattcoker’s picture

Issue tags: +PAreview: review bonus

Reviewed 3 modules for PAReview Bonus

mattcoker’s picture

Issue summary: View changes
gboudrias’s picture

This module works and should be accepted.

I have 2 suggestions though:

  • Capitalize "none" for the sake of consistency with most modules
  • Make the value optional and default to "None" in the callback, I think other modules do that as well

Good code.

mpdonadio’s picture

Issue summary: View changes

Added link to repo on drupal.org; added link to PAreview.sh

mpdonadio’s picture

Status: Reviewed & tested by the community » Needs work

Automated Review

OK; false positive.

Manual Review

(+) It looks like since you made your module, a different version came out: https://drupal.org/project/parallax
Look into how your is different, and update the project page.

(*) Project page mentions that it works with standard Drupal 7, but README mentions jQuery 1.7. This really needs to be fixed
before I can RTBC this. Personally, I would have a dependency on jQuery update.

(*) I think the project page could use some more details. Mirroring the info from the README would be a good start.

(+) Why does the JS behavior also use a $(document).ready(), which is inside an implicit $(document).ready()?

(+) The JS should use the context that is passed into the behavior. This may mean refactoring the call to enableParallax().

(+) The JS should probably also use .once() to make this AJAX friendly.

I don't think I have seen the schema alter called the way you do in the .install file.

The entry in the Drupal 7 API is template_preprocess_block; it's not a theme function.

(+) Your File API usage in the block preprocess is a little wrong. Using file_create_url() on a directory name
to get the path is a side effect that is not safe. You need to use this on the full URI w/ the filename to make
sure the hooks get invoked properly. Your implementation may have problems with the CDN module, or other
modules that alter outbound URLs.

It's best to avoid markup in t() if you can.

You probably want a validation on $form['settings']['parallax']['background_size'];

(+) The JS is being added to every page. Current best practice is to use #attached whenever possible. You can
probably do this in a hook_block_view_alter() instead of specifying in the .info file.

The starred (*) issues are blockers here (see section 5.1 of https://drupal.org/node/1587704). The plussed (+)
issues are fairly big ones, but not blockers.

mattcoker’s picture

Status: Needs work » Needs review

Update!

I have gone through and made most of the changes listed.

I could not find how to use #attached in hook_block_view_alter(), there was plenty of documentation on using it with the Form API but almost nothing for how to include this in a block. Could someone share how I could do this? Right now, I am checking to see if a block being rendered has a parallax value assigned, and if so, then the JS file is included with the page using the typical drupal_add_js.

Also, where is the documentation on the .once() JavaScript function? I can't find references to it, just .one(). To be honest, my JavaScript is not my strongest area, and would greatly appreciate it if someone could show me how this could be included to make it AJAX friendly.

I appreciate all the recommendations!

klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)

This sounds like a feature that should live in the existing parallax project. Module duplication and fragmentation is a huge problem on drupal.org and we prefer collaboration over competition. You said that the other project was deprecated anyway, so this is the perfect opportunity to take it over. Please open an issue in the parallax issue queue to discuss what you need. You should also get in contact with the maintainer(s) to offer your help to move the project forward. If you cannot reach the maintainer(s) please follow the abandoned project process.

If that fails for whatever reason please get back to us and set this back to "needs review".

mattcoker’s picture

Status: Postponed (maintainer needs more info) » Postponed

I'm back! So I tried getting in contact with the owner of the module. Seems like he is just wanting people to contribute to the module, then he will update, and continue to keep it in "Unsupported mode". Not cool, in my opinion.

I have begun the process of trying to attain ownership of the module regardless, and further information can be found here: https://www.drupal.org/node/2291419

I will update the status of this issue once I have more information.

mattcoker’s picture

Status: Postponed » Closed (fixed)

I have been instated as the module owner for the Parallax blocks module (http://drupal.org/project/parallax) and will be soon rolling the functionality of my code into version 2.0 of the module. As such, this issue is now closed.