-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
324 lines (221 loc) · 9.1 KB
/
Copy pathindex.html
File metadata and controls
324 lines (221 loc) · 9.1 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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>My App</title>
<!-- Path to Framework7 Library CSS-->
<link rel="stylesheet" href="css/framework7.material.min.css">
<link rel="stylesheet" href="css/framework7.material.colors.min.css">
<!-- Path to your custom app styles-->
<link rel="stylesheet" href="css/my-app.css">
<!-- Path to Framework7 Library JS-->
<script type="text/javascript" src="js/framework7.min.js"></script>
<!-- Path to your app js-->
<script type="text/javascript" src="js/my-app.js"></script>
<script type="text/javascript" src="js/kitchen-sink.js"></script>
<script src="./js/jquery.min.js"></script>
<script src="./js/angular.min.js"></script>
</head>
<body ng-init="init()" ng-app="myApp" ng-controller="myControler" >
<!-- Status bar overlay for fullscreen mode-->
<div class="statusbar-overlay"></div>
<!-- Panels overlay-->
<div class="panel-overlay"></div>
<!-- Left panel with reveal effect-->
<div class="panel panel-left panel-reveal" ng-controller="GetFilenames">
<!--
<div class="content-block">
<div class="content-block-title">Uploaded songs</div>
<div class="list-block">
<ul>
<li ng-repeat="fileName in file_names" ng-click="replay(fileName)">
<a href="#" class="item-link item-content">
<div class="item-inner" >
<div class="item-title">{{fileName}}</div>
</div>
</a>
</li>
</ul>
</div>
</div>
-->
<div class="list-block">
<ul>
<li class="swipeout" filename='{{fileName}}' ng-repeat="fileName in file_names" ng-click="replay(fileName)">
<div class="item-content swipeout-content" style="">
<div class="item-media"><i class="icon icon-f7"></i></div>
<div class="item-inner">
<div class="item-title">{{fileName}}</div>
</div>
</div>
<div class="swipeout-actions-right"><a href="#" data-confirm="Are you sure you want to delete this item?" class="swipeout-delete" style="left: 0px;">Delete</a></div>
</li>
</ul>
</div>
</div> <!-- left panel end -->
<!-- Right panel with cover effect-->
<div class="panel panel-right panel-cover">
<div class="content-block" ng-include="'./help.html'">
<p>Right panel content goes here</p>
</div>
</div>
<!-- Views-->
<div class="views">
<!-- Your main view, should have "view-main" class-->
<div class="view view-main">
<!-- Top Navbar-->
<div class="navbar">
<div class="navbar-inner">
<!-- We have home navbar without left link-->
<div class="center sliding">RASPBERRY PI RADIO App</div>
<div class="right">
<!-- Right link contains only icon - additional "icon-only" class--><a href="#" class="link icon-only open-panel"> <i class="icon icon-bars"></i></a>
</div>
</div>
</div>
<!-- Pages, because we need fixed-through navbar and toolbar, it has additional appropriate classes-->
<div class="pages navbar-through toolbar-through">
<!-- Page, data-page contains page name-->
<div data-page="index" class="page">
<!-- Scrollable page content-->
<div class="page-content" > <!-- angularjs -->
<div class="content-block-title">Welcome To My Awesome App</div>
<!-- <div class="row">
<div class="col-60">
-->
<div class="content-block" >
<div class="content-block-inner" >
<p>RASPBERY PI radio</p>
<p> This is a web interface for rasberry pi radio </p>
<p> transmit radio by pressing PLAY </p>
<br>
</div>
</div>
<div class="content-block bg-blue">
<div class="content-block-inner color-orange bold"><h1>FREQUENCY</h1></div>
<p class="content-block"style="font-size:5em;">{{frequency}}</p>
</div>
<!---->
<form id='form1' method="POST" enctype="multipart/form-data" action="./phpFMplayer.php">
<input class="custom-file-input " type='file' id='_file' name='music'>
<input type='hidden' name='play' value='valueplay'>
<p class="buttons-row" ><a href="#" ng-click="playFm()" class=" button button-big button-fill button-raised color-pink" >PLAY</a><a href="#" ng-click="stopFm()" class="button button-big button-fill button-raised color-teal">STOP</a></p>
<!--<div ng-app="">-->
<div class="item-content">
<div class="item-inner">
<div class="item-input">
<div class="range-slider">
<input ng-model="frequency" name='frequency' class="" min="88" max="108" value="95" step="0.1" type="range">
</div>
</div>
</div>
</div>
</form>
<!-- <h1>frequency {{frequency}}</h1> -->
<!--</div>-->
<br>
<br>
<br>
<br>
</div>
<!-- page-content end -->
</div>
</div>
<!-- Bottom Toolbar-->
<div class="toolbar">
<div class="toolbar-inner"><a href="#" class="link open-panel">songs</a><a href="#" class="link open-panel" data-panel="right" >help</a></div>
</div>
</div>
</div>
<script>
</script>
<script>
//setting up angular js
var app = angular.module('myApp', []);
app.controller('myControler', function($scope,$http) {
$scope.init = function () {
//inital function
}
$scope.frequency = "95";
//call post ///call jquery fmplay through angular
$scope.playFm=function(){
fq=$scope.frequency;
//$.post('http://192.168.1.10/~pi/index.php',{'play':'play','frequency':fq});
/* var file_data = $('#_file').prop('files')[0];
$.post('http://192.168.1.10/~pi/dev_piFM_project/phpFMplayer.php',{'play':'play','frequency':fq,'file':file_data}).done(function(data){console.log('received'+data)}).fail(function(data){console.log("ERROR"+data)});
$.post('http://192.168.43.10/~pi/dev_piFM_project/phpFMplayer.php',{'play':'play','frequency':fq}).done(function(data){console.log(data)});
$.post('http://raspberrypi.local/~pi/dev_piFM_project/phpFMplayer.php',{'play':'play','frequency':fq}).done(function(data){console.log(data)});
*/
form1.submit();
}
$scope.stopFm=function(e){
$.post('http://192.168.1.10/~pi/dev_piFM_project/phpFMplayer.php',{'stop':'play'});
$.post('http://192.168.43.10/~pi/dev_piFM_project/phpFMplayer.php',{'stop':'play'});//if wifi in meizu m2 note
$.post('http://raspberrypi.local/dev_piFM_project/~pi/phpFMplayer.php',{'stop':'play'});//if from pc
}
$scope.replay=function(filename){
console.log(filename);
fq=$scope.frequency;
$.post('./phpFMplayer.php',{'replay':filename,'frequency':fq},function(data){
//alert(data);
console.log('replay responce');
myApp7.addNotification({
message: 'Now Playing:'+filename
});
setTimeout(function(){
console.log('close notification');
myApp7.closeNotification('.notification-item')
},5000);
});
}
});
app.controller('GetFilenames', function($scope, $http) {
$http.get("./getuploadedsongs.php")
.then(function(response) {
$scope.file_names = response.data;
$$('.swipeout').on('deleted', function () {
myApp7.alert('Item removed');
});
console.log("getuploadedsongs called");
});
});
/*
function fmplay(){
frequency=
$.post('http://192.168.1.10/~pi/index.php',{'play':'play','frequency':'95.0'});
}*/
function finetunner()
{
f.value=parseFloat(parseFloat(slider1.value)+parseFloat(slider2.value))
}
</script>
<script>
//framework 7 notification
var myApp7 = new Framework7({
material: true
});
var mainView = myApp7.addView('.view-main');
var $$ = Dom7;
/*
uncomment to show welcome message
myApp7.addNotification({
message: 'Welcome to pi radio'
});
*/
/* $$('.swipeout').on('deleted', function () {
myApp7.alert('Item removed');
});
*/
$$('.open-panel').click(function(){
//myApp7.alert('openpanel');
$$('.swipeout').on('deleted', function () {
myApp7.alert('Item removed');
x=this;
});
});
x=null;
</script>
</html>