Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var ctrlDown = false,
- ctrlKey = 17,
- cmdKey = 91,
- vKey = 86,
- cKey = 67;
- $(document).keydown(function(e) {
- if (e.keyCode == ctrlKey || e.keyCode == cmdKey) ctrlDown = true;
- }).keyup(function(e) {
- if (e.keyCode == ctrlKey || e.keyCode == cmdKey) ctrlDown = false;
- });
- $(".no-copy-paste").keydown(function(e) {
- if (ctrlDown && (e.keyCode == vKey || e.keyCode == cKey)) return false;
- });
- // Document Ctrl + C/V
- $(document).keydown(function(e) {
- if (ctrlDown && (e.keyCode == cKey)) { $("a").hover(function() {
- // var URL = $(this).attr("href");
- var URL = (this.href);
- GM_setClipboard(URL);
- window.location.href = 'ms-word:ofe|u|https://sssssss.sharepoint.com/:w:/r/clients/Client%20Documents/T/BLAH%20BLAH/BLAH.docx';
- // window.location.assign("https://www.w3schools.com");
- // window.location = 'https://www.yahoo.com';
- console.log('"'+URL+'" copied to clipboard');
- });}
- if (ctrlDown && (e.keyCode == vKey)) { $("a").hover(function() {
- // var URL = $(this).attr("href");
- var URL = (this.href);
- GM_setClipboard(URL);
- var mystr = "ms-word:ofe|u|";
- mystr = mystr + URL;
- console.log('"'+URL+'" copied to clipboard');
- console.log('"'+mystr+'" is now loaded');
- });}
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement