From bc4d21e38203879a9a9d314e723904975a5cd6cc Mon Sep 17 00:00:00 2001 From: Stefan Yohansson Date: Mon, 21 Sep 2015 15:20:30 +0000 Subject: [PATCH] FS-8095 [verto_communicator] added reset button to default settings. --- .../src/partials/modal_settings.html | 1 + .../src/storageService/services/storage.js | 70 +++++++++---------- .../controllers/ModalSettingsController.js | 4 ++ 3 files changed, 39 insertions(+), 36 deletions(-) diff --git a/html5/verto/verto_communicator/src/partials/modal_settings.html b/html5/verto/verto_communicator/src/partials/modal_settings.html index ba7d03940e..dc08dbb9cc 100644 --- a/html5/verto/verto_communicator/src/partials/modal_settings.html +++ b/html5/verto/verto_communicator/src/partials/modal_settings.html @@ -24,6 +24,7 @@ Refresh device list + Factory reset
diff --git a/html5/verto/verto_communicator/src/storageService/services/storage.js b/html5/verto/verto_communicator/src/storageService/services/storage.js index b457678b35..69e7894f79 100644 --- a/html5/verto/verto_communicator/src/storageService/services/storage.js +++ b/html5/verto/verto_communicator/src/storageService/services/storage.js @@ -4,39 +4,40 @@ .module('storageService') .service('storage', ['$rootScope', '$localStorage', function($rootScope, $localStorage) { - var data = $localStorage; + var data = $localStorage, + defaultSettings = { + ui_connected: false, + ws_connected: false, + cur_call: 0, + called_number: '', + useVideo: true, + call_history: {}, + history_control: [], + call_start: false, + name: '', + email: '', + login: '', + password: '', + userStatus: 'disconnected', + mutedVideo: false, + mutedMic: false, + selectedVideo: null, + selectedAudio: null, + selectedShare: null, + useStereo: true, + useSTUN: true, + useDedenc: false, + mirrorInput: false, + outgoingBandwidth: 'default', + incomingBandwidth: 'default', + vidQual: undefined, + askRecoverCall: false, + googNoiseSuppression: true, + googHighpassFilter: true, + googEchoCancellation: true + }; - data.$default({ - ui_connected: false, - ws_connected: false, - cur_call: 0, - called_number: '', - useVideo: true, - call_history: {}, - history_control: [], - call_start: false, - name: '', - email: '', - login: '', - password: '', - userStatus: 'disconnected', - mutedVideo: false, - mutedMic: false, - selectedVideo: null, - selectedAudio: null, - selectedShare: null, - useStereo: true, - useSTUN: true, - useDedenc: false, - mirrorInput: false, - outgoingBandwidth: 'default', - incomingBandwidth: 'default', - vidQual: undefined, - askRecoverCall: false, - googNoiseSuppression: true, - googHighpassFilter: true, - googEchoCancellation: true - }); + data.$default(defaultSettings); function changeData(verto_data) { jQuery.extend(true, data, verto_data); @@ -46,10 +47,7 @@ data: data, changeData: changeData, reset: function() { - data.ui_connected = false; - data.ws_connected = false; - data.cur_call = 0; - data.userStatus = 'disconnected'; + data.$reset(defaultSettings); }, }; } diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js index 48e430d578..4d2ba0d442 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js @@ -25,6 +25,10 @@ $scope.refreshDeviceList = function() { return verto.refreshDevices(); } + + $scope.resetSettings = function() { + storage.reset(); + } } ]);