Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up of #1664940: [Policy, patch] Decide on JSHint configuration and part of #1415788: Javascript winter clean-up
Run jshint on the files with the configuration from the parent issue or use jshint.com with the following options:
/*jshint forin:true, noarg:true, eqeqeq:true, undef:true, curly:true, browser:true, expr:true, latedef:true, newcap:true, trailing:true */
/*global Drupal, jQuery */
Fix any warnings or errors the tool finds.
Check manually that the fixes did not break any functionalities
Create patch and upload for the testbot.
Files: color/color.js, color/preview.js
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff.txt | 885 bytes | tim.plunkett |
#3 | drupal-1684830-3.patch | 9.31 KB | tim.plunkett |
#2 | core-js-jshint-color.patch | 8.29 KB | nod_ |
Comments
Comment #1
nod_Comment #2
nod_Fix all, works.
Comment #3
tim.plunkettI was working on this patch earlier but forgot to upload, I had almost exactly the same thing, but I copied the closure from drupal.js and fixed indentation. If that's out of scope, then #2 is RTBC.
The interdiff is with -w to hide indentation changes.
Comment #4
tim.plunkettIn #1684906: Drupal.progressBar is a constructor, rename it Drupal.ProgressBar there is a change from Drupal.progressBar to Drupal.ProgressBar, should this be Drupal.Color?
Comment #5
nod_Drupal.color is never used as a constructor (it's already an object) so we can't capitalize it. I feel like the closure thing goes overboard. $: yes, Drupal: yes, the rest: not so much.
And that'll make things weird when we'll go towards a module achitecture. So I'd rather not put that with this patch.
Comment #6
tim.plunkettOkay, so RTBC for #2 for me. Thanks for the explanation, nod_.
Comment #7
catchCommitted/pushed to 8.x, thanks!