From d80c2661a1571f559bff0ed3e03231e0f2782a49 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Tue, 13 Jan 2015 02:14:24 +0200 Subject: [PATCH] Added Settings and UI tweaks Now you can lock the grade page with your password. still needs some work for unlocking - there should be a password prompt --- config.xml | 2 +- www/css/style.css | 14 +- www/js/ApiService.js | 10 +- www/js/app.js | 20 +++ www/js/controllers.js | 338 ++++++++++++++++++++---------------- www/templates/Aouth.html | 23 +++ www/templates/aguda.html | 91 ++++++++++ www/templates/grades.html | 22 --- www/templates/login.html | 25 --- www/templates/menu.html | 50 ++++-- www/templates/settings.html | 47 +++++ 11 files changed, 417 insertions(+), 225 deletions(-) create mode 100644 www/templates/Aouth.html create mode 100644 www/templates/aguda.html delete mode 100644 www/templates/login.html create mode 100644 www/templates/settings.html diff --git a/config.xml b/config.xml index 4ee665e..b2e398f 100644 --- a/config.xml +++ b/config.xml @@ -1,5 +1,5 @@ - + jceMobile Free Your Academic Data diff --git a/www/css/style.css b/www/css/style.css index 478ab7a..01132da 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -40,4 +40,16 @@ h1{ .page-content{ direction: rtl; padding: 15px; -} \ No newline at end of file + +} + +.settings{ + direction: ltr; +} + +.menu-tafrit{ + direction: rtl; + +} + + diff --git a/www/js/ApiService.js b/www/js/ApiService.js index e8dfc44..c9a3a4d 100644 --- a/www/js/ApiService.js +++ b/www/js/ApiService.js @@ -11,13 +11,7 @@ starter.factory('ApiService', ['$http', '$ionicPopup', '$ionicModal', function ( return $http.get(request).then(function(resp) { if(resp.data.guest == false){ - window.localStorage['loggedIn'] = true; - window.localStorage['fullName'] = resp.data.user_fullName; - window.localStorage['email'] = resp.data.user_email; - window.localStorage['phone'] = resp.data.user_phone; - window.localStorage['username'] = username; - window.localStorage['password'] = password; - + window.localStorage['userInfo'] = JSON.stringify(resp.data); console.log("[JCE] [INFO]: Success."); return true; }else{ @@ -25,7 +19,7 @@ starter.factory('ApiService', ['$http', '$ionicPopup', '$ionicModal', function ( title: 'שם משתמש או סיסמא שגויים', template: 'וודא שוב כי שם המשתמש והסיסמא הינם נכונים.' }); - console.log("[JCE] [INFO]: Wrong crads."); + console.log("[JCE] [INFO]: Wrong user/pass."); return false; } diff --git a/www/js/app.js b/www/js/app.js index cf1aed4..bbbaa28 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -70,6 +70,26 @@ app.run(function($ionicPlatform) { } }) + .state('app.aguda', { + url: "/aguda", + views: { + 'menuContent': { + templateUrl: "templates/aguda.html", + controller: 'AgudaCtrl' + } + } + }) + + .state('app.settings', { + url: "/settings", + views: { + 'menuContent': { + templateUrl: "templates/settings.html", + controller: 'SettingsCtrl' + } + } + }) + .state('app.grades', { url: "/grades", views: { diff --git a/www/js/controllers.js b/www/js/controllers.js index 0ca85cf..17eb6f6 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -4,12 +4,11 @@ angular.module('starter.controllers', []) = AppCtrl - Main = ======================================*/ -.controller('AppCtrl', function($scope, $rootScope, $ionicModal, $timeout, $http, $ionicPopup, $location) { +.controller('AppCtrl', function($scope, $ionicModal, $timeout, $ionicPopup, $ionicViewService, $location) { - // Form data for the login modal - $scope.loginData = {}; - + + $scope.lock = {}; var newNotes = false; $scope.logged = false; @@ -21,7 +20,7 @@ angular.module('starter.controllers', []) $scope.userData = null; // Create the login modal that we will use later - $ionicModal.fromTemplateUrl('templates/login.html', { + $ionicModal.fromTemplateUrl('templates/Aouth.html', { scope: $scope }).then(function(modal) { $scope.modal = modal; @@ -29,30 +28,38 @@ angular.module('starter.controllers', []) - - - $scope.isLoggedIn = function(){ - if($scope.userData == null) - return false; - console.log("[JCE] [Info] User hase loged in once!"); - return true; - }; - - $scope.newNotes = function(){ - var newNote = window.localStorage['newNotes'] || "false"; - return (newNote == "true") ? true : false; - }; + if((window.localStorage['userInfo'] || null) === null ) + $scope.isLoggedIn = false; + else + $scope.isLoggedIn = true; - // Triggered in the login modal to close it - $scope.closeLogin = function() { + // Triggered in the Aouth modal to close it + $scope.closeAouth = function() { $scope.modal.hide(); }; - // Open the login modal - $scope.login = function() { - $scope.modal.show(); + // Aouth for Grades + $scope.Aouth = function() { + console.log("Clicked GoOn - password enterd: "+ $scope.lock.password + "\nThe logs pass is: "+window.localStorage['password']); + + if($scope.lock.password === (window.localStorage['password'] || null)){ //ok + $scope.lock.password = ""; + $scope.modal.hide(); + $ionicViewService.nextViewOptions({ + disableBack: true }); + + $location.path( "/app/grades" ); + }else{ + var alertPopup = $ionicPopup.alert({ + title: 'סיסמה שגוייה', + template: 'טעות בסיסמה' + }); + alertPopup.then(function(res) { + $scope.modal.hide(); + }); + } }; @@ -65,15 +72,29 @@ angular.module('starter.controllers', []) }; - $scope.$watch(window.localStorage['logged'], function() { - console.log('[JCE] [INFO]: CHANGED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); - var tempBool = (window.localStorage['logged'] || false); - if(tempBool == "true") - $scope.logged = true; - else - $scope.logged = false; + $scope.openGrades = function(){ + var localSettingsStr = window.localStorage['Settings'] || null; + if (localSettingsStr !== null){ + var isLocked = (JSON.parse(localSettingsStr))[0].val; + } + if(isLocked){ + console.log("[JCE] [INFO]: Grades Locked"); + $scope.modal.show(); + } + else{ + console.log("Unlocked"); + $ionicViewService.nextViewOptions({ + disableBack: true }); + $location.path( "/app/grades" ); + } + }; - }); + $scope.menuClicked = function(){ + if((window.localStorage['userInfo'] || null) === null ){ + $scope.isLoggedIn = false; + }else + $scope.isLoggedIn = true; + }; @@ -156,25 +177,75 @@ angular.module('starter.controllers', []) } - $scope.getMedal = function(grade){ - if(grade < 55){ - return "https://wiki.openttd.org/images/1/10/Face-Sick-120px.png"; - }else if( 55<= grade && grade < 70){ - return "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcT6UK4UUxagOktpvJR_P433nvOeTDuV3rOxd0Mswo8T-tRueFmN"; - }else if( 70<= grade && grade < 80){ - return "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRz0_Nk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CMPVXP9TLsGGwM8iKJvQxo+CujXCOyRVKyct2yzZTICoAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAID//Z"; - }else{ - return "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRR0zMfWYUcjYyXjGUQY3tDj04rIFfi_CThbaolxTt_38eL1hkFmQ"; - } + // $scope.getMedal = function(grade){ + // if(grade < 55){ + // return "https://wiki.openttd.org/images/1/10/Face-Sick-120px.png"; + // }else if( 55<= grade && grade < 70){ + // return "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcT6UK4UUxagOktpvJR_P433nvOeTDuV3rOxd0Mswo8T-tRueFmN"; + // }else if( 70<= grade && grade < 80){ + // return "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRz0_NkZPM9FSymaCqFObwGPQFA9vRGZ82DEM7jfFU6xQ3qLbu8oQ"; + // }else if( 80<= grade && grade < 95){ + // return "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxATDw8UEBIQFhUVFRAPEBQVFBYVDxQVFBQWFhgUFRQYHCggGRonHhUUITEhJSkrLjEuFx8zODMsNygtLisBCgoKDg0OGxAQGiwkHyQsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLC8sLCwsLCwsLCwsLCwsLCwsLCwsLCwsLP/AABEIAMwAzAMBEQACEQEDEQH/xAAcAAABBQEBAQAAAAAAAAAAAAAAAQIDBAUGBwj/xABJEAABAwICBQYKBgcHBQAAAAABAAIDBBEFEgYhMUFRImFxgZGhBxMyQlJykrHB0RYjM1Ni4RQVQ2Nzk7IIJFSC0uLwFzRklKP/xAAaAQEAAgMBAAAAAAAAAAAAAAAAAgMBBAUG/8QAMxEAAgIBAgIIBQUBAAMBAAAAAAECAxEEMRIhBRMyQVFhcZEUFSKhsUJSgdHh8CMzwWL/2gAMAwEAAhEDEQA/APcUAIAQAgBACAEAIAQAgBACAEAIAQAgBAC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gokblkax43X2joO5V2VQsWJLJOFkoPMXgwKnRaVuuF7h+GQFzepw1jvXKu6Hg+dbx5HQr6Re1iz6GdNFVRfaQusPOZy2/Nc2zQ6ivuz6G5DUUT2fuRx4w29i6x4HUewqjjnHk0W9UnzRaZig4jtUlqCLpJP1kFL4lEeoGPxQcQsPUmVQVJsYaPOHaou9vYmqRsck0v2UUjue2VvaVZDTai3aJGVlNe8kX6fRuofrlflHoxguf7R1DvW9V0PJ87JexqWdJRXKC9zdw3R9sWuOOzt73a39p2Lr06WqnsI59uost7TNNmGu3kLYKCePD2DbcoCyyNo2AIB6AEAIAQAgBACAEAIAQAgBACAEAICGakjf5bGO9ZoPvUZRjLdGVJx2ZQl0conbaeLqbb3KmWlplvFFy1Nq2kyI6KUP3DO13zUfgqP2Il8Zd+4ezRihGynj6wT7ysrR0L9CMPVXP9TLsGGwM8iKJvQxo+CujXCOyRVKyct2yzZTICoAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAID//Z"; + // }else{ + // return "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRR0zMfWYUcjYyXjGUQY3tDj04rIFfi_CThbaolxTt_38eL1hkFmQ"; + // } - return "sdfgg"; - }; + // return "sdfgg"; + // }; }) + + +/*============================================= += Settings - controller = +=============================================*/ + + + + +.controller('SettingsCtrl', function($scope, $stateParams, $http) { + + var localSettingsStr = window.localStorage['Settings'] || null; + if (localSettingsStr === null){ + var settings_list = [ {text:"נעל גיליון ציונים", val: false}, //[0] + {text:"הצג מזג אויר", val: false} ]; //[1] + console.log("[JCE] [info]: No settings found!"); + } + else{ + settings_list = JSON.parse(localSettingsStr); + console.log("[JCE] [info]: settings found!"); + } + + $scope.settings = settings_list; + + $scope.toggled = function(){ + console.log("[JCE] [info]: Setting Changed"); + window.localStorage['Settings'] = JSON.stringify($scope.settings); + }; + + + +}) + + +/*============================================= += Aguda News - controller = +=============================================*/ + + + + +.controller('AgudaCtrl', function($scope, $stateParams, $http) { + var notesStr = window.localStorage['notes'] || null; + console.log(notesStr); + if(notesStr != null) + $scope.newss = JSON.parse(notesStr); + + + +}) /*============================================= = JCE News - controller = =============================================*/ @@ -200,37 +271,11 @@ angular.module('starter.controllers', []) -.controller('LoginCtrl', function($scope, $stateParams, $http, $location, $ionicPopup, $ionicViewService, $state) { - - function getNotes(){ - var notes = window.localStorage['notes'] || null; - return $http.get('https://mipo.jce.ac.il/index.php/site/studentMessages').then(function(resp) { - if(notes === null){ - window.localStorage['notes'] = JSON.stringify(resp.data); - return true; - }else if(notes === JSON.stringify(resp.data)){ - return false; - }else{ - window.localStorage['notes'] = JSON.stringify(resp.data); - return true; - } - $scope.$apply(); - console.log("[JCE] [INFO] Got JCE News!"); - }, function(err) { - console.error('ERR', err); - // err.status will contain the status code - }) - } - - - +.controller('LoginCtrl', function($scope, $http, $location, $ionicPopup, $ionicViewService, $timeout, $ionicLoading, ApiService) { var userStr = window.localStorage['userInfo'] || null; - + $scope.loginData = {}; if(userStr !== null){ - if(getNotes() == true){ - window.localStorage['newNotes'] = "true"; - } $ionicViewService.nextViewOptions({ disableBack: true }); @@ -244,85 +289,32 @@ angular.module('starter.controllers', []) // Perform the login action when the user submits the login form $scope.doLogin = function() { - console.log('[JCE] [Info] Doing login', $scope.loginData); + ApiService.login($scope.loginData.username, $scope.loginData.password); - //JCE Login shit: - var request = "https://mipo.jce.ac.il/index.php/site/login?_dc=1419773997764&formValues=%7B%22form_fields%22%3A%7B%22name%22%3A%22"+$scope.loginData.username+"%22%2C%22pwd%22%3A%22"+$scope.loginData.password+"%22%7D%7D&callback=JSON_CALLBACK"; - - $http.get(request).then(function(resp) { - console.log('Success', resp); - console.log('!!!\n'+JSON.stringify(resp.data)+'\n!!!', resp); - if(resp.data.guest == false){ - - window.localStorage['name'] = $scope.loginData.username; - window.localStorage['pass'] = $scope.loginData.password; - - $scope.userData = resp.data; - window.localStorage['userInfo'] = JSON.stringify(resp.data); - - - // // if(getNotes() == true){ - // window.localStorage['newNotes'] = "true"; - // // } - - // window.localStorage['logged'] = "true"; - - // // $state.forceReload(); - - // // $state.go($state.current, {}, {reload: true}); - // // + $ionicLoading.show({template: 'אנא המתן...'}); //close the popup after 3 seconds for some reason + $timeout(function() { + $ionicLoading.hide(); + if( (window.localStorage['userInfo'] || false) != false){ + window.localStorage['password'] = $scope.loginData.password; var alertPopup = $ionicPopup.alert({ - title: 'ההתחברות בוצעה בהצלחה!', - template: 'עקב בעיות גרסה. התוכנה תיסגר עכשיו. אנא כנס שוב כדי להנות מן האפשוריות' - }); + title: 'ברוכים הבאים!', + template: 'ההתחברות בוצעה בהצלחה!' + }); alertPopup.then(function(res) { - console.log('[JCE] [Info] Popup Confirmed - wrong Username/Password'); - navigator.app.exitApp(); - $scope.closeLogin(); - }); + $ionicViewService.nextViewOptions({ + disableBack: true + }); - $ionicViewService.nextViewOptions({ - disableBack: true + $location.path( "/app/home" ); //Start app }); - $location.path( "/app/home" ); - - - - console.log("[JCE] [Info] Login Was SUCCESSFULL!!", resp); - }else{ - var alertPopup = $ionicPopup.alert({ - title: 'הזנה שגויה', - template: 'וודא כי שם המשתמש וסיסמה נכונים' - }); - alertPopup.then(function(res) { - console.log('[JCE] [Info] Popup Confirmed - wrong Username/Password'); - $scope.closeLogin(); - }); - console.log("Login Faild!", resp); } - }, function(err) { - var alertPopup = $ionicPopup.alert({ - title: 'שגיאת התחברות', - template: 'ישנה שגיאת התחברות - נסה מאוחר יותר' - }); - alertPopup.then(function(res) { - console.log('[JCE] [Info] Popup Confirmed - Error Network'); - $scope.closeLogin(); - }); - console.error('[JCE] [error] ERR', err); - // err.status will contain the status code - }); + }, 2000); - - - -$scope.logout = function(){ - localStorage.clear(); - navigator.app.exitApp(); -}; + }; + }) /*======================================= @@ -330,10 +322,17 @@ $scope.logout = function(){ =======================================*/ -.controller('homeCtrl', function($scope, $stateParams, $ionicViewService, $location, $timeout, $rootScope, ApiService) { +.controller('homeCtrl', function($scope, $stateParams, $ionicViewService, $location, $timeout, $rootScope, $ionicModal, ApiService) { + $scope.lock = {}; + // Create the login modal that we will use later + $ionicModal.fromTemplateUrl('templates/Aouth.html', { + scope: $scope + }).then(function(modal) { + $scope.modal = modal; + }); $scope.update = function(){ console.log("[JCE] [info]: Refreshing..."); @@ -369,12 +368,22 @@ $scope.logout = function(){ }; $scope.goToGrades = function(){ - window.localStorage['newGrades'] = "false"; - $scope.newGrades = false; - $ionicViewService.nextViewOptions({ - disableBack: true - }); - $location.path( "/app/grades" ); + var localSettingsStr = window.localStorage['Settings'] || null; + if (localSettingsStr !== null){ + var isLocked = (JSON.parse(localSettingsStr))[0].val; + } + if(isLocked){ + console.log("[JCE] [INFO]: Grades Locked"); + $scope.modal.show(); + } + else{ + window.localStorage['newGrades'] = "false"; + $scope.newGrades = false; + console.log("Unlocked"); + $ionicViewService.nextViewOptions({ + disableBack: true }); + $location.path( "/app/grades" ); + } }; $scope.isLoggedIn = function(){ @@ -388,7 +397,6 @@ $scope.logout = function(){ // }); - $scope.version = "0.1.13alfa-develop_perview"; if(window.localStorage['newNotes'] == "true"){ $scope.newNotes = true; @@ -404,7 +412,37 @@ $scope.logout = function(){ + // Triggered in the Aouth modal to close it + $scope.closeAouth = function() { + $scope.modal.hide(); + }; + // Aouth for Grades + $scope.Aouth = function() { + console.log("Clicked GoOn - password enterd: "+ $scope.lock.password + "\nThe logs pass is: "+window.localStorage['password']); + + if($scope.lock.password === (window.localStorage['password'] || null)){ //ok + $scope.lock.password = ""; + $scope.modal.hide(); + window.localStorage['newGrades'] = "false"; + $scope.newGrades = false; + $ionicViewService.nextViewOptions({ + disableBack: true }); + + $location.path( "/app/grades" ); + }else{ + var alertPopup = $ionicPopup.alert({ + title: 'סיסמה שגוייה', + template: 'טעות בסיסמה' + }); + alertPopup.then(function(res) { + $scope.modal.hide(); + }); + } + }; +////////////////////////////////////////////////////////// + $scope.version = "0.1.28alpha-develop_perview"; +///////////////////////////////////////////////////////// }); diff --git a/www/templates/Aouth.html b/www/templates/Aouth.html new file mode 100644 index 0000000..40ff70e --- /dev/null +++ b/www/templates/Aouth.html @@ -0,0 +1,23 @@ + + +

הגיליון נעול

+
+ +
+
+ +
+
+
+ + +
+
+
+
+
diff --git a/www/templates/aguda.html b/www/templates/aguda.html new file mode 100644 index 0000000..83d675c --- /dev/null +++ b/www/templates/aguda.html @@ -0,0 +1,91 @@ + + +
+ +

אגודת הסטודנטים

+ +

גרסת פיתוח - הנתונים כאן לא מתעדכנים!

+ + +
+ +
+ +

פאנג'ויה!

+

November 05, 1955

+
+ +
+ +

את הטפסים יש לשלוח בדיוק בשעה שקיבלתם בהרשמה לתורים.

*** טפסים להורדה:
www.funjoya.co.il/funjoya-form-jr2015.pdf

***בעת הגשת הטפסים פיזית/בדוא"ל יתבצע אימות לשעה ולתאריך ע"פ מספר תעודת הזהות. סטודנט אשר לא יפעל על פי ההוראות, הזמנתו לא תתקבל.

+

+ 1 Like + 5 Comments +

+
+ + + +
+ + +
+ +
+ +

טורניר שש בש

+

November 04, 2014

+
+ +
+ + הטורניר השנתי ממשיך... +

+ 7 Like + 5 Comments +

+
+ + + +
+ + + + + + +
+
+
+ + + + + diff --git a/www/templates/grades.html b/www/templates/grades.html index 76d2279..ee19583 100644 --- a/www/templates/grades.html +++ b/www/templates/grades.html @@ -3,28 +3,6 @@

גיליון ציונים

- - - - -
diff --git a/www/templates/login.html b/www/templates/login.html deleted file mode 100644 index 00759fe..0000000 --- a/www/templates/login.html +++ /dev/null @@ -1,25 +0,0 @@ - - -

התחבר

-
- -
-
- -
-
- - - -
-
-
-
diff --git a/www/templates/menu.html b/www/templates/menu.html index e7a1ab4..7788455 100644 --- a/www/templates/menu.html +++ b/www/templates/menu.html @@ -4,48 +4,62 @@ - - - +

תפריט

+ +
diff --git a/www/templates/settings.html b/www/templates/settings.html new file mode 100644 index 0000000..0288476 --- /dev/null +++ b/www/templates/settings.html @@ -0,0 +1,47 @@ + + +
+

הגדרות

+ +
+
    +
  • + {{ setting.text }} + +
  • +
+
+ +

אודות

+
+ +
+ +

שגיא דיין

+

מפתח ראשי

+
+ +
+ +

+ התוכנה נוצרה למען הסטודנטים. +

+

+ כל הקוד זמין בgithub - וכך גם הוראות הבניה והקימפול. +
הרישיון של תוכנה זו היא כדלקמן: "עשה מה שבא לך - לא מעניין אותי" +

+ + + + +
+ + +
+ + \ No newline at end of file