mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 21:09:06 +02:00
Merge branch 'master' into derp
Conflicts: Gruntfile.js _config.yml dist/css/bootstrap-theme.css dist/css/bootstrap-theme.css.map dist/css/bootstrap-theme.min.css dist/css/bootstrap.css dist/css/bootstrap.css.map dist/css/bootstrap.min.css docs/_includes/components/button-groups.html docs/_includes/components/jumbotron.html docs/_includes/components/media.html docs/_includes/components/navs.html docs/_includes/customizer-variables.html docs/_includes/footer.html docs/_includes/getting-started/browser-device-support.html docs/_includes/js/carousel.html docs/_includes/js/dropdowns.html docs/_includes/js/modal.html docs/_includes/js/popovers.html docs/_includes/js/tooltips.html docs/_includes/nav/getting-started.html docs/_includes/nav/javascript.html docs/_layouts/default.html docs/assets/css/docs.min.css docs/assets/css/src/docs.css docs/assets/js/customize.min.js docs/assets/js/docs.min.js docs/assets/js/raw-files.min.js docs/browser-bugs.html docs/dist/css/bootstrap-theme.css docs/dist/css/bootstrap-theme.css.map docs/dist/css/bootstrap-theme.min.css docs/dist/css/bootstrap.css docs/dist/css/bootstrap.css.map docs/dist/css/bootstrap.min.css docs/examples/justified-nav/index.html less/_forms.less less/_tooltip.less less/navs.less less/theme.less
This commit is contained in:
@@ -85,6 +85,17 @@
|
||||
}, 3000)
|
||||
})
|
||||
|
||||
// Modal relatedTarget demo
|
||||
$('#exampleModal').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget) // Button that triggered the modal
|
||||
var recipient = button.data('whatever') // Extract info from data-* attributes
|
||||
// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
|
||||
// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
|
||||
var modal = $(this)
|
||||
modal.find('.modal-title').text('New message to ' + recipient)
|
||||
modal.find('.modal-body input').val(recipient)
|
||||
})
|
||||
|
||||
// Activate animated progress bar
|
||||
$('.bs-docs-activate-animated-progressbar').on('click', function () {
|
||||
$(this).prev('.progress-striped').toggleClass('progress-animated')
|
||||
|
@@ -6,13 +6,13 @@
|
||||
* details, see http://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
|
||||
/* global JSZip, less, saveAs, UglifyJS, __js, __less, __fonts */
|
||||
/* global JSZip, less, autoprefixer, saveAs, UglifyJS, __configBridge, __js, __less, __fonts */
|
||||
|
||||
window.onload = function () { // wait for load in a dumb way because B-0
|
||||
'use strict';
|
||||
var cw = '/*!\n' +
|
||||
' * Bootstrap v3.2.0 (http://getbootstrap.com)\n' +
|
||||
' * Copyright 2011-2014 Twitter, Inc.\n' +
|
||||
' * Bootstrap v3.3.0 (http://getbootstrap.com)\n' +
|
||||
' * Copyright 2011-' + new Date().getFullYear() + ' Twitter, Inc.\n' +
|
||||
' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
|
||||
' */\n\n'
|
||||
|
||||
@@ -251,6 +251,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
}
|
||||
|
||||
function compileLESS(lessSource, baseFilename, intoResult) {
|
||||
var promise = $.Deferred()
|
||||
var parser = new less.Parser({
|
||||
paths: ['variables.less', 'mixins.less'],
|
||||
optimization: 0,
|
||||
@@ -259,14 +260,18 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
|
||||
parser.parse(lessSource, function (err, tree) {
|
||||
if (err) {
|
||||
return showError('<strong>Ruh roh!</strong> Could not parse less files.', err)
|
||||
return promise.reject(err)
|
||||
}
|
||||
intoResult[baseFilename + '.css'] = cw + tree.toCSS()
|
||||
intoResult[baseFilename + '.min.css'] = cw + tree.toCSS({ compress: true })
|
||||
promise.resolve()
|
||||
})
|
||||
|
||||
return promise.promise()
|
||||
}
|
||||
|
||||
function generateCSS(preamble) {
|
||||
var promise = $.Deferred()
|
||||
var oneChecked = false
|
||||
var lessFileIncludes = {}
|
||||
$('#less-section input').each(function () {
|
||||
@@ -290,14 +295,22 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
var bsLessSource = preamble + generateLESS('bootstrap.less', lessFileIncludes, vars)
|
||||
var themeLessSource = preamble + generateLESS('theme.less', lessFileIncludes, vars)
|
||||
|
||||
try {
|
||||
compileLESS(bsLessSource, 'bootstrap', result)
|
||||
compileLESS(themeLessSource, 'bootstrap-theme', result)
|
||||
} catch (err) {
|
||||
return showError('<strong>Ruh roh!</strong> Could not parse less files.', err)
|
||||
}
|
||||
var prefixer = autoprefixer({ browsers: __configBridge.autoprefixerBrowsers })
|
||||
|
||||
return result
|
||||
$.when(
|
||||
compileLESS(bsLessSource, 'bootstrap', result),
|
||||
compileLESS(themeLessSource, 'bootstrap-theme', result)
|
||||
).done(function () {
|
||||
for (var key in result) {
|
||||
result[key] = prefixer.process(result[key]).css
|
||||
}
|
||||
promise.resolve(result)
|
||||
}).fail(function (err) {
|
||||
showError('<strong>Ruh roh!</strong> Could not parse less files.', err)
|
||||
promise.reject()
|
||||
})
|
||||
|
||||
return promise.promise()
|
||||
}
|
||||
|
||||
function uglify(js) {
|
||||
@@ -319,19 +332,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
|
||||
function generateJS(preamble) {
|
||||
var $checked = $('#plugin-section input:checked')
|
||||
var jqueryCheck = [
|
||||
'if (typeof jQuery === \'undefined\') {',
|
||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery\')',
|
||||
'}\n'
|
||||
].join('\n')
|
||||
var jqueryVersionCheck = [
|
||||
'+function ($) {',
|
||||
' var version = $.fn.jquery.split(\' \')[0].split(\'.\')',
|
||||
' if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {',
|
||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery version 1.9.1 or higher\')',
|
||||
' }',
|
||||
'}(jQuery);\n\n'
|
||||
].join('\n')
|
||||
var jqueryCheck = __configBridge.jqueryCheck.join('\n')
|
||||
var jqueryVersionCheck = __configBridge.jqueryVersionCheck.join('\n')
|
||||
|
||||
if (!$checked.length) return false
|
||||
|
||||
@@ -359,32 +361,26 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
|
||||
var file = (e.originalEvent.hasOwnProperty('dataTransfer')) ? e.originalEvent.dataTransfer.files[0] : e.originalEvent.target.files[0]
|
||||
|
||||
if (!file.type.match('application/json')) {
|
||||
return showAlert('danger', '<strong>Ruh roh.</strong> We can only read <code>.json</code> files. Please try again.', importDropTarget)
|
||||
}
|
||||
|
||||
var reader = new FileReader()
|
||||
|
||||
reader.onload = (function () {
|
||||
return function (e) {
|
||||
var text = e.target.result
|
||||
reader.onload = function (e) {
|
||||
var text = e.target.result
|
||||
|
||||
try {
|
||||
var json = JSON.parse(text)
|
||||
try {
|
||||
var json = JSON.parse(text)
|
||||
|
||||
if (typeof json != 'object') {
|
||||
throw new Error('JSON data from config file is not an object.')
|
||||
}
|
||||
|
||||
updateCustomizerFromJson(json)
|
||||
showAlert('success', '<strong>Woohoo!</strong> Your configuration was successfully uploaded. Tweak your settings, then hit Download.', importDropTarget)
|
||||
} catch (err) {
|
||||
return showAlert('danger', '<strong>Shucks.</strong> We can only read valid <code>.json</code> files. Please try again.', importDropTarget)
|
||||
if (!$.isPlainObject(json)) {
|
||||
throw new Error('JSON data from config file is not an object.')
|
||||
}
|
||||
}
|
||||
})(file)
|
||||
|
||||
reader.readAsText(file)
|
||||
updateCustomizerFromJson(json)
|
||||
showAlert('success', '<strong>Woohoo!</strong> Your configuration was successfully uploaded. Tweak your settings, then hit Download.', importDropTarget)
|
||||
} catch (err) {
|
||||
return showAlert('danger', '<strong>Shucks.</strong> We can only read valid <code>.json</code> files. Please try again.', importDropTarget)
|
||||
}
|
||||
}
|
||||
|
||||
reader.readAsText(file, 'utf-8')
|
||||
}
|
||||
|
||||
function handleConfigDragOver(e) {
|
||||
@@ -401,7 +397,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
.on('drop', handleConfigFileSelect)
|
||||
}
|
||||
|
||||
$('#import-file-select').on('select', handleConfigFileSelect)
|
||||
$('#import-file-select').on('change', handleConfigFileSelect)
|
||||
$('#import-manual-trigger').on('click', removeImportAlerts)
|
||||
|
||||
var inputsComponent = $('#less-section input')
|
||||
@@ -464,9 +460,15 @@ window.onload = function () { // wait for load in a dumb way because B-0
|
||||
' * Config saved to config.json and ' + gistUrl + '\n' +
|
||||
' */\n'
|
||||
|
||||
generateZip(generateCSS(preamble), generateJS(preamble), generateFonts(), configJson, function (blob) {
|
||||
$compileBtn.removeAttr('disabled')
|
||||
saveAs(blob, 'bootstrap.zip')
|
||||
$.when(
|
||||
generateCSS(preamble),
|
||||
generateJS(preamble),
|
||||
generateFonts()
|
||||
).done(function (css, js, fonts) {
|
||||
generateZip(css, js, fonts, configJson, function (blob) {
|
||||
$compileBtn.removeAttr('disabled')
|
||||
setTimeout(function () { saveAs(blob, 'bootstrap.zip') }, 0)
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
|
16015
docs/assets/js/vendor/autoprefixer.js
vendored
Normal file
16015
docs/assets/js/vendor/autoprefixer.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user