From: Geoff Kimball Date: Mon, 21 Mar 2016 20:20:16 +0000 (-0700) Subject: Remove extraneous JS docs code, which is already covered by foundation-docs X-Git-Tag: v2.0.0-rc.4~3^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9be9b960447eed7edd248ce82f3a6097b7d7150a;p=thirdparty%2Ffoundation%2Ffoundation-emails.git Remove extraneous JS docs code, which is already covered by foundation-docs --- diff --git a/docs/assets/js/docs.js b/docs/assets/js/docs.js index e959a624..947ba5a4 100644 --- a/docs/assets/js/docs.js +++ b/docs/assets/js/docs.js @@ -1,102 +1 @@ $(document).foundation(); - -// Adds a copy button to all code examples in the docs. - -!function() { - -ZeroClipboard.config({ - swfPath: 'https://cdn.jsdelivr.net/zeroclipboard/2.2.0/ZeroClipboard.swf' -}); - -if (!ZeroClipboard.isFlashUnusable()) { - var $buttonTemplate = $(''); - - // Look for code samples and set up a copy button on each - $('[data-docs-code]').each(function() { - var $button = $buttonTemplate.clone(); - var text = $(this).find('code').text() - .replace('<', '<') - .replace('>', '>'); - - $(this).prepend($button); - - var clipboard = new ZeroClipboard($button); - clipboard.on('copy', function(event) { - clipboard.setData('text/plain', text); - }); - - // Change the text of the copy button when it's clicked on - $button.click(function() { - $(this).text('Copied!'); - window.setTimeout(function() { - $button.text('Copy'); - }, 3000); - }); - }); -} - -}(); - -!function() { - -var source = { - limit: 10, - source: function(query, sync, async) { - query = query.toLowerCase(); - - $.getJSON('./data/search.json', function(data, status) { - async(data.filter(function(elem, i, arr) { - var name = elem.name.toLowerCase(); - var terms = [name, name.replace('-', '')].concat(elem.tags || []); - for (var i in terms) if (terms[i].indexOf(query) > -1) return true; - return false; - })); - }); - }, - display: function(item) { - return item.name; - }, - templates: { - notFound: function(query) { - return '
No results for "' + query.query + '".
'; - }, - suggestion: function(item) { - return '
' + item.name + '' + item.type + ' ' + item.description + '
'; - } - } -} - -// Search -$('[data-docs-search]') - .typeahead({ highlight: false }, source) - .on('typeahead:select', function(e, sel) { - window.location.href = sel.link; - }); - -// Auto-highlight unless it's a phone -if (!navigator.userAgent.match(/(iP(hone|ad|od)|Android)/)) { - $('[data-docs-search]').focus(); -} - -}(); - -!function() { - -var $h2s = $('.docs-component h2'); -var $toc = $('[data-docs-toc]'); - -$h2s.each(function() { - if ($(this).parents('.docs-code-live').length) return; - - var text = $(this).text(); - var anchor = $(this).children('a').attr('href'); - - $toc.append('
  • '+text+'
  • '); -}); - -if ($toc.length) { - new Foundation.Magellan($toc, {}); -} - -}(); -