-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhome.html
More file actions
153 lines (145 loc) · 4.08 KB
/
home.html
File metadata and controls
153 lines (145 loc) · 4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<script src="javascript/jquery.min.js"></script>
<meta charset="utf-8" />
<title>Surprise!</title>
<link href="css/bootstrap-combined.min.css" rel="stylesheet">
<script src="javascript/bootstrap.min.js"></script>
<style type="text/css">
#any {
position: absolute;
left: 250px;
top: 150px;
background-image: url(images/nm4.png);
width: 100px;
height: 100px;
}
#welcome {
position: absolute;
left: 0px;
top: 0px;
font-size: 20px;
}
.container {
position: relative;
width: 600px;
height: 300px;
}
#purpose, #manual {
font-size: 20px;
font-weight: bold;
}
</style>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36344182-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<center>
<div class="container">
<div id="any"></div>
<div id="welcome"></div>
</div>
<div class="row-fluid">
<div class="offset4 span4">
<table>
<tr>
<td align="right">
<div id="fb_login" class="btn btn-primary"></div>
</td>
<td>
<div id="guest_login" class="btn"></div>
</td>
</tr>
<tr>
<td colspan="2"><br>
<div id="purpose"></div>
<div id="pp1"></div>
</td>
</tr>
<tr>
<td colspan="2"><br>
<div id="manual"></div>
<ol>
<li id="mn1"></li>
<li id="mn2"></li>
<li id="mn3"></li>
</ol>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<select id="lang_select">
<option value="en">English</option>
<option value="zh">繁體中文</option>
<option value="ja">日本語</option>
</select>
</td>
</tr>
</table>
</div>
</div>
</center>
<script src="javascript/translation.js"></script>
<script type="text/javascript">
var lang = "en";
var any_left = parseInt($("#any").css("left"), 10);
var any_top = parseInt($("#any").css("top"), 10);
$("#lang_select :first").prop("selected", true).trigger("change")
$("#lang_select").change(function() {
lang = $("#lang_select").prop("value");
localize();
});
localize();
function localize() {
$("#welcome").css("left", any_left + 80 + "px");
$("#welcome").css("top", any_top - 20 + "px");
//use index to fetch translations
var arr = ["welcome", "guest_login", "fb_login", "purpose", "pp1", "manual", "mn1", "mn2", "mn3"];
for(var i=0;i<arr.length;i++) {
$("#"+arr[i]).html(translation[arr[i]][lang]);
}
}
</script>
<div id="fb-root"></div>
<script src="/socket.io/socket.io.js"></script>
<script type="text/javascript">
var hostname = "mr-tvbs.nko3.jitsu.com";
window.fbAsyncInit = function() {
FB.init({
appId : '301129303330641',
channelUrl : '//'+hostname+"/channel.html"
});
$("#fb_login").click(function() {
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
location.href = "client.html";
});
}
else {
alert(translation["login_plz"][lang]);
}
}, {scope: 'user_about_me, publish_stream'});
});
$("#guest_login").click(function() {
location.href = "client.html";
});
};
(function(d, debug){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all" + (debug ? "/debug" : "") + ".js";
ref.parentNode.insertBefore(js, ref);
}(document, false));
</script>
</body>
</html>