3 $node_config = json_decode(file_get_contents("node/config.json"), true);
6 case stripos($_SERVER['HTTP_USER_AGENT'], 'android') > 0:
7 $agent = "android"; $touchscreen = true;
10 case stripos($_SERVER['HTTP_USER_AGENT'], 'iphone') > 0:
11 $agent = "iphone"; $touchscreen = true;
14 case stripos($_SERVER['HTTP_USER_AGENT'], 'ipod') > 0:
15 $agent = "ipod"; $touchscreen = true;
18 case stripos($_SERVER['HTTP_USER_AGENT'], 'ipad') > 0:
19 $agent = "ipad"; $touchscreen = true;
27 define("SERVER_SET", isset($_GET['server']));
28 $server = isset($_GET['server']) ?
$_GET['server'] : "irc.anonnet.org";
29 $nick = isset($_GET['nick']) ?
$_GET['nick'] : "";
30 // Channel is set via javascript using location.hash
32 $node_server = $_SERVER['HTTP_HOST'];
35 <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
36 <html xmlns
="http://www.w3.org/1999/xhtml">
38 <meta http
-equiv
="Content-Type" content
="text/html; charset=utf-8" />
40 <?php
if(in_array($agent, array("android", "ipad", "iphone", "ipad"))){ ?
>
41 <meta name
="viewport" content
="width=device-width,user-scalable=no" />
44 <title
>Kiwi IRC
</title
>
45 <link rel
="stylesheet" type
="text/css" href
="css/default.css">
46 <link rel
="stylesheet" type
="text/css" href
="css/ui.css">
48 <?php
if($touchscreen){ ?
>
49 <link rel
="stylesheet" type
="text/css" href
="css/touchscreen_tweaks.css">
52 <script src
="http://<?php echo $node_server; ?>:7777/socket.io/socket.io.js"></script
>
53 <script type
="text/javascript" src
="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script
>
54 <script type
="text/javascript" src
="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script
>
55 <script type
="text/javascript" src
="js/jquery.json-2.2.min.js"></script
>
56 <script type
="text/javascript" src
="js/util.js"></script
>
57 <script type
="text/javascript" src
="js/gateway.js"></script
>
58 <script type
="text/javascript" src
="js/front.js"></script
>
59 <script type
="text/javascript" src
="js/iscroll.js"></script
>
61 <?php
if(in_array($agent, array("android", "ipad", "iphone", "ipad"))){ ?
>
62 <script type
="text/javascript" src
="js/touchscreen_tweaks.js"></script
>
65 <script type
="text/javascript">
66 var agent
= '<?php echo $agent; ?>';
67 var touchscreen
= <?php
echo ($touchscreen) ?
'true' : 'false'; ?
>;
69 var kiwi_server
= '<?php echo ($node_config['listen_ssl
'] ? "https" : "http")."://".$node_server; ?>:7777/';
72 $
(document
).ready(function(){
75 //#channel,##channel,&channel
76 var chans
= document
.location
.hash
.match(/[#&]+[^ ,\007]+/g);
77 if(chans
!= null && chans
.length
> 0) {
78 init_data
.channel
= chans
.join(',');
79 $
('#channel').val(init_data
.channel
);
83 gateway
.start(kiwi_server
);
91 $
('.more_link').click(function(){ $
('.content.bottom').slideDown('fast'); $
('.network').focus(); return false; });
92 $
('.formconnectwindow').submit(function(){
93 init_data
.channel
= $
('#channel').val();
96 $
('a.connect').click(function(){ $
('.formconnectwindow').submit(); return false; });
101 <script id
="tmpl_about_box" type
="text/x-jquery-tmpl">
103 <p
>An alternative to downloading an irc client
. Kiwi IRC is the best web app you
'll use for the next couple years.</p>
104 <button class="about_close">Close</button>
105 <p class="info">${about}</p>
106 <p class="revisions">Front: ${front_revision}<br />Gateway: ${gateway_revision}</p>
109 <script id="tmpl_change_nick" type="text/x-jquery-tmpl">
110 <div class="newnick box">
112 <form class="form_newnick">
113 <input type="text" class="txtnewnick" /><br />
114 <button class="butnewnick" type="submit">Change</button> <a class="link cancelnewnick">Cancel</a>
120 <script id="tmpl_plugins" type="text/x-jquery-tmpl">
122 <h2>Kiwi plugins</h2>
124 <select multiple="multiple" id="plugin_list">
126 <button id="plugins_list_unload">Unload</button>
130 Plugin file URL:<br />
132 <input type="text" class="txtpluginfile" /><br />
133 <button class="butnewnick" type="submit">Load..</button> <a class="link cancelpluginfile">Cancel</a>
138 <script id="tmpl_user_box" type="text/x-jquery-tmpl">
139 <div class="userbox">
140 <input type="hidden" class="userbox_nick" value="${nick}" />
141 <a href="#" class="userbox_query">Message</a>
142 <a href="#" class="userbox_whois">Info</a>
151 <div class="connectwindow">
152 <h1 class="logo">Kiwi IRC</h1>
154 <form class="formconnectwindow">
155 <div class="content top">
157 <li><label for="nick">Your nickname:</label>
158 <input type="text" id="nick" name="nick" class="nick" placeholder="Your nick.." /></li>
160 <a class="connect" href="">Connect..</a>
163 <div class="more" style="<?php if(SERVER_SET) echo "display:none;"; ?>">
164 <a href="" class="more_link">More</a>
165 <div class="content bottom">
167 <li><label for="network">Server:</label>
168 <input type="text" id="network" name="network" class="network" value="<?php echo htmlentities($server); ?>" /></li>
169 <li><label for="channel">Channel:</label>
170 <input type="text" id="channel" name="channel" class="channel" value="#kiwiirc" /></li>
172 <a class="connect" href="">Connect..</a>
181 <div class="windowlist">
182 <div class="poweredby">Powered by Kiwi IRC</div>
186 <div class="cur_topic"></div>
188 <div class="userlist">
192 <div id="windows" class="windows"><div class="scroller" style="width:100%;"></div></div>
194 <div class="control">
195 <div class="msginput">
196 <div class="nick"><a href="#"></a>:</div>
197 <input type="text" name="kiwi_msginput" id="kiwi_msginput" />
199 <div class="plugins">
201 <li><a class="load_plugin_file">Plugins</a></li>
202 <?php if(isset($_GET['debug
'])){ ?>
203 <li><a class="reload_css">Reload CSS</a></li>