-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsimpleHangoutApp.html
161 lines (136 loc) · 7.35 KB
/
simpleHangoutApp.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
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
<!DOCTYPE html>
<html data-ng-app="hangoutApp">
<head>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'><!--OswaldFonts-->
<link href='http://fonts.googleapis.com/css?family=Francois+One' rel='stylesheet' type='text/css'><!--Francois FOnt-->
<title>My Hangout List</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"><!--Responsive-->
<link href="StyleSheet.css" rel="stylesheet" media="screen" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"><!--fontawesome-->
</head>
<body>
<div class="container">
<div class="headerClass" id="headerId">
<h1> Hangout Contacts App</h1>
</div>
<div data-ng-controller="SimpleController">
<a ng-click="showTable()" class="btn btn-lg btn-success" href="#">
<i class="fa fa-phone-square fa-2x pull-left"></i> Show the Contacts
</a>
<a ng-click="hideTable()" class="btn btn-lg btn-success" href="#">
<i class="fa fa-phone-square fa-2x pull-left"></i> Hide the Contacts
</a>
<a ng-click="" target="_blank" href="https://plus.google.com/hangouts/_?gid=<app_id">Start a Hangout</a>
<br />
<br />
<div ng-show="checked">
<button ng-click="uncheckAll()" type="submit" class="btn btn-default">Clear All</button>
<button ng-click="generateCall()" type="button" class="btn btn-primary">Generate Group Call</button>
<br />
<br />
<div id="placeholder-div2"></div>
<br />
<br />
<table class="table" ng-cloak>
<thead>
<tr>
<th class="col-md-1">Choose</th>
<th class="col-md-1">Index</th>
<th class="col-md-1">Firstname</th>
<th class="col-md-1">Lastname</th>
<th class="col-md-1">Email</th>
<th class="col-md-1">Action</th>
<th class="col-md-1">Hangout Call</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="person in contacts | orderBy:'id'">
<td class="col-md-1"><input ng-change="modifyEmails('{{person.email}}')" type="checkbox" ng-model="person.selected"> </td>
<td class="col-md-1">{{ person.id }}</td>
<td class="col-md-1">{{person.name}}</td>
<td class="col-md-1">{{person.surname | uppercase}}</td>
<td class="col-md-1">{{person.email}}</td>
<td>
<button type="button" class="btn btn-danger" ng-click="del($index)">Delete</button>
</td>
<td class="col-md-1" ng-cloak>
<g:hangout render="createhangout"
invites="[{ id : '{{person.email}}', invite_type : 'EMAIL' }]">
</g:hangout>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script src="Scripts/angular.min.js"></script>
<script>
var hangoutApp = angular.module('hangoutApp', []);
var controllers = {};
controllers.SimpleController = function SimpleController($scope) {
$scope.emails = [];
$scope.contacts = [
{id: 1, name: 'Osman', surname: 'gurlek', email: '[email protected]', selected: false },
{ id: 2, name: 'Mesut', surname: 'gurlek', email: '[email protected]', selected: false },
{ id: 3, name: 'Emre', surname: 'gurlek', email: '[email protected]', selected: false },
{id: 4, name: 'Ahmet', surname: 'gurlek', email: '[email protected]', selected: false },
{ id: 5, name: 'Sami', surname: 'gurlek', email: '[email protected]', selected: false },
{ id: 6, name: 'Ali', surname: 'gurlek', email: '[email protected]', selected: false }
];
$scope.modifyEmails = function (_email) {
var checked;
angular.forEach($scope.contacts, function (e) {
if (e.email === _email) {
checked = e.selected;
}
});
if (checked) {
$scope.emails.push(
{ id: _email, invite_type: 'EMAIL' }
);
}
else {
var whatIndex = null;
angular.forEach($scope.emails, function (e, index) {
if (e.id === _email) {
whatIndex = index;
}
});
$scope.emails.splice(whatIndex, 1);
}
}
$scope.generateCall = function () {
gapi.hangout.render('placeholder-div2', {
'render': 'createhangout',
'invites': $scope.emails,
'widget_size': 72
});
};
$scope.del = function (ind) {
$scope.contacts.splice(ind, 1);
};
$scope.showTable = function () {
$scope.checked = true;
};
$scope.hideTable = function () {
$scope.checked = false;
};
$scope.uncheckAll = function () {
angular.forEach($scope.contacts, function (person) {
person.selected = false;
});
$scope.emails = [];
};
}
hangoutApp.controller(controllers);
</script>
</div>
</body>
</html>