09893fb3b88f0667202e8022291361498e0383a6
[KiwiIRC.git] / client / 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> Kiwi IRC </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
20 <script type="text/html" id="tmpl_application">
21 <div id="kiwi" class="theme_relaxed">
22 <div class="toolbar">
23 <div class="app_tools">
24 <ul class="main">
25 <li class="settings"><i class="icon-cogs" title="Settings"></i></li>
26 <li class="startup"><i class="icon-home" title="Home"></i></li>
27 <li><a href="https://kiwiirc.com/" target="_blank"><img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC" title="KiwiIRC" /></a></li>
28 </ul>
29 </div>
30
31 <div class="tabs"></div>
32
33 <div class="topic">
34 <div contenteditable="true"></div>
35 </div>
36
37 <div class="status_message"></div>
38 </div>
39
40 <div class="memberlists_resize_handle"></div>
41
42 <div class="panels">
43 <div class="panel_container container1"></div>
44 </div>
45
46 <div class="right_bar disabled">
47 <div class="channel_tools">
48 <i class="icon-info-sign channel_info" title="Channel Info"></i>
49 <i class="icon-signout channel_part" title="Leave Channel"></i>
50 </div>
51 <div class="memberlists"></div>
52 </div>
53
54 <div class="controlbox">
55 <div class="input">
56 <span class="nick"> </span>
57 <div class="input_wrap"><textarea class="inp"></textarea></div>
58 <div class="input_tools"></div>
59 </div>
60 </div>
61 </div>
62 </script>
63
64
65 <script type="text/html" id="tmpl_channel_info">
66 <div class="channel_info">
67 <b class="channel_url"><a href=""></a></b>
68
69 <form>
70 <div class="control-group channel_info_modes">
71 <label>
72 <input type="checkbox" name="channel_mute" class="channel-mode" data-mode="m" />
73 Moderated chat
74 </label>
75 <label>
76 <input type="checkbox" name="channel_invite" class="channel-mode" data-mode="i" />
77 Invite only
78 </label>
79 <label>
80 <input type="checkbox" name="channel_topic" class="channel-mode" data-mode="t" />
81 Only operators can change the topic
82 </label>
83 <label>
84 <input type="checkbox" name="channel_external_messages" class="channel-mode" data-mode="n" />
85 Block messages from outside this channel
86 </label>
87 </div>
88
89 <div class="control-group">
90 <label>
91 Password
92 <input type="text" name="channel_key" class="channel-mode" data-mode="k" />
93 </label>
94 </div>
95
96
97 <div class="control-group channel-banlist">
98 <button class="show_banlist">Show banlist</button> <span class="banlist-status"></span>
99 <table>
100 <thead>
101 <tr>
102 <td>Bank Mask</td>
103 <td>Added By</td>
104 <td>Date Added</td>
105 <td></td>
106 </tr>
107 </thead>
108 <tbody>
109 </tbody>
110 </table>
111 </div>
112 </form>
113 </div>
114 </script>
115
116
117 <script type="text/html" id="tmpl_userbox">
118 <div class="userbox">
119 <a class="close_menu if_op op"><i class="icon-star"></i><%= op %></a>
120 <a class="close_menu if_op deop"><i class="icon-star-empty"></i><%= de_op %></a>
121 <a class="close_menu if_op voice"><i class="icon-volume-up"></i><%= voice %></a>
122 <a class="close_menu if_op devoice"><i class="icon-volume-off"></i><%= de_voice %></a>
123 <a class="close_menu if_op kick"><i class="icon-remove"></i><%= kick %></a>
124 <a class="close_menu if_op ban"><i class="icon-ban-circle"></i><%= ban %></a>
125
126 <a class="close_menu query"><i class="icon-comment"></i><%= message %></a>
127 <a class="close_menu info"><i class="icon-info-sign"></i><%= info %></a>
128 <a class="close_menu slap"><i class="icon-user-md"></i><%= slap %></a>
129 </div>
130 </script>
131
132 <script type="text/html" id="tmpl_nickchange">
133 <form class="nickchange">
134 <label for="nickchange"><%= new_nick %>:</label> <input type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <button><%= change %></button> <a class="cancel"><%= cancel %></a>
135 </form>
136 </script>
137
138 <script type="text/html" id="tmpl_new_connection_info">
139 <div style="margin:1em 20px;">
140 <img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" style="display:block; margin:0 auto;"/> <br />
141 <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>
142
143 <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>
144 </div>
145 </script>
146
147 <script type="text/html" id="tmpl_server_select">
148 <div class="server_select">
149
150 <div class="side_panel" style="position:absolute;top:0px;left:320px;">
151 <div class="content" style="position:relative;width:300px;">
152 </div>
153 </div>
154
155 <div class="server_details" style="position:relative;width:320px;">
156 <div class="status"><%= think_nick %></div>
157
158 <form>
159 <div class="basic">
160 <table>
161 <tr class="nick">
162 <td><label for="server_select_nick"><%= nickname %></label></td>
163 <td><input type="text" class="nick" id="server_select_nick"></td>
164 </tr>
165
166 <tr class="have_pass">
167 <td colspan="2">
168 <label for="server_select_show_pass"><%= have_password %></label> <input type="checkbox" id="server_select_show_pass" style="width:auto;" />
169 </td>
170 </tr>
171
172 <tr class="pass">
173 <td><label for="server_select_password"><%= password %></label></td>
174 <td><input type="password" class="password" id="server_select_password"></td>
175 </tr>
176
177 <tr class="channel">
178 <td><label for="server_select_channel"><%= channel %></label></td>
179 <td>
180 <div style="position:relative;">
181 <input type="text" class="channel" id="server_select_channel">
182 <i class="icon-key" title="<%= channel_key %>"></i>
183 </div>
184 </td>
185 </tr>
186
187 <tr class="have_key">
188 <td colspan="2">
189 <label for="server_select_show_channel_key"><%= require_key %></label> <input type="checkbox" id="server_select_show_channel_key" style="width:auto;" />
190 </td>
191 </tr>
192
193 <tr class="key">
194 <td><label for="server_select_channel_key"><%= key %></label></td>
195 <td><input type="password" class="channel_key" id="server_select_channel_key"></td>
196 </tr>
197
198 <tr class="start">
199 <td></td>
200 <td><button type="submit"><%= start %></button></td>
201 </tr>
202 </table>
203
204 <a href="" onclick="return false;" class="show_more"><%= server_network %> <i class="icon-caret-down"></i></a>
205 </div>
206
207
208 <div class="more">
209 <table>
210 <tr class="server">
211 <td><label for="server_select_server"><%= server %></label></td>
212 <td><input type="text" class="server" id="server_select_server"></td>
213 <tr>
214
215 <tr class="port">
216 <td><label for="server_select_port"><%= port %></label></td>
217 <td><input type="text" class="port" id="server_select_port"></td>
218 </tr>
219
220 <tr class="ssl">
221 <td><label for="server_select_ssl">SSL</label></td>
222 <td><input type="checkbox" class="ssl" id="server_select_ssl"></td>
223 </tr>
224 </table>
225 </div>
226 </form>
227
228 <a class="kiwi_logo" href="https://kiwiirc.com/" target="_blank">
229 <h1><span><%= powered_by %></span> <img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" /></h1>
230 </a>
231 </div>
232 </div>
233 </script>
234
235 <script type="text/html" id="tmpl_theme_thumbnail">
236 <a class="thumbnail" data-setting="theme" data-value="<%= name.toLowerCase() %>" href="#">
237 <div class="thumbnail_wrapper"><div class="theme_color" style="background-color: <%= thumbnail_colour %>;"></div></div>
238 <div class="caption"><u><%= name %></u></div>
239 </a>
240 </script>
241
242 <script type="text/html" id="tmpl_applet_settings">
243 <div class="settings_container">
244 <form>
245 <section>
246 <h6>Theme</h6>
247 <div class="control-group">
248 <div class="thumbnails">
249 <% _.forEach(theme_thumbnails, function(thumbnail) { %>
250 <%= thumbnail %>
251 <% }); %>
252 </div>
253 </div>
254 </section>
255
256 <section>
257 <h6>Channels</h6>
258 <div class="control-group">
259 <div class="radio">
260 <label>
261 <input type="radio" name="channel_list_style" data-setting="channel_list_style" value="tabs">
262 <%= tabs %>
263 </label>
264 </div>
265 <div class="radio">
266 <label>
267 <input type="radio" name="channel_list_style" data-setting="channel_list_style" value="list">
268 <%= list %><small class="text-muted">(<%= large_amounts_of_chans %>)</small>
269 </label>
270 </div>
271 </div>
272 </section>
273
274 <section>
275 <h6>Chat window</h6>
276 <div class="control-group">
277 <div class="checkbox">
278 <label>
279 <input data-setting="show_joins_parts" type="checkbox">
280 <%= join_part %>
281 </label>
282 </div>
283 <div class="checkbox">
284 <label>
285 <input data-setting="count_all_activity" type="checkbox">
286 <%= count_all_activity %>
287 </label>
288 </div>
289 <div class="checkbox">
290 <label>
291 <input data-setting="show_timestamps" type="checkbox">
292 <%= timestamps %>
293 </label>
294 </div>
295 <div class="checkbox">
296 <label>
297 <input data-setting="use_24_hour_timestamps" type="checkbox">
298 <%= timestamp_24 %>
299 </label>
300 </div>
301 <div class="checkbox">
302 <label>
303 <input data-setting="mute_sounds" type="checkbox">
304 <%= mute %>
305 </label>
306 </div>
307 <div class="checkbox">
308 <label>
309 <input data-setting="show_emoticons" type="checkbox">
310 <%= emoticons %>
311 </label>
312 </div>
313 <label>
314 <input data-setting="scrollback" class="input-small" type="text" size="4" pattern="\d*">
315 <span><%= scroll_history %></span>
316 </label>
317 </div>
318 </section>
319
320 <section class="language">
321 <h6>Language</h6>
322 <div class="control-group">
323 <select data-setting="locale">
324 <% _.forEach(languages, function(lang) { %>
325 <option value="<%= lang.tag %>"><%= lang.language %></li>
326 <% }); %>
327 </select>
328 <br>
329 <small><%= locale_restart_needed %></small>
330 </div>
331 </section>
332
333 <section class="protocol_handler">
334 <h6><%= default_client %></h6>
335 <div class="control-group">
336 <button class="register_protocol"><%= make_default %></button>
337 <br>
338 <small><%= default_note %></small>
339 </div>
340 </section>
341
342 <section class="notification_enabler">
343 <h6><%= html5_notifications %></h6>
344 <div class="control-group">
345 <button class="enable_notifications"><%= enable_notifications %></button>
346 </div>
347 </section>
348 </form>
349 </div>
350 </script>
351
352
353 <script type="text/html" id="tmpl_channel_list">
354 <div class="applet_chanlist">
355 <table>
356 <thead style="font-weight: bold;">
357 <tr>
358 <td><a class="channel_name_title"><%= channel_name %></a></td>
359 <td><a class="users_title"><%= users %></a></td>
360 <td style="padding-left: 2em;"><%= topic %></td>
361 </tr>
362 </thead>
363 <tbody style="vertical-align: top;">
364 </tbody>
365 </table>
366 </div>
367 </script>
368
369
370 <script type="text/html" id="tmpl_script_editor">
371 <div style="height:100%;">
372 <style>
373 #kiwi .script_editor .se_toolbar { padding: 10px 20px; }
374 #kiwi .script_editor .se_toolbar span.status { margin-left:2em; font-style:italic; }
375 #kiwi .script_editor .se_toolbar button { height:30px; padding:0 1em; }
376 #kiwi .script_editor .se_toolbar button i { font-size:1.2em; margin-left:3px; }
377 </style>
378 <div class="script_editor" style="height:100%; position:relative;">
379 <div class="se_toolbar"><button class="btn_save"><%= save %><i class="icon-save"></i></button><span class="status"></span></div>
380 <div class="editor" style="position:absolute;top:50px;bottom:0px;left:0px;right:0px;"></div>
381 </div>
382 </div>
383 </script>
384
385
386 <script src="<%base_path%>/assets/libs/jquery-1.11.0.min.js"></script>
387 <script>
388 /* Script loader (https://github.com/ded/script.js) */
389 (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)
390
391
392 // Avoid `console` errors in browsers that lack a console. (https://github.com/h5bp/html5-boilerplate)
393 function normalizeConsole() {
394 var method;
395 var noop = function () {};
396 var methods = [
397 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
398 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
399 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
400 'timeStamp', 'trace', 'warn'
401 ];
402 var length = methods.length;
403 var console = (window.console = window.console || {});
404
405 while (length--) {
406 method = methods[length];
407
408 // Only stub undefined methods.
409 if (!console[method]) {
410 console[method] = noop;
411 }
412 }
413 };
414
415 function getQueryVariable(variable) {
416 var query = window.location.search.substring(1);
417 var vars = query.split('&');
418 for (var i = 0; i < vars.length; i++) {
419 var pair = vars[i].replace(/\+/g, '%20').split('=');
420 if (decodeURIComponent(pair[0]) == variable) {
421 return decodeURIComponent(pair[1]);
422 }
423 }
424 }
425
426 (function () {
427 var base_path = '<%base_path%>', // Entry path for the kiwi application
428 scripts = [],
429 opts = {
430 container: $('body'),
431 base_path: base_path,
432 settings_path: base_path + '/assets/settings.json'
433 };
434
435 normalizeConsole();
436
437 /**
438 * Job bootup manager
439 * Once all jobs have completed, call any registered completed functions
440 */
441 var jobs = new (function BootManager() {
442 var completed_jobs = { };
443
444 // Functions to call once all jobs have completed
445 var completed_callbacks = [];
446
447
448 function callCompletedFunctions(fn) {
449 $.each(completed_callbacks, function(idx, fn) {
450 fn();
451 });
452
453 completed_callbacks = [];
454 };
455
456
457 this.finishJob = function(job_name) {
458 if (typeof completed_jobs[job_name] === 'undefined') {
459 return;
460 }
461
462 completed_jobs[job_name] = true;
463
464 // Check if all our jobs have completed
465 var all_jobs_completed = true;
466 $.each(completed_jobs, function(idx, completed) {
467 if (!completed) {
468 all_jobs_completed = false;
469 return false;
470 }
471 });
472
473 if (all_jobs_completed) {
474 callCompletedFunctions();
475 }
476 };
477
478
479 this.onFinish = function(fn) {
480 completed_callbacks.push(fn);
481 };
482
483
484 this.registerJob = function(job_name) {
485 completed_jobs[job_name] = false;
486 };
487 })();
488
489
490 // Run after all dependancies have been loaded
491 jobs.onFinish(function startApp() {
492 // Start the app
493 kiwi.start(opts, function() {
494 // Load any plugins
495 if (opts.client_plugins && opts.client_plugins.length > 0) {
496 _.each(opts.client_plugins, function (plugin_url) {
497 kiwi.plugins.load(plugin_url);
498 });
499 }
500 });
501 });
502
503
504 // Load each script
505 jobs.registerJob('load_scripts');
506 var cur_script = 0;
507 function loadNextScript () {
508 var to_load,
509 base = base_path + '/';
510
511 // Start the kiwi app if all scripts have been loaded
512 if (cur_script === scripts.length) {
513 jobs.finishJob('load_scripts');
514 return;
515 }
516
517 if (typeof scripts[cur_script] === 'string') {
518 to_load = base + scripts[cur_script];
519 } else {
520 to_load = [];
521 for(var idx in scripts[cur_script]) {
522 to_load.push(base + scripts[cur_script][idx]);
523 }
524 }
525
526 $script(to_load, loadNextScript);
527
528 cur_script++;
529 }
530
531 // If we're not interested in debug libs, start loading production files
532 if (!getQueryVariable('debug')) {
533 scripts.push(['assets/libs/lodash.min.js']);
534 scripts.push([
535 'assets/libs/backbone.min.js',
536 'assets/libs/jed.js'
537 ]);
538 scripts.push([
539 'assets/kiwi.min.js',
540 'assets/libs/engine.io.bundle.min.js'
541 ]);
542
543 loadNextScript();
544 }
545
546 // Load application settings
547 jobs.registerJob('load_settings');
548 $.getJSON(opts.settings_path, function (data) {
549 opts.server_settings = data.server_settings;
550 opts.client_plugins = data.client_plugins;
551 opts.translations = data.translations;
552 opts.locale = data.locale;
553 opts.themes = data.themes;
554
555 if (typeof data.kiwi_server !== 'undefined')
556 opts.kiwi_server = data.kiwi_server;
557
558 jobs.finishJob('load_settings');
559
560 // If debugging, grab the debug scripts and load them
561 if (getQueryVariable('debug')) {
562 scripts = scripts.concat(data.scripts);
563 loadNextScript();
564 }
565
566 // Load themes
567 if (opts.themes) {
568 $.each(opts.themes, function (theme_idx, theme) {
569 var disabled = (opts.server_settings.client.settings.theme.toLowerCase() !== theme.name.toLowerCase()),
570 rel = (disabled?'alternate ':'') + 'stylesheet' /*+ (disabled?' prefetch':'')*/;
571
572 var link = $.parseHTML('<link rel="' + rel + '" type="text/css" data-theme href="'+ opts.base_path + '/assets/themes/' + theme.name.toLowerCase() + '/style.css" title="' + theme.name.toLowerCase() + '" ' + (disabled?'disabled':'') + '/>');
573 link.disabled = disabled;
574
575 $(link).appendTo($('head'));
576 });
577 }
578 });
579
580 jobs.registerJob('window_load');
581 window.onload = function() {
582 jobs.finishJob('window_load');
583 };
584 })();
585 </script>
586 </body>
587 </html>