Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I noticed that the Navbar project page provides instructions for downloading a custom Modernizr build, which included the following tests:
http://modernizr.com/download/#-inputtypes-svg-touch-cssclasses-addtest-teststyles-prefixes-elem_details
You can optionally integrate with the Modernizr module and implement its hook that allows you to declare HTML5 dependencies:
/**
* Implements hook_modernizr_info().
*/
function navbar_modernizr_info() {
return array('inputtypes','svg','touch','elem_details');
}
When the Modernizr module is used to rebuild the library, your required tests will be automatically included.
Comment | File | Size | Author |
---|---|---|---|
#1 | 2139345-1-modernizr-info.patch | 558 bytes | rupl |
Comments
Comment #1
ruplHere's a patch with the basic hook implemented. I'll leave it to you to determine whether more of the utilities need to be in there, but just note that the Modernizr module will always guarantee
cssclasses
andload
. Currentlyprintshiv
is also guaranteed but I've decided that's not always the best idea for all users.http://drupalcode.org/project/modernizr.git/blob/refs/heads/7.x-3.x:/mod...
Comment #2
ruplComment #3
hass CreditAttribution: hass commentedI guess this will not stop our hook_requirement() from complaining that the library is missing, isn't it? I really hope we are not going to require modernizr module for navbar.
Comment #4
jessebeach CreditAttribution: jessebeach commentedhass, what is your objection to the Modernizr module? It seems it might solve some of the setup issues that folks have with Navbar. I mean that they need to go get a copy of the library and copy it into their site.
Comment #5
hass CreditAttribution: hass commentedI do not like modernizr and try to keep everything out that is not required. Also bevause of the file size people need to download. Navbar uses only a very limited set of modernizr and this changes this and adds a lot of code. I with we do not require modernizr personally and do all with jquery only. You should not require other less popular modules if there is no real need and here I must say, there is no need at all and the hook_requirement issue seems not solvable, too. I'm not a fan of this.
Comment #6
jessebeach CreditAttribution: jessebeach commentedCommitted the info hook patch c42b8d22.
I'm not making Navbar depend on Modernizr because Modernizr depends on Node.js to do the package downloading. So, if someone wants to use Modernizr with Navbar, they can, but the previous approach of simply downloading the custom library still applies.
I hope that splits the lemon evenly :)
Comment #8
ruplI never meant to suggest that the Modernizr module be a dependency in order to use Navbar, rather that users of the Modernizr module benefit from the integration that Jesse already committed in comment #6.
Thanks, Jesse, I'd say the lemon is split just fine ;)