Skip to content

Instantly share code, notes, and snippets.

@wyw
Last active December 14, 2018 11:16
Show Gist options
  • Select an option

  • Save wyw/21a3f15ec4ee3c9cbf5386161052b0db to your computer and use it in GitHub Desktop.

Select an option

Save wyw/21a3f15ec4ee3c9cbf5386161052b0db to your computer and use it in GitHub Desktop.

Revisions

  1. Yuanwei Wu revised this gist Dec 14, 2018. 1 changed file with 29 additions and 32 deletions.
    61 changes: 29 additions & 32 deletions pve-ip.user.js
    Original file line number Diff line number Diff line change
    @@ -5,35 +5,32 @@
    // @include https://*:8006/*
    // ==/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);
    });

    })();
    (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);
    });
  2. Yuanwei Wu revised this gist Dec 14, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions pve-ip.user.js
    Original 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() {
  3. Yuanwei Wu renamed this gist Dec 14, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Yuanwei Wu created this gist Dec 14, 2018.
    38 changes: 38 additions & 0 deletions pve-ip.js
    Original 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);
    });

    })();