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">
8 <title> Kiwi IRC </title>
10 <link rel="shortcut icon" href="<%base_path%>/assets/img/favicon.ico">
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" />
15 <link rel="stylesheet" type="text/css" href="/kiwi/assets/css/font-awesome-ie7.css" />
20 <script type="text/html" id="tmpl_application">
21 <div id="kiwi" class="theme_relaxed">
23 <div class="app_tools">
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>
31 <div class="tabs"></div>
34 <div contenteditable="true"></div>
37 <div class="status_message"></div>
40 <div class="memberlists_resize_handle"></div>
43 <div class="panel_container container1"></div>
46 <div class="right_bar disabled">
47 <div class="right-bar-toggle"><i class=""></i></div>
48 <div class="right-bar-content">
49 <div class="channel_tools">
50 <i class="icon-info-sign channel_info" title="Channel Info"></i>
51 <i class="icon-signout channel_part" title="Leave Channel"></i>
52 <i class="icon-double-angle-right right-bar-toggle-inner" title="Hide"></i>
54 <div class="memberlists"></div>
58 <div class="controlbox">
60 <span class="nick"> </span>
61 <div class="input_wrap"><textarea class="inp"></textarea></div>
62 <div class="input_tools"></div>
69 <script type="text/html" id="tmpl_channel_info">
70 <div class="channel_info">
71 <b class="channel_url"><a href=""></a></b>
74 <div class="control-group channel_info_modes">
76 <input type="checkbox" name="channel_mute" class="channel-mode" data-mode="m" />
80 <input type="checkbox" name="channel_invite" class="channel-mode" data-mode="i" />
84 <input type="checkbox" name="channel_topic" class="channel-mode" data-mode="t" />
85 Only operators can change the topic
88 <input type="checkbox" name="channel_external_messages" class="channel-mode" data-mode="n" />
89 Block messages from outside this channel
93 <div class="control-group">
96 <input type="text" name="channel_key" class="channel-mode" data-mode="k" />
101 <div class="control-group channel-banlist">
102 <button class="toggle_banlist">Toggle banlist</button> <span class="banlist-status"></span>
121 <script type="text/html" id="tmpl_userbox">
122 <div class="userbox">
123 <a class="close_menu if_op op"><i class="icon-star"></i><%= op %></a>
124 <a class="close_menu if_op deop"><i class="icon-star-empty"></i><%= de_op %></a>
125 <a class="close_menu if_op voice"><i class="icon-volume-up"></i><%= voice %></a>
126 <a class="close_menu if_op devoice"><i class="icon-volume-off"></i><%= de_voice %></a>
127 <a class="close_menu if_op kick"><i class="icon-remove"></i><%= kick %></a>
128 <a class="close_menu if_op ban"><i class="icon-ban-circle"></i><%= ban %></a>
130 <a class="close_menu query"><i class="icon-comment"></i><%= message %></a>
131 <a class="close_menu info"><i class="icon-info-sign"></i><%= info %></a>
132 <a class="close_menu ignore"><label><i><input type="checkbox" /></i><%= ignore %></label></a>
136 <script type="text/html" id="tmpl_nickchange">
137 <form class="nickchange">
138 <label for="nickchange"><%= new_nick %>:</label> <input type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <button><%= change %></button> <a class="cancel"><%= cancel %></a>
142 <script type="text/html" id="tmpl_new_connection_info">
143 <div style="margin:1em 20px;">
144 <img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" style="display:block; margin:0 auto;"/> <br />
145 <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>
147 <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>
151 <script type="text/html" id="tmpl_server_select">
152 <div class="server_select">
154 <div class="side_panel" style="position:absolute;top:0px;left:320px;">
155 <div class="content" style="position:relative;width:300px;">
159 <div class="server_details" style="position:relative;width:320px;">
160 <div class="status"><%= think_nick %></div>
166 <td><label for="server_select_nick"><%= nickname %></label></td>
167 <td><input type="text" class="nick" id="server_select_nick"></td>
170 <tr class="have_pass">
172 <label for="server_select_show_pass"><%= have_password %></label> <input type="checkbox" id="server_select_show_pass" style="width:auto;" />
177 <td><label for="server_select_password"><%= password %></label></td>
178 <td><input type="password" class="password" id="server_select_password"></td>
182 <td><label for="server_select_channel"><%= channel %></label></td>
184 <div style="position:relative;">
185 <input type="text" class="channel" id="server_select_channel">
186 <i class="icon-key" title="<%= channel_key %>"></i>
191 <tr class="have_key">
193 <label for="server_select_show_channel_key"><%= require_key %></label> <input type="checkbox" id="server_select_show_channel_key" style="width:auto;" />
198 <td><label for="server_select_channel_key"><%= key %></label></td>
199 <td><input type="password" class="channel_key" id="server_select_channel_key"></td>
204 <td><button type="submit"><%= start %></button></td>
208 <a href="" onclick="return false;" class="show_more"><%= server_network %> <i class="icon-caret-down"></i></a>
215 <td><label for="server_select_server"><%= server %></label></td>
216 <td><input type="text" class="server" id="server_select_server"></td>
220 <td><label for="server_select_port"><%= port %></label></td>
221 <td><input type="text" class="port" id="server_select_port"></td>
225 <td><label for="server_select_ssl">SSL</label></td>
226 <td><input type="checkbox" class="ssl" id="server_select_ssl"></td>
232 <a class="kiwi_logo" href="https://kiwiirc.com/" target="_blank">
233 <h1><span><%= powered_by %></span> <img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" /></h1>
239 <script type="text/html" id="tmpl_theme_thumbnail">
240 <a class="thumbnail" data-setting="theme" data-value="<%= name.toLowerCase() %>" href="#">
241 <div class="thumbnail_wrapper"><div class="theme_color" style="background-color: <%= thumbnail_colour %>;"></div></div>
242 <div class="caption"><u><%= name %></u></div>
246 <script type="text/html" id="tmpl_applet_settings">
247 <div class="settings_container">
251 <div class="control-group">
252 <div class="thumbnails">
253 <% _.forEach(theme_thumbnails, function(thumbnail) { %>
262 <div class="control-group">
265 <input type="radio" name="channel_list_style" data-setting="channel_list_style" value="tabs">
271 <input type="radio" name="channel_list_style" data-setting="channel_list_style" value="list">
272 <%= list %><small class="text-muted">(<%= large_amounts_of_chans %>)</small>
280 <div class="control-group">
281 <div class="checkbox">
283 <input data-setting="show_joins_parts" type="checkbox">
287 <div class="checkbox">
289 <input data-setting="count_all_activity" type="checkbox">
290 <%= count_all_activity %>
293 <div class="checkbox">
295 <input data-setting="show_timestamps" type="checkbox">
299 <div class="checkbox">
301 <input data-setting="use_24_hour_timestamps" type="checkbox">
305 <div class="checkbox">
307 <input data-setting="mute_sounds" type="checkbox">
311 <div class="checkbox">
313 <input data-setting="show_emoticons" type="checkbox">
318 <input data-setting="scrollback" class="input-small" type="text" size="4" pattern="\d*">
319 <span><%= scroll_history %></span>
324 <section class="language">
326 <div class="control-group">
327 <select data-setting="locale">
328 <option value=""></li>
329 <% _.forEach(languages, function(lang) { %>
330 <option value="<%= lang.tag %>"><%= lang.language %></li>
334 <small><%= locale_restart_needed %></small>
338 <section class="protocol_handler">
339 <h6><%= default_client %></h6>
340 <div class="control-group">
341 <button class="register_protocol"><%= make_default %></button>
343 <small><%= default_note %></small>
347 <section class="notification_enabler">
348 <h6><%= html5_notifications %></h6>
349 <div class="control-group">
350 <button class="enable_notifications"><%= enable_notifications %></button>
358 <script type="text/html" id="tmpl_channel_list">
359 <div class="applet_chanlist">
361 <thead style="font-weight: bold;">
363 <td><a class="channel_name_title"><%= channel_name %></a></td>
364 <td><a class="users_title"><%= users %></a></td>
365 <td style="padding-left: 2em;"><%= topic %></td>
368 <tbody style="vertical-align: top;">
375 <script type="text/html" id="tmpl_script_editor">
376 <div style="height:100%;">
378 #kiwi .script_editor .se_toolbar { padding: 10px 20px; }
379 #kiwi .script_editor .se_toolbar span.status { margin-left:2em; font-style:italic; }
380 #kiwi .script_editor .se_toolbar button { height:30px; padding:0 1em; }
381 #kiwi .script_editor .se_toolbar button i { font-size:1.2em; margin-left:3px; }
383 <div class="script_editor" style="height:100%; position:relative;">
384 <div class="se_toolbar"><button class="btn_save"><%= save %><i class="icon-save"></i></button><span class="status"></span></div>
385 <div class="editor" style="position:absolute;top:50px;bottom:0px;left:0px;right:0px;"></div>
391 <script src="<%base_path%>/assets/libs/jquery-1.11.0.min.js"></script>
393 /* Script loader (https://github.com/ded/script.js) */
394 (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)
397 // Avoid `console` errors in browsers that lack a console. (https://github.com/h5bp/html5-boilerplate)
398 function normalizeConsole() {
400 var noop = function () {};
402 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
403 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
404 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
405 'timeStamp', 'trace', 'warn'
407 var length = methods.length;
408 var console = (window.console = window.console || {});
411 method = methods[length];
413 // Only stub undefined methods.
414 if (!console[method]) {
415 console[method] = noop;
420 function getQueryVariable(variable) {
421 var query = window.location.search.substring(1);
422 var vars = query.split('&');
423 for (var i = 0; i < vars.length; i++) {
424 var pair = vars[i].replace(/\+/g, '%20').split('=');
425 if (decodeURIComponent(pair[0]) == variable) {
426 return decodeURIComponent(pair[1]);
432 * Get alerted when a group of jobs have been completed.
433 * Eg. .registerJob('job1'); .registerJob('job2');
434 * .onFinish(function(){ alert('Jobs finished!'); });
435 * .finishJob('job1');
436 * .finishJob('job2');
438 function JobManager() {
439 var completed_jobs = { };
441 // Functions to call once all jobs have completed
442 var completed_callbacks = [];
445 function callCompletedFunctions(fn) {
446 $.each(completed_callbacks, function(idx, fn) {
450 completed_callbacks = [];
454 this.finishJob = function(job_name) {
455 if (typeof completed_jobs[job_name] === 'undefined') {
459 completed_jobs[job_name] = true;
461 // Check if all our jobs have completed
462 var all_jobs_completed = true;
463 $.each(completed_jobs, function(idx, completed) {
465 all_jobs_completed = false;
470 if (all_jobs_completed) {
471 callCompletedFunctions();
476 this.onFinish = function(fn) {
477 completed_callbacks.push(fn);
481 this.registerJob = function(job_name) {
482 completed_jobs[job_name] = false;
487 var base_path = '<%base_path%>', // Entry path for the kiwi application
490 container: $('body'),
491 base_path: base_path,
492 settings_path: base_path + '/assets/settings.json'
499 * Once all jobs have completed, call any registered completed functions
501 var jobs = new JobManager();
504 // Run after all dependancies have been loaded
505 jobs.onFinish(function startApp() {
506 // Kiwi IRC version this is built from
507 kiwi.build_version = '<%build_version%>';
509 // Start the app after loading plugins
510 kiwi.init(opts, function() {
511 if (opts.client_plugins && opts.client_plugins.length > 0) {
513 // Wait until all plugins are loaded before starting the app
514 kiwi.plugins.once('loaded', function() {
518 _.each(opts.client_plugins, function (plugin_url) {
519 kiwi.plugins.load(plugin_url);
524 // No plugins were needed so start the app
532 jobs.registerJob('load_scripts');
534 function loadNextScript () {
536 base = base_path + '/';
538 // Start the kiwi app if all scripts have been loaded
539 if (cur_script === scripts.length) {
540 jobs.finishJob('load_scripts');
544 if (typeof scripts[cur_script] === 'string') {
545 to_load = base + scripts[cur_script];
548 for(var idx in scripts[cur_script]) {
549 to_load.push(base + scripts[cur_script][idx]);
553 $script(to_load, loadNextScript);
558 // If we're not interested in debug libs, start loading production files
559 if (!getQueryVariable('debug')) {
560 scripts.push(['assets/libs/lodash.min.js']);
562 'assets/libs/backbone.min.js',
566 'assets/kiwi.min.js',
567 'assets/libs/engine.io.bundle.min.js'
573 // Load application settings
574 jobs.registerJob('load_settings');
575 $.getJSON(opts.settings_path, function (data) {
576 opts.server_settings = data.server_settings;
577 opts.client_plugins = data.client_plugins;
578 opts.translations = data.translations;
579 opts.locale = data.locale;
580 opts.themes = data.themes;
582 if (typeof data.kiwi_server !== 'undefined')
583 opts.kiwi_server = data.kiwi_server;
585 jobs.finishJob('load_settings');
587 // If debugging, grab the debug scripts and load them
588 if (getQueryVariable('debug')) {
589 scripts = scripts.concat(data.scripts);
595 $.each(opts.themes, function (theme_idx, theme) {
596 var disabled = (opts.server_settings.client.settings.theme.toLowerCase() !== theme.name.toLowerCase()),
597 rel = (disabled?'alternate ':'') + 'stylesheet' /*+ (disabled?' prefetch':'')*/;
599 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':'') + '/>');
600 link.disabled = disabled;
602 $(link).appendTo($('head'));
607 jobs.registerJob('window_load');
608 window.onload = function() {
609 jobs.finishJob('window_load');