+++ /dev/null
-// Adds a copy button to all code examples in the docs.
-
-!function() {
-
-// Look for code samples and set up a copy button on each
-$('[data-docs-code]').each(function(index, value) {
- var copyBtnId = 'copy-btn-' + index.toString();
- var $button = $('<button class="docs-code-copy" id="' + copyBtnId + '">Copy</button>');
-
- var text = $(this).find('code').text()
- .replace('<', '<')
- .replace('>', '>');
-
- $(this).prepend($button);
-
- var clipboard = new Clipboard('#' + copyBtnId, {
- text: function() {
- return text;
- }
- });
-
- // Change the text of the copy button when it's clicked on
- clipboard.on('success', function(event) {
- $button.text('Copied!');
- window.setTimeout(function() {
- $button.text('Copy');
- }, 3000);
- });
-
- // Log errors on copy failure
- clipboard.on('error', function(event) {
- console.error('Action:', event.action);
- console.error('Trigger:', event.trigger);
- });
-});
-
-}()
\ No newline at end of file
+++ /dev/null
-!function() {
-
-$ks = $('#docs-kitchen-sink');
-if (!$ks.length) return;
-
-$ks.find('[data-docs-code]').each(function() {
- var $code = $(this);
-
- $link = $('<a class="docs-code-toggle">Toggle Code</a>');
- $link.on('click.docs', function() {
- $code.slideToggle(250);
- });
- $link.insertBefore(this);
- $code.addClass('kitchen-sink').hide(0);
-});
-
-}()
\ No newline at end of file
+++ /dev/null
-!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 '<div class="tt-empty">No results for "' + query.query + '".</div>';
- },
- suggestion: function(item) {
- return '<div><span class="name">' + item.name + '<span class="meta">' + item.type + '</span></span> <span class="desc">' + item.description + '</span></div>';
- }
- }
-}
-
-// 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();
-}
-
-}()
\ No newline at end of file
+++ /dev/null
-!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('<li><a href="'+anchor+'">'+text+'</a></li>');
-});
-
-if ($toc.length) {
- new Foundation.Magellan($toc, {});
-}
-
-}()
var DOCS = [
'node_modules/clipboard/dist/clipboard.js',
'node_modules/corejs-typeahead/dist/typeahead.bundle.js',
+ 'node_modules/foundation-docs/js/**/*.js',
'docs/assets/js/docs.*.js',
'docs/assets/js/docs.js'
];