-
Notifications
You must be signed in to change notification settings - Fork 0
/
line2ez
67 lines (63 loc) · 2.8 KB
/
line2ez
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
<html>
<head>line</head>
<body>
網址:
<br> <textarea id="url" rows="1" cols="100">http://dl.camimg.line.naver.jp/linecamera/res2/stamp/</textarea><br>
A末檔名稱(首位數字): <input type="text" id="aname"><br>
B末檔名稱(不包括前後數字): <input type="text" id="bname"><br>
D末檔名稱(末位數字,前面沒有0): <input type="text" id="dname"><br>
<input type="radio" name="myRadios" onclick="temp(this)" value="1" checked/>模板1(3位)
<input type="radio" name="myRadios" onclick="temp(this)" value="2" />模板2(2位)
<input type="radio" name="myRadios" onclick="temp(this)" value="3" />模板3(2位無ID)</br>
<button type="button" onclick="mode='o';f()"> Android</button>
<button type="button" onclick="mode='i';f()"> iOS</button>
<button type="button" onclick="mode='a';f()"> Other</button>
<br>
<textarea id="out" readonly rows="30" cols="100"></textarea>
</body>
<script>
var mode = 'o',tmp = 1;
var url = document.getElementById('url');
var box = document.getElementById('out');
var a = document.getElementById('and'),b = document.getElementById('ios'),c=document.getElementById('otr');
var aname = document.getElementById('aname'),bname = document.getElementById('bname'),
dname = document.getElementById('dname');
function temp(e){
tmp = parseInt(e.value);
}
function f(){
var output = "";
switch (tmp) {
case 2:
var _url = url.value + aname.value + '/' + aname.value + bname.value;
var n = parseInt(dname.value);
for(var i = n;i>0;i--){
output += (_url + zero(i,2) + '_'+ mode +'.png'+'\r\n');
}
break;
case 3:
var _url = url.value + aname.value + '/' + bname.value;
var n = parseInt(dname.value);
for(var i = n;i>0;i--){
output += (_url + zero(i,2) + '_'+ mode +'.png'+'\r\n');
}
break;
case 1:
var _url = url.value + aname.value + '/' + aname.value + bname.value;
var n = parseInt(dname.value);
for(var i = n;i>0;i--){
output += (_url + zero(i,3) + '_'+ mode +'.png'+'\r\n');
}
break;
}
box.value = output;
}
function zero(n,i){
var _n = n + '';
for(var t = _n.length;t<i;t++){
_n = '0' + _n;
}
return _n;
}
</script>
</html>