-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (83 loc) · 3.44 KB
/
index.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
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Pebble Challenge</title>
<meta name="author" content="Jack Forbes" />
<meta name="description" content="Pebble Coding Challenge | Responsive Reddit Client">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="img/favicon.ico">
<link href='https://fonts.googleapis.com/css?family=tangerine|Raleway|Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/app.css"/>
<link rel="stylesheet" href="css/autocomplete.css"/>
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body ng-controller="PageCtrl" ng-init="initialize()">
<div class="autocomplete" ng-hide="elements.length">
<i class="fa fa-2x"
ng-class="{'fa-spinner fa-spin': (subreddits.length < 1 && !noAutocomplete), 'fa-search': (subreddits.length || noAutocomplete)}">
</i>
<input type="text" autocomplete
autofocus="true"
ng-model="searchParam"
placeholder="Search for a Subreddit"
ng-focus="focused = true"
ng-blur="blur()">
<ul ng-show="searchParam.length > 0 && focused" class="suggestions">
<li
ng-repeat="suggestion in subreddits | filter:searchParam | orderBy:'toString()' | limitTo:10 track by $index"
val="{{suggestion}}"
ng-class="{ 'active': $index == selectedIndex }"
ng-click="submitSubreddit(suggestion)"
ng-bind-html="suggestion | highlight:searchParam">
</li>
</ul>
</div>
<div class="content slide" ng-show="elements.length || noSubredditPosts">
<h2 ng-show="noSubredditPosts">Unable to load posts :(</h2>
<div>
<h2>{{type}} /r/{{searchParam}}</h2>
<table>
<tbody>
<tr ng-repeat="element in elements ">
<td class="score"><h3>{{element.score}}</h3></td>
<td>
<a ng-href='http://reddit.com{{element.permalink}}' target='_blank' class="title">{{element.title}}
</a>
<br>
<small class="label label-username">
<i class="fa fa-user-md"></i>{{element.author}}
</small>
<small class="label label-comments">
<i class="fa fa-comment-o"></i>{{element.num_comments}} comments
</small>
<small class="label label-hours">
<i class="fa fa-clock-o"></i>{{getHours(element.created_utc)}} hours
</small>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="footer" ng-class="{'relative': elements.length > 1}">
<a class="website" href="http://jackforbes.net" target="_blank">
<i class="fa fa-user"></i>
</a>
<a class="github" href="https://github.com/JackForbes/Pebble" target="_blank">
<i class="fa fa-github-square"></i>
</a>
<a class="linked-in" href="http://ca.linkedin.com/in/greaturl/" target="_blank">
<i class="fa fa-linkedin-square"></i>
</a>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular-touch.min.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/filters.js"></script>
<script src="js/directives.js"></script>
</body>
</html>