Merge remote branch 'origin/development' into text_themes
[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 ignore"><label><i><input type="checkbox" /></i><%= ignore %></label></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 <option value=""></li>
325 <% _.forEach(languages, function(lang) { %>
326 <option value="<%= lang.tag %>"><%= lang.language %></li>
327 <% }); %>
328 </select>
329 <br>
330 <small><%= locale_restart_needed %></small>
331 </div>
332 </section>
333
334 <section class="protocol_handler">
335 <h6><%= default_client %></h6>
336 <div class="control-group">
337 <button class="register_protocol"><%= make_default %></button>
338 <br>
339 <small><%= default_note %></small>
340 </div>
341 </section>
342
343 <section class="notification_enabler">
344 <h6><%= html5_notifications %></h6>
345 <div class="control-group">
346 <button class="enable_notifications"><%= enable_notifications %></button>
347 </div>
348 </section>
349 </form>
350 </div>
351 </script>
352
353
354 <script type="text/html" id="tmpl_channel_list">
355 <div class="applet_chanlist">
356 <table>
357 <thead style="font-weight: bold;">
358 <tr>
359 <td><a class="channel_name_title"><%= channel_name %></a></td>
360 <td><a class="users_title"><%= users %></a></td>
361 <td style="padding-left: 2em;"><%= topic %></td>
362 </tr>
363 </thead>
364 <tbody style="vertical-align: top;">
365 </tbody>
366 </table>
367 </div>
368 </script>
369
370
371 <script type="text/html" id="tmpl_script_editor">
372 <div style="height:100%;">
373 <style>
374 #kiwi .script_editor .se_toolbar { padding: 10px 20px; }
375 #kiwi .script_editor .se_toolbar span.status { margin-left:2em; font-style:italic; }
376 #kiwi .script_editor .se_toolbar button { height:30px; padding:0 1em; }
377 #kiwi .script_editor .se_toolbar button i { font-size:1.2em; margin-left:3px; }
378 </style>
379 <div class="script_editor" style="height:100%; position:relative;">
380 <div class="se_toolbar"><button class="btn_save"><%= save %><i class="icon-save"></i></button><span class="status"></span></div>
381 <div class="editor" style="position:absolute;top:50px;bottom:0px;left:0px;right:0px;"></div>
382 </div>
383 </div>
384 </script>
385
386
387 <script src="<%base_path%>/assets/libs/jquery-1.11.0.min.js"></script>
388 <script>
389 /* Script loader (https://github.com/ded/script.js) */
390 (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)
391
392
393 // Avoid `console` errors in browsers that lack a console. (https://github.com/h5bp/html5-boilerplate)
394 function normalizeConsole() {
395 var method;
396 var noop = function () {};
397 var methods = [
398 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
399 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
400 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
401 'timeStamp', 'trace', 'warn'
402 ];
403 var length = methods.length;
404 var console = (window.console = window.console || {});
405
406 while (length--) {
407 method = methods[length];
408
409 // Only stub undefined methods.
410 if (!console[method]) {
411 console[method] = noop;
412 }
413 }
414 };
415
416 function getQueryVariable(variable) {
417 var query = window.location.search.substring(1);
418 var vars = query.split('&');
419 for (var i = 0; i < vars.length; i++) {
420 var pair = vars[i].replace(/\+/g, '%20').split('=');
421 if (decodeURIComponent(pair[0]) == variable) {
422 return decodeURIComponent(pair[1]);
423 }
424 }
425 }
426
427 (function () {
428 var base_path = '<%base_path%>', // Entry path for the kiwi application
429 scripts = [],
430 opts = {
431 container: $('body'),
432 base_path: base_path,
433 settings_path: base_path + '/assets/settings.json'
434 };
435
436 normalizeConsole();
437
438 /**
439 * Job bootup manager
440 * Once all jobs have completed, call any registered completed functions
441 */
442 var jobs = new (function BootManager() {
443 var completed_jobs = { };
444
445 // Functions to call once all jobs have completed
446 var completed_callbacks = [];
447
448
449 function callCompletedFunctions(fn) {
450 $.each(completed_callbacks, function(idx, fn) {
451 fn();
452 });
453
454 completed_callbacks = [];
455 };
456
457
458 this.finishJob = function(job_name) {
459 if (typeof completed_jobs[job_name] === 'undefined') {
460 return;
461 }
462
463 completed_jobs[job_name] = true;
464
465 // Check if all our jobs have completed
466 var all_jobs_completed = true;
467 $.each(completed_jobs, function(idx, completed) {
468 if (!completed) {
469 all_jobs_completed = false;
470 return false;
471 }
472 });
473
474 if (all_jobs_completed) {
475 callCompletedFunctions();
476 }
477 };
478
479
480 this.onFinish = function(fn) {
481 completed_callbacks.push(fn);
482 };
483
484
485 this.registerJob = function(job_name) {
486 completed_jobs[job_name] = false;
487 };
488 })();
489
490
491 // Run after all dependancies have been loaded
492 jobs.onFinish(function startApp() {
493 // Kiwi IRC version this is built from
494 kiwi.build_version = '<%build_version%>';
495
496 // Start the app
497 kiwi.start(opts, function() {
498 // Load any plugins
499 if (opts.client_plugins && opts.client_plugins.length > 0) {
500 _.each(opts.client_plugins, function (plugin_url) {
501 kiwi.plugins.load(plugin_url);
502 });
503 }
504 });
505 });
506
507
508 // Load each script
509 jobs.registerJob('load_scripts');
510 var cur_script = 0;
511 function loadNextScript () {
512 var to_load,
513 base = base_path + '/';
514
515 // Start the kiwi app if all scripts have been loaded
516 if (cur_script === scripts.length) {
517 jobs.finishJob('load_scripts');
518 return;
519 }
520
521 if (typeof scripts[cur_script] === 'string') {
522 to_load = base + scripts[cur_script];
523 } else {
524 to_load = [];
525 for(var idx in scripts[cur_script]) {
526 to_load.push(base + scripts[cur_script][idx]);
527 }
528 }
529
530 $script(to_load, loadNextScript);
531
532 cur_script++;
533 }
534
535 // If we're not interested in debug libs, start loading production files
536 if (!getQueryVariable('debug')) {
537 scripts.push(['assets/libs/lodash.min.js']);
538 scripts.push([
539 'assets/libs/backbone.min.js',
540 'assets/libs/jed.js'
541 ]);
542 scripts.push([
543 'assets/kiwi.min.js',
544 'assets/libs/engine.io.bundle.min.js'
545 ]);
546
547 loadNextScript();
548 }
549
550 // Load application settings
551 jobs.registerJob('load_settings');
552 $.getJSON(opts.settings_path, function (data) {
553 opts.server_settings = data.server_settings;
554 opts.client_plugins = data.client_plugins;
555 opts.translations = data.translations;
556 opts.locale = data.locale;
557 opts.themes = data.themes;
558 opts.text_theme = data.server_settings.client.settings.text_theme;
559
560 if (typeof data.kiwi_server !== 'undefined')
561 opts.kiwi_server = data.kiwi_server;
562
563 jobs.finishJob('load_settings');
564
565 // If debugging, grab the debug scripts and load them
566 if (getQueryVariable('debug')) {
567 scripts = scripts.concat(data.scripts);
568 loadNextScript();
569 }
570
571 // Load themes
572 if (opts.themes) {
573 $.each(opts.themes, function (theme_idx, theme) {
574 var disabled = (opts.server_settings.client.settings.theme.toLowerCase() !== theme.name.toLowerCase()),
575 rel = (disabled?'alternate ':'') + 'stylesheet' /*+ (disabled?' prefetch':'')*/;
576
577 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':'') + '/>');
578 link.disabled = disabled;
579
580 $(link).appendTo($('head'));
581 });
582 }
583 });
584
585 jobs.registerJob('window_load');
586 window.onload = function() {
587 jobs.finishJob('window_load');
588 };
589 })();
590 </script>
591 </body>
592 </html>