Created
February 18, 2014 11:08
-
-
Save hnrch02/9068888 to your computer and use it in GitHub Desktop.
Blob feature detection with jQuery (see https://github.com/twbs/bootstrap/pull/12773)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+function() { | |
/** | |
* Based on: | |
* Blob Feature Check v1.0.0 | |
* https://github.com/ssorallen/blob-feature-check/ | |
* License: Public domain (http://unlicense.org) | |
*/ | |
var url = window.webkitURL || window.URL // Safari 6 uses "webkitURL". | |
var svg = new Blob( | |
['<svg xmlns="http://www.w3.org/2000/svg"></svg>'], | |
{ type: 'image/svg+xml;charset=utf-8' } | |
) | |
$('<img>') | |
.on('error', function() { | |
$('.bs-docs-section, .bs-docs-sidebar').css('display', 'none') | |
showCallout('Looks like your current browser doesn\'t support the Bootstrap Customizer. Please take a second ' + | |
'to <a href="https://www.google.com/intl/en/chrome/browser/">upgrade to a more modern browser</a>.', true) | |
}) | |
.on('load', function() { | |
$compileBtn.prop('disabled', false) | |
}) | |
.attr('src', url.createObjectURL(svg)) | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment