-
Notifications
You must be signed in to change notification settings - Fork 128
Feature: Alert bar for IPFS #289
Changes from all commits
23a2cd6
6d60aa2
30184c0
10683d2
0225fa8
158c1ff
4c293b2
05d3ef5
ea3aeca
af6f23b
417a793
b846dce
d3c8c1c
409d3be
26f4baf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
pagetype: major | ||
pagename: IPFS Weekly Call | ||
section: IPFS Weekly Call | ||
title: IPFS Weekly Call | ||
url: call | ||
save_as: call/index.html | ||
constellation: constellation-02.svg | ||
--- | ||
|
||
## Welcome to the IPFS Weekly Call | ||
|
||
Join us every week for the IPFS Weekly Call where we hear from the IPFS Community. Our calls start 17 UTC every Monday. We use zoom to host our calls and [this link](https://protocol.zoom.us/j/443621844) will directly bring you into the live video chat. | ||
|
||
Before you join there are several points we would like to go over: | ||
|
||
1. The IPFS calls are recorded and are put on [Youtube](https://www.youtube.com/playlist?list=PLuhRWgmPaHtSGRSHdU9dbsukHKlihZZAe) | ||
2. Have a read of the agenda for the call, and add your name as an attendee on the [IPFS Weekly Call document](https://docs.google.com/document/d/1WHyIZhBo2eEgYXlZ5HLHg6a6ZWTH3tV848sWkYBJjJA/edit#heading=h.hz5t61tdc5r6) | ||
3. We expect all participants to abide by the [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). | ||
|
||
|
||
### Call Format | ||
|
||
1. IPFS Announcements and Demos | ||
2. Main Presentation | ||
3. Q&A | ||
|
||
|
||
|
||
## Code of Conduct | ||
|
||
We believe that our mission is best served in an environment that is friendly, safe, and accepting; free from intimidation or harassment. | ||
|
||
Towards this end, certain behaviors and practices will not be tolerated. | ||
|
||
You can learn more about our Code of Conduct [here](https://github.com/ipfs/community/blob/master/code-of-conduct.md). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
var stars = require('./lib/stars') | ||
var popup = require('./lib/popup') | ||
var blogFeed = require('./lib/blog-feed') | ||
var alertBar = require('./lib/alert-bar') | ||
|
||
stars() | ||
popup() | ||
blogFeed() | ||
alertBar() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var $ = require('jquery') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not import jquery just to create a pop up There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @daviddias Jquery wouldn't be my first choice either, but it is already used in ipfs.io site. https://github.com/ipfs/website/blob/master/js/lib/popup.js https://github.com/ipfs/website/blob/master/js/lib/blog-feed.js There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ya, we’re already using it on two other pages. if someone wants to send a PR to remove it’s use throughout the site, fine, but I don’t see why we would hold up new contributions since it’s not actually adding a dependency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Understood. Although I would argue that the best way to default not be the first choice anymore is to move away from it rather than adding it in more places. |
||
var callData = require('./communityCall.json') | ||
|
||
function shouldShowBanner (date, startTimeString, startDay) { | ||
var now = date.getUTCHours() | ||
var startTime = parseInt(startTimeString, 10) | ||
var dayOfWeek = date.getUTCDay() | ||
|
||
if ((startTime - now <= 2 && startTime - now >= parseFloat(-0.5) && (dayOfWeek === startDay))) { | ||
return true | ||
} | ||
return false | ||
} | ||
|
||
module.exports.shouldShowBanner = shouldShowBanner | ||
|
||
function callTime () { | ||
var reminder = $('.alert-bar') | ||
if (shouldShowBanner(new Date(), callData.time, callData.day)) { | ||
$('.alert-bar-message').append('<span>The IPFS community call will start at ' + callData.time + '. Join us <a href=' + callData.callPage + ' style="color: #0073b5; text-decoration: underline">here</a></span>') | ||
reminder.show() | ||
} else { | ||
reminder.hide() | ||
} | ||
} | ||
callTime() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"callName": "IPFS Weekly Call", | ||
"time": "17:00 UTC", | ||
"day": 1, | ||
"callPage": "/call", | ||
"zoomLink": "https://protocol.zoom.us/j/443621844" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var assert = require('assert') | ||
var shouldShowBanner = require('./alert-bar').shouldShowBanner | ||
|
||
describe('shouldShowBanner', function () { | ||
it('should return false if the time is more than 2.5 hours before the call', function () { | ||
var wednesday = new Date('2019-03-13T18:33:05.629Z') | ||
assert.equal(shouldShowBanner(wednesday, '17:00 UTC', 1), false) | ||
}) | ||
|
||
it('should return if the time is within 2.5 hours before the call', function () { | ||
var monday = new Date('2019-03-11T16:33:05.629Z') | ||
assert.equal(shouldShowBanner(monday, '17:00 UTC', 1), true) | ||
}) | ||
|
||
it('should return true if the time is during the call', function () { | ||
var monday = new Date('2019-03-11T17:29:05.629Z') | ||
assert.equal(shouldShowBanner(monday, '17:00 UTC', 1), true) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="flex items-center justify-center pa2 navy alert-bar" style="display: none; background-color: #e2f4ff;"> | ||
<svg class="w1" data-icon="info" viewBox="0 0 32 32" style="fill:currentcolor"> | ||
<title>info icon</title> | ||
<path d="M16 0 A16 16 0 0 1 16 32 A16 16 0 0 1 16 0 M19 15 L13 15 L13 26 L19 26 z M16 6 A3 3 0 0 0 16 12 A3 3 0 0 0 16 6"></path> | ||
</svg> | ||
<span class="lh-title ml3 alert-bar-message"></span> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.