-
Notifications
You must be signed in to change notification settings - Fork 0
/
wikiViewer.html
54 lines (52 loc) · 3.21 KB
/
wikiViewer.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wikipedia Viewer - FreeCodeCamp</title>
<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.css">
<link href="css/wikiViewer.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="main-container" ng-app="wikiViewer">
<div class="container" ng-cloak ng-controller="wikiController">
<md-toolbar class="md-primary">
<div layout="row">
<div class="md-toolbar-tools" flex="70" flex-sm="50">
<h2>Wikipedia Viewer</h2>
</div>
<md-button class="md-raised md-accent" flex="10" flex-offset="20" flex-sm-offset="10" flex-sm="30" ng-click="goToRandom()">Random</md-button>
</div>
</md-toolbar>
<md-content flex layout-padding>
<md-input-container flex="90" flex-offset="5" class="md-primary md-block" class="md-icon-float">
<label>Search wikipedia articles</label>
<input type="text" id="search" ng-keyup="$event.keyCode == 13 && searchEntries()"/>
<md-icon md-font-icon="fa fa-search" style="cursor: pointer" ng-click="searchEntries()"></md-icon>
</md-input-container>
<md-progress-circular md-mode="indeterminate" ng-show="loading" flex-offset="45" class="md-block" layout="column"></md-progress-circular>
<h3 ng-show="showResults" flex-offset="45" flex-md-offset="20">Search results:</h3>
<md-list ng-show="showResults">
<md-divider></md-divider>
<md-list-item class="md-2-line item" ng-repeat="page in pages" ng-click="openArticle(page.pageid)">
<div class="md-list-item-text">
<a ng-href="{{ 'https://en.wikipedia.org/?curid='+ page.pageid }}" style="text-decoration: none"><strong>{{ page.title }}</strong></a>
<p>{{ page.extract }}</p>
</div>
<md-divider></md-divider>
</md-list-item>
</md-list>
</md-content>
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://use.fontawesome.com/75ecc3166c.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-aria.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-messages.min.js"></script>
<!-- Angular Material Library -->
<script src="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.js"></script>
<script type="text/javascript" src="js/wikiViewer.js"></script>
</body>
</html>