cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject [3/3] docs commit: Added zeroclipboard for all copy links. This closes #319.
Date Thu, 27 Aug 2015 22:22:33 GMT
Added zeroclipboard for all copy links. This closes #319.


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/00f07c3c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/00f07c3c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/00f07c3c

Branch: refs/heads/cordova-website
Commit: 00f07c3cb3d3807620afae5a0538330a172d90d2
Parents: f288a59
Author: riknoll <riknoll@microsoft.com>
Authored: Thu Aug 27 15:08:31 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Thu Aug 27 15:22:14 2015 -0700

----------------------------------------------------------------------
 www/index.html                      |   22 +-
 www/static/js/lib/ZeroClipboard.js  | 2581 ++++++++++++++++++++++++++++++
 www/static/js/lib/ZeroClipboard.swf |  Bin 0 -> 6580 bytes
 www/static/plugins/plugin.jsx       |   38 +-
 4 files changed, 2621 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/00f07c3c/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
index e8d6894..892748e 100644
--- a/www/index.html
+++ b/www/index.html
@@ -80,7 +80,7 @@ permalink: /
         <div class="col-md-4">
             <div class="well_code">
                 <div>
-                    <button type="button" class="btn btn btn-primary pull-right">Copy</button>
+                    <button id="copy-npm-install" type="button" class="btn btn btn-primary
pull-right">Copy</button>
                 </div>
                 $ npm install -g cordova
             </div>
@@ -98,7 +98,7 @@ permalink: /
         <div class="col-md-4">
             <div class="well_code">
                 <div>
-                    <button type="button" class="btn btn btn-primary pull-right">Copy</button>
+                    <button id="copy-cordova-create" type="button" class="btn btn btn-primary
pull-right">Copy</button>
                 </div>
                 $ cordova create MyApp
             </div>
@@ -117,7 +117,7 @@ permalink: /
         <div class="col-md-4">
             <div class="well_code">
                 <div>
-                    <button type="button" class="btn btn btn-primary pull-right">Copy</button>
+                    <button id="copy-cordova-platform-add" type="button" class="btn btn
btn-primary pull-right">Copy</button>
                 </div>
                 <p>$ cd MyApp</p>
                 <p>$ cordova platform add browser</p>
@@ -136,7 +136,7 @@ permalink: /
         <div class="col-md-4">
             <div class="well_code">
                 <div>
-                    <button type="button" class="btn btn btn-primary pull-right">Copy</button>
+                    <button id="copy-cordova-run" type="button" class="btn btn btn-primary
pull-right">Copy</button>
                 </div>
                 $ cordova run browser
             </div>
@@ -223,3 +223,17 @@ permalink: /
 
 	});
 </script>
+<script src="{{site.baseurl}}/static/js/lib/ZeroClipboard.js"></script>
+<script>
+    var addCopyText = function(elementId, copyText) {
+        new ZeroClipboard(document.getElementById(elementId))
+            .on("copy", function(event) {
+                event.clipboardData.setData("text/plain", copyText);
+            });
+    }
+
+    addCopyText("copy-npm-install", "npm install -g cordova");
+    addCopyText("copy-cordova-create", "cordova create MyApp");
+    addCopyText("copy-cordova-platform-add", "cd MyApp\ncordova platform add browser");
+    addCopyText("copy-cordova-run", "cordova run browser");
+</script>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message