forked from Nerfact/discord-widget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
183 lines (177 loc) · 8.77 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./css/solarized_dark.css">
<link href='https://fonts.googleapis.com/css?family=Raleway:400,500' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="./css/master.min.css" media="screen" title="default" charset="utf-8">
<link rel="stylesheet" href="./css/jquery-ui.min.css" media="screen" title="default" charset="utf-8">
<link rel="stylesheet" href="./css/jquery-ui.structure.min.css" media="screen" title="default" charset="utf-8">
<link rel="stylesheet" href="./css/jquery-ui.theme.min.css" media="screen" title="default" charset="utf-8">
<meta charset="utf-8">
<title>Discord Widget</title>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69334315-1', 'auto');
ga('send', 'pageview');
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
</head>
<body>
<h1>Discord Widget</h1>
<h5>Created By: <a href="http://github.com/restingcoder">Josh Schmille</a></h5>
<h2>
Code Snippet
</h2>
<div id="tabs">
<ul>
<li><a href="#tab1">HTML / JS</a></li>
<li><a href="#tab2">iframe</a></li>
</ul>
<div id="tab1">
<pre><code class="html"><script type="text/javascript" src="//cdn.jsdelivr.net/discord-widget/1.0/discord-widget.min.js"></script><br/><script type="text/javascript"><br/>discordWidget.init({<br/> serverId: '51143782082543616',<br/> title: 'Discord Widget Title',<br/> join: true,<br/> alphabetical: false,<br/> theme: 'light',<br/> hideChannels: ['Channel Name 1', 'Channel Name 2'],<br/> showAllUsers: true,<br/> allUsersDefaultState: true,<br/> showNick: false<br/>});<br/>discordWidget.render();<br/></script><br/><br/><div class="discord-widget"></div></code></pre>
</div>
<div id="tab2">
<p class="iframe-form-info">
This is still being worked on. The only part not added yet is the Hide Channels option.
</p>
<pre><code class="html" id="discord-iframe-code"><iframe src="http://discordi.deliriousdrunkards.com/render?id=51143782082543616" width="300px" height="400px" frameborder="0"></iframe></code></pre>
<form id="iframe-form">
<div id="iframe-id" class="iframe-form-input">
<label for="iframe-id-text">
Server ID
</label><br/>
<input type="text" name="iframe-id-text" id="iframe-id-text" autocomplete="off">
</div>
<div id="iframe-title" class="iframe-form-input">
<label for="iframe-title-text">
Widget Title <span class="iframe-form-info">(Leave blank to hide the title bar)</span>
</label><br/>
<input type="text" name="iframe-title" id="iframe-title-text" autocomplete="off">
</div>
<div id="iframe-theme" class="iframe-form-input">
<label for="iframe-theme-light">
Theme
</label>
<div>
<input type="radio" name="iframe-theme" id="iframe-theme-light" value="Light" checked="checked">
<span>
Light
</span>
</div>
<div>
<input type="radio" name="iframe-theme" id="iframe-theme-dark" value="Dark">
<span>
Dark
</span>
</div>
<div>
<input type="radio" name="iframe-theme" id="iframe-theme-none" value="None">
<span>
None
</span>
</div>
</div>
<div id="iframe-options" class="iframe-form-input">
<label for="iframe-options">
Options
</label>
<div>
<input type="checkbox" name="iframe-options-join" id="iframe-options-join" value="Show Join Button">
<span>
Show Join Button
</span>
<br>
</div>
<div>
<input type="checkbox" name="iframe-options-abc" id="iframe-options-abc" value="Alphabetize Channel List">
<span>
Alphabetize Channel List
</span>
<br>
</div>
<div>
<input type="checkbox" name="iframe-options-showall" id="iframe-options-showall" value="Show All Online Users">
<span>
Show All Online Users
</span>
<br>
</div>
<div>
<input type="checkbox" name="iframe-options-showalltoggle" id="iframe-options-showalltoggle" value="All Online Users Starts Expanded">
<span>
All Online Users Starts Expanded
</span>
<br>
</div>
<div>
<input type="checkbox" name="iframe-options-shownick" id="iframe-options-shownick" value="Show Server Nicknames">
<span>
Show Server Nicknames
</span>
<br>
</div>
</div>
<div id="iframe-hidechannels">
<label for="iframe-hidechannels-text">
Hide Channels <span class="iframe-form-info">(Separated by commas)</span>
</label><br/>
<input type="text" name="iframe-hidechannels-text" id="iframe-hidechannels-text" autocomplete="off" disabled>
</div>
</form>
</div>
</div>
<h2>
Parameters
</h2>
<table class="parameter-table">
<tr><th>Parameter</th><th>Usage</th><th>Default</th></tr>
<tr><td>serverId<br/><strong>[String]</strong></td><td>Paste your Server ID from the Widget section of your Server Settings here.</td><td>false</td></tr>
<tr><td>title<br/><strong>[String]</strong></td><td>A header will be added to the widget, containing the text supplied.</td><td>false</td></tr>
<tr><td>join<br/><strong>[Boolean]</strong></td><td>Determines whether to show the Join Server button within the widget.</td><td>true</td></tr>
<tr><td>alphabetical<br/><strong>[Boolean]</strong></td><td>Determines whether the channel list will display in alphabetical order or not.</td><td>false</td></tr>
<tr><td>theme<br/><strong>[String ('light', 'dark', 'none')]</strong></td><td>Pick your poison!<br/><br/>'none' removes <strong>all styling</strong>, including margins and padding around the widget.</td><td>light</td></tr>
<tr><td>hideChannels<br/><strong>[String Array]</strong></td><td>Hide channels. If the channel name contains the string provided, it will be hidden.</td><td>false</td></tr>
<tr><td>showAllUsers<br/><strong>[Boolean]</strong></td><td>Show all online users, even if they are not in a voice channel.</td><td>false</td></tr>
<tr><td>allUsersDefaultState<br/><strong>[Boolean]</strong></td><td>Sets whether the Online Users section is expanded or not by default.</td><td>true</td></tr>
<tr><td>showNick<br/><strong>[Boolean]</strong></td><td>Sets whether the the users' server nick name shows or not.</td><td>false</td></tr>
</table>
<h2>Preview</h2>
<div class="discord-preview">
<script type="text/javascript" src="//cdn.jsdelivr.net/discord-widget/1.0/discord-widget.min.js"></script>
<script type="text/javascript">
discordWidget.init({
serverId: '51143782082543616',
title: 'Discord Widget Title',
join: true,
alphabetical: false,
theme: 'light',
hideChannels: ['Channel Name 1', 'Channel Name 2'],
showAllUsers: true,
allUsersDefaultState: true,
showNick: false
});
discordWidget.render();
</script>
<div class="discord-widget"></div>
<iframe src="http://discordi.deliriousdrunkards.com/render?id=51143782082543616&showall=true&shownick=true" width="300px" height="200px" frameborder="0"></iframe>
</div>
<h2>
Help
</h2>
<p>
If you run into trouble, let me know <a href="https://github.com/RestingCoder/discord-widget/issues">here</a>.
</p>
<script src="./js/highlight.pack.js"></script>
<script src="./js/master.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>