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.

CommentFileSizeAuthor
#1 2139345-1-modernizr-info.patch558 bytesrupl
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rupl’s picture

FileSize
558 bytes

Here'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 and load. Currently printshiv 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...

rupl’s picture

Status: Active » Needs review
hass’s picture

I 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.

jessebeach’s picture

hass, 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.

hass’s picture

I 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.

jessebeach’s picture

Status: Needs review » Fixed

Committed 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 :)

Status: Fixed » Closed (fixed)

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

rupl’s picture

I 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 ;)