bfdotcom-theme 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/comments.html +8 -6
- data/assets/scripts/core.js +8 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3ed6dafdbe7d4d9dd22ba315097fc9109bc3f1eb9ed3048a2d0751db601a9a1
|
4
|
+
data.tar.gz: 9ba384c05c0071d723db0781a53a710243a4201ae30740befbd9f3d9d2b2dc5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10f3865e753672adda051b25d433720f136c3e387ef70621278992af0ce5b994bab9ea78fb96d8de87aa049bb26cc5f3cf7cdbbcaecb3cf5864289863897de47
|
7
|
+
data.tar.gz: 174a32ecb39bf26f65102464b16dd927767ad734a1cac27404e01ae4a2f2baebc796a5a0c86c1d1be3fdba71412b98839161a369f71ce45f60f049029a8ca844
|
data/_includes/comments.html
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
{%- assign comments = site.data.comments | where: "url", page.url -%}
|
2
2
|
{%- assign comments_size = comments | size -%}
|
3
3
|
|
4
|
+
<p> </p>
|
5
|
+
|
4
6
|
<h3>Comments</h3>
|
5
7
|
|
6
8
|
<div class="showSignedOut row">
|
@@ -11,14 +13,15 @@
|
|
11
13
|
|
12
14
|
<div class="showSignedIn row">
|
13
15
|
<div class="col">
|
14
|
-
You're signed in as <span id="currentUserName"></span>, and the new comment form is coming soon, I promise!
|
16
|
+
You're signed in as <span id="currentUserName"></span>, and the new comment form is coming soon, I promise! <br />
|
17
|
+
<a href="#" onclick="signOut()">Sign out</a>
|
15
18
|
</div>
|
16
19
|
</div>
|
17
20
|
|
18
21
|
{%- if comments_size > 0 -%}
|
22
|
+
{%- for comment in comments -%}
|
23
|
+
<hr />
|
19
24
|
<div class="row">
|
20
|
-
{%- for comment in comments -%}
|
21
|
-
|
22
25
|
<div class="col-md-1">
|
23
26
|
<img src="https://www.gravatar.com/avatar/{{comment.emailHash}}" alt="Profile image for {{comment.name}}" />
|
24
27
|
</div>
|
@@ -26,10 +29,9 @@
|
|
26
29
|
<div class="col-md-11">
|
27
30
|
<strong>{{comment.name}}</strong> <small>{{comment.datetime}}</small><br />
|
28
31
|
{{comment.comment}}
|
29
|
-
</div>
|
30
|
-
|
31
|
-
{%- endfor -%}
|
32
|
+
</div>
|
32
33
|
</div>
|
34
|
+
{%- endfor -%}
|
33
35
|
{%- endif -%}
|
34
36
|
|
35
37
|
<p> </p>
|
data/assets/scripts/core.js
CHANGED
@@ -19,9 +19,9 @@ function refreshLogin(id_token) {
|
|
19
19
|
console.error(error)
|
20
20
|
signOut()
|
21
21
|
} else {
|
22
|
-
localStorage.setItem("accessKeyId", credentials.accessKeyId)
|
23
|
-
localStorage.setItem("secretAccessKey", credentials.secretAccessKey)
|
24
|
-
localStorage.setItem("sessionToken", credentials.sessionToken)
|
22
|
+
localStorage.setItem("accessKeyId", AWS.config.credentials.accessKeyId)
|
23
|
+
localStorage.setItem("secretAccessKey", AWS.config.credentials.secretAccessKey)
|
24
|
+
localStorage.setItem("sessionToken", AWS.config.credentials.sessionToken)
|
25
25
|
var now = Date.now()
|
26
26
|
localStorage.setItem("expiresAt", addMinutes(now, 60))
|
27
27
|
refreshSignedInStatus()
|
@@ -38,7 +38,7 @@ function getUserInfo() {
|
|
38
38
|
|
39
39
|
function setDisplayElements() {
|
40
40
|
var userInfo = getUserInfo()
|
41
|
-
$('#currentUserName').
|
41
|
+
$('#currentUserName').text(userInfo.email)
|
42
42
|
}
|
43
43
|
|
44
44
|
function refreshSignedInStatus() {
|
@@ -46,7 +46,7 @@ function refreshSignedInStatus() {
|
|
46
46
|
var secretAccessKey = localStorage.getItem("secretAccessKey")
|
47
47
|
var sessionToken = localStorage.getItem("sessionToken")
|
48
48
|
var expiresAt = localStorage.getItem("expiresAt")
|
49
|
-
|
49
|
+
|
50
50
|
var now = Date.now()
|
51
51
|
if (expiresAt !== null && expiresAt < now) {
|
52
52
|
// session was there, but has expired, so force a sign out
|
@@ -55,9 +55,11 @@ function refreshSignedInStatus() {
|
|
55
55
|
} else if (accessKeyId === null || secretAccessKey === null || sessionToken === null) {
|
56
56
|
// user is not signed in
|
57
57
|
setSignInDisplay(false)
|
58
|
-
|
58
|
+
return
|
59
|
+
} else if (accessKeyId !== null && secretAccessKey !== null && sessionToken !== null) {
|
59
60
|
// user is signed in
|
60
61
|
setSignInDisplay(true)
|
62
|
+
return
|
61
63
|
}
|
62
64
|
|
63
65
|
// if we get to here, we just don't know, so force a signed out state
|