Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

W3Schools Copy Button TM

// ==UserScript==
// @name W3Schools Copy Button
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.w3schools.com/*
// @grant GM_setClipboard
//@require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
// ==/UserScript==
var $ = window.jQuery;
unsafeWindow.$=$;
unsafeWindow.copy=function (a){
GM_setClipboard(a);
}
unsafeWindow.copy2=function(){
var z='';$('.CodeMirror-line').each(function(){z+=$(this).text()+'\n'})
GM_setClipboard(z);
}

var copyf=function(){
console.log('copy');
var c=location.href.indexOf('tryit')!=-1;
var z=(c)?'\'.CodeMirror-lines\'':'this';
var $a=window.$().css({
background: "rgba(210, 98, 26, 0) url(https://bit.ly/copyicon) no-repeat scroll 0px 0px",
height: "20px",
position: "relative",
bottom: "0px",
left: "5px",
border: "0px",
float: "right",
'box-shadow':"none",
});
var $b=window.$().css({
background: "rgba(210, 98, 26, 0) url(https://bit.ly/copyicon) no-repeat scroll 0px 0px",
height: "20px",
position: "relative",
bottom: "0px",
left: "5px",
border: "0px",
float: "none",
'box-shadow':"none",
});
$('.w3-code').prepend($a);
$('.w3-bar').prepend($b)};
copyf();


This post first appeared on SMARTMANOJ, please read the originial post: here

Share the post

W3Schools Copy Button TM

×

Subscribe to Smartmanoj

Get updates delivered right to your inbox!

Thank you for your subscription

×