Separating script editor conflicting styles
[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="stylesheet" type="text/css" href="<%base_path%>/assets/css/style.css" />
11 <link rel="stylesheet" type="text/css" href="<%base_path%>/assets/css/font-awesome.min.css" />
12 <!--[if IE 7]>
13 <link rel="stylesheet" type="text/css" href="/kiwi/assets/css/font-awesome-ie7.css" />
14 <![endif]-->
15 </head>
16 <body>
17 <div id="kiwi" class="theme_relaxed">
18 <div class="toolbar">
19 <div class="app_tools">
20 <ul class="main">
21 <li class="settings"><i class="icon-cogs" title="Settings"></i></li>
22 <li><a href="https://kiwiirc.com/" target="_blank"><img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC" title="KiwiIRC" /></a></li>
23 </ul>
24 </div>
25
26 <div class="tabs"></div>
27
28 <div class="topic">
29 <div contenteditable="true"></div>
30 </div>
31
32 <div class="status_message"></div>
33 </div>
34
35 <div class="memberlists_resize_handle"></div>
36
37 <div class="panels">
38 <div class="panel_container container1"></div>
39 </div>
40
41 <div class="memberlists disabled"></div>
42
43 <div class="controlbox">
44 <div class="input">
45 <span class="nick"> </span>
46 <div class="input_wrap"><textarea class="inp"></textarea></div>
47 <div class="input_tools"></div>
48 </div>
49 </div>
50 </div>
51
52
53
54
55
56
57 <script type="text/html" id="tmpl_userbox">
58 <div class="userbox">
59 <a class="if_op op"><i class="icon-star"></i>Op</a>
60 <a class="if_op deop"><i class="icon-star-empty"></i>De-op</a>
61 <a class="if_op voice"><i class="icon-volume-up"></i>Voice</a>
62 <a class="if_op devoice"><i class="icon-volume-off"></i>De-voice</a>
63 <a class="if_op kick"><i class="icon-remove"></i>Kick</a>
64 <a class="if_op ban"><i class="icon-ban-circle"></i>Ban</a>
65
66 <a class="query"><i class="icon-comment"></i>Message</a>
67 <a class="info"><i class="icon-info-sign"></i>Info</a>
68 <a class="slap"><i class="icon-user-md"></i>Slap!</a>
69 </div>
70 </script>
71
72 <script type="text/html" id="tmpl_nickchange">
73 <form class="nickchange">
74 <label for="nickchange">New nick:</label> <input type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <button>Change</button> <a class="cancel">Cancel</a>
75 </form>
76 </script>
77
78 <script type="text/html" id="tmpl_new_connection_info">
79 <div style="margin:1em 20px;">
80 <img src="https://kiwiirc.com/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" style="display:block; margin:0 auto;"/> <br />
81 <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>
82
83 <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>
84 </div>
85 </script>
86
87 <script type="text/html" id="tmpl_server_select">
88 <div class="server_select">
89
90 <div class="side_panel" style="position:absolute;top:0px;left:320px;">
91 <div class="content" style="position:relative;width:300px;">
92 </div>
93 </div>
94
95 <div class="server_details" style="position:relative;width:320px;">
96 <div class="status">Think of a nickname..</div>
97
98 <form>
99 <div class="basic">
100 <table>
101 <tr class="nick">
102 <td><label for="server_select_nick">Nickname</label></td>
103 <td><input type="text" class="nick" id="server_select_nick"></td>
104 </tr>
105
106 <tr class="have_pass">
107 <td colspan="2">
108 <label for="server_select_show_pass">I have a password</label> <input type="checkbox" id="server_select_show_pass" style="width:auto;" />
109 </td>
110 </tr>
111
112 <tr class="pass">
113 <td><label for="server_select_password">Password</label></td>
114 <td><input type="password" class="password" id="server_select_password"></td>
115 </tr>
116
117 <tr class="channel">
118 <td><label for="server_select_channel">Channel</label></td>
119 <td>
120 <div style="position:relative;">
121 <input type="text" class="channel" id="server_select_channel">
122 <i class="icon-key" title="Channel Key"></i>
123 </div>
124 </td>
125 </tr>
126
127 <tr class="have_key">
128 <td colspan="2">
129 <label for="server_select_show_channel_key">Channel requires a key</label> <input type="checkbox" id="server_select_show_channel_key" style="width:auto;" />
130 </td>
131 </tr>
132
133 <tr class="key">
134 <td><label for="server_select_channel_key">Key</label></td>
135 <td><input type="password" class="channel_key" id="server_select_channel_key"></td>
136 </tr>
137
138 <tr class="start">
139 <td colspan="2"><button type="submit">Start..</button></td>
140 </tr>
141 </table>
142
143 <a href="" onclick="return false;" class="show_more">Server and network</a>
144 </div>
145
146
147 <div class="more">
148 <table>
149 <tr class="server">
150 <td><label for="server_select_server">Server</label></td>
151 <td><input type="text" class="server" id="server_select_server"></td>
152 <tr>
153
154 <tr class="port">
155 <td><label for="server_select_port">Port</label></td>
156 <td><input type="text" class="port" id="server_select_port"></td>
157 </tr>
158
159 <tr class="ssl">
160 <td><label for="server_select_ssl">SSL</label></td>
161 <td><input type="checkbox" class="ssl" id="server_select_ssl"></td>
162 </tr>
163 </table>
164 </div>
165 </form>
166
167 <a class="kiwi_logo" href="https://kiwiirc.com/" target="_blank">
168 <h1><span>Powered by Kiwi IRC</span> <img src="<%base_path%>/assets/img/ico.png" alt="KiwiIRC Logo" title="Kiwi IRC" /></h1>
169 </a>
170 </div>
171 </div>
172 </script>
173
174 <script type="text/html" id="tmpl_applet_settings">
175 <div class="settings">
176 ​<table>
177 <tr>
178 <td class="label">Theme</td>
179 <td class="setting">
180 <select class="setting-theme">
181 <option value="relaxed">Relaxed</option>
182 <option value="mini">Mini</option>
183 <option value="cli">CLI</option>
184 <option value="basic">Basic</option>
185 </select>
186 </td>
187 </tr>
188 <tr>
189 <td class="label">Channel list</td>
190 <td class="setting">
191 <select class="setting-channel_list_style">
192 <option value="list">List</option>
193 <option value="tabs">Tabs</option>
194 </select>
195
196 <i style="font-size:0.9em;">Lots of channels? `List` may be more suited</i>
197 </td>
198 </tr>
199 <tr>
200 <td class="label">Scrollback</td>
201 <td class="setting"><input type="text" class="setting-scrollback" value="150" /></td>
202 </tr>
203
204 <tr>
205 <td class="label">Show joins/parts</td>
206 <td class="setting"><input type="checkbox" class="setting-show_joins_parts" /></td>
207 </tr>
208
209 <tr>
210 <td class="label">Show timestamps</td>
211 <td class="setting"><input type="checkbox" class="setting-show_timestamps" /></td>
212 </tr>
213
214 <tr>
215 <td class="label">Mute sounds</td>
216 <td class="setting"><input type="checkbox" class="setting-mute_sounds" /></td>
217 </tr>
218
219 <tr class="save">
220 <td colspan="2"><button class="save">Save</button><br/><span class="feedback">Saved!</span></td>
221 </tr>
222 </table>
223 </div>
224 </script>
225
226
227 <script type="text/html" id="tmpl_channel_list">
228 <div>
229 <table style="margin:1em 2em;">
230 <thead style="font-weight: bold;">
231 <tr>
232 <td>Channel Name</td>
233 <td>Users</td>
234 <td style="padding-left: 2em;">Topic</td>
235 </tr>
236 </thead>
237 <tbody style="vertical-align: top;">
238 </tbody>
239 </table>
240 </div>
241 </script>
242
243
244 <script type="text/html" id="tmpl_script_editor">
245 <div style="height:100%;">
246 <style>
247 #kiwi .script_editor .se_toolbar { padding: 10px 20px; }
248 #kiwi .script_editor .se_toolbar span.status { margin-left:2em; font-style:italic; }
249 #kiwi .script_editor .se_toolbar button { height:30px; padding:0 1em; }
250 #kiwi .script_editor .se_toolbar button i { font-size:1.2em; margin-left:3px; }
251 </style>
252 <div class="script_editor" style="height:100%; position:relative;">
253 <div class="se_toolbar"><button class="btn_save">Save <i class="icon-save"></i></button><span class="status"></span></div>
254 <div class="editor" style="position:absolute;top:50px;bottom:0px;left:0px;right:0px;"></div>
255 </div>
256 </div>
257 </script>
258
259
260 <script>
261 /* Script loader (https://github.com/ded/script.js) */
262 (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)
263
264
265
266
267 function getQueryVariable(variable) {
268 var query = window.location.search.substring(1);
269 var vars = query.split('&');
270 for (var i = 0; i < vars.length; i++) {
271 var pair = vars[i].split('=');
272 if (decodeURIComponent(pair[0]) == variable) {
273 return decodeURIComponent(pair[1]);
274 }
275 }
276 }
277
278 window.onload = function () {
279
280 // Common dependancies that are required at all times
281 var scripts = [
282 ['libs/jquery-1.9.1.min.js', 'libs/lodash.min.js'],
283 'libs/backbone.min.js'
284 ];
285
286 // If in debug mode, load each development script
287 if (getQueryVariable('debug')) {
288 console.log('Loading debugging scripts');
289 scripts = scripts.concat([
290 'src/app.js',
291 [
292 'src/models/application.js',
293 'src/models/gateway.js'
294 ],
295 [
296 'src/models/newconnection.js',
297 'src/models/panellist.js',
298 'src/models/networkpanellist.js',
299 'src/models/panel.js',
300 'src/models/member.js',
301 'src/models/memberlist.js',
302 'src/models/network.js'
303 ],
304
305 [
306 'src/models/query.js',
307 'src/models/channel.js',
308 'src/models/server.js',
309 'src/models/applet.js'
310 ],
311
312 [
313 'src/applets/settings.js',
314 'src/applets/chanlist.js',
315 'src/applets/scripteditor.js'
316 ],
317
318 [
319 'src/models/pluginmanager.js',
320 'src/models/datastore.js',
321 'src/helpers/utils.js'
322 ],
323
324 // Some views extend these, so make sure they're loaded beforehand
325 [
326 'src/views/panel.js'
327 ],
328
329 [
330 'src/views/channel.js',
331 'src/views/applet.js',
332 'src/views/application.js',
333 'src/views/apptoolbar.js',
334 'src/views/controlbox.js',
335 'src/views/mediamessage.js',
336 'src/views/member.js',
337 'src/views/memberlist.js',
338 'src/views/menubox.js',
339 'src/views/networktabs.js',
340 'src/views/nickchangebox.js',
341 'src/views/resizehandler.js',
342 'src/views/serverselect.js',
343 'src/views/statusmessage.js',
344 'src/views/tabs.js',
345 'src/views/topicbar.js',
346 'src/views/userbox.js'
347 ]
348 ]);
349 } else {
350 scripts.push('kiwi.min.js?<%cache_buster%>');
351 }
352
353
354 // Run after all dependancies have been loaded
355 function startApp () {
356 var opts = {
357 container: $('#kiwi'),
358 base_path: base_path,
359
360 // Override the kiwi_server to use. (Think: running on standalone client..)
361 //kiwi_server: 'http://kiwiirc.com:80',
362
363 server_settings: <%server_settings%>,
364 client_plugins: <%client_plugins%>
365 };
366
367 // Start the app
368 kiwi.start(opts);
369
370 // Load any plugins
371 if (opts.client_plugins && opts.client_plugins.length > 0) {
372 _.each(opts.client_plugins, function (plugin_url) {
373 kiwi.plugins.load(plugin_url);
374 });
375 }
376 }
377
378
379 // Load each script
380 var cur_script = 0;
381 function loadNextScript () {
382 var to_load,
383 base = base_path + '/assets/';
384
385 // Start the kiwi app if all scripts have been loaded
386 if (cur_script === scripts.length) {
387 startApp();
388 return;
389 }
390
391 if (typeof scripts[cur_script] === 'string') {
392 to_load = base + scripts[cur_script];
393 } else {
394 to_load = [];
395 for(var idx in scripts[cur_script]) {
396 to_load.push(base + scripts[cur_script][idx]);
397 }
398 }
399
400 $script(to_load, loadNextScript);
401
402 cur_script++;
403 }
404
405 // Entry path for the kiwi application
406 var base_path = '<%base_path%>';
407
408 // Start loading scripts
409 loadNextScript();
410 };
411 </script>
412 </body>
413 </html>