This module will allow you to set a screen lock showing a spinner when the user clicks on an element that triggers a time consuming task.

The module will work amazingly in cases where, for example, the user submits a form that takes a long time to post and stays in the current page avoiding the submitter the chance to poke around the page while waiting.

To configure the behavior of this module go to admin/config/user-interface/page_load_progress. The last field, "Elements that will trigger the throbber", takes HTML elements, classes or ids, separated by commas, and assigns the behavior when they are clicked.

Link to project: http://drupal.org/sandbox/mariano/1425040

Currently only for Drupal 7, if approved, will backport to Drupal 6.

Url for git clone: http://git.drupal.org/sandbox/mariano/1425040.git

Thanks!

Comments

patrickd’s picture

Status: Needs review » Needs work
Issue tags: +PAreview: single application approval

Welcome!

This is kind of cool :-)

I'm wondering if there are already similar modules, didn't found something so far..

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.

I don't think that your modules settings are that relevant that they need their own permission, access admin pages permission would be enough, but okay

// replace this true with a check to the global variable that enables the module
Aww, a global variable? you should avoid that

your indenting is kind of chaotic, please bring more structure into your code

if ($enabled) {
    
    drupal_add_js(drupal_get_path('module', 'page_load_progress') . '/js/page_load_progress.js');
    drupal_add_css(drupal_get_path('module', 'page_load_progress') . '/css/page_load_progress.css');

If we assume that the module is enabled, it is probably desired to have its main functionality
I'd suggest you to remove that $enabled setting and put these files into your .info file

the way you define your settings form is kind of "ugly" please have a look on other modules/core modules how they're doing it more nicely
You're also using some form parameters that are not necessary, please don't declare default stuff
'#access' => 1, use TRUE and FALSE for booleans, numbers are harder to read and not very clearly

As your module contains only a few lines of relevant code and there is not much to review, I'd suggest a single project promotion for it.

Mariano’s picture

Hey, patrickd, thanks for getting to this so quickly. I couldn't find any other module to do this either, and that was the reason for writing this one.

I've moved the project to a 7.x-1.x branch. I've also committed a set of fixes for many of the problems you pointed, including the usage of the info file for js and css files and getting rid of the enabled option and assuming the user means to enable the functionality as soon as they enable the module.

Please let me know if there are any further steps that I should take to see this out in the wild ;)

rogical’s picture

This module makes sense and tested well.

Some suggestions:
1. let users input element is not a very good user experience, it would be better if there's just a setting, eg: enable on node/add, node/%/edit etc.
2. able to style the lock screen, some gifs, some notes which looks more comfortable.

rogical’s picture

BTW:
See this which can speed up review process - Review bonus

rogical’s picture

Status: Needs work » Needs review

Needs return to review

Mariano’s picture

rogical, thanks for the input!

I want to get it out there and kind of see what requests show up in the queue before I implement these improvements. I was envisioning the same, having a couple throbber options, and maybe some pre-set css selectors where to add the behavior, but more as future versions as I keep working on it.

Thanks again!!
Mariano

Jalandhar’s picture

Status: Needs review » Needs work

Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards).

FILE: ...al-7-pareview/sites/all/modules/pareview_temp/test_candidate/README.txt
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
45 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: ...tes/all/modules/pareview_temp/test_candidate/css/page_load_progress.css
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
9 | ERROR | Whitespace found at end of line
25 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: ...sites/all/modules/pareview_temp/test_candidate/js/page_load_progress.js
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Whitespace found at end of line
36 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: ...s/all/modules/pareview_temp/test_candidate/page_load_progress.admin.inc
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
24 | ERROR | Array indentation error, expected 4 spaces but found 6
24 | ERROR | Array closing indentation error, expected 4 spaces but found 6
27 | ERROR | Whitespace found at end of line
37 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: ...ites/all/modules/pareview_temp/test_candidate/page_load_progress.module
--------------------------------------------------------------------------------
FOUND 10 ERROR(S) AFFECTING 9 LINE(S)
--------------------------------------------------------------------------------
2 | ERROR | Missing file doc comment
5 | ERROR | Whitespace found at end of line
25 | ERROR | Whitespace found at end of line
37 | ERROR | Whitespace found at end of line
40 | ERROR | Whitespace found at end of line
42 | ERROR | Array indentation error, expected 4 spaces but found 16
43 | ERROR | Array indentation error, expected 4 spaces but found 16
43 | ERROR | Whitespace found at end of line
44 | ERROR | Array closing indentation error, expected 2 spaces but found 14
47 | ERROR | Files must end in a single new line character

Mariano’s picture

@Jalandhar thanks for the test, I've fixed the code to get rid of these errors, and committed to my current 7.x-1.x branch. Thanks!

Mariano’s picture

Status: Needs work » Needs review
lukas.fischer’s picture

Some super minor things found via http://ventral.org/pareview/httpgitdrupalorgsandboxmariano1425040git

FILE: ...tes/all/modules/pareview_temp/test_candidate/css/page_load_progress.css
--------------------------------------------------------------------------------
FOUND 5 ERROR(S) AFFECTING 5 LINE(S)
--------------------------------------------------------------------------------
3 | ERROR | Multiple CSS properties should be listed in alphabetical order
6 | ERROR | Multiple CSS properties should be listed in alphabetical order
8 | ERROR | Multiple CSS properties should be listed in alphabetical order
20 | ERROR | Multiple CSS properties should be listed in alphabetical order
23 | ERROR | Multiple CSS properties should be listed in alphabetical order
--------------------------------------------------------------------------------

FILE: ...s/all/modules/pareview_temp/test_candidate/page_load_progress.admin.inc
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
20 | ERROR | Array indentation error, expected 6 spaces but found 4
21 | ERROR | Array indentation error, expected 6 spaces but found 4
22 | ERROR | Array indentation error, expected 6 spaces but found 4
23 | ERROR | Array indentation error, expected 6 spaces but found 4
--------------------------------------------------------------------------------

FILE: ...ites/all/modules/pareview_temp/test_candidate/page_load_progress.module
--------------------------------------------------------------------------------
FOUND 3 ERROR(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
11 | ERROR | Additional blank line found at the end of doc comment
31 | ERROR | Additional blank line found at the end of doc comment
43 | ERROR | Additional blank line found at the end of doc comment
--------------------------------------------------------------------------------

lukas.fischer’s picture

Status: Needs review » Needs work

I played around with the functionality and manually reviewed the code. For me it looks very clean and simple. I had one non-technical issue: When I installed the module, I assuemd that the spinner will appear on every click. I haven't found an info anywhere that I HAVE TO set a class or id. I would highly recommend to add some hints in the config screen description or even add .form-submit by default. Also I would refer to the Readme.txt where you actually explain the caevats.

Oh, I found in page_load_progress.admin.in the line * Admin settings forms for progressive_registration. I assume the module would be called "page load progress". Maybe it's a doc line from an older version.

Mariano’s picture

Status: Needs work » Needs review

Lukas, thanks for the review!
I've fixed the comment and implemented .form-submit as the default value for the classes field.

Regards!
Mariano

scot.hubbard’s picture

Hi Mariano,

I have just been testing this module and I have to say, it is very nice!

There are still some minor issues being picked up by http://ventral.org/pareview/httpgitdrupalorgsandboxmariano1425040git, but I don't see why these should hold up this project.

My only suggestion would be to add the line...

configure = admin/config/user-interface/page_load_progress

...to your .info file. Doing this will make the configuration page link available on the modules list admin page, so as soon as the end user has enabled your module, they can scan back down the list and click straight to your config page.

Well done... nice module :-)

Mariano’s picture

@scot.hubbard awesome suggestion! I've just committed the change so we should be good to roll :D

EDIT: I also just committed the fixes for the small code styling issues...

scot.hubbard’s picture

Status: Needs review » Reviewed & tested by the community

This is looking good to me now and I think it's RTBC.

Just a couple of small suggestions...

In hook_menu the final section of your path (page_load_progress) uses underscores, whereas the 'norm' in Drupal seems to be to use hypens (page-load-progress). However, I am not going to let that stop it being RTBC. If you do change the path, don't forget to change the configure link in the .info file!

While it is quite simple, there is no documentation in your .js file (this should be documented as per any module file, @file block etc).

Mariano’s picture

Very valid suggestions and easy enough. I just committed the changes. Thanks for bumping the status!

klausi’s picture

Status: Reviewed & tested by the community » Fixed

Sorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.

manual review:
You shoudl implement hook_uninstall() to remove your variables.

But that is just a minor issue, so ...

Thanks for your contribution, Mariano! Welcome to the community of project contributors on drupal.org.

I have promoted this project for you: http://drupal.org/project/page_load_progress

Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.

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.

As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.

Thanks to the dedicated reviewer(s) as well.

Mariano’s picture

Cool! thanks klausi, and thanks all for your reviews and feedback!

Automatically closed -- issue fixed for 2 weeks with no activity.