AnatTestController.js
7.41 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
AIA.controller("AnatTestController", ["$scope", "$rootScope", "pages", "$log", "$location",
function ($scope, $rootScope, pages, log, $location) {
$scope.showTabButton = false;
$scope.IsVisible = function () {
$scope.scroll();
}
$scope.scroll = function () {
// $window.scrollTo(0, 0);
$("html,body").scrollTop(0);
//alert("scroll");
}
$scope.openAIAFlexAnatomyTest = function () {
var userInfo;
var encryptedUserName;
var encryptedPassword
var urlPrams;
var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OA");
var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHw");
if ($rootScope.isCallFromSite) {
if ($rootScope.IsCalsCred) {
encryptedUserName = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.username, key, { iv: iv });
encryptedPassword = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.password, key, { iv: iv });
if($location.host()=="qa.beta.interactiveanatomy.com")
{
if($rootScope.accessOldCurriculum)
{
window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7');
}
else
{
window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=8');
}
}
else
{
if($rootScope.accessOldCurriculum)
{
window.open('http://legacy.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7');
}
else
{
window.open('http://legacy.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=8');
}
}
$rootScope.accessOldCurriculum=false;
$location.url('/');
}
else {
var siteUrlInfo = JSON.parse(localStorage.getItem("siteUrlInfo"));
var encryptedSiteIP = CryptoJS.AES.encrypt(siteUrlInfo.siteIP, key, { iv: iv });
var encryptedAccountNumber = CryptoJS.AES.encrypt(siteUrlInfo.accountNumber, key, { iv: iv });
var encryptedEdition = siteUrlInfo.edition;
var encryptedUrlReferer = CryptoJS.AES.encrypt(siteUrlInfo.urlReferer, key, { iv: iv });
var encryptedSiteId = $rootScope.siteId;
var encryptedRemoteIPAddress = CryptoJS.AES.encrypt(siteUrlInfo.remoteIPAddress, key, { iv: iv });
console.log("encryptedSiteIP = " + encryptedSiteIP + ",encryptedAccountNumber= " + encryptedAccountNumber + ",encryptedEdition= " + encryptedEdition + ",encryptedUrlReferer= " + encryptedUrlReferer + ", encryptedSiteId= " + encryptedSiteId + ", encryptedRemoteIPAddress=" + encryptedRemoteIPAddress);
/* var encryptedSiteIP = CryptoJS.AES.encrypt(siteIp, key, { iv: iv });
var encryptedAccountNumber = CryptoJS.AES.encrypt(accountNo, key, { iv: iv });
var encryptedEdition = editionId;//CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv });
var encryptedUrlReferer = urlRef ;
var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv });
var encryptedSiteId = $rootscope.siteId;*/
if($location.host()=="qa.beta.interactiveanatomy.com")
{
if($rootScope.accessOldCurriculum)
{
window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=7' + '&s=' + encryptedSiteId);
}
else
{
window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=8' + '&s=' + encryptedSiteId);
}
}
else
{
if($rootScope.accessOldCurriculum)
{
window.open('http://legacy.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=7' + '&s=' + encryptedSiteId);
}
else
{
window.open('http://legacy.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=8' + '&s=' + encryptedSiteId);
}
}
$rootScope.accessOldCurriculum=false;
$location.url('/');
}
}
else {
userInfo = ($rootScope.userData);
var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv });
var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv });
if($location.host()=="qa.beta.interactiveanatomy.com")
{
if($rootScope.accessOldCurriculum)
{
window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7');
}
else
{
window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=8');
}
}
else
{
if($rootScope.accessOldCurriculum)
{
window.open('http://legacy.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7');
}
else
{
window.open('http://legacy.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=8');
}
}
$rootScope.accessOldCurriculum=false;
$location.url('/');
}
}
$scope.$on('$viewContentLoaded', function (event) {
// code that will be executed ...
// every time this view is loaded
//get current path
var currentURL = $location.path();
var selectedModuleName = '';
//set module title
angular.forEach($rootScope.userModules, function (value, key) {
if (value.slug === currentURL.replace('/', '')) {
selectedModuleName = value.name;
}
$rootScope.currentActiveModuleTitle = selectedModuleName;
})
})
// $rootScope.currentActiveModuleTitle = pages[7].name;
}]
);