From 8ae48183b236d4db104fa165b8aea762d70b9d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatan=20Vasovi=C4=87?= Date: Mon, 24 Mar 2014 21:47:59 +0100 Subject: Fix #13138: use underscore prefix to ignore directories --- docs/assets/js/src/application.js | 106 -------------------------------------- 1 file changed, 106 deletions(-) delete mode 100644 docs/assets/js/src/application.js (limited to 'docs/assets/js/src/application.js') diff --git a/docs/assets/js/src/application.js b/docs/assets/js/src/application.js deleted file mode 100644 index 678c6eace..000000000 --- a/docs/assets/js/src/application.js +++ /dev/null @@ -1,106 +0,0 @@ -// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT -// IT'S ALL JUST JUNK FOR OUR DOCS! -// ++++++++++++++++++++++++++++++++++++++++++ - -/*! - * JavaScript for Bootstrap's docs (http://getbootstrap.com) - * Copyright 2011-2014 Twitter, Inc. - * Licensed under the Creative Commons Attribution 3.0 Unported License. For - * details, see http://creativecommons.org/licenses/by/3.0/. - */ - - -!function ($) { - - $(function () { - - // IE10 viewport hack for Surface/desktop Windows 8 bug - // - // See Getting Started docs for more information - 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) - } - - - var $window = $(window) - var $body = $(document.body) - - var navHeight = $('.navbar').outerHeight(true) + 10 - - $body.scrollspy({ - target: '.bs-docs-sidebar', - // offset: navHeight - }) - - $window.on('load', function () { - $body.scrollspy('refresh') - }) - - $('.bs-docs-container [href=#]').click(function (e) { - e.preventDefault() - }) - - // back to top - 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) - - // tooltip demo - $('.tooltip-demo').tooltip({ - selector: '[data-toggle=tooltip]', - container: 'body' - }) - - $('.tooltip-test').tooltip() - $('.popover-test').popover() - - $('.bs-docs-navbar').tooltip({ - selector: 'a[data-toggle=tooltip]', - container: '.bs-docs-navbar .nav' - }) - - // popover demo - $('.bs-docs-popover').popover() - - // Popover dismiss on next click - $('.bs-docs-popover-dismiss').popover({ - trigger: 'focus' - }) - - // button state demo - $('#loading-example-btn') - .click(function () { - var btn = $(this) - btn.button('loading') - setTimeout(function () { - btn.button('reset') - }, 3000) - }) - }) - -}(jQuery) -- cgit v1.2.3 From 92fd25a2a29dbef6b47ba932e9ba836150b93eeb Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 3 Jul 2014 13:18:44 -0700 Subject: use non-minified docs JS on non-gh-pages --- docs/assets/js/src/application.js | 169 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 docs/assets/js/src/application.js (limited to 'docs/assets/js/src/application.js') diff --git a/docs/assets/js/src/application.js b/docs/assets/js/src/application.js new file mode 100644 index 000000000..792fc9779 --- /dev/null +++ b/docs/assets/js/src/application.js @@ -0,0 +1,169 @@ +// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT +// IT'S ALL JUST JUNK FOR OUR DOCS! +// ++++++++++++++++++++++++++++++++++++++++++ + +/*! + * JavaScript for Bootstrap's docs (http://getbootstrap.com) + * Copyright 2011-2014 Twitter, Inc. + * Licensed under the Creative Commons Attribution 3.0 Unported License. For + * details, see http://creativecommons.org/licenses/by/3.0/. + */ + +/* global ZeroClipboard */ + +!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() + + // Default & dismissible popover demos + $('.bs-docs-popover').popover() + $('.bs-docs-popover-dismiss').popover({ trigger: 'focus' }) + + // Button state demo + $('#loading-example-btn').click(function () { + var btn = $(this) + btn.button('loading') + setTimeout(function () { + btn.button('reset') + }, 3000) + }) + + + // Config ZeroClipboard + ZeroClipboard.config({ + moviePath: '/assets/flash/ZeroClipboard.swf', + hoverClass: 'btn-clipboard-hover' + }) + + // Insert copy to clipboard button before .highlight or .bs-example + $('.highlight').each(function () { + var highlight = $(this) + var previous = highlight.prev() + var btnHtml = '
Copy
' + + if (previous.hasClass('bs-example')) { + previous.before(btnHtml.replace(/btn-clipboard/, 'btn-clipboard with-example')) + } else { + highlight.before(btnHtml) + } + }) + var zeroClipboard = new ZeroClipboard($('.btn-clipboard')) + var htmlBridge = $('#global-zeroclipboard-html-bridge') + + // Handlers for ZeroClipboard + zeroClipboard.on('load', 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()) + }) + + // 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 failure + zeroClipboard.on('noflash wrongflash', function () { + htmlBridge + .attr('title', 'Flash required') + .tooltip('fixTitle') + .tooltip('show') + }) + + }) + +}(jQuery) -- cgit v1.2.3