dotfiles/.js/default.js

20 lines
466 B
JavaScript
Raw Normal View History

2016-09-09 22:33:05 +00:00
function addStyle(style) {
2016-09-10 16:10:47 +00:00
let el = $("style#dotjs-style");
if (!el.length) {
$("body").after(`<style id="dotjs-style">${style}</style>`);
} else {
$("style#dotjs-style").append(style);
}
2016-09-10 16:08:12 +00:00
}
function copyToClipBoard(text) {
let textArea = $("<textarea></textarea>");
textArea.css("opacity", "0");
textArea.css("position", "fixed");
textArea.val(text);
$("body").append(textArea);
textArea.select();
document.execCommand("copy");
textArea.remove();
2016-09-09 22:33:05 +00:00
}