Merge branch 'RC1-1.0' of https://github.com/havfo/multiparty-meeting into RC1-1.0

master
Håvar Aambø Fosstveit 2018-11-19 15:29:45 +01:00
commit 6a30cf9526
4 changed files with 93 additions and 14 deletions

View File

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Multiparty Meeting</title>
</head>
<style>
body{
margin:auto;
padding:0.5vmin;
text-align:center;
position: fixed;
left: 50%;
top: 40%;
width: 90%;
transform: translate(-50%, 0%);
background-image: url('/resources/images/background.svg');
background-attachment: fixed;
background-position: center;
background-size: cover;
background-repeat: repeat;
}
input:hover {opacity:0.9;}
input[type=text]{
font-size: 1.5em;
padding: 1.5vmin;
background-color: rgba(0,0,0,0.3);
border: 0;
color: #fff;
margin: 0.8vmin;
width: 50%;
}
button:hover {background-color: #28bd7b;}
button{
font-size: 1.5em;
padding: 1.5vmin;
margin: 0.8vmin;
background-color: #38cd8b;
border-radius: 1.8vmin;
color: #fff;
border: 0;
}
img{
height: 15vmin;
}
</style>
<body>
<a>
<img src='/resources/images/logo.svg'></img><br>
</a>
<input id="room" type="text" onkeypress="checkEnter(event)" value="" placeholder="your room name">
<button onclick = "start(location.href)">Go to room</button>
</body>
<script>
var room = document.getElementById("room");
var stateObj = { foo: "bar" };
room.addEventListener("input", function(e) {
console.log(e.charCode);
history.replaceState(stateObj, "Multiparty Meeting", "/"+room.value);
},true);
room.focus();
function start(target){
location.href;history.replaceState(stateObj, "Multiparty Meeting", "/");
window.location = target;
}
function checkEnter(event){
var x = event.charCode || event.keyCode;
if (x == 13 ) {
start(location.href);
}
}
</script>
</html>

View File

@ -137,7 +137,7 @@ gulp.task('lint', () =>
.pipe(eslint.format()); .pipe(eslint.format());
}); });
gulp.task('lint-fix', function() gulp.task('lint-fix', function()
{ {
return gulp.src(LINTING_FILES) return gulp.src(LINTING_FILES)
.pipe(plumber()) .pipe(plumber())
@ -168,7 +168,7 @@ gulp.task('css', () =>
gulp.task('html', () => gulp.task('html', () =>
{ {
return gulp.src('index.html') return gulp.src('*.html')
.pipe(change(changeHTML)) .pipe(change(changeHTML))
.pipe(gulp.dest(OUTPUT_DIR)); .pipe(gulp.dest(OUTPUT_DIR));
}); });
@ -241,7 +241,7 @@ gulp.task('browser', (done) =>
gulp.task('watch', (done) => gulp.task('watch', (done) =>
{ {
// Watch changes in HTML. // Watch changes in HTML.
gulp.watch([ 'index.html' ], gulp.series( gulp.watch([ '*.html' ], gulp.series(
'html' 'html'
)); ));

View File

@ -9,13 +9,13 @@
align-items: center; align-items: center;
+desktop() { +desktop() {
left: 20px; left: 1.0em;
width: 36px; width: 2.6em;
} }
+mobile() { +mobile() {
left: 10px; left: 0.5em;
width: 32px; width: 2.6em;
} }
> .button { > .button {
@ -34,13 +34,13 @@
justify-content: center; justify-content: center;
+desktop() { +desktop() {
height: 36px; height: 2.5em;
width: 36px; width: 2.5em;
} }
+mobile() { +mobile() {
height: 32px; height: 2.5em;
width: 32px; width: 2.5em;
} }
&.on { &.on {
@ -110,7 +110,7 @@
} }
&.leave-meeting { &.leave-meeting {
background-image: url('/resources/images/leave-meeting.svg'); background-image: url('/resources/images/cancel.svg');
} }
} }
} }

View File

@ -57,7 +57,7 @@ app.all('*', (req, res, next) =>
app.use(dataporten.passport.initialize()); app.use(dataporten.passport.initialize());
app.use(dataporten.passport.session()); app.use(dataporten.passport.session());
app.get('/login', (req, res, next) => app.get('/login', (req, res, next) =>
{ {
dataporten.passport.authenticate('dataporten', { dataporten.passport.authenticate('dataporten', {
state : base64.encode(JSON.stringify({ state : base64.encode(JSON.stringify({
@ -65,12 +65,17 @@ app.get('/login', (req, res, next) =>
peerName : req.query.peerName, peerName : req.query.peerName,
code : utils.random(10) code : utils.random(10)
})) }))
})(req, res, next); })(req, res, next);
}); });
dataporten.setupLogout(app, '/logout'); dataporten.setupLogout(app, '/logout');
app.get('/', function (req, res) {
console.log(req.url);
res.sendFile(`${__dirname}/public/chooseRoom.html`);
})
app.get( app.get(
'/auth-callback', '/auth-callback',
dataporten.passport.authenticate('dataporten', { failureRedirect: '/login' }), dataporten.passport.authenticate('dataporten', { failureRedirect: '/login' }),