Last active
December 14, 2018 11:16
-
-
Save wyw/21a3f15ec4ee3c9cbf5386161052b0db to your computer and use it in GitHub Desktop.
Revisions
-
Yuanwei Wu revised this gist
Dec 14, 2018 . 1 changed file with 29 additions and 32 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,35 +5,32 @@ // @include https://*:8006/* // ==/UserScript== (function (i, s, o, g, r, c, a, m) { i['global_clipboard'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; a.onload = c; m.parentNode.insertBefore(a, m); })(window, document, 'script', 'https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js', 'ga', function onload() { var reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/g; var itv = null; var list = []; function handleClick(t) { setTimeout(() => { t.style.color = 'green'; }, 1000); t.style.color = 'inherit'; return t.innerHTML.match(reg)[0]; } function applyClipboard() { var l = Array.from(document.querySelectorAll('label')).filter(i => i.textContent.match(reg))[0]; if (typeof l !== 'undefined') { if (list.indexOf(l) === -1) { list.push(l); l.style.color = 'green'; new ClipboardJS(l, { text: handleClick}); return; } } } itv = setInterval(applyClipboard, 500); }); -
Yuanwei Wu revised this gist
Dec 14, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ // @name PVE IP // @namespace http://tampermonkey.net/ // @version 0.1 // @include https://*:8006/* // ==/UserScript== (function() { -
Yuanwei Wu renamed this gist
Dec 14, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Yuanwei Wu created this gist
Dec 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ // ==UserScript== // @name PVE IP // @namespace http://tampermonkey.net/ // @version 0.1 // ==/UserScript== (function() { (function (i, s, o, g, r, c, a, m) { i['global_clipboard'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; a.onload = c; m.parentNode.insertBefore(a, m); })(window, document, 'script', 'https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js', 'ga', function onload() { var reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/g; var itv = null; var list = []; function handleClick(t) { setTimeout(() => { t.style.color = 'green'; }, 1000); t.style.color = 'inherit'; return t.innerHTML.match(reg)[0]; } function applyClipboard() { var l = Array.from(document.querySelectorAll('label')).filter(i => i.textContent.match(reg))[0]; if (typeof l !== 'undefined') { if (list.indexOf(l) === -1) { list.push(l); l.style.color = 'green'; new ClipboardJS(l, { text: handleClick}); return; } } } itv = setInterval(applyClipboard, 500); }); })();