Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
52 lines (45 sloc) 2.2 KB
<html ng-app="wikipediaApp">
<head>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body ng-controller="SearchController as ctrl">
<div class="container-fluid">
<div class="row">
<div class="text-center"><h1>Wikipedia Search</h1></div>
<div class="wrapper col-xs-10 col-xs-offset-1">
<div class="random">
<div class="content"></div>
<a href="https://en.wikipedia.org/wiki/Special:Random">
<button id="random" class="btn center-block">Random Article</button>
</a>
</div>
<div class="search">
<button id="search" class="btn center-block" ng-click="search.state = !search.state">Search</button>
<div class="search-container" ng-if="search.state">
<form>
<span class="col-xs-10 col-xs-offset-1 form-group">
<input ng-model="ctrl.searchTerm" id="searchbox" class="searchbox form-control" type="text" name="query" placeholder="Search Wikipedia">
</span>
<!-- Submit button not used after Part 2 -->
<!-- <button ng-click="ctrl.search()" id="submit" class="fa fa-chevron-right" aria-hidden="true"></button> -->
</form>
</div><!-- .search-container -->
<table class="search-results table table-striped table-hover table-responsive">
<tbody>
<tr ng-repeat="title in results[1]">
<td class="col-xs-3"><a ng-href="{{ results[3][$index] }}">{{ title }}</a></td>
<td class="col-xs-9">{{ results[2][$index] }}</td>
</tr>
</tbody>
</table>
</div><!-- .search -->
</div><!--.wrapper-->
</div> <!-- .row -->
</div><!-- .container-fluid -->
<script src="lib/jquery.min.js"></script>
<script src="lib/angular.min.js"></script>
<script src="app.js"></script>
</body>
</html>