-
Notifications
You must be signed in to change notification settings - Fork 0
/
agenda.js.backup
112 lines (101 loc) · 2.35 KB
/
agenda.js.backup
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
var httpObject = null;
var httpObject2 = null;
var link = "";
var timerID = 0;
// Get the HTTP Object
function getHTTPObject()
{
if( window.ActiveXObject )
return new ActiveXObject("Microsoft.XMLHTTP");
else if( window.XMLHttpRequest )
return new XMLHttpRequest();
else
{
alert("Your browser does not support AJAX.");
return null;
}
}
function setNow( text )
{
var objDiv = document.getElementById("CurrentAgendaItem");
objDiv.innerHTML = response;
}
function recvAgendaItem()
{
if( httpObject.readyState == 4 )
{
var response = httpObject.responseText;
var objDiv = document.getElementById("CurrentAgendaItem");
objDiv.innerHTML = response;
// objDiv.scrollTop = objDiv.scrollHeight;
}
}
function markItem( id )
{
httpObject = getHTTPObject();
if( httpObject != null )
{
var offset = Math.floor( jwplayer().getPosition() );
var link = dataURL + '?mediaid=' + mediaid + "&cmd=mk3&textid=" + id + "&position=" + offset;
httpObject.open("POST", link , true);
httpObject.onreadystatechange = recvAgendaItem;
httpObject.send(null);
}
}
function getAgendaItem( offset )
{
httpObject = getHTTPObject();
if( httpObject != null )
{
var link = dataURL + '?mediaid=' + mediaid + "&cmd=ply&position=" + offset;
httpObject.open("POST", link , true);
httpObject.onreadystatechange = recvAgendaItem;
httpObject.send(null);
}
}
function recvAllAgendaItem()
{
if( httpObject2.readyState == 4 )
{
var response = httpObject2.responseText;
var objDiv = document.getElementById("AgendaItemList");
objDiv.innerHTML = response;
// objDiv.scrollTop = objDiv.scrollHeight;
}
}
function getAllAgenda( edit )
{
httpObject2 = getHTTPObject();
if( httpObject2 != null )
{
var link = dataURL + '?mediaid=' + mediaid + "&cmd=lst";
if( 1 == edit )
{
link += "&edit=1";
}
httpObject2.open("POST", link , true);
httpObject2.onreadystatechange = recvAllAgendaItem;
httpObject2.send(null);
}
}
function doReload()
{
if( jwplayer != null )
{
var position = Math.floor( jwplayer().getPosition() );
getAgendaItem( position );
}
}
function UpdateTimer()
{
doReload();
timerID = setTimeout("UpdateTimer()", 5000);
}
function gotoIndex( offset, name )
{
if( jwplayer != null )
{
jwplayer().seek( offset );
getAgendaItem( offset );
}
}