mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2024-12-25 00:48:53 -05:00
Improved internal Modernizr testing function
This commit is contained in:
parent
90029198a4
commit
ce9b3cab18
@ -54,12 +54,23 @@ var octopress = (function(){
|
||||
});
|
||||
}
|
||||
|
||||
, testFeatures: function () {
|
||||
if (Modernizr.testAllProps('maskImage')) {
|
||||
$('html').addClass('maskimage')
|
||||
, testFeature: function (features) {
|
||||
getTestClasses = function (tests) {
|
||||
classes = '';
|
||||
if (typeof(tests.join) == 'function') {
|
||||
for (var i=0; i < features.length; i++)
|
||||
classes += getClass(features[i]) + ' ';
|
||||
} 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 (){
|
||||
@ -244,7 +255,7 @@ var octopress = (function(){
|
||||
|
||||
$(document).ready(function() {
|
||||
octopress.wrapFlashVideos();
|
||||
octopress.testFeatures();
|
||||
octopress.testFeature(['maskImage', 'transform']);
|
||||
octopress.flashVideoFallback();
|
||||
octopress.addCodeLineNumbers();
|
||||
octopress.addMobileNav();
|
||||
|
Loading…
Reference in New Issue
Block a user