Initial node code.
[KiwiIRC.git] / index_old.php
1 <?php
2
3 switch(true){
4 case stripos($_SERVER['HTTP_USER_AGENT'], 'android') > 0:
5 $agent = "android"; $touchscreen = true;
6 break;
7
8 case stripos($_SERVER['HTTP_USER_AGENT'], 'iphone') > 0:
9 $agent = "iphone"; $touchscreen = true;
10 break;
11
12 case stripos($_SERVER['HTTP_USER_AGENT'], 'ipod') > 0:
13 $agent = "ipod"; $touchscreen = true;
14 break;
15
16 case stripos($_SERVER['HTTP_USER_AGENT'], 'ipad') > 0:
17 $agent = "ipad"; $touchscreen = true;
18 break;
19
20 default:
21 $agent = "normal";
22 $touchscreen = false;
23 }
24 ?>
25 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
26 <html xmlns="http://www.w3.org/1999/xhtml">
27 <head>
28 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29
30 <?php if(in_array($agent, array("android", "ipad", "iphone", "ipad"))){ ?>
31 <meta name="viewport" content="width=device-width,user-scalable=no" />
32 <?php } ?>
33
34 <title>kiwi</title>
35 <link rel="stylesheet" type="text/css" href="css/default.css">
36 <link rel="stylesheet" type="text/css" href="css/ui.css">
37
38 <?php if($touchscreen){ ?>
39 <link rel="stylesheet" type="text/css" href="css/touchscreen_tweaks.css">
40 <?php } ?>
41
42
43 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
44 <script type="text/javascript" src="js/jquery.json-2.2.min.js"></script>
45 <script type="text/javascript" src="js/util.js"></script>
46 <script type="text/javascript" src="js/gateway.js"></script>
47 <script type="text/javascript" src="js/front.js"></script>
48
49 <?php if(in_array($agent, array("android", "ipad", "iphone", "ipad"))){ ?>
50 <script type="text/javascript" src="js/touchscreen_tweaks.js"></script>
51 <?php } ?>
52
53 <script type="text/javascript">
54 var agent = '<?= $agent ?>';
55 var touchscreen = <?= ($touchscreen) ? 'true' : 'false' ?>;
56 var init_data = {};
57
58 $(document).ready(function(){
59 if(touchscreen) $('#kiwi').addClass('touchscreen');
60
61 //#nick@irc.anonnet.org:6679+/#channel,##channel,&channel
62 var chans = document.location.hash.match(/[#&]+[^ ,\007]+/g);
63 if(chans != null && chans.length > 0) { init_data.channel = chans.join(','); }
64
65 front.init();
66 });
67 </script>
68
69 </head>
70
71 <body>
72
73 <div id="kiwi">
74 <div class="box about">
75 <h2>kiwi</h2>
76 <p>An alternative to downloading an irc client. This web app is the best thing you'll use in the next couple years.</p>
77 <button class="about_close">Close</button>
78 </div>
79
80 <div class="connectwindow">
81 <form class="formconnectwindow">
82 <label for="nick">Nick</label>
83 <input type="text" class="nick" value="<?php if(isset($_GET['nick'])) echo htmlentities($_GET['nick']); ?>" /><br />
84
85 <span class="networkselection">
86 <?php if(isset($_GET['server'])){ ?>
87 <input type="hidden" class="network" value="<?php if(isset($_GET['server'])) echo htmlentities($_GET['server']); ?>" />
88 <?php } else { ?>
89 <label for="network">Network</label>
90 <select class="network">
91 <?php if(1==1){ echo '<option value="irc.anonnet.org">AnonNet</option>'; } ?>
92 <option value="irc.freenode.net">Freenode</option>
93 <option value="irc.dal.net">DALnet</option>
94
95 </select>
96 <?php } ?>
97 </span>
98 <button type="submit">Connect</button>
99 </form>
100 </div>
101
102
103
104 <div class="windowlist">
105 <div class="poweredby">Powered by kiwi</div>
106 <ul></ul>
107 </div>
108
109 <div class="userlist">
110 <ul></ul>
111 </div>
112
113 <div class="cur_topic"></div>
114
115 <div class="control">
116 <div class="msginput">
117 <div class="nick"><a href="#"></a>:</div>
118 <input type="text" name="kiwi_msginput" id="kiwi_msginput" />
119 </div>
120 <div class="plugins">
121 <ul>
122 <li><a class="load_plugin_file">Load plugin file</a></li>
123 <li><a class="reload_css">Reload CSS</a></li>
124 </ul>
125 </div>
126 </div>
127 </div>
128
129 </body>
130 </html>