Skip to content

Commit

Permalink
Fix #132: Add copy to clipboard feature in docs(#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
krtkvrm authored and RishabhJain2018 committed Feb 12, 2019
1 parent 9dff6f2 commit 24b1e48
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 22 deletions.
33 changes: 33 additions & 0 deletions docs/assets/active.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,36 @@ function scroll_to_anchor(anchor_id){
$("#main-button").click(function() {
scroll_to_anchor('examples');
});

$(document).ready(function() {
$("body").tooltip({ selector: '[data-toggle=tooltip]' });
$.notify.addStyle('notification', {
html: "<div><span data-notify-text/></div>",
classes: {
base: {
"white-space": "nowrap",
"color": "grey",
"background-color": "#d3d3d3",
"padding": "5px",
"border-radius": "4px",
"width": "auto",
"font-weight": "600"
},

}
});
});



function CopyToClipboard(elementId) {
var aux = document.createElement("input");
aux.setAttribute("value", document.getElementById(elementId).innerHTML);
document.body.appendChild(aux);
aux.select();
document.execCommand("copy");
document.body.removeChild(aux);
$.notify("Command copied to clipboard", {
style: 'notification'
});
}
14 changes: 14 additions & 0 deletions docs/assets/evalai.css
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,20 @@ footer ul.primary-nav li:last-child a {
width: calc(100% - 180px);
padding: 15px 25px;
}
.command .copybtn {
background-color: #f7f7f7;
float: right;
height: 22px !important;
line-height: 15px !important;
border: 1px solid grey !important;
font-weight: 600;
font-size: 14px;
padding: 0 3% !important;
}

.command .copybtn:hover {
background-color: darkgray !important;
}
.projects-tutorials {
background-color: #f7f7f7;
padding: 90px 0 20px;
Expand Down
1 change: 1 addition & 0 deletions docs/assets/notify.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 24b1e48

Please sign in to comment.