-
-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathlayout_external.php
More file actions
46 lines (44 loc) · 1.74 KB
/
layout_external.php
File metadata and controls
46 lines (44 loc) · 1.74 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
<html>
<head>
<?php include_stylesheets() ?>
<?php include_javascripts() ?>
<script>
var socketIoAddress = "<?php echo sfConfig::get("app_ebot_ip"); ?>:<?php echo sfConfig::get("app_ebot_port"); ?>";
var httpMode = "<?php echo sfConfig::get("app_ebot_httpmode"); ?>";
var socket = null;
var socketIoLoaded = false;
var loadingSocketIo = false;
var callbacks = new Array();
function initSocketIo(callback) {
callbacks.push(callback);
if (loadingSocketIo) {
return;
}
if (socketIoLoaded) {
if (typeof callback == "function") {
callback(socket);
}
return;
}
loadingSocketIo = true;
$.getScript(httpMode+socketIoAddress+"/socket.io/socket.io.js", function(){
socket = io.connect("http://"+socketIoAddress);
socket.on('connect', function(){
socketIoLoaded = true;
loadingSocketIo = false;
if (typeof callback == "function") {
callback(socket);
}
for (var c in callbacks) {
callbacks[c](socket);
}
//callbacks = new Array();
});
});
}
</script>
</head>
<body style="background-color:transparent;">
<?php echo $sf_content ?>
</body>
</html>