Name: Viewport.
Drupal core version: 7.x
Project Page: http://drupal.org/sandbox/slv/1490000
GIT Repo: http://git.drupal.org/sandbox/slv/1490000.git
--------------------------------------------------
The viewport module allows users (which will be mostly administrators) to add a viewport tag () to the HTML Header of a drupal site, for a certain set of pages that can be selected using a textarea in a configuration page. The configuration page allows the user to select the desired values for the viewport properties (like max-width, minimum-scale, maximum-scale, user-scalable, etc).
This is useful when you want to have, for example, an embedded game into a page, that requires specific settings in order to be displayed correctly on smartphones or tablets, specially if the needed values are not known in advance, and these have to be figured out on a live site (making it easier for testing purposes than if the site was in a local computer, as the devices can check the page like any other site).
I haven't spotted any module doing this at the time being, and because of previous situations in which I've had to do a lot of testing on the fly on a non-local site (and not having all the required testing devices), I think that having a UI from which these values can be altered, is quite a handy tool.
Omega theme also allows users to set a viewport tag, but the values allowed for the properties are less flexible, and this is done in a site-wide fashion, instead of only for a certain set of pages. Also, I think this can be a nice tool to have as a separate module, in order to not make it theme-dependent.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | viewport.txt | 1.52 KB | soncco |
| #3 | viewport.txt | 3.6 KB | soncco |
Comments
Comment #1
bvanmeurs commentedHi Thorin, overall your module looks very good.
Handy when implementing responsive designs!
Some little issues I saw when reviewing:
- no help text in viewport_help. You might refer to some external website with more info about viewports.
- no validation of any of the variables. This may be a design decision, but why not checking values such as viewport_initial_scale, viewport_minimum_scale, etc? You can make your interface more user-friendly in that way, and decrease the chance of errors. At least check for the existence of comma's, as it seems that it would break the meta tag content in viewport_preprocess_html in viewport.module. Even though this is unlikely to happen assumptions are usually bad.
- A tiny grammatical thingy: 'the same value than the' should be 'the same value as the'. Thumbs up for some good descriptions of the values to be set overall. In general your language and descriptions are clear and helpful.
- In viewport.module line #87, use current_path instead of $_GET['q']. This wrapper function does the same, but is there to decrease coupling and should be used.
Regards,
Bas
Comment #2
bvanmeurs commentedOne more thing Thorin, can you make a separate branch for the drupal 7 version? So that your branch is not 'master' but '7.x-1.x'?
Comment #3
soncco commentedIt 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:
Comment #4
slv_ commentedHi bvanmeurs and soncco,
First of all, thanks a lot for taking your time for reviewing the module. I've been working through the suggestions (which were really helpful to remind me of a few things I'd forgotten!), and hopefully will be pushing the last commit to fix them all later in the day:
At the time being, there are only 3 things remaining:
Will comment here again when that stuff is pushed. Thanks again!
Comment #5
soncco commentedThanks to you thorin_edr :)
I found some minor issues in the code.
There are still files other than README.txt in the master branch, make sure to remove them. See also step 5 in http://drupal.org/node/1127732. In other words your master branch should be empty.
Please check attachment for Coding Standards or http://ventral.org/pareview/httpgitdrupalorgsandboxslv1490000git-7x-1x.
My personal observations:
¡Vamos amigo falta poco!
Comment #6
slv_ commentedooK guys =),
Just pushed the latest changes. I think everything is covered now.
Added README.txt
Did minor tweaks to comments and inline documentation.
Added basic validation of variables on the settings form. Is probable that I add something more complete in future enhancements, but think it's ok for now, given there are clear instructions on how to enter the values.
Completed the Help page with some resources and info.
I've removed the data type from the docs, although this is now something adopted for Drupal 8. Think is useful when using certain IDE's, though, but I've removed it anyways.
Thanks for the comments again, hope this wraps everything =).
Comment #7
slv_ commentedActually, forgot to change the status to needs review ;)
Comment #8
soncco commentedHello @thorind_edr:
In my manuel review I found minor coding issues on viewport.admin.inc, for more please use http://ventral.org/pareview to check and fix it.
Comment #9
slv_ commentedHi again,
I was getting on that review, 2 coding style issues for documentation which collides directly with what you told me on #5:
I've edited and pushed it, though, and taken the data types back so that the ventral.org doesn't throw any issues regarding that (should be ok even if it wasn't standard for Drupal 7, as it's adopted for Drupal 8.
Right now, http://ventral.org/pareview/httpgitdrupalorgsandboxslv1490000git is displaying two critical warnings, but are that, warnings. The text I'm displaying through a t() function is all static, hard-coded text, and is not using any kind of user-provided variable, so it's definitely not something to worry about :).
Hope those are the same issues you are mentioning.
Comment #10
anwar_maxHi,
You are already using t() function here.
You can remove
t() function from line #78
'#description' => t($path_patterns_description),Comment #11
slv_ commentedTrue! Stupid fail of mine :P
Fixed and pushed to the repo, thanks =)
Comment #12
soncco commentedYou have not listed any reviews of other project applications in your issue summary as strongly recommended here: http://drupal.org/node/1011698
Comment #13
slv_ commentedHi again,
I understand that last thing is optional (although very recommended), and I really appreciate the work you and some other reviewers are doing on this Project applications issue queue. Unfortunately, right now I lack the time to do that outside of work. I've spent some time through the issue queue looking for some small modules that need any kind of review, so I can contribute a little bit in that way too, but haven't found such modules until now.
However, in the understanding that the Project application reviews are there to have some control on the contributed code, and to ensure that contributors have some minimum coding skills and are not pushing any unsafe code (and won't do in the future), I don't see the way in which not having a few reviews of other people's modules could / should prevent a module from getting the full project perms, (assuming its code is already tested and working fine).
Given that, I'll be glad to try and review some stuff from the issue queue if the chance arises and I can really afford to work on that properly, but I can't say I'll be able to do that for sure.
Cheers!
Comment #14
lukas.fischer commentedIf I checkout http://git.drupal.org/sandbox/slv/1490000.git, my local copy is empty.
Comment #15
slv_ commentedHello Lukas,
I guess you are trying to clone from master branch (not sure though), try this:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/slv/1490000.git viewport
That should definitely set you up and running with all the project's code
Comment #16
bvanmeurs commentedI just did another manual & automatic review of this module.
The automatic review showed two 'criticals' but these proved to be false positives after manual review. These can be prevented by moving the value of $path_patterns_description to $form['viewport']['viewport_selected_pages']['#description'] directly. I would think this is a good thing to do anyway, as the descriptive text is now somewhere in the top of the function; it is more logical to put it right where it's necessary only. However, this is a tiny issue.
Overall I think all the correct fixes have been applied. Code is safe, well documented and clean, and the user showed that he has the appropriate knowledge to build modules with good code quality.
Now it's up to someone who can to give this user the 'create full projects' permission.
Comment #17
klausiYou have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
manual review of the 7.x-1.x branch:
But that are just minor issues, so ...
Thanks for your contribution, thorin_edr! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
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.
Comment #18
slv_ commentedThanks again bvanmeurs and klausi for your last comments. I'll fix those bits on the next commit for sure.
Also, thanks for taking the time to review the module. Not an easy task even if you are willing to do, and hard to find time sometimes!
Cheers guys =).