summaryrefslogtreecommitdiff
path: root/new_timer.html
blob: 1d94c064d33c3c2c5c111d57a19a4e553cccd56c (plain)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type" />
<meta content="minimum-scale=1.0, width=device-width, maximum-scale=0.6667, user-scalable=no" name="viewport" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script src="javascript/functions.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/spinningwheel.css" type="text/css" media="all" />
<script type="text/javascript" src="javascript/spinningwheel-min.js?v=1.4"></script>
<title>Title of your page</title>
<meta content="keyword1,keyword2,keyword3" name="keywords" />
<meta content="Description of your page" name="description" />
<script type="text/javascript">
function updateOrientation() {
     switch(window.orientation) {
     case 0:
         orient = "portrait";
         break;
     case -90:
         orient = "landscape";
         break;
     case 90:
         orient = "landscape";
         break;
     case 180:
         orient = "portrait";
         break;
     }
     document.body.setAttribute("orient", orient);
     window.scrollTo(0, 1);

 }
 function sendForm(formid) {
	var frm;
	frm = document.getElementById(formid);
	frm.submit();
}
function openSelectDate(timer_year,timer_month,timer_day) {
	var now = new Date();
	if ( timer_year == null ) {
	var now_year = now.getFullYear();
	var now_month = now.getMonth()+1;
	var now_day = now.getDate();
	}
	else
	{
	var now_year = timer_year;
        var now_month = timer_month;
        var now_day = timer_day;
	}
	var layer = 'layer_date';
	var days = { };
	var years = { };
	var months = { 1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec' };
	
	for( var i = 1; i < 32; i += 1 ) {
		days[i] = i;
	}

	for( i = now.getFullYear(); i < now.getFullYear()+5; i += 1 ) {
		years[i] = i;
	}

	SpinningWheel.addSlot(days, 'right', now_day);
	SpinningWheel.addSlot(months, '', now_month);
	SpinningWheel.addSlot(years, 'right', now_year );
	
	SpinningWheel.setCancelAction(cancel_date);
	SpinningWheel.setDoneAction(done_date);
	
	SpinningWheel.open();
}

function done_date() {
	var results = SpinningWheel.getSelectedValues();
	document.getElementById('layer_date').innerHTML = results.values.join(' ');
	document.timer.timer_date.value = results.keys.join(' ');
	
}

function cancel_date() {
}
function openSelectTime(layer,timer_hour,timer_minute) {
	 if ( timer_hour == null ) {
	var now = new Date();
	var now_hour = now.getHours();
	var now_minute = now.getMinutes()+1;
	}
	else
	{
	var now_hour = timer_hour;
        var now_minute = timer_minute;
	}
	var hours = { };
	var minutes = { };
	
	for( var i = 00; i < 24; i += 1 ) {
		hours[i] = i;
	}

	for( var i = 00; i < 60; i += 1 ) {
		minutes[i] = i;
	}

	SpinningWheel.addSlot(hours, 'right', now_hour);
	SpinningWheel.addSlot({ separator: 'h' }, 'readonly shrink');
	SpinningWheel.addSlot(minutes, '', now_minute);
	
	SpinningWheel.setCancelAction( function() {} );
	SpinningWheel.setDoneAction(function () {var results = SpinningWheel.getSelectedValues(); document.getElementById(layer).innerHTML = results.values.join('');if ( layer == 'layer_starttime' ) { var forminput = 'timer_starttime'; } else { var forminput = 'timer_endtime'; }; eval ("document.timer." + forminput + ".value = results.keys.join('')");  });
	SpinningWheel.open();
}

</script>
</head>

<body onorientationchange="updateOrientation();" onload="updateOrientation();">

<div id="topbar" class="transparent">
<div id="leftnav">
<a href="javascript:sendForm('getback')">Back</a></div>
<div id="rightnav">
<a href="index.php"><img alt="home" src="images/home.png" /></a></div>
<div id="title">
iStream
</div>
</div>
<div id="content"> <span class="graytitle">New Timer</span>

<form name="timer" id="timer" method="post" action="index.php">
  <ul class="pageitem">
    <li class="textbox"><span class="header">Recording name</span></li>
    <li class="bigfield">
      <input type="text" placeholder="Enter recording name" name="timer_name" />
    </li>
  </ul>
  <ul class="pageitem">
    <li class="textbox"><span class="header">Channel</span></li>
    <li class="select">
      <select name="timer_chan">
        <option value="1">TF1</option>
        <option value="2">France 2</option>
        <option value="3">France 3</option>
        <option value="4">France 4</option>
        <option value="4">France 5</option>
        <option value="4">M6</option>
      </select>
      <span class="arrow"></span></li>
  </ul>
    
  <ul class="pageitem">
   <li class="textbox"><span class="header">Date</span></li>
   <li class="menu"><a class="noeffect" href="javascript:openSelectDate()">
  <span class="name" id="layer_date">Select timer date</span><span class="arrow"></span></a></li>
 
  </ul>
  	<ul class="pageitem">
	<li class="textbox"><span class="header">Start time</span></li>
   <li class="menu"><a class="noeffect" href="javascript:openSelectTime('layer_starttime')">
  <span class="name" id="layer_starttime">Select start time</span><span class="arrow"></span></a></li>
  </ul>
  	<ul class="pageitem">
	<li class="textbox"><span class="header">End time</span></li>
   <li class="menu"><a class="noeffect" href="javascript:openSelectTime('layer_endtime')">
  <span class="name" id="layer_endtime">Select end time</span><span class="arrow"></span></a></li>
  </ul>
<input name="action" type="hidden" id="action" value="newtimer"/>
<input name="timer_date" type="hidden" id="timer_date" value="" />
<input name="timer_starttime" type="hidden" id="timer_starttime" value="" />
<input name="timer_endtime" type="hidden" id="timer_endtime" value="" />

<ul class="pageitem">
<li class="button">
			<input name="Submit" type="submit" value="Submit" /></li>
		</ul>
</form>
</div>
<div id="footer">
	
	iStreamdev 2010
</div>
<form name="getback" id="getback" method="post" action="index.php"><input name="action" type="hidden" id="action" value="timers" /></form>

</body>

</html>