-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
53 lines (44 loc) · 1.33 KB
/
main.js
File metadata and controls
53 lines (44 loc) · 1.33 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
var App = angular.module('pennnametags', []);
App.controller('NametagsController', function($scope, $interval) {
$interval(function() {
$.get('https://spreadsheets.google.com/feeds/list/1YIC3ak844JnRNGUF9AFstXCJePea4yCjwSMMIXcaxMA/od6/public/values?alt=json', function (data) {
var newData = [];
for (var r = 0; r < data.feed.entry.length; r++) {
var row = data.feed.entry[r];
var content = row.content.$t;
content = content.split(",");
var entry = {};
for (var i = 0; i < content.length; i++) {
var item = content[i];
var idx = item.indexOf(":");
var key = item.substring(0, idx).trim();
var value = item.substring(idx+1, item.length).trim();
entry[key] = value;
}
newData.push(entry);
}
$scope.nametags = newData;
$scope.$apply();
});
}, 1000);
var tables = [];
for (var i = 1; i < 201; i++) {
tables.push({
"First": i,
"Title": "Table",
"image": "exec"
});
}
//$scope.nametags = tables;
});
$(document).ready(function() {
$(window).load(function() {
setTimeout(function() {
$('.name').each(function() {
if ($(this).height() > 90) {
$(this).parent().css('top', '50%');
}
});
}, 3000); //excessively long timeout to make sure everything is loaded
});
});