mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-19 03:41:19 +02:00
publish 3.4 docs
This commit is contained in:
32
docs/3.4/assets/js/customize.min.js
vendored
Executable file
32
docs/3.4/assets/js/customize.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
16
docs/3.4/assets/js/docs.min.js
vendored
Executable file
16
docs/3.4/assets/js/docs.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
51
docs/3.4/assets/js/ie-emulation-modes-warning.js
Executable file
51
docs/3.4/assets/js/ie-emulation-modes-warning.js
Executable file
@@ -0,0 +1,51 @@
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
/*!
|
||||
* Copyright 2014-2018 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see https://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function emulatedIEMajorVersion() {
|
||||
var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
|
||||
if (groups === null) {
|
||||
return null
|
||||
}
|
||||
var ieVersionNum = parseInt(groups[1], 10)
|
||||
var ieMajorVersion = Math.floor(ieVersionNum)
|
||||
return ieMajorVersion
|
||||
}
|
||||
|
||||
function actualNonEmulatedIEMajorVersion() {
|
||||
// Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
|
||||
// IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx
|
||||
// @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx
|
||||
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line
|
||||
if (jscriptVersion === undefined) {
|
||||
return 11 // IE11+ not in emulation mode
|
||||
}
|
||||
if (jscriptVersion < 9) {
|
||||
return 8 // IE8 (or lower; haven't tested on IE<8)
|
||||
}
|
||||
return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
|
||||
}
|
||||
|
||||
var ua = window.navigator.userAgent
|
||||
if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
|
||||
return // Opera, which might pretend to be IE
|
||||
}
|
||||
var emulated = emulatedIEMajorVersion()
|
||||
if (emulated === null) {
|
||||
return // Not IE
|
||||
}
|
||||
var nonEmulated = actualNonEmulatedIEMajorVersion()
|
||||
|
||||
if (emulated !== nonEmulated) {
|
||||
window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
|
||||
}
|
||||
})();
|
23
docs/3.4/assets/js/ie10-viewport-bug-workaround.js
Executable file
23
docs/3.4/assets/js/ie10-viewport-bug-workaround.js
Executable file
@@ -0,0 +1,23 @@
|
||||
/*!
|
||||
* IE10 viewport hack for Surface/desktop Windows 8 bug
|
||||
* Copyright 2014-2018 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
// See the Getting Started docs for more information:
|
||||
// https://getbootstrap.com/docs/3.4/getting-started/#support-ie10-width
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
|
||||
var msViewportStyle = document.createElement('style')
|
||||
msViewportStyle.appendChild(
|
||||
document.createTextNode(
|
||||
'@-ms-viewport{width:auto!important}'
|
||||
)
|
||||
)
|
||||
document.querySelector('head').appendChild(msViewportStyle)
|
||||
}
|
||||
|
||||
})();
|
13
docs/3.4/assets/js/ie8-responsive-file-warning.js
Executable file
13
docs/3.4/assets/js/ie8-responsive-file-warning.js
Executable file
@@ -0,0 +1,13 @@
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
/*!
|
||||
* Copyright 2011-2018 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see https://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
// Intended to prevent false-positive bug reports about responsive styling supposedly not working in IE8.
|
||||
if (window.location.protocol == 'file:') {
|
||||
window.alert('ERROR: Bootstrap\'s responsive CSS is disabled!\nSee getbootstrap.com/getting-started/#respond-file-proto for details.')
|
||||
}
|
8
docs/3.4/assets/js/raw-files.min.js
vendored
Executable file
8
docs/3.4/assets/js/raw-files.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
180
docs/3.4/assets/js/src/application.js
Executable file
180
docs/3.4/assets/js/src/application.js
Executable file
@@ -0,0 +1,180 @@
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
/*!
|
||||
* JavaScript for Bootstrap's docs (https://getbootstrap.com/)
|
||||
* Copyright 2011-2018 Twitter, Inc.
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see https://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
|
||||
/* global ClipboardJS: false, anchors: false */
|
||||
|
||||
!function ($) {
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
|
||||
// Scrollspy
|
||||
var $window = $(window)
|
||||
var $body = $(document.body)
|
||||
|
||||
$body.scrollspy({
|
||||
target: '.bs-docs-sidebar'
|
||||
})
|
||||
$window.on('load', function () {
|
||||
$body.scrollspy('refresh')
|
||||
})
|
||||
|
||||
// Kill links
|
||||
$('.bs-docs-container [href="#"]').click(function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
// Sidenav affixing
|
||||
setTimeout(function () {
|
||||
var $sideBar = $('.bs-docs-sidebar')
|
||||
|
||||
$sideBar.affix({
|
||||
offset: {
|
||||
top: function () {
|
||||
var offsetTop = $sideBar.offset().top
|
||||
var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
|
||||
var navOuterHeight = $('.bs-docs-nav').height()
|
||||
|
||||
return (this.top = offsetTop - navOuterHeight - sideBarMargin)
|
||||
},
|
||||
bottom: function () {
|
||||
return (this.bottom = $('.bs-docs-footer').outerHeight(true))
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
$('.bs-top').affix()
|
||||
}, 100)
|
||||
|
||||
// Theme toggler
|
||||
;(function () {
|
||||
var $stylesheetLink = $('#bs-theme-stylesheet')
|
||||
var $themeBtn = $('.bs-docs-theme-toggle')
|
||||
|
||||
var activateTheme = function () {
|
||||
$stylesheetLink.attr('href', $stylesheetLink.attr('data-href'))
|
||||
$themeBtn.text('Disable theme preview')
|
||||
localStorage.setItem('previewTheme', true)
|
||||
}
|
||||
|
||||
if (localStorage.getItem('previewTheme')) {
|
||||
activateTheme()
|
||||
}
|
||||
|
||||
$themeBtn.click(function () {
|
||||
var href = $stylesheetLink.attr('href')
|
||||
if (!href || href.indexOf('data') === 0) {
|
||||
activateTheme()
|
||||
} else {
|
||||
$stylesheetLink.attr('href', '')
|
||||
$themeBtn.text('Preview theme')
|
||||
localStorage.removeItem('previewTheme')
|
||||
}
|
||||
})
|
||||
})();
|
||||
|
||||
// Tooltip and popover demos
|
||||
$('.tooltip-demo').tooltip({
|
||||
selector: '[data-toggle="tooltip"]',
|
||||
container: 'body'
|
||||
})
|
||||
$('.popover-demo').popover({
|
||||
selector: '[data-toggle="popover"]',
|
||||
container: 'body'
|
||||
})
|
||||
|
||||
// Demos within modals
|
||||
$('.tooltip-test').tooltip()
|
||||
$('.popover-test').popover()
|
||||
|
||||
// Popover demos
|
||||
$('.bs-docs-popover').popover()
|
||||
|
||||
// Button state demo
|
||||
$('#loading-example-btn').on('click', function () {
|
||||
var $btn = $(this)
|
||||
$btn.button('loading')
|
||||
setTimeout(function () {
|
||||
$btn.button('reset')
|
||||
}, 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).siblings('.progress').find('.progress-bar-striped').toggleClass('active')
|
||||
})
|
||||
|
||||
// Insert copy to clipboard button before .highlight
|
||||
$('figure.highlight, div.highlight').each(function () {
|
||||
var btnHtml = '<div class="bs-clipboard"><button type="button" class="btn-clipboard" title="Copy to clipboard">Copy</button></div>'
|
||||
$(this).before(btnHtml)
|
||||
$('.btn-clipboard')
|
||||
.tooltip()
|
||||
.on('mouseleave', function () {
|
||||
// Explicitly hide tooltip, since after clicking it remains
|
||||
// focused (as it's a button), so tooltip would otherwise
|
||||
// remain visible until focus is moved away
|
||||
$(this).tooltip('hide')
|
||||
})
|
||||
})
|
||||
|
||||
var clipboard = new ClipboardJS('.btn-clipboard', {
|
||||
target: function (trigger) {
|
||||
return trigger.parentNode.nextElementSibling
|
||||
}
|
||||
})
|
||||
|
||||
clipboard.on('success', function (e) {
|
||||
$(e.trigger)
|
||||
.attr('title', 'Copied!')
|
||||
.tooltip('fixTitle')
|
||||
.tooltip('show')
|
||||
.attr('title', 'Copy to clipboard')
|
||||
.tooltip('fixTitle')
|
||||
|
||||
e.clearSelection()
|
||||
})
|
||||
|
||||
clipboard.on('error', function (e) {
|
||||
var modifierKey = /Mac/i.test(navigator.userAgent) ? '\u2318' : 'Ctrl-'
|
||||
var fallbackMsg = 'Press ' + modifierKey + 'C to copy'
|
||||
|
||||
$(e.trigger)
|
||||
.attr('title', fallbackMsg)
|
||||
.tooltip('fixTitle')
|
||||
.tooltip('show')
|
||||
.attr('title', 'Copy to clipboard')
|
||||
.tooltip('fixTitle')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
}(jQuery)
|
||||
|
||||
;(function () {
|
||||
'use strict';
|
||||
|
||||
anchors.options.placement = 'left';
|
||||
anchors.add('.bs-docs-section > h1, .bs-docs-section > h2, .bs-docs-section > h3, .bs-docs-section > h4, .bs-docs-section > h5')
|
||||
})();
|
414
docs/3.4/assets/js/src/customizer.js
Executable file
414
docs/3.4/assets/js/src/customizer.js
Executable file
@@ -0,0 +1,414 @@
|
||||
/*!
|
||||
* Bootstrap Customizer (http://getbootstrap.com/customize/)
|
||||
* Copyright 2011-2018 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
|
||||
* details, see https://creativecommons.org/licenses/by/3.0/.
|
||||
*/
|
||||
|
||||
/* global JSON, 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.4.0 (https://getbootstrap.com/)\n' +
|
||||
' * Copyright 2011-' + new Date().getFullYear() + ' Twitter, Inc.\n' +
|
||||
' * Licensed under the MIT license\n' +
|
||||
' */\n\n'
|
||||
|
||||
var $importDropTarget = $('#import-drop-target')
|
||||
|
||||
function showError(msg, err) {
|
||||
$('<div id="bsCustomizerAlert" class="bs-customizer-alert">' +
|
||||
'<div class="container">' +
|
||||
'<a href="#bsCustomizerAlert" data-dismiss="alert" class="close pull-right" aria-label="Close" role="button"><span aria-hidden="true">×</span></a>' +
|
||||
'<p class="bs-customizer-alert-text"><span class="glyphicon glyphicon-warning-sign" aria-hidden="true"></span><span class="sr-only">Warning:</span>' + msg + '</p>' +
|
||||
(err.message ? $('<p></p>').text('Error: ' + err.message)[0].outerHTML : '') +
|
||||
(err.extract ? $('<pre class="bs-customizer-alert-extract"></pre>').text(err.extract.join('\n'))[0].outerHTML : '') +
|
||||
'</div>' +
|
||||
'</div>').appendTo('body').alert()
|
||||
throw err
|
||||
}
|
||||
|
||||
function showAlert(type, msg, insertAfter) {
|
||||
$('<div class="alert alert-' + type + '">' + msg + '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>')
|
||||
.insertAfter(insertAfter)
|
||||
}
|
||||
|
||||
function getQueryParam(key) {
|
||||
key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, '\\$&') // escape RegEx meta chars
|
||||
var match = location.search.match(new RegExp('[?&]' + key + '=([^&]+)(&|$)'))
|
||||
return match && decodeURIComponent(match[1].replace(/\+/g, ' '))
|
||||
}
|
||||
|
||||
function getCustomizerData() {
|
||||
var vars = {}
|
||||
|
||||
$('#less-variables-section input')
|
||||
.each(function () {
|
||||
$(this).val() && (vars[$(this).prev().text()] = $(this).val())
|
||||
})
|
||||
|
||||
var data = {
|
||||
vars: vars,
|
||||
css: $('#less-section input:checked') .map(function () { return this.value }).toArray(),
|
||||
js: $('#plugin-section input:checked').map(function () { return this.value }).toArray()
|
||||
}
|
||||
|
||||
if ($.isEmptyObject(data.vars) && !data.css.length && !data.js.length) return null
|
||||
|
||||
return data
|
||||
}
|
||||
|
||||
function updateCustomizerFromJson(data) {
|
||||
if (data.js) {
|
||||
$('#plugin-section input').each(function () {
|
||||
$(this).prop('checked', ~$.inArray(this.value, data.js))
|
||||
})
|
||||
}
|
||||
if (data.css) {
|
||||
$('#less-section input').each(function () {
|
||||
$(this).prop('checked', ~$.inArray(this.value, data.css))
|
||||
})
|
||||
}
|
||||
if (data.vars) {
|
||||
for (var i in data.vars) {
|
||||
$('input[data-var="' + i + '"]').val(data.vars[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function parseUrl() {
|
||||
var id = getQueryParam('id')
|
||||
|
||||
if (!id) return
|
||||
|
||||
$.ajax({
|
||||
url: 'https://api.github.com/gists/' + id,
|
||||
type: 'GET',
|
||||
dataType: 'json'
|
||||
})
|
||||
.success(function (result) {
|
||||
var data = JSON.parse(result.files['config.json'].content)
|
||||
updateCustomizerFromJson(data)
|
||||
})
|
||||
.error(function (err) {
|
||||
showError('Error fetching bootstrap config file', err)
|
||||
})
|
||||
}
|
||||
|
||||
function generateZip(css, js, fonts, config, complete) {
|
||||
if (!css && !js) return showError('<strong>Ruh roh!</strong> No Bootstrap files selected.', new Error('no Bootstrap'))
|
||||
|
||||
var zip = new JSZip()
|
||||
|
||||
if (css) {
|
||||
var cssFolder = zip.folder('css')
|
||||
for (var fileName in css) {
|
||||
cssFolder.file(fileName, css[fileName])
|
||||
}
|
||||
}
|
||||
|
||||
if (js) {
|
||||
var jsFolder = zip.folder('js')
|
||||
for (var jsFileName in js) {
|
||||
jsFolder.file(jsFileName, js[jsFileName])
|
||||
}
|
||||
}
|
||||
|
||||
if (fonts) {
|
||||
var fontsFolder = zip.folder('fonts')
|
||||
for (var fontsFileName in fonts) {
|
||||
fontsFolder.file(fontsFileName, fonts[fontsFileName], { base64: true })
|
||||
}
|
||||
}
|
||||
|
||||
if (config) {
|
||||
zip.file('config.json', config)
|
||||
}
|
||||
|
||||
var content = zip.generate({ type: 'blob' })
|
||||
|
||||
complete(content)
|
||||
}
|
||||
|
||||
function generateCustomLess(vars) {
|
||||
var result = ''
|
||||
|
||||
for (var key in vars) {
|
||||
result += key + ': ' + vars[key] + ';\n'
|
||||
}
|
||||
|
||||
return result + '\n\n'
|
||||
}
|
||||
|
||||
function generateFonts() {
|
||||
var $glyphicons = $('#less-section [value="glyphicons.less"]:checked')
|
||||
if ($glyphicons.length) {
|
||||
return __fonts
|
||||
}
|
||||
}
|
||||
|
||||
// Returns an Array of @import'd filenames in the order
|
||||
// in which they appear in the file.
|
||||
function includedLessFilenames(lessFilename) {
|
||||
var IMPORT_REGEX = /^@import \"(.*?)\";$/
|
||||
var lessLines = __less[lessFilename].split('\n')
|
||||
|
||||
var imports = []
|
||||
$.each(lessLines, function (index, lessLine) {
|
||||
var match = IMPORT_REGEX.exec(lessLine)
|
||||
if (match) {
|
||||
var importee = match[1]
|
||||
var transitiveImports = includedLessFilenames(importee)
|
||||
$.each(transitiveImports, function (index, transitiveImportee) {
|
||||
if ($.inArray(transitiveImportee, imports) === -1) {
|
||||
imports.push(transitiveImportee)
|
||||
}
|
||||
})
|
||||
imports.push(importee)
|
||||
}
|
||||
})
|
||||
|
||||
return imports
|
||||
}
|
||||
|
||||
function generateLESS(lessFilename, lessFileIncludes, vars) {
|
||||
var lessSource = __less[lessFilename]
|
||||
|
||||
var lessFilenames = includedLessFilenames(lessFilename)
|
||||
$.each(lessFilenames, function (index, filename) {
|
||||
var fileInclude = lessFileIncludes[filename]
|
||||
|
||||
// Files not explicitly unchecked are compiled into the final stylesheet.
|
||||
// Core stylesheets like 'normalize.less' are not included in the form
|
||||
// since disabling them would wreck everything, and so their 'fileInclude'
|
||||
// will be 'undefined'.
|
||||
if (fileInclude || fileInclude == null) lessSource += __less[filename]
|
||||
|
||||
// Custom variables are added after Bootstrap variables so the custom
|
||||
// ones take precedence.
|
||||
if (filename === 'variables.less' && vars) lessSource += generateCustomLess(vars)
|
||||
})
|
||||
|
||||
lessSource = lessSource.replace(/@import[^\n]*/gi, '') // strip any imports
|
||||
return lessSource
|
||||
}
|
||||
|
||||
function compileLESS(lessSource, baseFilename, intoResult) {
|
||||
var promise = $.Deferred()
|
||||
var parser = new less.Parser({
|
||||
paths: ['variables.less', 'mixins.less'],
|
||||
optimization: 0,
|
||||
filename: baseFilename + '.css'
|
||||
})
|
||||
|
||||
parser.parse(lessSource, function (parseErr, tree) {
|
||||
if (parseErr) {
|
||||
return promise.reject(parseErr)
|
||||
}
|
||||
try {
|
||||
intoResult[baseFilename + '.css'] = tree.toCSS()
|
||||
intoResult[baseFilename + '.min.css'] = tree.toCSS({ compress: true })
|
||||
} catch (compileErr) {
|
||||
return promise.reject(compileErr)
|
||||
}
|
||||
promise.resolve()
|
||||
})
|
||||
|
||||
return promise.promise()
|
||||
}
|
||||
|
||||
function generateCSS(preamble) {
|
||||
var promise = $.Deferred()
|
||||
var oneChecked = false
|
||||
var lessFileIncludes = {}
|
||||
$('#less-section input').each(function () {
|
||||
var $this = $(this)
|
||||
var checked = $this.is(':checked')
|
||||
lessFileIncludes[$this.val()] = checked
|
||||
|
||||
oneChecked = oneChecked || checked
|
||||
})
|
||||
|
||||
if (!oneChecked) return false
|
||||
|
||||
var result = {}
|
||||
var vars = {}
|
||||
|
||||
$('#less-variables-section input')
|
||||
.each(function () {
|
||||
$(this).val() && (vars[$(this).prev().text()] = $(this).val())
|
||||
})
|
||||
|
||||
var bsLessSource = preamble + generateLESS('bootstrap.less', lessFileIncludes, vars)
|
||||
var themeLessSource = preamble + generateLESS('theme.less', lessFileIncludes, vars)
|
||||
|
||||
var prefixer = autoprefixer(__configBridge.autoprefixer)
|
||||
|
||||
$.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> Problem parsing or compiling Less files.', err)
|
||||
promise.reject()
|
||||
})
|
||||
|
||||
return promise.promise()
|
||||
}
|
||||
|
||||
function uglify(js) {
|
||||
var ast = UglifyJS.parse(js)
|
||||
ast.figure_out_scope()
|
||||
|
||||
var compressor = UglifyJS.Compressor()
|
||||
var compressedAst = ast.transform(compressor)
|
||||
|
||||
compressedAst.figure_out_scope()
|
||||
compressedAst.compute_char_frequency()
|
||||
compressedAst.mangle_names()
|
||||
|
||||
var stream = UglifyJS.OutputStream()
|
||||
compressedAst.print(stream)
|
||||
|
||||
return stream.toString()
|
||||
}
|
||||
|
||||
function generateJS(preamble) {
|
||||
var $checked = $('#plugin-section input:checked')
|
||||
var jqueryCheck = __configBridge.jqueryCheck.join('\n')
|
||||
var jqueryVersionCheck = __configBridge.jqueryVersionCheck.join('\n')
|
||||
|
||||
if (!$checked.length) return false
|
||||
|
||||
var js = $checked
|
||||
.map(function () { return __js[this.value] })
|
||||
.toArray()
|
||||
.join('\n')
|
||||
|
||||
preamble = preamble + cw
|
||||
js = jqueryCheck + jqueryVersionCheck + js
|
||||
|
||||
return {
|
||||
'bootstrap.js': preamble + js,
|
||||
'bootstrap.min.js': preamble + uglify(js)
|
||||
}
|
||||
}
|
||||
|
||||
function removeImportAlerts() {
|
||||
$importDropTarget.nextAll('.alert').remove()
|
||||
}
|
||||
|
||||
function handleConfigFileSelect(e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
|
||||
var file = e.originalEvent.target.files[0]
|
||||
var reader = new FileReader()
|
||||
|
||||
reader.onload = function (e) {
|
||||
var text = e.target.result
|
||||
|
||||
try {
|
||||
var json = JSON.parse(text)
|
||||
|
||||
if (!$.isPlainObject(json)) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
reader.readAsText(file, 'utf-8')
|
||||
}
|
||||
|
||||
$('#import-file-select').on('change', handleConfigFileSelect)
|
||||
$('#import-manual-trigger').on('click', removeImportAlerts)
|
||||
|
||||
var $inputsComponent = $('#less-section input')
|
||||
var $inputsPlugin = $('#plugin-section input')
|
||||
var $inputsVariables = $('#less-variables-section input')
|
||||
|
||||
$('#less-section .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
$inputsComponent.prop('checked', !$inputsComponent.is(':checked'))
|
||||
})
|
||||
|
||||
$('#plugin-section .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
$inputsPlugin.prop('checked', !$inputsPlugin.is(':checked'))
|
||||
})
|
||||
|
||||
$('#less-variables-section .toggle').on('click', function (e) {
|
||||
e.preventDefault()
|
||||
$inputsVariables.val('')
|
||||
})
|
||||
|
||||
$('[data-dependencies]').on('click', function () {
|
||||
if (!$(this).is(':checked')) return
|
||||
var dependencies = this.getAttribute('data-dependencies')
|
||||
if (!dependencies) return
|
||||
dependencies = dependencies.split(',')
|
||||
for (var i = 0, len = dependencies.length; i < len; i++) {
|
||||
var $dependency = $('[value="' + dependencies[i] + '"]')
|
||||
$dependency && $dependency.prop('checked', true)
|
||||
}
|
||||
})
|
||||
|
||||
$('[data-dependents]').on('click', function () {
|
||||
if ($(this).is(':checked')) return
|
||||
var dependents = this.getAttribute('data-dependents')
|
||||
if (!dependents) return
|
||||
dependents = dependents.split(',')
|
||||
for (var i = 0, len = dependents.length; i < len; i++) {
|
||||
var $dependent = $('[value="' + dependents[i] + '"]')
|
||||
$dependent && $dependent.prop('checked', false)
|
||||
}
|
||||
})
|
||||
|
||||
var $compileBtn = $('#btn-compile')
|
||||
|
||||
$compileBtn.on('click', function (e) {
|
||||
e.preventDefault()
|
||||
|
||||
$compileBtn.attr('disabled', 'disabled')
|
||||
|
||||
function generate() {
|
||||
var configData = getCustomizerData()
|
||||
var configJson = JSON.stringify(configData, null, 2)
|
||||
var origin = window.location.protocol + '//' + window.location.host
|
||||
var customizerUrl = origin + window.location.pathname
|
||||
|
||||
var preamble = '/*!\n' +
|
||||
' * Generated using the Bootstrap Customizer (' + customizerUrl + ')\n' +
|
||||
' */\n\n'
|
||||
|
||||
$.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)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
generate()
|
||||
});
|
||||
|
||||
parseUrl()
|
||||
}
|
51
docs/3.4/assets/js/src/search.js
Executable file
51
docs/3.4/assets/js/src/search.js
Executable file
@@ -0,0 +1,51 @@
|
||||
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
|
||||
// IT'S ALL JUST JUNK FOR OUR DOCS!
|
||||
// ++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
var inputElement = document.getElementById('search-input')
|
||||
|
||||
if (!window.docsearch || !inputElement) {
|
||||
return
|
||||
}
|
||||
|
||||
function getOrigin() {
|
||||
var location = window.location
|
||||
var origin = location.origin
|
||||
|
||||
if (!origin) {
|
||||
var port = location.port ? ':' + location.port : ''
|
||||
|
||||
origin = location.protocol + '//' + location.hostname + port
|
||||
}
|
||||
|
||||
return origin
|
||||
}
|
||||
|
||||
window.docsearch({
|
||||
apiKey: 'c8948afa20e6437a6e829f7e87b9ac11',
|
||||
indexName: 'bootstrap-v3',
|
||||
inputSelector: '#search-input',
|
||||
transformData: function (hits) {
|
||||
return hits.map(function (hit) {
|
||||
var siteurl = getOrigin()
|
||||
var urlRE = /^https?:\/\/getbootstrap\.com/
|
||||
|
||||
// When in production, return the result as is,
|
||||
// otherwise remove our url from it.
|
||||
hit.url = siteurl.match(urlRE) ? hit.url : hit.url.replace(urlRE, '')
|
||||
|
||||
// Prevent jumping to first header
|
||||
if (hit.anchor === 'content') {
|
||||
hit.url = hit.url.replace(/#content$/, '')
|
||||
hit.anchor = null
|
||||
}
|
||||
|
||||
return hit
|
||||
})
|
||||
},
|
||||
debug: false // Set debug to true if you want to inspect the dropdown
|
||||
})
|
||||
}())
|
211
docs/3.4/assets/js/vendor/Blob.js
vendored
Executable file
211
docs/3.4/assets/js/vendor/Blob.js
vendored
Executable file
@@ -0,0 +1,211 @@
|
||||
/* Blob.js
|
||||
* A Blob implementation.
|
||||
* 2014-07-24
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* By Devin Samarin, https://github.com/dsamarin
|
||||
* License: X11/MIT
|
||||
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self, unescape */
|
||||
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
|
||||
plusplus: true */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
|
||||
|
||||
(function (view) {
|
||||
"use strict";
|
||||
|
||||
view.URL = view.URL || view.webkitURL;
|
||||
|
||||
if (view.Blob && view.URL) {
|
||||
try {
|
||||
new Blob;
|
||||
return;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// Internally we use a BlobBuilder implementation to base Blob off of
|
||||
// in order to support older browsers that only have BlobBuilder
|
||||
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
|
||||
var
|
||||
get_class = function(object) {
|
||||
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
|
||||
}
|
||||
, FakeBlobBuilder = function BlobBuilder() {
|
||||
this.data = [];
|
||||
}
|
||||
, FakeBlob = function Blob(data, type, encoding) {
|
||||
this.data = data;
|
||||
this.size = data.length;
|
||||
this.type = type;
|
||||
this.encoding = encoding;
|
||||
}
|
||||
, FBB_proto = FakeBlobBuilder.prototype
|
||||
, FB_proto = FakeBlob.prototype
|
||||
, FileReaderSync = view.FileReaderSync
|
||||
, FileException = function(type) {
|
||||
this.code = this[this.name = type];
|
||||
}
|
||||
, file_ex_codes = (
|
||||
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
|
||||
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
|
||||
).split(" ")
|
||||
, file_ex_code = file_ex_codes.length
|
||||
, real_URL = view.URL || view.webkitURL || view
|
||||
, real_create_object_URL = real_URL.createObjectURL
|
||||
, real_revoke_object_URL = real_URL.revokeObjectURL
|
||||
, URL = real_URL
|
||||
, btoa = view.btoa
|
||||
, atob = view.atob
|
||||
|
||||
, ArrayBuffer = view.ArrayBuffer
|
||||
, Uint8Array = view.Uint8Array
|
||||
|
||||
, origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
|
||||
;
|
||||
FakeBlob.fake = FB_proto.fake = true;
|
||||
while (file_ex_code--) {
|
||||
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
|
||||
}
|
||||
// Polyfill URL
|
||||
if (!real_URL.createObjectURL) {
|
||||
URL = view.URL = function(uri) {
|
||||
var
|
||||
uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
||||
, uri_origin
|
||||
;
|
||||
uri_info.href = uri;
|
||||
if (!("origin" in uri_info)) {
|
||||
if (uri_info.protocol.toLowerCase() === "data:") {
|
||||
uri_info.origin = null;
|
||||
} else {
|
||||
uri_origin = uri.match(origin);
|
||||
uri_info.origin = uri_origin && uri_origin[1];
|
||||
}
|
||||
}
|
||||
return uri_info;
|
||||
};
|
||||
}
|
||||
URL.createObjectURL = function(blob) {
|
||||
var
|
||||
type = blob.type
|
||||
, data_URI_header
|
||||
;
|
||||
if (type === null) {
|
||||
type = "application/octet-stream";
|
||||
}
|
||||
if (blob instanceof FakeBlob) {
|
||||
data_URI_header = "data:" + type;
|
||||
if (blob.encoding === "base64") {
|
||||
return data_URI_header + ";base64," + blob.data;
|
||||
} else if (blob.encoding === "URI") {
|
||||
return data_URI_header + "," + decodeURIComponent(blob.data);
|
||||
} if (btoa) {
|
||||
return data_URI_header + ";base64," + btoa(blob.data);
|
||||
} else {
|
||||
return data_URI_header + "," + encodeURIComponent(blob.data);
|
||||
}
|
||||
} else if (real_create_object_URL) {
|
||||
return real_create_object_URL.call(real_URL, blob);
|
||||
}
|
||||
};
|
||||
URL.revokeObjectURL = function(object_URL) {
|
||||
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
|
||||
real_revoke_object_URL.call(real_URL, object_URL);
|
||||
}
|
||||
};
|
||||
FBB_proto.append = function(data/*, endings*/) {
|
||||
var bb = this.data;
|
||||
// decode data to a binary string
|
||||
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
|
||||
var
|
||||
str = ""
|
||||
, buf = new Uint8Array(data)
|
||||
, i = 0
|
||||
, buf_len = buf.length
|
||||
;
|
||||
for (; i < buf_len; i++) {
|
||||
str += String.fromCharCode(buf[i]);
|
||||
}
|
||||
bb.push(str);
|
||||
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
|
||||
if (FileReaderSync) {
|
||||
var fr = new FileReaderSync;
|
||||
bb.push(fr.readAsBinaryString(data));
|
||||
} else {
|
||||
// async FileReader won't work as BlobBuilder is sync
|
||||
throw new FileException("NOT_READABLE_ERR");
|
||||
}
|
||||
} else if (data instanceof FakeBlob) {
|
||||
if (data.encoding === "base64" && atob) {
|
||||
bb.push(atob(data.data));
|
||||
} else if (data.encoding === "URI") {
|
||||
bb.push(decodeURIComponent(data.data));
|
||||
} else if (data.encoding === "raw") {
|
||||
bb.push(data.data);
|
||||
}
|
||||
} else {
|
||||
if (typeof data !== "string") {
|
||||
data += ""; // convert unsupported types to strings
|
||||
}
|
||||
// decode UTF-16 to binary string
|
||||
bb.push(unescape(encodeURIComponent(data)));
|
||||
}
|
||||
};
|
||||
FBB_proto.getBlob = function(type) {
|
||||
if (!arguments.length) {
|
||||
type = null;
|
||||
}
|
||||
return new FakeBlob(this.data.join(""), type, "raw");
|
||||
};
|
||||
FBB_proto.toString = function() {
|
||||
return "[object BlobBuilder]";
|
||||
};
|
||||
FB_proto.slice = function(start, end, type) {
|
||||
var args = arguments.length;
|
||||
if (args < 3) {
|
||||
type = null;
|
||||
}
|
||||
return new FakeBlob(
|
||||
this.data.slice(start, args > 1 ? end : this.data.length)
|
||||
, type
|
||||
, this.encoding
|
||||
);
|
||||
};
|
||||
FB_proto.toString = function() {
|
||||
return "[object Blob]";
|
||||
};
|
||||
FB_proto.close = function() {
|
||||
this.size = 0;
|
||||
delete this.data;
|
||||
};
|
||||
return FakeBlobBuilder;
|
||||
}(view));
|
||||
|
||||
view.Blob = function(blobParts, options) {
|
||||
var type = options ? (options.type || "") : "";
|
||||
var builder = new BlobBuilder();
|
||||
if (blobParts) {
|
||||
for (var i = 0, len = blobParts.length; i < len; i++) {
|
||||
if (Uint8Array && blobParts[i] instanceof Uint8Array) {
|
||||
builder.append(blobParts[i].buffer);
|
||||
}
|
||||
else {
|
||||
builder.append(blobParts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
var blob = builder.getBlob(type);
|
||||
if (!blob.slice && blob.webkitSlice) {
|
||||
blob.slice = blob.webkitSlice;
|
||||
}
|
||||
return blob;
|
||||
};
|
||||
|
||||
var getPrototypeOf = Object.getPrototypeOf || function(object) {
|
||||
return object.__proto__;
|
||||
};
|
||||
view.Blob.prototype = getPrototypeOf(new view.Blob());
|
||||
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
|
248
docs/3.4/assets/js/vendor/FileSaver.js
vendored
Executable file
248
docs/3.4/assets/js/vendor/FileSaver.js
vendored
Executable file
@@ -0,0 +1,248 @@
|
||||
/* FileSaver.js
|
||||
* A saveAs() FileSaver implementation.
|
||||
* 2015-03-04
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* License: X11/MIT
|
||||
* See https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self */
|
||||
/*jslint bitwise: true, indent: 4, laxbreak: true, laxcomma: true, smarttabs: true, plusplus: true */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
|
||||
|
||||
var saveAs = saveAs
|
||||
// IE 10+ (native saveAs)
|
||||
|| (typeof navigator !== "undefined" &&
|
||||
navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob.bind(navigator))
|
||||
// Everyone else
|
||||
|| (function(view) {
|
||||
"use strict";
|
||||
// IE <10 is explicitly unsupported
|
||||
if (typeof navigator !== "undefined" &&
|
||||
/MSIE [1-9]\./.test(navigator.userAgent)) {
|
||||
return;
|
||||
}
|
||||
var
|
||||
doc = view.document
|
||||
// only get URL when necessary in case Blob.js hasn't overridden it yet
|
||||
, get_URL = function() {
|
||||
return view.URL || view.webkitURL || view;
|
||||
}
|
||||
, save_link = doc.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
||||
, can_use_save_link = "download" in save_link
|
||||
, click = function(node) {
|
||||
var event = doc.createEvent("MouseEvents");
|
||||
event.initMouseEvent(
|
||||
"click", true, false, view, 0, 0, 0, 0, 0
|
||||
, false, false, false, false, 0, null
|
||||
);
|
||||
node.dispatchEvent(event);
|
||||
}
|
||||
, webkit_req_fs = view.webkitRequestFileSystem
|
||||
, req_fs = view.requestFileSystem || webkit_req_fs || view.mozRequestFileSystem
|
||||
, throw_outside = function(ex) {
|
||||
(view.setImmediate || view.setTimeout)(function() {
|
||||
throw ex;
|
||||
}, 0);
|
||||
}
|
||||
, force_saveable_type = "application/octet-stream"
|
||||
, fs_min_size = 0
|
||||
// See https://code.google.com/p/chromium/issues/detail?id=375297#c7 and
|
||||
// https://github.com/eligrey/FileSaver.js/commit/485930a#commitcomment-8768047
|
||||
// for the reasoning behind the timeout and revocation flow
|
||||
, arbitrary_revoke_timeout = 500 // in ms
|
||||
, revoke = function(file) {
|
||||
var revoker = function() {
|
||||
if (typeof file === "string") { // file is an object URL
|
||||
get_URL().revokeObjectURL(file);
|
||||
} else { // file is a File
|
||||
file.remove();
|
||||
}
|
||||
};
|
||||
if (view.chrome) {
|
||||
revoker();
|
||||
} else {
|
||||
setTimeout(revoker, arbitrary_revoke_timeout);
|
||||
}
|
||||
}
|
||||
, dispatch = function(filesaver, event_types, event) {
|
||||
event_types = [].concat(event_types);
|
||||
var i = event_types.length;
|
||||
while (i--) {
|
||||
var listener = filesaver["on" + event_types[i]];
|
||||
if (typeof listener === "function") {
|
||||
try {
|
||||
listener.call(filesaver, event || filesaver);
|
||||
} catch (ex) {
|
||||
throw_outside(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
, FileSaver = function(blob, name) {
|
||||
// First try a.download, then web filesystem, then object URLs
|
||||
var
|
||||
filesaver = this
|
||||
, type = blob.type
|
||||
, blob_changed = false
|
||||
, object_url
|
||||
, target_view
|
||||
, dispatch_all = function() {
|
||||
dispatch(filesaver, "writestart progress write writeend".split(" "));
|
||||
}
|
||||
// on any filesys errors revert to saving with object URLs
|
||||
, fs_error = function() {
|
||||
// don't create more object URLs than needed
|
||||
if (blob_changed || !object_url) {
|
||||
object_url = get_URL().createObjectURL(blob);
|
||||
}
|
||||
if (target_view) {
|
||||
target_view.location.href = object_url;
|
||||
} else {
|
||||
var new_tab = view.open(object_url, "_blank");
|
||||
if (new_tab == undefined && typeof safari !== "undefined") {
|
||||
//Apple do not allow window.open, see http://bit.ly/1kZffRI
|
||||
view.location.href = object_url
|
||||
}
|
||||
}
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch_all();
|
||||
revoke(object_url);
|
||||
}
|
||||
, abortable = function(func) {
|
||||
return function() {
|
||||
if (filesaver.readyState !== filesaver.DONE) {
|
||||
return func.apply(this, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
, create_if_not_found = {create: true, exclusive: false}
|
||||
, slice
|
||||
;
|
||||
filesaver.readyState = filesaver.INIT;
|
||||
if (!name) {
|
||||
name = "download";
|
||||
}
|
||||
if (can_use_save_link) {
|
||||
object_url = get_URL().createObjectURL(blob);
|
||||
save_link.href = object_url;
|
||||
save_link.download = name;
|
||||
click(save_link);
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch_all();
|
||||
revoke(object_url);
|
||||
return;
|
||||
}
|
||||
// prepend BOM for UTF-8 XML and text/plain types
|
||||
if (/^\s*(?:text\/(?:plain|xml)|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) {
|
||||
blob = new Blob(["\ufeff", blob], {type: blob.type});
|
||||
}
|
||||
// Object and web filesystem URLs have a problem saving in Google Chrome when
|
||||
// viewed in a tab, so I force save with application/octet-stream
|
||||
// http://code.google.com/p/chromium/issues/detail?id=91158
|
||||
// Update: Google errantly closed 91158, I submitted it again:
|
||||
// https://code.google.com/p/chromium/issues/detail?id=389642
|
||||
if (view.chrome && type && type !== force_saveable_type) {
|
||||
slice = blob.slice || blob.webkitSlice;
|
||||
blob = slice.call(blob, 0, blob.size, force_saveable_type);
|
||||
blob_changed = true;
|
||||
}
|
||||
// Since I can't be sure that the guessed media type will trigger a download
|
||||
// in WebKit, I append .download to the filename.
|
||||
// https://bugs.webkit.org/show_bug.cgi?id=65440
|
||||
if (webkit_req_fs && name !== "download") {
|
||||
name += ".download";
|
||||
}
|
||||
if (type === force_saveable_type || webkit_req_fs) {
|
||||
target_view = view;
|
||||
}
|
||||
if (!req_fs) {
|
||||
fs_error();
|
||||
return;
|
||||
}
|
||||
fs_min_size += blob.size;
|
||||
req_fs(view.TEMPORARY, fs_min_size, abortable(function(fs) {
|
||||
fs.root.getDirectory("saved", create_if_not_found, abortable(function(dir) {
|
||||
var save = function() {
|
||||
dir.getFile(name, create_if_not_found, abortable(function(file) {
|
||||
file.createWriter(abortable(function(writer) {
|
||||
writer.onwriteend = function(event) {
|
||||
target_view.location.href = file.toURL();
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch(filesaver, "writeend", event);
|
||||
revoke(file);
|
||||
};
|
||||
writer.onerror = function() {
|
||||
var error = writer.error;
|
||||
if (error.code !== error.ABORT_ERR) {
|
||||
fs_error();
|
||||
}
|
||||
};
|
||||
"writestart progress write abort".split(" ").forEach(function(event) {
|
||||
writer["on" + event] = filesaver["on" + event];
|
||||
});
|
||||
writer.write(blob);
|
||||
filesaver.abort = function() {
|
||||
writer.abort();
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
};
|
||||
filesaver.readyState = filesaver.WRITING;
|
||||
}), fs_error);
|
||||
}), fs_error);
|
||||
};
|
||||
dir.getFile(name, {create: false}, abortable(function(file) {
|
||||
// delete file if it already exists
|
||||
file.remove();
|
||||
save();
|
||||
}), abortable(function(ex) {
|
||||
if (ex.code === ex.NOT_FOUND_ERR) {
|
||||
save();
|
||||
} else {
|
||||
fs_error();
|
||||
}
|
||||
}));
|
||||
}), fs_error);
|
||||
}), fs_error);
|
||||
}
|
||||
, FS_proto = FileSaver.prototype
|
||||
, saveAs = function(blob, name) {
|
||||
return new FileSaver(blob, name);
|
||||
}
|
||||
;
|
||||
FS_proto.abort = function() {
|
||||
var filesaver = this;
|
||||
filesaver.readyState = filesaver.DONE;
|
||||
dispatch(filesaver, "abort");
|
||||
};
|
||||
FS_proto.readyState = FS_proto.INIT = 0;
|
||||
FS_proto.WRITING = 1;
|
||||
FS_proto.DONE = 2;
|
||||
|
||||
FS_proto.error =
|
||||
FS_proto.onwritestart =
|
||||
FS_proto.onprogress =
|
||||
FS_proto.onwrite =
|
||||
FS_proto.onabort =
|
||||
FS_proto.onerror =
|
||||
FS_proto.onwriteend =
|
||||
null;
|
||||
|
||||
return saveAs;
|
||||
}(
|
||||
typeof self !== "undefined" && self
|
||||
|| typeof window !== "undefined" && window
|
||||
|| this.content
|
||||
));
|
||||
// `self` is undefined in Firefox for Android content script context
|
||||
// while `this` is nsIContentFrameMessageManager
|
||||
// with an attribute `content` that corresponds to the window
|
||||
|
||||
if (typeof module !== "undefined" && module.exports) {
|
||||
module.exports.saveAs = saveAs;
|
||||
} else if ((typeof define !== "undefined" && define !== null) && (define.amd != null)) {
|
||||
define([], function() {
|
||||
return saveAs;
|
||||
});
|
||||
}
|
6
docs/3.4/assets/js/vendor/anchor.min.js
vendored
Executable file
6
docs/3.4/assets/js/vendor/anchor.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
21114
docs/3.4/assets/js/vendor/autoprefixer.js
vendored
Executable file
21114
docs/3.4/assets/js/vendor/autoprefixer.js
vendored
Executable file
File diff suppressed because one or more lines are too long
65
docs/3.4/assets/js/vendor/base64.js
vendored
Executable file
65
docs/3.4/assets/js/vendor/base64.js
vendored
Executable file
@@ -0,0 +1,65 @@
|
||||
;(function () {
|
||||
|
||||
var object =
|
||||
typeof exports != 'undefined' ? exports :
|
||||
typeof self != 'undefined' ? self : // #8: web workers
|
||||
$.global; // #31: ExtendScript
|
||||
|
||||
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
||||
|
||||
function InvalidCharacterError(message) {
|
||||
this.message = message;
|
||||
}
|
||||
InvalidCharacterError.prototype = new Error;
|
||||
InvalidCharacterError.prototype.name = 'InvalidCharacterError';
|
||||
|
||||
// encoder
|
||||
// [https://gist.github.com/999166] by [https://github.com/nignag]
|
||||
object.btoa || (
|
||||
object.btoa = function (input) {
|
||||
var str = String(input);
|
||||
for (
|
||||
// initialize result and counter
|
||||
var block, charCode, idx = 0, map = chars, output = '';
|
||||
// if the next str index does not exist:
|
||||
// change the mapping table to "="
|
||||
// check if d has no fractional digits
|
||||
str.charAt(idx | 0) || (map = '=', idx % 1);
|
||||
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
|
||||
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
|
||||
) {
|
||||
charCode = str.charCodeAt(idx += 3/4);
|
||||
if (charCode > 0xFF) {
|
||||
throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");
|
||||
}
|
||||
block = block << 8 | charCode;
|
||||
}
|
||||
return output;
|
||||
});
|
||||
|
||||
// decoder
|
||||
// [https://gist.github.com/1020396] by [https://github.com/atk]
|
||||
object.atob || (
|
||||
object.atob = function (input) {
|
||||
var str = String(input).replace(/[=]+$/, ''); // #31: ExtendScript bad parse of /=
|
||||
if (str.length % 4 == 1) {
|
||||
throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded.");
|
||||
}
|
||||
for (
|
||||
// initialize result and counters
|
||||
var bc = 0, bs, buffer, idx = 0, output = '';
|
||||
// get next character
|
||||
buffer = str.charAt(idx++);
|
||||
// character found in table? initialize bit storage and add its ascii value;
|
||||
~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
|
||||
// and if not first of each 4 characters,
|
||||
// convert the first 8 bits to one ascii character
|
||||
bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
|
||||
) {
|
||||
// try to find character in table (0-63, not found => -1)
|
||||
buffer = chars.indexOf(buffer);
|
||||
}
|
||||
return output;
|
||||
});
|
||||
|
||||
}());
|
7
docs/3.4/assets/js/vendor/clipboard.min.js
vendored
Executable file
7
docs/3.4/assets/js/vendor/clipboard.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
12
docs/3.4/assets/js/vendor/holder.min.js
vendored
Executable file
12
docs/3.4/assets/js/vendor/holder.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
5
docs/3.4/assets/js/vendor/jquery.min.js
vendored
Executable file
5
docs/3.4/assets/js/vendor/jquery.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
14
docs/3.4/assets/js/vendor/jszip.min.js
vendored
Executable file
14
docs/3.4/assets/js/vendor/jszip.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
16
docs/3.4/assets/js/vendor/less.min.js
vendored
Executable file
16
docs/3.4/assets/js/vendor/less.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
32
docs/3.4/assets/js/vendor/requestAnimationFrame-polyfill.js
vendored
Executable file
32
docs/3.4/assets/js/vendor/requestAnimationFrame-polyfill.js
vendored
Executable file
@@ -0,0 +1,32 @@
|
||||
// https://gist.github.com/paulirish/1579671
|
||||
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
|
||||
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
|
||||
|
||||
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
|
||||
|
||||
// MIT license
|
||||
|
||||
(function() {
|
||||
var lastTime = 0;
|
||||
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
|
||||
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame']
|
||||
|| window[vendors[x]+'CancelRequestAnimationFrame'];
|
||||
}
|
||||
|
||||
if (!window.requestAnimationFrame)
|
||||
window.requestAnimationFrame = function(callback, element) {
|
||||
var currTime = new Date().getTime();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||
timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
};
|
||||
|
||||
if (!window.cancelAnimationFrame)
|
||||
window.cancelAnimationFrame = function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}());
|
6
docs/3.4/assets/js/vendor/uglify.min.js
vendored
Executable file
6
docs/3.4/assets/js/vendor/uglify.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user