diff options
| author | Zac Echola <[email protected]> | 2015-04-28 09:45:16 -0500 |
|---|---|---|
| committer | Zac Echola <[email protected]> | 2015-04-28 09:45:16 -0500 |
| commit | 407e8dc9d8d8e28d456a37d9d69e1d3c89d6fbb4 (patch) | |
| tree | d841221f51dd9852fbce1c562127158d35b8812d /docs/assets/js/src | |
| parent | e46c998316359f3368d80736d7eb750d85dc4da5 (diff) | |
| parent | e6438592e9ea28324ba1a4344e724cab28032208 (diff) | |
| download | bootstrap-407e8dc9d8d8e28d456a37d9d69e1d3c89d6fbb4.tar.xz bootstrap-407e8dc9d8d8e28d456a37d9d69e1d3c89d6fbb4.zip | |
Merge branch 'master' of https://github.com/twbs/bootstrap into list_group_buttons
Diffstat (limited to 'docs/assets/js/src')
| -rw-r--r-- | docs/assets/js/src/application.js | 47 | ||||
| -rw-r--r-- | docs/assets/js/src/customizer.js | 19 |
2 files changed, 33 insertions, 33 deletions
diff --git a/docs/assets/js/src/application.js b/docs/assets/js/src/application.js index 161f3d002..8aff80afd 100644 --- a/docs/assets/js/src/application.js +++ b/docs/assets/js/src/application.js @@ -4,7 +4,7 @@ /*! * JavaScript for Bootstrap's docs (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * Licensed under the Creative Commons Attribution 3.0 Unported License. For * details, see http://creativecommons.org/licenses/by/3.0/. */ @@ -127,7 +127,7 @@ // Config ZeroClipboard ZeroClipboard.config({ - moviePath: '/assets/flash/ZeroClipboard.swf', + swfPath: '/assets/flash/ZeroClipboard.swf', hoverClass: 'btn-clipboard-hover' }) @@ -136,39 +136,38 @@ var btnHtml = '<div class="zero-clipboard"><span class="btn-clipboard">Copy</span></div>' $(this).before(btnHtml) }) + var zeroClipboard = new ZeroClipboard($('.btn-clipboard')) var htmlBridge = $('#global-zeroclipboard-html-bridge') // Handlers for ZeroClipboard - zeroClipboard.on('load', function () { + zeroClipboard.on('ready', function () { htmlBridge .data('placement', 'top') .attr('title', 'Copy to clipboard') .tooltip() - }) - // Copy to clipboard - zeroClipboard.on('dataRequested', function (client) { - var highlight = $(this).parent().nextAll('.highlight').first() - client.setText(highlight.text()) - }) + // Copy to clipboard + zeroClipboard.on('copy', function (event) { + var highlight = $(event.target).parent().nextAll('.highlight').first() + event.clipboardData.setData('text/plain', highlight.text()) + }) - // Notify copy success and reset tooltip title - zeroClipboard.on('complete', function () { - htmlBridge - .attr('title', 'Copied!') - .tooltip('fixTitle') - .tooltip('show') - .attr('title', 'Copy to clipboard') - .tooltip('fixTitle') + // Notify copy success and reset tooltip title + zeroClipboard.on('aftercopy', function () { + htmlBridge + .attr('title', 'Copied!') + .tooltip('fixTitle') + .tooltip('show') + .attr('title', 'Copy to clipboard') + .tooltip('fixTitle') + }) }) - // Notify copy failure - zeroClipboard.on('noflash wrongflash', function () { - htmlBridge - .attr('title', 'Flash required') - .tooltip('fixTitle') - .tooltip('show') + // Hide copy button on error + zeroClipboard.on('error', function () { + $('.zero-clipboard').remove() + ZeroClipboard.destroy() }) }) @@ -177,5 +176,5 @@ ;(function () { 'use strict'; - addAnchors('.bs-docs-container h1, .bs-docs-container h2, .bs-docs-container h3, .bs-docs-container h4, .bs-docs-container h5'); + addAnchors('.bs-docs-container > h1, .bs-docs-container > h2, .bs-docs-container > h3, .bs-docs-container > h4, .bs-docs-container > h5'); })(); diff --git a/docs/assets/js/src/customizer.js b/docs/assets/js/src/customizer.js index d38a71724..a6d46b5a3 100644 --- a/docs/assets/js/src/customizer.js +++ b/docs/assets/js/src/customizer.js @@ -1,6 +1,6 @@ /*! * Bootstrap Customizer (http://getbootstrap.com/customize/) - * Copyright 2011-2014 Twitter, Inc. + * Copyright 2011-2015 Twitter, Inc. * * Licensed under the Creative Commons Attribution 3.0 Unported License. For * details, see http://creativecommons.org/licenses/by/3.0/. @@ -17,7 +17,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 ' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' + ' */\n\n' - var supportsFile = (window.File && window.FileReader && window.FileList && window.Blob) + var supportsFile = window.File && window.FileReader && window.FileList && window.Blob var importDropTarget = $('#import-drop-target') function showError(msg, err) { @@ -112,7 +112,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 js: $('#plugin-section input:checked').map(function () { return this.value }).toArray() } - if ($.isEmptyObject(data.vars) && !data.css.length && !data.js.length) return + if ($.isEmptyObject(data.vars) && !data.css.length && !data.js.length) return null return data } @@ -241,11 +241,11 @@ window.onload = function () { // wait for load in a dumb way because B-0 // 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] + if (fileInclude || fileInclude == null) lessSource += __less[filename] // Custom variables are added after Bootstrap variables so the custom // ones take precedence. - if (('variables.less' === filename) && vars) lessSource += generateCustomLess(vars) + if (filename === 'variables.less' && vars) lessSource += generateCustomLess(vars) }) lessSource = lessSource.replace(/@import[^\n]*/gi, '') // strip any imports @@ -267,8 +267,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 try { intoResult[baseFilename + '.css'] = cw + tree.toCSS() intoResult[baseFilename + '.min.css'] = cw + tree.toCSS({ compress: true }) - } - catch (compileErr) { + } catch (compileErr) { return promise.reject(compileErr) } promise.resolve() @@ -366,7 +365,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 e.stopPropagation() e.preventDefault() - var file = (e.originalEvent.hasOwnProperty('dataTransfer')) ? e.originalEvent.dataTransfer.files[0] : e.originalEvent.target.files[0] + var file = e.originalEvent.hasOwnProperty('dataTransfer') ? e.originalEvent.dataTransfer.files[0] : e.originalEvent.target.files[0] var reader = new FileReader() @@ -474,7 +473,9 @@ window.onload = function () { // wait for load in a dumb way because B-0 ).done(function (css, js, fonts) { generateZip(css, js, fonts, configJson, function (blob) { $compileBtn.removeAttr('disabled') - setTimeout(function () { saveAs(blob, 'bootstrap.zip') }, 0) + setTimeout(function () { + saveAs(blob, 'bootstrap.zip') + }, 0) }) }) }) |
