From badcf4315172267a31eddd467ed9e3209649ad5a Mon Sep 17 00:00:00 2001 From: Matan Bar Yosef Date: Sat, 20 Jun 2015 14:58:30 +0300 Subject: [PATCH] - Lecturer / Student Mode added - TODO fix previous text input from (add message by lecturer) --- templates/js/controllers/homeController.js | 49 ++-------------------- templates/views/home.html | 6 +-- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/templates/js/controllers/homeController.js b/templates/js/controllers/homeController.js index 0d3031b..2e1b19d 100644 --- a/templates/js/controllers/homeController.js +++ b/templates/js/controllers/homeController.js @@ -1,6 +1,7 @@ angular.module('SeHub') .controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) { + $scope.isStudent = false; $scope.addMsg = false; $scope.msgToPost = ""; $scope.oldText = ""; @@ -13,58 +14,18 @@ angular.module('SeHub') if($scope.user.isLecturer) { + $scope.isStudent = false; console.log("Lecturer Mode!"); - $scope.messages = [ - { - face : imagePath, - what: 'Let me tell you a secret', - who: 'Sagi Dayan', - when: '4:15PM', - notes: " I am S'ein" - }, - { - face : imagePath, - what: 'Listen to this!', - who: 'Aran Zaiger', - when: '6:15PM', - notes: " I am gaylord ultima!!" - }, - { - face : imagePath, - what: 'Hi?', - who: 'Etye Meyer', - when: '7:45AM', - notes: " I am mega gaylord ultima" - } - ]; - - $scope.tasks = [ - { - ExNum: '1', - dueDate: '23/06/15', - notes: " Build A Game: Scrabble" - }, - { - ExNum: '3', - dueDate: '30/06/15', - notes: " Static Array" - }, - { - ExNum: '4', - dueDate: '07/07/15', - notes: " Dynamic Array" - }, - ]; } else { + $scope.isStudent = true; console.log("Student Mode!"); } $scope.addMessageClicked = function() { $scope.addMsg = true; // Reveal the "POST" Button - } $scope.postMessageClicked = function(msg) // Posting the message itself @@ -76,10 +37,8 @@ angular.module('SeHub') $scope.prevText += "

"; document.getElementById("bindText").innerHTML += $scope.prevText; } - $scope.prevText = ''; - document.getElementById("bindText").value = ''; document.getElementById("msg").value = ''; - + $scope.prevText = ''; } $scope.clearAllClicked = function() // Clear Screen from text diff --git a/templates/views/home.html b/templates/views/home.html index 5cb0ca3..cd2fc49 100644 --- a/templates/views/home.html +++ b/templates/views/home.html @@ -22,7 +22,6 @@ -
@@ -69,7 +68,7 @@ Post Clear All
-
+
@@ -77,7 +76,7 @@
-
+
@@ -112,5 +111,4 @@
-
\ No newline at end of file