-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.js
60 lines (54 loc) · 1.88 KB
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
let loginBtn = document.getElementById('login-btn');
let signupBtn = document.getElementById('signup-btn');
let submitBtn = document.getElementById('submit-btn');
let btnShift = document.querySelector('#btn-shift');
let currClicked = 'Login';
loginBtn.addEventListener('click', () => {
currClicked = 'Login';
submitBtn.innerHTML = currClicked;
btnShift.style.left = 0;
btnShift.style.right = 'intial';
});
signupBtn.addEventListener('click', () => {
currClicked = 'Register';
submitBtn.innerHTML = currClicked;
btnShift.style.right = 0;
btnShift.style.left = 'initial';
});
submitBtn.addEventListener('click', () => {
let email = document.querySelector('#email').value;
let password = document.querySelector('#password').value;
let jsonData = {
type: currClicked,
email: email,
password: password
}
chrome.runtime.sendMessage(jsonData);
window.close();
})
// let amazonextension = angular.module('amazonextension', ['ui.router'])
// amazonextension.config([
// '$stateProvider',
// '$urlRouterProvider',
// function ($stateProvider, $urlRouterProvider) {
// $stateProvider
// .state('home', {
// url: '/home',
// templateUrl: 'home.html',
// controller: 'home'
// })
// .state('login', {
// url: '/login',
// templateUrl: 'login.html',
// controller: 'login'
// })
// $urlRouterProvider.otherwise('login');
// }
// ]);
// let loginForm = angular.module('loginForm', []);
// loginForm.controller('myForm', ['$scope', function ($scope) {
// $scope.customEmail = 'shm@gmail.com';
// $scope.customPassword = '';
// console.log($scope.customEmail);
// console.log($scope.customPassword);
// }]);