From f3a7ba14300ff9bd469c0efbc106d2db8fb74f9b Mon Sep 17 00:00:00 2001 From: tekay <tom.kaesler@mni.thm.de> Date: Mon, 7 Mar 2016 19:37:31 +0100 Subject: [PATCH 1/8] add publication for students (removed isCorrect attr) add method for giving an response. This checks wether: - the response referes to a real answeroption - the response was given while the polling is running (set via session.timer) - the hashtag is active add rough basic view for giving a response as a "student" add route for giving a response --- .../client/js/create_question_view.js | 2 +- .../client/js/displayansweroptions.js | 43 +++++++++++++++ arsnova.click/client/routes.js | 4 ++ .../templates/displayansweroptions.html | 12 +++++ arsnova.click/lib/sessions.js | 4 ++ .../server/publications/answeroptions.js | 11 ++++ arsnova.click/server/startup.js | 2 +- arsnova.click/shared/responses.js | 54 +++++++++++++++++++ 8 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 arsnova.click/client/js/displayansweroptions.js create mode 100644 arsnova.click/client/templates/displayansweroptions.html create mode 100644 arsnova.click/shared/responses.js diff --git a/arsnova.click/client/js/create_question_view.js b/arsnova.click/client/js/create_question_view.js index c6c589bd5..da00be26d 100644 --- a/arsnova.click/client/js/create_question_view.js +++ b/arsnova.click/client/js/create_question_view.js @@ -70,4 +70,4 @@ Template.createQuestionView.events({ "click #previewButton": function () { //Not implemented yet } -});; +}); diff --git a/arsnova.click/client/js/displayansweroptions.js b/arsnova.click/client/js/displayansweroptions.js new file mode 100644 index 000000000..4446cd656 --- /dev/null +++ b/arsnova.click/client/js/displayansweroptions.js @@ -0,0 +1,43 @@ +Template.displayAnswerOptions.onCreated(function () { + this.autorun(() => { + this.subscribe('AnswerOptions.public', Session.get("hashtag")); + }); +}); + +Template.displayAnswerOptions.helpers({ + answerOptions: function () { + return AnswerOptions.find(); + }, + showForwardButton: function () { + return Session.get("showForwardButton"); + } +}); + +Template.displayAnswerOptions.events({ + "click .sendResponse": function (event) { + Meteor.call('Responses.addResponse', { + hashtag: Session.get("hashtag"), + answerOptionNumber: event.target.id, + userNick: Session.get("nick") + }, (err, res) => { + if (err) { + alert(err); + } else { + console.log(res); + if (!res.isCorrect || (res.questionType == "sc")) { + console.log("hiergehtsnichtweiter"); + //TODO Route to responsestatistics + //Router.go("/") + } + else { + if (Session.get("responseCount") === 1) { + Session.set("responseCount", Session.get("responseCount") + 1); + Session.set("showForwardButton", 1); + } else { + Session.set("responseCount", 1); + } + } + } + }); + } +}); \ No newline at end of file diff --git a/arsnova.click/client/routes.js b/arsnova.click/client/routes.js index e7152c5ab..c07ed6321 100755 --- a/arsnova.click/client/routes.js +++ b/arsnova.click/client/routes.js @@ -60,6 +60,10 @@ Router.route('/onpolling', function () { } }); +Router.route('/giveresponse', function () { + this.render('displayAnswerOptions'); +}); + Router.route('/statistics', function () { }); diff --git a/arsnova.click/client/templates/displayansweroptions.html b/arsnova.click/client/templates/displayansweroptions.html new file mode 100644 index 000000000..7768324b8 --- /dev/null +++ b/arsnova.click/client/templates/displayansweroptions.html @@ -0,0 +1,12 @@ +<template name="displayAnswerOptions"> + {{#each answerOptions}} + <div class="row"> + <div id="{{answerOptionNumber}}" class="sendResponse">{{answerText}}</div> + </div> + {{/each}} + {{#if showForwardButton}} + <button id="forwardButton" class="button button-next"> + Zur Auswertung + </button> + {{/if}} +</template> \ No newline at end of file diff --git a/arsnova.click/lib/sessions.js b/arsnova.click/lib/sessions.js index 1bdd6e68d..1ae699883 100755 --- a/arsnova.click/lib/sessions.js +++ b/arsnova.click/lib/sessions.js @@ -19,5 +19,9 @@ Sessions.attachSchema(new SimpleSchema({ type: Number, min: 0, max: 1 + }, + startTime: { + type: String, + optional: true } })); diff --git a/arsnova.click/server/publications/answeroptions.js b/arsnova.click/server/publications/answeroptions.js index 03bbec212..caad5d1c0 100644 --- a/arsnova.click/server/publications/answeroptions.js +++ b/arsnova.click/server/publications/answeroptions.js @@ -16,4 +16,15 @@ Meteor.publish('AnswerOptions.options', function(phashtag) { phashtag: {type: String} }).validate({phashtag}); return AnswerOptions.find({hashtag: phashtag}); +}); + +Meteor.publish('AnswerOptions.public', function(hashtag) { + new SimpleSchema({ + hashtag: {type: String} + }).validate({hashtag}); + return AnswerOptions.find({hashtag: hashtag}, { + fields: { + isCorrect: 0 + } + }); }); \ No newline at end of file diff --git a/arsnova.click/server/startup.js b/arsnova.click/server/startup.js index 06ecb1707..73d0dbd3c 100755 --- a/arsnova.click/server/startup.js +++ b/arsnova.click/server/startup.js @@ -111,7 +111,7 @@ if(Meteor.isServer){ var sessionExample = { hashtag: "wpw", questionText: "I am a question text. This is for testing purpose. Do you understand?", - timer: "180", + timer: "1800000", isReadingConfirmationRequired: 1 }; var answerOptionsExample1 = { diff --git a/arsnova.click/shared/responses.js b/arsnova.click/shared/responses.js new file mode 100644 index 000000000..587ae5092 --- /dev/null +++ b/arsnova.click/shared/responses.js @@ -0,0 +1,54 @@ +Meteor.methods({ + 'Responses.addResponse'(responseDoc) { + var timestamp = new Date().getTime(); + var hashtag = responseDoc.hashtag; + if (Meteor.isServer) { + var hashtagDoc = Hashtags.findOne({ + hashtag: hashtag, + isActive: 1 + }); + if (!doc) { + throw new Meteor.Error('Responses.addResponse', 'There is no such hashtag active in the db') + return; + } else { + var sessionDoc = Sessions.findOne({hashtag: responseDoc.hashtag}); + if (!sessionDoc) { + throw new Meteor.Error('Responses.addResponse', 'No session doc for this hashtag'); + return; + } + var responseTime = timestamp - hashtagDoc.startTime; + if (responseTime <= sessionDoc.timer) { + responseDoc.responseTime = responseTime; + var answerOptionDoc = AnswerOptions.findOne({ + hashtag: hashtag, + answerOptionNumber: parseInt(responseDoc.answerOptionNumber) + }); + if (!answerOptionDoc) { + throw new Meteor.Error('Responses.addResponse', 'There is no answer option with the given answerOptionNumber'); + return; + } + Responses.insert(responseDoc); + var questionType = "polling"; + var correctAnswerCount = AnswerOptions.find({ + hashtag: hashtag, + isCorrect: 1 + }).count(); + if (correctAnswerCount === 1) { + questionType = "sc"; + } else if (correctAnswerCount >= 2) { + questionType = "mc"; + } + var retDoc = { + isCorrect: answerOptionDoc.isCorrect, + questionType: questionType + } + return retDoc; + } + else { + throw new Meteor.Error('Responses.addResponse', 'Response was given out of time range'); + return; + } + } + } + }, +}); \ No newline at end of file -- GitLab From caaf16b2b7d7fc75b34a473535fd81a82fd953e9 Mon Sep 17 00:00:00 2001 From: Tim Strietzel <email@tim-strietzel.de> Date: Tue, 8 Mar 2016 12:03:02 +0100 Subject: [PATCH 2/8] Answeroption buttons with timer (mockup) and letters --- arsnova.click/client/css/memberlist.css | 4 +++ arsnova.click/client/css/voting_view.css | 5 ++++ arsnova.click/client/js/memberlist.js | 4 +++ ...displayansweroptions.js => voting_view.js} | 13 +++++---- arsnova.click/client/routes.js | 6 ++++- .../templates/displayansweroptions.html | 12 --------- .../client/templates/voting_view.html | 27 +++++++++++++++++++ 7 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 arsnova.click/client/css/voting_view.css rename arsnova.click/client/js/{displayansweroptions.js => voting_view.js} (82%) delete mode 100644 arsnova.click/client/templates/displayansweroptions.html create mode 100644 arsnova.click/client/templates/voting_view.html diff --git a/arsnova.click/client/css/memberlist.css b/arsnova.click/client/css/memberlist.css index c74b42623..1054fdb00 100644 --- a/arsnova.click/client/css/memberlist.css +++ b/arsnova.click/client/css/memberlist.css @@ -9,4 +9,8 @@ .learner-list { margin-bottom: 15px; +} + +.button-row { + margin-top: 20px; } \ No newline at end of file diff --git a/arsnova.click/client/css/voting_view.css b/arsnova.click/client/css/voting_view.css new file mode 100644 index 000000000..635d0f2e3 --- /dev/null +++ b/arsnova.click/client/css/voting_view.css @@ -0,0 +1,5 @@ +.btn-answerOption { + margin: 20px 0; + width: 100%; + font-size: 4em; +} \ No newline at end of file diff --git a/arsnova.click/client/js/memberlist.js b/arsnova.click/client/js/memberlist.js index 52f3c5a55..48b91fa11 100644 --- a/arsnova.click/client/js/memberlist.js +++ b/arsnova.click/client/js/memberlist.js @@ -27,7 +27,11 @@ Template.memberlist.events({ 'click .btn-less-learners': function () { Session.set("LearnerCountOverride", false); calculateButtonCount(); + }, + 'click #memberlist-go': function () { + Router.go("/votingview"); } + }); Template.memberlist.onRendered(function () { diff --git a/arsnova.click/client/js/displayansweroptions.js b/arsnova.click/client/js/voting_view.js similarity index 82% rename from arsnova.click/client/js/displayansweroptions.js rename to arsnova.click/client/js/voting_view.js index 4446cd656..92725794c 100644 --- a/arsnova.click/client/js/displayansweroptions.js +++ b/arsnova.click/client/js/voting_view.js @@ -1,19 +1,23 @@ -Template.displayAnswerOptions.onCreated(function () { +Template.votingview.onCreated(function () { this.autorun(() => { this.subscribe('AnswerOptions.public', Session.get("hashtag")); }); }); -Template.displayAnswerOptions.helpers({ +Template.votingview.helpers({ answerOptions: function () { return AnswerOptions.find(); }, showForwardButton: function () { + return true; return Session.get("showForwardButton"); + }, + answerOptionLetter: function (number) { + return String.fromCharCode((number.hash.number + 65)); } }); -Template.displayAnswerOptions.events({ +Template.votingview.events({ "click .sendResponse": function (event) { Meteor.call('Responses.addResponse', { hashtag: Session.get("hashtag"), @@ -28,8 +32,7 @@ Template.displayAnswerOptions.events({ console.log("hiergehtsnichtweiter"); //TODO Route to responsestatistics //Router.go("/") - } - else { + } else { if (Session.get("responseCount") === 1) { Session.set("responseCount", Session.get("responseCount") + 1); Session.set("showForwardButton", 1); diff --git a/arsnova.click/client/routes.js b/arsnova.click/client/routes.js index c07ed6321..ad825cb00 100755 --- a/arsnova.click/client/routes.js +++ b/arsnova.click/client/routes.js @@ -52,6 +52,10 @@ Router.route('/memberlist', function () { this.render('memberlist'); }); +Router.route('/votingview', function () { + this.render('votingview'); +}); + Router.route('/onpolling', function () { if (Session.get("isOwner")) { @@ -61,7 +65,7 @@ Router.route('/onpolling', function () { }); Router.route('/giveresponse', function () { - this.render('displayAnswerOptions'); + this.render('votingview'); }); Router.route('/statistics', function () { diff --git a/arsnova.click/client/templates/displayansweroptions.html b/arsnova.click/client/templates/displayansweroptions.html deleted file mode 100644 index 7768324b8..000000000 --- a/arsnova.click/client/templates/displayansweroptions.html +++ /dev/null @@ -1,12 +0,0 @@ -<template name="displayAnswerOptions"> - {{#each answerOptions}} - <div class="row"> - <div id="{{answerOptionNumber}}" class="sendResponse">{{answerText}}</div> - </div> - {{/each}} - {{#if showForwardButton}} - <button id="forwardButton" class="button button-next"> - Zur Auswertung - </button> - {{/if}} -</template> \ No newline at end of file diff --git a/arsnova.click/client/templates/voting_view.html b/arsnova.click/client/templates/voting_view.html new file mode 100644 index 000000000..7535f36cb --- /dev/null +++ b/arsnova.click/client/templates/voting_view.html @@ -0,0 +1,27 @@ +<template name="votingview"> + + {{>titel titelText="0:12 Minuten"}} + + <div class="row answer-row"> + + {{#each answerOptions}} + <div class="col-xs-6 col-sm-4 col-md-3"> + <button id="{{answerOptionNumber}}" class="sendResponse btn btn-grey btn-answerOption"> + {{answerOptionLetter number=answerOptionNumber}} + </button> + + </div> + {{/each}} + </div> + + <div class="row"> + {{#if showForwardButton}} + <button id="forwardButton" class="button button-next"> + Zur Auswertung + </button> + {{/if}} + </div> + +</template> + + -- GitLab From 27d6d25f41ff832493defe02488af9dc294f676f Mon Sep 17 00:00:00 2001 From: Tim Strietzel <email@tim-strietzel.de> Date: Tue, 8 Mar 2016 14:23:51 +0100 Subject: [PATCH 3/8] Show Modal Question overlay & include button functionality / also updated splashscreen class with noautorun feature --- arsnova.click/client/css/voting_view.css | 17 +++++++-- arsnova.click/client/js/splashscreen.js | 22 +++++------ arsnova.click/client/js/voting_view.js | 22 ++++++++++- .../client/templates/voting_view.html | 38 ++++++++++++++++--- 4 files changed, 74 insertions(+), 25 deletions(-) diff --git a/arsnova.click/client/css/voting_view.css b/arsnova.click/client/css/voting_view.css index 635d0f2e3..8815b02a6 100644 --- a/arsnova.click/client/css/voting_view.css +++ b/arsnova.click/client/css/voting_view.css @@ -1,5 +1,14 @@ +.btn-answerFont { + font-size: 4em; +} + .btn-answerOption { - margin: 20px 0; - width: 100%; - font-size: 4em; -} \ No newline at end of file + margin: 23px 0; + width: 100%; +} + +.answer-row { + /*position: fixed; + bottom: 10px;*/ + background-color: steelblue; +} diff --git a/arsnova.click/client/js/splashscreen.js b/arsnova.click/client/js/splashscreen.js index 858cc0090..f747a7c32 100644 --- a/arsnova.click/client/js/splashscreen.js +++ b/arsnova.click/client/js/splashscreen.js @@ -12,6 +12,7 @@ Template.splashscreen.rendered = function () { }); } /* + if (templateParams.timerClose) { if (isNaN(templateParams.timerClose)) { templateParams.timerClose = 5000; @@ -23,19 +24,10 @@ Template.splashscreen.rendered = function () { }, templateParams.timerClose); }*/ - splashscreen.modal('show'); - /*var wpwSessionData = { - questionText: "I'm a question text. This is for testing purpose. Do you understand?", - timer: 1800000, - isReadingConfirmationRequired: 0 - }; - var testingSessionData = { - questionText: "Do you like this course?", - timer: 8000000, - isReadingConfirmationRequired: 0 - }; - localStorage.setItem("wpw", JSON.stringify(wpwSessionData)); - localStorage.setItem("testing", JSON.stringify(testingSessionData));*/ + if (templateParams.noAutorun) { + splashscreen.modal({show: false}); + } else { + splashscreen.modal('show'); }; Template.splashscreen.helpers({ @@ -45,6 +37,10 @@ Template.splashscreen.helpers({ } }); +showSplashscreen = function () { + $('.js-splashscreen').modal(); +}; + closeSplashscreen = function () { $('.js-splashscreen').modal("hide"); }; diff --git a/arsnova.click/client/js/voting_view.js b/arsnova.click/client/js/voting_view.js index 92725794c..1cad4f612 100644 --- a/arsnova.click/client/js/voting_view.js +++ b/arsnova.click/client/js/voting_view.js @@ -1,6 +1,7 @@ Template.votingview.onCreated(function () { this.autorun(() => { this.subscribe('AnswerOptions.public', Session.get("hashtag")); + this.subscribe('Sessions.question', Session.get("hashtag")); }); }); @@ -9,7 +10,6 @@ Template.votingview.helpers({ return AnswerOptions.find(); }, showForwardButton: function () { - return true; return Session.get("showForwardButton"); }, answerOptionLetter: function (number) { @@ -18,6 +18,9 @@ Template.votingview.helpers({ }); Template.votingview.events({ + "click #js-btn-showQuestionModal": function () { + showSplashscreen(); + }, "click .sendResponse": function (event) { Meteor.call('Responses.addResponse', { hashtag: Session.get("hashtag"), @@ -43,4 +46,19 @@ Template.votingview.events({ } }); } -}); \ No newline at end of file +}); + +Template.questionContentSplash.helpers({ + questionContent: function () { + mySessions = Sessions.find(); + console.log(mySessions); + return mySessions; + } +}); + +Template.questionContentSplash.events({ + "click #js-btn-hideQuestionModal": function () { + closeSplashscreen(); + } +}); + diff --git a/arsnova.click/client/templates/voting_view.html b/arsnova.click/client/templates/voting_view.html index 7535f36cb..e6f5d62eb 100644 --- a/arsnova.click/client/templates/voting_view.html +++ b/arsnova.click/client/templates/voting_view.html @@ -6,22 +6,48 @@ {{#each answerOptions}} <div class="col-xs-6 col-sm-4 col-md-3"> - <button id="{{answerOptionNumber}}" class="sendResponse btn btn-grey btn-answerOption"> + <button id="{{answerOptionNumber}}" class="sendResponse btn btn-grey btn-answerOption btn-answerFont"> {{answerOptionLetter number=answerOptionNumber}} </button> - </div> {{/each}} </div> <div class="row"> - {{#if showForwardButton}} - <button id="forwardButton" class="button button-next"> - Zur Auswertung + <div class="col-xs-4"> + <button type="button" class="btn btn-info btn-lg btn-answerOption"> + <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span> Antworten + </button> + </div> + + <!-- glyphicon glyphicon-th-large --> + + <div class="col-xs-4"> + <button id="js-btn-showQuestionModal" type="button" class="btn btn-info btn-lg btn-answerOption"> + <span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> Frage + </button> + </div> + + + <div class="col-xs-4"> + <button type="button" class="btn btn-success btn-lg btn-answerOption"> + <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> Absenden </button> - {{/if}} + </div> + </div> + {{> splashscreen lazyClose="true" noAutorun="true" headername="Die Frage:" templateName="questionContentSplash" type="splash-screen-show-question"}} +</template> + +<template name="questionContentSplash"> + {{#each questionContent}} + <div>{{questionText}}</div> + {{/each}} + <button id="js-btn-hideQuestionModal" type="button" class="btn btn-success btn-answerOption btn-lg "> + <span class="glyphicon glyphicon-ok" aria-hidden="true"></span> + Fenster schließen + </button> </template> -- GitLab From 374e6ec9e64ef70b272980e60cd2445168fc3308 Mon Sep 17 00:00:00 2001 From: Michael Sann <michael.sann92@gmail.com> Date: Tue, 8 Mar 2016 14:07:00 +0100 Subject: [PATCH 4/8] first version of timer --- arsnova.click/client/js/voting_view.js | 12 ++++++++++++ arsnova.click/client/templates/voting_view.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arsnova.click/client/js/voting_view.js b/arsnova.click/client/js/voting_view.js index 1cad4f612..f98a85a01 100644 --- a/arsnova.click/client/js/voting_view.js +++ b/arsnova.click/client/js/voting_view.js @@ -5,6 +5,14 @@ Template.votingview.onCreated(function () { }); }); +var countdown = new ReactiveCountdown(30); + +countdown.start(function() { + + // do something when this is completed + +}); + Template.votingview.helpers({ answerOptions: function () { return AnswerOptions.find(); @@ -14,7 +22,11 @@ Template.votingview.helpers({ }, answerOptionLetter: function (number) { return String.fromCharCode((number.hash.number + 65)); + }, + getCountdown: function() { + return countdown.get(); } + }); Template.votingview.events({ diff --git a/arsnova.click/client/templates/voting_view.html b/arsnova.click/client/templates/voting_view.html index e6f5d62eb..00ff4534b 100644 --- a/arsnova.click/client/templates/voting_view.html +++ b/arsnova.click/client/templates/voting_view.html @@ -1,6 +1,6 @@ <template name="votingview"> - {{>titel titelText="0:12 Minuten"}} + <div class="titel">{{getCountdown}} seconds left!</div> <div class="row answer-row"> -- GitLab From a41c0c41285bbe4880d4ede1ef39342462e5f9de Mon Sep 17 00:00:00 2001 From: Tim Strietzel <email@tim-strietzel.de> Date: Tue, 8 Mar 2016 14:29:57 +0100 Subject: [PATCH 5/8] Splashscreen Question --- arsnova.click/client/css/createTimerView.css | 7 +- .../client/css/default/default_classes.css | 130 ++++++++++++++++ .../client/css/default/keyframes.css | 48 ++++++ arsnova.click/client/js/createTimerView.js | 44 +++--- .../client/js/create_question_view.js | 3 +- .../client/js/createansweroptions.js | 2 +- arsnova.click/client/js/home.js | 2 +- arsnova.click/client/js/localStorage.js | 147 +++++++++--------- arsnova.click/client/js/nick.js | 11 +- .../client/js/readconfirmationrequired.js | 8 +- arsnova.click/client/js/voting_view.js | 4 +- arsnova.click/shared/db.js | 4 +- arsnova.click/shared/sessions.js | 15 +- 13 files changed, 306 insertions(+), 119 deletions(-) create mode 100644 arsnova.click/client/css/default/default_classes.css create mode 100644 arsnova.click/client/css/default/keyframes.css diff --git a/arsnova.click/client/css/createTimerView.css b/arsnova.click/client/css/createTimerView.css index 81b0baabe..37870fee6 100644 --- a/arsnova.click/client/css/createTimerView.css +++ b/arsnova.click/client/css/createTimerView.css @@ -1,14 +1,15 @@ .timer-input { height: 50px; font-size: 1.5em; - width:100%; + width: 100%; } + .text-center { - text-align:center; + text-align: center; } .text-white { - color:#ffffff; + color: #ffffff; font-family: Georgia, serif; } diff --git a/arsnova.click/client/css/default/default_classes.css b/arsnova.click/client/css/default/default_classes.css new file mode 100644 index 000000000..9d69dc395 --- /dev/null +++ b/arsnova.click/client/css/default/default_classes.css @@ -0,0 +1,130 @@ +/* todo: we have to define the background-colors */ +.center-vertical { + position: relative; + top: 50%; + /* TODO: IE 8 and Opera 8 doesn't support translateY*/ + transform: translateY(-50%); } + +.round-corners, .button { + border-radius: 10px; } + +.button-shadow, .button { + box-shadow: 1px 1px 5px black; } + +.input-field { + height: 50px; + font-size: 1.5em; + width: 100%; + padding-left: 10px; + padding-right: 10px; } + +.input-field-bg-color, .input-field { + background-color: gold; + border: none; } + +.default-yellow-text-color { + color: gold; } + +.button { + height: 50px; + width: 100%; + border: none; + white-space: nowrap; } + +.input-group-letter { + font-size: 2em; + font-weight: 800; + color: darkslategrey; } + +.button:hover, .button:active:focus { + box-shadow: none; } + +.button-next, .button-success { + background-color: green; + color: white; } + +.button-warning, .button-back { + background-color: firebrick; + color: white; } + +.button-purple { + background-color: rebeccapurple; + color: white; } + +.button-default { + background-color: grey; + color: white; } + +.distance-top { + margin-top: 20px; } + +/* + * center's the placeholder + */ +.placeholder-align-center::-webkit-input-placeholder, .input-field::-webkit-input-placeholder { + text-align: center; } + +.placeholder-align-center:-moz-placeholder, .input-field:-moz-placeholder { + /* Firefox 18- */ + text-align: center; } + +.placeholder-align-center::-moz-placeholder, .input-field::-moz-placeholder { + /* Firefox 19+ */ + text-align: center; } + +.placeholder-align-center:-ms-input-placeholder, .input-field:-ms-input-placeholder { + text-align: center; } + +.hover-underline:hover { + text-decoration: underline; } + +.fixed-bottom { + position: fixed; + bottom: 25px; + width: 100%; + left: 0; + padding: 30px; } + +.content-with-navigation-buttons { + max-height: calc(100% - 105px); + overflow-y: auto; + padding-bottom: 10px; } + +.textarea { + width: 100%; + background-color: gold; + font-size: 1.5em; + outline: none; + resize: none; + padding: 10px; } + +.check-mark-checked { + color: #00882a; + font-size: 1.3em; + width: 30px; } + +.check-mark-unchecked { + color: #aaaaaa; + width: 30px; } + +.btn-add-remove-ans_opt { + line-height: 100%; + width: 50px !important; + height: 50px !important; + background-color: #aaaaaa; } + +.color-changing-ars, .color-changing-nova, .color-changing-click { + width: 100px; + height: 100px; + animation-duration: 7s; + animation-iteration-count: infinite; + font-weight: bold; } + +.color-changing-ars { + animation-name: colorChangingArs; } + +.color-changing-nova { + animation-name: colorChangingNova; } + +.color-changing-click { + animation-name: colorChangingClick; } diff --git a/arsnova.click/client/css/default/keyframes.css b/arsnova.click/client/css/default/keyframes.css new file mode 100644 index 000000000..3c372cfd3 --- /dev/null +++ b/arsnova.click/client/css/default/keyframes.css @@ -0,0 +1,48 @@ +/* todo: we have to define the background-colors */ +@keyframes colorChangingArs { + 0% { + color: white; } + + 25% { + color: firebrick; } + + 50% { + color: rebeccapurple; } + + 75% { + color: gold; } + + 100% { + color: white; } } + +@keyframes colorChangingNova { + 0% { + color: gold; } + + 25% { + color: white; } + + 50% { + color: firebrick; } + + 75% { + color: rebeccapurple; } + + 100% { + color: gold; } } + +@keyframes colorChangingClick { + 0% { + color: rebeccapurple; } + + 25% { + color: gold; } + + 50% { + color: white; } + + 75% { + color: firebrick; } + + 100% { + color: rebeccapurple; } } diff --git a/arsnova.click/client/js/createTimerView.js b/arsnova.click/client/js/createTimerView.js index 67853728a..00c6d6c60 100644 --- a/arsnova.click/client/js/createTimerView.js +++ b/arsnova.click/client/js/createTimerView.js @@ -17,30 +17,30 @@ Template.createTimerView.rendered = function () { }; Template.createTimerView.helpers({ - /* timer:function(){ - //For testing purposes - //Session.set("hashtag","wpw"); - //window.localStorage.setItem("privateKey", "thisismypriv"); + /* timer:function(){ + //For testing purposes + //Session.set("hashtag","wpw"); + //window.localStorage.setItem("privateKey", "thisismypriv"); - const currentSession = Sessions.findOne({hashtag:Session.get("hashtag")}); + const currentSession = Sessions.findOne({hashtag:Session.get("hashtag")}); - if(!currentSession || !currentSession.timer) { - return ""; - } - return currentSession.timer; - },*/ + if(!currentSession || !currentSession.timer) { + return ""; + } + return currentSession.timer; + },*/ slider: function () { return Session.get("slider"); } }); Template.createTimerView.events({ - "click #forwardButton":function(){ + "click #forwardButton": function () { const timer = Session.get("slider"); Meteor.call("Sessions.setTimer", { - privateKey:localData.getPrivateKey(), - hashtag:Session.get("hashtag"), - timer:timer + privateKey: localData.getPrivateKey(), + hashtag: Session.get("hashtag"), + timer: timer }, (err, res) => { if (err) { alert(err); @@ -50,21 +50,21 @@ Template.createTimerView.events({ } }); }, - "click #backButton":function(){ + "click #backButton": function () { const timer = Session.get("slider"); - if(!isNaN(timer) && timer > 0) { + if (!isNaN(timer) && timer > 0) { Meteor.call("Sessions.setTimer", { - privateKey:localData.getPrivateKey(), - hashtag:Session.get("hashtag"), - timer:timer + privateKey: localData.getPrivateKey(), + hashtag: Session.get("hashtag"), + timer: timer }, (err, res) => { if (err) { alert(err); } else { localData.addTimer(Session.get("hashtag"), timer); - Router.go("/answeroptions"); - } - }); + Router.go("/answeroptions"); + } + }); } } diff --git a/arsnova.click/client/js/create_question_view.js b/arsnova.click/client/js/create_question_view.js index da00be26d..53bd3e7b1 100644 --- a/arsnova.click/client/js/create_question_view.js +++ b/arsnova.click/client/js/create_question_view.js @@ -35,8 +35,7 @@ Template.createQuestionView.events({ var questionText = event.currentTarget.value; if (questionText.length > 4) { $("#forwardButton").removeAttr("disabled"); - } - else { + } else { $("#forwardButton").attr("disabled", "disabled"); } }, diff --git a/arsnova.click/client/js/createansweroptions.js b/arsnova.click/client/js/createansweroptions.js index 5aa6c09c0..eceb58b30 100644 --- a/arsnova.click/client/js/createansweroptions.js +++ b/arsnova.click/client/js/createansweroptions.js @@ -29,7 +29,7 @@ Template.createAnswerOptions.events({ "click #addAnswerOption": function () { if (AnswerOptions.find().count() < 26) { const answerOption = { - privateKey: localData.getPrivateKey(), + privateKey: localData.getPrivateKey(), hashtag: Session.get("hashtag"), answerText: "", answerOptionNumber: (AnswerOptions.find().count()), diff --git a/arsnova.click/client/js/home.js b/arsnova.click/client/js/home.js index 9b2ab6cdc..c701f5e3b 100644 --- a/arsnova.click/client/js/home.js +++ b/arsnova.click/client/js/home.js @@ -1,6 +1,6 @@ Template.home.helpers({ existingHashtagsAvailable: function () { - if (localData.getAllHashtags().length == 0){ + if (localData.getAllHashtags().length == 0) { return false; } return true; diff --git a/arsnova.click/client/js/localStorage.js b/arsnova.click/client/js/localStorage.js index be896f692..e89c34e01 100644 --- a/arsnova.click/client/js/localStorage.js +++ b/arsnova.click/client/js/localStorage.js @@ -2,40 +2,40 @@ * Created by Kevin on 07.03.16. */ localData = { - getAllHashtags : function(){ + getAllHashtags: function () { const hashtagString = localStorage.getItem("hashtags"); - if(!hashtagString) { + if (!hashtagString) { localStorage.setItem("hashtags", JSON.stringify([])); return []; } return JSON.parse(hashtagString); }, - containsHashtag : function(hashtag){ - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + containsHashtag: function (hashtag) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const hashtagString = localStorage.getItem("hashtags"); - if(!hashtagString) { + if (!hashtagString) { return false; } return $.inArray(hashtag, JSON.parse(hashtagString)); }, - addHashtag : function(hashtag){ - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + addHashtag: function (hashtag) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const hashtagString = localStorage.getItem("hashtags"); - if(!hashtagString) { + if (!hashtagString) { localStorage.setItem("hashtags", JSON.stringify([hashtag])); localStorage.setItem(hashtag, JSON.stringify({ - hashtag:hashtag, - questionText:"", - timer:20, - isReadingConfirmationRequired:1, - answers:[] + hashtag: hashtag, + questionText: "", + timer: 20, + isReadingConfirmationRequired: 1, + answers: [] })); return; } @@ -53,30 +53,30 @@ localData = { })); }, - updateIsReadingConfirmationRequired : function(hashtag, isReadingConfirmationRequired){ - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + updateIsReadingConfirmationRequired: function (hashtag, isReadingConfirmationRequired) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const hashtagString = localStorage.getItem(hashtag); - if (!hashtagString){ + if (!hashtagString) { return; } var hashtagData = JSON.parse(hashtagString); localStorage.setItem(hashtag, JSON.stringify({ - hashtag:hashtag, - questionText:hashtagData.questionText, - timer:hashtagData.timer, - isReadingConfirmationRequired:isReadingConfirmationRequired, - answers:hashtagData.answers + hashtag: hashtag, + questionText: hashtagData.questionText, + timer: hashtagData.timer, + isReadingConfirmationRequired: isReadingConfirmationRequired, + answers: hashtagData.answers })); }, - addQuestion : function(hashtag, question) { - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + addQuestion: function (hashtag, question) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const sessionDataString = localStorage.getItem(hashtag); - if(!sessionDataString) { + if (!sessionDataString) { return; } const sessionData = JSON.parse(sessionDataString); @@ -84,12 +84,12 @@ localData = { localStorage.setItem(hashtag, JSON.stringify(sessionData)); }, - addTimer : function(hashtag, timer) { - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + addTimer: function (hashtag, timer) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const sessionDataString = localStorage.getItem(hashtag); - if(!sessionDataString) { + if (!sessionDataString) { return; } const sessionData = JSON.parse(sessionDataString); @@ -97,12 +97,12 @@ localData = { localStorage.setItem(hashtag, JSON.stringify(sessionData)); }, - addAnswers : function(answer){ - if(!answer.hashtag || answer.hashtag === "hashtags" || answer.hashtag === "privateKey") { + addAnswers: function (answer) { + if (!answer.hashtag || answer.hashtag === "hashtags" || answer.hashtag === "privateKey") { return; } const sessionDataString = localStorage.getItem(answer.hashtag); - if(!sessionDataString) { + if (!sessionDataString) { return; } const sessionData = JSON.parse(sessionDataString); @@ -110,30 +110,30 @@ localData = { localStorage.setItem(answer.hashtag, JSON.stringify(sessionData)); }, - reenterSession : function(hashtag){ - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + reenterSession: function (hashtag) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const sessionDataString = localStorage.getItem(hashtag); - if(!sessionDataString) { + if (!sessionDataString) { return; } const sessionData = JSON.parse(sessionDataString); - if(!(typeof sessionData) === "object") { + if (!(typeof sessionData) === "object") { return; } Meteor.call("Sessions.setQuestion", { - privateKey:localStorage.getItem("privateKey"), - hashtag:hashtag, - questionText:sessionData.questionText + privateKey: localStorage.getItem("privateKey"), + hashtag: hashtag, + questionText: sessionData.questionText }); Meteor.call("Sessions.updateIsReadConfirmationRequired", { - privateKey:localStorage.getItem("privateKey"), - hashtag:hashtag, - isReadingConfirmationRequired:sessionData.isReadingConfirmationRequired + privateKey: localStorage.getItem("privateKey"), + hashtag: hashtag, + isReadingConfirmationRequired: sessionData.isReadingConfirmationRequired }); /* @@ -146,53 +146,53 @@ localData = { }); */ - $.each(sessionData.answers, function(key, value){ + $.each(sessionData.answers, function (key, value) { Meteor.call("AnswerOptions.addOption", { - privateKey:localStorage.getItem("privateKey"), - hashtag:hashtag, - answerText:value.answerText, - answerOptionNumber:value.answerOptionNumber, - isCorrect:value.isCorrect + privateKey: localStorage.getItem("privateKey"), + hashtag: hashtag, + answerText: value.answerText, + answerOptionNumber: value.answerOptionNumber, + isCorrect: value.isCorrect }); }); }, - deleteAnswerOption : function(hashtag, answerOptionsNumber){ - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + deleteAnswerOption: function (hashtag, answerOptionsNumber) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const sessionDataString = localStorage.getItem(hashtag); - if(!sessionDataString) { + if (!sessionDataString) { return; } const sessionData = JSON.parse(sessionDataString); - if(!(typeof sessionData) === "object") { + if (!(typeof sessionData) === "object") { return; } - sessionData.answers = $.grep(sessionData.answers, function(value){ + sessionData.answers = $.grep(sessionData.answers, function (value) { return value.answerOptionNumber != answerOptionsNumber; }); localStorage.setItem(hashtag, JSON.stringify(sessionData)); }, - updateAnswerText : function(hashtag, answerOptionNumber, answerText, isCorrect) { - if(!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { + updateAnswerText: function (hashtag, answerOptionNumber, answerText, isCorrect) { + if (!hashtag || hashtag === "hashtags" || hashtag === "privateKey") { return; } const sessionDataString = localStorage.getItem(hashtag); - if(!sessionDataString) { + if (!sessionDataString) { return; } const sessionData = JSON.parse(sessionDataString); - if(!(typeof sessionData) === "object") { + if (!(typeof sessionData) === "object") { return; } - $.each(sessionData.answers, function(key, value){ - if(value.answerOptionNumber === answerOptionNumber){ + $.each(sessionData.answers, function (key, value) { + if (value.answerOptionNumber === answerOptionNumber) { value.answerText = answerText; value.isCorrect = isCorrect; } @@ -201,7 +201,7 @@ localData = { localStorage.setItem(hashtag, JSON.stringify(sessionData)); }, - initializePrivateKey : function() { + initializePrivateKey: function () { /* TODO: Generate privateKey */ @@ -210,29 +210,32 @@ localData = { } }, - getPrivateKey : function() { + getPrivateKey: function () { return localStorage.getItem("privateKey"); }, - createTestData : function() { - if(!localStorage.getItem("wpw")) { + createTestData: function () { + if (!localStorage.getItem("wpw")) { localStorage.setItem("wpw", JSON.stringify({ hashtag: "wpw", questionText: "I am a question text. This is for testing purpose. Do you understand?", timer: 180000, isReadingConfirmationRequired: 1, - answers: [{ - hashtag: "wpw", - answerText: "Ja", - answerOptionNumber: 0, - isCorrect: 1 - }, { - hashtag: "wpw", - answerText: "Nein", - answerOptionNumber: 1, - isCorrect: 0 - }] + answers: [ + { + hashtag: "wpw", + answerText: "Ja", + answerOptionNumber: 0, + isCorrect: 1 + }, + { + hashtag: "wpw", + answerText: "Nein", + answerOptionNumber: 1, + isCorrect: 0 + } + ] })); localStorage.setItem("hashtags", JSON.stringify(["wpw"])); } diff --git a/arsnova.click/client/js/nick.js b/arsnova.click/client/js/nick.js index 94138a3e8..93c67814f 100644 --- a/arsnova.click/client/js/nick.js +++ b/arsnova.click/client/js/nick.js @@ -5,14 +5,16 @@ Template.nick.onCreated(function () { }); Template.nick.onRendered(function () { - $("#forwardButton").attr("disabled", "disabled"); + $("#forwardButton").attr("disabled", "disabled"); }); Template.nick.events({ "click #forwardButton": function () { var nickname = $("#nickname-input-field").val(); - Meteor.call('MemberList.addLearner', {hashtag: Session.get("hashtag"), nick: nickname}, - (err, res) => { + Meteor.call('MemberList.addLearner', { + hashtag: Session.get("hashtag"), + nick: nickname + }, (err, res) => { if (err) { alert(err); } else { @@ -29,8 +31,7 @@ Template.nick.events({ var currentNickName = event.currentTarget.value; if (currentNickName.length > 2) { $("#forwardButton").removeAttr("disabled"); - } - else { + } else { $("#forwardButton").attr("disabled", "disabled"); } var member = MemberList.findOne({nick: currentNickName}); diff --git a/arsnova.click/client/js/readconfirmationrequired.js b/arsnova.click/client/js/readconfirmationrequired.js index 27ae90e15..6cfeaaad2 100644 --- a/arsnova.click/client/js/readconfirmationrequired.js +++ b/arsnova.click/client/js/readconfirmationrequired.js @@ -17,7 +17,7 @@ Template.readconfirmationrequired.helpers({ Template.readconfirmationrequired.events({ "click #forwardButton": function () { - localData.updateIsReadingConfirmationRequired(Session.get("hashtag"), Sessions.findOne({hashtag:Session.get("hashtag")}).isReadingConfirmationRequired); + localData.updateIsReadingConfirmationRequired(Session.get("hashtag"), Sessions.findOne({hashtag: Session.get("hashtag")}).isReadingConfirmationRequired); Router.go("/memberlist"); }, "click #backButton": function () { @@ -31,7 +31,11 @@ Template.readconfirmationrequired.events({ event.preventDefault(); var newVal = Sessions.findOne({hashtag:Session.get("hashtag")}).isReadingConfirmationRequired ? 0 : 1; - Meteor.call("Sessions.updateIsReadConfirmationRequired", {privateKey:localData.getPrivateKey(), hashtag:Session.get("hashtag"), isReadingConfirmationRequired:newVal}); + Meteor.call("Sessions.updateIsReadConfirmationRequired", { + privateKey: localData.getPrivateKey(), + hashtag: Session.get("hashtag"), + isReadingConfirmationRequired: newVal + }); $('#isReadConfirmationRequiredButton').toggleClass("down"); } diff --git a/arsnova.click/client/js/voting_view.js b/arsnova.click/client/js/voting_view.js index f98a85a01..5304f4c87 100644 --- a/arsnova.click/client/js/voting_view.js +++ b/arsnova.click/client/js/voting_view.js @@ -7,7 +7,7 @@ Template.votingview.onCreated(function () { var countdown = new ReactiveCountdown(30); -countdown.start(function() { +countdown.start(function () { // do something when this is completed @@ -23,7 +23,7 @@ Template.votingview.helpers({ answerOptionLetter: function (number) { return String.fromCharCode((number.hash.number + 65)); }, - getCountdown: function() { + getCountdown: function () { return countdown.get(); } diff --git a/arsnova.click/shared/db.js b/arsnova.click/shared/db.js index 970117687..1a458149b 100644 --- a/arsnova.click/shared/db.js +++ b/arsnova.click/shared/db.js @@ -1,3 +1 @@ -Meteor.methods({ - -}); \ No newline at end of file +Meteor.methods({}); \ No newline at end of file diff --git a/arsnova.click/shared/sessions.js b/arsnova.click/shared/sessions.js index 61a6764c2..cd38b6d8f 100644 --- a/arsnova.click/shared/sessions.js +++ b/arsnova.click/shared/sessions.js @@ -59,7 +59,7 @@ Meteor.methods({ } }, - "Sessions.setTimer": function({privateKey, hashtag, timer}){ + "Sessions.setTimer": function ({privateKey, hashtag, timer}) { new SimpleSchema({ timer: { type: Number, @@ -67,14 +67,17 @@ Meteor.methods({ } }).validate({timer: timer}); - const hashItem = Hashtags.findOne({hashtag:hashtag, privateKey:privateKey}); + const hashItem = Hashtags.findOne({ + hashtag: hashtag, + privateKey: privateKey + }); - if(hashItem) { - const session = Sessions.findOne({hashtag:hashtag}); - if(!session) { + if (hashItem) { + const session = Sessions.findOne({hashtag: hashtag}); + if (!session) { throw new Meteor.Error('Sessions.setTimer: no access to session'); } else { - Sessions.update(session._id, {$set: {timer: timer}}, function(error) { + Sessions.update(session._id, {$set: {timer: timer}}, function (error) { if (error) { throw new Meteor.Error('Sessions.updateIsReadConfirmationRequired', error); } -- GitLab From 5a675e3e4dd6d2c39cc21fba7b22a749136b155e Mon Sep 17 00:00:00 2001 From: Christopher Fullarton <trayhem@gmail.com> Date: Tue, 8 Mar 2016 15:35:15 +0100 Subject: [PATCH 6/8] Remove timerview components, update title of voting view template --- arsnova.click/client/css/createTimerView.css | 22 --- .../client/css/default/default_classes.css | 130 ------------------ .../client/css/default/keyframes.css | 48 ------- arsnova.click/client/js/createTimerView.js | 71 ---------- arsnova.click/client/js/voting_view.js | 2 +- .../client/templates/voting_view.html | 2 +- 6 files changed, 2 insertions(+), 273 deletions(-) delete mode 100644 arsnova.click/client/css/createTimerView.css delete mode 100644 arsnova.click/client/css/default/default_classes.css delete mode 100644 arsnova.click/client/css/default/keyframes.css delete mode 100644 arsnova.click/client/js/createTimerView.js diff --git a/arsnova.click/client/css/createTimerView.css b/arsnova.click/client/css/createTimerView.css deleted file mode 100644 index 37870fee6..000000000 --- a/arsnova.click/client/css/createTimerView.css +++ /dev/null @@ -1,22 +0,0 @@ -.timer-input { - height: 50px; - font-size: 1.5em; - width: 100%; -} - -.text-center { - text-align: center; -} - -.text-white { - color: #ffffff; - font-family: Georgia, serif; -} - -#slider { - margin-top: 14px; -} - -.slider-timer-input { - text-align: center; -} \ No newline at end of file diff --git a/arsnova.click/client/css/default/default_classes.css b/arsnova.click/client/css/default/default_classes.css deleted file mode 100644 index 9d69dc395..000000000 --- a/arsnova.click/client/css/default/default_classes.css +++ /dev/null @@ -1,130 +0,0 @@ -/* todo: we have to define the background-colors */ -.center-vertical { - position: relative; - top: 50%; - /* TODO: IE 8 and Opera 8 doesn't support translateY*/ - transform: translateY(-50%); } - -.round-corners, .button { - border-radius: 10px; } - -.button-shadow, .button { - box-shadow: 1px 1px 5px black; } - -.input-field { - height: 50px; - font-size: 1.5em; - width: 100%; - padding-left: 10px; - padding-right: 10px; } - -.input-field-bg-color, .input-field { - background-color: gold; - border: none; } - -.default-yellow-text-color { - color: gold; } - -.button { - height: 50px; - width: 100%; - border: none; - white-space: nowrap; } - -.input-group-letter { - font-size: 2em; - font-weight: 800; - color: darkslategrey; } - -.button:hover, .button:active:focus { - box-shadow: none; } - -.button-next, .button-success { - background-color: green; - color: white; } - -.button-warning, .button-back { - background-color: firebrick; - color: white; } - -.button-purple { - background-color: rebeccapurple; - color: white; } - -.button-default { - background-color: grey; - color: white; } - -.distance-top { - margin-top: 20px; } - -/* - * center's the placeholder - */ -.placeholder-align-center::-webkit-input-placeholder, .input-field::-webkit-input-placeholder { - text-align: center; } - -.placeholder-align-center:-moz-placeholder, .input-field:-moz-placeholder { - /* Firefox 18- */ - text-align: center; } - -.placeholder-align-center::-moz-placeholder, .input-field::-moz-placeholder { - /* Firefox 19+ */ - text-align: center; } - -.placeholder-align-center:-ms-input-placeholder, .input-field:-ms-input-placeholder { - text-align: center; } - -.hover-underline:hover { - text-decoration: underline; } - -.fixed-bottom { - position: fixed; - bottom: 25px; - width: 100%; - left: 0; - padding: 30px; } - -.content-with-navigation-buttons { - max-height: calc(100% - 105px); - overflow-y: auto; - padding-bottom: 10px; } - -.textarea { - width: 100%; - background-color: gold; - font-size: 1.5em; - outline: none; - resize: none; - padding: 10px; } - -.check-mark-checked { - color: #00882a; - font-size: 1.3em; - width: 30px; } - -.check-mark-unchecked { - color: #aaaaaa; - width: 30px; } - -.btn-add-remove-ans_opt { - line-height: 100%; - width: 50px !important; - height: 50px !important; - background-color: #aaaaaa; } - -.color-changing-ars, .color-changing-nova, .color-changing-click { - width: 100px; - height: 100px; - animation-duration: 7s; - animation-iteration-count: infinite; - font-weight: bold; } - -.color-changing-ars { - animation-name: colorChangingArs; } - -.color-changing-nova { - animation-name: colorChangingNova; } - -.color-changing-click { - animation-name: colorChangingClick; } diff --git a/arsnova.click/client/css/default/keyframes.css b/arsnova.click/client/css/default/keyframes.css deleted file mode 100644 index 3c372cfd3..000000000 --- a/arsnova.click/client/css/default/keyframes.css +++ /dev/null @@ -1,48 +0,0 @@ -/* todo: we have to define the background-colors */ -@keyframes colorChangingArs { - 0% { - color: white; } - - 25% { - color: firebrick; } - - 50% { - color: rebeccapurple; } - - 75% { - color: gold; } - - 100% { - color: white; } } - -@keyframes colorChangingNova { - 0% { - color: gold; } - - 25% { - color: white; } - - 50% { - color: firebrick; } - - 75% { - color: rebeccapurple; } - - 100% { - color: gold; } } - -@keyframes colorChangingClick { - 0% { - color: rebeccapurple; } - - 25% { - color: gold; } - - 50% { - color: white; } - - 75% { - color: firebrick; } - - 100% { - color: rebeccapurple; } } diff --git a/arsnova.click/client/js/createTimerView.js b/arsnova.click/client/js/createTimerView.js deleted file mode 100644 index 00c6d6c60..000000000 --- a/arsnova.click/client/js/createTimerView.js +++ /dev/null @@ -1,71 +0,0 @@ -// slider starts at 20 and 80 -Session.setDefault("slider", 20); - - -Template.createTimerView.rendered = function () { - this.$("#slider").noUiSlider({ - start: Session.get("slider"), - range: { - 'min': 5, - 'max': 180 - } - }).on('slide', function (ev, val) { - Session.set('slider', Math.round(val)); - }).on('change', function (ev, val) { - Session.set('slider', Math.round(val)); - }); -}; - -Template.createTimerView.helpers({ - /* timer:function(){ - //For testing purposes - //Session.set("hashtag","wpw"); - //window.localStorage.setItem("privateKey", "thisismypriv"); - - const currentSession = Sessions.findOne({hashtag:Session.get("hashtag")}); - - if(!currentSession || !currentSession.timer) { - return ""; - } - return currentSession.timer; - },*/ - slider: function () { - return Session.get("slider"); - } -}); - -Template.createTimerView.events({ - "click #forwardButton": function () { - const timer = Session.get("slider"); - Meteor.call("Sessions.setTimer", { - privateKey: localData.getPrivateKey(), - hashtag: Session.get("hashtag"), - timer: timer - }, (err, res) => { - if (err) { - alert(err); - } else { - localData.addTimer(Session.get("hashtag"), timer); - Router.go("/readconfirmationrequired"); - } - }); - }, - "click #backButton": function () { - const timer = Session.get("slider"); - if (!isNaN(timer) && timer > 0) { - Meteor.call("Sessions.setTimer", { - privateKey: localData.getPrivateKey(), - hashtag: Session.get("hashtag"), - timer: timer - }, (err, res) => { - if (err) { - alert(err); - } else { - localData.addTimer(Session.get("hashtag"), timer); - Router.go("/answeroptions"); - } - }); - } - - } -}); \ No newline at end of file diff --git a/arsnova.click/client/js/voting_view.js b/arsnova.click/client/js/voting_view.js index 5304f4c87..02258838e 100644 --- a/arsnova.click/client/js/voting_view.js +++ b/arsnova.click/client/js/voting_view.js @@ -24,7 +24,7 @@ Template.votingview.helpers({ return String.fromCharCode((number.hash.number + 65)); }, getCountdown: function () { - return countdown.get(); + return countdown.get() + "seconds left!"; } }); diff --git a/arsnova.click/client/templates/voting_view.html b/arsnova.click/client/templates/voting_view.html index 00ff4534b..7371735f9 100644 --- a/arsnova.click/client/templates/voting_view.html +++ b/arsnova.click/client/templates/voting_view.html @@ -1,6 +1,6 @@ <template name="votingview"> - <div class="titel">{{getCountdown}} seconds left!</div> + {{> titel titelText = getCountdown}} <div class="row answer-row"> -- GitLab From 1a3f722d0fc62a20aab6a78b0bafb87b6273126c Mon Sep 17 00:00:00 2001 From: tekay <tom.kaesler@mni.thm.de> Date: Tue, 8 Mar 2016 17:44:07 +0100 Subject: [PATCH 7/8] recommit createTimerView.... --- arsnova.click/client/js/createTimerView.js | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 arsnova.click/client/js/createTimerView.js diff --git a/arsnova.click/client/js/createTimerView.js b/arsnova.click/client/js/createTimerView.js new file mode 100644 index 000000000..73184aae1 --- /dev/null +++ b/arsnova.click/client/js/createTimerView.js @@ -0,0 +1,58 @@ +// slider starts at 20 and 80 +Session.setDefault("slider", 20); + + +Template.createTimerView.rendered = function () { + this.$("#slider").noUiSlider({ + start: Session.get("slider"), + range: { + 'min': 5, + 'max': 180 + } + }).on('slide', function (ev, val) { + Session.set('slider', Math.round(val)); + }).on('change', function (ev, val) { + Session.set('slider', Math.round(val)); + }); +}; + +Template.createTimerView.helpers({ + slider: function () { + return Session.get("slider"); + } +}); + +Template.createTimerView.events({ + "click #forwardButton":function(){ + const timer = Session.get("slider"); + Meteor.call("Sessions.setTimer", { + privateKey:localData.getPrivateKey(), + hashtag:Session.get("hashtag"), + timer:timer + }, (err, res) => { + if (err) { + alert(err); + } else { + localData.addTimer(Session.get("hashtag"), timer); + Router.go("/readconfirmationrequired"); + } + }); + }, + "click #backButton":function(){ + const timer = Session.get("slider"); + if(!isNaN(timer) && timer > 0) { + Meteor.call("Sessions.setTimer", { + privateKey:localData.getPrivateKey(), + hashtag:Session.get("hashtag"), + timer:timer + }, (err, res) => { + if (err) { + alert(err); + } else { + localData.addTimer(Session.get("hashtag"), timer); + Router.go("/answeroptions"); + } + }); + } + } +}); \ No newline at end of file -- GitLab From 82462d213295d7b52bc97f5963c39273373fe65b Mon Sep 17 00:00:00 2001 From: tekay <tom.kaesler@mni.thm.de> Date: Tue, 8 Mar 2016 17:49:03 +0100 Subject: [PATCH 8/8] remove logging output.... --- arsnova.click/client/js/modalshowmyhashtags.js | 8 -------- arsnova.click/client/js/splashscreen.js | 1 + arsnova.click/client/js/titel.js | 3 --- arsnova.click/client/js/voting_view.js | 1 - 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/arsnova.click/client/js/modalshowmyhashtags.js b/arsnova.click/client/js/modalshowmyhashtags.js index aa8d09ef3..47e41eaa3 100644 --- a/arsnova.click/client/js/modalshowmyhashtags.js +++ b/arsnova.click/client/js/modalshowmyhashtags.js @@ -1,11 +1,5 @@ Template.modalShowMyHashtags.helpers({ hashtags: function () { - /*var hashtags = localStorage.getItem("hashtags").split(","); - var dataArray = []; - hashtags.forEach(function (name) { - dataArray.push({hashtag: name}); - }); - return dataArray;*/ return localData.getAllHashtags(); } }); @@ -14,8 +8,6 @@ Template.modalShowMyHashtags.events({ "click .js-my-hash": function (event) { var hashtag = event.target.innerHTML; localData.reenterSession(hashtag); - /*var question = localStorage.getItem(hashtag); - console.log(question);*/ Session.set("isOwner", true); Session.set("hashtag", hashtag); diff --git a/arsnova.click/client/js/splashscreen.js b/arsnova.click/client/js/splashscreen.js index f747a7c32..65df20eb2 100644 --- a/arsnova.click/client/js/splashscreen.js +++ b/arsnova.click/client/js/splashscreen.js @@ -28,6 +28,7 @@ Template.splashscreen.rendered = function () { splashscreen.modal({show: false}); } else { splashscreen.modal('show'); + } }; Template.splashscreen.helpers({ diff --git a/arsnova.click/client/js/titel.js b/arsnova.click/client/js/titel.js index 4af9d6cbc..1cdfdfaf8 100644 --- a/arsnova.click/client/js/titel.js +++ b/arsnova.click/client/js/titel.js @@ -8,8 +8,6 @@ Template.titel.onRendered(function () { var final_height = $(window).height() - $(".navbar").height(); $(".margin-to-logo").css("margin-top", $(".navbar").height()); $(".container").css("height", final_height); - console.log("test"); - }); }); @@ -19,5 +17,4 @@ Template.titel.rendered = function () { $(".margin-to-logo").css("margin-top", $(".navbar").height()); $(".container").css("height", final_height); - console.log("test"); }; \ No newline at end of file diff --git a/arsnova.click/client/js/voting_view.js b/arsnova.click/client/js/voting_view.js index 02258838e..88f1bdd46 100644 --- a/arsnova.click/client/js/voting_view.js +++ b/arsnova.click/client/js/voting_view.js @@ -63,7 +63,6 @@ Template.votingview.events({ Template.questionContentSplash.helpers({ questionContent: function () { mySessions = Sessions.find(); - console.log(mySessions); return mySessions; } }); -- GitLab