Improved internal Modernizr testing function

This commit is contained in:
Brandon Mathis 2012-06-07 13:09:46 -05:00
parent 90029198a4
commit ce9b3cab18

View File

@ -54,12 +54,23 @@ var octopress = (function(){
}); });
} }
, testFeatures: function () { , testFeature: function (features) {
if (Modernizr.testAllProps('maskImage')) { getTestClasses = function (tests) {
$('html').addClass('maskimage') classes = '';
if (typeof(tests.join) == 'function') {
for (var i=0; i < features.length; i++)
classes += getClass(features[i]) + ' ';
} else { } else {
$('html').addClass('no-maskimage') classes = getClass(tests);
} }
return classes;
}
getClass = function (test) {
return ((Modernizr.testAllProps(test) ? test : "no-"+features[i]).toLowerCase())
}
$('html').addClass(getTestClasses(features));
} }
, flashVideoFallback: function (){ , flashVideoFallback: function (){
@ -244,7 +255,7 @@ var octopress = (function(){
$(document).ready(function() { $(document).ready(function() {
octopress.wrapFlashVideos(); octopress.wrapFlashVideos();
octopress.testFeatures(); octopress.testFeature(['maskImage', 'transform']);
octopress.flashVideoFallback(); octopress.flashVideoFallback();
octopress.addCodeLineNumbers(); octopress.addCodeLineNumbers();
octopress.addMobileNav(); octopress.addMobileNav();