-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
97 lines (80 loc) · 3.26 KB
/
index.html
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
89
90
91
92
93
94
95
96
97
<html>
<head>
<title>UserStyle Generator</title>
<link rel="stylesheet" type="text/css" href="index.css" media="screen"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"> </script>
<script src="CheckBox.js"> </script>
<p><b>PLEASE NOTE:</b> it is recomended you minify your css first, you can do so <a target="_blank" href="https://www.toptal.com/developers/cssminifier">here</a>.</p>
<p>Name: <input class="item1" id="NAMEtHingy"></input></p>
<p>Namespace: <input id="NAMESPACEtHingy"></input></p>
<p>Version: <input id="VERSIONtHingy"></input></p>
<p>Description: <input id="DESCRIPTIONtHingy"></input></p>
<p>Author: <input id="AUTHORtHingy"></input></p>
<p>Website: <input id="MATCHtHingy"></input></p>
<p>CSS: <input id="CSStHingy"></input></p>
<p><label for="HideGen">Hide Generated:</label>
<input style="left: 131px;" type="checkbox" id="HideGen" onclick="CheckHideGen()"></p>
<button onclick="minify();THINNGY();">Generate UserStyle</button>
<script>
function minify() {
if (ShowGen == 1) {
document.getElementById('TheUserStyle').style = "display:block";
var str = document.getElementById('CSStHingy').value;
str = str.replace(/\s\s+/g, ' ');
document.getElementById("TheStyles").innerHTML = str;
} else {
document.getElementById('TheUserStyle').style = "display:none";
var str = document.getElementById('CSStHingy').value;
str = str.replace(/\s\s+/g, ' ');
document.getElementById("TheStyles").innerHTML = str;
}
}
function THINNGY() {
var str = document.getElementById('MATCHtHingy').value;
str = str.replace(/\s/g,'%20');
str = str.replace(/https/g,'*');
str = str.replace(/http/g,'*');
document.getElementById("mAtch").innerHTML = str;
var str = document.getElementById('AUTHORtHingy').value;
document.getElementById("aUthor").innerHTML = str;
var str = document.getElementById('DESCRIPTIONtHingy').value;
document.getElementById("dEscription").innerHTML = str;
var str = document.getElementById('VERSIONtHingy').value;
document.getElementById("vErsion").innerHTML = str;
var str = document.getElementById('NAMESPACEtHingy').value;
document.getElementById("nAmesPace").innerHTML = str;
var str = document.getElementById('NAMEtHingy').value;
document.getElementById("nAme").innerHTML = str;
if (ShowGen == 0) {
copyToClipboard('#TheUserStyle');
} else {
return;
}
}
function copyToClipboard(element) {
var $temp = $("<textarea>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand("copy");
$temp.remove();
alert('UserStyle has been copied');
}
</script>
<br/><br/><button onclick="copyToClipboard('#TheUserStyle')">Copy UserStyle</button>
<pre id="TheUserStyle" style="display:none">
// ==UserScript==
// @name <span id="nAme"></span>
// @namespace <span id="nAmesPace">http://tampermonkey.net/</span>
// @version <span id="vErsion">0.1</span>
// @description <span id="dEscription"></span>
// @author <span id="aUthor"></span>
// @match <span id="mAtch"></span>
// @grant GM_addStyle
// ==/UserScript==
<white>GM_addStyle(<yellow>`<span id="TheStyles"></span>`</yellow>);</white>
</pre>
</body>
</html>