Allow "server and network" section to be collapsed once it's expanded
[KiwiIRC.git] / client / assets / src / index.html.tmpl
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6 <base target="_blank">
7
8 <title> KiwiIRC </title>
9
10 <link rel="shortcut icon" href="<%base_path%>/assets/img/favicon.ico">
11
12 <link rel="stylesheet" type="text/css" href="<%base_path%>/assets/css/style.css" />
13 <link rel="stylesheet" type="text/css" href="<%base_path%>/assets/css/font-awesome.min.css" />
14 <!--[if IE 7]>
15 <link rel="stylesheet" type="text/css" href="/kiwi/assets/css/font-awesome-ie7.css" />
16 <![endif]-->
17 </head>
18 <body>
19 <div id="kiwi" class="theme_relaxed">
20 <div class="toolbar">
21 <div class="app_tools">
22 <ul class="main">
23 <li class="settings"><i class="icon-cogs" title="Settings"></i></li>
24 <li><a href="https://kiwiirc.com/" target="_blank"><img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC" title="KiwiIRC" /></a></li>
25 </ul>
26 </div>
27
28 <div class="tabs"></div>
29
30 <div class="topic">
31 <div contenteditable="true"></div>
32 </div>
33
34 <div class="status_message"></div>
35 </div>
36
37 <div class="memberlists_resize_handle"></div>
38
39 <div class="panels">
40 <div class="panel_container container1"></div>
41 </div>
42
43 <div class="memberlists disabled"></div>
44
45 <div class="controlbox">
46 <div class="input">
47 <span class="nick"> </span>
48 <div class="input_wrap"><textarea class="inp"></textarea></div>
49 <div class="input_tools"></div>
50 </div>
51 </div>
52 </div>
53
54
55
56
57
58
59 <script type="text/html" id="tmpl_userbox">
60 <div class="userbox">
61 <a class="if_op op"><i class="icon-star"></i>Op</a>
62 <a class="if_op deop"><i class="icon-star-empty"></i>De-op</a>
63 <a class="if_op voice"><i class="icon-volume-up"></i>Voice</a>
64 <a class="if_op devoice"><i class="icon-volume-off"></i>De-voice</a>
65 <a class="if_op kick"><i class="icon-remove"></i>Kick</a>
66 <a class="if_op ban"><i class="icon-ban-circle"></i>Ban</a>
67
68 <a class="query"><i class="icon-comment"></i>Message</a>
69 <a class="info"><i class="icon-info-sign"></i>Info</a>
70 <a class="slap"><i class="icon-user-md"></i>Slap!</a>
71 </div>
72 </script>
73
74 <script type="text/html" id="tmpl_nickchange">
75 <form class="nickchange">
76 <label for="nickchange">New nick:</label> <input type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <button>Change</button> <a class="cancel">Cancel</a>
77 </form>
78 </script>
79
80 <script type="text/html" id="tmpl_new_connection_info">
81 <div style="margin:1em 20px;">
82 <img src="https://kiwiirc.com/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" style="display:block; margin:0 auto;"/> <br />
83 <p style="font-style:italic;">A <strong>hand-crafted IRC client</strong> that you can enjoy. Designed to be used <strong>easily</strong> and <strong>freely</strong>.</p>
84
85 <p style="font-size:0.9em;margin-top:2em;">Peek at the <a href="https://www.kiwiirc.com/">Kiwi IRC homepage</a> for more information or to find out how to embed it on your own website. Looking for source code? Try the <a href="http://github.com/prawnsalad/KiwiIRC/">GitHub</a> page. This network of people may not be associated with Kiwi IRC itself.</p>
86 </div>
87 </script>
88
89 <script type="text/html" id="tmpl_server_select">
90 <div class="server_select">
91
92 <div class="side_panel" style="position:absolute;top:0px;left:320px;">
93 <div class="content" style="position:relative;width:300px;">
94 </div>
95 </div>
96
97 <div class="server_details" style="position:relative;width:320px;">
98 <div class="status">Think of a nickname..</div>
99
100 <form>
101 <div class="basic">
102 <table>
103 <tr class="nick">
104 <td><label for="server_select_nick">Nickname</label></td>
105 <td><input type="text" class="nick" id="server_select_nick"></td>
106 </tr>
107
108 <tr class="have_pass">
109 <td colspan="2">
110 <label for="server_select_show_pass">I have a password</label> <input type="checkbox" id="server_select_show_pass" style="width:auto;" />
111 </td>
112 </tr>
113
114 <tr class="pass">
115 <td><label for="server_select_password">Password</label></td>
116 <td><input type="password" class="password" id="server_select_password"></td>
117 </tr>
118
119 <tr class="channel">
120 <td><label for="server_select_channel">Channel</label></td>
121 <td>
122 <div style="position:relative;">
123 <input type="text" class="channel" id="server_select_channel">
124 <i class="icon-key" title="Channel Key"></i>
125 </div>
126 </td>
127 </tr>
128
129 <tr class="have_key">
130 <td colspan="2">
131 <label for="server_select_show_channel_key">Channel requires a key</label> <input type="checkbox" id="server_select_show_channel_key" style="width:auto;" />
132 </td>
133 </tr>
134
135 <tr class="key">
136 <td><label for="server_select_channel_key">Key</label></td>
137 <td><input type="password" class="channel_key" id="server_select_channel_key"></td>
138 </tr>
139
140 <tr class="start">
141 <td colspan="2"><button type="submit">Start..</button></td>
142 </tr>
143 </table>
144
145 <a href="" onclick="return false;" class="show_more">Server and network <i class="icon-caret-down"></i></a>
146 </div>
147
148
149 <div class="more">
150 <table>
151 <tr class="server">
152 <td><label for="server_select_server">Server</label></td>
153 <td><input type="text" class="server" id="server_select_server"></td>
154 <tr>
155
156 <tr class="port">
157 <td><label for="server_select_port">Port</label></td>
158 <td><input type="text" class="port" id="server_select_port"></td>
159 </tr>
160
161 <tr class="ssl">
162 <td><label for="server_select_ssl">SSL</label></td>
163 <td><input type="checkbox" class="ssl" id="server_select_ssl"></td>
164 </tr>
165 </table>
166 </div>
167 </form>
168
169 <a class="kiwi_logo" href="https://kiwiirc.com/" target="_blank">
170 <h1><span>Powered by Kiwi IRC</span> <img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" /></h1>
171 </a>
172 </div>
173 </div>
174 </script>
175
176 <script type="text/html" id="tmpl_applet_settings">
177 <div class="settings_container">
178 <section>
179 <h6>Theme</h6>
180 <div class="control-group">
181 <div class="thumbnails">
182 <a class="thumbnail" data-setting="theme" data-value="relaxed" href="#">
183 <div class="thumbnail_wrapper"><div class="theme_color" style="background-color: #e7e7e7;"></div></div>
184 <div class="caption"><u>Relaxed</u></div>
185 </a>
186 <a class="thumbnail" data-setting="theme" data-value="mini" href="#">
187 <div class="thumbnail_wrapper"><div class="theme_color" style="background-color: #fff;"></div></div>
188 <div class="caption"><u>Mini</u></div>
189 </a>
190 <a class="thumbnail" data-setting="theme" data-value="cli" href="#">
191 <div class="thumbnail_wrapper"><div class="theme_color" style="background-color: #222;"></div></div>
192 <div class="caption"><u>CLI</u></div>
193 </a>
194 <a class="thumbnail" data-setting="theme" data-value="basic" href="#">
195 <div class="thumbnail_wrapper"><div class="theme_color" style="background-color: #e7e7e7;"></div></div>
196 <div class="caption"><u>Basic</u></div>
197 </a>
198 </div>
199 </div>
200 </section>
201
202 <section>
203 <h6>Channels</h6>
204 <div class="control-group">
205 <div class="radio">
206 <label>
207 <input type="radio" name="channel_list_style" data-setting="channel_list_style" value="tabs">
208 Tabs
209 </label>
210 </div>
211 <div class="radio">
212 <label>
213 <input type="radio" name="channel_list_style" data-setting="channel_list_style" value="list">
214 List <small class="text-muted">(for large amouts of channels)</small>
215 </label>
216 </div>
217 </div>
218 </section>
219
220 <section>
221 <h6>Chat window</h6>
222 <div class="control-group">
223 <div class="checkbox">
224 <label>
225 <input data-setting="show_joins_parts" type="checkbox">
226 Join/part channel notifications
227 </label>
228 </div>
229 <div class="checkbox">
230 <label>
231 <input data-setting="show_timestamps" type="checkbox">
232 Timestamps
233 </label>
234 </div>
235 <div class="checkbox">
236 <label>
237 <input data-setting="mute_sounds" type="checkbox">
238 Mute sound notifications
239 </label>
240 </div>
241 <label>
242 <input data-setting="scrollback" class="input-small" type="text" size="4" pattern="\d*">
243 <span>messages in scroll history</span>
244 </label>
245 </div>
246 </section>
247
248 <section class="protocol_handler">
249 <h6>Default IRC client</h6>
250 <div class="control-group">
251 <button class="register_protocol">Make Kiwi my default IRC client</button>
252 <br>
253 <small>Note: Chrome or Chromium browser users may need to check their settings via <a href="chrome://settings/handlers">chrome://settings/handlers</a> if nothing happens</small>
254 </div>
255 </section>
256 </div>
257 </script>
258
259
260 <script type="text/html" id="tmpl_channel_list">
261 <div>
262 <table style="margin:1em 2em;">
263 <thead style="font-weight: bold;">
264 <tr>
265 <td>Channel Name</td>
266 <td>Users</td>
267 <td style="padding-left: 2em;">Topic</td>
268 </tr>
269 </thead>
270 <tbody style="vertical-align: top;">
271 </tbody>
272 </table>
273 </div>
274 </script>
275
276
277 <script type="text/html" id="tmpl_script_editor">
278 <div style="height:100%;">
279 <style>
280 #kiwi .script_editor .se_toolbar { padding: 10px 20px; }
281 #kiwi .script_editor .se_toolbar span.status { margin-left:2em; font-style:italic; }
282 #kiwi .script_editor .se_toolbar button { height:30px; padding:0 1em; }
283 #kiwi .script_editor .se_toolbar button i { font-size:1.2em; margin-left:3px; }
284 </style>
285 <div class="script_editor" style="height:100%; position:relative;">
286 <div class="se_toolbar"><button class="btn_save">Save <i class="icon-save"></i></button><span class="status"></span></div>
287 <div class="editor" style="position:absolute;top:50px;bottom:0px;left:0px;right:0px;"></div>
288 </div>
289 </div>
290 </script>
291
292
293 <script>
294 /* Script loader (https://github.com/ded/script.js) */
295 (function(a,b,c){typeof c["module"]!="undefined"&&c.module.exports?c.module.exports=b():typeof c["define"]!="undefined"&&c["define"]=="function"&&c.define.amd?define(a,b):c[a]=b()})("$script",function(){function p(a,b){for(var c=0,d=a.length;c<d;++c)if(!b(a[c]))return j;return 1}function q(a,b){p(a,function(a){return!b(a)})}function r(a,b,i){function o(a){return a.call?a():d[a]}function t(){if(!--n){d[m]=1,l&&l();for(var a in f)p(a.split("|"),o)&&!q(f[a],o)&&(f[a]=[])}}a=a[k]?a:[a];var j=b&&b.call,l=j?b:i,m=j?a.join(""):b,n=a.length;return setTimeout(function(){q(a,function(a){if(h[a])return m&&(e[m]=1),h[a]==2&&t();h[a]=1,m&&(e[m]=1),s(!c.test(a)&&g?g+a+".js":a,t)})},0),r}function s(c,d){var e=a.createElement("script"),f=j;e.onload=e.onerror=e[o]=function(){if(e[m]&&!/^c|loade/.test(e[m])||f)return;e.onload=e[o]=null,f=1,h[c]=2,d()},e.async=1,e.src=c,b.insertBefore(e,b.firstChild)}var a=document,b=a.getElementsByTagName("head")[0],c=/^https?:\/\//,d={},e={},f={},g,h={},i="string",j=!1,k="push",l="DOMContentLoaded",m="readyState",n="addEventListener",o="onreadystatechange";return!a[m]&&a[n]&&(a[n](l,function t(){a.removeEventListener(l,t,j),a[m]="complete"},j),a[m]="loading"),r.get=s,r.order=function(a,b,c){(function d(e){e=a.shift(),a.length?r(e,d):r(e,b,c)})()},r.path=function(a){g=a},r.ready=function(a,b,c){a=a[k]?a:[a];var e=[];return!q(a,function(a){d[a]||e[k](a)})&&p(a,function(a){return d[a]})?b():!function(a){f[a]=f[a]||[],f[a][k](b),c&&c(e)}(a.join("|")),r},r},this)
296
297
298
299
300 function getQueryVariable(variable) {
301 var query = window.location.search.substring(1);
302 var vars = query.split('&');
303 for (var i = 0; i < vars.length; i++) {
304 var pair = vars[i].split('=');
305 if (decodeURIComponent(pair[0]) == variable) {
306 return decodeURIComponent(pair[1]);
307 }
308 }
309 }
310
311 window.onload = function () {
312
313 // Common dependancies that are required at all times
314 var scripts = [
315 ['libs/jquery-1.9.1.min.js', 'libs/lodash.min.js'],
316 'libs/backbone.min.js'
317 ];
318
319 // If in debug mode, load each development script
320 if (getQueryVariable('debug')) {
321 console.log('Loading debugging scripts');
322 scripts = scripts.concat([
323 'src/app.js',
324 [
325 'src/models/application.js',
326 'src/models/gateway.js'
327 ],
328 [
329 'src/models/newconnection.js',
330 'src/models/panellist.js',
331 'src/models/networkpanellist.js',
332 'src/models/panel.js',
333 'src/models/member.js',
334 'src/models/memberlist.js',
335 'src/models/network.js'
336 ],
337
338 [
339 'src/models/query.js',
340 'src/models/channel.js',
341 'src/models/server.js',
342 'src/models/applet.js'
343 ],
344
345 [
346 'src/applets/settings.js',
347 'src/applets/chanlist.js',
348 'src/applets/scripteditor.js'
349 ],
350
351 [
352 'src/models/pluginmanager.js',
353 'src/models/datastore.js',
354 'src/helpers/utils.js'
355 ],
356
357 // Some views extend these, so make sure they're loaded beforehand
358 [
359 'src/views/panel.js'
360 ],
361
362 [
363 'src/views/channel.js',
364 'src/views/applet.js',
365 'src/views/application.js',
366 'src/views/apptoolbar.js',
367 'src/views/controlbox.js',
368 'src/views/favicon.js',
369 'src/views/mediamessage.js',
370 'src/views/member.js',
371 'src/views/memberlist.js',
372 'src/views/menubox.js',
373 'src/views/networktabs.js',
374 'src/views/nickchangebox.js',
375 'src/views/resizehandler.js',
376 'src/views/serverselect.js',
377 'src/views/statusmessage.js',
378 'src/views/tabs.js',
379 'src/views/topicbar.js',
380 'src/views/userbox.js'
381 ]
382 ]);
383 } else {
384 scripts.push('kiwi.min.js?<%cache_buster%>');
385 }
386
387
388 // Run after all dependancies have been loaded
389 function startApp () {
390 var opts = {
391 container: $('#kiwi'),
392 base_path: base_path,
393
394 // Override the kiwi_server to use. (Think: running on standalone client..)
395 //kiwi_server: 'http://kiwiirc.com:80',
396
397 server_settings: <%server_settings%>,
398 client_plugins: <%client_plugins%>
399 };
400
401 // Start the app
402 kiwi.start(opts);
403
404 // Load any plugins
405 if (opts.client_plugins && opts.client_plugins.length > 0) {
406 _.each(opts.client_plugins, function (plugin_url) {
407 kiwi.plugins.load(plugin_url);
408 });
409 }
410 }
411
412
413 // Load each script
414 var cur_script = 0;
415 function loadNextScript () {
416 var to_load,
417 base = base_path + '/assets/';
418
419 // Start the kiwi app if all scripts have been loaded
420 if (cur_script === scripts.length) {
421 startApp();
422 return;
423 }
424
425 if (typeof scripts[cur_script] === 'string') {
426 to_load = base + scripts[cur_script];
427 } else {
428 to_load = [];
429 for(var idx in scripts[cur_script]) {
430 to_load.push(base + scripts[cur_script][idx]);
431 }
432 }
433
434 $script(to_load, loadNextScript);
435
436 cur_script++;
437 }
438
439 // Entry path for the kiwi application
440 var base_path = '<%base_path%>';
441
442 // Start loading scripts
443 loadNextScript();
444 };
445 </script>
446 </body>
447 </html>