diff --git a/.gitignore b/.gitignore index fcb1d5d0401..6ffa504ac09 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ .#* *~ _site -*.sw? .idea diff --git a/_includes/download_widget.md b/_includes/download_widget.md index 7f473f2549b..3df4f628b95 100644 --- a/_includes/download_widget.md +++ b/_includes/download_widget.md @@ -10,7 +10,7 @@ Download
The recommended way to get the code for this project is to use a dependency management system. The snippet below can be copied and pasted into your build when you create a new project, or when adding {{ site.project }} to your project. -
+
diff --git a/_layouts/base_layout.html b/_layouts/base_layout.html index 8b4acb867dc..b8ab8e56f5d 100644 --- a/_layouts/base_layout.html +++ b/_layouts/base_layout.html @@ -10,12 +10,12 @@ - - - - - - + + + + + + @@ -25,11 +25,13 @@ - + + diff --git a/js/ZeroClipboard.min.js b/js/ZeroClipboard.min.js new file mode 100755 index 00000000000..32535fddf1b --- /dev/null +++ b/js/ZeroClipboard.min.js @@ -0,0 +1,8 @@ +/*! + * zeroclipboard + * The Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface. + * Copyright 2012 Jon Rohan, James M. Greene, . + * Released under the MIT license + * http://jonrohan.github.com/ZeroClipboard/ + * v1.1.7 + */(function(){"use strict";var a=function(a,b){var c=a.style[b];a.currentStyle?c=a.currentStyle[b]:window.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));if(c=="auto"&&b=="cursor"){var d=["a"];for(var e=0;e=0?"&":"?")+"nocache="+(new Date).getTime()},i=function(a){var b=[];return a.trustedDomains&&(typeof a.trustedDomains=="string"?b.push("trustedDomain="+a.trustedDomains):b.push("trustedDomain="+a.trustedDomains.join(","))),b.join("&")},j=function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c ';b=document.createElement("div"),b.id="global-zeroclipboard-html-bridge",b.setAttribute("class","global-zeroclipboard-container"),b.setAttribute("data-clipboard-ready",!1),b.style.position="absolute",b.style.left="-9999px",b.style.top="-9999px",b.style.width="15px",b.style.height="15px",b.style.zIndex="9999",b.innerHTML=c,document.body.appendChild(b)}a.htmlBridge=b,a.flashBridge=document["global-zeroclipboard-flash-bridge"]||b.children[0].lastElementChild};l.prototype.resetBridge=function(){this.htmlBridge.style.left="-9999px",this.htmlBridge.style.top="-9999px",this.htmlBridge.removeAttribute("title"),this.htmlBridge.removeAttribute("data-clipboard-text"),f(m,this.options.activeClass),m=null,this.options.text=null},l.prototype.ready=function(){var a=this.htmlBridge.getAttribute("data-clipboard-ready");return a==="true"||a===!0},l.prototype.reposition=function(){if(!m)return!1;var a=g(m);this.htmlBridge.style.top=a.top+"px",this.htmlBridge.style.left=a.left+"px",this.htmlBridge.style.width=a.width+"px",this.htmlBridge.style.height=a.height+"px",this.htmlBridge.style.zIndex=a.zIndex+1,this.setSize(a.width,a.height)},l.dispatch=function(a,b){l.prototype._singleton.receiveEvent(a,b)},l.prototype.on=function(a,b){var c=a.toString().split(/\s/g);for(var d=0;d'); + preEl.before(button); + var zero = new ZeroClipboard(button); + $(zero.htmlBridge).tooltip({title: "copy to clipboard", placement: 'bottom'}); +} \ No newline at end of file diff --git a/js/guide.js b/js/guide.js deleted file mode 100644 index 6b2cafb580a..00000000000 --- a/js/guide.js +++ /dev/null @@ -1,42 +0,0 @@ -ZeroClipboard.setDefaults( { moviePath: '/js/ZeroClipboard.swf' } ); - -$(document).ready(function() { - if (ZeroClipboard.detectFlashSupport()) { - createCodeCopyButtons(); - createCopyButton($('button.copy-button.github')); - } - - $('.github-actions button').click(function() { - $('.github-actions button').removeClass('active'); - $(this).addClass('active'); - - $('.clone-url').hide(); - $('.clone-url.' + $(this).data('protocol')).show(); - }); - - if (typeof(sts_import) === 'function') { - $(".gs-guide-import").show().click(function (e) { - var linkElement = e.target; - var url = linkElement.href; - sts_import("guide", url); - e.preventDefault(); - }); - } - -}); - -function createCodeCopyButtons() { - $('article .highlight pre').each(function(index) { - var codeBlockId = "code-block-"+ index; - $(this).attr('id', codeBlockId); - var button = $(''); - $(this).before(button); - createCopyButton(button); - } - ); -} - -function createCopyButton($el){ - var zero = new ZeroClipboard($el); - $(zero.htmlBridge).tooltip({title: "copy to clipboard", placement: 'bottom'}); -} \ No newline at end of file diff --git a/js/projectDocumentationWidget.js b/js/projectDocumentationWidget.js index 9f3e0dcf1c4..0eafef1d942 100644 --- a/js/projectDocumentationWidget.js +++ b/js/projectDocumentationWidget.js @@ -100,6 +100,7 @@ Spring.SnippetView = Backbone.View.extend({ var html = $("
");
     html.append(this.combinedTemplate(this.model));
     this.$el.html(html);
+    Spring.buildCopyButton(html, "snippet");
     return this;
   },
 
@@ -146,6 +147,7 @@ Spring.QuickStartSelectorView = Backbone.View.extend({
       snippetType: this.$('.js-active').data('snippet-type')
     });
     this.activeWidget.render();
+
   },
 
   changeDownloadSource: function (event) {