diff --git a/content/index.html b/content/index.html index 7d0c3868..004fbc81 100644 --- a/content/index.html +++ b/content/index.html @@ -6,6 +6,7 @@ + {{ partial "alert-bar.html" }} {{ partial "header.html" (dict "hero" "homepage" "baseUrl" ($.Param " baseURL ") "page" .) }}
diff --git a/content/ipfs-call/index.md b/content/ipfs-call/index.md new file mode 100644 index 00000000..ffea0928 --- /dev/null +++ b/content/ipfs-call/index.md @@ -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). \ No newline at end of file diff --git a/js/header-and-latest.js b/js/header-and-latest.js index d6cde822..47fe8e98 100644 --- a/js/header-and-latest.js +++ b/js/header-and-latest.js @@ -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() diff --git a/js/lib/alert-bar.js b/js/lib/alert-bar.js new file mode 100644 index 00000000..f97cc7cd --- /dev/null +++ b/js/lib/alert-bar.js @@ -0,0 +1,26 @@ +var $ = require('jquery') +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('The IPFS community call will start at ' + callData.time + '. Join us here') + reminder.show() + } else { + reminder.hide() + } +} +callTime() diff --git a/js/lib/communityCall.json b/js/lib/communityCall.json new file mode 100644 index 00000000..da896d35 --- /dev/null +++ b/js/lib/communityCall.json @@ -0,0 +1,7 @@ + { + "callName": "IPFS Weekly Call", + "time": "17:00 UTC", + "day": 1, + "callPage": "/call", + "zoomLink": "https://protocol.zoom.us/j/443621844" + } diff --git a/js/lib/test.js b/js/lib/test.js new file mode 100644 index 00000000..4e060e1d --- /dev/null +++ b/js/lib/test.js @@ -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) + }) +}) diff --git a/layouts/partials/alert-bar.html b/layouts/partials/alert-bar.html new file mode 100644 index 00000000..26deef5f --- /dev/null +++ b/layouts/partials/alert-bar.html @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/less/main.less b/less/main.less index c7b20cac..36bad200 100755 --- a/less/main.less +++ b/less/main.less @@ -22,6 +22,7 @@ @import 'components/code'; @import 'components/blog'; @import (less) 'node_modules/magnific-popup/dist/magnific-popup.css'; +@import (less) 'node_modules/tachyons/css/tachyons.css'; @import 'pages/home'; @import 'pages/docs'; diff --git a/package.json b/package.json index c0fb055e..c331b7a1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,12 @@ { "name": "ipfs.io", "private": true, - "dependencies": {}, + "dependencies": { + "chai": "^4.2.0", + "hugo": "0.0.3", + "mocha": "^6.0.2", + "tachyons": "^4.10.0" + }, "devDependencies": { "browserify": "^14.4.0", "dnslink-deploy": "^1.0.7", @@ -12,6 +17,8 @@ "imagemin-optipng": "^5.2.1", "imagemin-svgo": "^5.2.2", "jquery": "^3.2.1", + "jsdom": "14.0.0", + "jsdom-global": "3.0.2", "less": "^2.7.2", "less-plugin-autoprefix": "^1.5.1", "less-plugin-clean-css": "^1.5.1", @@ -37,7 +44,7 @@ "minify": "npm-run-all minify:*", "minify:img": "find public/images -type d -exec imagemin {}/* --out-dir={} \\; && find public/blog/static -type d -exec imagemin {}/* --out-dir={} \\;", "minify:js": "find public/js -name '*.js' -exec uglifyjs {} --compress --output {} \\;", - "test": "echo \"Error: no test specified\" && exit 1", + "test": "mocha -r jsdom-global/register --recursive './js/lib/test.js'", "watch": "npm-run-all -p watch:*", "watch:css": "stylus -u autoprefixer-stylus -I node_modules/yeticss/lib -w _styl/main.styl -c -o static/css", "watch:js": "nodemon --watch js --exec \"browserify js/popup.js -o static/js/popup.js && browserify js/stars.js -o static/js/stars.js\"",