50500e99844abed953c1e8ca994a24e86750cd87
[KiwiIRC.git] / client_backbone / index.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4
5 <title> KiwiIRC </title>
6
7 <link rel="stylesheet" type="text/css" href="style.css" />
8
9 </head>
10 <body>
11 <div id="kiwi">
12 <div id="toolbar">
13 <ul class="panellist channels"></ul>
14
15 <div id="topic">
16 <input type="text" />
17 </div>
18 </div>
19
20 <div id="panels">
21 <div class="panel_container container1"></div>
22 </div>
23
24 <div id="memberlists"></div>
25
26 <div id="controlbox">
27 <div class="input">
28 <span class="nick"> </span>
29 <div class="input_wrap"><input type="text" class="inp" /></div>
30 </div>
31 </div>
32 </div>
33
34 <script type="text/x-jquery-tmpl" id="tmpl_userbox">
35 <div class="userbox">
36 <a class="query">Message</a>
37 <a class="info">Info</a>
38 </div>
39 </script>
40
41 <script type="text/x-jquery-tmpl" id="tmpl_server_select">
42 <div class="server_select">
43 <div class="status"></div>
44
45 <form>
46 <div class="basic">
47 <label for="server_select_nick">Nickname</label>
48 <input type="text" class="nick" id="server_select_nick"> <br />
49
50 <button type="submit">Connect..</button> <br />
51 <a class="show_more">More</a>
52 </div>
53
54 <div class="more">
55 <label for="server_select_server">Server</label>
56 <input type="text" class="server" id="server_select_server"> <br />
57 <label for="server_select_channel">Channel</label>
58 <input type="text" class="channel" id="server_select_channel"> <br />
59 </div>
60 </form>
61 </div>
62 </script>
63
64 <script>
65
66 function getQueryVariable(variable) {
67 var query = window.location.search.substring(1);
68 var vars = query.split('&');
69 for (var i = 0; i < vars.length; i++) {
70 var pair = vars[i].split('=');
71 if (decodeURIComponent(pair[0]) == variable) {
72 return decodeURIComponent(pair[1]);
73 }
74 }
75 }
76
77 window.onload = function () {
78
79 // Common dependancies that are required at all times
80 var scripts = [
81 'jquery-1.7.1.min.js',
82 'underscore-min.js',
83 'backbone-git.js',
84 'http://localhost:7778/socket.io/socket.io.js',
85 ];
86
87 // If in debug mode, load each development script
88 if (getQueryVariable('debug')) {
89 scripts = scripts.concat([
90 'dev/utils.js',
91 'dev/model.js',
92 'dev/model_application.js',
93 'dev/model_gateway.js',
94 'dev/view.js'
95 ]);
96 } else {
97 scripts.push('kiwi.min.js');
98 }
99
100
101 // Run after all dependancies have been loaded
102 function startApp () {
103 // Only debug if set in the querystring
104 if (!getQueryVariable('debug')) {
105 manageDebug(false);
106 } else {
107 manageDebug(true);
108 }
109 kiwi.app = new kiwi.model.Application({container: $('#kiwi')});
110 kiwi.app.start();
111 }
112
113
114 // Load each script
115 var cur_script = 0;
116 function loadNextScript () {
117 if (cur_script === scripts.length) {
118 startApp();
119 return;
120 }
121
122 var el = document.createElement('script');
123 el.onload = loadNextScript;
124 el.src = scripts[cur_script];
125 document.getElementsByTagName('head')[0].appendChild(el);
126
127 cur_script++;
128 }
129
130 // Start loading scripts
131 loadNextScript();
132 };
133 </script>
134 </body>
135 </html>