diff --git a/examples/resources/common.js b/examples/resources/common.js index cf08daeb91..623f8bea92 100644 --- a/examples/resources/common.js +++ b/examples/resources/common.js @@ -1,6 +1,10 @@ (function() { - var clipboard = new Clipboard('#copy-button'); - clipboard.on('success', function(e) { + var htmlClipboard = new Clipboard('#copy-html-button'); + htmlClipboard.on('success', function(e) { + e.clearSelection(); + }); + var jsClipboard = new Clipboard('#copy-js-button'); + jsClipboard.on('success', function(e) { e.clearSelection(); }); diff --git a/examples/resources/layout.css b/examples/resources/layout.css index 021776f301..3cc66a1072 100644 --- a/examples/resources/layout.css +++ b/examples/resources/layout.css @@ -91,13 +91,13 @@ pre[class*="language-"] { background: #FFFFFF; } -#source-controls { +.source-controls { position: absolute; margin-top: 20px; right: 40px; } -#source-controls a { +.source-controls a { margin-left: 15px; } diff --git a/examples/templates/example.html b/examples/templates/example.html index 5ecbafe2c4..83fc621c19 100644 --- a/examples/templates/example.html +++ b/examples/templates/example.html @@ -113,8 +113,7 @@
-
- Copy +
@@ -125,7 +124,12 @@
-
<!DOCTYPE html>
+        
+
index.html
+
+ Copy +
+
<!DOCTYPE html>
 <html>
   <head>
     <title>{{ title }}</title>
@@ -138,10 +142,15 @@
 {{ indent css.source spaces=6 }}    </style>{{/if}}
   </head>
   <body>
-{{ indent contents spaces=4 }}    <script>
-{{ indent js.source spaces=6 }}    </script>
+{{ indent contents spaces=4 }}    <script src="index.js"></script>
   </body>
 </html>
+
+
index.js
+
+ Copy +
+
{{ js.source }}