summaryrefslogtreecommitdiffstats
path: root/f/scripts
diff options
context:
space:
mode:
authorokalintu <ilkka.oksanen@aalto.fi>2015-03-04 02:45:33 +0200
committerokalintu <ilkka.oksanen@aalto.fi>2015-03-04 02:45:33 +0200
commitf607dac15deb8b9faeb060661ccf8edd2b9564fc (patch)
treef5ec095641b7f56b419c793e1ae3148a5b4650e5 /f/scripts
parentf1258540d0ab8bc8acbff3f31040539d34131e48 (diff)
implemented feature to allow ppl to remove themselves from que
Diffstat (limited to 'f/scripts')
-rw-r--r--f/scripts/client.js19
1 files changed, 17 insertions, 2 deletions
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);
+ };
});