-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
108 lines (86 loc) · 2.62 KB
/
test.html
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
<!DOCTYPE html>
<html ng-app="myApp">
<head lang="en">
<meta charset="utf-8">
<title>Custom Plunker</title>
<link rel="stylesheet" type="text/css"
href="http://angular-ui.github.com/ng-grid/css/ng-grid.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script type="text/javascript"
src="http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript">
var songs = [ {
name : 'All of me',
tempo : 120,
key : "G",
playbacks : [ {
url : "http://gfdgfdg.mp3"
}, {
url : "http://gfdgfdg.mp366"
}, {
url : "http://gfdgfdg.mp55553"
} ]
}, {
name : 'Swing 42',
tempo : 160,
youtube_playbacks : [ "9mhDen5mpOw" ]
} ];
var app = angular.module('myApp', [ 'ngGrid' ]);
app
.controller(
'MyCtrl',
function($scope, $sce) {
for ( var indexSong = 0; indexSong < songs.length; indexSong++) {
var song = songs[indexSong];
var youtube_playbacks = song.youtube_playbacks;
if (youtube_playbacks != undefined)
for ( var indexPlayback = 0; indexPlayback < youtube_playbacks.length; indexPlayback++) {
youtube_playbacks[indexPlayback] = {
domain : $sce
.trustAsResourceUrl("https://www.youtube.com/embed/"
+ youtube_playbacks[indexPlayback])
};
// alert();
}
}
$scope.songs = songs;
});
</script>
<style type="text/css">
/*style.css*/
.gridStyle {
border: 1px solid rgb(212, 212, 212);
width: 400px;
height: 300px
}
</style>
</head>
<body ng-controller="MyCtrl">
<div>
<h1>Swing Lyons</h1>
<div ng-repeat="song in songs">
<h2 onclick="angular.element('song').visibility = 'none'">{{song.name}}</h2>
<div class="Song" ng-attr-id="{{ 'song-' + songs.index }}">
♩ = {{song.tempo}}
<div visibility="collapse" ng-repeat="playback in song.playbacks">
<a href="{{playback.url}}">{{playback.url}}</a>
</div>
<!-- <div ng-repeat="playback in song.playbacks"> -->
<!-- <a href="{{playback.url}}">{{playback.url}}</a> -->
<!-- </div> -->
<div ng-repeat="playback in song.youtube_playbacks">
<!-- <a href="//www.youtube.com/embed/{{playback}}">{{playback}}</a> -->
<iframe width="560" height="315" name="fff"
ng-src="{{playback.domain}}" frameborder="0" allowfullscreen>
</iframe>
</div>
</div>
</div>
</div>
</body>
</html>