- Add message for lecturer - ADDED

- Clear all messages for lecturer - ADDED

- Overflow - FIXED
This commit is contained in:
Matan Bar Yosef 2015-06-20 14:21:32 +03:00
parent 4221439085
commit 3c48e3fbe9
4 changed files with 169 additions and 98 deletions

View file

@ -33,9 +33,9 @@ md-list .md-button {
https://github.com/google/material-design-icons https://github.com/google/material-design-icons
*/ */
p { /*p {
margin-left: 2em; margin-left: 2em;
} }*/
.menuBtn { .menuBtn {
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) no-repeat center center; background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHg9IjBweCIgeT0iMHB4IiB3aWR0aD0iMjRweCIgaGVpZ2h0PSIyNHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDI0IDI0IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGcgaWQ9IkhlYWRlciI+CiAgICA8Zz4KICAgICAgICA8cmVjdCB4PSItNjE4IiB5PSItMjIzMiIgZmlsbD0ibm9uZSIgd2lkdGg9IjE0MDAiIGhlaWdodD0iMzYwMCIvPgogICAgPC9nPgo8L2c+CjxnIGlkPSJMYWJlbCI+CjwvZz4KPGcgaWQ9Ikljb24iPgogICAgPGc+CiAgICAgICAgPHJlY3QgZmlsbD0ibm9uZSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ii8+CiAgICAgICAgPHBhdGggZD0iTTMsMThoMTh2LTJIM1YxOHogTTMsMTNoMTh2LTJIM1YxM3ogTTMsNnYyaDE4VjZIM3oiIHN0eWxlPSJmaWxsOiNmM2YzZjM7Ii8+CiAgICA8L2c+CjwvZz4KPGcgaWQ9IkdyaWQiIGRpc3BsYXk9Im5vbmUiPgogICAgPGcgZGlzcGxheT0iaW5saW5lIj4KICAgIDwvZz4KPC9nPgo8L3N2Zz4=) no-repeat center center;
@ -147,7 +147,7 @@ body.noscroll
.feed .feed
{ {
overflow-y: scroll; overflow-y: scroll;
height: 300px; height: 350px;
/*width: 100%;*/ /*width: 100%;*/
} }
@ -349,17 +349,11 @@ body.noscroll
box-sizing: content-box; box-sizing: content-box;
} }
/*gridList Effects*/
md-grid-list /* Colors*/
{ .gray{
margin: 8px;
}
.gray
{
background:#f5f5f5; background:#f5f5f5;
} }
.aliceblue { .aliceblue {
background: aliceblue; background: aliceblue;
} }
@ -378,6 +372,7 @@ md-grid-list
.red { .red {
background: #ff8a80; background: #ff8a80;
} }
/* End Colors */
.whiteframedemoBasicUsage md-whiteframe { .whiteframedemoBasicUsage md-whiteframe {
background: #fff; background: #fff;
@ -385,40 +380,40 @@ md-grid-list
padding: 20px; padding: 20px;
} }
/* md-grid-tile {
transition: all 400ms ease-out 50ms;
}*/
/*END gridList Effects*/
.tasksContent .tasksContent
{ {
/*float:left;*/ padding-left: 4px;
padding-right: 4px;
margin: 5px;
background-color: aliceblue;
overflow: scroll;
height:250;
width:500;
} }
.messagesContent
{
md-list-item .md-no-style.md-button, md-list-item.md-no-proxy.md-button { padding-left: 4px;
font-size: inherit; padding-right: 4px;
height: inherit; margin: 5px;
text-align: left; background-color: #f5f5f5;
text-transform: none; overflow: scroll;
width: 300px; height:250;
white-space: normal; width:500;
} }
p.tasksFeed
/*md-list-item, md-list-item .md-list-item-inner { {
display: -webkit-flex; padding-left: 4px;
display: -ms-flexbox; margin: 5px;
display: flex; width:500;
-webkit-justify-content: flex-start; height: auto;
-ms-flex-pack: start; background-color: aliceblue;
justify-content: flex-start;
-webkit-align-items: center; }
-ms-flex-align: center; p.messagesFeed
align-items: center; {
min-height: 48px; padding-left: 4px;
}*/ margin: 5px;
width:500;
/*End Effects for MD*/ height: auto;
background-color: #f5f5f5;
}

View file

@ -1,12 +1,19 @@
angular.module('SeHub') angular.module('SeHub')
.controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope) .controller('homeController', ['$scope', '$cookies', '$cookieStore', '$window', '$location', '$mdToast', '$mdDialog', 'apiService', '$rootScope', function ($scope, $cookies, $cookieStore, $window, $location, $mdToast, $mdDialog, apiService ,$rootScope)
{ {
var imagePath = $scope.user.avatar_url; $scope.addMsg = false;
$scope.phones = [ $scope.msgToPost = "";
{ type: 'Home', number: '(972) 865-82861' }, $scope.oldText = "";
{ type: 'Cell', number: '(972) 5251-32309' },
];
var imagePath = $scope.user.avatar_url;
$scope.phones = [
{ type: 'Home', number: '(972) 865-82861' },
{ type: 'Cell', number: '(972) 5251-32309' },
];
if($scope.user.isLecturer)
{
console.log("Lecturer Mode!");
$scope.messages = [ $scope.messages = [
{ {
face : imagePath, face : imagePath,
@ -48,10 +55,38 @@ angular.module('SeHub')
notes: " Dynamic Array" notes: " Dynamic Array"
}, },
]; ];
}
else
{
console.log("Student Mode!");
}
$scope.addMessageClicked = function()
{
$scope.addMsg = true; // Reveal the "POST" Button
}
$scope.postMessageClicked = function(msg) // Posting the message itself
{
if(msg != null)
{
$scope.prevText = "- " + msg;
implementText = document.getElementById("msg").value;
$scope.prevText += "<br></br>";
document.getElementById("bindText").innerHTML += $scope.prevText;
}
$scope.prevText = '';
document.getElementById("bindText").value = '';
document.getElementById("msg").value = '';
}
// animation $scope.clearAllClicked = function() // Clear Screen from text
$scope.isEnterd = top.setIsEnterd; {
document.getElementById("bindText").innerHTML = "";
}
// animation
$scope.isEnterd = top.setIsEnterd;
}]); }]);

View file

@ -83,7 +83,7 @@ angular.module('SeHub')
console.log("DONE - 200"); console.log("DONE - 200");
$mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.') $mdDialog.show($mdDialog.alert().title('E-mail Verification').content('A verification e-mail has been sent to your email address.')
.ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(ev)); // Pop-up alert for e-mail verification .ariaLabel('Email verification alert dialog').ok('Got it!').targetEvent(ev)); // Pop-up alert for e-mail verification
// TODO ADD delete cookies and redirect only after pressed 'Got it' // TODO ADD- delete cookies and redirect only after pressed 'Got it'
$cookieStore.remove("com.sehub.www"); // Removing the cookies $cookieStore.remove("com.sehub.www"); // Removing the cookies
$window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page $window.location.href = 'http://se-hub.appspot.com'; // Reference to 'welcome' page
}).error(function() }).error(function()
@ -117,8 +117,6 @@ angular.module('SeHub')
var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (!result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked if (!result.test(email)) // TODO Fix when success to show mdDialog until 'Got it' clicked
{ {
console.log(email + ", Error in email, should alert");
// alert('Please provide a valid e-mail address');
$mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.') $mdDialog.show($mdDialog.alert().title('Error - E-mail Verification').content('An error has occured in your e-mail address.')
.ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email)); .ariaLabel('Email verification error alert dialog').ok('Got it!').targetEvent(email));
} }

View file

@ -23,51 +23,94 @@
</md-card> </md-card>
</md-content> </md-content>
<md-content layout-padding> <div ng-if="user.isLecturer"> <!-- Lecturer Mode -->
<md-card> <md-content layout-padding>
<div class = "feed"> <div layout="row" layout-margin layout-padding>
<md-grid-list <div>
md-cols-sm="1" md-cols-md="2" md-cols-gt-md="6" <md-card>
md-row-height-gt-md="1:1" md-row-height="2:2" <p class = "messagesFeed">Messages</p>
md-gutter="12px" md-gutter-gt-sm="8px" > </md-card>
<md-grid-tile class="aliceblue" </div>
md-rowspan="2" md-colspan="3" md-colspan-sm="1"> <div>
<md-grid-tile-header> <md-card>
<h3>Messages</h3> <p class = "tasksFeed">Tasks</p>
</md-grid-tile-header> </md-card>
In The Future Will Enter Wanted MESSAGES Text Here </div>
</md-grid-tile>
<md-grid-tile class="gray"
md-rowspan="2" md-colspan="3" md-colspan-sm="1">
<md-grid-tile-header>
<h3>Tasks</h3>
</md-grid-tile-header>
<!-- In The Future Will Enter Wanted TASKS Text Here -->
<div class = "tasksContent" style:"text-align= left;">
For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
<br>=====================</br>
For Task 4 Press: <a href="http://localhost:8080/home#/home">Task #4</a>
</div>
</md-grid-tile>
</md-grid-list>
</div> </div>
</md-card> <div layout="row" layout-margin layout-padding>
</md-content> <div>
<md-card>
<p id = "bindText" class = "messagesContent"></p>
<!-- <div layout="row" layout-fill style="padding-right: 320px;"> </md-card>
<md-whiteframe class="md-whiteframe-z4" layout layout-align="center center"> </div>
<span>.md-whiteframe-z4</span> <div>
</md-whiteframe> <md-card>
<md-whiteframe class="md-whiteframe-z5" layout layout-align="center center"> <p class = "tasksContent">
<span>.md-whiteframe-z5</span> For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
</md-whiteframe> <br></br>
</div> --> For Task 4 Press: <a href="http://localhost:8080/home#/home">Task #4</a>
<br></br>
For Task 5 Press: <a href="http://localhost:8080/home#/home">Task #5</a>
<br></br>
For Task 6 Press: <a href="http://localhost:8080/home#/home">Task #6</a>
<br></br>
For Task 7 Press: <a href="http://localhost:8080/home#/home">Task #7</a>
<br></br>
For Task 8 Press: <a href="http://localhost:8080/home#/home">Task #8</a>
</p>
</md-card>
</div>
</div>
<div layout-margin layout padding>
<md-button ng-click="addMessageClicked()" ng class="md-raised md-primary">Add Message</md-button>
</div>
<div ng-if="addMsg">
<div layout = "row" layout-margin layout padding layout-align = "left center">
<md-button ng-click="postMessageClicked(msgToAdd)" ng class="md-raised md-primary">Post</md-button>
<md-button ng-click="clearAllClicked()" ng class="md-raised md-primary">Clear All</md-button>
</div>
<div class="port_spacer">
<md-input-container>
<label> Write Your Desired Message Here And Press Post</label>
<input type="text" id="msg" md-maxlength="150" minlength="1" ng-model="msgToAdd" required>
</md-input-container>
</div>
</md-content>
</div>
<div ng-if="!user.isLecturer"> <!-- Student Mode -->
<md-content layout-padding>
<div layout="row" layout-margin layout-padding>
<div>
<md-card>
<p class = "messagesFeed">Messages</p>
</md-card>
</div>
<div>
<md-card>
<p class = "tasksFeed">Tasks</p>
</md-card>
</div>
</div>
<div layout="row" layout-margin layout-padding>
<div>
<md-card>
<p id = "bindText" class = "messagesContent"></p>
</md-card>
</div>
<div>
<md-card>
<p class = "tasksContent">
For Task 3 Press: <a href="http://localhost:8080/home#/tasks">Task #3</a>
<br></br>
For Task 4 Press: <a href="http://localhost:8080/home#/home">Task #4</a>
<br></br>
For Task 5 Press: <a href="http://localhost:8080/home#/home">Task #5</a>
</p>
</md-card>
</div>
</div>
</md-content>
</div>
</div> </div>