-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTMS.js
88 lines (83 loc) · 2.66 KB
/
TMS.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// ==UserScript==
// @name Eyny Link Grab
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Grab links from Eyny.
// @author Me
// @match http://video.eyny.com/*
// @grant none
// ==/UserScript==
function createCopyLinkBtn() {
var newbutton = document.createElement("button");
var directLinkParentElem = document.getElementById("ajaxwaitid");
newbutton.innerHTML = "Copy";
newbutton.className = "button";
newbutton.id = "copylinkbtn";
newbutton.style.border = "1px solid #3a90f2";
newbutton.style.padding = "7 px 13px 7px 13px";
newbutton.style.backgroundColor = "#3A90F2";
newbutton.style.color = "#fff";
newbutton.style.fontSize = "13px";
newbutton.addEventListener("click", function() {
var ajaxw8 = document.getElementById("ajaxwaitid");
var textBox = ajaxw8.firstChild;
textBox.select();
document.execCommand('copy');
});
directLinkParentElem.appendChild(newbutton);
}
function createNewTabBtn() {
var newbutton = document.createElement("button");
var directLinkParentElem = document.getElementById("ajaxwaitid");
newbutton.innerHTML = "New Tab";
newbutton.className = "button";
newbutton.id = "newtabbtn";
newbutton.style.border = "1px solid #f50";
newbutton.style.padding = "7 px 13px 7px 13px";
newbutton.style.backgroundColor = "#f50";
newbutton.style.color = "#fff";
newbutton.style.fontSize = "13px";
//margin:2px; border:1px solid #3A90F2; padding:7px 13px 7px 13px; background-color: #3A90F2; font-weight:bold; color: #fff; font-size:13px; border-radius:5px;
newbutton.addEventListener("click", function() {
window.open(video.currentSrc,'_blank');
});
directLinkParentElem.appendChild(newbutton);
}
function reloadButtons() {
var copyLinkButton = document.getElementById("copylinkbtn");
var newTabButton = document.getElementById("newtabbtn");
if (copyLinkButton == null) {
console.log("copylinkbtn != Null");
createCopyLinkBtn();
} else {
copyLinkButton.remove();
}
if (newTabButton == null) {
console.log("newtabbtn != Null");
createNewTabBtn();
} else {
newTabButton.remove();
}
}
(function() {
'use strict';
var videoLINK = video.currentSrc;
if (videoLINK == "") {
console.log("No link found");
return;
}
var text = document.createElement("textarea");
text.style.width = "98%";
text.style.height = "15px";
text.row = 1;
text.readOnly = true;
text.wrap = "soft";
text.style.resize = "none";
var t = document.createTextNode(video.currentSrc);
text.appendChild(t);
document.getElementById("ajaxwaitid").appendChild(text);
video.controlsList = "download";
//document.write("<h1>" + video.currentSrc + "</h1>");
//alert(video.currentSrc);
reloadButtons();
})();