-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.html
208 lines (205 loc) · 11.5 KB
/
settings.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
<html>
<head>
<title>Salty Sundays Stream Manager</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="static/jquery.ddslick.min.js"></script>
<script src="static/reconnecting-websocket.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script>
$(document).ready(function(){
$(function() {
$.getJSON('./settings/config', function(data) {
$("#twitchChat").val(data.TWITCH_CHAT);
$("#challongeApiKey").val(data.CHALLONGE_API_KEY);
$("#spritePath").val(data.SPRITE_PATH);
$("#spritePath2").val(data.SPRITE_PATH2);
$("#youtubeDescription").val(data.YOUTUBE_DESCRIPTION);
$("#youtubeKeywords").val(data.YOUTUBE_KEYWORDS);
$("#recordingPath").val(data.RECORDING_DIRECTORY);
$("#matchType").val(data.scene.MatchType);
$("#p1name").val(data.scene.Player1Name);
$("#p2name").val(data.scene.Player2Name);
$("#p1twitter").val(data.scene.Player1Twitter);
$("#p2twitter").val(data.scene.Player2Twitter);
$("#p1score").val(data.scene.Player1Score);
$("#p2score").val(data.scene.Player2Score);
$("#p1char").val(data.scene.Player1Character);
$("#p2char").val(data.scene.Player2Character);
$("#c1name").val(data.scene.Commentator1Name);
$("#c2name").val(data.scene.Commentator2Name);
$("#c1twitter").val(data.scene.Commentator1Twitter);
$("#c2twitter").val(data.scene.Commentator2Twitter);
$("#twConsumerKey").val(data.twitter.ConsumerKey);
$("#twConsumerSecret").val(data.twitter.ConsumerSecret);
$("#twToken").val(data.twitter.Token);
$("#twTokenSecret").val(data.twitter.TokenSecret);
});
});
$("#settings").click(function(e)
{
var settings = Object();
settings.RECORDING_DIRECTORY = $("#recordingPath").val();
settings.CHALLONGE_API_KEY = $("#challongeApiKey").val();
settings.SPRITE_PATH = $("#spritePath").val();
settings.SPRITE_PATH2 = $("#spritePath2").val();
settings.YOUTUBE_DESCRIPTION = $("#youtubeDescription").val();
settings.YOUTUBE_KEYWORDS = $("#youtubeKeywords").val();
settings.TWITCH_CHAT = $("#twitchChat").val();
var scene = Object();
scene.MatchType = $("#matchType").val().split(",")
scene.Player1Name = $("#p1name").val().split(",");
scene.Player2Name = $("#p2name").val().split(",");
scene.Player1Twitter = $("#p1twitter").val().split(",");
scene.Player2Twitter = $("#p2twitter").val().split(",");
scene.Player1Score = $("#p1score").val().split(",");
scene.Player2Score = $("#p2score").val().split(",");
scene.Player1Character = $("#p1char").val();
scene.Player2Character = $("#p2char").val();
scene.Commentator1Name = $("#c1name").val().split(",");
scene.Commentator2Name = $("#c2name").val().split(",");
scene.Commentator1Twitter = $("#c1twitter").val().split(",");
scene.Commentator2Twitter = $("#c2twitter").val().split(",");
settings.scene = scene;
var twitter = Object();
twitter.ConsumerKey = $("#twConsumerKey").val();
twitter.ConsumerSecret = $("#twConsumerSecret").val();
twitter.Token = $("#twToken").val();
twitter.TokenSecret = $("#twTokenSecret").val();
settings.twitter = twitter;
$.post('http://{{ ip }}:5000/settings', {'settings': JSON.stringify(settings)});
});
});
</script>
<body>
<div class="container" style="margin-top: 10px;">
<table class="table table-striped">
<thead>
<tr>
<th>Setting</th>
<th>Input</th>
</tr>
</thead>
<tbody>
<tr>
<td>Twitch Chat</td>
<td><input type="text" class="form-control" id="twitchChat" placeholder="http://www.twitch.tv/kappahaute/chat"</td>
</tr>
<tr>
<td>OBS Recording Path</td>
<td><input type"text" class="form-control" id="recordingPath" placeholder="X:/vods/"</td>
</tr>
<tr>
<td>OBS Image Path</td>
<td><input type="text" class="form-control" id="spritePath" placeholder="C:/Users/Everance/Desktop/sprites/"</td>
</tr>
<tr>
<td>OBS Player 2 Image Path</td>
<td><input type="text" class="form-control" id="spritePath2" placeholder="C:/Users/Everance/Desktop/sprites/"</td>
</tr>
<tr>
<td>Youtube Description</td>
<td><input type="text" class="form-control" id="youtubeDescription" placeholder="Terre Haute Salty Sundays"</td>
</tr>
<tr>
<td>Youtube Keywords (Comma seperated.)</td>
<td><input type="text" class="form-control" id="youtubeKeywords" placeholder="Smash 4, Super Smash Bros., Weekly, Tournament"</td>
</tr>
<tr>
<td>Challonge API Key</td>
<td><input type="password" class="form-control" id="challongeApiKey" placeholder="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"></td>
</tr>
</tbody>
<thead>
<tr>
<th>OBS Scene</th>
<th>Input</th>
</tr>
</thead>
<tbody>
<tr>
<td>Match Type</td>
<td><input type="text" class="form-control" id="matchType" placeholder="matchType"></td>
</tr>
<tr>
<td>Player 1 Name</td>
<td><input type="text" class="form-control" id="p1name" placeholder="p1Name"></td>
</tr>
<tr>
<td>Player 2 Name</td>
<td><input type="text" class="form-control" id="p2name" placeholder="p2name"></td>
</tr>
<tr>
<td>Player 1 Twitter</td>
<td><input type="text" class="form-control" id="p1twitter" placeholder="p1twitter"></td>
</tr>
<tr>
<td>Player 2 Twitter</td>
<td><input type="text" class="form-control" id="p2twitter" placeholder="p2twitter"></td>
</tr>
<tr>
<td>Player 1 Score</td>
<td><input type="text" class="form-control" id="p1score" placeholder="p1score"></td>
</tr>
<tr>
<td>Player 2 Score</td>
<td><input type="text" class="form-control" id="p2score" placeholder="p2score"></td>
</tr>
<tr>
<td>Player 1 Character</td>
<td><input type="text" class="form-control" id="p1char" placeholder="p1char"></td>
</tr>
<tr>
<td>Player 2 Character</td>
<td><input type="text" class="form-control" id="p2char" placeholder="p2char"></td>
</tr>
<tr>
<td>Commentator 1 Name</td>
<td><input type="text" class="form-control" id="c1name" placeholder="c1name"></td>
</tr>
<tr>
<td>Commentator 2 Name</td>
<td><input type="text" class="form-control" id="c2name" placeholder="c2name"></td>
</tr>
<tr>
<td>Commentator 1 Twitter</td>
<td><input type="text" class="form-control" id="c1twitter" placeholder="c1twitter"></td>
</tr>
<tr>
<td>Commentator 2 Twitter</td>
<td><input type="text" class="form-control" id="c2twitter" placeholder="c2twitter"></td>
</tr>
<thead>
<tr>
<th>Twitter OAuth</th>
<th>Input</th>
</tr>
<tr>
<td>Consumer Key</td>
<td><input type="password" class="form-control" id="twConsumerKey" placeholder="****"></td>
</tr>
<tr>
<td>Consumer Secret</td>
<td><input type="password" class="form-control" id="twConsumerSecret" placeholder="****"></td>
</tr>
<tr>
<td>Token</td>
<td><input type="password" class="form-control" id="twToken" placeholder="****"></td>
</tr>
<tr>
<td>Token Secret</td>
<td><input type="password" class="form-control" id="twTokenSecret" placeholder="****"></td>
</tr>
</thead>
<tbody>
</tbody>
</table>
<button id="settings" class="btn btn-default">Save</button>
<div class="btn-group pull-right">
<a href='/' class="btn btn-default" role="button">Back To Controller</a>
</div>
</div>
</body>
</head>
</html>