Hello,

jQuery Custom Scrollbar is an official jQuery plugin (http://plugins.jquery.com/custom-scrollbar/), actively maintained.

I created a module with this library embed (which can still be overrided by sites/all/library/jquery-custom-scrollbar if found). As you can see on the screenshot it gives three configuration options to choose pages where the lib files are loaded, selectors for scrollable elements and predefined skins.

I followed most of Drupal coding standard but I did not passed a pareview yet. However I think the module is usable in its current state.

Thanks in advance !

---

With the module enabled, when you go to 'admin/config/user-interface/jquery-custom-scrollbar' it should be self explanatory.

---

Project page: https://drupal.org/sandbox/zenmaster/2151303
GIT Repository : git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ZenMaster/2151303.git jquery_custom_scrollbar

B2F - module contributor, co-maintener of scald_flickr, ajax_chat and maintener of DBDD (Drupal Behavior Driven Development).

---

Reviews of other projects

https://drupal.org/node/2150243#comment-8295525
https://drupal.org/commenta/8487095#comment-8487095
https://drupal.org/comment/8487135#comment-8487135

Comments

PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxZenMaster2151303git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

drupaldev@assyst’s picture

Issue summary: View changes

GIT repository path updated.

ram4nd’s picture

  • Remove the library from your module.
  • Don't split up translatable strings between sentences.
  • Use arguments in translatable strings.

It's a small module, I can't find anything big wrong with it.

b2f’s picture

Status: Needs work » Needs review

Thanks for the review ram4nd !

-) I removed the library from the module
-) gathered translatable string in one variable where needed
-) used arguments for translatable strings variables
-) fixed remaining coding standard issues with pareview.sh
-) fixed minor bugs

I updated and improved the README.txt file and project's page accordingly. I will tag the release as 7.x-1.0 stable when you will mark the project as "Reviewed & tested by the community".

swarad07’s picture

Manual Review

  • You should look into hook_uninstall() to clear all the system variables you are creating. Otherwise if this module is uninstalled, it will leave behind redundant variables in the system table.

Apart from this there is not much I can see wrong in the module. Once the above is rectified this can be set to RTBC.

Cheer,
Swarad

swarad07’s picture

Status: Needs review » Needs work
b2f’s picture

Status: Needs work » Needs review

Hello swarad07, thanks for the review.

I added and tested the .install with variable_del for each used variables. pareview.sh still good.

b2f’s picture

Issue summary: View changes
ram4nd’s picture

Status: Needs review » Needs work
  • query_custom_scrollbar_settings() string translations are completely wrong.
  • Translate form titles.
  • jquery_custom_scrollbar.js - use dot at the end of comment sentence.
  • Fix your text and html with translations it's completely bad: jquery_custom_scrollbar_help.
  • jquery_custom_scrollbar_menu() - pre-define $items to avoid notices.
b2f’s picture

4 new commits.

b2f’s picture

Status: Needs work » Needs review
amreana’s picture

Status: Needs review » Needs work

Overall i like the module, seems clean and simple.
I'd move the jquery-custom-scrollbar/drupal-integration-example link from the admin page from where it is now to a new line so it's more accessible
something like:

Demo Page

klausi’s picture

Status: Needs work » Needs review

That does not sound like an application blocker, any other issues that you found?

amreana’s picture

Status: Needs review » Needs work

Manual Review:

Right now the module only checks for the libraries folder
$library = libraries_get_path('jquery-custom-scrollbar');
but you could add a check for the files required by the module also for:
jquery_custom_scrollbar.js
jquery_custom_scrollbar.css

b2f’s picture

Status: Needs work » Needs review

It's been a while, I have been busy at work lately. Just fixed the last issue. Anything else ?

b2f’s picture

Issue summary: View changes
b2f’s picture

Issue summary: View changes
b2f’s picture

Issue tags: +PAreview: review bonus
gobinathm’s picture

StatusFileSize
new61.99 KB
  1. PAREVIEW.SH: have found issue in your project. You need to fix them. http://git.drupal.org/sandbox/ZenMaster/2151303.git
  2. Git default branch is not set, this needs to be set. Please refer http://drupal.org/node/1659588
  3. Readme.txt file is not documented as per template (https://drupal.org/node/2181737). Might be confusing for beginner level users, hence update this.
  4. Few issues reported by coder module that needs to be addressed.I have attached screenshot : JQUERY_CUSTOM_Scrollbar_coder.png
gobinathm’s picture

Status: Needs review » Needs work
PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

b2f’s picture

Status: Closed (won't fix) » Needs review

@amreana:

Overall i like the module, seems clean and simple.
I'd move the jquery-custom-scrollbar/drupal-integration-example link from the admin page from where it is now to a new line so it's more accessible

-> I moved the demo to the bottom of the config page and improved the help messages, and improved the doc. It seems even cleaner now.

@gobinathm
* pareview.sh errors are fixed (I kept the string literals warning to the possible minimum)
* Git default branch set
* README.txt corrected
* coder issue adressed

Thanks for reviews.

pushpinderchauhan’s picture

Assigned: Unassigned » pushpinderchauhan

Assigning to myself for next review.

pushpinderchauhan’s picture

Assigned: pushpinderchauhan » Unassigned
Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Automated Review

Best practice issues identified by pareview.sh / drupalcs / coder. Yes, http://pareview.sh/pareview/httpgitdrupalorgsandboxzenmaster2151303git reported some minor issues that need to be address.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and fragmentation. Scrollbar seems something similar but using different js plugin so considering this module as separate module.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. If "no", list security issues identified.
Coding style & Drupal API usage
  1. (*) jquery_custom_scrollbar_help(): Help link is broken because of invalid path. Instead of case JQUERY_CUSTOM_SCROLLBAR_CONFIG_PATH:, it should be case 'admin/help#jquery_custom_scrollbar':. Why this help string broken across lines, also $h variable name not convincing here. You can keep this into a single line and simply return it.
  2. jquery_custom_scrollbar_menu(): The administration menu callback should probably use "administer site configuration" - which implies the user can change something - rather than "access administration pages" which is about viewing but not changing configurations. A separate permission would be good, too.

    Why you defining constant variables, comment needed?

    define('JQUERY_CUSTOM_SCROLLBAR_CONFIG_PATH', 'admin/config/user-interface/jquery-custom-scrollbar');
    define('JQUERY_CUSTOM_SCROLLBAR_SOURCE', 'https://github.com/mzubala/jquery-custom-scrollbar');
  3. (+) jquery_custom_scrollbar_page_build(): Checking pages visibility logic is not working as expected. Say If I have node with nid 4 and alias is 'test-page'. Then it works if I put 'test-page' under Pages (one per line) but not in case I put node/4. Can't we implement this for both cases as other drupal modules also work in similar way. Better to to look at the function drupal_match_path which will make your implementation a little easier. It would also help to resolve my other concern :)
  4. (+) jquery_custom_scrollbar_page_build(): Missing &$page param, See https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func....
  5. (+) jquery_custom_scrollbar_settings(): Don't split up translatable strings between sentences.
    $select_desc = 'The scrollable element must have fixed dimensions or ';
      $select_desc .= 'max-width, or max-height properties set.<br/>';
      $select_desc .= 'Given that fact, it won\'t work on a dynamic body element.';

    Some form elements missing default value for variable_get();, adding default value would be good something like variable_get('jquery_custom_scrollbar_pages', ' ');

  6. (+) jquery_custom_scrollbar_library(): Wrong comment The library is found in sites/all/library/jquery-custom-scrollbar, should be sites/all/libraries/jquery-custom-scrollbar.
  7. jquery_custom_scrollbar_page_build(): Using #attached is preferred over drupal_add_js(). See https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...
  8. (+) jquery_custom_scrollbar_page_build(): Wrong check_plain() at line 83 drupal_set_message(check_plain($err), 'error', FALSE);, @dir, would probably be a better choice, since @ does a check_plain for you. As there is no value coming from user input, don'think there is need of check_pain().
  9. (+) jquery_custom_scrollbar_page_build(): Wrong filter_xss() at line 84 drupal_set_message(filter_xss($link), 'error', FALSE);, as there is no value coming from user input, even don't any dynamic value populating in this message.
  10. (+) jquery_custom_scrollbar.js(): Missing semicolon(;) at line 16.

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

spheresh’s picture

Status: Closed (won't fix) » Needs review

It is a useful module. I think work must go on

I added a little patch fot it https://www.drupal.org/node/2398505#comment-9462109

klausi’s picture

Status: Needs review » Closed (won't fix)

The maintainer did not respond to issue raised by @er.pushpinderrana yet, so this application is closed until we hear back from the maintainer.

b2f’s picture

Assigned: Unassigned » b2f
Priority: Normal » Major
Status: Closed (won't fix) » Active

Hey, thanks for the support spheresh. At least someone is interested for this to get out of sandbox... I'll fix these issues soon then I'll merge your mobile detect module patch in the stable release.

b2f’s picture

Priority: Major » Normal
Status: Active » Reviewed & tested by the community

Today I pushed some commits to adress er.pushpinderrana's issues:

1. (*) jquery_custom_scrollbar_help(): Help link is broken because of invalid path. Instead of case JQUERY_CUSTOM_SCROLLBAR_CONFIG_PATH:, it should be case 'admin/help#jquery_custom_scrollbar':. Why this help string broken across lines, also $h variable name not convincing here. You can keep this into a single line and simply return it.

hook_help Fixed

2. jquery_custom_scrollbar_menu(): The administration menu callback should probably use "administer site configuration" - which implies the user can change something - rather than "access administration pages" which is about viewing but not changing configurations. A separate permission would be good, too.

The permission already is "administer site configuration".

Why you defining constant variables, comment needed?
define('JQUERY_CUSTOM_SCROLLBAR_CONFIG_PATH', 'admin/config/user-interface/jquery-custom-scrollbar');
define('JQUERY_CUSTOM_SCROLLBAR_SOURCE', 'https://github.com/mzubala/jquery-custom-scrollbar');

I used constants to keep lines short and easier to read, it also make it a little easier to update these text if needed. Anyway, it is not a bad practice especially with the JQUERY_CUSTOM_SCROLLBAR prefix avoiding name clashes...

(+) jquery_custom_scrollbar_page_build(): Checking pages visibility logic is not working as expected. Say If I have node with nid 4 and alias is 'test-page'. Then it works if I put 'test-page' under Pages (one per line) but not in case I put node/4. Can't we implement this for both cases as other drupal modules also work in similar way. Better to to look at the function drupal_match_path which will make your implementation a little easier. It would also help to resolve my other concern :)

Done, Thanks for that is a nice improvement.

(+) jquery_custom_scrollbar_page_build(): Missing &$page param, See https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func....

Ok

(+) jquery_custom_scrollbar_settings(): Don't split up translatable strings between sentences.
$select_desc = 'The scrollable element must have fixed dimensions or ';
$select_desc .= 'max-width, or max-height properties set.
';
$select_desc .= 'Given that fact, it won\'t work on a dynamic body element.';
Some form elements missing default value for variable_get();, adding default value would be good something like variable_get('jquery_custom_scrollbar_pages', ' ');

Ok

(+) jquery_custom_scrollbar_library(): Wrong comment The library is found in sites/all/library/jquery-custom-scrollbar, should be sites/all/libraries/jquery-custom-scrollbar.

Ok

jquery_custom_scrollbar_page_build(): Using #attached is preferred over drupal_add_js(). See https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.h...

The #attached attribute is not officially available for render arrays other than form, as far as I know because it's not in the doc. However there is a new hook_process_attached for Drupal 8, not 7. So I'll stick to drupal_add_js.

(+) jquery_custom_scrollbar_page_build(): Wrong check_plain() at line 83 drupal_set_message(check_plain($err), 'error', FALSE);, @dir, would probably be a better choice, since @ does a check_plain for you. As there is no value coming from user input, don'think there is need of check_pain().
(+) jquery_custom_scrollbar_page_build(): Wrong filter_xss() at line 84 drupal_set_message(filter_xss($link), 'error', FALSE);, as there is no value coming from user input, even don't any dynamic value populating in this message.
(+) jquery_custom_scrollbar.js(): Missing semicolon(;) at line 16.

Ok !

Back to reviews, I'm setting this to "Reviewed & tested by the community", first because we had it in prod for almost a year now, then amreana and spheresh provided positive feedbacks and I improved it, fixed a lot of minor issues to the point where it seems ridiculous to add more, most of it wasn't an application blocker anyway I fixed it.

Thanks in advance.

pushpinderchauhan’s picture

Assigned: b2f » pushpinderchauhan

Assigning to myself for next review, which will hopefully be tonight.

pushpinderchauhan’s picture

Automated Review

Best practice issues identified by pareview.sh / drupalcs / coder. Yes reported some minor issues that can be false.

Review of the 7.x-1.x branch (commit df4b7aa):

FILE: /var/www/drupal-7-pareview/pareview_temp/jquery_custom_scrollbar.module
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
22 | WARNING | Only string literals should be passed to t() where possible
72 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

FILE: ...r/www/drupal-7-pareview/pareview_temp/jquery_custom_scrollbar.admin.inc
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
28 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------

Manual Review

In general, using #attached is preferred over drupal_add_js().

But that are not critical application blockers, otherwise I think this is RTBC.

Nothing major jumped out at me when I read `git diff 16c3809..`. Assigning to mpdonadio for a second look if he has time.

mpdonadio’s picture

Review of the 7.x-1.x branch (commit 16c3809):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
  • DrupalPractice has found some issues with your code, but could be false positives.
    
    FILE: /home/matt/PAR/pareview_temp/jquery_custom_scrollbar_example.tpl.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     1 | WARNING | No PHP code was found in this file and short open tags are not
       |         | allowed by this install of PHP. This file may be using short
       |         | open tags but PHP does not allow them.
    --------------------------------------------------------------------------------
    
    Time: 98ms; Memory: 4.25Mb
    
  • DrupalSecure has found some issues with your code (please check the Writing secure core handbook).
    
    
    FILE: /home/matt/PAR/pareview_temp/jquery_custom_scrollbar_example.tpl.php
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     1 | WARNING | No PHP code was found in this file and short open tags are not
       |         | allowed by this install of PHP. This file may be using short
       |         | open tags but PHP does not allow them.
    --------------------------------------------------------------------------------
    
    Time: 65ms; Memory: 3.75Mb
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

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. You have to get a review bonus to get a review from me.


FILE: /home/matt/PAR/pareview_temp/jquery_custom_scrollbar.admin.inc
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 28 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------


FILE: /home/matt/PAR/pareview_temp/jquery_custom_scrollbar.module
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 22 | WARNING | Only string literals should be passed to t() where possible
 72 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------


FILE: /home/matt/PAR/pareview_temp/jquery_custom_scrollbar_example.tpl.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | WARNING | No PHP code was found in this file and short open tags are not
   |         | allowed by this install of PHP. This file may be using short
   |         | open tags but PHP does not allow them.
--------------------------------------------------------------------------------

Time: 209ms; Memory: 6.25Mb

Manual Review

jquery_custom_scrollbar_settings(), avoid breaking translatable strings scross lines. It makes translation harder. Also elsewhere.

(+) Your JS behavior should use the context that gets passed in to make it AJAX friendly. I think you may also need a .once() on this for the same reason.

In jquery_custom_scrollbar_page_build(), drupal_get_path() is preferred to get the module path.

Avoid !placeholders unless you are *positive* they need to be unsanitized.

Not a huge fan of setting variables, and then using these as the first argument to t(). This is not a common pattern in Drupal.

Think of ways you can validate jquery_custom_scrollbar_selectors. Not sure if this will be 100% possible, though.

Not seeing any blocking issues.

mpdonadio’s picture

Assigned: mpdonadio » Unassigned
Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, B2F!

I updated your account so you can 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 stay 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.

b2f’s picture

Status: Fixed » Closed (fixed)

Thanks ! Happy new year 2015 to all following this thread.