tianyunperfect 2 rokov pred
rodič
commit
f0ea464b69
5 zmenil súbory, kde vykonal 166 pridanie a 25 odobranie
  1. 16 0
      monkey/reload.js
  2. 5 0
      package.json
  3. 87 0
      tmp/json_sort.html
  4. 0 25
      tmp/tmp.js
  5. 58 0
      yarn.lock

+ 16 - 0
monkey/reload.js

@@ -0,0 +1,16 @@
+// ==UserScript==
+// @name              T-caht-刷新
+// @author            tianyunperfect
+// @description       简介
+// @version           1.0.0
+// @update            2021-07-08 16:16:14
+// @include           https://chat.openai.com/chat*
+
+
+// ==/UserScript==
+(async () => {
+    setInterval(()=> {
+        window.location.reload();
+    }, 10 * 60 * 1000);
+})();
+

+ 5 - 0
package.json

@@ -0,0 +1,5 @@
+{
+  "dependencies": {
+    "svg-to-excalidraw": "^0.0.2"
+  }
+}

+ 87 - 0
tmp/json_sort.html

@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Sortable JSON Data</title>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
+    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
+    <script src="https://code.jquery.com/ui/1.13.1/jquery-ui.min.js"></script>
+    <link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/smoothness/jquery-ui.css">
+    <script>
+        function copyToClipboard(str) {
+            var tempInput = document.createElement("input");
+            tempInput.style = "position: absolute; left: -1000px; top: -1000px";
+            tempInput.value = str;
+            document.body.appendChild(tempInput);
+            tempInput.select();
+            document.execCommand("copy");
+            document.body.removeChild(tempInput);
+        }
+
+        function copy() {
+            var json = JSON.stringify(getSortedData());
+            copyToClipboard(json);
+            alert("success");
+        }
+
+        function getSortedData() {
+            return $('#sortable li').map(function () {
+                return $(this).data('item');
+            }).toArray();
+        }
+
+        $(function () {
+            // 初始化上传控件
+            $('#upload').change(function () {
+                var file = this.files[0];
+                if (file) {
+                    var reader = new FileReader();
+                    reader.onload = function (e) {
+                        var data = JSON.parse(e.target.result);
+                        updateSortable(data);
+                    };
+                    reader.readAsText(file);
+                }
+            });
+
+            // 初始化拖放排序控件
+            $('#sortable').sortable({
+                axis: 'y',
+                stop: function (event, ui) {
+                    saveSortable();
+                }
+            });
+
+            // 保存排序后的数据到本地
+            function saveSortable() {
+                var data = $('#sortable li').map(function () {
+                    return $(this).data('item');
+                }).toArray();
+                var json = JSON.stringify(data);
+                var blob = new Blob([json], {type: 'application/json'});
+                var url = URL.createObjectURL(blob);
+                $('#download').attr('href', url);
+            }
+
+            // 更新拖放排序控件中的数据
+            function updateSortable(data) {
+                data.sort(function (a, b) {
+                    return (a.labels + ": " + a.name).localeCompare(b.labels + ": " + b.name);
+                });
+                $('#sortable').empty();
+                $.each(data, function (i, item) {
+                    var li = $('<li>').data('item', item);
+                    $('<div>').text(item.labels + ": " + item.name).appendTo(li);
+                    $('#sortable').append(li);
+                });
+                saveSortable();
+            }
+        });
+    </script>
+</head>
+<body>
+<input type="file" id="upload">
+<button id="copyBtn" onclick="copy()">Copy compressed JSON</button>
+<ul id="sortable"></ul>
+<a href="#" id="download" download="sorted.json">Download Sorted Data</a>
+</body>
+</html>

+ 0 - 25
tmp/tmp.js

@@ -1,25 +0,0 @@
-
-
-// ==UserScript==
-// @name              T-网站-目的
-// @author            tianyunperfect
-// @description       简介
-// @version           1.0.0
-// @update            2021-07-08 16:16:14
-// @include           *www.baidu.com*
-// @require           https://git.tianyunperfect.cn/tianyunperfect/web-base/raw/master/monkey/util.js?a=1
-// @require           https://cdn.bootcdn.net/ajax/libs/js-cookie/3.0.1/js.cookie.min.js
-
-
-// ==/UserScript==
-(async () => {
-    let elements = document.querySelector('a[data-testid="group-name"]');
-    while (true) {
-        await sleep(getRandomInt(15 * 60 * 1000, 40 * 60 * 1000));
-        window.open(getOneFromArray(elements).href);
-    }
-})();
-
-
-// @require     https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.min.js
-// @require      https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.slim.min.js

+ 58 - 0
yarn.lock

@@ -0,0 +1,58 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+chroma-js@^2.1.2:
+  version "2.4.2"
+  resolved "https://registry.npmmirror.com/chroma-js/-/chroma-js-2.4.2.tgz#dffc214ed0c11fa8eefca2c36651d8e57cbfb2b0"
+  integrity sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A==
+
+gl-matrix@^3.3.0:
+  version "3.4.3"
+  resolved "https://registry.npmmirror.com/gl-matrix/-/gl-matrix-3.4.3.tgz#fc1191e8320009fd4d20e9339595c6041ddc22c9"
+  integrity sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==
+
+nanoid@^3.1.25:
+  version "3.3.4"
+  resolved "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
+  integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==
+
+path-data-parser@0.1.0, path-data-parser@^0.1.0:
+  version "0.1.0"
+  resolved "https://registry.npmmirror.com/path-data-parser/-/path-data-parser-0.1.0.tgz#8f5ba5cc70fc7becb3dcefaea08e2659aba60b8c"
+  integrity sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==
+
+points-on-curve@0.2.0, points-on-curve@^0.2.0:
+  version "0.2.0"
+  resolved "https://registry.npmmirror.com/points-on-curve/-/points-on-curve-0.2.0.tgz#7dbb98c43791859434284761330fa893cb81b4d1"
+  integrity sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A==
+
+points-on-path@^0.2.1:
+  version "0.2.1"
+  resolved "https://registry.npmmirror.com/points-on-path/-/points-on-path-0.2.1.tgz#553202b5424c53bed37135b318858eacff85dd52"
+  integrity sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g==
+  dependencies:
+    path-data-parser "0.1.0"
+    points-on-curve "0.2.0"
+
+roughjs@^4.4.1:
+  version "4.5.2"
+  resolved "https://registry.npmmirror.com/roughjs/-/roughjs-4.5.2.tgz#aab644dcb41e9a75826c8bd5a5b0a859095f2f10"
+  integrity sha512-2xSlLDKdsWyFxrveYWk9YQ/Y9UfK38EAMRNkYkMqYBJvPX8abCa9PN0x3w02H8Oa6/0bcZICJU+U95VumPqseg==
+  dependencies:
+    path-data-parser "^0.1.0"
+    points-on-curve "^0.2.0"
+    points-on-path "^0.2.1"
+
+svg-to-excalidraw@^0.0.2:
+  version "0.0.2"
+  resolved "https://registry.npmmirror.com/svg-to-excalidraw/-/svg-to-excalidraw-0.0.2.tgz#01d4a77ab7a46d5a71e41c874d216177d0a33fc2"
+  integrity sha512-WP+RlvawFaWFqG0fVtQXjh7F+JYnox4vDdHM/iizEKtvjKLB5dih2yF+mcrGrKw7H77XlC8ScXf6zxSCkSGUAg==
+  dependencies:
+    chroma-js "^2.1.2"
+    gl-matrix "^3.3.0"
+    nanoid "^3.1.25"
+    path-data-parser "^0.1.0"
+    points-on-curve "^0.2.0"
+    points-on-path "^0.2.1"
+    roughjs "^4.4.1"