From f607dac15deb8b9faeb060661ccf8edd2b9564fc Mon Sep 17 00:00:00 2001 From: okalintu Date: Wed, 4 Mar 2015 02:45:33 +0200 Subject: implemented feature to allow ppl to remove themselves from que --- f/images/delete.jpg | Bin 0 -> 1307 bytes f/scripts/client.js | 19 +++++++++++++++++-- f/styles/style.css | 5 ++++- f/templates/index.html | 4 +++- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 f/images/delete.jpg (limited to 'f') diff --git a/f/images/delete.jpg b/f/images/delete.jpg new file mode 100644 index 0000000..1ae7bfa Binary files /dev/null and b/f/images/delete.jpg differ diff --git a/f/scripts/client.js b/f/scripts/client.js index fb612ed..546aa57 100644 --- a/f/scripts/client.js +++ b/f/scripts/client.js @@ -2,13 +2,16 @@ var ioc = angular.module('ioc',[]); ioc.controller('ioctrl',function($scope){ var soc= io(); + var pw =0; + + $scope.uid =0; $scope.que=[]; $scope.row=""; $scope.name=""; $scope.qsize=0; $scope.submit = function(){ - soc.emit("queadd",{"row":$scope.row,"name":$scope.name}); + soc.emit("queadd",{"row":$scope.row,"name":$scope.name,"uid":$scope.uid}); $scope.row=""; $scope.name=""; }; @@ -19,8 +22,20 @@ ioc.controller('ioctrl',function($scope){ $scope.$apply(); }); + soc.on("userinfo",function(data){ + $scope.uid = data.uid; + pw= data.pw; + }); + + soc.on("err",function(err){ + console.log("error! msg: "+err.msg); + }); + $scope.popfirst = function(){ soc.emit("quepopfirst",""); }; - + $scope.querm = function(qid){ + data = {"qid":qid,"pw":pw}; + soc.emit("quedelete",data); + }; }); diff --git a/f/styles/style.css b/f/styles/style.css index 246a201..ae909c8 100644 --- a/f/styles/style.css +++ b/f/styles/style.css @@ -4,7 +4,7 @@ body{ } #container_main{ font-size:24px; - width:200px; + width:400px; margin-top:40px; margin-left:auto; margin-right:auto; @@ -26,6 +26,9 @@ td:first-child{ #que tr:nth-child(2){ background-color:darkgreen; } +#que td:nth-child(3){ + text-align: center; +} #addform{ } diff --git a/f/templates/index.html b/f/templates/index.html index b75ee8a..b02d4b8 100644 --- a/f/templates/index.html +++ b/f/templates/index.html @@ -27,10 +27,12 @@ - + + +
RiviNimi
RiviNimiPoista
Rivi {{person.row}} {{person.name}}
-- cgit v1.3