-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathphp_array_to_txt.html
132 lines (128 loc) · 4.71 KB
/
php_array_to_txt.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html>
<head>
<meta content="text/html" charset="UTF-8">
<meta name="viewport" content="width=502">
<title>PHP array to txt - Wheiss' tools</title>
<link rel="Shortcut Icon" href="ico/illust_73070421.webp" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/default.css">
</head>
<body>
<div>
<h5 style="user-select:none !important;" id="un_copy_Para">A tool for converting PHP array into txt-format list.</h5>
</div>
<style>
.user_path_1-textarea {
width: 339.2px;
height: 18.4px;
}
.user_path_2-textarea {
width: 100.8px;
height: 18.4px;
}
.arr_data-textarea {
width: 460px;/*宽度*/
height: 248px;/*高度*/
}
.result-textarea {
width: 460px;
height: 248px;
background-color: #e6e6fa;
}
.submit-button {
margin:0.25% 8px 0.25% 66px;
padding: 4px 8px;
}
.copy-button {
margin:0.25% 0.25% 0.25% 8px;
padding: 4px 12px;
background-color: #e6e6fa;
}
</style>
<form action="api/php_array_to_txt.php" method="POST">
<div>
<textarea name="user_path_1" class="user_path_1-textarea" placeholder="[inessential]https://host/filename/"></textarea>
<textarea name="user_path_2" class="user_path_2-textarea" placeholder="[inessential]$HD"></textarea>
</div>
<div>
<textarea name="arr_data" class="arr_data-textarea" placeholder="[essential]'cctv1' => 'cctv1hd8m/80',//CCTV1
/* 'cctv2' => 'cctv2hd8m/80',//CCTV2
'cctv3' => 'cctv38m/80',//CCTV3
'cctv4' => 'cctv4hd8m/80',//CCTV4*/
// 'cctv5' => 'cctv58m/80',//CCTV5
'cctv6' => 'cctv6hd8m/80',//CCTV6
# 'cctv7' => 'cctv7hd8m/80',//CCTV7
'cctv8' => 'cctv8hd8m/80',//CCTV8
etc.
'cctv1hd8m/80',//CCTV1
/* 'cctv2hd8m/80',//CCTV2
'cctv38m/80',//CCTV3
'cctv4hd8m/80',//CCTV4*/
// 'cctv58m/80',//CCTV5
'cctv6hd8m/80',//CCTV6
# 'cctv7hd8m/80',//CCTV7
'cctv8hd8m/80',//CCTV8
etc."></textarea>
</div>
<div>
<input type="checkbox" name="scheme" value="1" id="scheme">
<label for="scheme"><span class="p2" style="user-select:none !important;" id="un_copy_Para">Original ID</span></label>
<input type="checkbox" name="scheme2" value="1" id="scheme2">
<label for="scheme2"><span class="p2" style="user-select:none !important;" id="un_copy_Para">Ignore notes</span></label>
<button type="submit" class="submit-button" style="user-select:none !important;" id="un_copy_Para">Submit</button>
<button onclick="copyToClipboard()" class="copy-button" style="user-select:none !important;" id="un_copy_Para">Copy</button>
</div>
</form>
<div>
<textarea id="result" class="result-textarea" readonly placeholder="CCTV1,https://host/filename/cctv1$HD
CCTV6,https://host/filename/cctv6$HD
CCTV8,https://host/filename/cctv8$HD
Or select the option 'Original ID' to convert into
CCTV1,https://host/filename/cctv1hd8m/80$HD
CCTV6,https://host/filename/cctv6hd8m/80$HD
CCTV8,https://host/filename/cctv8hd8m/80$HD
etc."></textarea>
</div>
<hr>
<div>
<span class="p1" style="user-select:none !important;" id="un_copy_Para"><a href="javascript:;" onClick="javascript:history.back(-1);">Previous</a></span>
<span class="p1" style="user-select:none !important;" id="un_copy_Para">Author: <a href="https://www.wheiss.com/">Wheiss</a> Source Code: <a href="https://github.com/WheissCherry/Wheiss-tools/">Github</a> Version: <a href="https://github.com/WheissCherry/Wheiss-tools/releases/tag/v1.9">1.4</a></span>
<span class="p1" style="user-select:none !important;" id="un_copy_Para"><a href="/">Home</a></span>
</div>
<script>
function copyToClipboard() {
const resultTextarea = document.getElementById('result');
resultTextarea.select();
document.execCommand('copy');
}
const form = document.querySelector('form');
form.addEventListener('submit', function(event) {
event.preventDefault();
const arr_data = document.querySelector('textarea[name="arr_data"]').value;
const user_path_1 = document.querySelector('textarea[name="user_path_1"]').value;
const user_path_2 = document.querySelector('textarea[name="user_path_2"]').value;
const scheme = document.querySelector('input[name="scheme"]').checked ? document.querySelector('input[name="scheme"]').value : '';
const scheme2 = document.querySelector('input[name="scheme2"]').checked ? document.querySelector('input[name="scheme2"]').value : '';
fetch('api/php_array_to_txt.php', {
method: 'POST',
body: new URLSearchParams({
arr_data: arr_data,
user_path_1: user_path_1,
user_path_2: user_path_2,
scheme: scheme,
scheme2: scheme2
})
})
.then(response => response.text())
.then(processedData => {
const resultTextarea = document.getElementById('result');
resultTextarea.value = processedData;
});
});
document.getElementById("un_copy_Para").oncopy = function(event) {
event.clipboardData.setData("text/plain", "");
event.preventDefault();
};
</script>
</body>
</html>