-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
233 lines (195 loc) · 9 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<html>
<head>
<script>
typename = ["normal","bug","dark","dragon","electric","fairy","fighting","fire","flying","ghost","grass","ground","ice","poison","psychic","rock","steel","water"]
pokecheck = [["aipom dunsparce teddiursa lillipup ","loudred kecleon audino minccino ","chansey ditto eevee smeargle "],["butterfree paras ledyba combee ","beautifly masquerain volbeat illumise ","venomoth pinsir heracross vivillon "],["mightyena nuzleaf pawniard vullaby ","sneasel cacturne crawdaunt sandile ","sableye absol liepard inkay "],["gabite fraxure ","dragonair shelgon noibat ","druddigon sliggoo "],["electrode pachirisu emolga dedenne ","pikachu electabuzz stunfisk helioptile ","manectric luxio zebstrika galvantula "],["togepi snubbull kirlia dedenne ","jigglypuff mawile spritzee swirlix ","clefairy floette "],["mankey machoke meditite mienfoo ","throh sawk pancham ","tyrogue breloom hariyama riolu "],["growlithe ponyta magmar pansear ","charmeleon slugma larvesta pyroar ","ninetales braixen fletchinder "],["pidgey spearow farfetchd doduo ","hoothoot tranquill woobat swanna ","tropius rufflet fletchinder hawlucha "],["shuppet lampent ","phantump pumpkaboo ","dusclops drifblim spiritomb golurk "],["oddish tangela sunkern pansage ","ivysaur swadloon petilil sawsbuck ","maractus quilladin gogoat "],["sandshrew wooper phanpy trapinch ","dugtrio marowak nincada camerupt ","gastrodon palpitoad diggersby "],["delibird snorunt spheal snover ","sneasel beartic bergmite ","dewgong cloyster lapras piloswine "],["kakuna gloom cascoon seviper ","venomoth ariados swalot garbodor ","muk drapion toxicroak whirlipede "],["abra drowzee grumpig munna ","wobbuffet sigilyph espurr ","xatu girafarig gothorita duosion "],["nosepass boldore dwebble ","onix magcargo corsola pupitar ","rhydon shuckle barbaracle "],["magneton mawile ferroseed ","forretress skarmory metang klang ","bronzong excadrill klefki "],["krabby octillery bibarel panpour ","wartortle gyarados quagsire floatzel ","poliwhirl lapras azumarill frogadier "]]
</script>
<style type="text/css">
body{
text-align: center;
background: #f8f8f8;
}
form{
width:458px;
display: inline-block;
margin-top: 100px;
}
select{
width: 150px;
}
#type, #user, #fc{
width: 100%;
margin-left: 0px;
}
#slot1, #slot2, #slot3{
display: inline-block;
margin: 5px 0px;
}
#button{
background: #3498db;
color: white;
padding: 3px 0;
text-align: center;
width: 100%px;
cursor: pointer;
border: 1px solid #2980b9;
text-shadow: 1px 1px #2980b9;
font-size: 14px;
}
a {
pointer-events: none;
text-decoration: none;
font-family: Georgia, serif;
font-weight: bold;
font-size: 18px;
color: #000000;
}
.post {
width: 600px;
margin-left: auto;
margin-right: auto;
font-family: Arial,sans-serif;
font-size: 14px;
}
</style>
</head>
<body>
<form>
<input type="text" id="user" value="Name">
<input type="text" id="fc" value="0000-0000-0000">
<script type="text/javascript">
document.write('<select onchange="set_pokes()" size="1" id="type">');
for (i = -1; i < typename.length; i++){
if (i<0){
document.write('<option selected="selected" value ="'+i+'">I don\'t know what\'s in my safari.</option>');
}
else{
document.write('<option value ="'+i+'">'+typename[i].slice(0,1).toUpperCase()+typename[i].slice(1)+'</option>');
}
}
document.write('</select>')
</script>
<br/>
<div id="slot1"></div>
<div id="slot2"></div>
<div id="slot3"></div>
<div id="button" onclick="safari_send()">GENERATE FLAIR REQUEST</div>
<p>
<!--<div id="button" onclick="unknown_send()">I don't know what pokemon I have!</div>-->
</form>
<script>
function check_fc(){
vnums = "0123456789"
valid = [vnums,vnums,vnums,vnums,"-",vnums,vnums,vnums,vnums,"-",vnums,vnums,vnums,vnums]
fc = document.getElementById("fc").value;
if ((fc).length != 14) return false;
for (i=0;i<14;i++) if (valid[i].indexOf(fc[i]) == -1) return false;
return true;
}
function unknown_send(){
name = document.getElementById("user").value;
fc = document.getElementById("fc").value;
if(check_fc()) {
if(fc == "0000-0000-0000"){
alert("You didn't enter your Friend Code, please insert it before submitting your request.");
}
else{
alert("DO NOT EDIT THE UPCOMING MESSAGE, JUST CLICK SEND!!!");
window.location="http://www.reddit.com/message/compose/?to=FriendSafariBot&subject="+name+":+"+fc+"&message=unknown";
}
}
else alert("Friend Code Invalid\nYour friend code should be in the form of 0000-0000-0000\nPlease insert a valid Friend Code");
}
function safari_send(){
name = document.getElementById("user").value;
fc = document.getElementById("fc").value;
type = document.getElementById("type");
type = type.options[type.selectedIndex].value;
if (type < 0) {
unknown_send();
return;
}
poke1 = document.getElementById("poke1");
poke1 = poke1.options[poke1.selectedIndex].value;
poke2 = document.getElementById("poke2");
poke2 = poke2.options[poke2.selectedIndex].value;
poke3 = document.getElementById("poke3");
poke3 = poke3.options[poke3.selectedIndex].value;
if (poke1==="none" || poke2==="none") {
alert("When entering a type, you must enter the first two Pokemon in your safari as well.\n\nIf you do not the first two Pokemon in your safari, please select \"I don't know what's in my safari.\" instead.");
return;
}
poke1 = pokecheck[type][0].split(" ")[poke1];
poke2 = pokecheck[type][1].split(" ")[poke2];
msg = poke1 + "+" + poke2
if (poke3!="none")
msg += "+" + pokecheck[type][2].split(" ")[poke3];
if(check_fc()) {
if(fc == "0000-0000-0000"){
alert("You didn't enter your Friend Code, please insert it before submitting your request.")
}
else{
alert("DO NOT EDIT THE UPCOMING MESSAGE, JUST CLICK SEND!!!");
window.location="http://www.reddit.com/message/compose/?to=FriendSafariBot&subject="+name+":+"+fc+"&message="+msg;
}
}
else alert("Friend Code Invalid\nYour friend code should be in the form of 0000-0000-0000\nPlease insert a valid Friend Code")
}
function set_pokes(){
type = document.getElementById("type");
type = type.options[type.selectedIndex].value;
if (type < 0) {
document.getElementById("slot1").innerHTML = "";
document.getElementById("slot2").innerHTML = "";
document.getElementById("slot3").innerHTML = "";
return;
}
oSlot1 = '<select size="1" id="poke1">';
pokes = pokecheck[type][0].split(" ");
for (i = -1; i < pokes.length-1; i++){
if (i==-1){
oSlot1 +=('<option selected="selected" value ="none">???</option>');
}
else{
oSlot1 +=('<option value ="'+i+'">'+pokes[i].slice(0,1).toUpperCase()+pokes[i].slice(1)+'</option>');
}
}
oSlot1 += '</select>';
oSlot2 = '<select size="1" id="poke2">';
pokes = pokecheck[type][1].split(" ");
for (i = -1; i < pokes.length-1; i++){
if (i==-1){
oSlot2 +=('<option selected="selected" value ="none">???</option>');
}
else{
oSlot2 +=('<option value ="'+i+'">'+pokes[i].slice(0,1).toUpperCase()+pokes[i].slice(1)+'</option>');
}
}
oSlot2 += '</select>';
oSlot3 = '<select size="1" id="poke3">';
pokes = pokecheck[type][2].split(" ");
for (i = -1; i < pokes.length-1; i++){
if (i==-1){
oSlot3 +=('<option selected="selected" value ="none">???</option>');
}
else{
oSlot3 +=('<option value ="'+i+'">'+pokes[i].slice(0,1).toUpperCase()+pokes[i].slice(1)+'</option>');
}
}
oSlot3 += '</select>';
document.getElementById("slot1").innerHTML = oSlot1;
document.getElementById("slot2").innerHTML = oSlot2;
document.getElementById("slot3").innerHTML = oSlot3;
}
set_pokes();
</script>
<div class="post">
<div class="regular">
<div>Instructions</div>
<p>Please enter your Mii name, friend code, and safari Pokémon (if you know them) in the boxes above. Then click on "Generate Flair Request" and a message to send to FriendSafariBot will be automatically be generated. Do not alter this message in any way! If something looks wrong, hit the back button, fix it here, and then try again. <strong>Once submitted, flair will usually be set within 15 minutes. You’ll receive a message from the bot and your flair will be displayed on the right sidebar of /r/friendsafari when it’s done.</strong></p>
<p><strong>Important information for newcomers:</strong> If you do not know your safari Pokémon, leave the last field on the default “I don’t know what’s in my safari.” option. In such a case, you will need to include the phrase <strong>[Safari Unknown]</strong> (exactly as written, complete with brackets) in your post title if you wish to make your own topic on /r/friendsafari. Once you know what your Friend Safari Pokémon are, come back to this page and make another flair request with the Pokémon section filled out.</p>
<p><strong>WARNING: Providing false information will lead to a ban from /r/friendsafari!<br></strong></p>
</div>
</div>
</body>
</html>