From d9971b2bad3c90cfae8260538fe0bfaa8ec9f111 Mon Sep 17 00:00:00 2001 From: 1987cr Date: Sat, 11 Jul 2015 21:05:40 -0430 Subject: [PATCH] Hodor --- app/controllers/index.js | 3 +- app/controllers/main.js | 4 +-- app/controllers/playTrivia.js | 52 +++++++++++++++++------------------ app/styles/main.tss | 2 +- app/views/main.xml | 8 ++++-- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/app/controllers/index.js b/app/controllers/index.js index b440ce3..b10290b 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -39,11 +39,10 @@ function password_blur(e) { $.password.setBorderColor("#aaa"); } -if(Ti.App.Properties.getString("token") != "null"){ +if(Ti.App.Properties.getString("token") != null){ var w=Alloy.createController('main').getView(); w.open(); }else{ $.index.open(); } - diff --git a/app/controllers/main.js b/app/controllers/main.js index 54464f9..c655fdb 100644 --- a/app/controllers/main.js +++ b/app/controllers/main.js @@ -180,8 +180,8 @@ function logout(e){ function optionDialog(e){ if(e.index == 0){ - Ti.App.Properties.setString('token', "null"); + Ti.App.Properties.setString('token', null); var w=Alloy.createController('index').getView(); w.open(); - } + } } diff --git a/app/controllers/playTrivia.js b/app/controllers/playTrivia.js index 691fbd8..62f3dde 100644 --- a/app/controllers/playTrivia.js +++ b/app/controllers/playTrivia.js @@ -202,8 +202,6 @@ function loadQuestions(e) { res3.setBackgroundColor('green'); } sumarScoreUser(); - - mostrarBotonContinue(); } @@ -305,31 +303,7 @@ function loadQuestions(e) { }; - function sumarScoreUser(e) { - - var url = "http://sheltered-mesa-1621.herokuapp.com/api/users/me/scores"; - var tokeni = Ti.App.Properties.getString('token'); - var score = Ti.Network.createHTTPClient({ - onload: function(e) { - var dialog = Ti.UI.createAlertDialog({ - title: 'Score', - message: puntaje - }); - dialog.show(); - }, - onerror: function(e) { - alert(e); - }, - timeout: 5000 - }); - score.open('POST', url); - score.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - score.setRequestHeader('token', Ti.App.Properties.getString("token")); - score.send({ - score: puntaje - }); - - }; + } else { $.question.remove(label); loadQuestions(); @@ -368,3 +342,27 @@ function rendirseDialog(e){ w.open(); } } + +function sumarScoreUser(e) { + + var url = "http://sheltered-mesa-1621.herokuapp.com/api/users/me/scores"; + var score = Ti.Network.createHTTPClient({ + onload: function(e) { + var dialog = Ti.UI.createAlertDialog({ + title: 'Score', + message: puntaje + }); + dialog.show(); + }, + onerror: function(e) { + alert(e); + }, + timeout: 5000 + }); + score.open('POST', url); + score.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + score.setRequestHeader('token', Ti.App.Properties.getString("token")); + score.send({ + score: puntaje + }); +} \ No newline at end of file diff --git a/app/styles/main.tss b/app/styles/main.tss index 86abd8c..60da6e4 100644 --- a/app/styles/main.tss +++ b/app/styles/main.tss @@ -56,7 +56,7 @@ } "#podio_splash":{ - height: "25%", + height: "25%", top: "0%", width: "100%", backgroundImage: "/podio-splash.png" diff --git a/app/views/main.xml b/app/views/main.xml index 5d845a6..cd54df0 100644 --- a/app/views/main.xml +++ b/app/views/main.xml @@ -1,6 +1,7 @@ + @@ -9,12 +10,14 @@ - + + + @@ -24,7 +27,7 @@ - + @@ -36,6 +39,7 @@ +