mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
use @ssorallen's blob support test in customizer; fixes #12617
This commit is contained in:
parent
b3f30bb70e
commit
1ff6d33aa8
@ -327,20 +327,42 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
|||||||
saveAs(blob, 'bootstrap.zip')
|
saveAs(blob, 'bootstrap.zip')
|
||||||
createGist(configJson)
|
createGist(configJson)
|
||||||
})
|
})
|
||||||
})
|
});
|
||||||
|
|
||||||
// browser support alerts
|
// browser support alert
|
||||||
if (!window.URL && navigator.userAgent.toLowerCase().indexOf('safari') != -1) {
|
(function () {
|
||||||
showCallout('Looks like you\'re using safari, which sadly doesn\'t have the best support' +
|
function failback() {
|
||||||
'for HTML5 blobs. Because of this your file will be downloaded with the name <code>"untitled"</code>.' +
|
$('.bs-docs-section, .bs-docs-sidebar').css('display', 'none')
|
||||||
'However, if you check your downloads folder, just rename this <code>"untitled"</code> file' +
|
showCallout('Looks like your current browser doesn\'t support the Bootstrap Customizer. Please take a second ' +
|
||||||
'to <code>"bootstrap.zip"</code> and you should be good to go!')
|
'to <a href="http://browsehappy.com/">upgrade to a more modern browser</a> (other than Safari).', true)
|
||||||
} else if (!window.URL && !window.webkitURL) {
|
}
|
||||||
$('.bs-docs-section, .bs-docs-sidebar').css('display', 'none')
|
/**
|
||||||
|
* Based on:
|
||||||
showCallout('Looks like your current browser doesn\'t support the Bootstrap Customizer. Please take a second' +
|
* Blob Feature Check v1.1.0
|
||||||
'to <a href="https://www.google.com/intl/en/chrome/browser/">upgrade to a more modern browser</a>.', true)
|
* 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'}
|
||||||
|
)
|
||||||
|
var objectUrl = url.createObjectURL(svg);
|
||||||
|
if (/^blob:/.exec(objectUrl) === null) {
|
||||||
|
// `URL.createObjectURL` created a URL that started with something other
|
||||||
|
// than "blob:", which means it has been polyfilled and is not supported by
|
||||||
|
// this browser.
|
||||||
|
failback()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('<img>')
|
||||||
|
.on('load', function () {
|
||||||
|
$compileBtn.prop('disabled', false)
|
||||||
|
})
|
||||||
|
.on('error', failback)
|
||||||
|
.attr('src', objectUrl)
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
parseUrl()
|
parseUrl()
|
||||||
}
|
}
|
||||||
|
@ -356,7 +356,7 @@ lead: Customize Bootstrap's components, Less variables, and jQuery plugins to ge
|
|||||||
|
|
||||||
<p class="lead">Hooray! Your custom version of Bootstrap is now ready to be compiled. Just click the button below to finish the process.</p>
|
<p class="lead">Hooray! Your custom version of Bootstrap is now ready to be compiled. Just click the button below to finish the process.</p>
|
||||||
<div class="bs-customize-download">
|
<div class="bs-customize-download">
|
||||||
<button type="submit" id="btn-compile" class="btn btn-block btn-lg btn-outline" onclick="_gaq.push(['_trackEvent', 'Customize', 'Download', 'Customize and Download']);">Compile and Download</button>
|
<button type="submit" id="btn-compile" disabled class="btn btn-block btn-lg btn-outline" onclick="_gaq.push(['_trackEvent', 'Customize', 'Download', 'Customize and Download']);">Compile and Download</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /download -->
|
</div><!-- /download -->
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user