Commit | Line | Data |
---|---|---|
54f4a22e D |
1 | <?php\r |
2 | \r | |
e602d687 JA |
3 | $node_config = json_decode(file_get_contents("node/config.json"), true);\r |
4 | \r | |
5 | switch(true){\r | |
6 | case stripos($_SERVER['HTTP_USER_AGENT'], 'android') > 0:\r | |
7 | $agent = "android"; $touchscreen = true;\r | |
8 | break;\r | |
9 | \r | |
10 | case stripos($_SERVER['HTTP_USER_AGENT'], 'iphone') > 0:\r | |
11 | $agent = "iphone"; $touchscreen = true;\r | |
12 | break;\r | |
13 | \r | |
14 | case stripos($_SERVER['HTTP_USER_AGENT'], 'ipod') > 0:\r | |
15 | $agent = "ipod"; $touchscreen = true;\r | |
16 | break;\r | |
17 | \r | |
18 | case stripos($_SERVER['HTTP_USER_AGENT'], 'ipad') > 0:\r | |
19 | $agent = "ipad"; $touchscreen = true;\r | |
20 | break;\r | |
21 | \r | |
22 | default:\r | |
23 | $agent = "normal";\r | |
24 | $touchscreen = false;\r | |
25 | }\r | |
26 | \r | |
27 | define("SERVER_SET", isset($_GET['server']));\r | |
28 | $server = isset($_GET['server']) ? $_GET['server'] : "irc.anonnet.org";\r | |
29 | $nick = isset($_GET['nick']) ? $_GET['nick'] : "";\r | |
30 | // Channel is set via javascript using location.hash\r | |
31 | \r | |
32 | $node_server = $_SERVER['HTTP_HOST'];\r | |
33 | \r | |
54f4a22e | 34 | ?>\r |
ceec0f93 | 35 | <!DOCTYPE html>\r |
54f4a22e D |
36 | <html xmlns="http://www.w3.org/1999/xhtml">\r |
37 | <head>\r | |
38 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r | |
39 | \r | |
40 | <?php if(in_array($agent, array("android", "ipad", "iphone", "ipad"))){ ?>\r | |
41 | <meta name="viewport" content="width=device-width,user-scalable=no" />\r | |
42 | <?php } ?>\r | |
43 | \r | |
44 | <title>Kiwi IRC</title>\r | |
45 | <link rel="stylesheet" type="text/css" href="css/default.css">\r | |
46 | <link rel="stylesheet" type="text/css" href="css/ui.css">\r | |
47 | \r | |
48 | <?php if($touchscreen){ ?>\r | |
49 | <link rel="stylesheet" type="text/css" href="css/touchscreen_tweaks.css">\r | |
50 | <?php } ?>\r | |
51 | \r | |
1614c0f9 | 52 | <script src="http://<?php echo $node_server; ?>:7777/socket.io/socket.io.js"></script>\r |
6cd647f7 | 53 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>\r |
54f4a22e D |
54 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>\r |
55 | <script type="text/javascript" src="js/jquery.json-2.2.min.js"></script>\r | |
56 | <script type="text/javascript" src="js/util.js"></script>\r | |
57 | <script type="text/javascript" src="js/gateway.js"></script>\r | |
58 | <script type="text/javascript" src="js/front.js"></script>\r | |
784ae106 | 59 | <script type="text/javascript" src="js/iscroll.js"></script>\r |
54f4a22e D |
60 | \r |
61 | <?php if(in_array($agent, array("android", "ipad", "iphone", "ipad"))){ ?>\r | |
62 | <script type="text/javascript" src="js/touchscreen_tweaks.js"></script>\r | |
63 | <?php } ?>\r | |
64 | \r | |
65 | <script type="text/javascript">\r | |
e602d687 JA |
66 | var agent = '<?php echo $agent; ?>';\r |
67 | var touchscreen = <?php echo ($touchscreen) ? 'true' : 'false'; ?>;\r | |
68 | var init_data = {};\r | |
7d1c3ee9 | 69 | var kiwi_server = '<?php echo ($node_config['listen_ssl'] ? "https" : "http")."://".$node_server; ?>:7777/kiwi';\r |
e602d687 JA |
70 | var touch_scroll;\r |
71 | \r | |
72 | $(document).ready(function(){\r | |
73 | manageDebug(false);\r | |
74 | \r | |
75 | //#channel,##channel,&channel\r | |
76 | var chans = document.location.hash.match(/[#&]+[^ ,\007]+/g);\r | |
77 | if(chans != null && chans.length > 0) {\r | |
78 | init_data.channel = chans.join(',');\r | |
79 | $('#channel').val(init_data.channel);\r | |
80 | }\r | |
81 | \r | |
82 | front.init();\r | |
83 | gateway.start(kiwi_server);\r | |
84 | \r | |
85 | addEvents();\r | |
86 | $('.nick').focus();\r | |
87 | });\r | |
88 | \r | |
89 | \r | |
90 | function addEvents(){\r | |
eaab80b4 D |
91 | $('#kiwi .more_link').click(function(){ $('.content.bottom').slideDown('fast'); $('.network').focus(); return false; });\r |
92 | $('#kiwi .formconnectwindow').submit(function(){\r | |
e602d687 JA |
93 | init_data.channel = $('#channel').val();\r |
94 | return false;\r | |
95 | });\r | |
eaab80b4 D |
96 | $('#kiwi a.connect').click(function(){ $('.formconnectwindow').submit(); return false; });\r |
97 | $('#kiwi .messages a.chan').live('click', function() {\r | |
98 | front.joinChannel($(this).text());\r | |
99 | return false;\r | |
100 | });\r | |
e602d687 | 101 | }\r |
54f4a22e D |
102 | </script>\r |
103 | \r | |
6cd647f7 D |
104 | \r |
105 | <script id="tmpl_about_box" type="text/x-jquery-tmpl">\r | |
e602d687 JA |
106 | <h2>Kiwi IRC</h2>\r |
107 | <p>An alternative to downloading an irc client. Kiwi IRC is the best web app you'll use for the next couple years.</p>\r | |
108 | <button class="about_close">Close</button>\r | |
109 | <p class="info">${about}</p>\r | |
110 | <p class="revisions">Front: ${front_revision}<br />Gateway: ${gateway_revision}</p>\r | |
6cd647f7 D |
111 | </script>\r |
112 | \r | |
113 | <script id="tmpl_change_nick" type="text/x-jquery-tmpl">\r | |
e602d687 JA |
114 | <div class="newnick box">\r |
115 | Your new nick:<br />\r | |
116 | <form class="form_newnick">\r | |
117 | <input type="text" class="txtnewnick" /><br />\r | |
118 | <button class="butnewnick" type="submit">Change</button> <a class="link cancelnewnick">Cancel</a>\r | |
119 | </form>\r | |
120 | </div>\r | |
6cd647f7 D |
121 | </script>\r |
122 | \r | |
123 | \r | |
124 | <script id="tmpl_plugins" type="text/x-jquery-tmpl">\r | |
e602d687 JA |
125 | <div class="list">\r |
126 | <h2>Kiwi plugins</h2>\r | |
127 | <p>\r | |
128 | <select multiple="multiple" id="plugin_list">\r | |
129 | </select>\r | |
130 | <button id="plugins_list_unload">Unload</button>\r | |
131 | </p>\r | |
132 | </div>\r | |
133 | <div class="load">\r | |
134 | Plugin file URL:<br />\r | |
135 | <form>\r | |
136 | <input type="text" class="txtpluginfile" /><br />\r | |
137 | <button class="butnewnick" type="submit">Load..</button> <a class="link cancelpluginfile">Cancel</a>\r | |
138 | </form>\r | |
139 | </div>\r | |
6cd647f7 D |
140 | </script>\r |
141 | \r | |
142 | <script id="tmpl_user_box" type="text/x-jquery-tmpl">\r | |
e602d687 JA |
143 | <div class="userbox">\r |
144 | <input type="hidden" class="userbox_nick" value="${nick}" />\r | |
145 | <a href="#" class="userbox_query">Message</a>\r | |
146 | <a href="#" class="userbox_whois">Info</a>\r | |
147 | </div>\r | |
6cd647f7 D |
148 | </script>\r |
149 | \r | |
54f4a22e D |
150 | </head>\r |
151 | \r | |
152 | <body>\r | |
153 | \r | |
154 | <div id="kiwi">\r | |
e602d687 JA |
155 | <div class="connectwindow">\r |
156 | <h1 class="logo">Kiwi IRC</h1>\r | |
157 | <div id="login">\r | |
158 | <form class="formconnectwindow">\r | |
159 | <div class="content top">\r | |
160 | <ul>\r | |
161 | <li><label for="nick">Your nickname:</label>\r | |
162 | <input type="text" id="nick" name="nick" class="nick" placeholder="Your nick.." /></li>\r | |
163 | </ul>\r | |
164 | <a class="connect" href="">Connect..</a>\r | |
165 | </div>\r | |
166 | \r | |
167 | <div class="more" style="<?php if(SERVER_SET) echo "display:none;"; ?>">\r | |
168 | <a href="" class="more_link">More</a>\r | |
169 | <div class="content bottom">\r | |
170 | <ul>\r | |
171 | <li><label for="network">Server:</label>\r | |
172 | <input type="text" id="network" name="network" class="network" value="<?php echo htmlentities($server); ?>" /></li>\r | |
173 | <li><label for="channel">Channel:</label>\r | |
174 | <input type="text" id="channel" name="channel" class="channel" value="#kiwiirc" /></li>\r | |
175 | </ul>\r | |
176 | <a class="connect" href="">Connect..</a>\r | |
177 | </div>\r | |
178 | </div>\r | |
179 | </form>\r | |
180 | </div>\r | |
181 | </div>\r | |
182 | \r | |
183 | \r | |
184 | \r | |
185 | <div class="windowlist">\r | |
186 | <div class="poweredby">Powered by Kiwi IRC</div>\r | |
187 | <ul></ul>\r | |
188 | </div>\r | |
189 | \r | |
ceec0f93 D |
190 | <div class="cur_topic">\r |
191 | <!--\r | |
192 | <ul class="edit" style="float:right;">\r | |
193 | <li>\r | |
194 | <img src="img/more.png" />\r | |
195 | <ul id="kiwi_menu">\r | |
196 | <li>Item 1</li>\r | |
197 | <li>Item 2</li>\r | |
198 | <li>Item 3</li>\r | |
199 | </ul>\r | |
200 | </li>\r | |
201 | </ul>\r | |
202 | -->\r | |
203 | <div class="topic" style="margin-right:5em; overflow:hidden; white-space: pre-wrap; word-wrap: break-word;"></div>\r | |
204 | </div>\r | |
e602d687 JA |
205 | \r |
206 | <div class="userlist">\r | |
207 | <ul></ul>\r | |
208 | </div>\r | |
209 | \r | |
210 | <div id="windows" class="windows"><div class="scroller" style="width:100%;"></div></div>\r | |
211 | \r | |
212 | <div class="control">\r | |
213 | <div class="msginput">\r | |
214 | <div class="nick"><a href="#"></a>:</div>\r | |
215 | <input type="text" name="kiwi_msginput" id="kiwi_msginput" />\r | |
216 | </div>\r | |
217 | <div class="plugins">\r | |
218 | <ul>\r | |
219 | <li><a class="load_plugin_file">Plugins</a></li>\r | |
220 | <?php if(isset($_GET['debug'])){ ?>\r | |
221 | <li><a class="reload_css">Reload CSS</a></li>\r | |
222 | <?php } ?>\r | |
223 | </ul>\r | |
224 | </div>\r | |
225 | </div>\r | |
54f4a22e D |
226 | </div>\r |
227 | \r | |
228 | </body>\r | |
c984ba1b | 229 | </html>\r |