forked from CNXTEoEorg/sc2-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (72 loc) · 3.31 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
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<title>Demo</title>
<base href="/" />
<meta charset="UTF-8">
<meta id="viewport" name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_ykgtxz90gjve7b9.css">
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script>
<script src="https://steemit.github.io/example-steemconnect-angular/sc2.min.js"></script>
<script src="https://cdn.steemjs.com/lib/latest/steem.min.js"></script>
<script src="https://steemit.github.io/example-steemconnect-angular/app.js"></script>
<style>
hr { margin: 40px 0; }
h3 { margin-bottom: 20px; }
</style>
</head>
<body>
<div class="container py-5" style="max-width: 600px;" ng-controller="Main as main">
<div class="mb-4">
<h1>Demo</h1>
<p>This is a demo using <a href="https://github.com/steemit/sc2-sdk">SteemConnect 2 SDK</a>. You can login, logout, comment and upvote.</p>
<p>Find the code of this demo on GitHub: <a href="https://github.com/steemit/example-steemconnect-angular">https://github.com/steemit/example-steemconnect-angular</a></p>
</div>
<hr />
<div>
<h3>Login & logout</h3>
<b ng-show="isAuth()"><img src="https://steemitimages.com/u/{{user.name}}/avatar" width="32" height="32"> @{{user.name}}</b>
<button ng-show="isAuth()" class="ml-2 btn btn-secondary" type="submit" ng-click="logout()">
Logout
</button>
<a class="btn btn-primary" ng-href="{{loginURL}}" ng-hide="isAuth()">Log In</a>
</div>
<hr />
<h3>Comment & vote</h3>
<div class="input-group input-group-lg">
Last comments on the post: @{{parentAuthor}}/{{parentPermlink}}
</div>
<ul class="list-group my-4" ng-init="loadComments()">
<li class="list-group-item" ng-repeat="comment in comments">
@{{comment.author}}: {{comment.body}}
<button ng-show="isAuth()" class="ml-2 btn btn-secondary btn-sm" type="submit" ng-click="vote(comment.author, comment.permlink, 1000)">
<i class="icon iconfont icon-praise"></i> {{comment.net_votes}}
</button>
</li>
</ul>
<form ng-show="isAuth()" ng-submit="comment()">
<div class="input-group">
<input type="text" class="form-control" ng-disabled="loading" placeholder="Write a comment here" ng-model="message">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">Submit</button>
</span>
</div>
</form>
<hr />
<h3>User metadata</h3>
<p>SteemConnect allows you to store data related to each user (such as user preferences) that do not impact a user's core functionality.</p>
<form ng-show="isAuth()" ng-submit="updateUserMetadata({ locale: locale })">
<div class="input-group">
<input type="text" class="form-control" placeholder="What is your locale?" ng-model="locale">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">Save</button>
</span>
</div>
<pre class="mt-4">{{metadata}}</pre>
</form>
</div>
</body>
</html>