From 3fb86482404e11942cd83c3500a297a3991db0e4 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Wed, 13 Sep 2017 16:28:53 +0200 Subject: Restructure project --- .bowerrc | 2 +- .gitignore | 3 +- app.js | 62 ---- bin/www | 60 ---- lib/getMeetingpointData.js | 83 ----- lib/getURLOfUser.js | 8 - lib/getUserIndex.js | 85 ----- package.json | 2 +- public/.well-known/keybase.txt | 54 --- public/apple-touch-icon.png | Bin 6447 -> 0 bytes public/browserconfig.xml | 9 - public/favicon-16x16.png | Bin 1293 -> 0 bytes public/favicon-32x32.png | Bin 2103 -> 0 bytes public/favicon.ico | Bin 15086 -> 0 bytes public/icons/mml-logo.png | Bin 12508 -> 0 bytes public/icons/res/mipmap-hdpi/ic_launcher.png | Bin 6503 -> 0 bytes public/icons/res/mipmap-mdpi/ic_launcher.png | Bin 3854 -> 0 bytes public/icons/res/mipmap-xhdpi/ic_launcher.png | Bin 9631 -> 0 bytes public/icons/res/mipmap-xxhdpi/ic_launcher.png | Bin 15315 -> 0 bytes public/icons/res/mipmap-xxxhdpi/ic_launcher.png | Bin 23445 -> 0 bytes public/javascripts/analytics.js | 35 -- public/javascripts/autocomplete.js | 87 ----- public/javascripts/browserFixToolkit.js | 12 - public/javascripts/bundle.js | 256 -------------- public/javascripts/favorite.js | 79 ----- public/javascripts/featureDetect.js | 29 -- public/javascripts/frontpage.js | 23 -- public/javascripts/main.js | 71 ---- public/javascripts/schedule.js | 78 ---- public/javascripts/scrollSnap.js | 59 ---- public/javascripts/search.js | 95 ----- public/javascripts/url.js | 67 ---- public/javascripts/weekSelector.js | 99 ------ public/javascripts/zoom.js | 30 -- public/manifest.beta.webmanifest | 29 -- public/manifest.webmanifest | 29 -- public/mstile-150x150.png | Bin 3995 -> 0 bytes public/safari-pinned-tab.svg | 34 -- public/stylesheets/hello.css | 23 -- public/stylesheets/print.css | 63 ---- public/stylesheets/style.css | 392 --------------------- public/sw.js | 29 -- public/untisinfo.css | 11 - routes/getSchedule.js | 55 --- routes/index.js | 31 -- routes/manifest.js | 19 - routes/opensearch.js | 12 - src/client/javascript/analytics.js | 35 ++ src/client/javascript/autocomplete.js | 87 +++++ src/client/javascript/browserFixToolkit.js | 12 + src/client/javascript/favorite.js | 79 +++++ src/client/javascript/featureDetect.js | 29 ++ src/client/javascript/frontpage.js | 23 ++ src/client/javascript/main.js | 71 ++++ src/client/javascript/schedule.js | 78 ++++ src/client/javascript/scrollSnap.js | 59 ++++ src/client/javascript/search.js | 95 +++++ src/client/javascript/url.js | 67 ++++ src/client/javascript/weekSelector.js | 99 ++++++ src/client/javascript/zoom.js | 30 ++ src/client/static/.well-known/keybase.txt | 54 +++ src/client/static/apple-touch-icon.png | Bin 0 -> 6447 bytes src/client/static/browserconfig.xml | 9 + src/client/static/favicon-16x16.png | Bin 0 -> 1293 bytes src/client/static/favicon-32x32.png | Bin 0 -> 2103 bytes src/client/static/favicon.ico | Bin 0 -> 15086 bytes src/client/static/icons/mml-logo.png | Bin 0 -> 12508 bytes .../static/icons/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 6503 bytes .../static/icons/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 3854 bytes .../static/icons/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 9631 bytes .../static/icons/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 15315 bytes .../icons/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 23445 bytes src/client/static/manifest.beta.webmanifest | 29 ++ src/client/static/manifest.webmanifest | 29 ++ src/client/static/mstile-150x150.png | Bin 0 -> 3995 bytes src/client/static/safari-pinned-tab.svg | 34 ++ src/client/static/stylesheets/hello.css | 23 ++ src/client/static/stylesheets/print.css | 63 ++++ src/client/static/stylesheets/style.css | 392 +++++++++++++++++++++ src/client/static/sw.js | 29 ++ src/client/static/untisinfo.css | 11 + src/client/views/error.jade | 6 + src/client/views/index.jade | 51 +++ src/client/views/layout.jade | 25 ++ src/client/views/redirect.jade | 47 +++ src/server/app.js | 62 ++++ src/server/bin/www | 60 ++++ src/server/lib/getMeetingpointData.js | 83 +++++ src/server/lib/getURLOfUser.js | 8 + src/server/lib/getUserIndex.js | 85 +++++ src/server/routes/getSchedule.js | 55 +++ src/server/routes/index.js | 31 ++ src/server/routes/manifest.js | 19 + src/server/routes/opensearch.js | 12 + views/error.jade | 6 - views/index.jade | 51 --- views/layout.jade | 25 -- views/redirect.jade | 47 --- webpack.config.js | 4 +- 99 files changed, 1986 insertions(+), 2243 deletions(-) delete mode 100644 app.js delete mode 100755 bin/www delete mode 100644 lib/getMeetingpointData.js delete mode 100644 lib/getURLOfUser.js delete mode 100644 lib/getUserIndex.js delete mode 100644 public/.well-known/keybase.txt delete mode 100644 public/apple-touch-icon.png delete mode 100644 public/browserconfig.xml delete mode 100644 public/favicon-16x16.png delete mode 100644 public/favicon-32x32.png delete mode 100644 public/favicon.ico delete mode 100644 public/icons/mml-logo.png delete mode 100644 public/icons/res/mipmap-hdpi/ic_launcher.png delete mode 100644 public/icons/res/mipmap-mdpi/ic_launcher.png delete mode 100644 public/icons/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 public/icons/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 public/icons/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 public/javascripts/analytics.js delete mode 100644 public/javascripts/autocomplete.js delete mode 100644 public/javascripts/browserFixToolkit.js delete mode 100644 public/javascripts/bundle.js delete mode 100644 public/javascripts/favorite.js delete mode 100644 public/javascripts/featureDetect.js delete mode 100644 public/javascripts/frontpage.js delete mode 100644 public/javascripts/main.js delete mode 100644 public/javascripts/schedule.js delete mode 100644 public/javascripts/scrollSnap.js delete mode 100644 public/javascripts/search.js delete mode 100644 public/javascripts/url.js delete mode 100644 public/javascripts/weekSelector.js delete mode 100644 public/javascripts/zoom.js delete mode 100644 public/manifest.beta.webmanifest delete mode 100644 public/manifest.webmanifest delete mode 100644 public/mstile-150x150.png delete mode 100644 public/safari-pinned-tab.svg delete mode 100644 public/stylesheets/hello.css delete mode 100644 public/stylesheets/print.css delete mode 100644 public/stylesheets/style.css delete mode 100644 public/sw.js delete mode 100644 public/untisinfo.css delete mode 100644 routes/getSchedule.js delete mode 100644 routes/index.js delete mode 100644 routes/manifest.js delete mode 100644 routes/opensearch.js create mode 100644 src/client/javascript/analytics.js create mode 100644 src/client/javascript/autocomplete.js create mode 100644 src/client/javascript/browserFixToolkit.js create mode 100644 src/client/javascript/favorite.js create mode 100644 src/client/javascript/featureDetect.js create mode 100644 src/client/javascript/frontpage.js create mode 100644 src/client/javascript/main.js create mode 100644 src/client/javascript/schedule.js create mode 100644 src/client/javascript/scrollSnap.js create mode 100644 src/client/javascript/search.js create mode 100644 src/client/javascript/url.js create mode 100644 src/client/javascript/weekSelector.js create mode 100644 src/client/javascript/zoom.js create mode 100644 src/client/static/.well-known/keybase.txt create mode 100644 src/client/static/apple-touch-icon.png create mode 100644 src/client/static/browserconfig.xml create mode 100644 src/client/static/favicon-16x16.png create mode 100644 src/client/static/favicon-32x32.png create mode 100644 src/client/static/favicon.ico create mode 100644 src/client/static/icons/mml-logo.png create mode 100644 src/client/static/icons/res/mipmap-hdpi/ic_launcher.png create mode 100644 src/client/static/icons/res/mipmap-mdpi/ic_launcher.png create mode 100644 src/client/static/icons/res/mipmap-xhdpi/ic_launcher.png create mode 100644 src/client/static/icons/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 src/client/static/icons/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 src/client/static/manifest.beta.webmanifest create mode 100644 src/client/static/manifest.webmanifest create mode 100644 src/client/static/mstile-150x150.png create mode 100644 src/client/static/safari-pinned-tab.svg create mode 100644 src/client/static/stylesheets/hello.css create mode 100644 src/client/static/stylesheets/print.css create mode 100644 src/client/static/stylesheets/style.css create mode 100644 src/client/static/sw.js create mode 100644 src/client/static/untisinfo.css create mode 100644 src/client/views/error.jade create mode 100644 src/client/views/index.jade create mode 100644 src/client/views/layout.jade create mode 100644 src/client/views/redirect.jade create mode 100644 src/server/app.js create mode 100755 src/server/bin/www create mode 100644 src/server/lib/getMeetingpointData.js create mode 100644 src/server/lib/getURLOfUser.js create mode 100644 src/server/lib/getUserIndex.js create mode 100644 src/server/routes/getSchedule.js create mode 100644 src/server/routes/index.js create mode 100644 src/server/routes/manifest.js create mode 100644 src/server/routes/opensearch.js delete mode 100644 views/error.jade delete mode 100644 views/index.jade delete mode 100644 views/layout.jade delete mode 100644 views/redirect.jade diff --git a/.bowerrc b/.bowerrc index 0b92d57..077f68e 100644 --- a/.bowerrc +++ b/.bowerrc @@ -1,3 +1,3 @@ { - "directory" : "public/components" + "directory" : "client/static/components" } diff --git a/.gitignore b/.gitignore index a78e046..479c388 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ -/public/components +src/client/static/components bundle.js - # Created by https://www.gitignore.io/api/node,bower,vagrant ### Bower ### diff --git a/app.js b/app.js deleted file mode 100644 index c0a0b35..0000000 --- a/app.js +++ /dev/null @@ -1,62 +0,0 @@ -const express = require('express') -const path = require('path') -const logger = require('morgan') -const cookieParser = require('cookie-parser') -const bodyParser = require('body-parser') -const compression = require('compression') - -const routes = require('./routes/index') -const getSchedule = require('./routes/getSchedule') -const manifest = require('./routes/manifest') - -const app = express() - -app.use(compression()) - -// view engine setup -app.set('views', path.join(__dirname, 'views')) -app.set('view engine', 'jade') - -app.use(logger('dev')) -app.use(bodyParser.json()) -app.use(bodyParser.urlencoded({ extended: false })) -app.use(cookieParser()) - -app.use('/manifest.webmanifest', manifest) -app.use(express.static(path.join(__dirname, 'public'))) - -app.use('/', routes) -app.use('/get', getSchedule) - -// catch 404 and forward to error handler -app.use(function (req, res, next) { - const err = new Error('Not Found') - err.status = 404 - next(err) -}) - -// error handlers - -// development error handler -// will print stacktrace -if (app.get('env') === 'development') { - app.use(function (err, req, res, next) { - res.status(err.status || 500) - res.render('error', { - message: err.message, - error: err - }) - }) -} - -// production error handler -// no stacktraces leaked to user -app.use(function (err, req, res, next) { - res.status(err.status || 500) - res.render('error', { - message: err.message, - error: {} - }) -}) - -module.exports = app diff --git a/bin/www b/bin/www deleted file mode 100755 index 545db41..0000000 --- a/bin/www +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env node - -const app = require('../app') -const http = require('http') - -const port = normalizePort(process.env.PORT || '3000') -const server = http.createServer(app) - -server.listen(port) -server.on('error', error => onError(error, port)) -server.on('listening', _ => onListening(server)) - -function normalizePort (val) { - const port = parseInt(val, 10) - - if (isNaN(port)) { - // named pipe - return val - } - - if (port >= 0) { - // port number - return port - } - - return false -} - -function onError (error, port) { - if (error.syscall !== 'listen') { - throw error - } - - const bind = typeof port === 'string' - ? 'Pipe ' + port - : 'Port ' + port - - // handle specific listen errors with friendly messages - switch (error.code) { - case 'EACCES': - console.error(bind + ' requires elevated privileges') - process.exit(1) - break - case 'EADDRINUSE': - console.error(bind + ' is already in use') - process.exit(1) - break - default: - throw error - } -} - -function onListening (server) { - const addr = server.address() - if (typeof addr === 'string') { - console.log(`Listening on pipe ${addr}`) - } else { - console.log(`Listening on http://localhost:${addr.port}/`) - } -} diff --git a/lib/getMeetingpointData.js b/lib/getMeetingpointData.js deleted file mode 100644 index 94cf36c..0000000 --- a/lib/getMeetingpointData.js +++ /dev/null @@ -1,83 +0,0 @@ -'use strict' - -const Promise = require('bluebird') -const cheerio = require('cheerio') -const _ = require('lodash') -const request = Promise.promisify(require('request')) - -let meetingpointData -let lastUpdate - -function getUsers (page) { - const script = page('script').eq(1).text() - - const regexs = [/var classes = \[(.+)\];/, /var teachers = \[(.+)\];/, /var rooms = \[(.+)\];/, /var students = \[(.+)\];/] - const items = regexs.map(function (regex) { - return script.match(regex)[1].split(',').map(function (item) { - return item.replace(/"/g, '') - }) - }) - - return [] - .concat(items[0].map(function (item, index) { - return { - type: 'c', - value: item, - index: index - } - })) - .concat(items[1].map(function (item, index) { - return { - type: 't', - value: item, - index: index - } - })) - .concat(items[2].map(function (item, index) { - return { - type: 'r', - value: item, - index: index - } - })) - .concat(items[3].map(function (item, index) { - return { - type: 's', - value: item, - index: index - } - })) -} - -function getValidWeekNumbers(page) { - const weekSelector = page('select[name="week"]'); - const weekNumbers = _.map(weekSelector.children(), option => parseInt(option.attribs.value)) - - return weekNumbers; -} - -function requestData() { - lastUpdate = new Date() - - return request(`http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/frames/navbar.htm`, { timeout: 5000 }).then((response) => { - const page = cheerio.load(response.body) - const users = getUsers(page) - const validWeekNumbers = getValidWeekNumbers(page) - - meetingpointData = { users, validWeekNumbers } - - return meetingpointData - }) -} - -function getMeetingpointData () { - if (lastUpdate == null || new Date() - lastUpdate > 10 * 60 * 1000) { // 10 minutes - return requestData() - } else if (!meetingpointData) { - return Promise.reject() - } else { - return Promise.resolve(meetingpointData) - } -} - -module.exports = getMeetingpointData diff --git a/lib/getURLOfUser.js b/lib/getURLOfUser.js deleted file mode 100644 index 2de48e6..0000000 --- a/lib/getURLOfUser.js +++ /dev/null @@ -1,8 +0,0 @@ -const leftPad = require('left-pad') // I imported this just to piss you off ;) - -function getURLOfUser (type, index, week) { - return `http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/` + - `${leftPad(week, 2, '0')}/${type}/${type}${leftPad(index + 1, 5, '0')}.htm` -} - -module.exports = getURLOfUser diff --git a/lib/getUserIndex.js b/lib/getUserIndex.js deleted file mode 100644 index db7daa8..0000000 --- a/lib/getUserIndex.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict' - -const Promise = require('bluebird') -const cheerio = require('cheerio') -const request = Promise.promisify(require('request')) - -let userIndex -let lastUpdate - -function updateUserIndex () { - return new Promise(function (resolve, reject) { - process.stdout.write('Updating user index... ') - request(`http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/frames/navbar.htm`) - .then(function (page) { - lastUpdate = new Date() - page = page.body - - const $ = cheerio.load(page) - const $script = $('script').eq(1) - const scriptText = $script.text() - - const regexs = [/var classes = \[(.+)];/, /var teachers = \[(.+)];/, /var rooms = \[(.+)];/, /var students = \[(.+)];/] - const items = regexs.map(function (regex) { - return scriptText.match(regex)[1].split(',').map(function (item) { - return item.replace(/"/g, '') - }) - }) - - userIndex = ([] - .concat(items[0].map(function (item, index) { - return { - type: 'c', - value: item, - index: index - } - })) - .concat(items[1].map(function (item, index) { - return { - type: 't', - value: item, - index: index - } - })) - .concat(items[2].map(function (item, index) { - return { - type: 'r', - value: item, - index: index - } - })) - .concat(items[3].map(function (item, index) { - return { - type: 's', - value: item, - index: index - } - }))) - - process.stdout.write('done.\n') - - resolve(userIndex) - }) - .catch(error => { - process.stdout.write('failed.\n') - reject(error) - }) - }) -} - -function getUserIndex () { - return new Promise((resolve, reject) => { - if (lastUpdate == null) { - updateUserIndex().then(resolve, reject) - } else if (new Date() - lastUpdate > 10 * 60 * 1000) { // 10 minutes - updateUserIndex().then(resolve, function () { - console.warn('Unable to update userIndex, using cached.') - resolve(userIndex) - }) - } else { - resolve(userIndex) - } - }) -} - -module.exports = getUserIndex diff --git a/package.json b/package.json index b00ea68..d03dc84 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "main": "app.js", "private": true, "scripts": { - "start": "node ./bin/www", + "start": "node ./src/server/bin/www", "setup": "npm install && bower install", "dev": "webpack -wd" }, diff --git a/public/.well-known/keybase.txt b/public/.well-known/keybase.txt deleted file mode 100644 index 7e11526..0000000 --- a/public/.well-known/keybase.txt +++ /dev/null @@ -1,54 +0,0 @@ -================================================================== -https://keybase.io/nloomans --------------------------------------------------------------------- - -I hereby claim: - - * I am an admin of https://rooster.hetmml.nl - * I am nloomans (https://keybase.io/nloomans) on keybase. - * I have a public key ASCCV4aRFiMkEv7inJTf34RgxZ6IK0wQ-wTH2ZfSIu3OzAo - -To do so, I am signing this object: - -{ - "body": { - "key": { - "eldest_kid": "0101bbdb28841b169de6538a51d17ca94b30088ba2914e56fd19121eec05f7a389cc0a", - "host": "keybase.io", - "kid": "01208257869116232412fee29c94dfdf8460c59e882b4c10fb04c7d997d222edcecc0a", - "uid": "7a52ddabf92293dd59f8fbf3774ea319", - "username": "nloomans" - }, - "service": { - "hostname": "rooster.hetmml.nl", - "protocol": "https:" - }, - "type": "web_service_binding", - "version": 1 - }, - "client": { - "name": "keybase.io go client", - "version": "1.0.20" - }, - "ctime": 1492017398, - "expire_in": 504576000, - "merkle_root": { - "ctime": 1492017367, - "hash": "463e597079ce3829ccc1f1aa7b15533c0848f9e13cdb55407af490a87bf4ac1b2d64e8235518ada07d93003b889157b576aad02eda294ccd594dc0dcbf8862ef", - "seqno": 1015311 - }, - "prev": "36959cd282a98f651138068f8695b07480a016f02ba99a0acbde277e0cf4ca30", - "seqno": 19, - "tag": "signature" -} - -which yields the signature: - -hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEggleGkRYjJBL+4pyU39+EYMWeiCtMEPsEx9mX0iLtzswKp3BheWxvYWTFAvt7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTAxYmJkYjI4ODQxYjE2OWRlNjUzOGE1MWQxN2NhOTRiMzAwODhiYTI5MTRlNTZmZDE5MTIxZWVjMDVmN2EzODljYzBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwODI1Nzg2OTExNjIzMjQxMmZlZTI5Yzk0ZGZkZjg0NjBjNTllODgyYjRjMTBmYjA0YzdkOTk3ZDIyMmVkY2VjYzBhIiwidWlkIjoiN2E1MmRkYWJmOTIyOTNkZDU5ZjhmYmYzNzc0ZWEzMTkiLCJ1c2VybmFtZSI6Im5sb29tYW5zIn0sInNlcnZpY2UiOnsiaG9zdG5hbWUiOiJyb29zdGVyLmhldG1tbC5ubCIsInByb3RvY29sIjoiaHR0cHM6In0sInR5cGUiOiJ3ZWJfc2VydmljZV9iaW5kaW5nIiwidmVyc2lvbiI6MX0sImNsaWVudCI6eyJuYW1lIjoia2V5YmFzZS5pbyBnbyBjbGllbnQiLCJ2ZXJzaW9uIjoiMS4wLjIwIn0sImN0aW1lIjoxNDkyMDE3Mzk4LCJleHBpcmVfaW4iOjUwNDU3NjAwMCwibWVya2xlX3Jvb3QiOnsiY3RpbWUiOjE0OTIwMTczNjcsImhhc2giOiI0NjNlNTk3MDc5Y2UzODI5Y2NjMWYxYWE3YjE1NTMzYzA4NDhmOWUxM2NkYjU1NDA3YWY0OTBhODdiZjRhYzFiMmQ2NGU4MjM1NTE4YWRhMDdkOTMwMDNiODg5MTU3YjU3NmFhZDAyZWRhMjk0Y2NkNTk0ZGMwZGNiZjg4NjJlZiIsInNlcW5vIjoxMDE1MzExfSwicHJldiI6IjM2OTU5Y2QyODJhOThmNjUxMTM4MDY4Zjg2OTViMDc0ODBhMDE2ZjAyYmE5OWEwYWNiZGUyNzdlMGNmNGNhMzAiLCJzZXFubyI6MTksInRhZyI6InNpZ25hdHVyZSJ9o3NpZ8RAcP5FuvbGM9nXBzWqChr9zdj452IpBzrVbd6YvcktLyKjaUaRg51BOWsyHmYQ+uxmZ2ZCUI6xZbbJ1SIAnWqvC6hzaWdfdHlwZSCkaGFzaIKkdHlwZQildmFsdWXEING7Z+BlY2sOTnQqQJo/PUBashy75VL9UU4tGIEvMXbco3RhZ80CAqd2ZXJzaW9uAQ== - -And finally, I am proving ownership of this host by posting or -appending to this document. - -View my publicly-auditable identity here: https://keybase.io/nloomans - -================================================================== diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png deleted file mode 100644 index 5adfc69..0000000 Binary files a/public/apple-touch-icon.png and /dev/null differ diff --git a/public/browserconfig.xml b/public/browserconfig.xml deleted file mode 100644 index b3930d0..0000000 --- a/public/browserconfig.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - #da532c - - - diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png deleted file mode 100644 index 1df47d3..0000000 Binary files a/public/favicon-16x16.png and /dev/null differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png deleted file mode 100644 index 36cd5da..0000000 Binary files a/public/favicon-32x32.png and /dev/null differ diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index c201043..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/icons/mml-logo.png b/public/icons/mml-logo.png deleted file mode 100644 index fa5ae11..0000000 Binary files a/public/icons/mml-logo.png and /dev/null differ diff --git a/public/icons/res/mipmap-hdpi/ic_launcher.png b/public/icons/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 514ad14..0000000 Binary files a/public/icons/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/public/icons/res/mipmap-mdpi/ic_launcher.png b/public/icons/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 59bab1d..0000000 Binary files a/public/icons/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/public/icons/res/mipmap-xhdpi/ic_launcher.png b/public/icons/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 908a6e8..0000000 Binary files a/public/icons/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/public/icons/res/mipmap-xxhdpi/ic_launcher.png b/public/icons/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index f12048f..0000000 Binary files a/public/icons/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/public/icons/res/mipmap-xxxhdpi/ic_launcher.png b/public/icons/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 7a0462e..0000000 Binary files a/public/icons/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/public/javascripts/analytics.js b/public/javascripts/analytics.js deleted file mode 100644 index a93c8a4..0000000 --- a/public/javascripts/analytics.js +++ /dev/null @@ -1,35 +0,0 @@ -/* global ga */ - -const self = {} - -self.send = {} - -self.send.search = function (selectedUser, favorite) { - const hitType = 'event' - - const eventCategory = favorite ? 'search fav' : 'search' - - let eventAction - switch (selectedUser.type) { - case 'c': - eventAction = 'Class' - break - case 't': - eventAction = 'Teacher' - break - case 'r': - eventAction = 'Room' - break - case 's': - eventAction = 'Student' - break - } - - const eventLabel = selectedUser.value - - ga(function () { - ga('send', { hitType, eventCategory, eventAction, eventLabel }) - }) -} - -module.exports = self diff --git a/public/javascripts/autocomplete.js b/public/javascripts/autocomplete.js deleted file mode 100644 index 61f400a..0000000 --- a/public/javascripts/autocomplete.js +++ /dev/null @@ -1,87 +0,0 @@ -const EventEmitter = require('events') - -const self = new EventEmitter() - -self._users = [] -self._selectedUserIndex = -1 - -self._nodes = { - search: document.querySelector('#search'), - input: document.querySelector('input[type="search"]'), - autocomplete: document.querySelector('.autocomplete') -} - -self.getSelectedUser = function () { - if (self.getItems() === []) return - - if (self.getSelectedUserIndex() === -1) { - return self.getItems()[0] - } else { - return self.getItems()[self.getSelectedUserIndex()] - } -} - -self.getSelectedUserIndex = function () { - return self._selectedUserIndex -} - -self.getItems = function () { - return self._users -} - -self.removeAllItems = function () { - while (self._nodes.autocomplete.firstChild) { - self._nodes.autocomplete.removeChild(self._nodes.autocomplete.firstChild) - } - self._users = [] - self._selectedUserIndex = -1 -} - -self.addItem = function (user) { - const listItem = document.createElement('li') - listItem.textContent = user.value - self._nodes.autocomplete.appendChild(listItem) - self._users.push(user) -} - -self._moveSelected = function (shift) { - if (self._selectedUserIndex + shift >= self.getItems().length) { - self._selectedUserIndex = -1 - } else if (self._selectedUserIndex + shift < -1) { - self._selectedUserIndex = self.getItems().length - 1 - } else { - self._selectedUserIndex += shift - } - - for (let i = 0; i < self.getItems().length; i++) { - self._nodes.autocomplete.children[i].classList.remove('selected') - } - if (self._selectedUserIndex >= 0) { - self._nodes.autocomplete - .children[self._selectedUserIndex].classList.add('selected') - } -} - -self._handleItemClick = function (event) { - if (!self._nodes.autocomplete.contains(event.target)) return - const userIndex = Array.prototype.indexOf - .call(self._nodes.autocomplete.children, event.target) - self._selectedUserIndex = userIndex - self.emit('select', self.getSelectedUser()) -} - -self._handleKeydown = function (event) { - if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { - event.preventDefault() - if (event.key === 'ArrowDown') { - self._moveSelected(1) - } else if (event.key === 'ArrowUp') { - self._moveSelected(-1) - } - } -} - -self._nodes.autocomplete.addEventListener('click', self._handleItemClick) -self._nodes.input.addEventListener('keydown', self._handleKeydown) - -module.exports = self diff --git a/public/javascripts/browserFixToolkit.js b/public/javascripts/browserFixToolkit.js deleted file mode 100644 index fbeab74..0000000 --- a/public/javascripts/browserFixToolkit.js +++ /dev/null @@ -1,12 +0,0 @@ -const self = {} - -self.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || - navigator.appVersion.indexOf('Trident/') > 0 - -if (self.isIE) { - self.inputEvent = 'textinput' -} else { - self.inputEvent = 'input' -} - -module.exports = self diff --git a/public/javascripts/bundle.js b/public/javascripts/bundle.js deleted file mode 100644 index 25695a4..0000000 --- a/public/javascripts/bundle.js +++ /dev/null @@ -1,256 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 4); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/*!***************************************!*\ - !*** ./node_modules/events/events.js ***! - \***************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports) { - -eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n if (!isNumber(n) || n < 0 || isNaN(n))\n throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n var er, handler, len, args, i, listeners;\n\n if (!this._events)\n this._events = {};\n\n // If there is no 'error' event listener then throw.\n if (type === 'error') {\n if (!this._events.error ||\n (isObject(this._events.error) && !this._events.error.length)) {\n er = arguments[1];\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n\n if (isUndefined(handler))\n return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n case 2:\n handler.call(this, arguments[1]);\n break;\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n for (i = 0; i < len; i++)\n listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n var m;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events)\n this._events = {};\n\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (this._events.newListener)\n this.emit('newListener', type,\n isFunction(listener.listener) ?\n listener.listener : listener);\n\n if (!this._events[type])\n // Optimize the case of one listener. Don't need the extra array object.\n this._events[type] = listener;\n else if (isObject(this._events[type]))\n // If we've already got an array, just append.\n this._events[type].push(listener);\n else\n // Adding the second element, need to change to array.\n this._events[type] = [this._events[type], listener];\n\n // Check for listener leak\n if (isObject(this._events[type]) && !this._events[type].warned) {\n if (!isUndefined(this._maxListeners)) {\n m = this._maxListeners;\n } else {\n m = EventEmitter.defaultMaxListeners;\n }\n\n if (m && m > 0 && this._events[type].length > m) {\n this._events[type].warned = true;\n console.error('(node) warning: possible EventEmitter memory ' +\n 'leak detected. %d listeners added. ' +\n 'Use emitter.setMaxListeners() to increase limit.',\n this._events[type].length);\n if (typeof console.trace === 'function') {\n // not supported in IE 10\n console.trace();\n }\n }\n }\n\n return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n var fired = false;\n\n function g() {\n this.removeListener(type, g);\n\n if (!fired) {\n fired = true;\n listener.apply(this, arguments);\n }\n }\n\n g.listener = listener;\n this.on(type, g);\n\n return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n var list, position, length, i;\n\n if (!isFunction(listener))\n throw TypeError('listener must be a function');\n\n if (!this._events || !this._events[type])\n return this;\n\n list = this._events[type];\n length = list.length;\n position = -1;\n\n if (list === listener ||\n (isFunction(list.listener) && list.listener === listener)) {\n delete this._events[type];\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n\n } else if (isObject(list)) {\n for (i = length; i-- > 0;) {\n if (list[i] === listener ||\n (list[i].listener && list[i].listener === listener)) {\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (list.length === 1) {\n list.length = 0;\n delete this._events[type];\n } else {\n list.splice(position, 1);\n }\n\n if (this._events.removeListener)\n this.emit('removeListener', type, listener);\n }\n\n return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n var key, listeners;\n\n if (!this._events)\n return this;\n\n // not listening for removeListener, no need to emit\n if (!this._events.removeListener) {\n if (arguments.length === 0)\n this._events = {};\n else if (this._events[type])\n delete this._events[type];\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n for (key in this._events) {\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = {};\n return this;\n }\n\n listeners = this._events[type];\n\n if (isFunction(listeners)) {\n this.removeListener(type, listeners);\n } else if (listeners) {\n // LIFO order\n while (listeners.length)\n this.removeListener(type, listeners[listeners.length - 1]);\n }\n delete this._events[type];\n\n return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n var ret;\n if (!this._events || !this._events[type])\n ret = [];\n else if (isFunction(this._events[type]))\n ret = [this._events[type]];\n else\n ret = this._events[type].slice();\n return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n if (this._events) {\n var evlistener = this._events[type];\n\n if (isFunction(evlistener))\n return 1;\n else if (evlistener)\n return evlistener.length;\n }\n return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9ldmVudHMvZXZlbnRzLmpzP2JmMzAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IEpveWVudCwgSW5jLiBhbmQgb3RoZXIgTm9kZSBjb250cmlidXRvcnMuXG4vL1xuLy8gUGVybWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBv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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///0\n"); - -/***/ }), -/* 1 */ -/*!****************************************!*\ - !*** ./public/javascripts/schedule.js ***! - \****************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* global VALID_WEEK_NUMBERS */\n\nvar EventEmitter = __webpack_require__(/*! events */ 0);\nvar search = __webpack_require__(/*! ./search */ 2);\n\nvar self = new EventEmitter();\n\nself._nodes = {\n schedule: document.querySelector('#schedule')\n};\n\nself._parseMeetingpointHTML = function (htmlStr) {\n var html = document.createElement('html');\n html.innerHTML = htmlStr;\n var centerNode = html.querySelector('center');\n return centerNode;\n};\n\nself._handleLoad = function (event) {\n var request = event.target;\n if (request.status < 200 || request.status >= 400) {\n self._handleError(event);\n return;\n }\n var document = self._parseMeetingpointHTML(request.response);\n self._removeChilds();\n self._nodes.schedule.appendChild(document);\n self._nodes.schedule.classList.remove('error');\n self.emit('load');\n};\n\nself._handleError = function (event) {\n var request = event.target;\n var error = void 0;\n if (request.status === 404) {\n error = 'Sorry, er is (nog) geen rooster voor deze week.';\n } else {\n error = 'Sorry, er is iets mis gegaan tijdens het laden van deze week.';\n }\n self._removeChilds();\n self._nodes.schedule.textContent = error;\n self._nodes.schedule.classList.add('error');\n self.emit('load');\n};\n\nself._getURLOfUser = function (week, user) {\n return '/get/' + user.type + '/' + user.value + '?week=' + week;\n};\n\nself._removeChilds = function () {\n while (self._nodes.schedule.firstChild) {\n self._nodes.schedule.removeChild(self._nodes.schedule.firstChild);\n }\n};\n\nself.viewItem = function (week, selectedUser) {\n if (selectedUser == null) {\n self._removeChilds();\n search.updateDom(selectedUser);\n } else if (VALID_WEEK_NUMBERS.indexOf(week) === -1) {\n self._handleError({ target: { status: 404 } });\n return;\n } else {\n var url = self._getURLOfUser(week, selectedUser);\n\n self._removeChilds();\n\n var request = new window.XMLHttpRequest();\n request.addEventListener('load', self._handleLoad);\n request.addEventListener('error', self._handleError);\n request.open('GET', url, true);\n request.send();\n\n search.updateDom(selectedUser);\n }\n};\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvc2NoZWR1bGUuanM/Z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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n"); - -/***/ }), -/* 2 */ -/*!**************************************!*\ - !*** ./public/javascripts/search.js ***! - \**************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* global USERS */\n\nvar EventEmitter = __webpack_require__(/*! events */ 0);\nvar fuzzy = __webpack_require__(/*! fuzzy */ 7);\nvar autocomplete = __webpack_require__(/*! ./autocomplete */ 8);\nvar browserFixToolkit = __webpack_require__(/*! ./browserFixToolkit */ 3);\n\nvar self = new EventEmitter();\n\nself._nodes = {\n search: document.querySelector('#search'),\n input: document.querySelector('input[type=\"search\"]')\n};\n\nself.submit = function () {\n var selectedUser = autocomplete.getSelectedUser();\n if (selectedUser == null) return;\n\n console.log(selectedUser);\n\n self._nodes.input.blur();\n document.body.classList.remove('week-selector-not-visible'); // Safari bug\n\n self.emit('search', selectedUser);\n};\n\nself.updateDom = function (selectedUser) {\n if (selectedUser == null) {\n self._nodes.input.value = '';\n autocomplete.removeAllItems();\n document.body.classList.add('no-input');\n document.body.classList.remove('searched');\n } else {\n self._nodes.input.value = selectedUser.value;\n autocomplete.removeAllItems();\n document.body.classList.remove('no-input');\n document.body.classList.add('searched');\n }\n};\n\nself.focus = function () {\n self._nodes.input.focus();\n};\n\nself._handleSubmit = function (event) {\n event.preventDefault();\n self.submit();\n};\n\nself._calculate = function (searchTerm) {\n var allResults = fuzzy.filter(searchTerm, USERS, {\n extract: function extract(user) {\n return user.value;\n }\n });\n var firstResults = allResults.slice(0, 7);\n\n var originalResults = firstResults.map(function (result) {\n return result.original;\n });\n\n return originalResults;\n};\n\nself._handleTextUpdate = function () {\n var results = self._calculate(self._nodes.input.value);\n\n autocomplete.removeAllItems();\n for (var i = 0; i < results.length; i++) {\n autocomplete.addItem(results[i]);\n }\n};\n\nself._handleFocus = function () {\n self._nodes.input.select();\n};\n\nself._handleBlur = function () {\n // this will removed the selection without drawing focus on it (safari)\n // this will removed selection even when focusing an iframe (chrome)\n var oldValue = self._nodes.value;\n self._nodes.value = '';\n self._nodes.value = oldValue;\n\n // this will hide the keyboard (iOS safari)\n document.activeElement.blur();\n};\n\nautocomplete.on('select', self.submit);\n\nself._nodes.search.addEventListener('submit', self._handleSubmit);\nself._nodes.input.addEventListener('focus', self._handleFocus);\nself._nodes.input.addEventListener('blur', self._handleBlur);\nself._nodes.input.addEventListener(browserFixToolkit.inputEvent, self._handleTextUpdate);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvc2VhcmNoLmpzPzljNzgiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZ2xvYmFsIFVTRVJTICovXG5cbmNvbnN0IEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoJ2V2ZW50cycpXG5jb25zdCBmdXp6eSA9IHJlcXVpcmUoJ2Z1enp5JylcbmNvbnN0IGF1dG9jb21wbGV0ZSA9IHJlcXVpcmUoJy4vYXV0b2NvbXBsZXRlJylcbmNvbnN0IGJyb3dzZXJGaXhUb29sa2l0ID0gcmVxdWlyZSgnLi9icm93c2Vy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IHNlbGYuX2hhbmRsZVRleHRVcGRhdGUpXG5cbm1vZHVsZS5leHBvcnRzID0gc2VsZlxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHB1YmxpYy9qYXZhc2NyaXB0cy9zZWFyY2guanMiXSwibWFwcGluZ3MiOiI7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFDQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBREE7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///2\n"); - -/***/ }), -/* 3 */ -/*!*************************************************!*\ - !*** ./public/javascripts/browserFixToolkit.js ***! - \*************************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar self = {};\n\nself.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0;\n\nif (self.isIE) {\n self.inputEvent = 'textinput';\n} else {\n self.inputEvent = 'input';\n}\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvYnJvd3NlckZpeFRvb2xraXQuanM/MjJlNyJdLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBzZWxmID0ge31cblxuc2VsZi5pc0lFID0gbmF2aWdhdG9yLnVzZXJBZ2VudC5pbmRleE9mKCdNU0lFJykgIT09IC0xIHx8XG4gICAgICAgICAgICBuYXZpZ2F0b3IuYXBwVmVyc2lvbi5pbmRleE9mKCdUcmlkZW50LycpID4gMFxuXG5pZiAoc2VsZi5pc0lFKSB7XG4gIHNlbGYuaW5wdXRFdmVudCA9ICd0ZXh0aW5wdXQnXG59IGVsc2Uge1xuICBzZWxmLmlucHV0RXZlbnQgPSAnaW5wdXQnXG59XG5cbm1vZHVsZS5leHBvcnRzID0gc2VsZlxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHB1YmxpYy9qYXZhc2NyaXB0cy9icm93c2VyRml4VG9vbGtpdC5qcyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///3\n"); - -/***/ }), -/* 4 */ -/*!************************************!*\ - !*** ./public/javascripts/main.js ***! - \************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n__webpack_require__(/*! ./featureDetect */ 5).check();\n__webpack_require__(/*! ./zoom */ 6);\n\nvar frontpage = __webpack_require__(/*! ./frontpage */ 9);\nvar search = __webpack_require__(/*! ./search */ 2);\nvar schedule = __webpack_require__(/*! ./schedule */ 1);\nvar weekSelector = __webpack_require__(/*! ./weekSelector */ 10);\nvar favorite = __webpack_require__(/*! ./favorite */ 11);\nvar scrollSnap = __webpack_require__(/*! ./scrollSnap */ 12);\nvar analytics = __webpack_require__(/*! ./analytics */ 14);\nvar url = __webpack_require__(/*! ./url */ 15);\n\nvar state = {};\n\nwindow.state = state;\n\nfrontpage.show();\nweekSelector.updateCurrentWeek();\nscrollSnap.startListening();\n\nif (url.hasSelectedUser()) {\n state.selectedUser = url.getSelectedUser();\n\n favorite.update(state.selectedUser);\n url.update(state.selectedUser);\n analytics.send.search(state.selectedUser);\n\n schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser);\n} else if (favorite.get() != null) {\n state.selectedUser = favorite.get();\n\n favorite.update(state.selectedUser);\n url.push(state.selectedUser, false);\n url.update(state.selectedUser);\n analytics.send.search(state.selectedUser, true);\n\n schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser);\n} else {\n search.focus();\n}\n\nsearch.on('search', function (selectedUser) {\n state.selectedUser = selectedUser;\n\n favorite.update(state.selectedUser);\n url.push(state.selectedUser);\n url.update(state.selectedUser);\n analytics.send.search(state.selectedUser);\n\n schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser);\n});\n\nurl.on('update', function (selectedUser) {\n state.selectedUser = selectedUser;\n\n favorite.update(state.selectedUser);\n url.update(state.selectedUser);\n\n schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser);\n});\n\nweekSelector.on('weekChanged', function (newWeek) {\n analytics.send.search(state.selectedUser);\n schedule.viewItem(newWeek, state.selectedUser);\n});\n\nfavorite.on('click', function () {\n favorite.toggle(state.selectedUser);\n});\n\ndocument.body.style.opacity = 1;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2V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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n"); - -/***/ }), -/* 5 */ -/*!*********************************************!*\ - !*** ./public/javascripts/featureDetect.js ***! - \*********************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* global FLAGS */\n\nvar self = {};\n\nself._nodes = {\n input: document.querySelector('input[type=\"search\"]'),\n overflowButton: document.querySelector('#overflow-button')\n};\n\nself._shouldCheck = function () {\n return FLAGS.indexOf('NO_FEATURE_DETECT') === -1;\n};\n\nself._redirect = function () {\n window.location.href = 'http://www.meetingpointmco.nl/Roosters-AL/doc/';\n};\n\nself.check = function () {\n if (!self._shouldCheck()) return;\n\n window.onerror = self._redirect;\n\n if (self._nodes.input.getClientRects()[0].top !== self._nodes.overflowButton.getClientRects()[0].top) {\n self._redirect();\n }\n};\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvZmVhdHVyZURldGVjdC5qcz8xZGFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGdsb2JhbCBGTEFHUyAqL1xuXG5jb25zdCBzZWxmID0ge31cblxuc2VsZi5fbm9kZXMgPSB7XG4gIGlucHV0OiBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdpbnB1dFt0eXBlPVwic2VhcmNoXCJdJyksXG4gIG92ZXJmbG93QnV0dG9uOiBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjb3ZlcmZsb3ctYnV0dG9uJylcbn1cblxuc2VsZi5fc2hvdWxkQ2hlY2sgPSBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBGTEFHUy5pbmRleE9mKCdOT19GRUFUVVJFX0RFVEVDVCcpID09PSAtMVxufVxuXG5zZWxmLl9yZWRpcmVjdCA9IGZ1bmN0aW9uICgpIHtcbiAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSAnaHR0cDovL3d3dy5tZWV0aW5ncG9pbnRtY28ubmwvUm9vc3RlcnMtQUwvZG9jLydcbn1cblxuc2VsZi5jaGVjayA9IGZ1bmN0aW9uICgpIHtcbiAgaWYgKCFzZWxmLl9zaG91bGRDaGVjaygpKSByZXR1cm5cblxuICB3aW5kb3cub25lcnJvciA9IHNlbGYuX3JlZGlyZWN0XG5cbiAgaWYgKHNlbGYuX25vZGVzLmlucHV0LmdldENsaWVudFJlY3RzKClbMF0udG9wICE9PVxuICAgICAgc2VsZi5fbm9kZXMub3ZlcmZsb3dCdXR0b24uZ2V0Q2xpZW50UmVjdHMoKVswXS50b3ApIHtcbiAgICBzZWxmLl9yZWRpcmVjdCgpXG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBzZWxmXG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gcHVibGljL2phdmFzY3JpcHRzL2ZlYXR1cmVEZXRlY3QuanMiXSwibWFwcGluZ3MiOiI7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5\n"); - -/***/ }), -/* 6 */ -/*!************************************!*\ - !*** ./public/javascripts/zoom.js ***! - \************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar schedule = __webpack_require__(/*! ./schedule */ 1);\n\nvar self = {};\n\nself._nodes = {\n body: document.body\n};\n\nself._handleResize = function () {\n // the table node may not exist before this function is called\n var tableNode = document.querySelector('center > table');\n\n // infact, it may not even exist when this function is called.\n if (!tableNode) return;\n\n var tableWidth = tableNode.getBoundingClientRect().width;\n var tableGoalWidth = self._nodes.body.getBoundingClientRect().width * 0.9;\n var zoomFactor = tableGoalWidth / tableWidth;\n\n if (zoomFactor < 1) {\n tableNode.style.zoom = '' + zoomFactor;\n } else {\n tableNode.style.zoom = '1';\n }\n};\n\nschedule.on('load', self._handleResize);\nwindow.addEventListener('resize', self._handleResize);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvem9vbS5qcz9iMzM1Il0sInNvdXJjZXNDb250ZW50IjpbImNvbnN0IHNjaGVkdWxlID0gcmVxdWlyZSgnLi9zY2hlZHVsZScpXG5cbmNvbnN0IHNlbGYgPSB7fVxuXG5zZWxmLl9ub2RlcyA9IHtcbiAgYm9keTogZG9jdW1lbnQuYm9keVxufVxuXG5zZWxmLl9oYW5kbGVSZXNpemUgPSBmdW5jdGlvbiAoKSB7XG4gIC8vIHRoZSB0YWJsZSBub2RlIG1heSBub3QgZXhpc3QgYmVmb3JlIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkXG4gIGNvbnN0IHRhYmxlTm9kZSA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2NlbnRlciA+IHRhYmxlJylcblxuICAvLyBpbmZhY3QsIGl0IG1heSBub3QgZXZlbiBleGlzdCB3aGVuIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkLlxuICBpZiAoIXRhYmxlTm9kZSkgcmV0dXJuXG5cbiAgY29uc3QgdGFibGVXaWR0aCA9IHRhYmxlTm9kZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS53aWR0aFxuICBjb25zdCB0YWJsZUdvYWxXaWR0aCA9IHNlbGYuX25vZGVzLmJvZHkuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkud2lkdGggKiAwLjlcbiAgY29uc3Qgem9vbUZhY3RvciA9IHRhYmxlR29hbFdpZHRoIC8gdGFibGVXaWR0aFxuXG4gIGlmICh6b29tRmFjdG9yIDwgMSkge1xuICAgIHRhYmxlTm9kZS5zdHlsZS56b29tID0gYCR7em9vbUZhY3Rvcn1gXG4gIH0gZWxzZSB7XG4gICAgdGFibGVOb2RlLnN0eWxlLnpvb20gPSBgMWBcbiAgfVxufVxuXG5zY2hlZHVsZS5vbignbG9hZCcsIHNlbGYuX2hhbmRsZVJlc2l6ZSlcbndpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdyZXNpemUnLCBzZWxmLl9oYW5kbGVSZXNpemUpXG5cbm1vZHVsZS5leHBvcnRzID0gc2VsZlxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHB1YmxpYy9qYXZhc2NyaXB0cy96b29tLmpzIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n"); - -/***/ }), -/* 7 */ -/*!*****************************************!*\ - !*** ./node_modules/fuzzy/lib/fuzzy.js ***! - \*****************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/*\n * Fuzzy\n * https://github.com/myork/fuzzy\n *\n * Copyright (c) 2012 Matt York\n * Licensed under the MIT license.\n */\n\n(function() {\n\nvar root = this;\n\nvar fuzzy = {};\n\n// Use in node or in browser\nif (true) {\n module.exports = fuzzy;\n} else {\n root.fuzzy = fuzzy;\n}\n\n// Return all elements of `array` that have a fuzzy\n// match against `pattern`.\nfuzzy.simpleFilter = function(pattern, array) {\n return array.filter(function(str) {\n return fuzzy.test(pattern, str);\n });\n};\n\n// Does `pattern` fuzzy match `str`?\nfuzzy.test = function(pattern, str) {\n return fuzzy.match(pattern, str) !== null;\n};\n\n// If `pattern` matches `str`, wrap each matching character\n// in `opts.pre` and `opts.post`. If no match, return null\nfuzzy.match = function(pattern, str, opts) {\n opts = opts || {};\n var patternIdx = 0\n , result = []\n , len = str.length\n , totalScore = 0\n , currScore = 0\n // prefix\n , pre = opts.pre || ''\n // suffix\n , post = opts.post || ''\n // String to compare against. This might be a lowercase version of the\n // raw string\n , compareString = opts.caseSensitive && str || str.toLowerCase()\n , ch;\n\n pattern = opts.caseSensitive && pattern || pattern.toLowerCase();\n\n // For each character in the string, either add it to the result\n // or wrap in template if it's the next string in the pattern\n for(var idx = 0; idx < len; idx++) {\n ch = str[idx];\n if(compareString[idx] === pattern[patternIdx]) {\n ch = pre + ch + post;\n patternIdx += 1;\n\n // consecutive characters should increase the score more than linearly\n currScore += 1 + currScore;\n } else {\n currScore = 0;\n }\n totalScore += currScore;\n result[result.length] = ch;\n }\n\n // return rendered string if we have a match for every char\n if(patternIdx === pattern.length) {\n // if the string is an exact match with pattern, totalScore should be maxed\n totalScore = (compareString === pattern) ? Infinity : totalScore;\n return {rendered: result.join(''), score: totalScore};\n }\n\n return null;\n};\n\n// The normal entry point. Filters `arr` for matches against `pattern`.\n// It returns an array with matching values of the type:\n//\n// [{\n// string: 'lah' // The rendered string\n// , index: 2 // The index of the element in `arr`\n// , original: 'blah' // The original element in `arr`\n// }]\n//\n// `opts` is an optional argument bag. Details:\n//\n// opts = {\n// // string to put before a matching character\n// pre: ''\n//\n// // string to put after matching character\n// , post: ''\n//\n// // Optional function. Input is an entry in the given arr`,\n// // output should be the string to test `pattern` against.\n// // In this example, if `arr = [{crying: 'koala'}]` we would return\n// // 'koala'.\n// , extract: function(arg) { return arg.crying; }\n// }\nfuzzy.filter = function(pattern, arr, opts) {\n if(!arr || arr.length === 0) {\n return [];\n }\n if (typeof pattern !== 'string') {\n return arr;\n }\n opts = opts || {};\n return arr\n .reduce(function(prev, element, idx, arr) {\n var str = element;\n if(opts.extract) {\n str = opts.extract(element);\n }\n var rendered = fuzzy.match(pattern, str, opts);\n if(rendered != null) {\n prev[prev.length] = {\n string: rendered.rendered\n , score: rendered.score\n , index: idx\n , original: element\n };\n }\n return prev;\n }, [])\n\n // Sort by score. Browsers are inconsistent wrt stable/unstable\n // sorting, so force stable by using the index in the case of tie.\n // See http://ofb.net/~sethml/is-sort-stable.html\n .sort(function(a,b) {\n var compare = b.score - a.score;\n if(compare) return compare;\n return a.index - b.index;\n });\n};\n\n\n}());\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9mdXp6eS9saWIvZnV6enkuanM/M2VmZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogRnV6enlcbiAqIGh0dHBzOi8vZ2l0aHViLmNvbS9teW9yay9mdXp6eVxuICpcbiAqIENvcHlyaWdodCAoYykgMjAxMiBNYXR0IFlvcmtcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBNSVQgbGljZW5zZS5cbiAqL1xuXG4oZnVuY3Rpb24oKSB7XG5cbnZhciByb290ID0gdGhpcztcblxudmFyIGZ1enp5ID0ge307XG5cbi8vIFVzZSBpbiBub2RlIG9yIGluIGJyb3dzZXJcbmlmICh0eXBlb2YgZXhwb3J0cyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgbW9kdWxlLmV4cG9ydHMgPSBmdX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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n"); - -/***/ }), -/* 8 */ -/*!********************************************!*\ - !*** ./public/javascripts/autocomplete.js ***! - \********************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar EventEmitter = __webpack_require__(/*! events */ 0);\n\nvar self = new EventEmitter();\n\nself._users = [];\nself._selectedUserIndex = -1;\n\nself._nodes = {\n search: document.querySelector('#search'),\n input: document.querySelector('input[type=\"search\"]'),\n autocomplete: document.querySelector('.autocomplete')\n};\n\nself.getSelectedUser = function () {\n if (self.getItems() === []) return;\n\n if (self.getSelectedUserIndex() === -1) {\n return self.getItems()[0];\n } else {\n return self.getItems()[self.getSelectedUserIndex()];\n }\n};\n\nself.getSelectedUserIndex = function () {\n return self._selectedUserIndex;\n};\n\nself.getItems = function () {\n return self._users;\n};\n\nself.removeAllItems = function () {\n while (self._nodes.autocomplete.firstChild) {\n self._nodes.autocomplete.removeChild(self._nodes.autocomplete.firstChild);\n }\n self._users = [];\n self._selectedUserIndex = -1;\n};\n\nself.addItem = function (user) {\n var listItem = document.createElement('li');\n listItem.textContent = user.value;\n self._nodes.autocomplete.appendChild(listItem);\n self._users.push(user);\n};\n\nself._moveSelected = function (shift) {\n if (self._selectedUserIndex + shift >= self.getItems().length) {\n self._selectedUserIndex = -1;\n } else if (self._selectedUserIndex + shift < -1) {\n self._selectedUserIndex = self.getItems().length - 1;\n } else {\n self._selectedUserIndex += shift;\n }\n\n for (var i = 0; i < self.getItems().length; i++) {\n self._nodes.autocomplete.children[i].classList.remove('selected');\n }\n if (self._selectedUserIndex >= 0) {\n self._nodes.autocomplete.children[self._selectedUserIndex].classList.add('selected');\n }\n};\n\nself._handleItemClick = function (event) {\n if (!self._nodes.autocomplete.contains(event.target)) return;\n var userIndex = Array.prototype.indexOf.call(self._nodes.autocomplete.children, event.target);\n self._selectedUserIndex = userIndex;\n self.emit('select', self.getSelectedUser());\n};\n\nself._handleKeydown = function (event) {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n if (event.key === 'ArrowDown') {\n self._moveSelected(1);\n } else if (event.key === 'ArrowUp') {\n self._moveSelected(-1);\n }\n }\n};\n\nself._nodes.autocomplete.addEventListener('click', self._handleItemClick);\nself._nodes.input.addEventListener('keydown', self._handleKeydown);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvYXV0b2NvbXBsZXRlLmpzPzY5YzciXSwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgRXZlbnRFbWl0dGVyID0gcmVxdWlyZSgnZXZlbnRzJylcblxuY29uc3Qgc2VsZiA9IG5ldyBFdmVudEVtaXR0ZXIoKVxuXG5zZWxmLl91c2VycyA9IFtdXG5zZWxmLl9zZWxlY3RlZFVzZXJJbmRleCA9IC0xXG5cbnNlbGYuX25vZGVzID0ge1xuICBzZWFyY2g6IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNzZWFyY2gnKSxcbiAgaW5wdXQ6IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJ2lucHV0W3R5cGU9XCJzZWFyY2hcIl0nKSxcbiAgYXV0b2NvbXBsZXRlOiBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuYXV0b2NvbXBsZXRlJylcbn1cblxuc2VsZi5nZXRTZWxlY3RlZFVzZXIgPSBmdW5jdGlvbiAoKSB7XG4gIGlmIChzZWxmLmdldEl0ZW1zKCkgPT09IFtdKSByZXR1cm5cblxuICBpZiAoc2VsZi5nZXRTZWxlY3RlZFVzZXJJbmRleCgpID09PSAtMSkge1xuICAgIHJldHVybiBzZWxmLmdldEl0ZW1zKClbMF1cbiAgfSBlbHNlIHtcbiAgICByZXR1cm4gc2VsZi5nZXRJdGVtcygpW3NlbGYuZ2V0U2VsZWN0ZWRVc2VySW5kZXgoKV1cbiAgfVxufVxuXG5zZWxmLmdldFNlbGVjdGVkVXNlckluZGV4ID0gZnVuY3Rpb24gKCkge1xuICByZXR1cm4gc2VsZi5fc2VsZWN0ZWRVc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sourceURL=webpack-internal:///8\n"); - -/***/ }), -/* 9 */ -/*!*****************************************!*\ - !*** ./public/javascripts/frontpage.js ***! - \*****************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar browserFixToolkit = __webpack_require__(/*! ./browserFixToolkit */ 3);\n\nvar self = {};\n\nself._nodes = {\n input: document.querySelector('input[type=\"search\"]')\n};\n\nself.isShown = false;\n\nself.show = function () {\n document.body.classList.add('no-input');\n self.isShown = true;\n};\n\nself.hide = function () {\n document.body.classList.remove('no-input');\n self.isShown = false;\n};\n\nself._nodes.input.addEventListener(browserFixToolkit.inputEvent, self.hide);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9wdWJsaWMvamF2YXNjcmlwdHMvZnJvbnRwYWdlLmpzP2Y4ZjAiXSwic291cmNlc0NvbnRlbnQiOlsiY29uc3QgYnJvd3NlckZpeFRvb2xraXQgPSByZXF1aXJlKCcuL2Jyb3dzZXJGaXhUb29sa2l0JylcblxuY29uc3Qgc2VsZiA9IHt9XG5cbnNlbGYuX25vZGVzID0ge1xuICBpbnB1dDogZG9jdW1lbnQucXVlcnlTZWxlY3RvcignaW5wdXRbdHlwZT1cInNlYXJjaFwiXScpXG59XG5cbnNlbGYuaXNTaG93biA9IGZhbHNlXG5cbnNlbGYuc2hvdyA9IGZ1bmN0aW9uICgpIHtcbiAgZG9jdW1lbnQuYm9keS5jbGFzc0xpc3QuYWRkKCduby1pbnB1dCcpXG4gIHNlbGYuaXNTaG93biA9IHRydWVcbn1cblxuc2VsZi5oaWRlID0gZnVuY3Rpb24gKCkge1xuICBkb2N1bWVudC5ib2R5LmNsYXNzTGlzdC5yZW1vdmUoJ25vLWlucHV0JylcbiAgc2VsZi5pc1Nob3duID0gZmFsc2Vcbn1cblxuc2VsZi5fbm9kZXMuaW5wdXQuYWRkRXZlbnRMaXN0ZW5lcihicm93c2VyRml4VG9vbGtpdC5pbnB1dEV2ZW50LCBzZWxmLmhpZGUpXG5cbm1vZHVsZS5leHBvcnRzID0gc2VsZlxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHB1YmxpYy9qYXZhc2NyaXB0cy9mcm9udHBhZ2UuanMiXSwibWFwcGluZ3MiOiI7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///9\n"); - -/***/ }), -/* 10 */ -/*!********************************************!*\ - !*** ./public/javascripts/weekSelector.js ***! - \********************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\nvar EventEmitter = __webpack_require__(/*! events */ 0);\n\nvar self = new EventEmitter();\n\nself._nodes = {\n prevButton: document.querySelectorAll('#week-selector button')[0],\n nextButton: document.querySelectorAll('#week-selector button')[1],\n currentWeekNode: document.querySelector('#week-selector .current'),\n currentWeekNormalText: document.querySelector('#week-selector .current .no-print'),\n currentWeekPrintText: document.querySelector('#week-selector .current .print')\n};\n\nself._weekOffset = 0;\n\n// copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js,\n// were using the same code as they do to be sure that we always get the same\n// week number.\nself.getCurrentWeek = function (target) {\n var dayNr = (target.getDay() + 6) % 7;\n target.setDate(target.getDate() - dayNr + 3);\n var firstThursday = target.valueOf();\n target.setMonth(0, 1);\n if (target.getDay() !== 4) {\n target.setMonth(0, 1 + (4 - target.getDay() + 7) % 7);\n }\n\n return 1 + Math.ceil((firstThursday - target) / 604800000);\n};\n\nself.getSelectedWeek = function () {\n var now = new Date();\n var targetDate = new Date(now.getTime() + self._weekOffset * 604800 * 1000 + 86400 * 1000);\n return self.getCurrentWeek(targetDate);\n};\n\nself.updateCurrentWeek = function () {\n var selectedWeekNumber = self.getSelectedWeek();\n if (self.getCurrentWeek(new Date()) !== selectedWeekNumber) {\n self._nodes.currentWeekNode.classList.add('changed');\n } else {\n self._nodes.currentWeekNode.classList.remove('changed');\n }\n self.updateDom();\n self.emit('weekChanged', selectedWeekNumber);\n};\n\nself.updateDom = function () {\n var selectedWeekNumber = self.getSelectedWeek();\n var isSunday = new Date().getDay() === 0;\n var humanReadableWeek = null;\n if (isSunday) {\n switch (self._weekOffset) {\n case 0:\n humanReadableWeek = 'Aanstaande week';\n break;\n case 1:\n humanReadableWeek = 'Volgende week';\n break;\n case -1:\n humanReadableWeek = 'Afgelopen week';\n break;\n }\n } else {\n switch (self._weekOffset) {\n case 0:\n humanReadableWeek = 'Huidige week';\n break;\n case 1:\n humanReadableWeek = 'Volgende week';\n break;\n case -1:\n humanReadableWeek = 'Vorige week';\n break;\n }\n }\n if (humanReadableWeek != null) {\n self._nodes.currentWeekNormalText.textContent = humanReadableWeek + ' • ' + selectedWeekNumber;\n self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber;\n } else {\n self._nodes.currentWeekNormalText.textContent = 'Week ' + selectedWeekNumber;\n self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber;\n }\n};\n\nself._handlePrevButtonClick = function () {\n self._weekOffset -= 1;\n self.updateCurrentWeek();\n};\n\nself._handleNextButtonClick = function () {\n self._weekOffset += 1;\n self.updateCurrentWeek();\n};\n\nself._nodes.prevButton.addEventListener('click', self._handlePrevButtonClick);\nself._nodes.nextButton.addEventListener('click', self._handleNextButtonClick);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjp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G4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gcHVibGljL2phdmFzY3JpcHRzL3dlZWtTZWxlY3Rvci5qcyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUxBO0FBQ0E7QUFPQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVRBO0FBV0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVRBO0FBV0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///10\n"); - -/***/ }), -/* 11 */ -/*!****************************************!*\ - !*** ./public/javascripts/favorite.js ***! - \****************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* global USERS */\n\nvar EventEmitter = __webpack_require__(/*! events */ 0);\n\nvar self = new EventEmitter();\n\nself._nodes = {\n toggle: document.querySelector('.fav')\n};\n\nself.get = function () {\n try {\n var localStorageUser = JSON.parse(window.localStorage.getItem('fav'));\n if (localStorageUser == null) return;\n\n var correctedUser = USERS.filter(function (user) {\n return user.type === localStorageUser.type && user.value === localStorageUser.value;\n })[0];\n return correctedUser;\n } catch (e) {\n self.delete();\n return;\n }\n};\n\nself.set = function (user) {\n window.localStorage.setItem('fav', JSON.stringify(user));\n self._nodes.innerHTML = '';\n};\n\nself.delete = function () {\n window.localStorage.removeItem('fav');\n};\n\nself.updateDom = function (isFavorite) {\n if (isFavorite) {\n self._nodes.toggle.innerHTML = '';\n } else {\n self._nodes.toggle.innerHTML = '';\n }\n};\n\nself.update = function (selectedUser) {\n var currentUser = self.get();\n\n if (currentUser == null || selectedUser == null) {\n self.updateDom(false);\n return;\n }\n\n var isEqual = currentUser.type === selectedUser.type && currentUser.index === selectedUser.index;\n\n self.updateDom(isEqual);\n};\n\nself.toggle = function (selectedUser) {\n var currentUser = self.get();\n var isEqual = currentUser != null && currentUser.type === selectedUser.type && currentUser.index === selectedUser.index;\n\n if (isEqual) {\n self.delete();\n self.updateDom(false);\n } else {\n self.set(selectedUser);\n self.updateDom(true);\n }\n};\n\nself._handleClick = function () {\n self.emit('click');\n};\n\nself._nodes.toggle.addEventListener('click', self._handleClick);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vcHVibGljL2phdmFzY3JpcHRzL2Zhdm9yaXRlLmpzPzMxOTEiXSwic291cmNlc0NvbnRlbnQiOlsiLyogZ2xvYmFsIFVTRVJTICovXG5cbmNvbnN0IEV2ZW50RW1pdHRlciA9IHJlcXVpcmUoJ2V2ZW50cycpXG5cbmNvbnN0IHNlbGYgPSBuZXcgRXZlbnRFbWl0dGVyKClcblxuc2VsZi5fbm9kZXMgPSB7XG4gIHRvZ2dsZTogZG9jdW1lbnQucXVl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lzdGVuZXIoJ2NsaWNrJywgc2VsZi5faGFuZGxlQ2xpY2spXG5cbm1vZHVsZS5leHBvcnRzID0gc2VsZlxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHB1YmxpYy9qYXZhc2NyaXB0cy9mYXZvcml0ZS5qcyJdLCJtYXBwaW5ncyI6Ijs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n"); - -/***/ }), -/* 12 */ -/*!******************************************!*\ - !*** ./public/javascripts/scrollSnap.js ***! - \******************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n__webpack_require__(/*! smoothscroll-polyfill */ 13).polyfill();\n\nvar self = {};\nvar schedule = __webpack_require__(/*! ./schedule */ 1);\n\nself._nodes = {\n search: document.querySelector('#search'),\n weekSelector: document.querySelector('#week-selector')\n};\n\nself._timeoutID = null;\n\nself._getScrollPosition = function () {\n return document.documentElement && document.documentElement.scrollTop || document.body.scrollTop;\n};\n\nself._handleDoneScrolling = function () {\n var scrollPosition = self._getScrollPosition();\n var weekSelectorHeight = self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight;\n if (scrollPosition < weekSelectorHeight && scrollPosition > 0) {\n window.scroll({ top: weekSelectorHeight, left: 0, behavior: 'smooth' });\n }\n};\n\nself._handleScroll = function () {\n if (self._timeoutID != null) window.clearTimeout(self._timeoutID);\n self._timeoutID = window.setTimeout(self._handleDoneScrolling, 500);\n\n var scrollPosition = self._getScrollPosition();\n var weekSelectorHeight = self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight;\n if (scrollPosition >= weekSelectorHeight) {\n document.body.classList.add('week-selector-not-visible');\n } else {\n document.body.classList.remove('week-selector-not-visible');\n }\n};\n\nself._handleWindowResize = function () {\n var weekSelectorHeight = self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight;\n var extraPixelsNeeded = weekSelectorHeight - (document.body.clientHeight - window.innerHeight);\n if (extraPixelsNeeded > 0) {\n document.body.style.marginBottom = extraPixelsNeeded + 'px';\n } else {\n document.body.style.marginBottom = null;\n }\n};\n\nself.startListening = function () {\n window.addEventListener('scroll', self._handleScroll);\n};\n\nschedule.on('load', self._handleWindowResize);\nwindow.addEventListener('resize', self._handleWindowResize);\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vcHVibGljL2phdmFzY3JpcHRzL3Njcm9sbFNuYXAuanM/NzFkMiJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCdzbW9vdGhzY3JvbGwtcG9seWZpbGwnKS5wb2x5ZmlsbCgpXG5cbmNvbnN0IHNlbGYgPSB7fVxuY29uc3Qgc2NoZWR1bGUgPSByZXF1aXJlKCcuL3NjaGVkdWxlJylcblxuc2VsZi5fbm9kZXMg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WxsXG4gIH1cbn1cblxuc2VsZi5zdGFydExpc3RlbmluZyA9IGZ1bmN0aW9uICgpIHtcbiAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3Njcm9sbCcsIHNlbGYuX2hhbmRsZVNjcm9sbClcbn1cblxuc2NoZWR1bGUub24oJ2xvYWQnLCBzZWxmLl9oYW5kbGVXaW5kb3dSZXNpemUpXG53aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigncmVzaXplJywgc2VsZi5faGFuZGxlV2luZG93UmVzaXplKVxubW9kdWxlLmV4cG9ydHMgPSBzZWxmXG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gcHVibGljL2phdmFzY3JpcHRzL3Njcm9sbFNuYXAuanMiXSwibWFwcGluZ3MiOiI7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///12\n"); - -/***/ }), -/* 13 */ -/*!*****************************************************************!*\ - !*** ./node_modules/smoothscroll-polyfill/dist/smoothscroll.js ***! - \*****************************************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/*\n * smoothscroll polyfill - v0.3.5\n * https://iamdustan.github.io/smoothscroll\n * 2016 (c) Dustan Kasten, Jeremias Menichelli - MIT License\n */\n\n(function(w, d, undefined) {\n 'use strict';\n\n /*\n * aliases\n * w: window global object\n * d: document\n * undefined: undefined\n */\n\n // polyfill\n function polyfill() {\n // return when scrollBehavior interface is supported\n if ('scrollBehavior' in d.documentElement.style) {\n return;\n }\n\n /*\n * globals\n */\n var Element = w.HTMLElement || w.Element;\n var SCROLL_TIME = 468;\n\n /*\n * object gathering original scroll methods\n */\n var original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elScroll: Element.prototype.scroll || scrollElement,\n scrollIntoView: Element.prototype.scrollIntoView\n };\n\n /*\n * define timing method\n */\n var now = w.performance && w.performance.now\n ? w.performance.now.bind(w.performance) : Date.now;\n\n /**\n * changes scroll position inside an element\n * @method scrollElement\n * @param {Number} x\n * @param {Number} y\n */\n function scrollElement(x, y) {\n this.scrollLeft = x;\n this.scrollTop = y;\n }\n\n /**\n * returns result of applying ease math function to a number\n * @method ease\n * @param {Number} k\n * @returns {Number}\n */\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n\n /**\n * indicates if a smooth behavior should be applied\n * @method shouldBailOut\n * @param {Number|Object} x\n * @returns {Boolean}\n */\n function shouldBailOut(x) {\n if (typeof x !== 'object'\n || x === null\n || x.behavior === undefined\n || x.behavior === 'auto'\n || x.behavior === 'instant') {\n // first arg not an object/null\n // or behavior is auto, instant or undefined\n return true;\n }\n\n if (typeof x === 'object'\n && x.behavior === 'smooth') {\n // first argument is an object and behavior is smooth\n return false;\n }\n\n // throw error when behavior is not supported\n throw new TypeError('behavior not valid');\n }\n\n /**\n * finds scrollable parent of an element\n * @method findScrollableParent\n * @param {Node} el\n * @returns {Node} el\n */\n function findScrollableParent(el) {\n var isBody;\n var hasScrollableSpace;\n var hasVisibleOverflow;\n\n do {\n el = el.parentNode;\n\n // set condition variables\n isBody = el === d.body;\n hasScrollableSpace =\n el.clientHeight < el.scrollHeight ||\n el.clientWidth < el.scrollWidth;\n hasVisibleOverflow =\n w.getComputedStyle(el, null).overflow === 'visible';\n } while (!isBody && !(hasScrollableSpace && !hasVisibleOverflow));\n\n isBody = hasScrollableSpace = hasVisibleOverflow = null;\n\n return el;\n }\n\n /**\n * self invoked function that, given a context, steps through scrolling\n * @method step\n * @param {Object} context\n */\n function step(context) {\n var time = now();\n var value;\n var currentX;\n var currentY;\n var elapsed = (time - context.startTime) / SCROLL_TIME;\n\n // avoid elapsed times higher than one\n elapsed = elapsed > 1 ? 1 : elapsed;\n\n // apply easing to elapsed time\n value = ease(elapsed);\n\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n\n context.method.call(context.scrollable, currentX, currentY);\n\n // scroll more if we have not reached our destination\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n\n /**\n * scrolls window with a smooth behavior\n * @method smoothScroll\n * @param {Object|Node} el\n * @param {Number} x\n * @param {Number} y\n */\n function smoothScroll(el, x, y) {\n var scrollable;\n var startX;\n var startY;\n var method;\n var startTime = now();\n\n // define scroll context\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n\n // scroll looping over a frame\n step({\n scrollable: scrollable,\n method: method,\n startTime: startTime,\n startX: startX,\n startY: startY,\n x: x,\n y: y\n });\n }\n\n /*\n * ORIGINAL METHODS OVERRIDES\n */\n\n // w.scroll and w.scrollTo\n w.scroll = w.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scroll.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left,\n ~~arguments[0].top\n );\n };\n\n // w.scrollBy\n w.scrollBy = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n\n // Element.prototype.scroll and Element.prototype.scrollTo\n Element.prototype.scroll = Element.prototype.scrollTo = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.elScroll.call(\n this,\n arguments[0].left || arguments[0],\n arguments[0].top || arguments[1]\n );\n return;\n }\n\n var left = arguments[0].left;\n var top = arguments[0].top;\n\n // LET THE SMOOTHNESS BEGIN!\n smoothScroll.call(\n this,\n this,\n typeof left === 'number' ? left : this.scrollLeft,\n typeof top === 'number' ? top : this.scrollTop\n );\n };\n\n // Element.prototype.scrollBy\n Element.prototype.scrollBy = function() {\n var arg0 = arguments[0];\n\n if (typeof arg0 === 'object') {\n this.scroll({\n left: arg0.left + this.scrollLeft,\n top: arg0.top + this.scrollTop,\n behavior: arg0.behavior\n });\n } else {\n this.scroll(\n this.scrollLeft + arg0,\n this.scrollTop + arguments[1]\n );\n }\n };\n\n // Element.prototype.scrollIntoView\n Element.prototype.scrollIntoView = function() {\n // avoid smooth behavior if not required\n if (shouldBailOut(arguments[0])) {\n original.scrollIntoView.call(\n this,\n arguments[0] === undefined ? true : arguments[0]\n );\n return;\n }\n\n // LET THE SMOOTHNESS BEGIN!\n var scrollableParent = findScrollableParent(this);\n var parentRects = scrollableParent.getBoundingClientRect();\n var clientRects = this.getBoundingClientRect();\n\n if (scrollableParent !== d.body) {\n // reveal element inside parent\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n // reveal parent in viewport\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: 'smooth'\n });\n } else {\n // reveal element in viewport\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: 'smooth'\n });\n }\n };\n }\n\n if (true) {\n // commonjs\n module.exports = { polyfill: polyfill };\n } else {\n // global\n polyfill();\n }\n})(window, document);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvc21vb3Roc2Nyb2xsLXBvbHlmaWxsL2Rpc3Qvc21vb3Roc2Nyb2xsLmpzPzQ1YzgiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIHNtb290aHNjcm9sbCBwb2x5ZmlsbCAtIHYwLjMuNVxuICogaHR0cHM6Ly9pYW1kdXN0YW4uZ2l0aHViLmlvL3Ntb290aHNjcm9sbFxuICogMjAxNiAoYykgRHVzdGFuIEthc3RlbiwgSmVyZW1pYXMgTWVuaWNoZWxsaSAtIE1JVCBMaWNlbnNlXG4gKi9cblxuKGZ1bmN0aW9uKHcsIGQsIHVuZGVmaW5lZCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLypcbiAgICogYWxpYXNlc1xuICAgKiB3OiB3aW5kb3cgZ2xvYmFsIG9iamVjdFxuICAgKiBkOiBkb2N1bWVudFxuICAgKiB1bmRlZmluZWQ6IHVuZGVmaW5lZFxuICAgKi9cblxuICAvLyBwb2x5ZmlsbFxuICBmdW5jdGlvbiBwb2x5ZmlsbCgpIHtcbiAgICAvLyByZXR1cm4gd2hlbiBzY3JvbGxCZWhhdmlvciBpbnRlcmZhY2UgaXMgc3VwcG9ydGVkXG4gICAgaWYgKCdzY3JvbGxCZWhhdmlvcicgaW4gZC5kb2N1bWVudEVsZW1lbnQuc3R5bGUpIHtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICAvKlxuICAgICAqIGdsb2JhbHNcbiAgICAgKi9cbiAgICB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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///13\n"); - -/***/ }), -/* 14 */ -/*!*****************************************!*\ - !*** ./public/javascripts/analytics.js ***! - \*****************************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* global ga */\n\nvar self = {};\n\nself.send = {};\n\nself.send.search = function (selectedUser, favorite) {\n var hitType = 'event';\n\n var eventCategory = favorite ? 'search fav' : 'search';\n\n var eventAction = void 0;\n switch (selectedUser.type) {\n case 'c':\n eventAction = 'Class';\n break;\n case 't':\n eventAction = 'Teacher';\n break;\n case 'r':\n eventAction = 'Room';\n break;\n case 's':\n eventAction = 'Student';\n break;\n }\n\n var eventLabel = selectedUser.value;\n\n ga(function () {\n ga('send', { hitType: hitType, eventCategory: eventCategory, eventAction: eventAction, eventLabel: eventLabel });\n });\n};\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vcHVibGljL2phdmFzY3JpcHRzL2FuYWx5dGljcy5qcz85MGMwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qIGdsb2JhbCBnYSAqL1xuXG5jb25zdCBzZWxmID0ge31cblxuc2VsZi5zZW5kID0ge31cblxuc2VsZi5zZW5kLnNlYXJjaCA9IGZ1bmN0aW9uIChzZWxlY3Rl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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///14\n"); - -/***/ }), -/* 15 */ -/*!***********************************!*\ - !*** ./public/javascripts/url.js ***! - \***********************************/ -/*! no static exports found */ -/*! all exports used */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\n\n/* global USERS FLAGS */\n\nvar EventEmitter = __webpack_require__(/*! events */ 0);\n\nvar self = new EventEmitter();\n\nself._getPageTitle = function (selectedUser) {\n var ret = void 0;\n\n if (selectedUser == null) {\n ret = 'Metis Rooster';\n } else {\n ret = 'Metis Rooster - ' + selectedUser.value;\n }\n\n if (FLAGS.indexOf('BETA') !== -1) {\n ret = 'BETA ' + ret;\n }\n\n return ret;\n};\n\nself._getPageURL = function (selectedUser) {\n return '/' + selectedUser.type + '/' + selectedUser.value;\n};\n\nself.push = function (selectedUser, push) {\n if (push == null) push = true;\n var pageTitle = self._getPageTitle(selectedUser);\n var pageURL = self._getPageURL(selectedUser);\n if (push) {\n window.history.pushState(selectedUser, pageTitle, pageURL);\n } else {\n window.history.replaceState(selectedUser, pageTitle, pageURL);\n }\n};\n\nself.update = function (selectedUser) {\n document.title = self._getPageTitle(selectedUser);\n};\n\nself.hasSelectedUser = function () {\n var pageUrl = window.location.pathname;\n return (/^\\/s\\/|^\\/t\\/|^\\/r\\/|^\\/c\\//.test(pageUrl)\n );\n};\n\nself.getSelectedUser = function () {\n var pageUrl = window.location.pathname;\n var pageUrlData = pageUrl.split('/');\n var type = pageUrlData[1];\n var value = pageUrlData[2];\n\n var user = USERS.filter(function (user) {\n return user.type === type && user.value === value;\n })[0];\n\n return user;\n};\n\nself._handleUpdate = function (event) {\n self.emit('update', event.state);\n};\n\nwindow.addEventListener('popstate', self._handleUpdate);\n\nmodule.exports = self;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiL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oJ3BvcHN0YXRlJywgc2VsZi5faGFuZGxlVXBkYXRlKVxuXG5tb2R1bGUuZXhwb3J0cyA9IHNlbGZcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBwdWJsaWMvamF2YXNjcmlwdHMvdXJsLmpzIl0sIm1hcHBpbmdzIjoiOztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n"); - -/***/ }) -/******/ ]); \ No newline at end of file diff --git a/public/javascripts/favorite.js b/public/javascripts/favorite.js deleted file mode 100644 index 92c87f7..0000000 --- a/public/javascripts/favorite.js +++ /dev/null @@ -1,79 +0,0 @@ -/* global USERS */ - -const EventEmitter = require('events') - -const self = new EventEmitter() - -self._nodes = { - toggle: document.querySelector('.fav') -} - -self.get = function () { - try { - const localStorageUser = JSON.parse(window.localStorage.getItem('fav')) - if (localStorageUser == null) return - - const correctedUser = USERS.filter(function (user) { - return user.type === localStorageUser.type && - user.value === localStorageUser.value - })[0] - return correctedUser - } catch (e) { - self.delete() - return - } -} - -self.set = function (user) { - window.localStorage.setItem('fav', JSON.stringify(user)) - self._nodes.innerHTML = '' -} - -self.delete = function () { - window.localStorage.removeItem('fav') -} - -self.updateDom = function (isFavorite) { - if (isFavorite) { - self._nodes.toggle.innerHTML = '' - } else { - self._nodes.toggle.innerHTML = '' - } -} - -self.update = function (selectedUser) { - const currentUser = self.get() - - if (currentUser == null || selectedUser == null) { - self.updateDom(false) - return - } - - const isEqual = currentUser.type === selectedUser.type && - currentUser.index === selectedUser.index - - self.updateDom(isEqual) -} - -self.toggle = function (selectedUser) { - const currentUser = self.get() - const isEqual = currentUser != null && - currentUser.type === selectedUser.type && - currentUser.index === selectedUser.index - - if (isEqual) { - self.delete() - self.updateDom(false) - } else { - self.set(selectedUser) - self.updateDom(true) - } -} - -self._handleClick = function () { - self.emit('click') -} - -self._nodes.toggle.addEventListener('click', self._handleClick) - -module.exports = self diff --git a/public/javascripts/featureDetect.js b/public/javascripts/featureDetect.js deleted file mode 100644 index 3a072a1..0000000 --- a/public/javascripts/featureDetect.js +++ /dev/null @@ -1,29 +0,0 @@ -/* global FLAGS */ - -const self = {} - -self._nodes = { - input: document.querySelector('input[type="search"]'), - overflowButton: document.querySelector('#overflow-button') -} - -self._shouldCheck = function () { - return FLAGS.indexOf('NO_FEATURE_DETECT') === -1 -} - -self._redirect = function () { - window.location.href = 'http://www.meetingpointmco.nl/Roosters-AL/doc/' -} - -self.check = function () { - if (!self._shouldCheck()) return - - window.onerror = self._redirect - - if (self._nodes.input.getClientRects()[0].top !== - self._nodes.overflowButton.getClientRects()[0].top) { - self._redirect() - } -} - -module.exports = self diff --git a/public/javascripts/frontpage.js b/public/javascripts/frontpage.js deleted file mode 100644 index 17cb539..0000000 --- a/public/javascripts/frontpage.js +++ /dev/null @@ -1,23 +0,0 @@ -const browserFixToolkit = require('./browserFixToolkit') - -const self = {} - -self._nodes = { - input: document.querySelector('input[type="search"]') -} - -self.isShown = false - -self.show = function () { - document.body.classList.add('no-input') - self.isShown = true -} - -self.hide = function () { - document.body.classList.remove('no-input') - self.isShown = false -} - -self._nodes.input.addEventListener(browserFixToolkit.inputEvent, self.hide) - -module.exports = self diff --git a/public/javascripts/main.js b/public/javascripts/main.js deleted file mode 100644 index 0d125cb..0000000 --- a/public/javascripts/main.js +++ /dev/null @@ -1,71 +0,0 @@ -require('./featureDetect').check() -require('./zoom') - -const frontpage = require('./frontpage') -const search = require('./search') -const schedule = require('./schedule') -const weekSelector = require('./weekSelector') -const favorite = require('./favorite') -const scrollSnap = require('./scrollSnap') -const analytics = require('./analytics') -const url = require('./url') - -const state = {} - -window.state = state - -frontpage.show() -weekSelector.updateCurrentWeek() -scrollSnap.startListening() - -if (url.hasSelectedUser()) { - state.selectedUser = url.getSelectedUser() - - favorite.update(state.selectedUser) - url.update(state.selectedUser) - analytics.send.search(state.selectedUser) - - schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) -} else if (favorite.get() != null) { - state.selectedUser = favorite.get() - - favorite.update(state.selectedUser) - url.push(state.selectedUser, false) - url.update(state.selectedUser) - analytics.send.search(state.selectedUser, true) - - schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) -} else { - search.focus() -} - -search.on('search', function (selectedUser) { - state.selectedUser = selectedUser - - favorite.update(state.selectedUser) - url.push(state.selectedUser) - url.update(state.selectedUser) - analytics.send.search(state.selectedUser) - - schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) -}) - -url.on('update', function (selectedUser) { - state.selectedUser = selectedUser - - favorite.update(state.selectedUser) - url.update(state.selectedUser) - - schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) -}) - -weekSelector.on('weekChanged', function (newWeek) { - analytics.send.search(state.selectedUser) - schedule.viewItem(newWeek, state.selectedUser) -}) - -favorite.on('click', function () { - favorite.toggle(state.selectedUser) -}) - -document.body.style.opacity = 1 diff --git a/public/javascripts/schedule.js b/public/javascripts/schedule.js deleted file mode 100644 index 38ad66d..0000000 --- a/public/javascripts/schedule.js +++ /dev/null @@ -1,78 +0,0 @@ -/* global VALID_WEEK_NUMBERS */ - -const EventEmitter = require('events') -const search = require('./search') - -const self = new EventEmitter() - -self._nodes = { - schedule: document.querySelector('#schedule') -} - -self._parseMeetingpointHTML = function (htmlStr) { - const html = document.createElement('html') - html.innerHTML = htmlStr - const centerNode = html.querySelector('center') - return centerNode -} - -self._handleLoad = function (event) { - const request = event.target - if (request.status < 200 || request.status >= 400) { - self._handleError(event) - return - } - const document = self._parseMeetingpointHTML(request.response) - self._removeChilds() - self._nodes.schedule.appendChild(document) - self._nodes.schedule.classList.remove('error') - self.emit('load') -} - -self._handleError = function (event) { - const request = event.target - let error - if (request.status === 404) { - error = 'Sorry, er is (nog) geen rooster voor deze week.' - } else { - error = 'Sorry, er is iets mis gegaan tijdens het laden van deze week.' - } - self._removeChilds() - self._nodes.schedule.textContent = error - self._nodes.schedule.classList.add('error') - self.emit('load') -} - -self._getURLOfUser = function (week, user) { - return `/get/${user.type}/${user.value}?week=${week}` -} - -self._removeChilds = function () { - while (self._nodes.schedule.firstChild) { - self._nodes.schedule.removeChild(self._nodes.schedule.firstChild) - } -} - -self.viewItem = function (week, selectedUser) { - if (selectedUser == null) { - self._removeChilds() - search.updateDom(selectedUser) - } else if (VALID_WEEK_NUMBERS.indexOf(week) === -1) { - self._handleError({ target: { status: 404 } }); - return - } else { - const url = self._getURLOfUser(week, selectedUser) - - self._removeChilds() - - const request = new window.XMLHttpRequest() - request.addEventListener('load', self._handleLoad) - request.addEventListener('error', self._handleError) - request.open('GET', url, true) - request.send() - - search.updateDom(selectedUser) - } -} - -module.exports = self diff --git a/public/javascripts/scrollSnap.js b/public/javascripts/scrollSnap.js deleted file mode 100644 index afee979..0000000 --- a/public/javascripts/scrollSnap.js +++ /dev/null @@ -1,59 +0,0 @@ -require('smoothscroll-polyfill').polyfill() - -const self = {} -const schedule = require('./schedule') - -self._nodes = { - search: document.querySelector('#search'), - weekSelector: document.querySelector('#week-selector') -} - -self._timeoutID = null - -self._getScrollPosition = function () { - return (document.documentElement && document.documentElement.scrollTop) || - document.body.scrollTop -} - -self._handleDoneScrolling = function () { - const scrollPosition = self._getScrollPosition() - const weekSelectorHeight = - self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight - if (scrollPosition < weekSelectorHeight && scrollPosition > 0) { - window.scroll({ top: weekSelectorHeight, left: 0, behavior: 'smooth' }) - } -} - -self._handleScroll = function () { - if (self._timeoutID != null) window.clearTimeout(self._timeoutID) - self._timeoutID = window.setTimeout(self._handleDoneScrolling, 500) - - const scrollPosition = self._getScrollPosition() - const weekSelectorHeight = - self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight - if (scrollPosition >= weekSelectorHeight) { - document.body.classList.add('week-selector-not-visible') - } else { - document.body.classList.remove('week-selector-not-visible') - } -} - -self._handleWindowResize = function () { - const weekSelectorHeight = - self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight - const extraPixelsNeeded = - weekSelectorHeight - (document.body.clientHeight - window.innerHeight) - if (extraPixelsNeeded > 0) { - document.body.style.marginBottom = extraPixelsNeeded + 'px' - } else { - document.body.style.marginBottom = null - } -} - -self.startListening = function () { - window.addEventListener('scroll', self._handleScroll) -} - -schedule.on('load', self._handleWindowResize) -window.addEventListener('resize', self._handleWindowResize) -module.exports = self diff --git a/public/javascripts/search.js b/public/javascripts/search.js deleted file mode 100644 index 96413b0..0000000 --- a/public/javascripts/search.js +++ /dev/null @@ -1,95 +0,0 @@ -/* global USERS */ - -const EventEmitter = require('events') -const fuzzy = require('fuzzy') -const autocomplete = require('./autocomplete') -const browserFixToolkit = require('./browserFixToolkit') - -const self = new EventEmitter() - -self._nodes = { - search: document.querySelector('#search'), - input: document.querySelector('input[type="search"]') -} - -self.submit = function () { - const selectedUser = autocomplete.getSelectedUser() - if (selectedUser == null) return - - console.log(selectedUser) - - self._nodes.input.blur() - document.body.classList.remove('week-selector-not-visible') // Safari bug - - self.emit('search', selectedUser) -} - -self.updateDom = function (selectedUser) { - if (selectedUser == null) { - self._nodes.input.value = '' - autocomplete.removeAllItems() - document.body.classList.add('no-input') - document.body.classList.remove('searched') - } else { - self._nodes.input.value = selectedUser.value - autocomplete.removeAllItems() - document.body.classList.remove('no-input') - document.body.classList.add('searched') - } -} - -self.focus = function () { - self._nodes.input.focus() -} - -self._handleSubmit = function (event) { - event.preventDefault() - self.submit() -} - -self._calculate = function (searchTerm) { - const allResults = fuzzy.filter(searchTerm, USERS, { - extract: function (user) { return user.value } - }) - const firstResults = allResults.slice(0, 7) - - const originalResults = firstResults.map(function (result) { - return result.original - }) - - return originalResults -} - -self._handleTextUpdate = function () { - const results = self._calculate(self._nodes.input.value) - - autocomplete.removeAllItems() - for (let i = 0; i < results.length; i++) { - autocomplete.addItem(results[i]) - } -} - -self._handleFocus = function () { - self._nodes.input.select() -} - -self._handleBlur = function () { - // this will removed the selection without drawing focus on it (safari) - // this will removed selection even when focusing an iframe (chrome) - const oldValue = self._nodes.value - self._nodes.value = '' - self._nodes.value = oldValue - - // this will hide the keyboard (iOS safari) - document.activeElement.blur() -} - -autocomplete.on('select', self.submit) - -self._nodes.search.addEventListener('submit', self._handleSubmit) -self._nodes.input.addEventListener('focus', self._handleFocus) -self._nodes.input.addEventListener('blur', self._handleBlur) -self._nodes.input.addEventListener(browserFixToolkit.inputEvent, - self._handleTextUpdate) - -module.exports = self diff --git a/public/javascripts/url.js b/public/javascripts/url.js deleted file mode 100644 index 17ab7c8..0000000 --- a/public/javascripts/url.js +++ /dev/null @@ -1,67 +0,0 @@ -/* global USERS FLAGS */ - -const EventEmitter = require('events') - -const self = new EventEmitter() - -self._getPageTitle = function (selectedUser) { - let ret - - if (selectedUser == null) { - ret = `Metis Rooster` - } else { - ret = `Metis Rooster - ${selectedUser.value}` - } - - if (FLAGS.indexOf('BETA') !== -1) { - ret = `BETA ${ret}` - } - - return ret -} - -self._getPageURL = function (selectedUser) { - return `/${selectedUser.type}/${selectedUser.value}` -} - -self.push = function (selectedUser, push) { - if (push == null) push = true - const pageTitle = self._getPageTitle(selectedUser) - const pageURL = self._getPageURL(selectedUser) - if (push) { - window.history.pushState(selectedUser, pageTitle, pageURL) - } else { - window.history.replaceState(selectedUser, pageTitle, pageURL) - } -} - -self.update = function (selectedUser) { - document.title = self._getPageTitle(selectedUser) -} - -self.hasSelectedUser = function () { - const pageUrl = window.location.pathname - return /^\/s\/|^\/t\/|^\/r\/|^\/c\//.test(pageUrl) -} - -self.getSelectedUser = function () { - const pageUrl = window.location.pathname - const pageUrlData = pageUrl.split('/') - const type = pageUrlData[1] - const value = pageUrlData[2] - - const user = USERS.filter(function (user) { - return user.type === type && - user.value === value - })[0] - - return user -} - -self._handleUpdate = function (event) { - self.emit('update', event.state) -} - -window.addEventListener('popstate', self._handleUpdate) - -module.exports = self diff --git a/public/javascripts/weekSelector.js b/public/javascripts/weekSelector.js deleted file mode 100644 index d4e7f2a..0000000 --- a/public/javascripts/weekSelector.js +++ /dev/null @@ -1,99 +0,0 @@ -const EventEmitter = require('events') - -const self = new EventEmitter() - -self._nodes = { - prevButton: document.querySelectorAll('#week-selector button')[0], - nextButton: document.querySelectorAll('#week-selector button')[1], - currentWeekNode: document.querySelector('#week-selector .current'), - currentWeekNormalText: document.querySelector('#week-selector .current .no-print'), - currentWeekPrintText: document.querySelector('#week-selector .current .print') -} - -self._weekOffset = 0 - -// copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js, -// were using the same code as they do to be sure that we always get the same -// week number. -self.getCurrentWeek = function (target) { - const dayNr = (target.getDay() + 6) % 7 - target.setDate(target.getDate() - dayNr + 3) - const firstThursday = target.valueOf() - target.setMonth(0, 1) - if (target.getDay() !== 4) { - target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7) - } - - return 1 + Math.ceil((firstThursday - target) / 604800000) -} - -self.getSelectedWeek = function () { - const now = new Date() - const targetDate = new Date(now.getTime() + - self._weekOffset * 604800 * 1000 + 86400 * 1000) - return self.getCurrentWeek(targetDate) -} - -self.updateCurrentWeek = function () { - const selectedWeekNumber = self.getSelectedWeek() - if (self.getCurrentWeek(new Date()) !== selectedWeekNumber) { - self._nodes.currentWeekNode.classList.add('changed') - } else { - self._nodes.currentWeekNode.classList.remove('changed') - } - self.updateDom() - self.emit('weekChanged', selectedWeekNumber) -} - -self.updateDom = function () { - const selectedWeekNumber = self.getSelectedWeek() - const isSunday = new Date().getDay() === 0 - let humanReadableWeek = null - if (isSunday) { - switch (self._weekOffset) { - case 0: - humanReadableWeek = 'Aanstaande week' - break - case 1: - humanReadableWeek = 'Volgende week' - break - case -1: - humanReadableWeek = 'Afgelopen week' - break - } - } else { - switch (self._weekOffset) { - case 0: - humanReadableWeek = 'Huidige week' - break - case 1: - humanReadableWeek = 'Volgende week' - break - case -1: - humanReadableWeek = 'Vorige week' - break - } - } - if (humanReadableWeek != null) { - self._nodes.currentWeekNormalText.textContent = humanReadableWeek + ' • ' + selectedWeekNumber - self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber - } else { - self._nodes.currentWeekNormalText.textContent = 'Week ' + selectedWeekNumber - self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber - } -} - -self._handlePrevButtonClick = function () { - self._weekOffset -= 1 - self.updateCurrentWeek() -} - -self._handleNextButtonClick = function () { - self._weekOffset += 1 - self.updateCurrentWeek() -} - -self._nodes.prevButton.addEventListener('click', self._handlePrevButtonClick) -self._nodes.nextButton.addEventListener('click', self._handleNextButtonClick) - -module.exports = self diff --git a/public/javascripts/zoom.js b/public/javascripts/zoom.js deleted file mode 100644 index 59b80db..0000000 --- a/public/javascripts/zoom.js +++ /dev/null @@ -1,30 +0,0 @@ -const schedule = require('./schedule') - -const self = {} - -self._nodes = { - body: document.body -} - -self._handleResize = function () { - // the table node may not exist before this function is called - const tableNode = document.querySelector('center > table') - - // infact, it may not even exist when this function is called. - if (!tableNode) return - - const tableWidth = tableNode.getBoundingClientRect().width - const tableGoalWidth = self._nodes.body.getBoundingClientRect().width * 0.9 - const zoomFactor = tableGoalWidth / tableWidth - - if (zoomFactor < 1) { - tableNode.style.zoom = `${zoomFactor}` - } else { - tableNode.style.zoom = `1` - } -} - -schedule.on('load', self._handleResize) -window.addEventListener('resize', self._handleResize) - -module.exports = self diff --git a/public/manifest.beta.webmanifest b/public/manifest.beta.webmanifest deleted file mode 100644 index a1fdd92..0000000 --- a/public/manifest.beta.webmanifest +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "BETA Metis Rooster", - "short_name": "BETA Rooster", - "start_url": "/", - "display": "standalone", - "background_color": "#ececec", - "description": "Een verbeterde rooster pagina voor het metis", - "icons": [{ - "src": "/icons/res/mipmap-mdpi/ic_launcher.png", - "sizes": "48x48", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-hdpi/ic_launcher.png", - "sizes": "72x72", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-xhdpi/ic_launcher.png", - "sizes": "96x96", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-xxhdpi/ic_launcher.png", - "sizes": "144x144", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-xxxhdpi/ic_launcher.png", - "sizes": "192x192", - "type": "image/png" - }] -} diff --git a/public/manifest.webmanifest b/public/manifest.webmanifest deleted file mode 100644 index d33ee8e..0000000 --- a/public/manifest.webmanifest +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "Metis Rooster", - "short_name": "Rooster", - "start_url": "/", - "display": "standalone", - "background_color": "#ececec", - "description": "Een verbeterde rooster pagina voor het metis", - "icons": [{ - "src": "/icons/res/mipmap-mdpi/ic_launcher.png", - "sizes": "48x48", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-hdpi/ic_launcher.png", - "sizes": "72x72", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-xhdpi/ic_launcher.png", - "sizes": "96x96", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-xxhdpi/ic_launcher.png", - "sizes": "144x144", - "type": "image/png" - }, { - "src": "/icons/res/mipmap-xxxhdpi/ic_launcher.png", - "sizes": "192x192", - "type": "image/png" - }] -} diff --git a/public/mstile-150x150.png b/public/mstile-150x150.png deleted file mode 100644 index 5e381e6..0000000 Binary files a/public/mstile-150x150.png and /dev/null differ diff --git a/public/safari-pinned-tab.svg b/public/safari-pinned-tab.svg deleted file mode 100644 index 97ce8bf..0000000 --- a/public/safari-pinned-tab.svg +++ /dev/null @@ -1,34 +0,0 @@ - - - - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - - - - diff --git a/public/stylesheets/hello.css b/public/stylesheets/hello.css deleted file mode 100644 index edcbc92..0000000 --- a/public/stylesheets/hello.css +++ /dev/null @@ -1,23 +0,0 @@ -* { - box-sizing: border-box; -} - -html, body { - margin: 0; - font-family: 'Roboto', sans-serif; - display: flex; - flex-direction: column; - justify-content: center; - text-align: center; - width: 100vw; - height: 100vh; - color: gray; -} - -.ideas { - font-size: 0.8em; -} - -a { - color: #3f51b5; -} diff --git a/public/stylesheets/print.css b/public/stylesheets/print.css deleted file mode 100644 index 0e09533..0000000 --- a/public/stylesheets/print.css +++ /dev/null @@ -1,63 +0,0 @@ -#search, #week-selector { - background-color: inherit; - box-shadow: inherit; -} - -#search { - border-bottom: 1px solid black; - position: absolute; -} - -#search .top-bar, #week-selector .week-wrapper { - max-width: inherit; -} - -#search input[type="search"] { - background-color: inherit; - color: black; - font-weight: bold; -} - -#search .fav { - display: none !important; -} - -#search #overflow-button { - display: none; -} - -#week-selector .week-wrapper { - display: block; -} - -#week-selector button { - display: none; -} - -#week-selector .current { - color: black; - padding: 16px; - font-size: 1.1em; - float: right; -} - -#search-space-filler { - display: none; -} - -.mdl-menu__container { - display: none !important; -} - -#schedule { - padding-top: 16px; - width: 100%; -} - -.no-print { - display: none; -} - -.print { - display: initial; -} diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css deleted file mode 100644 index 830b007..0000000 --- a/public/stylesheets/style.css +++ /dev/null @@ -1,392 +0,0 @@ -* { - box-sizing: border-box; -} - -html, body { - margin: 0; - font-family: 'Roboto', sans-serif; -} - -.other { - color: gray; - font-style: italic; - margin-left: 5px; -} - -#search { - z-index: 2; - background-color: #F44336; - margin: 0 auto; - width: 100%; - position: fixed; - box-shadow: 0 0.5px 1.5px rgba(0,0,0,0.06), 0 0.5px 1px rgba(0,0,0,0.12); -} - -#search .top-bar { - position: relative; - margin: 0 auto; - max-width: 600px; - padding: 10px; - display: flex; -} - -#search .input-wrapper { - position: relative; - flex-grow: 1; - color: #FFFFFF; -} - -#search input[type='search'] { - display: block; - background-color: #f6695e; - color: inherit; - border-radius: 2px; - width: 100%; - display: block; - outline: none; - border: 0; - padding: 16px; - font-size: 16px; - transition: box-shadow 200ms ease-in-out; -} - -#search input[type='search']:focus { - background-color: #FFFFFF; - color: #212121; - box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); -} - -#search input[type='search']:focus + button { - color: #212121; -} - -input[type="search"]::-webkit-search-decoration, -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-results-button, -input[type="search"]::-webkit-search-results-decoration { - display: none; -} - -input[type="search"]::-ms-clear { - width: 0; - height: 0; -} - -button::-moz-focus-inner { - border: 0; -} - - -/* WebKit, Blink, Edge */ -input::-webkit-input-placeholder { - color: #FFCDD2; -} -input:focus::-webkit-input-placeholder { - color: #757575; -} - -/* Mozilla Firefox 4 to 18 */ -input:-moz-placeholder { - color: #FFCDD2; - opacity: 1; -} -input:focus:-moz-placeholder { - color: #757575; -} - -/* Mozilla Firefox 19+ */ -input::-moz-placeholder { - color: #FFCDD2; - opacity: 1; -} -input:focus::-moz-placeholder { - color: #757575; -} - -/* Internet Explorer 10-11 */ -input:-ms-input-placeholder { - color: #FFCDD2; -} -input:focus:-ms-input-placeholder { - color: #757575; -} - -li:hover { - background-color: lightgray; - cursor: pointer; -} - -.selected { - background-color: lightgray; -} - -#schedule { - overflow: auto; -} - -body.searched #search-space-filler { - height: 70px; -} - -.autocomplete-wrapper { - background-color: white; -} - -.autocomplete { - max-width: 600px; - margin: 0 auto; - padding: 0; -} - -.autocomplete li { - list-style: none; - padding: 10px; -} - -#week-selector { - z-index: 1; - background-color: #F44336; - box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); - color: white; -} - -#week-selector .week-wrapper { - max-width: 600px; - padding: 10px !important; - margin: 0 auto; - display: flex; - -js-display: flex; - padding: 10px 0; -} - -#week-selector .current { - display: flex; - flex-grow: 1; - align-items: center; - justify-content: center; -} - -#week-selector .current.changed { - font-weight: bold; -} - -#week-selector button { - background: transparent; - color: white; - border: 0px; - padding: 5px 10px; - border-radius: 2px; -} - -input { - -webkit-appearance: none; -} - -#search .fav { - position: absolute; - font-size: 1.8em; - color: inherit; - right: 8.5px; - top: 8.5px; - border: 0; - padding: 4px; - border-radius: 2px; - background: none; - - display: none; -} - -body.searched #search .fav { - display: block; -} - -#week-selector button:focus, #search #overflow-button:focus, #search .fav:focus { - outline: none; - background-color: #D32F2F; -} - -#search #overflow-button { - background: none; - border: none; - padding: 3px 9px; - color: white; - border-radius: 2px; -} - -.hidden { - display: none !important; -} - -ul a { - color: inherit; - text-decoration: none; -} - -#search .title { - display: none; -} - -body:not(.no-input) { - overflow-y: scroll; -} - -body.no-input #week-selector { - display: none; -} - -@media screen and (min-height: 400px) { - body.no-input { - background-color: #ececec; - } - - body.no-input #search { - height: 100%; - background-color: #ececec; - box-shadow: none; - } - - body.no-input #search button { - display: none; - } - - body.no-input #search #overflow-button { - position: absolute; - display: block; - top: 0; - right: 0; - color: #757575; - } - - body.no-input #search .print-page { - display: none; - } - - body.no-input #search #overflow-button:focus { - background-color: inherit; - color: #212121; - } - - body.no-input #search .logo { - background-image: url(/icons/mml-logo.png); - background-position: center; - background-repeat: no-repeat; - background-size: contain; - height: 100px; - width: 100px; - - /* virtual center: http://javier.xyz/visual-center/ */ - transform: translate(-8%,-3%); - margin: 0 auto; - } - - body.no-input #search .title { - display: block; - font-size: 55px; - padding-bottom: 32px; - } - - body.no-input #search .title .text { - text-align: center; - line-height: 55px; - } - - body.no-input #search .top-bar { - position: static; - display: block; - margin-top: 50vh; - transform: translateY(-75%); - } - - body.no-input #search input[type='search'] { - background-color: #FFF; - } - - /* WebKit, Blink, Edge */ - body.no-input #search input::-webkit-input-placeholder { - color: #757575; - } - - /* Mozilla Firefox 4 to 18 */ - body.no-input #search input:-moz-placeholder { - color: #757575; - opacity: 1; - } - - /* Mozilla Firefox 19+ */ - body.no-input #search input::-moz-placeholder { - color: #757575; - opacity: 1; - } - - /* Internet Explorer 10-11 */ - body.no-input #search input:-ms-input-placeholder { - color: #757575; - } - - body.no-input .tooltip { - display: block; - position: absolute; - background-color: white; - padding: 15px; - margin: 32px 8px; - border-radius: 2px; - - left: 16px; - right: 16px; - } - - body.no-input .tooltip::before { - content: ''; - width: 24px; - height: 24px; - background-color: white; - top: -12px; - position: absolute; - transform: rotate(45deg); - z-index: -1; - } -} - -.tooltip { - display: none; -} - -.error { - text-align: center; - margin-top: 100px; - padding: 16px; -} - -body.week-selector-not-visible #search { - box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); -} - -body.week-selector-not-visible #week-selector { - box-shadow: inherit; -} - -.print { - display: none; -} - -#notification { - max-width: 600px; - padding: 10px; - margin: 0 auto; -} - -#notification .box { - display: flex; - background-color: #e0e0e0; - padding: 8px; - border-radius: 2px; - align-items: center; -} - -#notification .text { - padding-left: 8px; -} - -.grow { - flex-grow: 1; -} diff --git a/public/sw.js b/public/sw.js deleted file mode 100644 index bd43805..0000000 --- a/public/sw.js +++ /dev/null @@ -1,29 +0,0 @@ -/* global importScripts toolbox self */ - -(global => { - 'use strict' - - // Load the sw-toolbox library. - importScripts('/components/sw-toolbox/sw-toolbox.js') - - // Ensure that our service worker takes control of the page as soon as possible. - global.addEventListener('install', event => event.waitUntil(global.skipWaiting())) - global.addEventListener('activate', event => event.waitUntil(global.clients.claim())) - - toolbox.precache([ - '/', - '/hello', - '/untisinfo.css', - '/javascripts/bundle.js', - '/stylesheets/style.css', - '/stylesheets/hello.css' - ]) - - toolbox.router.get('/', toolbox.fastest) - toolbox.router.get('/hello', toolbox.fastest) - - toolbox.router.get('/javascripts/bundle.js', toolbox.fastest) - toolbox.router.get('/stylesheets/*', toolbox.fastest) - toolbox.router.get('/untisinfo.css', toolbox.fastest) - toolbox.router.get('/meetingpointProxy/*', toolbox.networkFirst) -})(self) diff --git a/public/untisinfo.css b/public/untisinfo.css deleted file mode 100644 index d74a7aa..0000000 --- a/public/untisinfo.css +++ /dev/null @@ -1,11 +0,0 @@ -html, body { - overflow: auto; - width: 100vw; - height: 100vh; - margin: 0; - -webkit-overflow-scrolling: touch; -} - -center { - margin: 5px; -} diff --git a/routes/getSchedule.js b/routes/getSchedule.js deleted file mode 100644 index f6c3cb6..0000000 --- a/routes/getSchedule.js +++ /dev/null @@ -1,55 +0,0 @@ -const express = require('express') -const router = express.Router() -const request = require('request') -const iconv = require('iconv-lite') - -const getUserIndex = require('../lib/getUserIndex') -const getURLOfUser = require('../lib/getURLOfUser') - -// copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js, -// were using the same code as they do to be sure that we always get the same -// week number. -function getWeekNumber (target) { - const dayNr = (target.getDay() + 6) % 7 - target.setDate(target.getDate() - dayNr + 3) - const firstThursday = target.valueOf() - target.setMonth(0, 1) - if (target.getDay() !== 4) { - target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7) - } - - return 1 + Math.ceil((firstThursday - target) / 604800000) -} - -router.get('/:type/:value', function (req, res, next) { - getUserIndex().then(users => { - const { type, value } = req.params - let { week } = req.query - const user = - users.filter(user => user.type === type && user.value === value)[0] - - if (!user) { - next(new Error(`${type}${value} is not in the user index.`)) - } - - if (!week) { - week = getWeekNumber(new Date()) - } - - const { index } = user - - const url = getURLOfUser(type, index, week) - - request(url, { encoding: null }, function (err, data) { - if (err) { - next(err) - return - } - - const utf8Body = iconv.decode(data.body, 'ISO-8859-1') - res.status(data.statusCode).end(utf8Body) - }) - }) -}) - -module.exports = router diff --git a/routes/index.js b/routes/index.js deleted file mode 100644 index d2267ba..0000000 --- a/routes/index.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' - -const express = require('express') -const router = express.Router() -const getMeetingpointData = require('../lib/getMeetingpointData') - -/* GET home page. */ -router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) { - getMeetingpointData().then(data => { - const isBeta = process.env.BETA === '1' - - let flags = [] - if (isBeta) { - flags.push('BETA') - flags.push('NO_FEATURE_DETECT') - } else if (req.query.nfd != null) { - flags.push('NO_FEATURE_DETECT') - } - - const flagsStr = `var FLAGS = ${JSON.stringify(flags)};` - const usersStr = `var USERS = ${JSON.stringify(data.users)};` - const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}` - - res.render('index', { flagsStr, usersStr, validWeekNumbersStr }) - }).catch(function () { - console.error('Unable to get user info, emergency redirect!') - res.render('redirect') - }) -}) - -module.exports = router diff --git a/routes/manifest.js b/routes/manifest.js deleted file mode 100644 index b2ce55f..0000000 --- a/routes/manifest.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict' - -const express = require('express') -const router = express.Router() -const path = require('path') - -router.get('/', function (req, res, next) { - console.log('got a request') - - const isBeta = process.env.BETA === '1' - - if (isBeta) { - res.sendFile('manifest.beta.webmanifest', { root: path.join(__dirname, '../public') }) - } else { - res.sendFile('manifest.webmanifest', { root: path.join(__dirname, '../public') }) - } -}) - -module.exports = router diff --git a/routes/opensearch.js b/routes/opensearch.js deleted file mode 100644 index c3e2e57..0000000 --- a/routes/opensearch.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -const express = require('express') -const router = express.Router() -const path = require('path') - -router.get('/', function (req, res, next) { - res.setHeader('content-type', 'application/opensearchdescription+xml') - res.sendFile('opensearch.xml', { root: path.join(__dirname, '../public') }) -}) - -module.exports = router diff --git a/src/client/javascript/analytics.js b/src/client/javascript/analytics.js new file mode 100644 index 0000000..a93c8a4 --- /dev/null +++ b/src/client/javascript/analytics.js @@ -0,0 +1,35 @@ +/* global ga */ + +const self = {} + +self.send = {} + +self.send.search = function (selectedUser, favorite) { + const hitType = 'event' + + const eventCategory = favorite ? 'search fav' : 'search' + + let eventAction + switch (selectedUser.type) { + case 'c': + eventAction = 'Class' + break + case 't': + eventAction = 'Teacher' + break + case 'r': + eventAction = 'Room' + break + case 's': + eventAction = 'Student' + break + } + + const eventLabel = selectedUser.value + + ga(function () { + ga('send', { hitType, eventCategory, eventAction, eventLabel }) + }) +} + +module.exports = self diff --git a/src/client/javascript/autocomplete.js b/src/client/javascript/autocomplete.js new file mode 100644 index 0000000..61f400a --- /dev/null +++ b/src/client/javascript/autocomplete.js @@ -0,0 +1,87 @@ +const EventEmitter = require('events') + +const self = new EventEmitter() + +self._users = [] +self._selectedUserIndex = -1 + +self._nodes = { + search: document.querySelector('#search'), + input: document.querySelector('input[type="search"]'), + autocomplete: document.querySelector('.autocomplete') +} + +self.getSelectedUser = function () { + if (self.getItems() === []) return + + if (self.getSelectedUserIndex() === -1) { + return self.getItems()[0] + } else { + return self.getItems()[self.getSelectedUserIndex()] + } +} + +self.getSelectedUserIndex = function () { + return self._selectedUserIndex +} + +self.getItems = function () { + return self._users +} + +self.removeAllItems = function () { + while (self._nodes.autocomplete.firstChild) { + self._nodes.autocomplete.removeChild(self._nodes.autocomplete.firstChild) + } + self._users = [] + self._selectedUserIndex = -1 +} + +self.addItem = function (user) { + const listItem = document.createElement('li') + listItem.textContent = user.value + self._nodes.autocomplete.appendChild(listItem) + self._users.push(user) +} + +self._moveSelected = function (shift) { + if (self._selectedUserIndex + shift >= self.getItems().length) { + self._selectedUserIndex = -1 + } else if (self._selectedUserIndex + shift < -1) { + self._selectedUserIndex = self.getItems().length - 1 + } else { + self._selectedUserIndex += shift + } + + for (let i = 0; i < self.getItems().length; i++) { + self._nodes.autocomplete.children[i].classList.remove('selected') + } + if (self._selectedUserIndex >= 0) { + self._nodes.autocomplete + .children[self._selectedUserIndex].classList.add('selected') + } +} + +self._handleItemClick = function (event) { + if (!self._nodes.autocomplete.contains(event.target)) return + const userIndex = Array.prototype.indexOf + .call(self._nodes.autocomplete.children, event.target) + self._selectedUserIndex = userIndex + self.emit('select', self.getSelectedUser()) +} + +self._handleKeydown = function (event) { + if (event.key === 'ArrowDown' || event.key === 'ArrowUp') { + event.preventDefault() + if (event.key === 'ArrowDown') { + self._moveSelected(1) + } else if (event.key === 'ArrowUp') { + self._moveSelected(-1) + } + } +} + +self._nodes.autocomplete.addEventListener('click', self._handleItemClick) +self._nodes.input.addEventListener('keydown', self._handleKeydown) + +module.exports = self diff --git a/src/client/javascript/browserFixToolkit.js b/src/client/javascript/browserFixToolkit.js new file mode 100644 index 0000000..fbeab74 --- /dev/null +++ b/src/client/javascript/browserFixToolkit.js @@ -0,0 +1,12 @@ +const self = {} + +self.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || + navigator.appVersion.indexOf('Trident/') > 0 + +if (self.isIE) { + self.inputEvent = 'textinput' +} else { + self.inputEvent = 'input' +} + +module.exports = self diff --git a/src/client/javascript/favorite.js b/src/client/javascript/favorite.js new file mode 100644 index 0000000..92c87f7 --- /dev/null +++ b/src/client/javascript/favorite.js @@ -0,0 +1,79 @@ +/* global USERS */ + +const EventEmitter = require('events') + +const self = new EventEmitter() + +self._nodes = { + toggle: document.querySelector('.fav') +} + +self.get = function () { + try { + const localStorageUser = JSON.parse(window.localStorage.getItem('fav')) + if (localStorageUser == null) return + + const correctedUser = USERS.filter(function (user) { + return user.type === localStorageUser.type && + user.value === localStorageUser.value + })[0] + return correctedUser + } catch (e) { + self.delete() + return + } +} + +self.set = function (user) { + window.localStorage.setItem('fav', JSON.stringify(user)) + self._nodes.innerHTML = '' +} + +self.delete = function () { + window.localStorage.removeItem('fav') +} + +self.updateDom = function (isFavorite) { + if (isFavorite) { + self._nodes.toggle.innerHTML = '' + } else { + self._nodes.toggle.innerHTML = '' + } +} + +self.update = function (selectedUser) { + const currentUser = self.get() + + if (currentUser == null || selectedUser == null) { + self.updateDom(false) + return + } + + const isEqual = currentUser.type === selectedUser.type && + currentUser.index === selectedUser.index + + self.updateDom(isEqual) +} + +self.toggle = function (selectedUser) { + const currentUser = self.get() + const isEqual = currentUser != null && + currentUser.type === selectedUser.type && + currentUser.index === selectedUser.index + + if (isEqual) { + self.delete() + self.updateDom(false) + } else { + self.set(selectedUser) + self.updateDom(true) + } +} + +self._handleClick = function () { + self.emit('click') +} + +self._nodes.toggle.addEventListener('click', self._handleClick) + +module.exports = self diff --git a/src/client/javascript/featureDetect.js b/src/client/javascript/featureDetect.js new file mode 100644 index 0000000..3a072a1 --- /dev/null +++ b/src/client/javascript/featureDetect.js @@ -0,0 +1,29 @@ +/* global FLAGS */ + +const self = {} + +self._nodes = { + input: document.querySelector('input[type="search"]'), + overflowButton: document.querySelector('#overflow-button') +} + +self._shouldCheck = function () { + return FLAGS.indexOf('NO_FEATURE_DETECT') === -1 +} + +self._redirect = function () { + window.location.href = 'http://www.meetingpointmco.nl/Roosters-AL/doc/' +} + +self.check = function () { + if (!self._shouldCheck()) return + + window.onerror = self._redirect + + if (self._nodes.input.getClientRects()[0].top !== + self._nodes.overflowButton.getClientRects()[0].top) { + self._redirect() + } +} + +module.exports = self diff --git a/src/client/javascript/frontpage.js b/src/client/javascript/frontpage.js new file mode 100644 index 0000000..17cb539 --- /dev/null +++ b/src/client/javascript/frontpage.js @@ -0,0 +1,23 @@ +const browserFixToolkit = require('./browserFixToolkit') + +const self = {} + +self._nodes = { + input: document.querySelector('input[type="search"]') +} + +self.isShown = false + +self.show = function () { + document.body.classList.add('no-input') + self.isShown = true +} + +self.hide = function () { + document.body.classList.remove('no-input') + self.isShown = false +} + +self._nodes.input.addEventListener(browserFixToolkit.inputEvent, self.hide) + +module.exports = self diff --git a/src/client/javascript/main.js b/src/client/javascript/main.js new file mode 100644 index 0000000..0d125cb --- /dev/null +++ b/src/client/javascript/main.js @@ -0,0 +1,71 @@ +require('./featureDetect').check() +require('./zoom') + +const frontpage = require('./frontpage') +const search = require('./search') +const schedule = require('./schedule') +const weekSelector = require('./weekSelector') +const favorite = require('./favorite') +const scrollSnap = require('./scrollSnap') +const analytics = require('./analytics') +const url = require('./url') + +const state = {} + +window.state = state + +frontpage.show() +weekSelector.updateCurrentWeek() +scrollSnap.startListening() + +if (url.hasSelectedUser()) { + state.selectedUser = url.getSelectedUser() + + favorite.update(state.selectedUser) + url.update(state.selectedUser) + analytics.send.search(state.selectedUser) + + schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) +} else if (favorite.get() != null) { + state.selectedUser = favorite.get() + + favorite.update(state.selectedUser) + url.push(state.selectedUser, false) + url.update(state.selectedUser) + analytics.send.search(state.selectedUser, true) + + schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) +} else { + search.focus() +} + +search.on('search', function (selectedUser) { + state.selectedUser = selectedUser + + favorite.update(state.selectedUser) + url.push(state.selectedUser) + url.update(state.selectedUser) + analytics.send.search(state.selectedUser) + + schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) +}) + +url.on('update', function (selectedUser) { + state.selectedUser = selectedUser + + favorite.update(state.selectedUser) + url.update(state.selectedUser) + + schedule.viewItem(weekSelector.getSelectedWeek(), state.selectedUser) +}) + +weekSelector.on('weekChanged', function (newWeek) { + analytics.send.search(state.selectedUser) + schedule.viewItem(newWeek, state.selectedUser) +}) + +favorite.on('click', function () { + favorite.toggle(state.selectedUser) +}) + +document.body.style.opacity = 1 diff --git a/src/client/javascript/schedule.js b/src/client/javascript/schedule.js new file mode 100644 index 0000000..38ad66d --- /dev/null +++ b/src/client/javascript/schedule.js @@ -0,0 +1,78 @@ +/* global VALID_WEEK_NUMBERS */ + +const EventEmitter = require('events') +const search = require('./search') + +const self = new EventEmitter() + +self._nodes = { + schedule: document.querySelector('#schedule') +} + +self._parseMeetingpointHTML = function (htmlStr) { + const html = document.createElement('html') + html.innerHTML = htmlStr + const centerNode = html.querySelector('center') + return centerNode +} + +self._handleLoad = function (event) { + const request = event.target + if (request.status < 200 || request.status >= 400) { + self._handleError(event) + return + } + const document = self._parseMeetingpointHTML(request.response) + self._removeChilds() + self._nodes.schedule.appendChild(document) + self._nodes.schedule.classList.remove('error') + self.emit('load') +} + +self._handleError = function (event) { + const request = event.target + let error + if (request.status === 404) { + error = 'Sorry, er is (nog) geen rooster voor deze week.' + } else { + error = 'Sorry, er is iets mis gegaan tijdens het laden van deze week.' + } + self._removeChilds() + self._nodes.schedule.textContent = error + self._nodes.schedule.classList.add('error') + self.emit('load') +} + +self._getURLOfUser = function (week, user) { + return `/get/${user.type}/${user.value}?week=${week}` +} + +self._removeChilds = function () { + while (self._nodes.schedule.firstChild) { + self._nodes.schedule.removeChild(self._nodes.schedule.firstChild) + } +} + +self.viewItem = function (week, selectedUser) { + if (selectedUser == null) { + self._removeChilds() + search.updateDom(selectedUser) + } else if (VALID_WEEK_NUMBERS.indexOf(week) === -1) { + self._handleError({ target: { status: 404 } }); + return + } else { + const url = self._getURLOfUser(week, selectedUser) + + self._removeChilds() + + const request = new window.XMLHttpRequest() + request.addEventListener('load', self._handleLoad) + request.addEventListener('error', self._handleError) + request.open('GET', url, true) + request.send() + + search.updateDom(selectedUser) + } +} + +module.exports = self diff --git a/src/client/javascript/scrollSnap.js b/src/client/javascript/scrollSnap.js new file mode 100644 index 0000000..afee979 --- /dev/null +++ b/src/client/javascript/scrollSnap.js @@ -0,0 +1,59 @@ +require('smoothscroll-polyfill').polyfill() + +const self = {} +const schedule = require('./schedule') + +self._nodes = { + search: document.querySelector('#search'), + weekSelector: document.querySelector('#week-selector') +} + +self._timeoutID = null + +self._getScrollPosition = function () { + return (document.documentElement && document.documentElement.scrollTop) || + document.body.scrollTop +} + +self._handleDoneScrolling = function () { + const scrollPosition = self._getScrollPosition() + const weekSelectorHeight = + self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight + if (scrollPosition < weekSelectorHeight && scrollPosition > 0) { + window.scroll({ top: weekSelectorHeight, left: 0, behavior: 'smooth' }) + } +} + +self._handleScroll = function () { + if (self._timeoutID != null) window.clearTimeout(self._timeoutID) + self._timeoutID = window.setTimeout(self._handleDoneScrolling, 500) + + const scrollPosition = self._getScrollPosition() + const weekSelectorHeight = + self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight + if (scrollPosition >= weekSelectorHeight) { + document.body.classList.add('week-selector-not-visible') + } else { + document.body.classList.remove('week-selector-not-visible') + } +} + +self._handleWindowResize = function () { + const weekSelectorHeight = + self._nodes.weekSelector.clientHeight - self._nodes.search.clientHeight + const extraPixelsNeeded = + weekSelectorHeight - (document.body.clientHeight - window.innerHeight) + if (extraPixelsNeeded > 0) { + document.body.style.marginBottom = extraPixelsNeeded + 'px' + } else { + document.body.style.marginBottom = null + } +} + +self.startListening = function () { + window.addEventListener('scroll', self._handleScroll) +} + +schedule.on('load', self._handleWindowResize) +window.addEventListener('resize', self._handleWindowResize) +module.exports = self diff --git a/src/client/javascript/search.js b/src/client/javascript/search.js new file mode 100644 index 0000000..96413b0 --- /dev/null +++ b/src/client/javascript/search.js @@ -0,0 +1,95 @@ +/* global USERS */ + +const EventEmitter = require('events') +const fuzzy = require('fuzzy') +const autocomplete = require('./autocomplete') +const browserFixToolkit = require('./browserFixToolkit') + +const self = new EventEmitter() + +self._nodes = { + search: document.querySelector('#search'), + input: document.querySelector('input[type="search"]') +} + +self.submit = function () { + const selectedUser = autocomplete.getSelectedUser() + if (selectedUser == null) return + + console.log(selectedUser) + + self._nodes.input.blur() + document.body.classList.remove('week-selector-not-visible') // Safari bug + + self.emit('search', selectedUser) +} + +self.updateDom = function (selectedUser) { + if (selectedUser == null) { + self._nodes.input.value = '' + autocomplete.removeAllItems() + document.body.classList.add('no-input') + document.body.classList.remove('searched') + } else { + self._nodes.input.value = selectedUser.value + autocomplete.removeAllItems() + document.body.classList.remove('no-input') + document.body.classList.add('searched') + } +} + +self.focus = function () { + self._nodes.input.focus() +} + +self._handleSubmit = function (event) { + event.preventDefault() + self.submit() +} + +self._calculate = function (searchTerm) { + const allResults = fuzzy.filter(searchTerm, USERS, { + extract: function (user) { return user.value } + }) + const firstResults = allResults.slice(0, 7) + + const originalResults = firstResults.map(function (result) { + return result.original + }) + + return originalResults +} + +self._handleTextUpdate = function () { + const results = self._calculate(self._nodes.input.value) + + autocomplete.removeAllItems() + for (let i = 0; i < results.length; i++) { + autocomplete.addItem(results[i]) + } +} + +self._handleFocus = function () { + self._nodes.input.select() +} + +self._handleBlur = function () { + // this will removed the selection without drawing focus on it (safari) + // this will removed selection even when focusing an iframe (chrome) + const oldValue = self._nodes.value + self._nodes.value = '' + self._nodes.value = oldValue + + // this will hide the keyboard (iOS safari) + document.activeElement.blur() +} + +autocomplete.on('select', self.submit) + +self._nodes.search.addEventListener('submit', self._handleSubmit) +self._nodes.input.addEventListener('focus', self._handleFocus) +self._nodes.input.addEventListener('blur', self._handleBlur) +self._nodes.input.addEventListener(browserFixToolkit.inputEvent, + self._handleTextUpdate) + +module.exports = self diff --git a/src/client/javascript/url.js b/src/client/javascript/url.js new file mode 100644 index 0000000..17ab7c8 --- /dev/null +++ b/src/client/javascript/url.js @@ -0,0 +1,67 @@ +/* global USERS FLAGS */ + +const EventEmitter = require('events') + +const self = new EventEmitter() + +self._getPageTitle = function (selectedUser) { + let ret + + if (selectedUser == null) { + ret = `Metis Rooster` + } else { + ret = `Metis Rooster - ${selectedUser.value}` + } + + if (FLAGS.indexOf('BETA') !== -1) { + ret = `BETA ${ret}` + } + + return ret +} + +self._getPageURL = function (selectedUser) { + return `/${selectedUser.type}/${selectedUser.value}` +} + +self.push = function (selectedUser, push) { + if (push == null) push = true + const pageTitle = self._getPageTitle(selectedUser) + const pageURL = self._getPageURL(selectedUser) + if (push) { + window.history.pushState(selectedUser, pageTitle, pageURL) + } else { + window.history.replaceState(selectedUser, pageTitle, pageURL) + } +} + +self.update = function (selectedUser) { + document.title = self._getPageTitle(selectedUser) +} + +self.hasSelectedUser = function () { + const pageUrl = window.location.pathname + return /^\/s\/|^\/t\/|^\/r\/|^\/c\//.test(pageUrl) +} + +self.getSelectedUser = function () { + const pageUrl = window.location.pathname + const pageUrlData = pageUrl.split('/') + const type = pageUrlData[1] + const value = pageUrlData[2] + + const user = USERS.filter(function (user) { + return user.type === type && + user.value === value + })[0] + + return user +} + +self._handleUpdate = function (event) { + self.emit('update', event.state) +} + +window.addEventListener('popstate', self._handleUpdate) + +module.exports = self diff --git a/src/client/javascript/weekSelector.js b/src/client/javascript/weekSelector.js new file mode 100644 index 0000000..d4e7f2a --- /dev/null +++ b/src/client/javascript/weekSelector.js @@ -0,0 +1,99 @@ +const EventEmitter = require('events') + +const self = new EventEmitter() + +self._nodes = { + prevButton: document.querySelectorAll('#week-selector button')[0], + nextButton: document.querySelectorAll('#week-selector button')[1], + currentWeekNode: document.querySelector('#week-selector .current'), + currentWeekNormalText: document.querySelector('#week-selector .current .no-print'), + currentWeekPrintText: document.querySelector('#week-selector .current .print') +} + +self._weekOffset = 0 + +// copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js, +// were using the same code as they do to be sure that we always get the same +// week number. +self.getCurrentWeek = function (target) { + const dayNr = (target.getDay() + 6) % 7 + target.setDate(target.getDate() - dayNr + 3) + const firstThursday = target.valueOf() + target.setMonth(0, 1) + if (target.getDay() !== 4) { + target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7) + } + + return 1 + Math.ceil((firstThursday - target) / 604800000) +} + +self.getSelectedWeek = function () { + const now = new Date() + const targetDate = new Date(now.getTime() + + self._weekOffset * 604800 * 1000 + 86400 * 1000) + return self.getCurrentWeek(targetDate) +} + +self.updateCurrentWeek = function () { + const selectedWeekNumber = self.getSelectedWeek() + if (self.getCurrentWeek(new Date()) !== selectedWeekNumber) { + self._nodes.currentWeekNode.classList.add('changed') + } else { + self._nodes.currentWeekNode.classList.remove('changed') + } + self.updateDom() + self.emit('weekChanged', selectedWeekNumber) +} + +self.updateDom = function () { + const selectedWeekNumber = self.getSelectedWeek() + const isSunday = new Date().getDay() === 0 + let humanReadableWeek = null + if (isSunday) { + switch (self._weekOffset) { + case 0: + humanReadableWeek = 'Aanstaande week' + break + case 1: + humanReadableWeek = 'Volgende week' + break + case -1: + humanReadableWeek = 'Afgelopen week' + break + } + } else { + switch (self._weekOffset) { + case 0: + humanReadableWeek = 'Huidige week' + break + case 1: + humanReadableWeek = 'Volgende week' + break + case -1: + humanReadableWeek = 'Vorige week' + break + } + } + if (humanReadableWeek != null) { + self._nodes.currentWeekNormalText.textContent = humanReadableWeek + ' • ' + selectedWeekNumber + self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber + } else { + self._nodes.currentWeekNormalText.textContent = 'Week ' + selectedWeekNumber + self._nodes.currentWeekPrintText.textContent = 'Week ' + selectedWeekNumber + } +} + +self._handlePrevButtonClick = function () { + self._weekOffset -= 1 + self.updateCurrentWeek() +} + +self._handleNextButtonClick = function () { + self._weekOffset += 1 + self.updateCurrentWeek() +} + +self._nodes.prevButton.addEventListener('click', self._handlePrevButtonClick) +self._nodes.nextButton.addEventListener('click', self._handleNextButtonClick) + +module.exports = self diff --git a/src/client/javascript/zoom.js b/src/client/javascript/zoom.js new file mode 100644 index 0000000..59b80db --- /dev/null +++ b/src/client/javascript/zoom.js @@ -0,0 +1,30 @@ +const schedule = require('./schedule') + +const self = {} + +self._nodes = { + body: document.body +} + +self._handleResize = function () { + // the table node may not exist before this function is called + const tableNode = document.querySelector('center > table') + + // infact, it may not even exist when this function is called. + if (!tableNode) return + + const tableWidth = tableNode.getBoundingClientRect().width + const tableGoalWidth = self._nodes.body.getBoundingClientRect().width * 0.9 + const zoomFactor = tableGoalWidth / tableWidth + + if (zoomFactor < 1) { + tableNode.style.zoom = `${zoomFactor}` + } else { + tableNode.style.zoom = `1` + } +} + +schedule.on('load', self._handleResize) +window.addEventListener('resize', self._handleResize) + +module.exports = self diff --git a/src/client/static/.well-known/keybase.txt b/src/client/static/.well-known/keybase.txt new file mode 100644 index 0000000..7e11526 --- /dev/null +++ b/src/client/static/.well-known/keybase.txt @@ -0,0 +1,54 @@ +================================================================== +https://keybase.io/nloomans +-------------------------------------------------------------------- + +I hereby claim: + + * I am an admin of https://rooster.hetmml.nl + * I am nloomans (https://keybase.io/nloomans) on keybase. + * I have a public key ASCCV4aRFiMkEv7inJTf34RgxZ6IK0wQ-wTH2ZfSIu3OzAo + +To do so, I am signing this object: + +{ + "body": { + "key": { + "eldest_kid": "0101bbdb28841b169de6538a51d17ca94b30088ba2914e56fd19121eec05f7a389cc0a", + "host": "keybase.io", + "kid": "01208257869116232412fee29c94dfdf8460c59e882b4c10fb04c7d997d222edcecc0a", + "uid": "7a52ddabf92293dd59f8fbf3774ea319", + "username": "nloomans" + }, + "service": { + "hostname": "rooster.hetmml.nl", + "protocol": "https:" + }, + "type": "web_service_binding", + "version": 1 + }, + "client": { + "name": "keybase.io go client", + "version": "1.0.20" + }, + "ctime": 1492017398, + "expire_in": 504576000, + "merkle_root": { + "ctime": 1492017367, + "hash": "463e597079ce3829ccc1f1aa7b15533c0848f9e13cdb55407af490a87bf4ac1b2d64e8235518ada07d93003b889157b576aad02eda294ccd594dc0dcbf8862ef", + "seqno": 1015311 + }, + "prev": "36959cd282a98f651138068f8695b07480a016f02ba99a0acbde277e0cf4ca30", + "seqno": 19, + "tag": "signature" +} + +which yields the signature: + +hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEggleGkRYjJBL+4pyU39+EYMWeiCtMEPsEx9mX0iLtzswKp3BheWxvYWTFAvt7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTAxYmJkYjI4ODQxYjE2OWRlNjUzOGE1MWQxN2NhOTRiMzAwODhiYTI5MTRlNTZmZDE5MTIxZWVjMDVmN2EzODljYzBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwODI1Nzg2OTExNjIzMjQxMmZlZTI5Yzk0ZGZkZjg0NjBjNTllODgyYjRjMTBmYjA0YzdkOTk3ZDIyMmVkY2VjYzBhIiwidWlkIjoiN2E1MmRkYWJmOTIyOTNkZDU5ZjhmYmYzNzc0ZWEzMTkiLCJ1c2VybmFtZSI6Im5sb29tYW5zIn0sInNlcnZpY2UiOnsiaG9zdG5hbWUiOiJyb29zdGVyLmhldG1tbC5ubCIsInByb3RvY29sIjoiaHR0cHM6In0sInR5cGUiOiJ3ZWJfc2VydmljZV9iaW5kaW5nIiwidmVyc2lvbiI6MX0sImNsaWVudCI6eyJuYW1lIjoia2V5YmFzZS5pbyBnbyBjbGllbnQiLCJ2ZXJzaW9uIjoiMS4wLjIwIn0sImN0aW1lIjoxNDkyMDE3Mzk4LCJleHBpcmVfaW4iOjUwNDU3NjAwMCwibWVya2xlX3Jvb3QiOnsiY3RpbWUiOjE0OTIwMTczNjcsImhhc2giOiI0NjNlNTk3MDc5Y2UzODI5Y2NjMWYxYWE3YjE1NTMzYzA4NDhmOWUxM2NkYjU1NDA3YWY0OTBhODdiZjRhYzFiMmQ2NGU4MjM1NTE4YWRhMDdkOTMwMDNiODg5MTU3YjU3NmFhZDAyZWRhMjk0Y2NkNTk0ZGMwZGNiZjg4NjJlZiIsInNlcW5vIjoxMDE1MzExfSwicHJldiI6IjM2OTU5Y2QyODJhOThmNjUxMTM4MDY4Zjg2OTViMDc0ODBhMDE2ZjAyYmE5OWEwYWNiZGUyNzdlMGNmNGNhMzAiLCJzZXFubyI6MTksInRhZyI6InNpZ25hdHVyZSJ9o3NpZ8RAcP5FuvbGM9nXBzWqChr9zdj452IpBzrVbd6YvcktLyKjaUaRg51BOWsyHmYQ+uxmZ2ZCUI6xZbbJ1SIAnWqvC6hzaWdfdHlwZSCkaGFzaIKkdHlwZQildmFsdWXEING7Z+BlY2sOTnQqQJo/PUBashy75VL9UU4tGIEvMXbco3RhZ80CAqd2ZXJzaW9uAQ== + +And finally, I am proving ownership of this host by posting or +appending to this document. + +View my publicly-auditable identity here: https://keybase.io/nloomans + +================================================================== diff --git a/src/client/static/apple-touch-icon.png b/src/client/static/apple-touch-icon.png new file mode 100644 index 0000000..5adfc69 Binary files /dev/null and b/src/client/static/apple-touch-icon.png differ diff --git a/src/client/static/browserconfig.xml b/src/client/static/browserconfig.xml new file mode 100644 index 0000000..b3930d0 --- /dev/null +++ b/src/client/static/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/src/client/static/favicon-16x16.png b/src/client/static/favicon-16x16.png new file mode 100644 index 0000000..1df47d3 Binary files /dev/null and b/src/client/static/favicon-16x16.png differ diff --git a/src/client/static/favicon-32x32.png b/src/client/static/favicon-32x32.png new file mode 100644 index 0000000..36cd5da Binary files /dev/null and b/src/client/static/favicon-32x32.png differ diff --git a/src/client/static/favicon.ico b/src/client/static/favicon.ico new file mode 100644 index 0000000..c201043 Binary files /dev/null and b/src/client/static/favicon.ico differ diff --git a/src/client/static/icons/mml-logo.png b/src/client/static/icons/mml-logo.png new file mode 100644 index 0000000..fa5ae11 Binary files /dev/null and b/src/client/static/icons/mml-logo.png differ diff --git a/src/client/static/icons/res/mipmap-hdpi/ic_launcher.png b/src/client/static/icons/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..514ad14 Binary files /dev/null and b/src/client/static/icons/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/client/static/icons/res/mipmap-mdpi/ic_launcher.png b/src/client/static/icons/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..59bab1d Binary files /dev/null and b/src/client/static/icons/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/client/static/icons/res/mipmap-xhdpi/ic_launcher.png b/src/client/static/icons/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..908a6e8 Binary files /dev/null and b/src/client/static/icons/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/client/static/icons/res/mipmap-xxhdpi/ic_launcher.png b/src/client/static/icons/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..f12048f Binary files /dev/null and b/src/client/static/icons/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/client/static/icons/res/mipmap-xxxhdpi/ic_launcher.png b/src/client/static/icons/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..7a0462e Binary files /dev/null and b/src/client/static/icons/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/client/static/manifest.beta.webmanifest b/src/client/static/manifest.beta.webmanifest new file mode 100644 index 0000000..a1fdd92 --- /dev/null +++ b/src/client/static/manifest.beta.webmanifest @@ -0,0 +1,29 @@ +{ + "name": "BETA Metis Rooster", + "short_name": "BETA Rooster", + "start_url": "/", + "display": "standalone", + "background_color": "#ececec", + "description": "Een verbeterde rooster pagina voor het metis", + "icons": [{ + "src": "/icons/res/mipmap-mdpi/ic_launcher.png", + "sizes": "48x48", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-hdpi/ic_launcher.png", + "sizes": "72x72", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-xhdpi/ic_launcher.png", + "sizes": "96x96", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-xxhdpi/ic_launcher.png", + "sizes": "144x144", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-xxxhdpi/ic_launcher.png", + "sizes": "192x192", + "type": "image/png" + }] +} diff --git a/src/client/static/manifest.webmanifest b/src/client/static/manifest.webmanifest new file mode 100644 index 0000000..d33ee8e --- /dev/null +++ b/src/client/static/manifest.webmanifest @@ -0,0 +1,29 @@ +{ + "name": "Metis Rooster", + "short_name": "Rooster", + "start_url": "/", + "display": "standalone", + "background_color": "#ececec", + "description": "Een verbeterde rooster pagina voor het metis", + "icons": [{ + "src": "/icons/res/mipmap-mdpi/ic_launcher.png", + "sizes": "48x48", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-hdpi/ic_launcher.png", + "sizes": "72x72", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-xhdpi/ic_launcher.png", + "sizes": "96x96", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-xxhdpi/ic_launcher.png", + "sizes": "144x144", + "type": "image/png" + }, { + "src": "/icons/res/mipmap-xxxhdpi/ic_launcher.png", + "sizes": "192x192", + "type": "image/png" + }] +} diff --git a/src/client/static/mstile-150x150.png b/src/client/static/mstile-150x150.png new file mode 100644 index 0000000..5e381e6 Binary files /dev/null and b/src/client/static/mstile-150x150.png differ diff --git a/src/client/static/safari-pinned-tab.svg b/src/client/static/safari-pinned-tab.svg new file mode 100644 index 0000000..97ce8bf --- /dev/null +++ b/src/client/static/safari-pinned-tab.svg @@ -0,0 +1,34 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + + diff --git a/src/client/static/stylesheets/hello.css b/src/client/static/stylesheets/hello.css new file mode 100644 index 0000000..edcbc92 --- /dev/null +++ b/src/client/static/stylesheets/hello.css @@ -0,0 +1,23 @@ +* { + box-sizing: border-box; +} + +html, body { + margin: 0; + font-family: 'Roboto', sans-serif; + display: flex; + flex-direction: column; + justify-content: center; + text-align: center; + width: 100vw; + height: 100vh; + color: gray; +} + +.ideas { + font-size: 0.8em; +} + +a { + color: #3f51b5; +} diff --git a/src/client/static/stylesheets/print.css b/src/client/static/stylesheets/print.css new file mode 100644 index 0000000..0e09533 --- /dev/null +++ b/src/client/static/stylesheets/print.css @@ -0,0 +1,63 @@ +#search, #week-selector { + background-color: inherit; + box-shadow: inherit; +} + +#search { + border-bottom: 1px solid black; + position: absolute; +} + +#search .top-bar, #week-selector .week-wrapper { + max-width: inherit; +} + +#search input[type="search"] { + background-color: inherit; + color: black; + font-weight: bold; +} + +#search .fav { + display: none !important; +} + +#search #overflow-button { + display: none; +} + +#week-selector .week-wrapper { + display: block; +} + +#week-selector button { + display: none; +} + +#week-selector .current { + color: black; + padding: 16px; + font-size: 1.1em; + float: right; +} + +#search-space-filler { + display: none; +} + +.mdl-menu__container { + display: none !important; +} + +#schedule { + padding-top: 16px; + width: 100%; +} + +.no-print { + display: none; +} + +.print { + display: initial; +} diff --git a/src/client/static/stylesheets/style.css b/src/client/static/stylesheets/style.css new file mode 100644 index 0000000..830b007 --- /dev/null +++ b/src/client/static/stylesheets/style.css @@ -0,0 +1,392 @@ +* { + box-sizing: border-box; +} + +html, body { + margin: 0; + font-family: 'Roboto', sans-serif; +} + +.other { + color: gray; + font-style: italic; + margin-left: 5px; +} + +#search { + z-index: 2; + background-color: #F44336; + margin: 0 auto; + width: 100%; + position: fixed; + box-shadow: 0 0.5px 1.5px rgba(0,0,0,0.06), 0 0.5px 1px rgba(0,0,0,0.12); +} + +#search .top-bar { + position: relative; + margin: 0 auto; + max-width: 600px; + padding: 10px; + display: flex; +} + +#search .input-wrapper { + position: relative; + flex-grow: 1; + color: #FFFFFF; +} + +#search input[type='search'] { + display: block; + background-color: #f6695e; + color: inherit; + border-radius: 2px; + width: 100%; + display: block; + outline: none; + border: 0; + padding: 16px; + font-size: 16px; + transition: box-shadow 200ms ease-in-out; +} + +#search input[type='search']:focus { + background-color: #FFFFFF; + color: #212121; + box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); +} + +#search input[type='search']:focus + button { + color: #212121; +} + +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-results-button, +input[type="search"]::-webkit-search-results-decoration { + display: none; +} + +input[type="search"]::-ms-clear { + width: 0; + height: 0; +} + +button::-moz-focus-inner { + border: 0; +} + + +/* WebKit, Blink, Edge */ +input::-webkit-input-placeholder { + color: #FFCDD2; +} +input:focus::-webkit-input-placeholder { + color: #757575; +} + +/* Mozilla Firefox 4 to 18 */ +input:-moz-placeholder { + color: #FFCDD2; + opacity: 1; +} +input:focus:-moz-placeholder { + color: #757575; +} + +/* Mozilla Firefox 19+ */ +input::-moz-placeholder { + color: #FFCDD2; + opacity: 1; +} +input:focus::-moz-placeholder { + color: #757575; +} + +/* Internet Explorer 10-11 */ +input:-ms-input-placeholder { + color: #FFCDD2; +} +input:focus:-ms-input-placeholder { + color: #757575; +} + +li:hover { + background-color: lightgray; + cursor: pointer; +} + +.selected { + background-color: lightgray; +} + +#schedule { + overflow: auto; +} + +body.searched #search-space-filler { + height: 70px; +} + +.autocomplete-wrapper { + background-color: white; +} + +.autocomplete { + max-width: 600px; + margin: 0 auto; + padding: 0; +} + +.autocomplete li { + list-style: none; + padding: 10px; +} + +#week-selector { + z-index: 1; + background-color: #F44336; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); + color: white; +} + +#week-selector .week-wrapper { + max-width: 600px; + padding: 10px !important; + margin: 0 auto; + display: flex; + -js-display: flex; + padding: 10px 0; +} + +#week-selector .current { + display: flex; + flex-grow: 1; + align-items: center; + justify-content: center; +} + +#week-selector .current.changed { + font-weight: bold; +} + +#week-selector button { + background: transparent; + color: white; + border: 0px; + padding: 5px 10px; + border-radius: 2px; +} + +input { + -webkit-appearance: none; +} + +#search .fav { + position: absolute; + font-size: 1.8em; + color: inherit; + right: 8.5px; + top: 8.5px; + border: 0; + padding: 4px; + border-radius: 2px; + background: none; + + display: none; +} + +body.searched #search .fav { + display: block; +} + +#week-selector button:focus, #search #overflow-button:focus, #search .fav:focus { + outline: none; + background-color: #D32F2F; +} + +#search #overflow-button { + background: none; + border: none; + padding: 3px 9px; + color: white; + border-radius: 2px; +} + +.hidden { + display: none !important; +} + +ul a { + color: inherit; + text-decoration: none; +} + +#search .title { + display: none; +} + +body:not(.no-input) { + overflow-y: scroll; +} + +body.no-input #week-selector { + display: none; +} + +@media screen and (min-height: 400px) { + body.no-input { + background-color: #ececec; + } + + body.no-input #search { + height: 100%; + background-color: #ececec; + box-shadow: none; + } + + body.no-input #search button { + display: none; + } + + body.no-input #search #overflow-button { + position: absolute; + display: block; + top: 0; + right: 0; + color: #757575; + } + + body.no-input #search .print-page { + display: none; + } + + body.no-input #search #overflow-button:focus { + background-color: inherit; + color: #212121; + } + + body.no-input #search .logo { + background-image: url(/icons/mml-logo.png); + background-position: center; + background-repeat: no-repeat; + background-size: contain; + height: 100px; + width: 100px; + + /* virtual center: http://javier.xyz/visual-center/ */ + transform: translate(-8%,-3%); + margin: 0 auto; + } + + body.no-input #search .title { + display: block; + font-size: 55px; + padding-bottom: 32px; + } + + body.no-input #search .title .text { + text-align: center; + line-height: 55px; + } + + body.no-input #search .top-bar { + position: static; + display: block; + margin-top: 50vh; + transform: translateY(-75%); + } + + body.no-input #search input[type='search'] { + background-color: #FFF; + } + + /* WebKit, Blink, Edge */ + body.no-input #search input::-webkit-input-placeholder { + color: #757575; + } + + /* Mozilla Firefox 4 to 18 */ + body.no-input #search input:-moz-placeholder { + color: #757575; + opacity: 1; + } + + /* Mozilla Firefox 19+ */ + body.no-input #search input::-moz-placeholder { + color: #757575; + opacity: 1; + } + + /* Internet Explorer 10-11 */ + body.no-input #search input:-ms-input-placeholder { + color: #757575; + } + + body.no-input .tooltip { + display: block; + position: absolute; + background-color: white; + padding: 15px; + margin: 32px 8px; + border-radius: 2px; + + left: 16px; + right: 16px; + } + + body.no-input .tooltip::before { + content: ''; + width: 24px; + height: 24px; + background-color: white; + top: -12px; + position: absolute; + transform: rotate(45deg); + z-index: -1; + } +} + +.tooltip { + display: none; +} + +.error { + text-align: center; + margin-top: 100px; + padding: 16px; +} + +body.week-selector-not-visible #search { + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} + +body.week-selector-not-visible #week-selector { + box-shadow: inherit; +} + +.print { + display: none; +} + +#notification { + max-width: 600px; + padding: 10px; + margin: 0 auto; +} + +#notification .box { + display: flex; + background-color: #e0e0e0; + padding: 8px; + border-radius: 2px; + align-items: center; +} + +#notification .text { + padding-left: 8px; +} + +.grow { + flex-grow: 1; +} diff --git a/src/client/static/sw.js b/src/client/static/sw.js new file mode 100644 index 0000000..bd43805 --- /dev/null +++ b/src/client/static/sw.js @@ -0,0 +1,29 @@ +/* global importScripts toolbox self */ + +(global => { + 'use strict' + + // Load the sw-toolbox library. + importScripts('/components/sw-toolbox/sw-toolbox.js') + + // Ensure that our service worker takes control of the page as soon as possible. + global.addEventListener('install', event => event.waitUntil(global.skipWaiting())) + global.addEventListener('activate', event => event.waitUntil(global.clients.claim())) + + toolbox.precache([ + '/', + '/hello', + '/untisinfo.css', + '/javascripts/bundle.js', + '/stylesheets/style.css', + '/stylesheets/hello.css' + ]) + + toolbox.router.get('/', toolbox.fastest) + toolbox.router.get('/hello', toolbox.fastest) + + toolbox.router.get('/javascripts/bundle.js', toolbox.fastest) + toolbox.router.get('/stylesheets/*', toolbox.fastest) + toolbox.router.get('/untisinfo.css', toolbox.fastest) + toolbox.router.get('/meetingpointProxy/*', toolbox.networkFirst) +})(self) diff --git a/src/client/static/untisinfo.css b/src/client/static/untisinfo.css new file mode 100644 index 0000000..d74a7aa --- /dev/null +++ b/src/client/static/untisinfo.css @@ -0,0 +1,11 @@ +html, body { + overflow: auto; + width: 100vw; + height: 100vh; + margin: 0; + -webkit-overflow-scrolling: touch; +} + +center { + margin: 5px; +} diff --git a/src/client/views/error.jade b/src/client/views/error.jade new file mode 100644 index 0000000..51ec12c --- /dev/null +++ b/src/client/views/error.jade @@ -0,0 +1,6 @@ +extends layout + +block content + h1= message + h2= error.status + pre #{error.stack} diff --git a/src/client/views/index.jade b/src/client/views/index.jade new file mode 100644 index 0000000..540fd42 --- /dev/null +++ b/src/client/views/index.jade @@ -0,0 +1,51 @@ +extends layout + +block variables + - var bodyStyle = 'opacity: 0;'; + +block head + link(rel='stylesheet', href='/stylesheets/style.css') + link(rel='stylesheet', href='/stylesheets/print.css', media='print') + link(rel='stylesheet', href='https://fonts.googleapis.com/icon?family=Material+Icons') + link(rel='stylesheet', href='/components/material-design-lite/material.min.css') + script(defer='', src='/components/material-design-lite/material.min.js') + +block content + form#search + .top-bar + .title + .logo + .text Rooster + .input-wrapper + input(type='search', placeholder='Zoeken', autocomplete='off') + button.material-icons.fav(tabindex='0', type='button')  + .tooltip + span Voer hier een docentafkorting, klas, leerlingnummer of lokaalnummer in. + button#overflow-button(type='button') + i.material-icons  + + ul.mdl-menu.mdl-menu--bottom-right.mdl-js-menu.mdl-js-ripple-effect(for='overflow-button') + a(href='http://www.meetingpointmco.nl/Roosters-AL/doc/basisroosters/default.htm') + li.mdl-menu__item Basis rooster gebruiken + a(href='http://www.meetingpointmco.nl/Roosters-AL/doc/') + li.mdl-menu__item Oud rooster gebruiken + a(href='javascript:window.print()').print-page + li.mdl-menu__item.mdl-menu__item--full-bleed-divider#print-page Pagina printen + li.mdl-menu__item(disabled) Gemaakt door Noah Loomans + .autocomplete-wrapper + ul.autocomplete + #week-selector + #search-space-filler + .week-wrapper + button(type='button').material-icons  + span.current + span.no-print Loading... + span.print + button(type='button').material-icons  + + #schedule + +block scripts + script. + !{flagsStr}!{usersStr}!{validWeekNumbersStr} + script(src='/bundle.js') diff --git a/src/client/views/layout.jade b/src/client/views/layout.jade new file mode 100644 index 0000000..f7f9e1f --- /dev/null +++ b/src/client/views/layout.jade @@ -0,0 +1,25 @@ +block variables + - var bodyStyle = ''; + +doctype html +html(lang='nl') + head + block head_top + if isBeta + title BETA Metis Rooster + else + title Metis Rooster + meta(name='theme-color',content='#F44336') + meta(name='viewport', content='width=device-width, initial-scale=1') + link(href='https://fonts.googleapis.com/css?family=Roboto', rel='stylesheet') + link(rel='manifest', href='/manifest.webmanifest') + link(rel="apple-touch-icon", sizes="120x120", href="/apple-touch-icon.png") + link(rel="icon", type="image/png", href="/favicon-32x32.png", sizes="32x32") + link(rel="icon", type="image/png", href="/favicon-16x16.png", sizes="16x16") + link(rel="mask-icon", href="/safari-pinned-tab.svg", color="#f44336") + block head + body(style=bodyStyle) + block content + script. + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', 'UA-83684754-1', 'auto');ga('send', 'pageview'); + block scripts diff --git a/src/client/views/redirect.jade b/src/client/views/redirect.jade new file mode 100644 index 0000000..e895456 --- /dev/null +++ b/src/client/views/redirect.jade @@ -0,0 +1,47 @@ +extends layout + +block head + style. + body { + font-family: 'Roboto', sans-serif; + text-align: center; + margin: 32px; + } + + .content { + max-width: 600px; + margin: 0 auto; + } + + h1 { + color: #212121; + margin-bottom: 32px; + } + + h2 { + color: #727272; + margin-bottom: 64px; + } + + a, a:visited { + margin: 8px; + padding: 8px 16px; + background-color: #c84127; + color: white; + text-decoration: none; + font-weight: bold; + border-radius: 3px; + } + + a:hover, a:focus, a:active { + background-color: #e45a3f; + } + +block content + .content + script document.body.style.opacity = 1 + img(src='/icons/mml-logo.png') + h1 Er is iets mis gegaan tijdens het ophalen van de benodigde informatie + h2 Je kunt proberen door te gaan naar het oude rooster of Magister + a(href='http://www.meetingpointmco.nl/Roosters-AL/doc/') Oud rooster + a(href='http://msa.magister.net/') Magister diff --git a/src/server/app.js b/src/server/app.js new file mode 100644 index 0000000..36d7e26 --- /dev/null +++ b/src/server/app.js @@ -0,0 +1,62 @@ +const express = require('express') +const path = require('path') +const logger = require('morgan') +const cookieParser = require('cookie-parser') +const bodyParser = require('body-parser') +const compression = require('compression') + +const routes = require('./routes/index') +const getSchedule = require('./routes/getSchedule') +const manifest = require('./routes/manifest') + +const app = express() + +app.use(compression()) + +// view engine setup +app.set('views', path.join(__dirname, '../client/views')) +app.set('view engine', 'jade') + +app.use(logger('dev')) +app.use(bodyParser.json()) +app.use(bodyParser.urlencoded({ extended: false })) +app.use(cookieParser()) + +app.use('/manifest.webmanifest', manifest) +app.use(express.static(path.join(__dirname, '../client/static'))) + +app.use('/', routes) +app.use('/get', getSchedule) + +// catch 404 and forward to error handler +app.use(function (req, res, next) { + const err = new Error('Not Found') + err.status = 404 + next(err) +}) + +// error handlers + +// development error handler +// will print stacktrace +if (app.get('env') === 'development') { + app.use(function (err, req, res, next) { + res.status(err.status || 500) + res.render('error', { + message: err.message, + error: err + }) + }) +} + +// production error handler +// no stacktraces leaked to user +app.use(function (err, req, res, next) { + res.status(err.status || 500) + res.render('error', { + message: err.message, + error: {} + }) +}) + +module.exports = app diff --git a/src/server/bin/www b/src/server/bin/www new file mode 100755 index 0000000..545db41 --- /dev/null +++ b/src/server/bin/www @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +const app = require('../app') +const http = require('http') + +const port = normalizePort(process.env.PORT || '3000') +const server = http.createServer(app) + +server.listen(port) +server.on('error', error => onError(error, port)) +server.on('listening', _ => onListening(server)) + +function normalizePort (val) { + const port = parseInt(val, 10) + + if (isNaN(port)) { + // named pipe + return val + } + + if (port >= 0) { + // port number + return port + } + + return false +} + +function onError (error, port) { + if (error.syscall !== 'listen') { + throw error + } + + const bind = typeof port === 'string' + ? 'Pipe ' + port + : 'Port ' + port + + // handle specific listen errors with friendly messages + switch (error.code) { + case 'EACCES': + console.error(bind + ' requires elevated privileges') + process.exit(1) + break + case 'EADDRINUSE': + console.error(bind + ' is already in use') + process.exit(1) + break + default: + throw error + } +} + +function onListening (server) { + const addr = server.address() + if (typeof addr === 'string') { + console.log(`Listening on pipe ${addr}`) + } else { + console.log(`Listening on http://localhost:${addr.port}/`) + } +} diff --git a/src/server/lib/getMeetingpointData.js b/src/server/lib/getMeetingpointData.js new file mode 100644 index 0000000..94cf36c --- /dev/null +++ b/src/server/lib/getMeetingpointData.js @@ -0,0 +1,83 @@ +'use strict' + +const Promise = require('bluebird') +const cheerio = require('cheerio') +const _ = require('lodash') +const request = Promise.promisify(require('request')) + +let meetingpointData +let lastUpdate + +function getUsers (page) { + const script = page('script').eq(1).text() + + const regexs = [/var classes = \[(.+)\];/, /var teachers = \[(.+)\];/, /var rooms = \[(.+)\];/, /var students = \[(.+)\];/] + const items = regexs.map(function (regex) { + return script.match(regex)[1].split(',').map(function (item) { + return item.replace(/"/g, '') + }) + }) + + return [] + .concat(items[0].map(function (item, index) { + return { + type: 'c', + value: item, + index: index + } + })) + .concat(items[1].map(function (item, index) { + return { + type: 't', + value: item, + index: index + } + })) + .concat(items[2].map(function (item, index) { + return { + type: 'r', + value: item, + index: index + } + })) + .concat(items[3].map(function (item, index) { + return { + type: 's', + value: item, + index: index + } + })) +} + +function getValidWeekNumbers(page) { + const weekSelector = page('select[name="week"]'); + const weekNumbers = _.map(weekSelector.children(), option => parseInt(option.attribs.value)) + + return weekNumbers; +} + +function requestData() { + lastUpdate = new Date() + + return request(`http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/frames/navbar.htm`, { timeout: 5000 }).then((response) => { + const page = cheerio.load(response.body) + const users = getUsers(page) + const validWeekNumbers = getValidWeekNumbers(page) + + meetingpointData = { users, validWeekNumbers } + + return meetingpointData + }) +} + +function getMeetingpointData () { + if (lastUpdate == null || new Date() - lastUpdate > 10 * 60 * 1000) { // 10 minutes + return requestData() + } else if (!meetingpointData) { + return Promise.reject() + } else { + return Promise.resolve(meetingpointData) + } +} + +module.exports = getMeetingpointData diff --git a/src/server/lib/getURLOfUser.js b/src/server/lib/getURLOfUser.js new file mode 100644 index 0000000..2de48e6 --- /dev/null +++ b/src/server/lib/getURLOfUser.js @@ -0,0 +1,8 @@ +const leftPad = require('left-pad') // I imported this just to piss you off ;) + +function getURLOfUser (type, index, week) { + return `http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/` + + `${leftPad(week, 2, '0')}/${type}/${type}${leftPad(index + 1, 5, '0')}.htm` +} + +module.exports = getURLOfUser diff --git a/src/server/lib/getUserIndex.js b/src/server/lib/getUserIndex.js new file mode 100644 index 0000000..db7daa8 --- /dev/null +++ b/src/server/lib/getUserIndex.js @@ -0,0 +1,85 @@ +'use strict' + +const Promise = require('bluebird') +const cheerio = require('cheerio') +const request = Promise.promisify(require('request')) + +let userIndex +let lastUpdate + +function updateUserIndex () { + return new Promise(function (resolve, reject) { + process.stdout.write('Updating user index... ') + request(`http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/frames/navbar.htm`) + .then(function (page) { + lastUpdate = new Date() + page = page.body + + const $ = cheerio.load(page) + const $script = $('script').eq(1) + const scriptText = $script.text() + + const regexs = [/var classes = \[(.+)];/, /var teachers = \[(.+)];/, /var rooms = \[(.+)];/, /var students = \[(.+)];/] + const items = regexs.map(function (regex) { + return scriptText.match(regex)[1].split(',').map(function (item) { + return item.replace(/"/g, '') + }) + }) + + userIndex = ([] + .concat(items[0].map(function (item, index) { + return { + type: 'c', + value: item, + index: index + } + })) + .concat(items[1].map(function (item, index) { + return { + type: 't', + value: item, + index: index + } + })) + .concat(items[2].map(function (item, index) { + return { + type: 'r', + value: item, + index: index + } + })) + .concat(items[3].map(function (item, index) { + return { + type: 's', + value: item, + index: index + } + }))) + + process.stdout.write('done.\n') + + resolve(userIndex) + }) + .catch(error => { + process.stdout.write('failed.\n') + reject(error) + }) + }) +} + +function getUserIndex () { + return new Promise((resolve, reject) => { + if (lastUpdate == null) { + updateUserIndex().then(resolve, reject) + } else if (new Date() - lastUpdate > 10 * 60 * 1000) { // 10 minutes + updateUserIndex().then(resolve, function () { + console.warn('Unable to update userIndex, using cached.') + resolve(userIndex) + }) + } else { + resolve(userIndex) + } + }) +} + +module.exports = getUserIndex diff --git a/src/server/routes/getSchedule.js b/src/server/routes/getSchedule.js new file mode 100644 index 0000000..f6c3cb6 --- /dev/null +++ b/src/server/routes/getSchedule.js @@ -0,0 +1,55 @@ +const express = require('express') +const router = express.Router() +const request = require('request') +const iconv = require('iconv-lite') + +const getUserIndex = require('../lib/getUserIndex') +const getURLOfUser = require('../lib/getURLOfUser') + +// copied from http://www.meetingpointmco.nl/Roosters-AL/doc/dagroosters/untisscripts.js, +// were using the same code as they do to be sure that we always get the same +// week number. +function getWeekNumber (target) { + const dayNr = (target.getDay() + 6) % 7 + target.setDate(target.getDate() - dayNr + 3) + const firstThursday = target.valueOf() + target.setMonth(0, 1) + if (target.getDay() !== 4) { + target.setMonth(0, 1 + ((4 - target.getDay()) + 7) % 7) + } + + return 1 + Math.ceil((firstThursday - target) / 604800000) +} + +router.get('/:type/:value', function (req, res, next) { + getUserIndex().then(users => { + const { type, value } = req.params + let { week } = req.query + const user = + users.filter(user => user.type === type && user.value === value)[0] + + if (!user) { + next(new Error(`${type}${value} is not in the user index.`)) + } + + if (!week) { + week = getWeekNumber(new Date()) + } + + const { index } = user + + const url = getURLOfUser(type, index, week) + + request(url, { encoding: null }, function (err, data) { + if (err) { + next(err) + return + } + + const utf8Body = iconv.decode(data.body, 'ISO-8859-1') + res.status(data.statusCode).end(utf8Body) + }) + }) +}) + +module.exports = router diff --git a/src/server/routes/index.js b/src/server/routes/index.js new file mode 100644 index 0000000..d2267ba --- /dev/null +++ b/src/server/routes/index.js @@ -0,0 +1,31 @@ +'use strict' + +const express = require('express') +const router = express.Router() +const getMeetingpointData = require('../lib/getMeetingpointData') + +/* GET home page. */ +router.get(['/', '/s/*', '/t/*', '/r/*', '/c/*'], function (req, res, next) { + getMeetingpointData().then(data => { + const isBeta = process.env.BETA === '1' + + let flags = [] + if (isBeta) { + flags.push('BETA') + flags.push('NO_FEATURE_DETECT') + } else if (req.query.nfd != null) { + flags.push('NO_FEATURE_DETECT') + } + + const flagsStr = `var FLAGS = ${JSON.stringify(flags)};` + const usersStr = `var USERS = ${JSON.stringify(data.users)};` + const validWeekNumbersStr = `var VALID_WEEK_NUMBERS = ${JSON.stringify(data.validWeekNumbers)}` + + res.render('index', { flagsStr, usersStr, validWeekNumbersStr }) + }).catch(function () { + console.error('Unable to get user info, emergency redirect!') + res.render('redirect') + }) +}) + +module.exports = router diff --git a/src/server/routes/manifest.js b/src/server/routes/manifest.js new file mode 100644 index 0000000..b2ce55f --- /dev/null +++ b/src/server/routes/manifest.js @@ -0,0 +1,19 @@ +'use strict' + +const express = require('express') +const router = express.Router() +const path = require('path') + +router.get('/', function (req, res, next) { + console.log('got a request') + + const isBeta = process.env.BETA === '1' + + if (isBeta) { + res.sendFile('manifest.beta.webmanifest', { root: path.join(__dirname, '../public') }) + } else { + res.sendFile('manifest.webmanifest', { root: path.join(__dirname, '../public') }) + } +}) + +module.exports = router diff --git a/src/server/routes/opensearch.js b/src/server/routes/opensearch.js new file mode 100644 index 0000000..c3e2e57 --- /dev/null +++ b/src/server/routes/opensearch.js @@ -0,0 +1,12 @@ +'use strict' + +const express = require('express') +const router = express.Router() +const path = require('path') + +router.get('/', function (req, res, next) { + res.setHeader('content-type', 'application/opensearchdescription+xml') + res.sendFile('opensearch.xml', { root: path.join(__dirname, '../public') }) +}) + +module.exports = router diff --git a/views/error.jade b/views/error.jade deleted file mode 100644 index 51ec12c..0000000 --- a/views/error.jade +++ /dev/null @@ -1,6 +0,0 @@ -extends layout - -block content - h1= message - h2= error.status - pre #{error.stack} diff --git a/views/index.jade b/views/index.jade deleted file mode 100644 index 397e6b2..0000000 --- a/views/index.jade +++ /dev/null @@ -1,51 +0,0 @@ -extends layout - -block variables - - var bodyStyle = 'opacity: 0;'; - -block head - link(rel='stylesheet', href='/stylesheets/style.css') - link(rel='stylesheet', href='/stylesheets/print.css', media='print') - link(rel='stylesheet', href='https://fonts.googleapis.com/icon?family=Material+Icons') - link(rel='stylesheet', href='/components/material-design-lite/material.min.css') - script(defer='', src='/components/material-design-lite/material.min.js') - -block content - form#search - .top-bar - .title - .logo - .text Rooster - .input-wrapper - input(type='search', placeholder='Zoeken', autocomplete='off') - button.material-icons.fav(tabindex='0', type='button')  - .tooltip - span Voer hier een docentafkorting, klas, leerlingnummer of lokaalnummer in. - button#overflow-button(type='button') - i.material-icons  - - ul.mdl-menu.mdl-menu--bottom-right.mdl-js-menu.mdl-js-ripple-effect(for='overflow-button') - a(href='http://www.meetingpointmco.nl/Roosters-AL/doc/basisroosters/default.htm') - li.mdl-menu__item Basis rooster gebruiken - a(href='http://www.meetingpointmco.nl/Roosters-AL/doc/') - li.mdl-menu__item Oud rooster gebruiken - a(href='javascript:window.print()').print-page - li.mdl-menu__item.mdl-menu__item--full-bleed-divider#print-page Pagina printen - li.mdl-menu__item(disabled) Gemaakt door Noah Loomans - .autocomplete-wrapper - ul.autocomplete - #week-selector - #search-space-filler - .week-wrapper - button(type='button').material-icons  - span.current - span.no-print Loading... - span.print - button(type='button').material-icons  - - #schedule - -block scripts - script. - !{flagsStr}!{usersStr}!{validWeekNumbersStr} - script(src='/javascripts/bundle.js') diff --git a/views/layout.jade b/views/layout.jade deleted file mode 100644 index f7f9e1f..0000000 --- a/views/layout.jade +++ /dev/null @@ -1,25 +0,0 @@ -block variables - - var bodyStyle = ''; - -doctype html -html(lang='nl') - head - block head_top - if isBeta - title BETA Metis Rooster - else - title Metis Rooster - meta(name='theme-color',content='#F44336') - meta(name='viewport', content='width=device-width, initial-scale=1') - link(href='https://fonts.googleapis.com/css?family=Roboto', rel='stylesheet') - link(rel='manifest', href='/manifest.webmanifest') - link(rel="apple-touch-icon", sizes="120x120", href="/apple-touch-icon.png") - link(rel="icon", type="image/png", href="/favicon-32x32.png", sizes="32x32") - link(rel="icon", type="image/png", href="/favicon-16x16.png", sizes="16x16") - link(rel="mask-icon", href="/safari-pinned-tab.svg", color="#f44336") - block head - body(style=bodyStyle) - block content - script. - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');ga('create', 'UA-83684754-1', 'auto');ga('send', 'pageview'); - block scripts diff --git a/views/redirect.jade b/views/redirect.jade deleted file mode 100644 index e895456..0000000 --- a/views/redirect.jade +++ /dev/null @@ -1,47 +0,0 @@ -extends layout - -block head - style. - body { - font-family: 'Roboto', sans-serif; - text-align: center; - margin: 32px; - } - - .content { - max-width: 600px; - margin: 0 auto; - } - - h1 { - color: #212121; - margin-bottom: 32px; - } - - h2 { - color: #727272; - margin-bottom: 64px; - } - - a, a:visited { - margin: 8px; - padding: 8px 16px; - background-color: #c84127; - color: white; - text-decoration: none; - font-weight: bold; - border-radius: 3px; - } - - a:hover, a:focus, a:active { - background-color: #e45a3f; - } - -block content - .content - script document.body.style.opacity = 1 - img(src='/icons/mml-logo.png') - h1 Er is iets mis gegaan tijdens het ophalen van de benodigde informatie - h2 Je kunt proberen door te gaan naar het oude rooster of Magister - a(href='http://www.meetingpointmco.nl/Roosters-AL/doc/') Oud rooster - a(href='http://msa.magister.net/') Magister diff --git a/webpack.config.js b/webpack.config.js index 1fc43ff..8b713a6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,9 +1,9 @@ const path = require('path'); module.exports = { - entry: './public/javascripts/main.js', + entry: './src/client/javascript/main.js', output: { - path: path.resolve(__dirname, 'public/javascripts'), + path: path.resolve(__dirname, 'src/client/static'), filename: 'bundle.js' }, module: { -- cgit v1.1