summaryrefslogtreecommitdiffstats
path: root/templates/html5/app/Frontend/pages/SampleHome/SampleHome.js
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-18 17:49:35 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:20 +0200
commita808486bae230c982a05980a0a28c00a43c05d3a (patch)
tree4e447c8c6622f3703a006da242885a0b1b60cece /templates/html5/app/Frontend/pages/SampleHome/SampleHome.js
parent6daf741824b7c6e1c60b7a26fc91c454876f7392 (diff)
Git repo can be used as submodules
Clean templates files as they are useless for usage in submodules into a project. Change-Id: I24c71b64ab2b3a958494f3f190c014227a1da576 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'templates/html5/app/Frontend/pages/SampleHome/SampleHome.js')
-rw-r--r--templates/html5/app/Frontend/pages/SampleHome/SampleHome.js104
1 files changed, 0 insertions, 104 deletions
diff --git a/templates/html5/app/Frontend/pages/SampleHome/SampleHome.js b/templates/html5/app/Frontend/pages/SampleHome/SampleHome.js
deleted file mode 100644
index 1e404b8..0000000
--- a/templates/html5/app/Frontend/pages/SampleHome/SampleHome.js
+++ /dev/null
@@ -1,104 +0,0 @@
-(function() {
-'use strict';
-
-// WARNING: make sure than app/frontend/services/AppConfig.js match your server
-
-// list all rependencies within the page + controler if needed
-angular.module('SampleHomeModule', ['SubmitButton', 'TokenRefresh','ModalNotification'])
-
- .controller('SampleHomeController', function (AppCall, Notification) {
- var scope = this; // I hate JavaScript
- scope.uuid ="none";
- scope.token ="none";
- scope.session="none";
- scope.status ="err-no";
-
- console.log ("Home Controller");
-
- scope.OnResponse= function(jresp, errcode) {
-
- // Update UI response global display zone
- scope.status = jresp.request.status;
- scope.errcode = errcode;
- scope.request = jresp.request;
- scope.response = jresp.response;
-
- var action=jresp.request.reqid.toUpperCase();
-
- switch (action) {
- case 'CONNECT':
- if (jresp.request.status !== "success") {
- Notification.error ({message: action + ": Logout before reconnecting", delay: 5000});
- scope.class [jresp.request.reqid]="fail";
- return;
- }
- scope.class={}; // reset CSS buttons classes
- break;
-
- case 'LOGOUT':
- if (jresp.request.status !== "success") {
- Notification.error ({message: action + ": Do connect first", delay: 5000});
- scope.class [jresp.request.reqid]="fail";
- return;
- }
- scope.class={}; // reset CSS buttons classes
- break;
-
- case 'REFRESH':
- case 'CHECK':
- if (jresp.request.status !== "success") {
- Notification.error ({message: action + ": Need to be Connected to check/refresh session", delay: 5000});
- scope.class [jresp.request.reqid]="fail";
- return;
- }
-
- break;
-
- default:
- Notification.error ({message: "Invalid RequestID:" + jresp.request.reqid , delay: 5000});
- return;
- }
-
- // update button classes within home.html
- scope.class [jresp.request.reqid]="success";
- console.log ("OK: "+ JSON.stringify(jresp));
- };
-
- scope.ProcessError= function(response, errcode, config) {
- Notification.error ({message: "Invalid API:" + response.request.reqid , delay: 5000});
- scope.status = "err-fx";
- scope.errcode = errcode;
- scope.request = response.request;
- scope.response = "";
- console.log ("FX: "+ JSON.stringify(response));
- };
-
- scope.ConnectClient = function() {
- console.log ("ConnectClient");
- AppCall.get ("auth", "connect", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
- };
-
- scope.CheckSession = function() {
- console.log ("CheckSession");
- AppCall.get ("auth", "check", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
-
- };
-
- scope.RefreshSession = function() {
- console.log ("RefreshSession");
- AppCall.get ("auth", "refresh", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
- };
-
- scope.LogoutClient = function() {
- console.log ("LogoutClient");
- AppCall.get ("auth", "logout", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
- };
-
- scope.Initialised = function () {
- scope.class = {connect: "success"};
- };
-
- });
-
-console.log ("SampleControler Loaded");
-})();