Commit 63560c2e9f2508d0d35c79f3670efe424ba6003f

Authored by Nikita Kulshreshtha
2 parents 519b7396 2b8b72c8

manually merged CALandscapeIssue into develop.

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
Changes suppressed. Click to show
1   -'use strict';
2   -
3   -AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", "AIAConstants",
4   -function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants,AIAConstants) {
5   -
6   - //$scope.pageToOpen = {
7   - // name: 'MainMenu'
8   - //};
9   - $rootScope.pageToOpen = 'app/widget/MainMenu.html';
10   - $rootScope.currentBodyViewId;
11   - $rootScope.currentActiveModuleTitle = 'Welcome to A.D.A.M. Interactive Anatomy';//Modules[0].Name;
12   - $rootScope.currentActiveViewTitle;
13   - $rootScope.cuurentActiveModuleId;
14   - $rootScope.openModules = [];
15   - $rootScope.openViews = [];
16   - $rootScope.currentSlug;
17   - $rootScope.jsPanelTitle;
18   - $rootScope.ViewTitle;
19   - $rootScope.isLoading = false;
20   - $rootScope.isAnnotationWindowOpen = false;
21   - $rootScope.isDrawingToolSelected = false;
22   - $rootScope.isIdetifyClicked = true;
23   - $rootScope.paint = false;
24   - $rootScope.clickX = new Array();
25   - $rootScope.clickY = new Array();
26   - $rootScope.clickDrag = new Array();
27   - $rootScope.isLineDrawSelecyed = false;
28   - $rootScope.isAnnotationWindowClose = false;
29   - $rootScope.setListManagerZindex = false;
30   - $rootScope.lastX;
31   - $rootScope.lastY;
32   - $rootScope.CommonData;
33   - $rootScope.shapeType;
34   - $rootScope.globalSetting = {
35   - ethnicity: 'W',
36   - modesty: 'Y',
37   - };
38   - $rootScope.formsetting = {
39   - ethnicity: null,
40   - modesty: null
41   - };
42   -
43   - // on refersh this variable will also get null that is why we are only checking this variable on initialize that if it is null that means page gets refershed.
44   - $rootScope.refreshcheck = null;
45   - $rootScope.isCloseSettingClicked = false;
46   -
47   -
48   - $rootScope.isModestyOn;
49   - $rootScope.isModestyOff;
50   - $rootScope.SetSettingActiveTab;
51   - $rootScope.disableMenuannotation = "disableMenuannotation";
52   - $rootScope.disableMenuoption = "disableMenuoption";
53   - $rootScope.menuLabExer;
54   - $rootScope.menuLabExer = 0;
55   -
56   -
57   - $rootScope.fontSizes;
58   - $rootScope.fontWeight;
59   - $rootScope.fontStyle;
60   - $rootScope.textAlignmt;
61   - $rootScope.fontColor;
62   - $rootScope.underlineText;
63   - $rootScope.textArea;
64   - $rootScope.fontFamily;
65   - $rootScope.TextPropertyArray = [];
66   - $rootScope.modifySavedText = [];
67   - $rootScope.TextRectangleArr = [];
68   - $rootScope.rectDimension = [];
69   - $rootScope.isMousedownOnPaintCanvas = false;
70   - //opacity code
71   - $rootScope.shapestyleOpacity = 1;
72   - $rootScope.shapestyleFillColor = "#fff";
73   - $rootScope.shapestyleFillBorderColor = "black";
74   - $rootScope.shapestyleborderWidth = 2;
75   - $rootScope.shapestyleborderStyles = "solid";
76   - //$rootScope.errorMessage = ''; // Commented initialization to retain message when coming to login after password reset success screen
77   - $rootScope.disableFileMenu = "disableFileMenu";
78   -
79   - $rootScope.userInfo = {
80   - username: null,
81   - password: null,
82   - emailId: null,
83   - newPassword: null,
84   - confirmPassword: null,
85   - userMessage: null,
86   - unblockUser: false,
87   - isMailForForgotPassword:false
88   - };
89   - $rootScope.userLicenseInfo = {
90   - userLicenseId: 0,
91   - licenseeAccountNumber: null
92   - };
93   - $rootScope.userData;
94   - $rootScope.userModules;
95   - $rootScope.passwordMismatchMessage;
96   - $rootScope.isVisibleLogin;
97   - $rootScope.haveRoleAdmin;
98   - $rootScope.checked = false;
99   - var isfilloptionChecked = "";
100   - var isOutlineOptionChecked = "";
101   - $rootScope.forgotPwdModalShow = function () {
102   - document.getElementById("forgetPwdForm").reset()
103   - $("#forgotPwdModal").modal("show");
104   - $(".modal-backdrop").css("opacity", ".5");
105   - $("body.modal-open").css("padding-right", "0px");
106   - }
107   - $rootScope.forgotUserModalShow = function () {
108   - document.getElementById("forgetUSerIdForm").reset();
109   - $("#forgotUserModal").modal("show");
110   - $(".modal-backdrop").css("opacity", ".5");
111   - $("body.modal-open").css("padding-right", "0px");
112   -
113   - }
114   -
115   - $rootScope.promptUserForCookies= function()
116   - {
117   - $rootScope.errorMessage = AIAConstants.COOKIES_MESSAGE;
118   - $("#messageModal").modal('show');
119   -
120   - }
121   -
122   -
123   - $rootScope.initializeAIA = function () {
124   -
125   - if (navigator.cookieEnabled) {
126   -
127   - $rootScope.isLoading = false;
128   -
129   - var url = $location.url();
130   -
131   - //unblock user
132   - if (url.indexOf('?unb:') != -1) {
133   -
134   - $rootScope.isVisibleLogin = true;
135   - $rootScope.UnblockUser();
136   - }
137   - else if (url.indexOf('?em:') != -1) {
138   -
139   - $rootScope.isVisibleLogin = false;
140   - $rootScope.isVisibleResetPass = true;
141   - }
142   - else {
143   - $rootScope.isVisibleLogin = true;
144   - $rootScope.isVisibleResetPass = false;
145   - getUserDetails();
146   - }
147   - }
148   -
149   - else {
150   -
151   - $rootScope.isVisibleLogin = true;
152   -
153   - $rootScope.promptUserForCookies();
154   - }
155   -
156   -
157   - }
158   -
159   - $rootScope.AuthenticateUser = function (userInfo)
160   - {
161   - if (navigator.cookieEnabled) {
162   -
163   - $rootScope.errorMessage = "";
164   - if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) {
165   -
166   - // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING);
167   - $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING;
168   - $("#messageModal").modal('show');
169   - }
170   - else {
171   -
172   - AuthenticationService.authenticateUser(userInfo)
173   - .then(
174   -
175   - function (result) {
176   - if (result == LoginConstants.USER_NOT_FOUND) {
177   - $rootScope.isVisibleLogin = true;
178   - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
179   - $rootScope.errorMessage = LoginMessageConstants.INVALID_USER;
180   - $("#messageModal").modal('show');
181   - }
182   - else {
183   - if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) {
184   -
185   - if ($("#messageModal").length > 0) {
186   - $("#messageModal").modal('hide');
187   - }
188   - if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_PASSWORD_NOT_MATCH) {
189   - $rootScope.isVisibleLogin = true;
190   - $rootScope.errorMessage = LoginMessageConstants.INVALID_PASSWORD;
191   - $("#messageModal").modal('show');
192   - }
193   - else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_ID_BLOCKED_24_HRS) {
194   - $rootScope.isVisibleLogin = true;
195   - $rootScope.errorMessage = LoginMessageConstants.USER_BLOCKED;
196   - $("#messageModal").modal('show');
197   - }
198   - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) {
199   - $rootScope.isVisibleLogin = true;
200   - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
201   - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
202   - $("#messageModal").modal('show');
203   - }
204   - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) {
205   - $rootScope.isVisibleLogin = true;
206   - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
207   - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
208   - $("#messageModal").modal('show');
209   - }
210   - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) {
211   - $rootScope.isVisibleLogin = true;
212   - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
213   - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
214   - $("#messageModal").modal('show');
215   - }
216   - else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) {
217   - $rootScope.isVisibleLogin = true;
218   - $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
219   - $("#messageModal").modal('show');
220   - }
221   - else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) {
222   - $rootScope.isVisibleLogin = true;
223   - $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE;
224   - $("#messageModal").modal('show');
225   - }
226   - else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) {
227   - $rootScope.isVisibleLogin = true;
228   - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
229   - $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE;
230   - $("#messageModal").modal('show');
231   - }
232   - else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) {
233   - $rootScope.isVisibleLogin = true;
234   - $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
235   - $("#messageModal").modal('show');
236   - }
237   - else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) {
238   - $rootScope.isVisibleLogin = true;
239   - $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE;
240   - $("#messageModal").modal('show');
241   - }
242   - else {
243   -
244   - //if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) &&
245   - if (result.LicenseId == 0 && result.IsActive) {
246   - $rootScope.userData = result;
247   - $rootScope.userModules = result.Modules;
248   - $rootScope.isVisibleLogin = false;
249   - $rootScope.haveRoleAdmin = true;
250   - localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
251   - ShowAssignedModulesPopup(result.Modules);
252   - $location.path('/');
253   -
254   - }
255   - else {
256   - if (result.LicenseInfo != null && result.LicenseInfo.IsTermAccepted) {
257   - $rootScope.userData = result;
258   - $rootScope.userModules = result.Modules;
259   - $rootScope.isVisibleLogin = false;
260   - $rootScope.haveRoleAdmin = false;
261   - localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
262   - ShowAssignedModulesPopup(result.Modules);
263   - $location.path('/');
264   -
265   - }
266   - else {
267   - if ($('#dvTerms').length > 0) {
268   - $('#dvTerms').html(result.TermsAndConditionsText);
269   - }
270   - $rootScope.isVisibleLogin = true;
271   - $('#dvTermCondition').fadeIn();
272   - $rootScope.userData = result;
273   - $rootScope.haveRoleAdmin = false;
274   - localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
275   - $location.path('/');
276   - }
277   - }
278   -
279   - }
280   -
281   - }
282   - }
283   - }),
284   -
285   - function (error) {
286   - console.log(' Error in authentication = ' + error.statusText);
287   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
288   - $rootScope.isVisibleLogin = true;
289   - $rootScope.errorMessage = error;
290   - $("#messageModal").modal('show');
291   - }
292   - }
293   - }
294   -
295   - else
296   - {
297   - $rootScope.promptUserForCookies();
298   - }
299   -
300   - }
301   -
302   - function ShowAssignedModulesPopup(userModules) {
303   - var allModules = Modules;
304   - var arrPendingModules = [];
305   - if ($('#dvPendingModules').length > 0) {
306   - $('#dvPending').hide();
307   - }
308   - for (var module = 1; module <= allModules.length; module++) {
309   - $('#moduleDiv' + module).hide();
310   - }
311   - if (('#moduleDiv1017').length > 0) {
312   - $('#moduleDiv1017').hide();
313   - }
314   -
315   - for (var count = 0; count < userModules.length; count++) {
316   - for (var module = 0; module < allModules.length; module++) {
317   - if (userModules[count].id == allModules[module].Id) {
318   - $('#moduleDiv' + userModules[count].id).show();
319   - break;
320   - }
321   -
322   - if (userModules[count].id == 7)
323   - arrPendingModules.push(userModules[count].id);
324   - if (userModules[count].id == 8)
325   - arrPendingModules.push(userModules[count].id);
326   - if (userModules[count].id == 10)
327   - arrPendingModules.push(userModules[count].id);
328   - }
329   - }
330   - if (userModules.length > 0) {
331   - $('#dvUserModulesInfo').modal('show');
332   - }
333   -
334   - if (arrPendingModules.length > 0) {
335   - $('#dvPendingModules').show();
336   - }
337   - }
338   - $rootScope.UpdateLicenseTermStatus = function () {
339   - $('#dvTermCondition').fadeOut();
340   - var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails');
341   - if (currentUserDetails) {
342   - var userInfo = JSON.parse(currentUserDetails);
343   - }
344   - if (userInfo.LicenseInfo.AccountNumber != null && userInfo.LicenseInfo.Id != 0) {
345   - $rootScope.userLicenseInfo.userLicenseId = userInfo.LicenseInfo.Id;
346   - $rootScope.userLicenseInfo.licenseeAccountNumber = userInfo.LicenseInfo.AccountNumber;
347   -
348   - AuthenticationService.UpdateLicenseTerm($rootScope.userLicenseInfo)
349   - .then(function (result) {
350   - if (result.Modules !=="" && result.Modules !== null) { // LoginMessageConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) {
351   - console.log(' Term and Condition acceptance status updated successfully.');
352   - if (currentUserDetails) {
353   - var userInfo = JSON.parse(currentUserDetails);
354   - userInfo.Modules = result.Modules;
355   -
356   - if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) {
357   - $rootScope.isVisibleLogin = false;
358   - $rootScope.userData = userInfo;
359   - $rootScope.userModules = userInfo.Modules;
360   - ShowAssignedModulesPopup(userInfo.Modules);;
361   - }
362   - }
363   - }
364   - else if (result = LoginConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED) {
365   - console.log(result);
366   - $rootScope.isVisibleLogin = true;
367   - $('#dvTermCondition').fadeIn();
368   - $rootScope.errorMessage = LoginConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED;
369   - $("#messageModal").modal('show');
370   - $("#messageModal").css("z-index", 111112);
371   - localStorage.removeItem("loggedInUserDetails");
372   - }
373   -
374   - },
375   - function (error) {
376   - console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText
377   - $rootScope.isVisibleLogin = true;
378   - $rootScope.isVisibleLogin = true;
379   - $rootScope.errorMessage = error;
380   - $("#messageModal").modal('show');
381   - $('#dvTermCondition').fadeIn();
382   - });
383   - }
384   - };
385   -
386   -
387   - $rootScope.LogoutUser = function () {
388   - localStorage.removeItem('loggedInUserDetails');
389   - localStorage.clear();
390   - document.location = '/';
391   - $rootScope.isVisibleLogin = true;
392   - }
393   -
394   - function getUserDetails() { //Retain logged in user details
395   - var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails');
396   - if (currentUserDetails) {
397   - try {
398   - var userInfo = JSON.parse(currentUserDetails);
399   -
400   - if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) {
401   -
402   - if (userInfo.UserType == UserTypeConstants.SUPER_ADMIN && userInfo.IsActive) { //(!result.IsSubscriptionExpired) &&
403   -
404   - $rootScope.userData = userInfo;
405   -
406   - $rootScope.userModules = userInfo.Modules;
407   -
408   - $rootScope.isVisibleLogin = false;
409   - $rootScope.haveRoleAdmin = true;
410   -
411   - if ($rootScope.refreshcheck == null) {
412   -
413   - $location.path('/');
414   -
415   - }
416   - }
417   -
418   - else
419   - {
420   - $rootScope.haveRoleAdmin = false;
421   -
422   - if (userInfo.LicenseInfo.IsTermAccepted) {
423   - $rootScope.userData = userInfo;
424   - $rootScope.userModules = userInfo.Modules;
425   - $rootScope.isVisibleLogin = false;
426   - //$rootScope.haveRoleAdmin = true;
427   -
428   - if ($rootScope.refreshcheck == null) {
429   - $location.path('/');
430   - }
431   -
432   - }
433   - else {
434   - if ($('#dvTerms').length > 0) {
435   - $('#dvTerms').html(userInfo.TermsAndConditionsText);
436   - }
437   - $rootScope.isVisibleLogin = true;
438   - $('#dvTermCondition').fadeIn();
439   - $rootScope.userData = userInfo;
440   - $rootScope.userModules = userInfo.Modules;
441   - //$rootScope.haveRoleAdmin = true;
442   - $location.path('/');
443   - }
444   - }
445   - }
446   - }
447   - catch (e) {
448   - localStorage.removeItem('loggedInUserDetails');
449   - }
450   - }
451   - }
452   -
453   - $rootScope.SendMailToUser = function (userInfo, isMailForForgotPassword) {
454   - //
455   -
456   - if ((userInfo.emailId != null) && (userInfo.emailId != '')) {
457   - if (validateEmail(userInfo.emailId)) {
458   - if (isMailForForgotPassword) {
459   -
460   - var selectedOption = $("input[name='inlineRadioOptions']:checked").val();
461   -
462   - if (selectedOption == LoginMessageConstants.UNBLOCK_SELECTED) {
463   - userInfo.unblockUser = true;
464   - userInfo.isMailForForgotPassword = true;
465   - }
466   - else if (selectedOption == LoginMessageConstants.FORGOT_PASSWORD_SELECTED) {
467   - userInfo.unblockUser = false;
468   - userInfo.isMailForForgotPassword = true;
469   - }
470   - }
471   - else
472   - userInfo.isMailForForgotPassword = false;
473   -
474   - AuthenticationService.SendMailToUser(userInfo)
475   - .then(function (result) {
476   - if (result == LoginConstants.USER_NOT_FOUND) {
477   - removeEmailPopUp();
478   - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
479   - $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
480   - $("#messageModal").modal('show');
481   - }
482   - else if (result == LoginConstants.MAIL_NOT_SENT) {
483   - removeEmailPopUp();
484   - // alert(LoginMessageConstants.MAIL_NOT_SENT);
485   - $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT;
486   - $("#messageModal").modal('show');
487   - }
488   - else {
489   - if (result == LoginMessageConstants.MAIL_SENT) {
490   - var message;
491   - removeEmailPopUp();
492   -
493   - if (isMailForForgotPassword) {
494   - if (userInfo.unblockUser)
495   - message = LoginMessageConstants.USER_UNBLOCK_LINK_IN_EMAIL;
496   - else
497   - message = LoginMessageConstants.RESET_PASSWORD;
498   - }
499   - else
500   - message = LoginMessageConstants.USERID_SENT_IN_EMAIL
501   - //alert(message);
502   - $rootScope.errorMessage = message;
503   - $("#messageModal").modal('show');
504   -
505   -
506   - }
507   - }
508   -
509   - },
510   - function (error) {
511   - console.log(' Error in authentication = ' + error.statusText);
512   - removeEmailPopUp();
513   - // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS);
514   - $rootScope.errorMessage = error;
515   - $("#messageModal").modal('show');
516   - });
517   - }
518   - else {
519   - // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
520   - removeEmailPopUp();
521   - $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
522   - $("#messageModal").modal('show');
523   - }
524   - }
525   - else {
526   - //alert(LoginMessageConstants.BLANK_EMAIL_ID);
527   - removeEmailPopUp();
528   - $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID;
529   - $("#messageModal").modal('show');
530   -
531   - }
532   - };
533   -
534   - function removeEmailPopUp()
535   - {
536   - if ($('#forgotUserModal').length > 0) {
537   - $('#forgotUserModal').fadeOut();
538   - $('#forgotUserModal').modal('hide');
539   - }
540   - if ($('#forgotPwdModal').length > 0) {
541   - $('#forgotPwdModal').fadeOut();
542   - $('#forgotPwdModal').modal('hide');
543   - }
544   - }
545   -
546   -
547   - function validateEmail(email) {
548   - var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
549   - return re.test(email);
550   - }
551   -
552   - $rootScope.ResetUserPassword = function (userInfo) {
553   -
554   - var url = $location.url();
555   - if (url.indexOf('?em:') != -1) {
556   - var split = url.split('?em:');
557   - userInfo.emailId = split[1];
558   - }
559   -
560   - if (userInfo.newPassword != null) {
561   -
562   - if (userInfo.newPassword === userInfo.confirmPassword) {
563   - $rootScope.passwordMismatchMessage = null;
564   -
565   - AuthenticationService.ResetUserPassword(userInfo)
566   - .then(
567   - function (result) {
568   - if (result == LoginConstants.USER_NOT_FOUND) {
569   - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
570   - $rootScope.errorMessage = LoginMessageConstants.USER_NOT_FOUND;
571   - $("#messageModal").modal('show');
572   -
573   - }
574   - else if (result == LoginConstants.EXCEPTION_OCCURED) {
575   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
576   - $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
577   - $("#messageModal").modal('show');
578   -
579   - }
580   - else if (result == LoginConstants.SQL_CONNECTION_ERROR) {
581   - $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE;
582   - $("#messageModal").modal('show');
583   - }
584   - else {
585   - //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) {
586   - if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) {
587   - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE);
588   - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
589   - $("#messageModal").modal('show');
590   - $rootScope.isVisibleLogin = true;
591   - $rootScope.isVisibleResetPass = false;
592   - $location.url("/");
593   - }
594   - else {
595   - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_FAILURE;
596   - $("#messageModal").modal('show');
597   - $rootScope.isVisibleLogin = true;
598   - $rootScope.isVisibleResetPass = false;
599   - $location.url("/");
600   - }
601   - }
602   - },
603   - function (error) {
604   - console.log(' Error in authentication = ' + error.statusText);
605   - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
606   - $rootScope.errorMessage = error;
607   - $("#messageModal").modal('show');
608   -
609   - });
610   - }
611   - else {
612   - $rootScope.errorMessage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH;
613   - $("#messageModal").modal('show');
614   - }
615   - }
616   - else {
617   - $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY;
618   - $("#messageModal").modal('show');
619   - }
620   -
621   - }
622   -
623   - $rootScope.UnblockUser = function () {
624   -
625   - var userEmailId = '';
626   - var url = $location.url();
627   -
628   - var split = url.split('?unb:');
629   - userEmailId = split[1];
630   -
631   -
632   - AuthenticationService.UnblockUser(userEmailId)
633   - .then(
634   - function (result) {
635   - if (result == LoginMessageConstants.USER_UNBLOCK_SUCCESS) {
636   - $rootScope.errorMessage = LoginMessageConstants.USER_UNBLOCK_SUCCESS_MESSAGE;
637   - $("#messageModal").modal('show');
638   - $rootScope.isVisibleLogin = true;
639   - $location.url("/");
640   - }
641   - else {
642   - $rootScope.errorMessage = LoginMessageConstants.UNABLE_TO_UNBLOCK;
643   - $("#messageModal").modal('show');
644   - $rootScope.isVisibleLogin = true;
645   - $location.url("/");
646   - }
647   - },
648   - function (error) {
649   - console.log(' Error in UnblockUser = ' + error.statusText);
650   - $rootScope.errorMessage = error;
651   - $("#messageModal").modal('show');
652   - }
653   - );
654   - }
655   -
656   - $rootScope.lexiconLanguageArray = [];
657   - $rootScope.lexiconLanguageArray.push({ id: "1", language: "English" });
658   - $(document).ready(function () {
659   -
660   - $rootScope.isLexiconTabClicked = true;
661   - $rootScope.lexiconData = function () {
662   - if ($rootScope.isLexiconTabClicked == true) {
663   - $rootScope.isLexiconTabClicked = false;
664   - $.ajax({
665   - url: '~/../content/data/json/da/uc_dat_default.json',
666   - dataType: "json",
667   - success: function (result) {
668   - $(result.root.uc.al.lx).each(function (key, value) {
669   -
670   - $('#lexiconLangDropdown').append('<option val="' + this._id + '">' + this._tl + '</option>');
671   -
672   - });
673   -
674   - }
675   -
676   - });
677   - }
678   - $('#lexiconLangDropdown').change(function () {
679   - $rootScope.isLexiconLanguageClicked = true;
680   - $('#laxiconLangAdd').removeAttr('disabled');
681   - $('#laxicanlanguageChagne').removeAttr('disabled');
682   - $rootScope.selectedId = $("#lexiconLangDropdown option:selected").attr('val');
683   - $rootScope.selectedText = $("#lexiconLangDropdown option:selected").text();
684   - });
685   -
686   - $('#laxiconLangAdd').click(function () {
687   - if ($rootScope.isLexiconLanguageClicked == true) {
688   - $rootScope.isLexiconLanguageClicked = false;
689   - $("#lexiconLangDropdown :selected").remove();
690   - $('#secondLax').append('<option val="' + $rootScope.selectedId + '">' + $rootScope.selectedText + '</option>');
691   - $rootScope.lexiconLanguageArray.push({ id: $rootScope.selectedId, language: $rootScope.selectedText });
692   - }
693   - });
694   -
695   - $('#secondLax').change(function () {
696   - $rootScope.isActiveLexiconLanguageClicked = true;
697   - $rootScope.secondlaxdid = $("#secondLax option:selected").attr('val');
698   - $rootScope.secondlaxtext = $("#secondLax option:selected").text();
699   -
700   - });
701   -
702   - $("#laxiconLangRemove").click(function () {
703   - if ($rootScope.isActiveLexiconLanguageClicked == true) {
704   - $rootScope.isActiveLexiconLanguageClicked = false;
705   - $("#secondLax :selected").remove();
706   - $('#lexiconLangDropdown').append('<option val="' + $rootScope.secondlaxdid + '">' + $rootScope.secondlaxtext + '</option>');
707   - // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1);
708   - $rootScope.lexiconLanguageArray = [];
709   - $("#secondLax > option").each(function () {
710   - $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value });
711   - });
712   - $rootScope.lexiconLanguageArray.unshift({ id: $("#primarylaxican").attr("name"), language: $("#primarylaxican").val() });
713   - }
714   - });
715   -
716   - $("#laxicanlanguageChagne").click(function () {
717   - if ($rootScope.isLexiconLanguageClicked == true) {
718   - $rootScope.isLexiconLanguageClicked = false;
719   - var primarylaxiid = $("#lexiconLangDropdown option:selected").attr('val');
720   - var primarylaxicantext = $("#lexiconLangDropdown option:selected").text();
721   - $("#lexiconLangDropdown :selected").remove();
722   - $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $('#primarylaxican').val() + '</option>');
723   - $('#primarylaxican').val(primarylaxicantext);
724   - $('#primarylaxican').attr("name", primarylaxiid);
725   - $rootScope.lexiconLanguageArray[0].id = primarylaxiid;
726   - $rootScope.lexiconLanguageArray[0].language = primarylaxicantext;
727   - }
728   - });
729   - }
730   -
731   -
732   - if ($.browser.msie) {
733   - $("#resetBtn").css("display", "inline-block");
734   - // $rootScope.refreshCanvas();
735   -
736   - }
737   - $(function () {
738   - var colpick = $('.demo').each(function () {
739   -
740   - $(this).minicolors({
741   - control: $(this).attr('data-control') || 'hue',
742   - inline: $(this).attr('data-inline') === 'true',
743   - letterCase: 'lowercase',
744   - opacity: false,
745   - change: function (hex, opacity) {
746   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").removeClass("ActiveDefaultColorAnnotation");
747   - if (!hex) return;
748   - if (opacity) hex += ', ' + opacity;
749   - try {
750   - console.log(hex);
751   - $("#text_area").css("color", hex);
752   - } catch (e) { }
753   - $(this).select();
754   - },
755   - theme: 'bootstrap'
756   - });
757   - });
758   -
759   - var $inlinehex = $('#inlinecolorhex h3 small');
760   - //alert($inlinehex);
761   - $('#inlinecolors').minicolors({
762   - inline: true,
763   - theme: 'bootstrap',
764   - change: function (hex) {
765   - if (!hex) return;
766   -
767   - $inlinehex.html(hex);
768   - }
769   - });
770   - });
771   -
772   -
773   - $(function () {
774   - var colpick = $('.drawTextBG').each(function () {
775   - $(this).minicolors({
776   - control: $(this).attr('data-control') || 'hue',
777   - inline: $(this).attr('data-inline') === 'true',
778   - letterCase: 'lowercase',
779   - opacity: false,
780   - change: function (hex, opacity) {
781   - $("#drawTextBGColorpicker .minicolors .minicolors-swatch .minicolors-swatch-color").removeClass("ActiveDefaultColorAnnotation");
782   - if (!hex) return;
783   - if (opacity) hex += ', ' + opacity;
784   - try {
785   - console.log(hex);
786   - // $("#text_area").css("background-color", hex);
787   - } catch (e) { }
788   - $(this).select();
789   - },
790   - theme: 'bootstrap'
791   - });
792   - });
793   - var $inlinehex = $('#inlinecolorhex h3 small');
794   - //alert($inlinehex);
795   - $('#inlinecolors').minicolors({
796   - inline: true,
797   - theme: 'bootstrap',
798   - change: function (hex) {
799   -
800   - if (!hex) return;
801   - $inlinehex.html(hex);
802   - }
803   - });
804   - });
805   -
806   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
807   - $("#drawTextBGColorpicker .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#ffffff" });
808   -
809   - });
810   -
811   - $rootScope.$on("$locationChangeSuccess", function () {
812   -
813   - $rootScope.HightLightModuleSelection = function (moduleUrl) {
814   - var currentRoute = $location.path().substring(1);
815   - return moduleUrl === currentRoute ? 'active' : '';
816   - }
817   - $("#annotationToolBarOptions").removeClass("disableMenuoption");
818   - $("#optionsListManagerTab").removeClass("disableMenuoption");
819   -
820   -
821   - if (($location.url() == "/da-body-view")) {
822   - $rootScope.disableMenuannotation = " ";
823   - $rootScope.disableMenuoption = " ";
824   - $rootScope.disableSubMenu = "disableSubMenu";
825   - $rootScope.disableFileMenu = " ";
826   - }
827   - else if ($location.url() == "/clinical-illustrations-detail") {
828   - $rootScope.disableMenuannotation = " ";
829   - $rootScope.disableMenuoption = " ";
830   - $rootScope.disableSubMenu = "disableSubMenu";
831   - $("#annotationToolBarOptions").removeClass("disableSubMenu");
832   - $("#optionsListManagerTab").addClass("disableSubMenu");
833   - $rootScope.disableFileMenu = " ";
834   - }
835   - else if ($location.url() == "/module-item-view") {
836   - $rootScope.disableMenuannotation = " ";
837   - $rootScope.disableMenuoption = " ";
838   - $rootScope.disableSubMenu = "disableSubMenu";
839   - $("#annotationToolBarOptions").removeClass("disableSubMenu");
840   - $rootScope.disableFileMenu = " ";
841   - }
842   -
843   - else if ($location.url() == "/clinical-animations-detail") {
844   - $rootScope.disableMenuannotation = "disableMenuannotation";
845   - $rootScope.disableMenuoption = " ";
846   - $rootScope.disableSubMenu = "disableSubMenu";
847   - $("#annotationToolBarOptions").addClass("disableSubMenu");
848   - $("#optionsListManagerTab").addClass("disableSubMenu");
849   - $rootScope.disableFileMenu = "disableFileMenu";
850   - }
851   - else {
852   - $("#annotationToolBarOptions").removeClass("disableSubMenu");
853   - $("#optionsListManagerTab").removeClass("disableSubMenu");
854   - $rootScope.disableMenuannotation = "disableMenuannotation";
855   - $rootScope.disableMenuoption = "disableMenuoption";
856   - $rootScope.disableSubMenu = "";
857   - $rootScope.CloseAnnotationTool();
858   - $rootScope.CloseListManager();
859   - angular.element('#modal-settings').css('display', 'none');
860   - if ($location.url() == "/lab-exercises") {
861   -
862   - $rootScope.menuLabExer = 0;
863   - }
864   - if ($rootScope.menuLabExer == 1) {
865   - $rootScope.disableMenuoption = " ";
866   - }
867   - $rootScope.disableFileMenu = "disableFileMenu";
868   - }
869   -
870   - });
871   -
872   - //jspanel functionality..
873   -
874   - $rootScope.getModuleScrollPosition = function () {
875   - $rootScope.refreshcheck = "check";
876   - $('.mCSB_container ul li').click(function () {
877   -
878   - $rootScope.scrollTopPosition = $(this).position().top;
879   -
880   - });
881   - setTimeout(function () {
882   -
883   - $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px");
884   -
885   -
886   -
887   - }, 300);
888   - }
889   -
890   - $rootScope.openParent = function (slug) {
891   - if ($('#jsPanel-1').length > 0) {
892   -
893   - }
894   - else {
895   - var openViews = $rootScope.openViews;
896   - if (openViews.length > 0) {
897   - $rootScope.openViews.splice(openViews.length - 1);
898   - }
899   - if (openViews.length > 0) {
900   - var lastOpenMoudle = $rootScope.openViews[openViews.length - 1];
901   - }
902   - // $('#daImagePanel').remove();
903   - if ($('#jsPanel-1').length > 0)
904   - $('#jsPanel-1').remove();
905   -
906   - if ($('#3DImagePanel').length > 0)
907   - $('#3DImagePanel').remove();
908   -
909   - if ($('#ciImagePanel').length > 0)
910   - $('#ciImagePanel').remove();
911   -
912   - if ($('#caVideoPanel').length > 0)
913   - $('#caVideoPanel').remove();
914   -
915   - if ($('#ImagePanel').length > 0)
916   - $('#ImagePanel').remove();
917   -
918   - $location.url('/' + slug);
919   -
920   - $rootScope.$broadcast('jsPanelCloseEvent', true);
921   - }
922   - }
923   -
924   - //called on jsanel minimize
925   - $rootScope.setState = function (state, title) {
926   -
927   -
928   - var alreadyOpenThisView = new jinqJs()
929   - .from($rootScope.openViews)
930   - .where("body-views == " + title)
931   - .select();
932   - var k = 0;
933   - if (alreadyOpenThisView != null) {
934   - for (var i = 0; i < $rootScope.openViews.length; i++) {
935   - k++;
936   - if ($rootScope.openViews[i].body - views == title) {
937   - $rootScope.openViews.splice((k - 1), 1);
938   -
939   - $rootScope.openViews.push(
940   - {
941   - "module": $rootScope.currentActiveModuleTitle, "bodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId,
942   - "slug": $rootScope.currentSlug
943   - }
944   - );
945   - }
946   - }
947   - }
948   - if (state == 'max') {
949   - $('#daBodyview').css('width', '100%')
950   - }
951   - }
952   -
953   - $rootScope.ClearIframe = function () {
954   - if ($('#daImagePanel') != null)
955   - $('#daImagePanel').remove();
956   - if ($('#jsPanel-1').length > 0)
957   - $('#jsPanel-1').remove();
958   -
959   - $rootScope.hideScrollbar();
960   - }
961   -
962   - //ends
963   -
964   - $rootScope.hideScrollbar = function () {
965   - $(".sidebar").mCustomScrollbar({
966   - autoHideScrollbar: true,
967   - //theme:"rounded"
968   - });
969   - }
970   - $rootScope.isFontFamilyLoaded = false;
971   - //annotation tool custom events
972   - $rootScope.ShowAnnotationWindow = function () {
973   - //7904
974   -
975   - $rootScope.isAnnotatiomToolBarPopupActive = true;
976   - $rootScope.isAnnotatiomToolBarPopupClosed = false;
977   - $rootScope.isAnnotaionToolBarDrawingModeActive = false;
978   - if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "CI" || $rootScope.MenuModuleName == "AA") {
979   - if ($rootScope.disableAnnotationtoolOnListManager == true) {
980   - $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
981   - $('#slider-range-min-2').slider('disable');
982   - $("#annotationpaintbrushsize").attr('disabled', 'disabled');
983   - $("#annotationpainteraser").attr('disabled', 'disabled');
984   -
985   - // $rootScope.disableAnnotationTB = false;
986   - } else {
987   - $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
988   - $('#slider-range-min-2').slider('enable');
989   - $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
990   - $("#annotationpainteraser").removeAttr('disabled', 'disabled');
991   - }
992   - // document.getElementById('modelbackground').style.display = "block";
993   - // document.getElementById('modeleditstyle').style.display = "block";
994   -
995   - }
996   - if ($rootScope.MenuModuleName == "CA") {
997   - $("#annotationpaintbrushsize").attr("href", "#");
998   - $("#annotationpainteraser").attr("href", "#");
999   - $("#annotationpainteraser").attr('disabled', 'disabled');
1000   - $("#annotationpainteraser").css('pointer-events', 'none');
1001   - }
1002   - else {
1003   - $("#annotationpaintbrushsize").attr("href", "#canvasPaint");
1004   - $("#annotationpainteraser").attr("href", "#canvasPaint");
1005   - $("#annotationpainteraser").removeAttr('disabled', 'disabled');
1006   - $("#annotationpainteraser").css('pointer-events', 'auto');
1007   - }
1008   - $("#OnIdentify").addClass("annotationtoolbartab");
1009   - $("#annotationToolBarOptions").addClass("active");
1010   - $("#annotationButton").addClass("active");
1011   -
1012   - $rootScope.isAnnotationWindowOpen = true;
1013   - $(".annotationTollbar").css("display", "block");
1014   - $rootScope.$broadcast('annotationToolEvent', true);
1015   - // $("#canvasPaint").css("display", "none");
1016   - // $("#canvas").css("display", "none");
1017   -
1018   - var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json';
1019   - if ($rootScope.isFontFamilyLoaded == false) {
1020   -
1021   -
1022   - DataService.getJson(FontFamilyJson)
1023   - .then(
1024   - function (result) {
1025   -
1026   - $rootScope.AnnotationFontFamily = result;
1027   - // alert($rootScope.AnnotationFontFamily.FontStyle.length);
1028   -
1029   - for (var i = 0; i <= $rootScope.AnnotationFontFamily.FontFamily.length - 1; i++) {
1030   - var fontName = $rootScope.AnnotationFontFamily.FontFamily[i].FontName;
1031   - if (/\s/g.test(fontName)) { //Check if white-space exists in between strings
1032   - fontName = fontName.replace(" ", "_"); // replace white-space with an underscore
1033   - }
1034   - //$rootScope.AnnotationFontFamily.FontFamily[i].FontName
1035   - $("#selected-font-family").append("<option value=" + fontName + ">" + $rootScope.AnnotationFontFamily.FontFamily[i].FontName + "</option>");
1036   -
1037   - }
1038   - $rootScope.isFontFamilyLoaded = true;
1039   -
1040   - },
1041   - function (error) {
1042   - console.log(error.statusText)
1043   - }
1044   - )
1045   -
1046   - }
1047   -
1048   - if ($("#transparencyScale").css("display") == "block") {
1049   -
1050   - $rootScope.switchToTransparencycanvas();
1051   - }
1052   -
1053   -
1054   - if ($location.url() == "/module-item-view") {
1055   -
1056   - var canvasZIndex = $("#canvas").css("z-index");
1057   - var canvasPaintZIndex = $("#canvasPaint").css("z-index");
1058   -
1059   - if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) {
1060   - canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
1061   - $("#aaDetailViewCanvas").css("z-index", canvasPaintZIndex);
1062   -
1063   - }
1064   - else
1065   - {
1066   - canvasZIndex = parseInt(canvasZIndex) + 1;
1067   - $("#aaDetailViewCanvas").css("z-index", canvasZIndex);
1068   - }
1069   -
1070   - }
1071   - }
1072   -
1073   - $rootScope.CloseAnnotationTool = function () {
1074   - console.log('close');
1075   - $rootScope.isAnnotatiomToolBarPopupActive = false;
1076   - $rootScope.isAnnotatiomToolBarPopupClosed = true;
1077   - $("#OnIdentify").removeClass("annotationtoolbartab");
1078   - $("#DrawMode").removeClass("annotationtoolbartab");
1079   - $('.btnCursor').removeClass('activebtncolor');
1080   - $("#annotationButton").removeClass("active");
1081   - $("#annotationButton").blur();
1082   - $("#annotationToolBarOptions").removeClass("active");
1083   -
1084   -
1085   - $(".annotationTollbar").css("display", "none");
1086   - $rootScope.isAnnotationWindowClose = true;
1087   - // $("#canvasPaint").css("display", "none");
1088   - // $("#canvas").css("display", "none");
1089   - $('.btnCursor').removeClass('activebtncolor');
1090   - $(".btn-annotation").removeClass("activebtncolor");
1091   - $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1092   -
1093   - if ($("#transparencyScale").css("display") == "block") {
1094   - $rootScope.switchToTransparencycanvas();
1095   - }
1096   - else {
1097   - $rootScope.switchCanvas();
1098   - }
1099   - $rootScope.shapeType = '';
1100   - if ($location.url() == "/module-item-view") {
1101   -
1102   - var canvasZIndex = $("#canvas").css("z-index");
1103   - var canvasPaintZIndex = $("#canvasPaint").css("z-index");
1104   -
1105   - if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) {
1106   - canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
1107   - $("#aaDetailViewCanvas").css("z-index", canvasPaintZIndex);
1108   -
1109   - }
1110   - else {
1111   - canvasZIndex = parseInt(canvasZIndex) + 1;
1112   - $("#aaDetailViewCanvas").css("z-index", canvasZIndex);
1113   - }
1114   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
1115   -
1116   - for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) {
1117   -
1118   - if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) {
1119   -
1120   - var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId;
1121   - var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId;
1122   -
1123   - $('#aaDetailViewCanvas').setLayer(pinName, {
1124   - visible: false // set to true instead to show the layer again
1125   - }).drawLayers();
1126   -
1127   - $('#aaDetailViewCanvas').setLayer(pinArcName, {
1128   - visible: false // set to true instead to show the layer again
1129   - }).drawLayers();
1130   -
1131   - }
1132   -
1133   - }
1134   - }
1135   - }
1136   - }
1137   - $rootScope.CIAnotationIdentifyModeOff = false;
1138   - $rootScope.OnIdentifyClick = function () {
1139   -
1140   - $("#OnIdentify").addClass("annotationtoolbartab");
1141   - $("#DrawMode").removeClass("annotationtoolbartab");
1142   -
1143   - if ($rootScope.CIAnotationIdentifyModeOff == true) {
1144   - $('.btnCursor').removeClass('activebtncolor');
1145   -
1146   - } else {
1147   -
1148   - $('.btnCursor').removeClass('activebtncolor');
1149   -
1150   - }
1151   -
1152   - $("#annotationpaintbrushsize").removeClass("activebtncolor");
1153   - $("#annotationpainteraser").removeClass("activebtncolor");
1154   -
1155   - $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1156   - $rootScope.switchCanvas();
1157   -
1158   - if ($("#transparencyScale").css("display") == "block") {
1159   -
1160   - $rootScope.switchToTransparencycanvas();
1161   - }
1162   - if ($location.url() == "/module-item-view") {
1163   -
1164   - var canvasZIndex = $("#canvas").css("z-index");
1165   - var canvasPaintZIndex = $("#canvasPaint").css("z-index");
1166   -
1167   - if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) {
1168   - canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
1169   - $("#aaDetailViewCanvas").css("z-index", canvasPaintZIndex);
1170   -
1171   - }
1172   - else {
1173   - canvasZIndex = parseInt(canvasZIndex) + 1;
1174   - $("#aaDetailViewCanvas").css("z-index", canvasZIndex);
1175   - }
1176   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
1177   -
1178   - for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) {
1179   -
1180   - if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) {
1181   -
1182   - var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId;
1183   - var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId;
1184   -
1185   - $('#aaDetailViewCanvas').setLayer(pinName, {
1186   - visible: false // set to true instead to show the layer again
1187   - }).drawLayers();
1188   -
1189   - $('#aaDetailViewCanvas').setLayer(pinArcName, {
1190   - visible: false // set to true instead to show the layer again
1191   - }).drawLayers();
1192   -
1193   - }
1194   -
1195   - }
1196   - }
1197   -
1198   - }
1199   - }
1200   -
1201   - $rootScope.switchToTransparencycanvas = function () {
1202   -
1203   - if ($rootScope.isTBoxModestyVisible == true) {
1204   - var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
1205   - if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
1206   - for (var j = 0; j < modestyTransCanvases.length; j++) {
1207   - var ctx = document.getElementById(modestyTransCanvases[j].id);
1208   -
1209   - if (ctx.style.visibility == "visible") {
1210   -
1211   - if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
1212   -
1213   - var drawCanvasZindex = $("#canvas").css("z-index");
1214   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1215   - var TransCanvasZindex = ctx.style.zIndex;
1216   - var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
1217   - MaxZindexVal = MaxZindexVal + 1;
1218   - $("#canvas").css("z-index", MaxZindexVal);
1219   - if ($rootScope.currentBodyViewId == "11") {
1220   - $(".ui-wrapper").css("z-index", MaxZindexVal + 1);
1221   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
1222   -
1223   - }
1224   - else {
1225   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
1226   - }
1227   - }
1228   - else {
1229   - var drawCanvasZindex = $("#canvas").css("z-index");
1230   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1231   - var TransCanvasZindex = ctx.style.zIndex;
1232   - var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
1233   - MaxZindexVal = parseInt(MaxZindexVal + 1);
1234   -
1235   - if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
1236   - $("#canvasPaint").css("z-index", MaxZindexVal);
1237   - }
1238   - else {
1239   -
1240   - $("#canvas").css("z-index", MaxZindexVal);
1241   - if ($rootScope.currentBodyViewId == "11") {
1242   - $(".ui-wrapper").css("z-index", MaxZindexVal);
1243   - }
1244   - else
1245   - {
1246   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
1247   - }
1248   -
1249   - }
1250   -
1251   - }
1252   - }
1253   - else {
1254   - var drawCanvasZindex = $("#canvas").css("z-index");
1255   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1256   - drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
1257   - paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
1258   - if (drawCanvasZindex > paintCanvasZindex) {
1259   - $(".ui-wrapper").css("z-index", drawCanvasZindex);
1260   - $("#canvas").css("z-index", drawCanvasZindex);
1261   - $rootScope.UIWrapperZIndex = drawCanvasZindex;
1262   - }
1263   - else {
1264   - $(".ui-wrapper").css("z-index", paintCanvasZindex);
1265   - $("#canvas").css("z-index", paintCanvasZindex);
1266   - $rootScope.UIWrapperZIndex = paintCanvasZindex;
1267   - }
1268   -
1269   - }
1270   - }
1271   - }
1272   -
1273   - }
1274   - else {
1275   - var drawCanvasZindex = $("#canvas").css("z-index");
1276   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1277   - drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
1278   - paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
1279   - if (drawCanvasZindex > paintCanvasZindex) {
1280   - $(".ui-wrapper").css("z-index", drawCanvasZindex);
1281   - $("#canvas").css("z-index", drawCanvasZindex);
1282   - $rootScope.UIWrapperZIndex = drawCanvasZindex;
1283   - }
1284   - else {
1285   - $(".ui-wrapper").css("z-index", paintCanvasZindex);
1286   - $("#canvas").css("z-index", paintCanvasZindex);
1287   - $rootScope.UIWrapperZIndex = paintCanvasZindex;
1288   - }
1289   - }
1290   - }
1291   -
1292   - $rootScope.DrawingMode = function () {
1293   -
1294   - //Annotation History
1295   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1296   - $("#OnIdentify").removeClass("annotationtoolbartab");
1297   - $("#DrawMode").addClass("annotationtoolbartab");
1298   - $('.btnCursor').addClass('activebtncolor');
1299   - $rootScope.switchCanvas();
1300   - $("#annotationpaintbrushsize").removeClass("activebtncolor");
1301   - $("#annotationpainteraser").removeClass("activebtncolor");
1302   - $rootScope.isEraseToolSelected = false;
1303   -
1304   - if ($location.url() == "/module-item-view") {
1305   -
1306   - $rootScope.switchToAnnotationCanvas();
1307   -
1308   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
1309   -
1310   - for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) {
1311   -
1312   - if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) {
1313   -
1314   - var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId;
1315   - var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId;
1316   -
1317   - $('#aaDetailViewCanvas').setLayer(pinName, {
1318   - visible: true // set to true instead to show the layer again
1319   - }).drawLayers();
1320   -
1321   - $('#aaDetailViewCanvas').setLayer(pinArcName, {
1322   - visible: true // set to true instead to show the layer again
1323   - }).drawLayers();
1324   -
1325   - }
1326   - }
1327   - }
1328   -
1329   - }
1330   -
1331   - }
1332   -
1333   - // Dissectible Anatomy > Settings should be disable if Annotation is Open.
1334   - $rootScope.ShowSettingWindow = function () {
1335   - if ($(".annotationTollbar").css("display") == "block") {
1336   - // alert("already open");
1337   - $('#modal-settings').css("display", "none");
1338   - $("#modelsettingsbackground").css("display", "none");
1339   - }
1340   - else {
1341   -
1342   - $('#modal-settings').css("display", "block");
1343   - $("#modelsettingsbackground").css("display", "block");
1344   - }
1345   -
1346   - $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length;
1347   - $rootScope.lexiconPrimaryLanguage = $("#primarylaxican").val();
1348   - $rootScope.primaryLangID = $('#primarylaxican').attr("name");
1349   - }
1350   -
1351   - //----Annotation Toolbar: Jcanvas-----
1352   -
1353   - $rootScope.DrawLine = function (e) {
1354   - $rootScope.setListManagerZindex = true;
1355   - $("#canvasPaint").css("display", "block");
1356   - $("#canvas").css("display", "block");
1357   -
1358   - $('.btnCursor').removeClass('activebtncolor');
1359   - $(".btn-annotation").removeClass("activebtncolor");
1360   - $(".btn-annotation-line").addClass("activebtncolor");
1361   - $("#OnIdentify").removeClass('annotationtoolbartab');
1362   - $("#DrawMode").addClass('annotationtoolbartab');
1363   -
1364   -
1365   - $rootScope.switchCanvas();
1366   - $rootScope.shapeType = "Line";
1367   -
1368   -
1369   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1370   - if ($location.url() == "/module-item-view") {
1371   -
1372   - $rootScope.switchToAnnotationCanvas();
1373   -
1374   - }
1375   - }
1376   -
1377   - $rootScope.switchToAnnotationCanvas = function () {
1378   - var aaViewCanvasZIndex = $("#aaDetailViewCanvas").css("z-index");
1379   - var canvasPaintZIndex = $("#canvasPaint").css("z-index");
1380   - if (parseInt(aaViewCanvasZIndex) < parseInt(canvasPaintZIndex)) {
1381   - canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
1382   - $("#canvas").css("z-index", canvasPaintZIndex);
1383   - }
1384   - else {
1385   - aaViewCanvasZIndex = parseInt(aaViewCanvasZIndex) + 1;
1386   - $("#canvas").css("z-index", aaViewCanvasZIndex);
1387   - }
1388   - }
1389   -
1390   -
1391   - $rootScope.DrawPin = function (e) {
1392   - $("#canvasPaint").css("display", "block");
1393   - $("#canvas").css("display", "block");
1394   -
1395   - $('.btnCursor').removeClass('activebtncolor');
1396   - $(".btn-annotation").removeClass("activebtncolor");
1397   - $(".btn-annotation-pin").addClass("activebtncolor");
1398   - $("#OnIdentify").removeClass('annotationtoolbartab');
1399   - $("#DrawMode").addClass('annotationtoolbartab');
1400   -
1401   - $rootScope.switchCanvas();
1402   - $rootScope.setListManagerZindex = true;
1403   - $rootScope.shapeType = "Pin";
1404   -
1405   -
1406   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1407   - if ($location.url() == "/module-item-view") {
1408   -
1409   - $rootScope.switchToAnnotationCanvas();
1410   -
1411   - }
1412   - }
1413   -
1414   - $rootScope.Cursor = function () {
1415   - $rootScope.switchCanvas();
1416   - $rootScope.shapeType = "cursor";
1417   -
1418   - $(".btn-annotation").removeClass("activebtncolor");
1419   - // $("#" + e.currentTarget.id).removeClass("activebtncolor");
1420   - $('.btnCursor').addClass('activebtncolor');
1421   - $("#OnIdentify").removeClass('annotationtoolbartab');
1422   - $("#DrawMode").addClass('annotationtoolbartab');
1423   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1424   - if ($location.url() == "/module-item-view") {
1425   -
1426   - $rootScope.switchToAnnotationCanvas();
1427   -
1428   - }
1429   - }
1430   -
1431   -
1432   - $rootScope.DrawRectangle = function (e) {
1433   - $rootScope.setListManagerZindex = true;
1434   - $("#canvasPaint").css("display", "block");
1435   - $("#canvas").css("display", "block");
1436   -
1437   - $('.btnCursor').removeClass('activebtncolor');
1438   - $(".btn-annotation").removeClass("activebtncolor");
1439   - $(".btn-annotation-rectangle").addClass("activebtncolor");
1440   - $("#OnIdentify").removeClass('annotationtoolbartab');
1441   - $("#DrawMode").addClass('annotationtoolbartab');
1442   -
1443   - $rootScope.switchCanvas();
1444   - $rootScope.shapeType = "Rectangle";
1445   -
1446   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1447   - if ($location.url() == "/module-item-view") {
1448   -
1449   - $rootScope.switchToAnnotationCanvas();
1450   -
1451   - }
1452   - }
1453   -
1454   - $rootScope.paintBrush = function () {
1455   -
1456   - $('.btnCursor').removeClass('activebtncolor');
1457   - $(".btn-annotation").removeClass("activebtncolor");
1458   - $(".btn-annotation-brush").addClass("activebtncolor");
1459   - $("#OnIdentify").removeClass('annotationtoolbartab');
1460   - $("#DrawMode").addClass('annotationtoolbartab');
1461   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1462   - if ($rootScope.disableAnnotationtoolOnListManager == true) {
1463   - $rootScope.switchCanvas();
1464   - var canvasPaintZindex = $('#canvasPaint').css("z-index"); //x
1465   -
1466   - var canvasZindex = $('#canvas').css("z-index"); //y
1467   - var listManagerZindex = $('#listManager').css("z-index"); //z
1468   - if (canvasPaintZindex > canvasZindex) {
1469   -
1470   - $('#listManager').css("z-index", canvasPaintZindex);
1471   -
1472   - } else {
1473   -
1474   - $('#listManager').css("z-index", canvasZindex);
1475   - }
1476   -
1477   - } else {
1478   -
1479   - $rootScope.setListManagerZindex = true;
1480   - $("#canvasPaint").css("display", "block");
1481   - $("#canvas").css("display", "block");
1482   -
1483   - if ((document.getElementById('fill-option').checked == false) && ($rootScope.isShapeSyleOkBtnClicked == true)) {
1484   -
1485   - $rootScope.switchCanvas();
1486   - }
1487   - else if (($("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color') == "transparent") || ($("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color') == "rgba(0, 0, 0, 0)")) {
1488   - // we are switching canvas from paint to draw to prevent paint because it does not take transparent color and we need control default black color for the case where user has unchecked fill option from Edit Shape Style window
1489   -
1490   - $rootScope.switchCanvas();
1491   - }
1492   - else {
1493   -
1494   - $rootScope.switchCanvasToPaintCanvas();
1495   - }
1496   - $rootScope.shapeType = "FreeStylePaint";
1497   - var btnBrushSizeValue = $("#btnBrushSize").val();
1498   - $rootScope.shapeSize = parseInt(btnBrushSizeValue);
1499   - $("#annotationpaintbrushsize").attr("data-size", $rootScope.shapeSize);
1500   -
1501   - $("#annotationpaintbrushsize").attr("data-color", $rootScope.shapestyleColorWithOpacity);
1502   -
1503   - if ($rootScope.shapeSize == '') {
1504   - $('#canvasPaint').sketch({ defaultSize: 1 });
1505   - }
1506   - else {
1507   - $('#canvasPaint').sketch();
1508   -
1509   - }
1510   - }
1511   -
1512   -
1513   - }
1514   -
1515   - $rootScope.switchCanvasToPaintCanvas = function (e) {
1516   - if ($rootScope.isTBoxModestyVisible == true) {
1517   - var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
1518   - if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
1519   - for (var j = 0; j < modestyTransCanvases.length; j++) {
1520   - var ctx = document.getElementById(modestyTransCanvases[j].id);
1521   - if (ctx.style.visibility == "visible") {
1522   - var drawCanvasZindex = $("#canvas").css("z-index");
1523   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1524   - var TransCanvasZindex = ctx.style.zIndex;
1525   - var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
1526   - MaxZindexVal = MaxZindexVal + 1;
1527   - if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
1528   - if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
1529   - $("#canvas").css("z-index", MaxZindexVal);
1530   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
1531   - }
1532   - else {
1533   -
1534   - if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
1535   - $("#canvasPaint").css("z-index", MaxZindexVal);
1536   - }
1537   - else {
1538   - $("#canvas").css("z-index", MaxZindexVal);
1539   - }
1540   - }
1541   - }
1542   - }
1543   - else {
1544   -
1545   - var drawCanvasZindex = $("#canvas").css("z-index");
1546   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1547   - var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
1548   - MaxZindexVal = parseInt(MaxZindexVal + 1);
1549   -
1550   - if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
1551   - $("#canvasPaint").css("z-index", MaxZindexVal);
1552   - }
1553   -
1554   - else {
1555   - $("#canvas").css("z-index", MaxZindexVal);
1556   - }
1557   -
1558   - }
1559   - }
1560   - }
1561   -
1562   - }
1563   - else {
1564   - var canvasPaint_zIndex = $('#canvasPaint').css("z-index");
1565   - var canvas_zIndex = $('#canvas').css("z-index");
1566   - if (canvas_zIndex > canvasPaint_zIndex) {
1567   - canvasPaint_zIndex = parseInt(canvas_zIndex) + 1;
1568   -
1569   - }
1570   - else {
1571   - canvasPaint_zIndex = parseInt(canvasPaint_zIndex) + 1;
1572   - }
1573   - $('#canvasPaint').css("z-index", canvasPaint_zIndex);
1574   - }
1575   - }
1576   -
1577   - $rootScope.DrawCircle = function (e) {
1578   - $rootScope.setListManagerZindex = true;
1579   - $("#canvasPaint").css("display", "block");
1580   - $("#canvas").css("display", "block");
1581   -
1582   - $('.btnCursor').removeClass('activebtncolor');
1583   - $(".btn-annotation").removeClass("activebtncolor");
1584   - $(".btn-annotation-circle").addClass("activebtncolor");
1585   - $("#OnIdentify").removeClass('annotationtoolbartab');
1586   - $("#DrawMode").addClass('annotationtoolbartab');
1587   -
1588   - $rootScope.switchCanvas();
1589   - $rootScope.shapeType = "Circle";
1590   -
1591   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1592   - if ($location.url() == "/module-item-view") {
1593   -
1594   - $rootScope.switchToAnnotationCanvas();
1595   -
1596   - }
1597   - }
1598   -
1599   - $rootScope.DrawArrow = function (e) {
1600   - $rootScope.setListManagerZindex = true;
1601   - $("#canvasPaint").css("display", "block");
1602   - $("#canvas").css("display", "block");
1603   -
1604   - $('.btnCursor').removeClass('activebtncolor');
1605   - $(".btn-annotation").removeClass("activebtncolor");
1606   - $(".btn-annotation-arrow").addClass("activebtncolor");
1607   - $("#OnIdentify").removeClass('annotationtoolbartab');
1608   - $("#DrawMode").addClass('annotationtoolbartab');
1609   -
1610   - $rootScope.switchCanvas();
1611   - $rootScope.shapeType = "Arrow";
1612   -
1613   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1614   - if ($location.url() == "/module-item-view") {
1615   -
1616   - $rootScope.switchToAnnotationCanvas();
1617   -
1618   - }
1619   - }
1620   - $rootScope.DrawText = function () {
1621   -
1622   - $rootScope.setListManagerZindex = true;
1623   - $("#canvasPaint").css("display", "block");
1624   - $("#canvas").css("display", "block");
1625   -
1626   - $('.btnCursor').removeClass('activebtncolor');
1627   - $(".btn-annotation").removeClass("activebtncolor");
1628   - $(".btn-annotation-Text").addClass("activebtncolor");
1629   - $("#OnIdentify").removeClass('annotationtoolbartab');
1630   - $("#DrawMode").addClass('annotationtoolbartab');
1631   -
1632   - $rootScope.switchCanvas();
1633   -
1634   - $rootScope.shapeType = "TextArea";
1635   -
1636   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1637   - if ($location.url() == "/module-item-view") {
1638   -
1639   - $rootScope.switchToAnnotationCanvas();
1640   -
1641   - }
1642   - }
1643   -
1644   - $rootScope.DrawPolygon = function () {
1645   - $rootScope.setListManagerZindex = true;
1646   - $("#canvasPaint").css("display", "block");
1647   - $("#canvas").css("display", "block");
1648   - $rootScope.shapeType = "DrawPolygon";
1649   - $("#OnIdentify").removeClass('annotationtoolbartab');
1650   - $("#DrawMode").addClass('annotationtoolbartab');
1651   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1652   - if ($location.url() == "/module-item-view") {
1653   -
1654   - $rootScope.switchToAnnotationCanvas();
1655   -
1656   - }
1657   - }
1658   -
1659   -
1660   - $rootScope.switchCanvas = function () {
1661   -
1662   - if ($rootScope.isTBoxModestyVisible == true) {
1663   - var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
1664   - if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
1665   - for (var j = 0; j < modestyTransCanvases.length; j++) {
1666   - var ctx = document.getElementById(modestyTransCanvases[j].id);
1667   -
1668   - if (ctx.style.visibility == "visible") {
1669   -
1670   - var drawCanvasZindex = $("#canvas").css("z-index");
1671   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1672   - var TransCanvasZindex = ctx.style.zIndex;
1673   - var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
1674   - MaxZindexVal = MaxZindexVal + 1;
1675   -
1676   -
1677   - if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
1678   -
1679   - $("#canvas").css("z-index", MaxZindexVal);
1680   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
1681   -
1682   - }
1683   - else {
1684   -
1685   - if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
1686   - if ($rootScope.currentBodyViewId == "11") { $("#canvasPaint").css("z-index", MaxZindexVal + 1); }
1687   - else{ $("#canvasPaint").css("z-index", MaxZindexVal);}
1688   - }
1689   - else {
1690   - if ($rootScope.currentBodyViewId == "11") {
1691   - $("#canvas").css("z-index", MaxZindexVal + 1);
1692   - }
1693   - else
1694   - {
1695   - $("#canvas").css("z-index", MaxZindexVal);
1696   - }
1697   - }
1698   -
1699   - }
1700   - }
1701   - else {
1702   -
1703   - var drawCanvasZindex = $("#canvas").css("z-index");
1704   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1705   -
1706   - var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
1707   - MaxZindexVal = parseInt(MaxZindexVal + 1);
1708   -
1709   - if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
1710   -
1711   - $("#canvasPaint").css("z-index", MaxZindexVal);
1712   - }
1713   -
1714   - else {
1715   - $("#canvas").css("z-index", MaxZindexVal);
1716   - }
1717   - }
1718   - }
1719   - }
1720   - }
1721   - else {
1722   -
1723   - var drawCanvasZindex = $("#canvas").css("z-index");
1724   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
1725   -
1726   -
1727   - if (drawCanvasZindex > paintCanvasZindex) {
1728   - paintCanvasZindex = parseInt(drawCanvasZindex) + 1;
1729   - } else {
1730   - paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
1731   - }
1732   - $('#canvas').css("z-index", paintCanvasZindex);
1733   - }
1734   -
1735   - }
1736   - $rootScope.EraseDrawing = function () {
1737   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1738   - $('.btnCursor').removeClass('activebtncolor');
1739   - $(".btn-annotation").removeClass("activebtncolor");
1740   - $(".btn-annotation-erase").addClass("activebtncolor");
1741   - $("#OnIdentify").removeClass('annotationtoolbartab');
1742   - $("#DrawMode").addClass('annotationtoolbartab');
1743   - $rootScope.switchCanvasToPaintCanvas();
1744   - var btneraseBrushSizeValue = $("#btnBrushSize").val();
1745   - $('#canvasPaint').sketch();
1746   - $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
1747   -
1748   - $("#annotationpainteraser").attr("data-size", $rootScope.eraseshapeSize);
1749   - return $.sketch.tools.eraser = {
1750   - onEvent: function (e) {
1751   - return $.sketch.tools.marker.onEvent.call(this, e);
1752   - },
1753   - draw: function (action) {
1754   - var oldcomposite;
1755   - oldcomposite = this.context.globalCompositeOperation;
1756   - this.context.globalCompositeOperation = "destination-out";
1757   - action.color = "#000000";
1758   - $.sketch.tools.marker.draw.call(this, action);
1759   - return this.context.globalCompositeOperation = oldcomposite;
1760   - }
1761   - }
1762   -
1763   -
1764   - }
1765   -
1766   - $rootScope.isShapeSyleOkBtnClicked = false;
1767   -
1768   - $rootScope.setPropertiesForShapes = function (id) {
1769   - isfilloptionChecked = document.getElementById('fill-option').checked;
1770   - isOutlineOptionChecked = document.getElementById('Outline-Option').checked;
1771   - $rootScope.isShapeSyleOkBtnClicked = true;
1772   - if ($("#annotationpaintbrushsize").hasClass('activebtncolor')) {
1773   - $("#annotationpaintbrushsize").removeClass('activebtncolor')
1774   - $rootScope.switchCanvas();
1775   -
1776   - }
1777   - if ($("#annotationpainteraser").hasClass('activebtncolor')) {
1778   - $("#annotationpainteraser").removeClass('activebtncolor')
1779   - $rootScope.switchCanvas();
1780   -
1781   - }
1782   - if ((document.getElementById('fill-option').checked == false) && (document.getElementById('Outline-Option').checked == false)) {
1783   - // $('#btnShapeStyle').attr('disabled', 'disabled');
1784   - } else {
1785   - //$('#btnShapeStyle').removeAttr('disabled', 'disabled');
1786   - document.getElementById('modelbackground').style.display = "none";
1787   - document.getElementById('modeleditstyle').style.display = "none";
1788   -
1789   - $rootScope.shapestyleOpacity = $("#" + id).css('opacity');
1790   - $("#shapeStyleDiv").parent().css("opacity", $rootScope.shapestyleOpacity);
1791   - $rootScope.shapestyleFillColor = $("#" + id).css('background-color');
1792   - $rootScope.shapeStyleColorRGBA = $rootScope.shapestyleFillColor.replace("rgb", "rgba");
1793   - $rootScope.shapestyleColorWithOpacity = $rootScope.shapeStyleColorRGBA.substring(0, $rootScope.shapeStyleColorRGBA.length - 1) + " " + "," + $rootScope.shapestyleOpacity + ")";
1794   - $("#shapeStyleDiv").css("background-color", $rootScope.shapestyleFillColor);
1795   - $rootScope.shapestyleborderColor = $("#" + id).parent().css("border-top-color");
1796   - // $("#shapeStyleDiv").parent().css("border-color", $rootScope.shapestyleborderColor);
1797   - $rootScope.borderDimensions = $("#" + id).parent().css("border-top-width");
1798   -
1799   - document.getElementById("shapeStyleDiv").parentNode.style.border = $rootScope.borderDimensions + " " + "solid" + " " + $rootScope.shapestyleborderColor;
1800   -
1801   - // $("#shapeStyleDiv").parent().css("border-width", $rootScope.shapestyleborderWidthSeparatingPixel);
1802   -
1803   - var borderDimensions = $rootScope.borderDimensions;
1804   - var borderDimensionSplitArray = borderDimensions.split("p");
1805   -
1806   - $rootScope.shapestyleborderWidth = borderDimensionSplitArray[0];
1807   - $rootScope.shapestyleborderStyles = "solid";
1808   -
1809   -
1810   - $('#editshapestyle').modal('hide');
1811   -
1812   - //Edit Shape Style popup should open at it's default position
1813   - $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" });
1814   - }
1815   - }
1816   -
1817   - $rootScope.enableAnnotationToolBar = function () {
1818   - if ($rootScope.disableAnnotationTB == true) {
1819   - document.getElementById('modelbackground').style.display = "none";
1820   - document.getElementById('modeleditstyle').style.display = "none";
1821   - }
1822   - else {
1823   - document.getElementById('modelbackground').style.display = "block";
1824   - document.getElementById('modeleditstyle').style.display = "block";
1825   -
1826   - // alert(document.getElementById('outlinedivId').style.border);
1827   - // alert(document.getElementById('imgOpacity').style.backgroundColor);
1828   - $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('imgOpacity').style.backgroundColor);
1829   - $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('outlinedivId').style.border);
1830   -
1831   - if ($('#modeleditstyle').css("display") == "block") { //Check if the modal is already showing
1832   - var previewOpacity = $('#imgOpacity').css("opacity");
1833   - $('#slider-range-min-4 div.ui-slider-range-min').css("width", (previewOpacity * 100) + "%");
1834   - $('#slider-range-min-4 span.ui-slider-handle').css("left", (previewOpacity * 100) + "%");
1835   -
1836   - };
1837   -
1838   - }
1839   - }
1840   -
1841   -
1842   - $rootScope.enableEditShapeTooltip = function () {
1843   -
1844   - $("#edit-block").addClass("custom-tooltip-annotation");
1845   - $(".custom-tooltip-annotation").css('display', 'block');
1846   -
1847   - }
1848   -
1849   - $rootScope.disableEditShapeTooltip = function () {
1850   -
1851   - $(".custom-tooltip-annotation").css('display', 'none');
1852   - $("#edit-block").removeClass("custom-tooltip-annotation");
1853   - }
1854   -
1855   -
1856   - $rootScope.disableAnnotationToolBar = function () {
1857   -
1858   - if ($rootScope.isShapeSyleOkBtnClicked == false) {
1859   - $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)");
1860   - $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(0,0,0)");
1861   - var previewBorderColor = $("#outlineColor span.minicolors-swatch-color").css('background-color');
1862   - $(".marginTopBtm10 div.outlinediv").css("border-color", previewBorderColor);
1863   - var previewBgColor = $("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color');
1864   - $("#imgOpacity").css("background-color", previewBgColor);
1865   - $('#borderWidthCanvasElement').val(1);
1866   - $('.marginTopBtm10 div.outlinediv').css("border-width", 1);
1867   - $("#imgOpacity").css("opacity", 1);
1868   - $(".marginTopBtm10 div.outlinediv").css("opacity", 1);
1869   - document.getElementById("editStyleForm").reset();
1870   - isOutlineOptionChecked = document.getElementById('Outline-Option').checked;
1871   - isfilloptionChecked = document.getElementById('fill-option').checked;
1872   - if (isOutlineOptionChecked == true) {
1873   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" });
1874   - $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
1875   - $("#outlineColor").css({ "pointer-events": "auto" });
1876   - }
1877   - else {
1878   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": ".5" });
1879   - $("#borderWidthCanvasElement").css({ "pointer-events": "none" });
1880   - $("#outlineColor").css({ "pointer-events": "none" });
1881   - }
1882   - if (isfilloptionChecked == true) {
1883   - $(".enableDisableOpacity label").css({ "cursor": "pointer" });
1884   - $(".enableDisableOpacity").css({ "opacity": "1" });
1885   - $("#edit-slider-3").css({ "pointer-events": "auto" });
1886   - $("#edit-slider-4").css({ "pointer-events": "auto" });
1887   - $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
1888   - }
1889   - else {
1890   - $(".enableDisableOpacity label").css({ "cursor": "pointer" });
1891   - $(".enableDisableOpacity").css({ "opacity": ".5" });
1892   - $("#edit-slider-3").css({ "pointer-events": "none" });
1893   - $("#edit-slider-4").css({ "pointer-events": "none" });
1894   - $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
1895   - }
1896   -
1897   - } else {
1898   -
1899   - document.getElementById('fill-option').checked = isfilloptionChecked;
1900   - document.getElementById('Outline-Option').checked = isOutlineOptionChecked;
1901   - if (isfilloptionChecked == true) {
1902   - $(".enableDisableOpacity label").css({ "cursor": "pointer" });
1903   - $(".enableDisableOpacity").css({ "opacity": "1" });
1904   - $("#edit-slider-3").css({ "pointer-events": "auto" });
1905   - $("#edit-slider-4").css({ "pointer-events": "auto" });
1906   - $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
1907   - }
1908   - else {
1909   - $(".enableDisableOpacity label").css({ "cursor": "pointer" });
1910   - $(".enableDisableOpacity").css({ "opacity": ".5" });
1911   - $("#edit-slider-3").css({ "pointer-events": "none" });
1912   - $("#edit-slider-4").css({ "pointer-events": "none" });
1913   - $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
1914   - }
1915   - if (isOutlineOptionChecked == true) {
1916   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" });
1917   - $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
1918   - $("#outlineColor").css({ "pointer-events": "auto" });
1919   - }
1920   - else {
1921   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": ".5" });
1922   - $("#borderWidthCanvasElement").css({ "pointer-events": "none" });
1923   - $("#outlineColor").css({ "pointer-events": "none" });
1924   - }
1925   - if ((isfilloptionChecked == false) && (isOutlineOptionChecked == false)) {
1926   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" });
1927   - $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
1928   - $("#outlineColor").css({ "pointer-events": "auto" });
1929   - $(".enableDisableOpacity label").css({ "cursor": "pointer" });
1930   - $(".enableDisableOpacity").css({ "opacity": "1" });
1931   - $("#edit-slider-3").css({ "pointer-events": "auto" });
1932   - $("#edit-slider-4").css({ "pointer-events": "auto" });
1933   - $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
1934   - document.getElementById("editStyleForm").reset();
1935   - }
1936   - var previewBgColor = $("#shapeStyleDiv").css('background-color');
1937   - var previewBorderColor = $('#previewBorder').css('border-top-color');
1938   - var previewBorderWidth = $('#previewBorder').css('border-top-width');
1939   - var previewOpacity = $('#previewBorder').css('opacity');
1940   - $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", previewBgColor);
1941   - $("#imgOpacity").css("background-color", previewBgColor);
1942   - $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", previewBorderColor);
1943   - $(".marginTopBtm10 div.outlinediv").css("border-color", previewBorderColor);
1944   - $('.marginTopBtm10 div.outlinediv').css("border-width", previewBorderWidth);
1945   - $('#borderWidthCanvasElement').val(previewBorderWidth.split("px"));
1946   - $("#imgOpacity").css("opacity", previewOpacity);
1947   - $(".marginTopBtm10 div.outlinediv").css("opacity", previewOpacity);
1948   -
1949   - }
1950   - document.getElementById('modelbackground').style.display = "none";
1951   - document.getElementById('modeleditstyle').style.display = "none";
1952   - //Edit Shape Style popup should open at it's default position
1953   - $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" });
1954   - }
1955   - //--Common code of Annotation Toolbar for CI and DA-------
1956   - $rootScope.DrawLineOnModuleItem = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
1957   - // alert('inside DrawLineOnModuleItem');
1958   - // alert("canvasId" + canvasId + ",LineNumber" + LineNumber + ",shapestyleborderColor" + shapestyleborderColor + ",shapestyleborderWidth" + shapestyleborderWidth + ",offsetX1" + offsetX1 + ",offsetY1" + offsetY1 + ",x" + x);
1959   - if ($rootScope.isLinePreviewCompleted == true) {
1960   - // alert('$rootScope.isLinePreviewCompleted == true')
1961   - $rootScope.isLinePreviewCompleted = false;
1962   - $(canvasId).addLayer({
1963   - name: 'Line_' + LineNumber,
1964   - layer: true,
1965   - type: 'line',
1966   - draggable: true,
1967   - strokeStyle: shapestyleborderColor,
1968   - strokeWidth: shapestyleborderWidth,
1969   - rounded: true,
1970   - x1: offsetX1, y1: offsetY1,
1971   - x2: x, y2: y,
1972   - click: function (layer) {
1973   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
1974   - //jcanvas property
1975   - layer.draggable = true;
1976   - $rootScope.canvasLayerNameCollection = [];
1977   - $rootScope.canvasLayerNameCollection.push(layer.name);
1978   - $(canvasId).setLayer(layer.name, {
1979   - handle: {
1980   - type: 'arc',
1981   - fillStyle: '#fff',
1982   - strokeStyle: '#c33',
1983   - strokeWidth: 2,
1984   - radius: 3
1985   - }
1986   - }).drawLayers();
1987   -
1988   - }
1989   - else {
1990   - //jcanvas property
1991   - layer.draggable = false;
1992   - }
1993   - },
1994   - mouseout: function (layer) {
1995   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
1996   - //jcanvas property
1997   - layer.draggable = true;
1998   - $rootScope.canvasLayerNameCollection = [];
1999   - $(canvasId).setLayer(layer.name, {
2000   - handle: {
2001   - type: 'arc',
2002   - fillStyle: '#fff',
2003   - strokeStyle: '#c33',
2004   - strokeWidth: 0,
2005   - radius: 0
2006   - }
2007   -
2008   - }).drawLayers();
2009   - }
2010   - else {
2011   - //jcanvas property
2012   - layer.draggable = false;
2013   - }
2014   - },
2015   - mouseover: function (layer) {
2016   -
2017   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2018   - //jcanvas property
2019   - layer.draggable = true;
2020   -
2021   - $(canvasId).setLayer(layer.name, {
2022   - handle: {
2023   - type: 'arc',
2024   - fillStyle: '#fff',
2025   - strokeStyle: '#c33',
2026   - strokeWidth: 2,
2027   - radius: 3
2028   - }
2029   - }).drawLayers();
2030   - }
2031   - else {
2032   - //jcanvas property
2033   - layer.draggable = false;
2034   - }
2035   - }
2036   -
2037   - }).drawLayers();
2038   -
2039   - }
2040   -
2041   -
2042   - $('.btnCursor').trigger('click');
2043   - $(".btn-annotation").removeClass("activebtncolor");
2044   - $('.btnCursor').addClass('activebtncolor');
2045   - }
2046   - $rootScope.jcanvasObjectArray = [];
2047   - $rootScope.DrawRectangleOnModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
2048   - if ($rootScope.isRectanglePreviewCompleted == true) {
2049   - $rootScope.isRectanglePreviewCompleted = false;
2050   - $(canvasId).addLayer({
2051   - layer: true,
2052   - name: 'Rect_' + RectNumber,
2053   - fillStyle: shapestyleFillColor,
2054   - type: 'rectangle',
2055   - draggable: true,
2056   - strokeStyle: shapestyleborderColor,
2057   - opacity: shapestyleOpacity,
2058   - strokeWidth: shapestyleborderWidth,
2059   - fromCenter: false,
2060   - x: offsetX1, y: offsetY1,
2061   - width: Math.abs(x - offsetX1),
2062   - height: Math.abs(y - offsetY1),
2063   - resizeFromCenter: false,
2064   - add: function (layer) {
2065   - if ($location.path() == "/module-item-view") {
2066   - $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
2067   - }
2068   - },
2069   - dragstop: function (layer) {
2070   - if ($location.path() == "/module-item-view") {
2071   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
2072   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
2073   - $rootScope.jcanvasObjectArray[i].x = layer.x;
2074   - $rootScope.jcanvasObjectArray[i].y = layer.y;
2075   - $rootScope.jcanvasObjectArray[i].width = layer.width;
2076   - $rootScope.jcanvasObjectArray[i].height = layer.height;
2077   - }
2078   - }
2079   - }
2080   - },
2081   - change: function (layer) {
2082   - if ($location.path() == "/module-item-view") {
2083   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
2084   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
2085   - $rootScope.jcanvasObjectArray[i].x = layer.x;
2086   - $rootScope.jcanvasObjectArray[i].y = layer.y;
2087   - $rootScope.jcanvasObjectArray[i].width = layer.width;
2088   - $rootScope.jcanvasObjectArray[i].height = layer.height;
2089   - }
2090   - }
2091   - }
2092   - },
2093   - click: function (layer) {
2094   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2095   - //jcanvas property
2096   - layer.draggable = true;
2097   - $rootScope.canvasLayerNameCollection = [];
2098   - $rootScope.canvasLayerNameCollection.push(layer.name);
2099   - $(canvasId).setLayer(layer.name, {
2100   - handle: {
2101   - type: 'rectangle',
2102   - fillStyle: '#fff',
2103   - strokeStyle: '#c33',
2104   - strokeWidth: 2,
2105   - width: 5, height: 5,
2106   - cornerRadius: 3,
2107   - }
2108   - }).drawLayers();
2109   - }
2110   - else {
2111   - //jcanvas property
2112   - layer.draggable = false;
2113   - }
2114   - },
2115   - mouseout: function (layer) {
2116   -
2117   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2118   - //jcanvas property
2119   - layer.draggable = true;
2120   - $rootScope.canvasLayerNameCollection = [];
2121   - $(canvasId).setLayer(layer.name, {
2122   - handle: {
2123   - type: 'rectangle',
2124   - fillStyle: 'pink',
2125   - strokeStyle: 'yellow',
2126   - strokeWidth: 0,
2127   - width: 0, height: 0,
2128   - cornerRadius: 0,
2129   - }
2130   -
2131   - }).drawLayers();
2132   - }
2133   - else {
2134   - //jcanvas property
2135   - layer.draggable = false;
2136   - }
2137   - },
2138   - mouseover: function (layer) {
2139   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2140   - //jcanvas property
2141   - layer.draggable = true;
2142   -
2143   - $(canvasId).setLayer(layer.name, {
2144   - handle: {
2145   - type: 'rectangle',
2146   - fillStyle: '#fff',
2147   - strokeStyle: '#c33',
2148   - strokeWidth: 2,
2149   - width: 5, height: 5,
2150   - cornerRadius: 3,
2151   - }
2152   - }).drawLayers();
2153   - }
2154   - else {
2155   - //jcanvas property
2156   - layer.draggable = false;
2157   - }
2158   - }
2159   - }).drawLayers();
2160   - }
2161   - $('.btnCursor').trigger('click');
2162   - $(".btn-annotation").removeClass("activebtncolor");
2163   - $('.btnCursor').addClass('activebtncolor');
2164   -
2165   - }
2166   -
2167   - $rootScope.DrawCircleOnModuleItem = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) {
2168   -
2169   - if ($rootScope.isCirclePreviewCompleted == true) {
2170   - $rootScope.isCirclePreviewCompleted = false;
2171   - $(canvasId).addLayer({
2172   - layer: true,
2173   - name: 'Circle_' + CircleNumber,
2174   - type: 'ellipse',
2175   - opacity: shapestyleOpacity,
2176   - draggable: true,
2177   - strokeStyle: shapestyleborderColor,
2178   - strokeWidth: shapestyleborderWidth,
2179   - fillStyle: shapestyleFillColor,
2180   - fromCenter: false,
2181   - x: (offsetX1), y: (offsetY1),
2182   - //added abs
2183   - width: Math.abs(x - offsetX1), height: Math.abs(y - offsetY1),
2184   - // Place a handle at each side and each corner
2185   - resizeFromCenter: false,
2186   - handlePlacement: 'both',
2187   -
2188   - add: function (layer) {
2189   -
2190   - if ($location.path() == "/module-item-view") {
2191   - $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
2192   - }
2193   - },
2194   - dragstop: function (layer) {
2195   -
2196   - if ($location.path() == "/module-item-view") {
2197   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
2198   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
2199   - $rootScope.jcanvasObjectArray[i].x = layer.x;
2200   - $rootScope.jcanvasObjectArray[i].y = layer.y;
2201   - $rootScope.jcanvasObjectArray[i].width = layer.width;
2202   - $rootScope.jcanvasObjectArray[i].height = layer.height;
2203   - }
2204   - }
2205   - }
2206   - },
2207   - change: function (layer) {
2208   - if ($location.path() == "/module-item-view") {
2209   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
2210   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
2211   - $rootScope.jcanvasObjectArray[i].x = layer.x;
2212   - $rootScope.jcanvasObjectArray[i].y = layer.y;
2213   - $rootScope.jcanvasObjectArray[i].width = layer.width;
2214   - $rootScope.jcanvasObjectArray[i].height = layer.height;
2215   - }
2216   - }
2217   - }
2218   - },
2219   - click: function (layer) {
2220   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2221   - //jcanvas property
2222   - layer.draggable = true;
2223   - $rootScope.canvasLayerNameCollection = [];
2224   - $rootScope.canvasLayerNameCollection.push(layer.name);
2225   - $(canvasId).setLayer(layer.name, {
2226   - handle: {
2227   - type: 'arc',
2228   - fillStyle: '#fff',
2229   - strokeStyle: '#c33',
2230   - strokeWidth: 2,
2231   - radius: 3
2232   - }
2233   - }).drawLayers();
2234   - }
2235   - else {
2236   - //jcanvas property
2237   - layer.draggable = false;
2238   - }
2239   - },
2240   - mouseout: function (layer) {
2241   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2242   - //jcanvas property
2243   - layer.draggable = true;
2244   - $rootScope.canvasLayerNameCollection = [];
2245   -
2246   - $(canvasId).setLayer(layer.name, {
2247   - handle: {
2248   - type: 'arc',
2249   - fillStyle: '#fff',
2250   - strokeStyle: '#c33',
2251   - strokeWidth: 0,
2252   - // width: 0, height: 0,
2253   - radius: 0
2254   - }
2255   -
2256   - }).drawLayers();
2257   - }
2258   - else {
2259   - layer.draggable = false;
2260   - }
2261   - },
2262   - mouseover: function (layer) {
2263   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2264   - //jcanvas property
2265   - layer.draggable = true;
2266   -
2267   - $(canvasId).setLayer(layer.name, {
2268   - handle: {
2269   - type: 'arc',
2270   - fillStyle: '#fff',
2271   - strokeStyle: '#c33',
2272   - strokeWidth: 2,
2273   - // width: 5, height: 5,
2274   - radius: 3,
2275   - }
2276   - }).drawLayers();
2277   - }
2278   - else {
2279   - //jcanvas property
2280   - layer.draggable = false;
2281   - }
2282   - }
2283   - }).drawLayers();
2284   - }
2285   - $('.btnCursor').trigger('click');
2286   - $(".btn-annotation").removeClass("activebtncolor");
2287   - $('.btnCursor').addClass('activebtncolor');
2288   - }
2289   -
2290   - $rootScope.DrawArrowOnModuleItem = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
2291   - if ($rootScope.isArrowPreviewCompleted == true) {
2292   - $rootScope.isArrowPreviewCompleted = false;
2293   - $('#canvas').drawLine({
2294   - layer: true,
2295   - name: 'Arrow_' + ArrowNumber,
2296   - draggable: true,
2297   - strokeStyle: shapestyleborderColor,
2298   - strokeWidth: shapestyleborderWidth,
2299   - rounded: true,
2300   - startArrow: true,
2301   - arrowRadius: 7,
2302   - arrowAngle: 90,
2303   - x1: offsetX1, y1: offsetY1,
2304   - x2: x, y2: y,
2305   -
2306   - click: function (layer) {
2307   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2308   - //jcanvas property
2309   - layer.draggable = true;
2310   - $rootScope.canvasLayerNameCollection = [];
2311   - $rootScope.canvasLayerNameCollection.push(layer.name);
2312   - $(canvasId).setLayer(layer.name, {
2313   - handle: {
2314   - type: 'arc',
2315   - fillStyle: '#fff',
2316   - strokeStyle: '#c33',
2317   - strokeWidth: 2,
2318   - // width: 5, height: 5,
2319   - radius: 3
2320   - }
2321   - }).drawLayers();
2322   - // $("#canvas").removeLayer(layer.name).drawLayers();
2323   - }
2324   - else {
2325   - //jcanvas property
2326   - layer.draggable = false;
2327   - }
2328   -
2329   - },
2330   - mouseout: function (layer) {
2331   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2332   - //jcanvas property
2333   - layer.draggable = true;
2334   - $rootScope.canvasLayerNameCollection = [];
2335   - $(canvasId).setLayer(layer.name, {
2336   - handle: {
2337   - type: 'arc',
2338   - fillStyle: '#fff',
2339   - strokeStyle: '#c33',
2340   - strokeWidth: 0,
2341   - // width: 0, height: 0,
2342   - radius: 0
2343   - }
2344   -
2345   - }).drawLayers();
2346   - }
2347   - else {
2348   - //jcanvas property
2349   - layer.draggable = false;
2350   - }
2351   - },
2352   - mouseover: function (layer) {
2353   -
2354   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2355   - //jcanvas property
2356   - layer.draggable = true;
2357   - $(canvasId).setLayer(layer.name, {
2358   - handle: {
2359   - type: 'arc',
2360   - fillStyle: '#fff',
2361   - strokeStyle: '#c33',
2362   - strokeWidth: 2,
2363   - // width: 5, height: 5,
2364   - radius: 3
2365   - }
2366   - }).drawLayers();
2367   - }
2368   - else {
2369   - //jcanvas property
2370   - layer.draggable = false;
2371   - }
2372   - }
2373   -
2374   - });
2375   - }
2376   -
2377   - $('.btnCursor').trigger('click');
2378   - $(".btn-annotation").removeClass("activebtncolor");
2379   - $('.btnCursor').addClass('activebtncolor');
2380   - }
2381   -
2382   - $rootScope.DrawPinOnModuleItem = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) {
2383   -
2384   - if ($rootScope.isPinPreviewCompleted == true) {
2385   - $rootScope.isPinPreviewCompleted = false;
2386   - var radial = $('#canvas').createGradient({
2387   - x1: 50, y1: 50,
2388   - x2: 50, y2: 50,
2389   - r1: 10, r2: 30,
2390   - c1: 'rgba(100, 50, 0,0)',
2391   - c2: 'grey'
2392   - });
2393   - $(canvasId).drawLine({
2394   - draggable: true,
2395   - layer: true,
2396   - name: "Pin_" + PinNumber,
2397   - groups: ["Pin_" + PinNumber],
2398   - dragGroups: ["Pin_" + PinNumber],
2399   - strokeStyle: 'black',
2400   - strokeWidth: 2,
2401   - x1: offsetX1, y1: offsetY1,
2402   - x2: x, y2: y,
2403   -
2404   - click: function (layer) {
2405   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2406   - //jcanvas property
2407   - layer.draggable = true;
2408   - $rootScope.shapeTypePin = "Pin";
2409   - $rootScope.canvasLayerNameCollection = [];
2410   - var pinLine_layer = layer.name;
2411   - var pinLine_layer_split = pinLine_layer.split("_");
2412   - var pinArcName = "ArcPin_";
2413   - var pinResult = pinArcName.concat(pinLine_layer_split[1]);
2414   -
2415   - $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult });
2416   -
2417   - $(canvasId).setLayer(layer.name, {
2418   - handle: {
2419   - type: 'arc',
2420   - fillStyle: '#fff',
2421   - strokeStyle: '#c33',
2422   - strokeWidth: 2,
2423   - // width: 5, height: 5,
2424   - radius: 3
2425   - }
2426   - }).drawLayers();
2427   -
2428   - }
2429   - else {
2430   - //jcanvas property
2431   - layer.draggable = false;
2432   - }
2433   - },
2434   - mouseout: function (layer) {
2435   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2436   - //jcanvas property
2437   - layer.draggable = true;
2438   - $rootScope.canvasLayerNameCollection = [];
2439   - $(canvasId).setLayer(layer.name, {
2440   - handle: {
2441   - type: 'arc',
2442   - fillStyle: '#fff',
2443   - strokeStyle: '#c33',
2444   - strokeWidth: 0,
2445   - // width: 0, height: 0,
2446   - radius: 0
2447   - }
2448   -
2449   - }).drawLayers();
2450   - }
2451   - else {
2452   - //jcanvas property
2453   - layer.draggable = false;
2454   - }
2455   - },
2456   - mouseover: function (layer) {
2457   -
2458   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2459   - //jcanvas property
2460   - layer.draggable = true;
2461   - $(canvasId).setLayer(layer.name, {
2462   - handle: {
2463   - type: 'arc',
2464   - fillStyle: '#fff',
2465   - strokeStyle: '#c33',
2466   - strokeWidth: 2,
2467   - // width: 5, height: 5,
2468   - radius: 3
2469   - }
2470   - }).drawLayers();
2471   - }
2472   - else {
2473   - //jcanvas property
2474   - layer.draggable = false;
2475   - }
2476   - }
2477   - }).drawArc({
2478   - draggable: true,
2479   - name: "ArcPin_" + PinArcNumber,
2480   - // name: "Pin_" + $rootScope.resetPin,
2481   - layer: true,
2482   - groups: ["Pin_" + PinNumber],
2483   - dragGroups: ["Pin_" + PinNumber],
2484   - strokeStyle: 'grey',
2485   - strokeWidth: 2,
2486   - fillStyle: radial,
2487   - x: offsetX1, y: offsetY1,
2488   - radius: 5,
2489   -
2490   -
2491   - add: function (layer) {
2492   -
2493   - $rootScope.PinArcNumber = layer.name;
2494   - // $scope.arr = [];
2495   -
2496   -
2497   - },
2498   -
2499   - }).drawLayers();
2500   - }
2501   -
2502   -
2503   - $('.btnCursor').trigger('click');
2504   - $(".btn-annotation").removeClass("activebtncolor");
2505   - $('.btnCursor').addClass('activebtncolor');
2506   - }
2507   - var isDoubleTouch = null;
2508   - $rootScope.TextEditorFunctionality = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) {
2509   - if ($rootScope.isTextAreaPreviewCompleted == true) {
2510   - $rootScope.isTextAreaPreviewCompleted = false;
2511   - $('#canvas').drawText({
2512   - layer: true,
2513   - draggable: true,
2514   - // opacity: $rootScope.shapestyleOpacity,
2515   - name: 'TextArea_' + $rootScope.TextNumber,
2516   - groups: ['TextArea_' + $rootScope.TextNumber],
2517   - dragGroups: ['TextArea_' + $rootScope.TextNumber],
2518   - fillStyle: '#36c',
2519   - strokeWidth: 0,
2520   - x: $rootScope.offsetX1, y: $rootScope.offsetY1,
2521   - fromCenter: false,
2522   - fontSize: '14pt',
2523   - align: "left",
2524   - fontFamily: 'Verdana, sans-serif',
2525   - text: '',
2526   - add: function (layer) {
2527   -
2528   - $rootScope.TextID = layer.name;
2529   - }
2530   -
2531   -
2532   - })
2533   - // Draw rect as wide as the text
2534   - .drawRect({
2535   - layer: true,
2536   - name: "TextRect_" + $rootScope.TextNumber,
2537   - dragGroups: ['shapes'],
2538   - opacity: $rootScope.shapestyleOpacity,
2539   - strokeStyle: $rootScope.shapestyleborderColor,
2540   - fromCenter: false,
2541   - strokeWidth: $rootScope.shapestyleborderWidth,
2542   - fillStyle: $rootScope.shapestyleFillColor,
2543   - x: $rootScope.offsetX1, y: $rootScope.offsetY1,
2544   - width: Math.abs($rootScope.x - $rootScope.offsetX1),
2545   - height: Math.abs($rootScope.y - $rootScope.offsetY1),
2546   - resizeFromCenter: false,
2547   - add: function (layer) {
2548   -
2549   - $rootScope.TextAreaRectID = layer.name;
2550   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
2551   -
2552   - if ($location.path() == "/module-item-view") {
2553   - $rootScope.initialTextAreaName = layer.name;
2554   - $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
2555   - }
2556   -
2557   - },
2558   -
2559   - dragstop: function (layer) {
2560   -
2561   - if ($location.path() == "/module-item-view") {
2562   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
2563   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
2564   - $rootScope.jcanvasObjectArray[i].x = layer.x;
2565   - $rootScope.jcanvasObjectArray[i].y = layer.y;
2566   - $rootScope.jcanvasObjectArray[i].width = layer.width;
2567   - $rootScope.jcanvasObjectArray[i].height = layer.height;
2568   - }
2569   - }
2570   - }
2571   - },
2572   - change: function (layer) {
2573   - if ($location.path() == "/module-item-view") {
2574   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
2575   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
2576   - $rootScope.jcanvasObjectArray[i].x = layer.x;
2577   - $rootScope.jcanvasObjectArray[i].y = layer.y;
2578   - $rootScope.jcanvasObjectArray[i].width = layer.width;
2579   - $rootScope.jcanvasObjectArray[i].height = layer.height;
2580   - }
2581   - }
2582   - }
2583   - },
2584   -
2585   - click: function (layer) {
2586   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2587   - //jcanvas property
2588   - layer.draggable = true;
2589   - $rootScope.canvasLayerNameCollection = [];
2590   - $rootScope.canvasLayerNameCollection.push(layer.name);
2591   - $('#canvas').setLayer(layer.name, {
2592   - handle: {
2593   - type: 'rectangle',
2594   - fillStyle: '#fff',
2595   - strokeStyle: '#c33',
2596   - strokeWidth: 2,
2597   - width: 5, height: 5,
2598   - cornerRadius: 3,
2599   -
2600   - }
2601   - }).drawLayers();
2602   - }
2603   - else {
2604   - //jcanvas property
2605   - layer.draggable = false;
2606   - }
2607   - },
2608   - dblclick: function (layer) {
2609   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2610   - //jcanvas property
2611   - layer.draggable = true;
2612   - $rootScope.IsTextAlreadySave = false;
2613   - var RectNameArray = (layer.name).split("_");
2614   -
2615   - var TextAreaRectangleName = "TextArea_";
2616   - var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
2617   - $rootScope.TextAreaRectID = layer.name;
2618   - $rootScope.TextID = TextAreaRectNameConcat;
2619   -
2620   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
2621   - $("#annotationTextModal").css("padding-right", "0px");
2622   - document.getElementById('modelbackground').style.display = "block";
2623   - $("#annotationTextModal").modal("toggle");
2624   -
2625   - $("#text_area").val('');
2626   - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
2627   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
2628   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
2629   -
2630   - $("#selected-font-family option:eq(0)").prop('selected', true);
2631   - $("#selected-font-size option:eq(0)").prop('selected', true);
2632   -
2633   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
2634   -
2635   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
2636   -
2637   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
2638   -
2639   - $("#text-left").removeClass("ActiveFormattingButtonClass");
2640   -
2641   - $("#text-right").removeClass("ActiveFormattingButtonClass");
2642   -
2643   - $("#text-center").removeClass("ActiveFormattingButtonClass");
2644   - }
2645   - else {
2646   - //jcanvas property
2647   - layer.draggable = false;
2648   - }
2649   - },
2650   - touchstart: function (layer)
2651   - {
2652   - if (isDoubleTouch == null) {
2653   - isDoubleTouch = setTimeout(function () {
2654   - isDoubleTouch = null;
2655   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2656   - //jcanvas property
2657   - layer.draggable = true;
2658   - $rootScope.canvasLayerNameCollection = [];
2659   - $rootScope.canvasLayerNameCollection.push(layer.name);
2660   - $('#canvas').setLayer(layer.name, {
2661   - handle: {
2662   - type: 'rectangle',
2663   - fillStyle: '#fff',
2664   - strokeStyle: '#c33',
2665   - strokeWidth: 2,
2666   - width: 5, height: 5,
2667   - cornerRadius: 3,
2668   -
2669   - }
2670   - }).drawLayers();
2671   - }
2672   - else {
2673   - //jcanvas property
2674   - layer.draggable = false;
2675   - }
2676   -
2677   - }, 1000)
2678   - } else {
2679   - clearTimeout(isDoubleTouch);
2680   - isDoubleTouch = null;
2681   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2682   - //jcanvas property
2683   - layer.draggable = true;
2684   - $rootScope.IsTextAlreadySave = false;
2685   - var RectNameArray = (layer.name).split("_");
2686   -
2687   - var TextAreaRectangleName = "TextArea_";
2688   - var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
2689   - $rootScope.TextAreaRectID = layer.name;
2690   - $rootScope.TextID = TextAreaRectNameConcat;
2691   -
2692   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
2693   - $("#annotationTextModal").css("padding-right", "0px");
2694   - document.getElementById('modelbackground').style.display = "block";
2695   - $("#annotationTextModal").modal("toggle");
2696   -
2697   - $("#text_area").val('');
2698   - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
2699   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
2700   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
2701   -
2702   - $("#selected-font-family option:eq(0)").prop('selected', true);
2703   - $("#selected-font-size option:eq(0)").prop('selected', true);
2704   -
2705   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
2706   -
2707   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
2708   -
2709   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
2710   -
2711   - $("#text-left").removeClass("ActiveFormattingButtonClass");
2712   -
2713   - $("#text-right").removeClass("ActiveFormattingButtonClass");
2714   -
2715   - $("#text-center").removeClass("ActiveFormattingButtonClass");
2716   - }
2717   - else {
2718   - //jcanvas property
2719   - layer.draggable = false;
2720   - }
2721   -
2722   - }
2723   - },
2724   - mouseout: function (layer) {
2725   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2726   - //jcanvas property
2727   - layer.draggable = true;
2728   - $rootScope.canvasLayerNameCollection = [];
2729   - $('#canvas').setLayer(layer.name, {
2730   - handle: {
2731   - type: 'rectangle',
2732   - fillStyle: 'pink',
2733   - strokeStyle: 'yellow',
2734   - strokeWidth: 0,
2735   - width: 0, height: 0,
2736   - cornerRadius: 0
2737   - }
2738   -
2739   - }).drawLayers();
2740   - }
2741   - else {
2742   - //jcanvas property
2743   - layer.draggable = false;
2744   - }
2745   - },
2746   - mouseover: function (layer) {
2747   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2748   - //jcanvas property
2749   - layer.draggable = true;
2750   - $('#canvas').setLayer(layer.name, {
2751   - handle: {
2752   - type: 'rectangle',
2753   - fillStyle: '#fff',
2754   - strokeStyle: '#c33',
2755   - strokeWidth: 2,
2756   - width: 5, height: 5,
2757   - cornerRadius: 3,
2758   - }
2759   - }).drawLayers();
2760   -
2761   - }
2762   - else {
2763   - //jcanvas property
2764   - layer.draggable = false;
2765   - }
2766   - }
2767   - });
2768   -
2769   - // Annotation: Edit Text option is missing.
2770   - $("#annotationTextModal").css("padding-right", "0px");
2771   - $("#annotationTextModal").modal("toggle");
2772   - document.getElementById('modelbackground').style.display = "block";
2773   -
2774   - }
2775   - $('.btnCursor').trigger('click');
2776   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
2777   -
2778   - $("#text_area").val('');
2779   -
2780   - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
2781   -
2782   - $("#selected-font-family option:eq(0)").prop('selected', true);
2783   - $("#selected-font-size option:eq(0)").prop('selected', true);
2784   -
2785   - // $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
2786   -
2787   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
2788   -
2789   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
2790   -
2791   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
2792   -
2793   - $("#text-left").removeClass("ActiveFormattingButtonClass");
2794   -
2795   - $("#text-right").removeClass("ActiveFormattingButtonClass");
2796   -
2797   - $("#text-center").removeClass("ActiveFormattingButtonClass");
2798   -
2799   - $(".btn-annotation").removeClass("activebtncolor");
2800   -
2801   - $('.btnCursor').addClass('activebtncolor');
2802   -
2803   - }
2804   -
2805   -
2806   -
2807   - $rootScope.clicked = true;
2808   - $rootScope.offsetX1 = 0;
2809   - $rootScope.offsetY1 = 0;
2810   - $rootScope.x = 0;
2811   - $rootScope.y = 0;
2812   - $rootScope.mousePressed = false;
2813   - $rootScope.lastX; $rootScope.lastY;
2814   - var ctx;
2815   - $rootScope.OnPaintCanvasMouseDown = function (event) {
2816   - event.preventDefault();
2817   - if ($rootScope.isAnnotatiomToolBarPopupClosed == false) {
2818   - var canvasElement = document.getElementById("canvas");
2819   - var ctx = canvasElement.getContext("2d");
2820   - $rootScope.offsetX1 = 0;
2821   - $rootScope.offsetY1 = 0;
2822   - var canvasDiv = document.getElementById('canvasDiv');
2823   - var verticalScrollPosition = canvasDiv.scrollTop;
2824   - var horizontlScrollPosition = canvasDiv.scrollLeft;
2825   - var $ua = navigator.userAgent;
2826   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
2827   - var verticalScrollPosition = canvasDiv.scrollTop;
2828   - var horizontlScrollPosition = canvasDiv.scrollLeft;
2829   - $rootScope.offsetX1 = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
2830   - $rootScope.offsetY1 = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
2831   - }
2832   - else
2833   - {
2834   - $rootScope.offsetX1 = event.offsetX;
2835   - $rootScope.offsetY1 = event.offsetY;
2836   - }
2837   - ctx.clearRect(0, 0, 2277, 3248);
2838   - $rootScope.clicked = true;
2839   - canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false);
2840   - canvasElement.addEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove, false);
2841   - }
2842   -
2843   - }
2844   - $rootScope.rectNumber = 0;
2845   - $rootScope.LineNumber = 0;
2846   - $rootScope.CircleNumber = 0;
2847   - $rootScope.ArrowNumber = 0;
2848   - $rootScope.PinNumber = 0;
2849   - $rootScope.PinArcNumber = 0;
2850   - $rootScope.ObjectIndex = 0;
2851   - $rootScope.ArcObjectIndex = 0;
2852   - $rootScope.PinObjectIndex = 0;
2853   - $rootScope.TextNumber = 0;
2854   - $rootScope.resetTextSave = 0;
2855   - $rootScope.ObjectIndexSave = 0;
2856   -
2857   - var arrayRect = {};
2858   -
2859   - var storeLine = '';
2860   -
2861   - $rootScope.OnPaintCanvasMouseUp = function (event) {
2862   - event.preventDefault();
2863   - if (!$rootScope.clicked) {
2864   - return;
2865   - }
2866   - if ($rootScope.isAnnotatiomToolBarPopupClosed == false) {
2867   - var AnnotationCanvas = document.getElementById('canvas');
2868   - AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false);
2869   - AnnotationCanvas.removeEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove, false);
2870   -
2871   - $(".line").remove();
2872   - $(".arrow").remove();
2873   - $(".pin").remove();
2874   - $(".circle").remove();
2875   - $(".rectangle").remove();
2876   - $(".textarea").remove();
2877   - $rootScope.clicked = false;
2878   - $rootScope.x = 0;
2879   - $rootScope.y = 0;
2880   - var canvasDiv = document.getElementById('canvasDiv');
2881   - var verticalScrollPosition = canvasDiv.scrollTop;
2882   - var horizontlScrollPosition = canvasDiv.scrollLeft;
2883   - $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
2884   - $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
2885   - var canvasElement = document.getElementById("canvas");
2886   - var ctx = canvasElement.getContext("2d");
2887   - var canvasPaintElement = document.getElementById("canvasPaint");
2888   - var PaintCanvasctx = canvasPaintElement.getContext("2d");
2889   - switch ($rootScope.shapeType) {
2890   - case "cursor":
2891   - ctx.beginPath();
2892   - PaintCanvasctx.beginPath();
2893   - break;
2894   - case "Line":
2895   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2896   - $rootScope.LineNumber = $rootScope.ObjectIndex++;
2897   - // $rootScope.isLinePreviewCompleted = true;
2898   - $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y)
2899   - break;
2900   - case "Rectangle":
2901   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2902   - $rootScope.rectNumber = $rootScope.ObjectIndex++;
2903   - // $rootScope.isRectanglePreviewCompleted = true;
2904   - $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
2905   -
2906   - break;
2907   - case "Circle":
2908   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2909   - $rootScope.CircleNumber = $rootScope.ObjectIndex++;
2910   - // $rootScope.isCirclePreviewCompleted = true;
2911   - $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
2912   - break;
2913   - case "Arrow":
2914   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2915   - $rootScope.ArrowNumber = $rootScope.ObjectIndex++;
2916   - //$rootScope.isArrowPreviewCompleted = true;
2917   - $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
2918   - break;
2919   - case "Pin":
2920   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2921   - $rootScope.PinNumber = $rootScope.PinObjectIndex++;
2922   - $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++;
2923   -
2924   - //$rootScope.isPinPreviewCompleted = true;
2925   -
2926   - $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber);
2927   - break;
2928   - case "TextArea":
2929   - $rootScope.isAnnotaionToolBarDrawingModeActive = true;
2930   - $rootScope.IsTextAlreadySave = false;
2931   - $("#text_area").val('');
2932   - // Draw text
2933   - $rootScope.resetTextRect = $rootScope.ObjectIndex++;
2934   - $rootScope.TextNumber = $rootScope.ObjectIndex++;
2935   - // $rootScope.isTextAreaPreviewCompleted = true;
2936   - $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y);
2937   - break;
2938   - case "DrawPolygon":
2939   - break;
2940   -
2941   - }
2942   - }
2943   - //}
2944   -
2945   - }
2946   - $rootScope.OnPaintCanvasMouseMove = function (event) {
2947   - event.preventDefault();
2948   - var canvasDiv = document.getElementById('canvasDiv');
2949   - var verticalScrollPosition = canvasDiv.scrollTop;
2950   - var horizontlScrollPosition = canvasDiv.scrollLeft;
2951   - $rootScope.MouseMoveXAxis = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
2952   - $rootScope.MouseMoveYAxis = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
2953   - switch ($rootScope.shapeType) {
2954   - case "Line":
2955   - $(".line").remove();
2956   - $rootScope.isLinePreviewCompleted = true;
2957   - $("#canvasDiv").append("<div class='line' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
2958   - $rootScope.Annotationangle();
2959   - break;
2960   - case "Arrow":
2961   - $(".arrow").remove();
2962   - $rootScope.isArrowPreviewCompleted = true;
2963   - $("#canvasDiv").append("<div class='arrow' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='border-bottom: 9px solid transparent;border-right: 12px dashed #ccc;border-top: 7px solid transparent;height: 0;left: -6px;position: absolute;top: -8px;width: 0;'></div></div>");
2964   - $rootScope.Annotationangle();
2965   - break;
2966   - case "Pin":
2967   - $(".pin").remove();
2968   - $rootScope.isPinPreviewCompleted = true;
2969   - $("#canvasDiv").append("<div class='pin' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='background-color:#fff;left: -8px;position: absolute;top: -6px;width: 10;height:12px;width:12px;border:2px dashed #808080;border-radius:50%;'></div></div>");
2970   - $rootScope.Annotationangle();
2971   - break;
2972   - case "Circle":
2973   - $(".circle").remove();
2974   - $rootScope.isCirclePreviewCompleted = true;
2975   - $("#canvasDiv").append("<div class='circle' style='z-index:12001;border-radius:50%;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
2976   - break;
2977   - case "Rectangle":
2978   - $(".rectangle").remove();
2979   - $rootScope.isRectanglePreviewCompleted = true;
2980   - $("#canvasDiv").append("<div class='rectangle' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
2981   - break;
2982   - case "TextArea":
2983   - $(".textarea").remove();
2984   - $rootScope.isTextAreaPreviewCompleted = true;
2985   - $("#canvasDiv").append("<div class='textarea' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
2986   - break;
2987   -
2988   - }
2989   - }
2990   - $rootScope.Annotationangle = function (event) {
2991   - var dy = $rootScope.MouseMoveYAxis - $rootScope.offsetY1;
2992   - var dx = $rootScope.MouseMoveXAxis - $rootScope.offsetX1;
2993   - var theta = 0;
2994   - if (dx < 0) {
2995   - theta = Math.atan(dy / dx) * (180 / Math.PI);
2996   - theta = theta + 180;
2997   - }
2998   - else if (dy < 0) {
2999   - theta = Math.atan(dy / dx) * (180 / Math.PI);
3000   - theta = theta + 360;
3001   - }
3002   - else {
3003   - theta = Math.atan(dy / dx) * (180 / Math.PI);
3004   - }
3005   - var dottedLineWidth = Math.sqrt(($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) * ($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) + ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis) * ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis));
3006   - switch ($rootScope.shapeType) {
3007   - case "Line":
3008   - $('.line').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
3009   - break;
3010   - case "Arrow":
3011   - $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
3012   - break;
3013   - case "Pin":
3014   - $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
3015   - break;
3016   - }
3017   - }
3018   -
3019   - ///-----
3020   -
3021   - var isDoubleTouchSaveText = null;
3022   - var isDoubleTouchSaveTextAgain = null;
3023   - $rootScope.saveText = function () {
3024   -
3025   - document.getElementById('modelbackground').style.display = "none";
3026   - $rootScope.selectedBGColorForTextArea = $("#drawTextBGColorpicker span.minicolors-swatch-color").css('background-color');
3027   -
3028   -
3029   -
3030   -
3031   - // this part will work first time when save button will be clicked
3032   - if ($rootScope.IsTextAlreadySave == false) {
3033   -
3034   -
3035   - if ($location.path() == "/module-item-view") {
3036   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
3037   - if ($rootScope.jcanvasObjectArray[i].name == $rootScope.initialTextAreaName) {
3038   - $rootScope.jcanvasObjectArray.splice(i, 1);
3039   - $rootScope.initialTextAreaName = '';
3040   - }
3041   - }
3042   - }
3043   -
3044   -
3045   -
3046   - // getting textarea style properties
3047   - $rootScope.fontSizes = $("#text_area").css("font-size");
3048   - $rootScope.fontWeight = $("#text_area").css("font-weight");
3049   - $rootScope.fontStyle = $("#text_area").css("font-style");
3050   - $rootScope.textAlignmt = $("#text_area").css("text-align");
3051   - $rootScope.fontColor = $("#text_area").css("color");
3052   - $rootScope.fontFamily = $("#text_area").css("font-family");
3053   - $rootScope.underlineText = $("#text_area").css("text-decoration");
3054   - $rootScope.textArea = $("#text_area").val();
3055   -
3056   - // deleting previous text area
3057   - $("#canvas").removeLayer($rootScope.TextID).drawLayers();
3058   - $("#canvas").removeLayer($rootScope.TextAreaRectID).drawLayers();
3059   - // Text After Saving in Rectangle
3060   - $rootScope.resetTextRect = $rootScope.ObjectIndex++;
3061   -
3062   - $('#canvas').drawRect({
3063   - name: 'TextArea1_' + $rootScope.resetTextRect,
3064   - layer: true,
3065   - draggable: true,
3066   - groups: ['TextAreaNew_' + $rootScope.resetTextRect],
3067   - dragGroups: ['TextAreaNew_' + $rootScope.resetTextRect],
3068   - opacity: $rootScope.shapestyleOpacity,
3069   - strokeStyle: $rootScope.shapestyleborderColor,
3070   - strokeWidth: $rootScope.shapestyleborderWidth,
3071   - fillStyle: $rootScope.selectedBGColorForTextArea,
3072   - fromCenter: false,
3073   - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
3074   - width: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
3075   - height: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
3076   - resizeFromCenter: false,
3077   - add: function (layer) {
3078   - var TextAreaLayerName = layer.name;
3079   - var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
3080   - $rootScope.postFixLayerNumber = TextAreaLayerNameAftrSplit[1];
3081   - if ($location.path() == "/module-item-view") {
3082   - $rootScope.initialTextAreaName = layer.name;
3083   - $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
3084   - }
3085   - },
3086   - dragstop: function (layer) {
3087   -
3088   - if ($location.path() == "/module-item-view") {
3089   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
3090   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
3091   - $rootScope.jcanvasObjectArray[i].x = layer.x;
3092   - $rootScope.jcanvasObjectArray[i].y = layer.y;
3093   - $rootScope.jcanvasObjectArray[i].width = layer.width;
3094   - $rootScope.jcanvasObjectArray[i].height = layer.height;
3095   - }
3096   - }
3097   - }
3098   - },
3099   -
3100   - click: function (layer) {
3101   -
3102   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3103   - //jcanvas property
3104   - layer.draggable = true;
3105   - $rootScope.shapeTypeText = "textAreaRect";
3106   - var layerName = layer.name;
3107   - var splitedName = layerName.split("_");
3108   - var textValName = "TextAreaNew_";
3109   - var concatinateResult = textValName.concat(splitedName[1]);
3110   - $rootScope.canvasLayerNameCollection = [];
3111   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
3112   - $('#canvas').setLayer(layer.name, {
3113   - handle: {
3114   - type: 'rectangle',
3115   - fillStyle: '#fff',
3116   - strokeStyle: '#c33',
3117   - strokeWidth: 2,
3118   - width: 5, height: 5,
3119   - cornerRadius: 3,
3120   - }
3121   - }).drawLayers();
3122   -
3123   - }
3124   - else {
3125   - //jcanvas property
3126   - layer.draggable = false;
3127   - }
3128   - },
3129   - dblclick: function (layer) {
3130   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3131   - //jcanvas property
3132   - layer.draggable = true;
3133   - $rootScope.isTextAreaClosedButtonActive = false;
3134   - $rootScope.IsTextAlreadySave = true;
3135   -
3136   - var _rectLayerOnSave = layer.name;
3137   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
3138   - var TextAreaRectName = "TextAreaNew_";
3139   - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
3140   -
3141   - $rootScope.layerNameArr = layer.name;
3142   - $rootScope.rectTextArr = TextAreaRectNameConcatenated;
3143   -
3144   -
3145   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
3146   -
3147   - for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
3148   - if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
3149   -
3150   - var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
3151   - $("#text_area").val(textArrVal);
3152   - var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
3153   - var fontWeightProp = fontStyleProp.split(" ");
3154   -
3155   - $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
3156   - $("#text_area").css("font-weight", fontWeightProp[0]);
3157   - $("#text_area").css("font-style", fontWeightProp[1]);
3158   - $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
3159   - $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
3160   - $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
3161   - $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
3162   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
3163   -
3164   - var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
3165   - var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
3166   - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
3167   - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
3168   -
3169   - CurrentFontFamily = '';
3170   - CurrentFontSize = '';
3171   -
3172   -
3173   - if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
3174   -
3175   - $("#text-underline").addClass("ActiveFormattingButtonClass");
3176   -
3177   - }
3178   -
3179   - else {
3180   -
3181   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
3182   -
3183   - }
3184   -
3185   - //adding text font weight active class in text edit pop-up
3186   -
3187   - if (fontWeightProp[0] == 700) {
3188   -
3189   - $("#text-bold").addClass("ActiveFormattingButtonClass");
3190   -
3191   - }
3192   -
3193   - else {
3194   -
3195   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
3196   -
3197   - }
3198   -
3199   - //adding text font style active class in text edit pop-up
3200   -
3201   - if (fontWeightProp[1] == "italic") {
3202   -
3203   -
3204   - $("#text-italic").addClass("ActiveFormattingButtonClass");
3205   - }
3206   - else {
3207   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
3208   -
3209   -
3210   - }
3211   -
3212   - //adding text alignment active class in text edit pop-up
3213   -
3214   - if ($rootScope.TextPropertyArray[i].Align == "left") {
3215   -
3216   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3217   -
3218   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3219   -
3220   - $("#text-left").addClass("ActiveFormattingButtonClass");
3221   -
3222   - }
3223   -
3224   - else if ($rootScope.TextPropertyArray[i].Align == "right") {
3225   -
3226   -
3227   -
3228   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3229   -
3230   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3231   -
3232   - $("#text-right").addClass("ActiveFormattingButtonClass");
3233   - }
3234   -
3235   - else if ($rootScope.TextPropertyArray[i].Align == "center") {
3236   -
3237   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3238   -
3239   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3240   -
3241   - $("#text-center").addClass("ActiveFormattingButtonClass");
3242   -
3243   - }
3244   -
3245   - }
3246   - else {
3247   - // alert("no");
3248   -
3249   - }
3250   -
3251   - }
3252   -
3253   -
3254   - // _rectLayerOnSaveSplitInt = '';
3255   - textArrVal = '';
3256   - $("#annotationTextModal").css("padding-right", "0px");
3257   - document.getElementById('modelbackground').style.display = "block";
3258   - $("#annotationTextModal").modal("toggle");
3259   -
3260   - // $("#selected-font-family").val(CurrentFontFamily);
3261   - // $("#selected-font-size").val(CurrentFontSize);
3262   - }
3263   - else {
3264   - //jcanvas property
3265   - layer.draggable = false;
3266   - }
3267   -
3268   - },
3269   - touchstart: function (layer) {
3270   -
3271   - if (isDoubleTouchSaveText == null) {
3272   - isDoubleTouchSaveText = setTimeout(function () {
3273   - isDoubleTouchSaveText = null;
3274   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3275   - //jcanvas property
3276   - layer.draggable = true;
3277   - $rootScope.shapeTypeText = "textAreaRect";
3278   - var layerName = layer.name;
3279   - var splitedName = layerName.split("_");
3280   - var textValName = "TextAreaNew_";
3281   - var concatinateResult = textValName.concat(splitedName[1]);
3282   - $rootScope.canvasLayerNameCollection = [];
3283   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
3284   - $('#canvas').setLayer(layer.name, {
3285   - handle: {
3286   - type: 'rectangle',
3287   - fillStyle: '#fff',
3288   - strokeStyle: '#c33',
3289   - strokeWidth: 2,
3290   - width: 5, height: 5,
3291   - cornerRadius: 3,
3292   - }
3293   - }).drawLayers();
3294   -
3295   - }
3296   - else {
3297   - //jcanvas property
3298   - layer.draggable = false;
3299   - }
3300   -
3301   - }, 1000)
3302   - } else {
3303   - clearTimeout(isDoubleTouchSaveText);
3304   - isDoubleTouchSaveText = null;
3305   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3306   - //jcanvas property
3307   - layer.draggable = true;
3308   - $rootScope.isTextAreaClosedButtonActive = false;
3309   - $rootScope.IsTextAlreadySave = true;
3310   -
3311   - var _rectLayerOnSave = layer.name;
3312   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
3313   - var TextAreaRectName = "TextAreaNew_";
3314   - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
3315   -
3316   - $rootScope.layerNameArr = layer.name;
3317   - $rootScope.rectTextArr = TextAreaRectNameConcatenated;
3318   -
3319   -
3320   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
3321   -
3322   - for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
3323   - if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
3324   -
3325   - var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
3326   - $("#text_area").val(textArrVal);
3327   - var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
3328   - var fontWeightProp = fontStyleProp.split(" ");
3329   -
3330   - $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
3331   - $("#text_area").css("font-weight", fontWeightProp[0]);
3332   - $("#text_area").css("font-style", fontWeightProp[1]);
3333   - $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
3334   - $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
3335   - $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
3336   - $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
3337   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
3338   -
3339   - var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
3340   - var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
3341   - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
3342   - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
3343   -
3344   - CurrentFontFamily = '';
3345   - CurrentFontSize = '';
3346   -
3347   -
3348   - if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
3349   -
3350   - $("#text-underline").addClass("ActiveFormattingButtonClass");
3351   -
3352   - }
3353   -
3354   - else {
3355   -
3356   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
3357   -
3358   - }
3359   -
3360   - //adding text font weight active class in text edit pop-up
3361   -
3362   - if (fontWeightProp[0] == 700) {
3363   -
3364   - $("#text-bold").addClass("ActiveFormattingButtonClass");
3365   -
3366   - }
3367   -
3368   - else {
3369   -
3370   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
3371   -
3372   - }
3373   -
3374   - //adding text font style active class in text edit pop-up
3375   -
3376   - if (fontWeightProp[1] == "italic") {
3377   -
3378   -
3379   - $("#text-italic").addClass("ActiveFormattingButtonClass");
3380   - }
3381   - else {
3382   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
3383   -
3384   -
3385   - }
3386   -
3387   - //adding text alignment active class in text edit pop-up
3388   -
3389   - if ($rootScope.TextPropertyArray[i].Align == "left") {
3390   -
3391   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3392   -
3393   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3394   -
3395   - $("#text-left").addClass("ActiveFormattingButtonClass");
3396   -
3397   - }
3398   -
3399   - else if ($rootScope.TextPropertyArray[i].Align == "right") {
3400   -
3401   -
3402   -
3403   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3404   -
3405   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3406   -
3407   - $("#text-right").addClass("ActiveFormattingButtonClass");
3408   - }
3409   -
3410   - else if ($rootScope.TextPropertyArray[i].Align == "center") {
3411   -
3412   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3413   -
3414   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3415   -
3416   - $("#text-center").addClass("ActiveFormattingButtonClass");
3417   -
3418   - }
3419   -
3420   - }
3421   - else {
3422   - // alert("no");
3423   -
3424   - }
3425   -
3426   - }
3427   -
3428   -
3429   - // _rectLayerOnSaveSplitInt = '';
3430   - textArrVal = '';
3431   - $("#annotationTextModal").css("padding-right", "0px");
3432   - document.getElementById('modelbackground').style.display = "block";
3433   - $("#annotationTextModal").modal("toggle");
3434   -
3435   - // $("#selected-font-family").val(CurrentFontFamily);
3436   - // $("#selected-font-size").val(CurrentFontSize);
3437   - }
3438   - else {
3439   - //jcanvas property
3440   - layer.draggable = false;
3441   - }
3442   -
3443   - }
3444   - },
3445   - mouseout: function (layer) {
3446   -
3447   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3448   - //jcanvas property
3449   - layer.draggable = true;
3450   - $rootScope.canvasLayerNameCollection = [];
3451   - $('#canvas').setLayer(layer.name, {
3452   - handle: {
3453   - type: 'rectangle',
3454   - fillStyle: 'pink',
3455   - strokeStyle: 'yellow',
3456   - strokeWidth: 0,
3457   - width: 0, height: 0,
3458   - cornerRadius: 0
3459   -
3460   - }
3461   - }).drawLayers();
3462   - }
3463   - else {
3464   - //jcanvas property
3465   - layer.draggable = false;
3466   - }
3467   -
3468   - },
3469   - mouseover: function (layer) {
3470   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3471   - //jcanvas property
3472   - layer.draggable = true;
3473   - $('#canvas').setLayer(layer.name, {
3474   - handle: {
3475   - type: 'rectangle',
3476   - fillStyle: '#fff',
3477   - strokeStyle: '#c33',
3478   - strokeWidth: 2,
3479   - width: 5, height: 5,
3480   - cornerRadius: 3,
3481   - click: function () {
3482   - $rootScope.isTextAReaRectangleClicked = true;
3483   -
3484   - }
3485   -
3486   - }
3487   - }).drawLayers();
3488   - }
3489   - else {
3490   - //jcanvas property
3491   - layer.draggable = false;
3492   - }
3493   - },
3494   - change: function (layer) {
3495   -
3496   - if ($rootScope.isTextAReaRectangleClicked == true) {
3497   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3498   - console.log(layer.x + " " + layer.y);
3499   - console.log($rootScope.textXAxisAftrResize + " " + $rootScope.textYAxisAftrResize);
3500   - $rootScope.isTextAReaRectangleClicked = false;
3501   - //if ((layer.x > $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x == $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x > $rootScope.textXAxisAftrResize) && (layer.y == $rootScope.textYAxisAftrResize)) {
3502   - var CangedTextAreaName = 'TextAreaNew_' + $rootScope.postFixLayerNumber;
3503   - $('#canvas').setLayer(CangedTextAreaName, {
3504   - x: layer.x,
3505   - y: layer.y
3506   - });
3507   - //}
3508   - $rootScope.textXAxisAftrResize = layer.x;
3509   - $rootScope.textYAxisAftrResize = layer.y;
3510   -
3511   -
3512   - if ($location.path() == "/module-item-view") {
3513   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
3514   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
3515   - $rootScope.jcanvasObjectArray[i].x = layer.x;
3516   - $rootScope.jcanvasObjectArray[i].y = layer.y;
3517   - $rootScope.jcanvasObjectArray[i].width = layer.width;
3518   - $rootScope.jcanvasObjectArray[i].height = layer.height;
3519   - }
3520   - }
3521   - }
3522   - }
3523   - }
3524   - }
3525   -
3526   - }).drawText({
3527   - layer: true,
3528   - draggable: true,
3529   - name: 'TextAreaNew_' + $rootScope.resetTextRect,
3530   - groups: ['TextAreaNew_' + $rootScope.resetTextRect],
3531   - dragGroups: ['TextAreaNew_' + $rootScope.resetTextRect],
3532   - fillStyle: $rootScope.fontColor,
3533   - fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle,
3534   - fontSize: $rootScope.fontSizes,
3535   - fromCenter: false,
3536   - fontFamily: $rootScope.fontFamily,
3537   - align: $rootScope.textAlignmt,
3538   - strokeWidth: 0,
3539   - text: $rootScope.textArea,
3540   - x: ($rootScope.rectDimension[$rootScope.rectDimension.length - 1].x), y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
3541   - maxWidth: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
3542   - maxHeight: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
3543   - add: function (layer) {
3544   - // console.log(layer.x + " " + layer.y);
3545   - $rootScope.textXAxisAftrResize = layer.x;
3546   - $rootScope.textYAxisAftrResize = layer.y;
3547   -
3548   - //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
3549   - $rootScope.TextPropertyArray.push({ layerName: layer.name, Rect_Text: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText });
3550   - }
3551   - });
3552   - $("#text_area").val('');
3553   - $("#text_area").css({ " font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
3554   -
3555   - $("#selected-font-family option:eq(0)").prop('selected', true);
3556   - $("#selected-font-size option:eq(0)").prop('selected', true);
3557   -
3558   - // $("#selected-font-family option:eq(0)").prop('selected', true);
3559   - // $("#selected-font-size option:eq(0)").prop('selected', true);
3560   -
3561   - // $("#selected-font-family option[value='Arial']").prop('selected', true);
3562   - // $("#selected-font-size option[value=14]").prop('selected', true);
3563   -
3564   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
3565   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
3566   -
3567   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
3568   -
3569   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
3570   -
3571   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3572   -
3573   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3574   -
3575   - $("#text-center").removeClass("ActiveFormattingButtonClass");
3576   -
3577   -
3578   - }
3579   -
3580   - // this part will work second time when save button will be clicked
3581   - else {
3582   -
3583   -
3584   - if ($location.path() == "/module-item-view") {
3585   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
3586   - if ($rootScope.jcanvasObjectArray[i].name == $rootScope.initialTextAreaName) {
3587   - $rootScope.jcanvasObjectArray.splice(i, 1);
3588   - $rootScope.initialTextAreaName = '';
3589   - }
3590   - }
3591   - }
3592   -
3593   -
3594   - // getting textarea style properties
3595   - var _modifiedText = $("#text_area").val();
3596   - var _modifiedFontSize = $("#text_area").css("font-size");
3597   - var _modifiedFontWeight = $("#text_area").css("font-weight");
3598   - var _modifiedFontStyle = $("#text_area").css("font-style");
3599   - var _modifiedTextAlign = $("#text_area").css("text-align");
3600   - var _modifiedFontColor = $("#text_area").css("color");
3601   - var _modifiedFontFamily = $("#text_area").css("font-family");
3602   - var _modifiedFontDecoration = $("#text_area").css("text-decoration");
3603   -
3604   - // deleting previous textarea
3605   -
3606   -
3607   - $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers();
3608   - $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers();
3609   -
3610   - $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
3611   - $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
3612   -
3613   - // generating new text area
3614   - // $('#canvas')
3615   - // Draw rect as wide as the text
3616   - $('#canvas').drawRect({
3617   - name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
3618   - layer: true,
3619   - draggable: true,
3620   - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
3621   - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
3622   - opacity: $rootScope.shapestyleOpacity,
3623   - fromCenter: false,
3624   - strokeStyle: $rootScope.shapestyleborderColor,
3625   - strokeWidth: $rootScope.shapestyleborderWidth,
3626   - fillStyle: $rootScope.selectedBGColorForTextArea,
3627   - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
3628   - width: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
3629   - height: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
3630   - resizeFromCenter: false,
3631   - add: function (layer) {
3632   - var TextAreaLayerName = layer.name;
3633   - var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
3634   - $rootScope.postFixLayerNumberAftrEdit = TextAreaLayerNameAftrSplit[1];
3635   - if ($location.path() == "/module-item-view") {
3636   - $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
3637   - }
3638   - },
3639   - dragstop: function (layer) {
3640   -
3641   - if ($location.path() == "/module-item-view") {
3642   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
3643   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
3644   - $rootScope.jcanvasObjectArray[i].x = layer.x;
3645   - $rootScope.jcanvasObjectArray[i].y = layer.y;
3646   - $rootScope.jcanvasObjectArray[i].width = layer.width;
3647   - $rootScope.jcanvasObjectArray[i].height = layer.height;
3648   - }
3649   - }
3650   - }
3651   - },
3652   - click: function (layer) {
3653   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3654   - //jcanvas property
3655   - layer.draggable = true;
3656   - $rootScope.shapeTypeText = "textAreaRect";
3657   - var layerName = layer.name;
3658   - var splitedName = layerName.split("_");
3659   - var textValName = "TextAreaAfterEdit_";
3660   - var concatinateResult = textValName.concat(splitedName[1]);
3661   - $rootScope.canvasLayerNameCollection = [];
3662   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
3663   -
3664   - $('#canvas').setLayer(layer.name, {
3665   - handle: {
3666   - type: 'rectangle',
3667   - fillStyle: '#fff',
3668   - strokeStyle: '#c33',
3669   - strokeWidth: 2,
3670   - width: 5, height: 5,
3671   - cornerRadius: 3,
3672   - }
3673   - }).drawLayers();
3674   - }
3675   - else {
3676   - //jcanvas property
3677   - layer.draggable = false;
3678   - }
3679   -
3680   - },
3681   - dblclick: function (layer) {
3682   -
3683   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3684   - //jcanvas property
3685   - layer.draggable = true;
3686   - $rootScope.isTextAreaClosedButtonActive = false;
3687   - $rootScope.IsTextAlreadySave = true;
3688   - var _rectLayerOnSave = layer.name;
3689   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
3690   - var RectNameAfterEdit = "TextAreaAfterEdit_";
3691   - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
3692   - $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
3693   -
3694   - $rootScope.layerNameArr = layer.name;
3695   - $rootScope.rectTextArr = RectNameAfterEditResult;
3696   -
3697   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
3698   - $("#text_area").val(_modifiedText);
3699   - $("#text_area").css("font-size", _modifiedFontSize);
3700   - $("#text_area").css("font-weight", _modifiedFontWeight);
3701   - $("#text_area").css("font-style", _modifiedFontStyle);
3702   - $("#text_area").css("text-align", _modifiedTextAlign);
3703   - $("#text_area").css("color", _modifiedFontColor);
3704   - $("#text_area").css("font-family", _modifiedFontFamily);
3705   - $("#text_area").css("text-decoration", _modifiedFontDecoration);
3706   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
3707   -
3708   - // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
3709   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
3710   -
3711   - //khushbu
3712   - var CurrentFontFamily = _modifiedFontFamily;
3713   - // alert(CurrentFontFamily);
3714   - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
3715   - var CurrentFontSize = parseInt(_modifiedFontSize);
3716   - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
3717   - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
3718   - CurrentFontFamily = '';
3719   - CurrentFontSize = '';
3720   - //adding text text decoration active class in text edit pop-up
3721   - if (_modifiedFontDecoration == "underline") {
3722   - $("#text-underline").addClass("ActiveFormattingButtonClass");
3723   - }
3724   - else {
3725   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
3726   - }
3727   -
3728   - //adding text font weight active class in text edit pop-up
3729   - if (_modifiedFontWeight == 700) {
3730   -
3731   - $("#text-bold").addClass("ActiveFormattingButtonClass");
3732   - }
3733   - else {
3734   -
3735   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
3736   -
3737   - }
3738   -
3739   - //adding text font style active class in text edit pop-up
3740   - if (_modifiedFontStyle == "italic") {
3741   -
3742   - $("#text-italic").addClass("ActiveFormattingButtonClass");
3743   - }
3744   - else {
3745   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
3746   -
3747   - }
3748   -
3749   - //adding text alignment active class in text edit pop-up
3750   - if (_modifiedTextAlign == "left") {
3751   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3752   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3753   - $("#text-left").addClass("ActiveFormattingButtonClass");
3754   - }
3755   - else if (_modifiedTextAlign == "right") {
3756   -
3757   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3758   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3759   - $("#text-right").addClass("ActiveFormattingButtonClass");
3760   -
3761   - }
3762   - else if (_modifiedTextAlign == "center") {
3763   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3764   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3765   - $("#text-center").addClass("ActiveFormattingButtonClass");
3766   -
3767   - }
3768   -
3769   - document.getElementById('modelbackground').style.display = "block";
3770   - $("#annotationTextModal").modal("toggle");
3771   - }
3772   - else {
3773   - //jcanvas property
3774   - layer.draggable = false;
3775   - }
3776   - },
3777   - touchstart: function (layer) {
3778   -
3779   - if (isDoubleTouchSaveTextAgain == null) {
3780   - isDoubleTouchSaveTextAgain = setTimeout(function () {
3781   - isDoubleTouchSaveTextAgain = null;
3782   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3783   - //jcanvas property
3784   - layer.draggable = true;
3785   - $rootScope.shapeTypeText = "textAreaRect";
3786   - var layerName = layer.name;
3787   - var splitedName = layerName.split("_");
3788   - var textValName = "TextAreaAfterEdit_";
3789   - var concatinateResult = textValName.concat(splitedName[1]);
3790   - $rootScope.canvasLayerNameCollection = [];
3791   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
3792   -
3793   - $('#canvas').setLayer(layer.name, {
3794   - handle: {
3795   - type: 'rectangle',
3796   - fillStyle: '#fff',
3797   - strokeStyle: '#c33',
3798   - strokeWidth: 2,
3799   - width: 5, height: 5,
3800   - cornerRadius: 3,
3801   - }
3802   - }).drawLayers();
3803   - }
3804   - else {
3805   - //jcanvas property
3806   - layer.draggable = false;
3807   - }
3808   -
3809   - }, 1000)
3810   - } else {
3811   - clearTimeout(isDoubleTouchSaveTextAgain);
3812   - isDoubleTouchSaveTextAgain = null;
3813   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3814   - //jcanvas property
3815   - layer.draggable = true;
3816   - $rootScope.isTextAreaClosedButtonActive = false;
3817   - $rootScope.IsTextAlreadySave = true;
3818   - var _rectLayerOnSave = layer.name;
3819   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
3820   - var RectNameAfterEdit = "TextAreaAfterEdit_";
3821   - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
3822   - $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
3823   -
3824   - $rootScope.layerNameArr = layer.name;
3825   - $rootScope.rectTextArr = RectNameAfterEditResult;
3826   -
3827   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
3828   - $("#text_area").val(_modifiedText);
3829   - $("#text_area").css("font-size", _modifiedFontSize);
3830   - $("#text_area").css("font-weight", _modifiedFontWeight);
3831   - $("#text_area").css("font-style", _modifiedFontStyle);
3832   - $("#text_area").css("text-align", _modifiedTextAlign);
3833   - $("#text_area").css("color", _modifiedFontColor);
3834   - $("#text_area").css("font-family", _modifiedFontFamily);
3835   - $("#text_area").css("text-decoration", _modifiedFontDecoration);
3836   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
3837   -
3838   - // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
3839   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
3840   -
3841   - //khushbu
3842   - var CurrentFontFamily = _modifiedFontFamily;
3843   - // alert(CurrentFontFamily);
3844   - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
3845   - var CurrentFontSize = parseInt(_modifiedFontSize);
3846   - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
3847   - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
3848   - CurrentFontFamily = '';
3849   - CurrentFontSize = '';
3850   - //adding text text decoration active class in text edit pop-up
3851   - if (_modifiedFontDecoration == "underline") {
3852   - $("#text-underline").addClass("ActiveFormattingButtonClass");
3853   - }
3854   - else {
3855   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
3856   - }
3857   -
3858   - //adding text font weight active class in text edit pop-up
3859   - if (_modifiedFontWeight == 700) {
3860   -
3861   - $("#text-bold").addClass("ActiveFormattingButtonClass");
3862   - }
3863   - else {
3864   -
3865   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
3866   -
3867   - }
3868   -
3869   - //adding text font style active class in text edit pop-up
3870   - if (_modifiedFontStyle == "italic") {
3871   -
3872   - $("#text-italic").addClass("ActiveFormattingButtonClass");
3873   - }
3874   - else {
3875   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
3876   -
3877   - }
3878   -
3879   - //adding text alignment active class in text edit pop-up
3880   - if (_modifiedTextAlign == "left") {
3881   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3882   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3883   - $("#text-left").addClass("ActiveFormattingButtonClass");
3884   - }
3885   - else if (_modifiedTextAlign == "right") {
3886   -
3887   - $("#text-center").removeClass("ActiveFormattingButtonClass")
3888   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3889   - $("#text-right").addClass("ActiveFormattingButtonClass");
3890   -
3891   - }
3892   - else if (_modifiedTextAlign == "center") {
3893   - $("#text-left").removeClass("ActiveFormattingButtonClass");
3894   - $("#text-right").removeClass("ActiveFormattingButtonClass");
3895   - $("#text-center").addClass("ActiveFormattingButtonClass");
3896   -
3897   - }
3898   -
3899   - document.getElementById('modelbackground').style.display = "block";
3900   - $("#annotationTextModal").modal("toggle");
3901   - }
3902   - else {
3903   - //jcanvas property
3904   - layer.draggable = false;
3905   - }
3906   -
3907   - }
3908   - },
3909   - mouseout: function (layer) {
3910   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3911   - //jcanvas property
3912   - layer.draggable = true;
3913   - $rootScope.canvasLayerNameCollection = [];
3914   - $('#canvas').setLayer(layer.name, {
3915   - handle: {
3916   - type: 'rectangle',
3917   - fillStyle: 'pink',
3918   - strokeStyle: 'yellow',
3919   - strokeWidth: 0,
3920   - width: 0, height: 0,
3921   - cornerRadius: 0
3922   - }
3923   - }).drawLayers();
3924   -
3925   - }
3926   - else {
3927   - //jcanvas property
3928   - layer.draggable = false;
3929   - }
3930   - $rootScope.RectXAxisAftrResize = layer.x;
3931   - $rootScope.RectYAxisAftrResize = layer.y;
3932   - },
3933   - mouseover: function (layer) {
3934   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3935   - //jcanvas property
3936   - layer.draggable = true;
3937   - $('#canvas').setLayer(layer.name, {
3938   - handle: {
3939   - type: 'rectangle',
3940   - fillStyle: '#fff',
3941   - strokeStyle: '#c33',
3942   - strokeWidth: 2,
3943   - width: 10, height: 10,
3944   - cornerRadius: 3,
3945   - click: function () {
3946   - $rootScope.isTextAReaRectangleClickedAftrEdit = true;
3947   - }
3948   - }
3949   - }).drawLayers();
3950   -
3951   - }
3952   -
3953   - else {
3954   - //jcanvas property
3955   - layer.draggable = false;
3956   - }
3957   - },
3958   - change: function (layer) {
3959   -
3960   - if ($rootScope.isTextAReaRectangleClickedAftrEdit == true) {
3961   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3962   - console.log(layer.x + " " + layer.y);
3963   - console.log($rootScope.textXAxisAftrResize + " " + $rootScope.textYAxisAftrResize);
3964   - $rootScope.isTextAReaRectangleClickedAftrEdit = false;
3965   - //if ((layer.x > $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x == $rootScope.textXAxisAftrResize) && (layer.y > $rootScope.textYAxisAftrResize) || (layer.x > $rootScope.textXAxisAftrResize) && (layer.y == $rootScope.textYAxisAftrResize)) {
3966   - var CangedTextAreaName = 'TextAreaAfterEdit_' + $rootScope.postFixLayerNumberAftrEdit;
3967   - $('#canvas').setLayer(CangedTextAreaName, {
3968   - x: layer.x,
3969   - y: layer.y
3970   - });
3971   -
3972   - //}
3973   - $rootScope.editTextXAxisAftrResize = layer.x;
3974   - $rootScope.editTextYAxisAftrResize = layer.y;
3975   - if ($location.path() == "/module-item-view") {
3976   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
3977   - if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
3978   - $rootScope.jcanvasObjectArray[i].x = layer.x;
3979   - $rootScope.jcanvasObjectArray[i].y = layer.y;
3980   - $rootScope.jcanvasObjectArray[i].width = layer.width;
3981   - $rootScope.jcanvasObjectArray[i].height = layer.height;
3982   - }
3983   - }
3984   -
3985   - }
3986   -
3987   -
3988   - }
3989   - }
3990   -
3991   -
3992   - }
3993   -
3994   - }).drawText({
3995   - layer: true,
3996   - draggable: true,
3997   - name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
3998   - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
3999   - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
4000   - fillStyle: _modifiedFontColor,
4001   - fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle,
4002   - fontSize: _modifiedFontSize,
4003   - fontFamily: _modifiedFontFamily,
4004   - align: _modifiedTextAlign,
4005   - strokeWidth: 0,
4006   - fromCenter: false,
4007   - text: _modifiedText,
4008   - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
4009   - maxWidth: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
4010   - maxHeight: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
4011   - add: function (layer) {
4012   - // console.log(layer.x + " " + layer.y);
4013   - $rootScope.editTextXAxisAftrResize = layer.x;
4014   - $rootScope.editTextYAxisAftrResize = layer.y;
4015   - }
4016   - });
4017   -
4018   - }
4019   - }
4020   - //----
4021   -
4022   - $rootScope.onDrawingCanvasClick = function (event) {
4023   -
4024   - $rootScope.clicked = true;
4025   - // OnPaintCanvasMouseDown(event);
4026   -
4027   - var annotationCanvas = document.getElementById('canvas');
4028   - if (annotationCanvas != null || annotationCanvas != undefined) {
4029   -
4030   - annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintCanvasMouseDown, false);
4031   - annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false);
4032   -
4033   -
4034   - annotationCanvas.addEventListener("touchstart", $rootScope.OnPaintCanvasMouseDown, false);
4035   - annotationCanvas.addEventListener("touchend", $rootScope.OnPaintCanvasMouseUp, false);
4036   -
4037   - }
4038   -
4039   - // alert("doclick");
4040   - // annotation history
4041   - if (event != undefined) {
4042   -
4043   - if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
4044   -
4045   - $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event);
4046   -
4047   - }
4048   - }
4049   -
4050   -
4051   - };
4052   -
4053   -
4054   - $(document).keydown(function (event) {
4055   -
4056   - // predefined function for detecting keyboard key
4057   - if (event.which == 46) {
4058   -
4059   - if ($rootScope.shapeTypePin == "Pin") {
4060   -
4061   -
4062   - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].pinName).drawLayers();
4063   - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].ArcName).drawLayers();
4064   - $rootScope.shapeTypePin = "";
4065   -
4066   - }
4067   - else if ($rootScope.shapeTypeText == "textAreaRect") {
4068   - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaRectangle).drawLayers();
4069   - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaString).drawLayers();
4070   - $rootScope.shapeTypeText = "";
4071   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
4072   -
4073   - if ($rootScope.canvasLayerNameCollection[0].textareaRectangle == $rootScope.jcanvasObjectArray[i].name) {
4074   -
4075   - $rootScope.jcanvasObjectArray.splice(i, 1);
4076   -
4077   - }
4078   - // console.log($rootScope.jcanvasObjectArray);
4079   - }
4080   -
4081   - }
4082   - else {
4083   -
4084   - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers();
4085   - if ($location.path() == "/module-item-view") {
4086   - for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
4087   -
4088   - if ($rootScope.canvasLayerNameCollection == $rootScope.jcanvasObjectArray[i].name) {
4089   -
4090   - $rootScope.jcanvasObjectArray.splice(i, 1);
4091   - }
4092   - }
4093   - }
4094   - }
4095   - }
4096   -
4097   - });
4098   -
4099   -
4100   - $rootScope.closeModal = function () {
4101   -
4102   - document.getElementById('modelbackground').style.display = "none";
4103   - $("#drawTextBGColorpicker span.minicolors-swatch-color").css('background-color', $rootScope.selectedBGColorForTextArea);
4104   -
4105   - }
4106   - //-- End ----------------------------
4107   -
4108   -
4109   - $rootScope.AddClick = function (x, y, dragging) {
4110   - $rootScope.clickX.push(x);
4111   - $rootScope.clickY.push(y);
4112   - $rootScope.clickDrag.push(dragging);
4113   - }
4114   -
4115   - $rootScope.Redraw = function () {
4116   - var context = document.getElementById('paintCanvas').getContext('2d');
4117   -
4118   - context.clearRect(0, 0, context.canvas.width, context.canvas.height); // Clears the canvas
4119   -
4120   - context.strokeStyle = "#FFFFFF";
4121   - context.lineJoin = "round";
4122   - context.lineWidth = 5;
4123   -
4124   -
4125   - for (var i = 0; i < $rootScope.clickX.length; i++) {
4126   - context.beginPath();
4127   - if ($rootScope.clickDrag[i] && i) {
4128   - context.moveTo($rootScope.clickX[i - 1], $rootScope.clickY[i - 1]);
4129   - } else {
4130   - context.moveTo($rootScope.clickX[i] - 1, $rootScope.clickY[i]);
4131   - }
4132   - context.lineTo($rootScope.clickX[i], $rootScope.clickY[i]);
4133   - context.closePath();
4134   - context.stroke();
4135   - }
4136   - }
4137   -
4138   - $rootScope.PaintCanvasMousedownListener = function (canvasContext, x, y) {
4139   - if ($rootScope.isLineDrawSelecyed == true) {
4140   -
4141   - canvasContext.lineWidth = 0.1;
4142   - canvasContext.strokeStyle = 'red';
4143   - canvasContext.beginPath();
4144   - canvasContext.moveTo(x, y);
4145   - }
4146   -
4147   - }
4148   -
4149   - $rootScope.PaintCanvasMouseupListener = function (canvasContext) {
4150   - if ($scope.isLineDrawSelecyed == true) {
4151   -
4152   - }
4153   - }
4154   -
4155   - $rootScope.PaintCanvasMousemoveListener = function (canvasContext, x, y) {
4156   - if ($rootScope.isLineDrawSelecyed == true) {
4157   - console.log('hm moving')
4158   - canvasContext.lineTo(x, y);
4159   - canvasContext.stroke();
4160   - }
4161   - }
4162   -
4163   - $rootScope.Draw = function (x, y, isDown, context) {
4164   - if (isDown) {
4165   - context.beginPath();
4166   - context.strokeStyle = '#000000';
4167   - context.lineWidth = 1//$('#selWidth').val();
4168   - context.lineJoin = "round";
4169   - context.moveTo($rootScope.lastX, $rootScope.lastY);
4170   - context.lineTo(x, y);
4171   - context.closePath();
4172   - context.stroke();
4173   - }
4174   - $rootScope.lastX = x; $rootScope.lastY = y;
4175   - }
4176   -
4177   - $rootScope.disableAnnotationTB = false;
4178   - $rootScope.disableAnnotationTBFn = function () {
4179   - $rootScope.disableAnnotationTB = true;
4180   - }
4181   -
4182   - //list manager function
4183   -
4184   - //list manager function
4185   -
4186   - $rootScope.disableAnnotationtoolOnListManager = false;
4187   - $rootScope.ShowListManager = function () {
4188   -
4189   - $rootScope.switchCanvas();
4190   - $("#annotationpaintbrushsize").attr("href", "#");
4191   - $("#annotationpainteraser").attr("href", "#");
4192   - console.log('ShowListManager')
4193   - $rootScope.disableAnnotationtoolOnListManager = true;
4194   - $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
4195   - $('#slider-range-min-2').slider('disable');
4196   - $("#annotationpaintbrushsize").attr('disabled', 'disabled');
4197   - $("#annotationpainteraser").attr('disabled', 'disabled');
4198   - $("#annotationpaintbrushsize").css('pointer-events', 'none');
4199   - $("#annotationpainteraser").css('pointer-events', 'none');
4200   - $rootScope.isLoading = true;
4201   - $('#spinner').css('visibility', 'visible');
4202   -
4203   - $('#listManager').css('display', 'block');
4204   - $("#listManager").css("visibility", "visible");
4205   -
4206   - $('#listManager').draggable();
4207   - $rootScope.islistManagerEventAlredayDispachted = true;
4208   -
4209   - $rootScope.$broadcast('listManagerEvent', true);
4210   -
4211   - if ($rootScope.selectedBodySystemName == undefined && $rootScope.slectedActualTermNumber == undefined) {
4212   - if ($location.path() == "/module-item-view") {
4213   - $timeout(function () {
4214   - $('#termList option[selected="selected"]').prop("selected", false);
4215   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
4216   - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
4217   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
4218   -
4219   - }, 1000);
4220   - }
4221   - else {
4222   - $('#termList option[selected="selected"]').prop("selected", false);
4223   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
4224   - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
4225   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
4226   - }
4227   - }
4228   - else {
4229   -
4230   - if ($rootScope.selectedBodySystemId == undefined) {
4231   - $rootScope.selectedBodySystemId = 0;
4232   - if ($location.path() == "/module-item-view") {
4233   - $rootScope.refreshTermListOnAASystemSelection($rootScope.selectedBodySystemId);
4234   - }
4235   - else {
4236   - if ($location.path() == "/module-item-view") {
4237   - $rootScope.refreshTermListOnAASystemSelection($rootScope.selectedBodySystemId);
4238   - }
4239   - else {
4240   - $rootScope.refreshTermListOnSystemSelection($rootScope.selectedBodySystemId);
4241   - }
4242   -
4243   - }
4244   - }
4245   - else {
4246   - if ($location.path() == "/module-item-view") {
4247   - $rootScope.refreshTermListOnAASystemSelection($rootScope.selectedBodySystemId);
4248   - }
4249   - else {
4250   - $rootScope.refreshTermListOnSystemSelection($rootScope.selectedBodySystemId);
4251   - }
4252   -
4253   - }
4254   -
4255   - $timeout(function () {
4256   - $('#bodySystems option[selected="selected"]').prop("selected", false);
4257   - $('#bodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').prop("selected", true);
4258   - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
4259   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
4260   -
4261   - }, 1000);
4262   - }
4263   - $("#optionsListManagerTab").addClass("active");
4264   - var viewNameAftrSplit;
4265   - if ($("#viewName").val() !== null) {
4266   - viewNameAftrSplit = $("#viewName").val().split(" ");
4267   -
4268   - if (viewNameAftrSplit[0] == "null") {
4269   - document.location.href = "/";
4270   - }
4271   - }
4272   - if ($location.url() == "/module-item-view") {
4273   - $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onSearchItemSelection(this.options[this.selectedIndex].id)");
4274   - }
4275   - else {
4276   - $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id, true)");
4277   - }
4278   -
4279   - }
4280   -
4281   - $rootScope.CloseListManager = function () {
4282   - $("#btnTranparency").removeAttr('disabled', 'disabled');
4283   - $("#optionsListManagerTab").removeClass("active");
4284   - $rootScope.isListManagerMenuSelected = false;
4285   - console.log('listManager closed');
4286   - $rootScope.disableAnnotationtoolOnListManager = false;
4287   - if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") {
4288   - $("#annotationpaintbrushsize").attr("href", "#canvasPaint");
4289   - $("#annotationpainteraser").attr("href", "#canvasPaint");
4290   - if ($rootScope.disableAnnotationtoolOnListManager == false) {
4291   - $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
4292   - $('#slider-range-min-2').slider('enable');
4293   - $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
4294   - $("#annotationpainteraser").removeAttr('disabled', 'disabled');
4295   - $("#annotationpaintbrushsize").css('pointer-events', 'auto');
4296   - $("#annotationpainteraser").css('pointer-events', 'auto');
4297   - if ($(".annotationTollbar").css("display") == "block") {
4298   - $rootScope.switchCanvasToPaintCanvas();
4299   - }
4300   - }
4301   - }
4302   - if ($location.path() == "/module-item-view") {
4303   - $rootScope.selectedBodySystemName = $("#AABodySystems").val();
4304   - $rootScope.selectedBodySystemId = $('#AABodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').attr("id");
4305   - }
4306   - $('#listManager').css('display', 'none');
4307   - $("#listManager").css("visibility", "hidden");
4308   -
4309   - $rootScope.isLoading = false;
4310   - $('#spinner').css('visibility', 'hidden');
4311   - //$('#spinner').css('display', 'none');
4312   - // $rootScope.isAnnotationWindowClose = true;
4313   - // if('#termList')
4314   - if ($('#termList option').length > 0) {
4315   - //$('#termList option') = null;
4316   - //$('#termList').innerHTML='';
4317   - $('#termList')
4318   - .find('option')
4319   - .remove()
4320   - .end()
4321   - if ($('#termList option').length > 0) {
4322   -
4323   - }
4324   - }
4325   -
4326   - $rootScope.prevId = "";
4327   - }
4328   -
4329   - function fillListManagerTerms() {
4330   -
4331   - var len = $rootScope.openModules.length;
4332   - var openViewLen = $rootScope.openViews.length;
4333   -
4334   - var currentOpenModuleId = $rootScope.openModules[len - 1].ModuleId;
4335   - var currentOpenViewId = $rootScope.openViews[openViewLen - 1].BodyViewId;
4336   - if (currentOpenModuleId == 1) {
4337   -
4338   - }
4339   -
4340   - }
4341   -
4342   - //setrtings
4343   - $rootScope.SetSettingActiveTab = function (tabToSet) {
4344   - $rootScope.SettingsTab = tabToSet;
4345   - };
4346   -
4347   - $rootScope.loadsettings = function () {
4348   -
4349   - //1. For now we are by default opening DA settings tab
4350   - $rootScope.SettingsTab = 3;
4351   -
4352   - //2.
4353   - var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity");
4354   - if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) {
4355   - $rootScope.globalSetting.ethnicity = curentEthnicity;
4356   - }
4357   - else {
4358   - localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity);
4359   - }
4360   -
4361   - var curentmodesty = $rootScope.getLocalStorageValue("globalModesty");
4362   - if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) {
4363   - $rootScope.globalSetting.modesty = curentmodesty
4364   - }
4365   - else {
4366   - localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty);
4367   - }
4368   -
4369   - //3.
4370   - $rootScope.setModestySettings($rootScope.globalSetting.modesty);
4371   -
4372   - //4.
4373   - $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity);
4374   -
4375   -
4376   - };
4377   -
4378   - $rootScope.setModestySettings = function (currentmodsetting) {
4379   -
4380   - if (currentmodsetting == 'Y') {
4381   - $rootScope.isModestyOn = true;
4382   - $rootScope.isModestyOff = false;
4383   - }
4384   - else {
4385   - $rootScope.isModestyOn = false;
4386   - $rootScope.isModestyOff = true;
4387   - }
4388   - }
4389   -
4390   - $rootScope.setEthncitySettings = function (currentEthncitysetting) {
4391   -
4392   - // this code is used for maintaing the currently selected Ethencity.
4393   - if (currentEthncitysetting == 'L') {
4394   - $("#btnEthnicA").addClass("skindefault");
4395   - if ($("#btnEthnicB").hasClass("skindefault")) { $("#btnEthnicB").removeClass("skindefault"); }
4396   - if ($("#btnEthnicL").hasClass("skindefault")) { $("#btnEthnicL").removeClass("skindefault"); }
4397   - if ($("#btnEthnicW").hasClass("skindefault")) { $("#btnEthnicW").removeClass("skindefault"); }
4398   - }
4399   - if (currentEthncitysetting == 'B') {
4400   - $("#btnEthnicB").addClass("skindefault");
4401   - if ($("#btnEthnicL").hasClass("skindefault")) { $("#btnEthnicL").removeClass("skindefault"); }
4402   - if ($("#btnEthnicW").hasClass("skindefault")) { $("#btnEthnicW").removeClass("skindefault"); }
4403   - if ($("#btnEthnicA").hasClass("skindefault")) { $("#btnEthnicA").removeClass("skindefault"); }
4404   - }
4405   - if (currentEthncitysetting == 'A') {
4406   - $("#btnEthnicL").addClass("skindefault");
4407   - if ($("#btnEthnicB").hasClass("skindefault")) { $("#btnEthnicB").removeClass("skindefault"); }
4408   - if ($("#btnEthnicW").hasClass("skindefault")) { $("#btnEthnicW").removeClass("skindefault"); }
4409   - if ($("#btnEthnicA").hasClass("skindefault")) { $("#btnEthnicA").removeClass("skindefault"); }
4410   - }
4411   - if (currentEthncitysetting == 'W') {
4412   - $("#btnEthnicW").addClass("skindefault");
4413   - if ($("#btnEthnicB").hasClass("skindefault")) { $("#btnEthnicB").removeClass("skindefault"); }
4414   - if ($("#btnEthnicL").hasClass("skindefault")) { $("#btnEthnicL").removeClass("skindefault"); }
4415   - if ($("#btnEthnicA").hasClass("skindefault")) { $("#btnEthnicA").removeClass("skindefault"); }
4416   - }
4417   - }
4418   -
4419   - $rootScope.ChangeEthnicity = function (formsetting, skintone) {
4420   -
4421   - if ($rootScope.isCloseSettingClicked == true) {
4422   - formsetting.ethnicity = localStorage.getItem("globalEthnicity");
4423   - $rootScope.isCloseSettingClicked = false;
4424   - }
4425   - else {
4426   - formsetting.ethnicity = skintone;
4427   - }
4428   - $rootScope.setEthncitySettings(formsetting.ethnicity);
4429   -
4430   -
4431   -
4432   - }
4433   -
4434   - $rootScope.ChangeModesty = function (formsetting, modestyValue) {
4435   - formsetting.modesty = modestyValue;
4436   - $rootScope.setModestySettings(formsetting.modesty);
4437   -
4438   - }
4439   - $rootScope.isApplyBtnClicked = false;
4440   - $rootScope.CloseSetting = function () {
4441   - $rootScope.isCloseSettingClicked = true;
4442   - $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity);
4443   - $rootScope.setModestySettings($rootScope.globalSetting.modesty);
4444   - if ($rootScope.isApplyBtnClicked == false) {
4445   -
4446   - $rootScope.deSelectLanguageOptions();
4447   - }
4448   - else {
4449   -
4450   - $rootScope.isApplyBtnClicked = false;
4451   - }
4452   - $('#modal-settings').css("display", "none");
4453   - $("#modelsettingsbackground").css("display", "none");
4454   - }
4455   -
4456   - $rootScope.UpdateAndCloseSetting = function (setting) {
4457   -
4458   - $rootScope.UpdateSetting(setting);
4459   - if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") {
4460   - $rootScope.loadSearchData();
4461   - }
4462   - $rootScope.isApplyBtnClicked = false;
4463   - //$timeout(function () {
4464   - $('#modal-settings').css("display", "none");
4465   - $("#modelsettingsbackground").css("display", "none");
4466   - // $("#setting-spinner").css("display", "none");
4467   - if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") {
4468   - $("#setting-spinner").css("display", "block");
4469   - }
4470   -
4471   - $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length;
4472   -
4473   - // }, 6000);
4474   - };
4475   -
4476   -
4477   -
4478   - $rootScope.deSelectLanguageOptions = function () {
4479   -
4480   - var languageDifference = ($rootScope.lexiconLanguageArrayLength) - ($rootScope.lexiconLanguageArray.length);
4481   - languageDifference = parseInt(languageDifference);
4482   - if (languageDifference > 0) {
4483   - for (var i = 0; i <= $rootScope.lexiconRemovedLanguage.length - 1; i++) {
4484   - $("#lexiconLangDropdown option").each(function () {
4485   - if ($rootScope.lexiconRemovedLanguage[i].language == $(this).val()) {
4486   - $(this).remove();
4487   - $('#secondLax').append('<option val="' + $rootScope.lexiconRemovedLanguage[i].id + '">' + $rootScope.lexiconRemovedLanguage[i].language + '</option>');
4488   - $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language });
4489   - }
4490   - });
4491   -
4492   - if ($rootScope.lexiconRemovedLanguage[i].language == $("#primarylaxican").val()) {
4493   -
4494   - $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
4495   - $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
4496   - $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
4497   - $('#primarylaxican').attr("name", $rootScope.primaryLangID);
4498   - $('#secondLax').append('<option val="' + $rootScope.lexiconRemovedLanguage[i].id + '">' + $rootScope.lexiconRemovedLanguage[i].language + '</option>');
4499   - $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language });
4500   - $("#lexiconLangDropdown option").each(function () {
4501   - if($rootScope.lexiconPrimaryLanguage == $(this).val()){
4502   - $(this).remove();
4503   - }
4504   - });
4505   - }
4506   -
4507   - //$("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
4508   - //$('#primarylaxican').attr("name", $rootScope.primaryLangID);
4509   -
4510   - }
4511   - }
4512   - else if (languageDifference < 0) {
4513   - languageDifference = Math.abs(languageDifference);
4514   - for (var i = 1; i <= languageDifference; i++) {
4515   - var lexiconArrayLength = $rootScope.lexiconLanguageArray.length;
4516   -
4517   - $("#secondLax option").each(function () {
4518   - if ($rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language == $(this).val()) {
4519   - $(this).remove();
4520   - }
4521   -
4522   - })
4523   - $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>');
4524   - $rootScope.lexiconLanguageArray.pop();
4525   - }
4526   - if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {
4527   - }
4528   - else
4529   - {
4530   - $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
4531   - $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
4532   - $("#lexiconLangDropdown option").each(function () {
4533   - if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {
4534   - $(this).remove();
4535   - }
4536   - })
4537   - $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');
4538   - $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
4539   - $('#primarylaxican').attr("name", $rootScope.primaryLangID);
4540   - }
4541   - }
4542   -
4543   - else if (languageDifference == 0) {
4544   - if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {
4545   - // alert("same name");
4546   - }
4547   - else {
4548   - $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
4549   - $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
4550   - $("#lexiconLangDropdown option").each(function () {
4551   - if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {
4552   - $(this).remove();
4553   - }
4554   - })
4555   - $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');
4556   - $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
4557   - $('#primarylaxican').attr("name", $rootScope.primaryLangID);
4558   - }
4559   - }
4560   - }
4561   -
4562   -
4563   - $rootScope.UpdateSetting = function (setting) {
4564   -
4565   - $rootScope.isApplyBtnClicked = true;
4566   - var isReloadingViewRequired = false;
4567   - //1.
4568   - if (typeof (setting.ethnicity) !== "undefined" && setting.ethnicity !== null) {
4569   - $rootScope.ChangeEthnicity(setting, setting.ethnicity);
4570   - }
4571   - if (typeof (setting.modesty) !== "undefined" && setting.modesty !== null) {
4572   - $rootScope.ChangeModesty(setting, setting.modesty);
4573   - }
4574   -
4575   - //2.
4576   - if ((setting.ethnicity != null && setting.ethnicity != $rootScope.globalSetting.ethnicity) && (setting.modesty != null && setting.modesty != $rootScope.globalSetting.modesty)) {
4577   - $rootScope.globalSetting.ethnicity = setting.ethnicity;
4578   - localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity);
4579   -
4580   - $rootScope.globalSetting.modesty = setting.modesty;
4581   - localStorage.setItem("globalModesty", setting.modesty);
4582   -
4583   - isReloadingViewRequired = true;
4584   -
4585   - }
4586   -
4587   - else if (setting.ethnicity != null && setting.ethnicity != $rootScope.globalSetting.ethnicity) {
4588   -
4589   - $rootScope.globalSetting.ethnicity = setting.ethnicity;
4590   - localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity);
4591   -
4592   - $rootScope.globalSetting.modesty = $rootScope.getLocalStorageValue("globalModesty");
4593   -
4594   - isReloadingViewRequired = true;
4595   - }
4596   - else if (setting.modesty != null && setting.modesty != $rootScope.globalSetting.modesty) {
4597   - $rootScope.globalSetting.modesty = setting.modesty;
4598   - localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty);
4599   -
4600   - $rootScope.globalSetting.ethnicity = $rootScope.getLocalStorageValue("globalEthnicity");
4601   -
4602   - if ($('.modestyImg') != null) {
4603   - if (($rootScope.globalSetting.modesty == 'Y')) {
4604   - $('.modestyImg').css('visibility', 'visible');
4605   - }
4606   -
4607   - else {
4608   - $('.modestyImg').css('visibility', 'hidden');
4609   - }
4610   - }
4611   -
4612   - if ($('.transModestyImg') != null) {
4613   - if (($rootScope.globalSetting.modesty == 'Y')) {
4614   - $('.transModestyImg').css('visibility', 'visible');
4615   - }
4616   -
4617   - else {
4618   - $('.transModestyImg').css('visibility', 'hidden');
4619   - }
4620   - }
4621   - $rootScope.changeNavigatorModesty();
4622   - }
4623   -
4624   - var len = $rootScope.openModules.length;
4625   - if (len > 0) {
4626   - if (isReloadingViewRequired == true) {
4627   - $rootScope.reloadChildController();
4628   - }
4629   - }
4630   - else {
4631   -
4632   - $('#modal-settings').css("display", "none");
4633   - $("#modelsettingsbackground").css("display", "none");
4634   - }
4635   - $rootScope.lexiconRemovedLanguage = [];
4636   - $("#secondLax option").each(function () {
4637   - $rootScope.lexiconRemovedLanguage.push({ "id": $(this).attr("val"), "language": $(this).val() });
4638   - });
4639   - };
4640   -
4641   -
4642   -
4643   -
4644   -
4645   -
4646   -
4647   -
4648   -
4649   -
4650   -
4651   -
4652   - $rootScope.reloadChildController = function () {
4653   -
4654   - var len = $rootScope.openModules.length;
4655   -
4656   - var currentOpenModuleId = $rootScope.openModules[len - 1].ModuleId;
4657   -
4658   - //checking is DA module is opend.
4659   - if (currentOpenModuleId == 1) {
4660   -
4661   - //Check that what current bodyview is open
4662   - if ($rootScope.openViews.length > 0) {
4663   - var openViewLen = $rootScope.openViews.length;
4664   - var currentOpenViewId = $rootScope.getLocalStorageValue("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId;
4665   - $rootScope.isSettingEventAlredayDispachted = true;
4666   - $rootScope.$broadcast('reloadDABodyViewEvent', { reloadDABodyViewId: currentOpenViewId }, true);
4667   - }
4668   - else {
4669   - $rootScope.$broadcast('reloadDAControllerEvent', true);
4670   -
4671   - }
4672   - }
4673   - };
4674   -
4675   -
4676   - $rootScope.changeNavigatorModesty = function () {
4677   - var currentOpenViewId = $rootScope.getLocalStorageValue("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId;
4678   -
4679   - $rootScope.$broadcast('changeNavigatorModestyEvent', { bodyViewId: currentOpenViewId }, true);
4680   -
4681   - };
4682   -
4683   - $rootScope.ShowExportImageWindow = function () {
4684   - $(".export-image").modal("show").draggable({ handle: ".modal-header" });
4685   -
4686   - $(".modal-backdrop").css("opacity", ".5");
4687   - $(".modal-backdrop").css("z-index", "1200001");
4688   - };
4689   -
4690   -
4691   -
4692   - $rootScope.ShowPrintWindow = function () { // Print Active Viewer
4693   - html2canvas($("#canvasDiv"), {
4694   - onrendered: function (canvas) {
4695   - var dataURL = canvas.toDataURL("image/jpeg");
4696   - var imageToPrint = new Image();
4697   - imageToPrint.src = dataURL;
4698   - $('#snipImage').attr('src', dataURL);
4699   -
4700   - $('#spnModule').text($rootScope.currentActiveModuleTitle);
4701   - $('#spnBodyViewTitle').text($rootScope.getLocalStorageValue('currentViewTitle'));
4702   -
4703   - PrintDivContentByID('printBox'); // Open Print Window
4704   - }
4705   - });
4706   - };
4707   -
4708   - $rootScope.ShowPrintPreviewWindow = function (event) { // Print Preview
4709   - if ($location.url() == "/module-item-view") {
4710   - if ($("#hidePinBtn").hasClass("btn-primary")) {
4711   - $rootScope.isHidePinBtnActiveInPrintPreview = true;
4712   - }
4713   - if ($("#selectedPin").hasClass("btn-primary")) {
4714   - $rootScope.isShowSelectedPinActiveInPrintPrevMode = true;
4715   - }
4716   - if ($("#allPinBtn").hasClass("btn-primary")) {
4717   - $rootScope.isShowAllPinBtnActiveInPrintPreviewMode = true;
4718   - }
4719   - }
4720   - $(".tools").css("z-index", "1029");
4721   - $rootScope.CloseListManager();
4722   - $rootScope.CloseAnnotationTool();
4723   - $("#annotationButton").parent().addClass("disableMenuannotation");
4724   - $("#annotationToolBarOptions").addClass("disableMenuoption");
4725   - $("#optionsListManagerTab").addClass("disableMenuoption");
4726   - $('#dvPrintPreview').css('display', 'block');
4727   - html2canvas($("#canvasDiv"), {
4728   - onrendered: function (canvas) {
4729   - var dataURL = canvas.toDataURL("image/jpeg");
4730   - var imageToPrint = new Image();
4731   - imageToPrint.src = dataURL;
4732   -
4733   - OpenJSPanel(); // open jsPanel here
4734   - if ($('#jsPanel-1').length > 0) {
4735   - $('.jsPanel-btn-norm').attr('style', 'display: none');
4736   - }
4737   -
4738   - console.log('jsPanel loaded exist= ' + document.getElementById('jsPanel-1')); // document.getElementsByClassName('ppImagePanel'));
4739   -
4740   - var curModule = $rootScope.currentActiveModuleTitle;
4741   - var curPosture = $rootScope.getLocalStorageValue('currentViewTitle');
4742   -
4743   - if (document.getElementById('jsPanel-1')) { //document.getElementsByClassName('ppImagePanel')) {
4744   - if (dataURL == "" || dataURL == undefined) {
4745   -
4746   - setTimeout(function () {
4747   - document.getElementById('imgPortrait').setAttribute('src', dataURL);
4748   - document.getElementById('imgLandscape').setAttribute('src', dataURL);
4749   - document.getElementById('spnModulePor').innerHTML = curModule;
4750   - document.getElementById('spnBodyViewTitlePor').innerHTML = curPosture;
4751   - document.getElementById('spnModuleLan').innerHTML = curModule;
4752   - document.getElementById('spnBodyViewTitleLan').innerHTML = curPosture;
4753   - if ($('#printcontainer').length > 0) {
4754   - $("#printcontainer").css('width', $(window).outerWidth());
4755   - $("#printcontainer").css('height', $(window).outerHeight());
4756   - }
4757   - if ($location.url() == "/module-item-view") {
4758   - $("#aaDetailViewCanvas").css("display", "none");
4759   - $("#canvasPaint").css("display", "none");
4760   - $("#canvas").css("display", "none");
4761   -
4762   - }
4763   - }, 520);
4764   - }
4765   - else {
4766   - setTimeout(function () {
4767   - document.getElementById('imgPortrait').setAttribute('src', dataURL);
4768   - document.getElementById('imgLandscape').setAttribute('src', dataURL);
4769   - document.getElementById('spnModulePor').innerHTML = curModule;
4770   - document.getElementById('spnBodyViewTitlePor').innerHTML = curPosture;
4771   - document.getElementById('spnModuleLan').innerHTML = curModule;
4772   - document.getElementById('spnBodyViewTitleLan').innerHTML = curPosture;
4773   - if ($('#printcontainer').length > 0) {
4774   - $("#printcontainer").css('width', $(window).outerWidth());
4775   - $("#printcontainer").css('height', $(window).outerHeight());
4776   - }
4777   - if ($location.url() == "/module-item-view") {
4778   - $("#aaDetailViewCanvas").css("display", "none");
4779   - $("#canvasPaint").css("display", "none");
4780   - $("#canvas").css("display", "none");
4781   - }
4782   - }, 320);
4783   - }
4784   -
4785   - }
4786   -
4787   - $('#fileMenuAnchor').parent().addClass('disableFileMenu');
4788   - if ($('#daImagePanel').length > 0) {
4789   - console.log('close')
4790   - //$('#daImagePanel').css('display', 'none');
4791   - // $('#daImagePanel').remove();
4792   - }
4793   - }
4794   - });
4795   -
4796   - if ($location.url() == "/module-item-view") {
4797   - $timeout(function () {
4798   - $rootScope.hidePins();
4799   - }, 100);
4800   - }
4801   - $timeout(function () {
4802   - var $ua = navigator.userAgent;
4803   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
4804   - var printContainerWidth = $("#printcontainer").css("width");
4805   - $("#printcontainer").css({ "width": "100%", "min-width": printContainerWidth });
4806   - var jspanelContainerWidth = $("#jsPanel-1 .jsPanel-content").css("width");
4807   - $("#jsPanel-1 .jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });
4808   - $("#jsPanel-1").css("width", "100%");
4809   -
4810   - }
4811   - }, 500)
4812   - };
4813   -
4814   - function OpenJSPanel() {
4815   - $("#daImagePanel").css({ "pointer-events": "none", "opacity": ".5" });
4816   - $("#ciImagePanel").css({ "pointer-events": "none", "opacity": ".5" });
4817   - $("#ImagePanel").css({ "pointer-events": "none", "opacity": ".5" });
4818   - $.jsPanel({
4819   - id: 'jsPanel-1',
4820   - selector: '#dvPrintPreview',
4821   - theme: 'success',
4822   - currentController: 'HomeController',
4823   - //parentSlug: 'da-view-list', //After closing panel, control moves to here
4824   - ajax: {
4825   - url: 'app/views/home/printPreview.html'
4826   - },
4827   - title: $rootScope.getLocalStorageValue("currentViewTitle"),
4828   - position: {
4829   - top: 70,
4830   - left: 1,
4831   - },
4832   - controls: { buttons: 'closeonly' },
4833   - size: { width: $(window).outerWidth(), height: $(window).outerHeight() + 60 },
4834   - //size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 },
4835   - });
4836   - }
4837   - $rootScope.getLocalStorageValue = function (localStorageParam) {
4838   -
4839   -
4840   -
4841   - if ((localStorage.getItem('loggedInUserDetails') == null) && ($rootScope.isVisibleLogin == false)) {
4842   - if ($location.url().indexOf('?em') == -1 && $location.url().indexOf('?unb') == -1)
4843   - $rootScope.LogoutUser();
4844   -
4845   -
4846   - }
4847   - else {
4848   - return localStorage.getItem(localStorageParam);
4849   - }
4850   -
4851   -
4852   - }
4853   - // $(<parent>).on('<event>', '<child>', callback);
4854   - $(document).on('change', 'input[name=inlineRadioOptions]', function () {
4855   - if ($(this).attr("value") == "Portrait") {
4856   - $(".print-box").not(".portrait-box").hide();
4857   - $(".portrait-box").show();
4858   - }
4859   - if ($(this).attr("value") == "Landscape") {
4860   - $(".print-box").not(".landscape-box").hide();
4861   - $(".landscape-box").show();
4862   - }
4863   - });
4864   -
4865   - $(document).on('change', '#printPSOptions', function () {
4866   - var option = $('#printPSOptions').find(":selected").text();
4867   - switch (option) {
4868   - case ("10%"):
4869   - ResizeImage(0.1);
4870   - break;
4871   - case ("25%"):
4872   - ResizeImage(0.25);
4873   - break;
4874   - case ("50%"):
4875   - ResizeImage(0.5);
4876   - break;
4877   - case ("75%"):
4878   - ResizeImage(.75);
4879   - break;
4880   - case ("65%"):
4881   - ResizeImage(0.65);
4882   - break;
4883   - case ("100%"):
4884   - ResizeImage(1);
4885   - break;
4886   - case ("150%"):
4887   - ResizeImage(1.5);
4888   - break;
4889   - case ("200%"):
4890   - ResizeImage(2);
4891   - break;
4892   - case ("500%"):
4893   - ResizeImage(5);
4894   - break;
4895   - case ("Auto"):
4896   - ResizeImage(0);
4897   - break;
4898   - default:
4899   - ResizeImage(0);
4900   - }
4901   - });
4902   -
4903   - $(document).on('click', '#btnPrint', function () {
4904   - PrintDivContentByID('printBoxPor');
4905   - });
4906   -
4907   - function PrintDivContentByID(id) {
4908   -
4909   - if (id == 'printBoxPor') {
4910   - $("#printPSOptions").val("100%");
4911   - ResizeImage(1);
4912   - }
4913   - var contents = document.getElementById(id).innerHTML;
4914   - // code for printng in ipads
4915   - var $ua = navigator.userAgent;
4916   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
4917   - $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
4918   - html2canvas($("#canvasDiv"), {
4919   - onrendered: function (canvas) {
4920   - var imgsrc = canvas.toDataURL("image/png");
4921   - var printContent = '<div id="img1"><img src="' + imgsrc + '" id="newimg1" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>';
4922   - var newPrintWindow = window.open();
4923   - $(newPrintWindow.document.body).html(printContent);
4924   - newPrintWindow.print();
4925   - }
4926   - });
4927   - }
4928   - else {
4929   - var frame1 = $('<iframe />');
4930   - frame1[0].name = "frame1";
4931   - frame1.css({ "position": "absolute", "top": "-1000000px" });
4932   - $("body").append(frame1);
4933   - var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
4934   - frameDoc.document.open();
4935   - //Create a new HTML document.
4936   - frameDoc.document.write('<html><head><title></title>');//Print Preview
4937   - frameDoc.document.write('</head><body>');
4938   - //Append the external CSS file.
4939   - frameDoc.document.write('<link href="content/css/print-Portrait.css" rel="stylesheet" type="text/css" />');
4940   - frameDoc.document.write('<link href="content/css/print-main.css" rel="stylesheet" type="text/css" />');
4941   - //Append the DIV contents.
4942   - frameDoc.document.write(contents);
4943   - frameDoc.document.write('</body></html>');
4944   - frameDoc.document.close();
4945   - setTimeout(function () {
4946   - window.frames["frame1"].focus();
4947   - window.frames["frame1"].print();
4948   - frame1.remove();
4949   - }, 320);
4950   - }
4951   - console.log('close');
4952   - }
4953   -
4954   - $(document).on('click', '#jsPanel-1 .jsglyph-remove', function () {
4955   - $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" });
4956   - $("#ciImagePanel").css({ "pointer-events": "auto", "opacity": "1" });
4957   - $("#ImagePanel").css({ "pointer-events": "auto", "opacity": "1" });
4958   - $("#annotationButton").parent().removeClass("disableMenuannotation");
4959   - $("#annotationToolBarOptions").removeClass("disableMenuoption");
4960   - $("#optionsListManagerTab").removeClass("disableMenuoption");
4961   - $('#fileMenuAnchor').parent().removeClass('disableFileMenu');
4962   - if ($location.url() == "/module-item-view") {
4963   - $("#aaDetailViewCanvas").css("display", "block");
4964   - $("#canvasPaint").css("display", "block");
4965   - $("#canvas").css("display", "block");
4966   - }
4967   - if ($('#jsPanel-1').length > 0)
4968   - $('#jsPanel-1').remove();
4969   - console.log('close');
4970   -
4971   - });
4972   -
4973   - $rootScope.restrictBodySystemList = function () {
4974   - var RestrictListDiv = document.getElementById("restrictListDiv");
4975   - if (RestrictListDiv.style.display == 'block') {
4976   - RestrictListDiv.style.display = 'none';
4977   - $(".restrict-carret-icon").css({ "transform": "rotate(0deg)", "-moz-transform": "rotate(0deg)", "-webkit-transform": "rotate(0deg)", "-ms-transform": "rotate(0deg)" });
4978   - return;
4979   - }
4980   - RestrictListDiv.style.display = 'block';
4981   - $(".restrict-carret-icon").css({ "transform": "rotate(90deg)", "-moz-transform": "rotate(90deg)", "-webkit-transform": "rotate(90deg)", "-ms-transform": "rotate(90deg)" });
4982   -
4983   - }
4984   -
4985   - $rootScope.OpenAdminForm = function (userInfo) {
4986   - $('#adminModal').css({ top: '50px' });
4987   - if ($rootScope.userData) {
4988   - $('#adminfName').val($rootScope.userData.FirstName);
4989   - $('#adminlName').val($rootScope.userData.LastName);
4990   - $('#adminEmailId').val($rootScope.userData.EmailId);
4991   - }
4992   - };
4993   -
4994   - $rootScope.SendAdminAccessRequestMail = function (userInfo) {
4995   -
4996   - if ($rootScope.userData) {
4997   - userInfo.firstName = $rootScope.userData.FirstName;
4998   - userInfo.lastName = $rootScope.userData.LastName;
4999   - userInfo.emailId = $rootScope.userData.EmailId;
5000   - }
5001   -
5002   - AdminService.SendAdminAccessRequestMail(userInfo)
5003   - .then(function (result) {
5004   - if (result == AdminConstants.MAIL_SENT) {
5005   - $rootScope.errorMessage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE;
5006   - $("#messageModal").modal('show');
5007   - }
5008   - $("#adminModal").fadeOut();
5009   - $("#adminModal").modal('hide');
5010   - $('[name="adminAccessTextArea"]').val('');
5011   - },
5012   - function (error) {
5013   - console.log(' Error in sending mail to admin support = ' + error.statusText);
5014   - $rootScope.errorMessage = AdminConstants.ERROR_IN_SENDING_MAIL;
5015   - $("#messageModal").modal('show');
5016   - });
5017   - };
5018   -
5019   - $rootScope.CloseAAModal = function () {
5020   - $("#adminModal").fadeOut();
5021   - $("#adminModal").modal('hide');
5022   - $("adminAccessTextArea").text('');
5023   - }
5024   -
5025   -
5026   - $rootScope.addToolTip = function (toolTipTopPosition, toolTipLeftPosition, toolTipWidth, toolTipText) {
5027   -
5028   - $("#cursor-block").addClass("custom-tooltip-annotation-toolbar");
5029   - $(".custom-tooltip-annotation-toolbar").css({ "display": "block", "top": toolTipTopPosition + "px", "width": toolTipWidth + "px", "left": toolTipLeftPosition + "px" });
5030   - $("#cursor-block").html(toolTipText);
5031   - }
5032   -
5033   - $rootScope.removeToolTipOnMouseOut = function () {
5034   -
5035   - $(".custom-tooltip-annotation-toolbar").css('display', 'none');
5036   - $("#cursor-block").removeClass("custom-tooltip-annotation-toolbar");
5037   - $("#cursor-block").html();
5038   -
5039   - }
5040   - var $ue = navigator.userAgent;
5041   - if (($ue.match(/(iPod|iPhone|iPad|android)/i))) {
5042   -
5043   - $("#text_area").click(function () {
5044   - $("#annotationTextModal").draggable('disable');
5045   - }).blur(function () {
5046   - $("#annotationTextModal").draggable('enable');
5047   - });
5048   - }
5049   - $rootScope.CheckRefresh = function (e) {
5050   - //Checking if 'REFRESHED' or 'RELOADED'
5051   - if ((e.keyCode === 116) || (e.keyCode == 82 && e.ctrlKey))
5052   - $location.path('/'); //Redirecting to landing page
5053   - };
5054   -
5055   - $rootScope.resetDrawing = function (e) {
5056   -
5057   - $('#canvas').removeLayers();
5058   -
5059   - };
5060   -
5061   -}]
5062   -);
5063   -
5064   -
  1 +'use strict';
  2 +
  3 +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", "AIAConstants",
  4 +function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants,AIAConstants) {
  5 +
  6 + //$scope.pageToOpen = {
  7 + // name: 'MainMenu'
  8 + //};
  9 + $rootScope.pageToOpen = 'app/widget/MainMenu.html';
  10 + $rootScope.currentBodyViewId;
  11 + $rootScope.currentActiveModuleTitle = 'Welcome to A.D.A.M. Interactive Anatomy';//Modules[0].Name;
  12 + $rootScope.currentActiveViewTitle;
  13 + $rootScope.cuurentActiveModuleId;
  14 + $rootScope.openModules = [];
  15 + $rootScope.openViews = [];
  16 + $rootScope.currentSlug;
  17 + $rootScope.jsPanelTitle;
  18 + $rootScope.ViewTitle;
  19 + $rootScope.isLoading = false;
  20 + $rootScope.isAnnotationWindowOpen = false;
  21 + $rootScope.isDrawingToolSelected = false;
  22 + $rootScope.isIdetifyClicked = true;
  23 + $rootScope.paint = false;
  24 + $rootScope.clickX = new Array();
  25 + $rootScope.clickY = new Array();
  26 + $rootScope.clickDrag = new Array();
  27 + $rootScope.isLineDrawSelecyed = false;
  28 + $rootScope.isAnnotationWindowClose = false;
  29 + $rootScope.setListManagerZindex = false;
  30 + $rootScope.lastX;
  31 + $rootScope.lastY;
  32 + $rootScope.CommonData;
  33 + $rootScope.shapeType;
  34 + $rootScope.globalSetting = {
  35 + ethnicity: 'W',
  36 + modesty: 'Y',
  37 + };
  38 + $rootScope.formsetting = {
  39 + ethnicity: null,
  40 + modesty: null
  41 + };
  42 +
  43 + // on refersh this variable will also get null that is why we are only checking this variable on initialize that if it is null that means page gets refershed.
  44 + $rootScope.refreshcheck = null;
  45 + $rootScope.isCloseSettingClicked = false;
  46 +
  47 +
  48 + $rootScope.isModestyOn;
  49 + $rootScope.isModestyOff;
  50 + $rootScope.SetSettingActiveTab;
  51 + $rootScope.disableMenuannotation = "disableMenuannotation";
  52 + $rootScope.disableMenuoption = "disableMenuoption";
  53 + $rootScope.menuLabExer;
  54 + $rootScope.menuLabExer = 0;
  55 +
  56 +
  57 + $rootScope.fontSizes;
  58 + $rootScope.fontWeight;
  59 + $rootScope.fontStyle;
  60 + $rootScope.textAlignmt;
  61 + $rootScope.fontColor;
  62 + $rootScope.underlineText;
  63 + $rootScope.textArea;
  64 + $rootScope.fontFamily;
  65 + $rootScope.TextPropertyArray = [];
  66 + $rootScope.modifySavedText = [];
  67 + $rootScope.TextRectangleArr = [];
  68 + $rootScope.rectDimension = [];
  69 + $rootScope.isMousedownOnPaintCanvas = false;
  70 + //opacity code
  71 + $rootScope.shapestyleOpacity = 1;
  72 + $rootScope.shapestyleFillColor = "#fff";
  73 + $rootScope.shapestyleFillBorderColor = "black";
  74 + $rootScope.shapestyleborderWidth = 2;
  75 + $rootScope.shapestyleborderStyles = "solid";
  76 + //$rootScope.errorMessage = ''; // Commented initialization to retain message when coming to login after password reset success screen
  77 + $rootScope.disableFileMenu = "disableFileMenu";
  78 +
  79 + $rootScope.userInfo = {
  80 + username: null,
  81 + password: null,
  82 + emailId: null,
  83 + newPassword: null,
  84 + confirmPassword: null,
  85 + userMessage: null,
  86 + unblockUser: false,
  87 + isMailForForgotPassword:false
  88 + };
  89 + $rootScope.userLicenseInfo = {
  90 + userLicenseId: 0,
  91 + licenseeAccountNumber: null
  92 + };
  93 + $rootScope.userData;
  94 + $rootScope.userModules;
  95 + $rootScope.passwordMismatchMessage;
  96 + $rootScope.isVisibleLogin;
  97 + $rootScope.haveRoleAdmin;
  98 + $rootScope.checked = false;
  99 + var isfilloptionChecked = "";
  100 + var isOutlineOptionChecked = "";
  101 + $rootScope.forgotPwdModalShow = function () {
  102 + document.getElementById("forgetPwdForm").reset()
  103 + $("#forgotPwdModal").modal("show");
  104 + $(".modal-backdrop").css("opacity", ".5");
  105 + $("body.modal-open").css("padding-right", "0px");
  106 + }
  107 + $rootScope.forgotUserModalShow = function () {
  108 + document.getElementById("forgetUSerIdForm").reset();
  109 + $("#forgotUserModal").modal("show");
  110 + $(".modal-backdrop").css("opacity", ".5");
  111 + $("body.modal-open").css("padding-right", "0px");
  112 +
  113 + }
  114 +
  115 + $rootScope.promptUserForCookies= function()
  116 + {
  117 + $rootScope.errorMessage = AIAConstants.COOKIES_MESSAGE;
  118 + $("#messageModal").modal('show');
  119 +
  120 + }
  121 +
  122 +
  123 + $rootScope.initializeAIA = function () {
  124 +
  125 + if (navigator.cookieEnabled) {
  126 +
  127 + $rootScope.isLoading = false;
  128 +
  129 + var url = $location.url();
  130 +
  131 + //unblock user
  132 + if (url.indexOf('?unb:') != -1) {
  133 +
  134 + $rootScope.isVisibleLogin = true;
  135 + $rootScope.UnblockUser();
  136 + }
  137 + else if (url.indexOf('?em:') != -1) {
  138 +
  139 + $rootScope.isVisibleLogin = false;
  140 + $rootScope.isVisibleResetPass = true;
  141 + }
  142 + else {
  143 + $rootScope.isVisibleLogin = true;
  144 + $rootScope.isVisibleResetPass = false;
  145 + getUserDetails();
  146 + }
  147 + }
  148 +
  149 + else {
  150 +
  151 + $rootScope.isVisibleLogin = true;
  152 +
  153 + $rootScope.promptUserForCookies();
  154 + }
  155 +
  156 +
  157 + }
  158 +
  159 + $rootScope.AuthenticateUser = function (userInfo)
  160 + {
  161 + if (navigator.cookieEnabled) {
  162 +
  163 + $rootScope.errorMessage = "";
  164 + if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) {
  165 +
  166 + // alert(LoginMessageConstants.USER_CREDENTIALS_MISSING);
  167 + $rootScope.errorMessage = LoginMessageConstants.USER_CREDENTIALS_MISSING;
  168 + $("#messageModal").modal('show');
  169 + }
  170 + else {
  171 +
  172 + AuthenticationService.authenticateUser(userInfo)
  173 + .then(
  174 +
  175 + function (result) {
  176 + if (result == LoginConstants.USER_NOT_FOUND) {
  177 + $rootScope.isVisibleLogin = true;
  178 + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
  179 + $rootScope.errorMessage = LoginMessageConstants.INVALID_USER;
  180 + $("#messageModal").modal('show');
  181 + }
  182 + else {
  183 + if (typeof result.LoginId != undefined || result.LoginId != "" || result.LoginId != null) {
  184 +
  185 + if ($("#messageModal").length > 0) {
  186 + $("#messageModal").modal('hide');
  187 + }
  188 + if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_PASSWORD_NOT_MATCH) {
  189 + $rootScope.isVisibleLogin = true;
  190 + $rootScope.errorMessage = LoginMessageConstants.INVALID_PASSWORD;
  191 + $("#messageModal").modal('show');
  192 + }
  193 + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_ID_BLOCKED_24_HRS) {
  194 + $rootScope.isVisibleLogin = true;
  195 + $rootScope.errorMessage = LoginMessageConstants.USER_BLOCKED;
  196 + $("#messageModal").modal('show');
  197 + }
  198 + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) {
  199 + $rootScope.isVisibleLogin = true;
  200 + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
  201 + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
  202 + $("#messageModal").modal('show');
  203 + }
  204 + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) {
  205 + $rootScope.isVisibleLogin = true;
  206 + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
  207 + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
  208 + $("#messageModal").modal('show');
  209 + }
  210 + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && result.IsSubscriptionExpired) {
  211 + $rootScope.isVisibleLogin = true;
  212 + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
  213 + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
  214 + $("#messageModal").modal('show');
  215 + }
  216 + else if ((result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) && (result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) {
  217 + $rootScope.isVisibleLogin = true;
  218 + $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE + ' ' + LoginMessageConstants.USER_INACTIVE_MESSAGE;
  219 + $("#messageModal").modal('show');
  220 + }
  221 + else if (result.LoginFailureCauseId != undefined && result.LoginFailureCauseId.toString() == LoginConstants.E_USER_NOT_ACTIVE) {
  222 + $rootScope.isVisibleLogin = true;
  223 + $rootScope.errorMessage = LoginMessageConstants.USER_INACTIVE_MESSAGE;
  224 + $("#messageModal").modal('show');
  225 + }
  226 + else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) {
  227 + $rootScope.isVisibleLogin = true;
  228 + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
  229 + $rootScope.errorMessage = $rootScope.errorMessage + ' ' + LoginMessageConstants.LICENSE_INACTIVE_MESSAGE;
  230 + $("#messageModal").modal('show');
  231 + }
  232 + else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (result.LicenseInfo.IsActive) && (result.IsSubscriptionExpired)) {
  233 + $rootScope.isVisibleLogin = true;
  234 + $rootScope.errorMessage = LoginMessageConstants.SUBSCRIPTION_EXPIRATION_MESSAGE + result.SubscriptionExpirationDate + '.';
  235 + $("#messageModal").modal('show');
  236 + }
  237 + else if ((result.LicenseInfo != null) && (result.LicenseInfo != undefined) && (!result.LicenseInfo.IsActive) && (!result.IsSubscriptionExpired)) {
  238 + $rootScope.isVisibleLogin = true;
  239 + $rootScope.errorMessage = LoginMessageConstants.LICENSE_INACTIVE_MESSAGE;
  240 + $("#messageModal").modal('show');
  241 + }
  242 + else {
  243 +
  244 + //if (result.UserType == UserTypeConstants.SUPER_ADMIN && result.IsActive) { //(!result.IsSubscriptionExpired) &&
  245 + if (result.LicenseId == 0 && result.IsActive) {
  246 + $rootScope.userData = result;
  247 + $rootScope.userModules = result.Modules;
  248 + $rootScope.isVisibleLogin = false;
  249 + $rootScope.haveRoleAdmin = true;
  250 + localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
  251 + ShowAssignedModulesPopup(result.Modules);
  252 + $location.path('/');
  253 +
  254 + }
  255 + else {
  256 + if (result.LicenseInfo != null && result.LicenseInfo.IsTermAccepted) {
  257 + $rootScope.userData = result;
  258 + $rootScope.userModules = result.Modules;
  259 + $rootScope.isVisibleLogin = false;
  260 + $rootScope.haveRoleAdmin = false;
  261 + localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
  262 + ShowAssignedModulesPopup(result.Modules);
  263 + $location.path('/');
  264 +
  265 + }
  266 + else {
  267 + if ($('#dvTerms').length > 0) {
  268 + $('#dvTerms').html(result.TermsAndConditionsText);
  269 + }
  270 + $rootScope.isVisibleLogin = true;
  271 + $('#dvTermCondition').fadeIn();
  272 + $rootScope.userData = result;
  273 + $rootScope.haveRoleAdmin = false;
  274 + localStorage.setItem('loggedInUserDetails', JSON.stringify(result));
  275 + $location.path('/');
  276 + }
  277 + }
  278 +
  279 + }
  280 +
  281 + }
  282 + }
  283 + }),
  284 +
  285 + function (error) {
  286 + console.log(' Error in authentication = ' + error.statusText);
  287 + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
  288 + $rootScope.isVisibleLogin = true;
  289 + $rootScope.errorMessage = error;
  290 + $("#messageModal").modal('show');
  291 + }
  292 + }
  293 + }
  294 +
  295 + else
  296 + {
  297 + $rootScope.promptUserForCookies();
  298 + }
  299 +
  300 + }
  301 +
  302 + function ShowAssignedModulesPopup(userModules) {
  303 + var allModules = Modules;
  304 + var arrPendingModules = [];
  305 + if ($('#dvPendingModules').length > 0) {
  306 + $('#dvPending').hide();
  307 + }
  308 + for (var module = 1; module <= allModules.length; module++) {
  309 + $('#moduleDiv' + module).hide();
  310 + }
  311 + if (('#moduleDiv1017').length > 0) {
  312 + $('#moduleDiv1017').hide();
  313 + }
  314 +
  315 + for (var count = 0; count < userModules.length; count++) {
  316 + for (var module = 0; module < allModules.length; module++) {
  317 + if (userModules[count].id == allModules[module].Id) {
  318 + $('#moduleDiv' + userModules[count].id).show();
  319 + break;
  320 + }
  321 +
  322 + if (userModules[count].id == 7)
  323 + arrPendingModules.push(userModules[count].id);
  324 + if (userModules[count].id == 8)
  325 + arrPendingModules.push(userModules[count].id);
  326 + if (userModules[count].id == 10)
  327 + arrPendingModules.push(userModules[count].id);
  328 + }
  329 + }
  330 + if (userModules.length > 0) {
  331 + $('#dvUserModulesInfo').modal('show');
  332 + }
  333 +
  334 + if (arrPendingModules.length > 0) {
  335 + $('#dvPendingModules').show();
  336 + }
  337 + }
  338 + $rootScope.UpdateLicenseTermStatus = function () {
  339 + $('#dvTermCondition').fadeOut();
  340 + var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails');
  341 + if (currentUserDetails) {
  342 + var userInfo = JSON.parse(currentUserDetails);
  343 + }
  344 + if (userInfo.LicenseInfo.AccountNumber != null && userInfo.LicenseInfo.Id != 0) {
  345 + $rootScope.userLicenseInfo.userLicenseId = userInfo.LicenseInfo.Id;
  346 + $rootScope.userLicenseInfo.licenseeAccountNumber = userInfo.LicenseInfo.AccountNumber;
  347 +
  348 + AuthenticationService.UpdateLicenseTerm($rootScope.userLicenseInfo)
  349 + .then(function (result) {
  350 + if (result.Modules !=="" && result.Modules !== null) { // LoginMessageConstants.LICENSE_TERM_CONDITION_UPDATE_SUCCESS) {
  351 + console.log(' Term and Condition acceptance status updated successfully.');
  352 + if (currentUserDetails) {
  353 + var userInfo = JSON.parse(currentUserDetails);
  354 + userInfo.Modules = result.Modules;
  355 +
  356 + if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) {
  357 + $rootScope.isVisibleLogin = false;
  358 + $rootScope.userData = userInfo;
  359 + $rootScope.userModules = userInfo.Modules;
  360 + ShowAssignedModulesPopup(userInfo.Modules);;
  361 + }
  362 + }
  363 + }
  364 + else if (result = LoginConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED) {
  365 + console.log(result);
  366 + $rootScope.isVisibleLogin = true;
  367 + $('#dvTermCondition').fadeIn();
  368 + $rootScope.errorMessage = LoginConstants.LICENSE_TERM_CONDITION_UPDATE_FAILED;
  369 + $("#messageModal").modal('show');
  370 + $("#messageModal").css("z-index", 111112);
  371 + localStorage.removeItem("loggedInUserDetails");
  372 + }
  373 +
  374 + },
  375 + function (error) {
  376 + console.log(' Error in Term and Condition acceptance status update = ' + error);//.statusText
  377 + $rootScope.isVisibleLogin = true;
  378 + $rootScope.isVisibleLogin = true;
  379 + $rootScope.errorMessage = error;
  380 + $("#messageModal").modal('show');
  381 + $('#dvTermCondition').fadeIn();
  382 + });
  383 + }
  384 + };
  385 +
  386 +
  387 + $rootScope.LogoutUser = function () {
  388 + localStorage.removeItem('loggedInUserDetails');
  389 + localStorage.clear();
  390 + document.location = '/';
  391 + $rootScope.isVisibleLogin = true;
  392 + }
  393 +
  394 + function getUserDetails() { //Retain logged in user details
  395 + var currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails');
  396 + if (currentUserDetails) {
  397 + try {
  398 + var userInfo = JSON.parse(currentUserDetails);
  399 +
  400 + if (userInfo.LoginId != undefined || userInfo.LoginId != "" || userInfo.LoginId != null) {
  401 +
  402 + if (userInfo.UserType == UserTypeConstants.SUPER_ADMIN && userInfo.IsActive) { //(!result.IsSubscriptionExpired) &&
  403 +
  404 + $rootScope.userData = userInfo;
  405 +
  406 + $rootScope.userModules = userInfo.Modules;
  407 +
  408 + $rootScope.isVisibleLogin = false;
  409 + $rootScope.haveRoleAdmin = true;
  410 +
  411 + if ($rootScope.refreshcheck == null) {
  412 +
  413 + $location.path('/');
  414 +
  415 + }
  416 + }
  417 +
  418 + else
  419 + {
  420 + $rootScope.haveRoleAdmin = false;
  421 +
  422 + if (userInfo.LicenseInfo.IsTermAccepted) {
  423 + $rootScope.userData = userInfo;
  424 + $rootScope.userModules = userInfo.Modules;
  425 + $rootScope.isVisibleLogin = false;
  426 + //$rootScope.haveRoleAdmin = true;
  427 +
  428 + if ($rootScope.refreshcheck == null) {
  429 + $location.path('/');
  430 + }
  431 +
  432 + }
  433 + else {
  434 + if ($('#dvTerms').length > 0) {
  435 + $('#dvTerms').html(userInfo.TermsAndConditionsText);
  436 + }
  437 + $rootScope.isVisibleLogin = true;
  438 + $('#dvTermCondition').fadeIn();
  439 + $rootScope.userData = userInfo;
  440 + $rootScope.userModules = userInfo.Modules;
  441 + //$rootScope.haveRoleAdmin = true;
  442 + $location.path('/');
  443 + }
  444 + }
  445 + }
  446 + }
  447 + catch (e) {
  448 + localStorage.removeItem('loggedInUserDetails');
  449 + }
  450 + }
  451 + }
  452 +
  453 + $rootScope.SendMailToUser = function (userInfo, isMailForForgotPassword) {
  454 + //
  455 +
  456 + if ((userInfo.emailId != null) && (userInfo.emailId != '')) {
  457 + if (validateEmail(userInfo.emailId)) {
  458 + if (isMailForForgotPassword) {
  459 +
  460 + var selectedOption = $("input[name='inlineRadioOptions']:checked").val();
  461 +
  462 + if (selectedOption == LoginMessageConstants.UNBLOCK_SELECTED) {
  463 + userInfo.unblockUser = true;
  464 + userInfo.isMailForForgotPassword = true;
  465 + }
  466 + else if (selectedOption == LoginMessageConstants.FORGOT_PASSWORD_SELECTED) {
  467 + userInfo.unblockUser = false;
  468 + userInfo.isMailForForgotPassword = true;
  469 + }
  470 + }
  471 + else
  472 + userInfo.isMailForForgotPassword = false;
  473 +
  474 + AuthenticationService.SendMailToUser(userInfo)
  475 + .then(function (result) {
  476 + if (result == LoginConstants.USER_NOT_FOUND) {
  477 + removeEmailPopUp();
  478 + // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
  479 + $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
  480 + $("#messageModal").modal('show');
  481 + }
  482 + else if (result == LoginConstants.MAIL_NOT_SENT) {
  483 + removeEmailPopUp();
  484 + // alert(LoginMessageConstants.MAIL_NOT_SENT);
  485 + $rootScope.errorMessage = LoginMessageConstants.MAIL_NOT_SENT;
  486 + $("#messageModal").modal('show');
  487 + }
  488 + else {
  489 + if (result == LoginMessageConstants.MAIL_SENT) {
  490 + var message;
  491 + removeEmailPopUp();
  492 +
  493 + if (isMailForForgotPassword) {
  494 + if (userInfo.unblockUser)
  495 + message = LoginMessageConstants.USER_UNBLOCK_LINK_IN_EMAIL;
  496 + else
  497 + message = LoginMessageConstants.RESET_PASSWORD;
  498 + }
  499 + else
  500 + message = LoginMessageConstants.USERID_SENT_IN_EMAIL
  501 + //alert(message);
  502 + $rootScope.errorMessage = message;
  503 + $("#messageModal").modal('show');
  504 +
  505 +
  506 + }
  507 + }
  508 +
  509 + },
  510 + function (error) {
  511 + console.log(' Error in authentication = ' + error.statusText);
  512 + removeEmailPopUp();
  513 + // alert(LoginConstants.ERROR_IN_FECTHING_DETAILS);
  514 + $rootScope.errorMessage = error;
  515 + $("#messageModal").modal('show');
  516 + });
  517 + }
  518 + else {
  519 + // alert(LoginMessageConstants.INCORRECT_EMAIL_ID);
  520 + removeEmailPopUp();
  521 + $rootScope.errorMessage = LoginMessageConstants.INCORRECT_EMAIL_ID;
  522 + $("#messageModal").modal('show');
  523 + }
  524 + }
  525 + else {
  526 + //alert(LoginMessageConstants.BLANK_EMAIL_ID);
  527 + removeEmailPopUp();
  528 + $rootScope.errorMessage = LoginMessageConstants.BLANK_EMAIL_ID;
  529 + $("#messageModal").modal('show');
  530 +
  531 + }
  532 + };
  533 +
  534 + function removeEmailPopUp()
  535 + {
  536 + if ($('#forgotUserModal').length > 0) {
  537 + $('#forgotUserModal').fadeOut();
  538 + $('#forgotUserModal').modal('hide');
  539 + }
  540 + if ($('#forgotPwdModal').length > 0) {
  541 + $('#forgotPwdModal').fadeOut();
  542 + $('#forgotPwdModal').modal('hide');
  543 + }
  544 + }
  545 +
  546 +
  547 + function validateEmail(email) {
  548 + var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
  549 + return re.test(email);
  550 + }
  551 +
  552 + $rootScope.ResetUserPassword = function (userInfo) {
  553 +
  554 + var url = $location.url();
  555 + if (url.indexOf('?em:') != -1) {
  556 + var split = url.split('?em:');
  557 + userInfo.emailId = split[1];
  558 + }
  559 +
  560 + if (userInfo.newPassword != null) {
  561 +
  562 + if (userInfo.newPassword === userInfo.confirmPassword) {
  563 + $rootScope.passwordMismatchMessage = null;
  564 +
  565 + AuthenticationService.ResetUserPassword(userInfo)
  566 + .then(
  567 + function (result) {
  568 + if (result == LoginConstants.USER_NOT_FOUND) {
  569 + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT);
  570 + $rootScope.errorMessage = LoginMessageConstants.USER_NOT_FOUND;
  571 + $("#messageModal").modal('show');
  572 +
  573 + }
  574 + else if (result == LoginConstants.EXCEPTION_OCCURED) {
  575 + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
  576 + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS;
  577 + $("#messageModal").modal('show');
  578 +
  579 + }
  580 + else if (result == LoginConstants.SQL_CONNECTION_ERROR) {
  581 + $rootScope.errorMessage = LoginConstants.SQL_CONNECTION_ERROR_MESSAGE;
  582 + $("#messageModal").modal('show');
  583 + }
  584 + else {
  585 + //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) {
  586 + if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) {
  587 + // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE);
  588 + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE;
  589 + $("#messageModal").modal('show');
  590 + $rootScope.isVisibleLogin = true;
  591 + $rootScope.isVisibleResetPass = false;
  592 + $location.url("/");
  593 + }
  594 + else {
  595 + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_FAILURE;
  596 + $("#messageModal").modal('show');
  597 + $rootScope.isVisibleLogin = true;
  598 + $rootScope.isVisibleResetPass = false;
  599 + $location.url("/");
  600 + }
  601 + }
  602 + },
  603 + function (error) {
  604 + console.log(' Error in authentication = ' + error.statusText);
  605 + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS);
  606 + $rootScope.errorMessage = error;
  607 + $("#messageModal").modal('show');
  608 +
  609 + });
  610 + }
  611 + else {
  612 + $rootScope.errorMessage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH;
  613 + $("#messageModal").modal('show');
  614 + }
  615 + }
  616 + else {
  617 + $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY;
  618 + $("#messageModal").modal('show');
  619 + }
  620 +
  621 + }
  622 +
  623 + $rootScope.UnblockUser = function () {
  624 +
  625 + var userEmailId = '';
  626 + var url = $location.url();
  627 +
  628 + var split = url.split('?unb:');
  629 + userEmailId = split[1];
  630 +
  631 +
  632 + AuthenticationService.UnblockUser(userEmailId)
  633 + .then(
  634 + function (result) {
  635 + if (result == LoginMessageConstants.USER_UNBLOCK_SUCCESS) {
  636 + $rootScope.errorMessage = LoginMessageConstants.USER_UNBLOCK_SUCCESS_MESSAGE;
  637 + $("#messageModal").modal('show');
  638 + $rootScope.isVisibleLogin = true;
  639 + $location.url("/");
  640 + }
  641 + else {
  642 + $rootScope.errorMessage = LoginMessageConstants.UNABLE_TO_UNBLOCK;
  643 + $("#messageModal").modal('show');
  644 + $rootScope.isVisibleLogin = true;
  645 + $location.url("/");
  646 + }
  647 + },
  648 + function (error) {
  649 + console.log(' Error in UnblockUser = ' + error.statusText);
  650 + $rootScope.errorMessage = error;
  651 + $("#messageModal").modal('show');
  652 + }
  653 + );
  654 + }
  655 +
  656 + $rootScope.lexiconLanguageArray = [];
  657 + $rootScope.lexiconLanguageArray.push({ id: "1", language: "English" });
  658 + $(document).ready(function () {
  659 +
  660 + $rootScope.isLexiconTabClicked = true;
  661 + $rootScope.lexiconData = function () {
  662 + if ($rootScope.isLexiconTabClicked == true) {
  663 + $rootScope.isLexiconTabClicked = false;
  664 + $.ajax({
  665 + url: '~/../content/data/json/da/uc_dat_default.json',
  666 + dataType: "json",
  667 + success: function (result) {
  668 + $(result.root.uc.al.lx).each(function (key, value) {
  669 +
  670 + $('#lexiconLangDropdown').append('<option val="' + this._id + '">' + this._tl + '</option>');
  671 +
  672 + });
  673 +
  674 + }
  675 +
  676 + });
  677 + }
  678 + $('#lexiconLangDropdown').change(function () {
  679 + $rootScope.isLexiconLanguageClicked = true;
  680 + $('#laxiconLangAdd').removeAttr('disabled');
  681 + $('#laxicanlanguageChagne').removeAttr('disabled');
  682 + $rootScope.selectedId = $("#lexiconLangDropdown option:selected").attr('val');
  683 + $rootScope.selectedText = $("#lexiconLangDropdown option:selected").text();
  684 + });
  685 +
  686 + $('#laxiconLangAdd').click(function () {
  687 + if ($rootScope.isLexiconLanguageClicked == true) {
  688 + $rootScope.isLexiconLanguageClicked = false;
  689 + $("#lexiconLangDropdown :selected").remove();
  690 + $('#secondLax').append('<option val="' + $rootScope.selectedId + '">' + $rootScope.selectedText + '</option>');
  691 + $rootScope.lexiconLanguageArray.push({ id: $rootScope.selectedId, language: $rootScope.selectedText });
  692 + }
  693 + });
  694 +
  695 + $('#secondLax').change(function () {
  696 + $rootScope.isActiveLexiconLanguageClicked = true;
  697 + $rootScope.secondlaxdid = $("#secondLax option:selected").attr('val');
  698 + $rootScope.secondlaxtext = $("#secondLax option:selected").text();
  699 +
  700 + });
  701 +
  702 + $("#laxiconLangRemove").click(function () {
  703 + if ($rootScope.isActiveLexiconLanguageClicked == true) {
  704 + $rootScope.isActiveLexiconLanguageClicked = false;
  705 + $("#secondLax :selected").remove();
  706 + $('#lexiconLangDropdown').append('<option val="' + $rootScope.secondlaxdid + '">' + $rootScope.secondlaxtext + '</option>');
  707 + // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1);
  708 + $rootScope.lexiconLanguageArray = [];
  709 + $("#secondLax > option").each(function () {
  710 + $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value });
  711 + });
  712 + $rootScope.lexiconLanguageArray.unshift({ id: $("#primarylaxican").attr("name"), language: $("#primarylaxican").val() });
  713 + }
  714 + });
  715 +
  716 + $("#laxicanlanguageChagne").click(function () {
  717 + if ($rootScope.isLexiconLanguageClicked == true) {
  718 + $rootScope.isLexiconLanguageClicked = false;
  719 + var primarylaxiid = $("#lexiconLangDropdown option:selected").attr('val');
  720 + var primarylaxicantext = $("#lexiconLangDropdown option:selected").text();
  721 + $("#lexiconLangDropdown :selected").remove();
  722 + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $('#primarylaxican').val() + '</option>');
  723 + $('#primarylaxican').val(primarylaxicantext);
  724 + $('#primarylaxican').attr("name", primarylaxiid);
  725 + $rootScope.lexiconLanguageArray[0].id = primarylaxiid;
  726 + $rootScope.lexiconLanguageArray[0].language = primarylaxicantext;
  727 + }
  728 + });
  729 + }
  730 +
  731 +
  732 + if ($.browser.msie) {
  733 + $("#resetBtn").css("display", "inline-block");
  734 + // $rootScope.refreshCanvas();
  735 +
  736 + }
  737 + $(function () {
  738 + var colpick = $('.demo').each(function () {
  739 +
  740 + $(this).minicolors({
  741 + control: $(this).attr('data-control') || 'hue',
  742 + inline: $(this).attr('data-inline') === 'true',
  743 + letterCase: 'lowercase',
  744 + opacity: false,
  745 + change: function (hex, opacity) {
  746 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").removeClass("ActiveDefaultColorAnnotation");
  747 + if (!hex) return;
  748 + if (opacity) hex += ', ' + opacity;
  749 + try {
  750 + console.log(hex);
  751 + $("#text_area").css("color", hex);
  752 + } catch (e) { }
  753 + $(this).select();
  754 + },
  755 + theme: 'bootstrap'
  756 + });
  757 + });
  758 +
  759 + var $inlinehex = $('#inlinecolorhex h3 small');
  760 + //alert($inlinehex);
  761 + $('#inlinecolors').minicolors({
  762 + inline: true,
  763 + theme: 'bootstrap',
  764 + change: function (hex) {
  765 + if (!hex) return;
  766 +
  767 + $inlinehex.html(hex);
  768 + }
  769 + });
  770 + });
  771 +
  772 +
  773 + $(function () {
  774 + var colpick = $('.drawTextBG').each(function () {
  775 + $(this).minicolors({
  776 + control: $(this).attr('data-control') || 'hue',
  777 + inline: $(this).attr('data-inline') === 'true',
  778 + letterCase: 'lowercase',
  779 + opacity: false,
  780 + change: function (hex, opacity) {
  781 + $("#drawTextBGColorpicker .minicolors .minicolors-swatch .minicolors-swatch-color").removeClass("ActiveDefaultColorAnnotation");
  782 + if (!hex) return;
  783 + if (opacity) hex += ', ' + opacity;
  784 + try {
  785 + console.log(hex);
  786 + // $("#text_area").css("background-color", hex);
  787 + } catch (e) { }
  788 + $(this).select();
  789 + },
  790 + theme: 'bootstrap'
  791 + });
  792 + });
  793 + var $inlinehex = $('#inlinecolorhex h3 small');
  794 + //alert($inlinehex);
  795 + $('#inlinecolors').minicolors({
  796 + inline: true,
  797 + theme: 'bootstrap',
  798 + change: function (hex) {
  799 +
  800 + if (!hex) return;
  801 + $inlinehex.html(hex);
  802 + }
  803 + });
  804 + });
  805 +
  806 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  807 + $("#drawTextBGColorpicker .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#ffffff" });
  808 +
  809 + });
  810 +
  811 + $rootScope.$on("$locationChangeSuccess", function () {
  812 +
  813 + $rootScope.HightLightModuleSelection = function (moduleUrl) {
  814 + var currentRoute = $location.path().substring(1);
  815 + return moduleUrl === currentRoute ? 'active' : '';
  816 + }
  817 + $("#annotationToolBarOptions").removeClass("disableMenuoption");
  818 + $("#optionsListManagerTab").removeClass("disableMenuoption");
  819 +
  820 +
  821 + if (($location.url() == "/da-body-view")) {
  822 + $rootScope.disableMenuannotation = " ";
  823 + $rootScope.disableMenuoption = " ";
  824 + $rootScope.disableSubMenu = "disableSubMenu";
  825 + $rootScope.disableFileMenu = " ";
  826 + }
  827 + else if ($location.url() == "/clinical-illustrations-detail") {
  828 + $rootScope.disableMenuannotation = " ";
  829 + $rootScope.disableMenuoption = " ";
  830 + $rootScope.disableSubMenu = "disableSubMenu";
  831 + $("#annotationToolBarOptions").removeClass("disableSubMenu");
  832 + $("#optionsListManagerTab").addClass("disableSubMenu");
  833 + $rootScope.disableFileMenu = " ";
  834 + }
  835 + else if ($location.url() == "/module-item-view") {
  836 + $rootScope.disableMenuannotation = " ";
  837 + $rootScope.disableMenuoption = " ";
  838 + $rootScope.disableSubMenu = "disableSubMenu";
  839 + $("#annotationToolBarOptions").removeClass("disableSubMenu");
  840 + $rootScope.disableFileMenu = " ";
  841 + }
  842 +
  843 + else if ($location.url() == "/clinical-animations-detail") {
  844 + $rootScope.disableMenuannotation = "disableMenuannotation";
  845 + $rootScope.disableMenuoption = " ";
  846 + $rootScope.disableSubMenu = "disableSubMenu";
  847 + $("#annotationToolBarOptions").addClass("disableSubMenu");
  848 + $("#optionsListManagerTab").addClass("disableSubMenu");
  849 + $rootScope.disableFileMenu = "disableFileMenu";
  850 + }
  851 + else {
  852 + $("#annotationToolBarOptions").removeClass("disableSubMenu");
  853 + $("#optionsListManagerTab").removeClass("disableSubMenu");
  854 + $rootScope.disableMenuannotation = "disableMenuannotation";
  855 + $rootScope.disableMenuoption = "disableMenuoption";
  856 + $rootScope.disableSubMenu = "";
  857 + $rootScope.CloseAnnotationTool();
  858 + $rootScope.CloseListManager();
  859 + angular.element('#modal-settings').css('display', 'none');
  860 + if ($location.url() == "/lab-exercises") {
  861 +
  862 + $rootScope.menuLabExer = 0;
  863 + }
  864 + if ($rootScope.menuLabExer == 1) {
  865 + $rootScope.disableMenuoption = " ";
  866 + }
  867 + $rootScope.disableFileMenu = "disableFileMenu";
  868 + }
  869 +
  870 + });
  871 +
  872 + //jspanel functionality..
  873 +
  874 + $rootScope.getModuleScrollPosition = function () {
  875 + $rootScope.refreshcheck = "check";
  876 + $('.mCSB_container ul li').click(function () {
  877 +
  878 + $rootScope.scrollTopPosition = $(this).position().top;
  879 +
  880 + });
  881 + setTimeout(function () {
  882 +
  883 + $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px");
  884 +
  885 +
  886 +
  887 + }, 300);
  888 + }
  889 +
  890 + $rootScope.openParent = function (slug) {
  891 + if ($('#jsPanel-1').length > 0) {
  892 +
  893 + }
  894 + else {
  895 + var openViews = $rootScope.openViews;
  896 + if (openViews.length > 0) {
  897 + $rootScope.openViews.splice(openViews.length - 1);
  898 + }
  899 + if (openViews.length > 0) {
  900 + var lastOpenMoudle = $rootScope.openViews[openViews.length - 1];
  901 + }
  902 + // $('#daImagePanel').remove();
  903 + if ($('#jsPanel-1').length > 0)
  904 + $('#jsPanel-1').remove();
  905 +
  906 + if ($('#3DImagePanel').length > 0)
  907 + $('#3DImagePanel').remove();
  908 +
  909 + if ($('#ciImagePanel').length > 0)
  910 + $('#ciImagePanel').remove();
  911 +
  912 + if ($('#caVideoPanel').length > 0)
  913 + $('#caVideoPanel').remove();
  914 +
  915 + if ($('#ImagePanel').length > 0)
  916 + $('#ImagePanel').remove();
  917 +
  918 + $location.url('/' + slug);
  919 +
  920 + $rootScope.$broadcast('jsPanelCloseEvent', true);
  921 + }
  922 + }
  923 +
  924 + //called on jsanel minimize
  925 + $rootScope.setState = function (state, title) {
  926 +
  927 +
  928 + var alreadyOpenThisView = new jinqJs()
  929 + .from($rootScope.openViews)
  930 + .where("body-views == " + title)
  931 + .select();
  932 + var k = 0;
  933 + if (alreadyOpenThisView != null) {
  934 + for (var i = 0; i < $rootScope.openViews.length; i++) {
  935 + k++;
  936 + if ($rootScope.openViews[i].body - views == title) {
  937 + $rootScope.openViews.splice((k - 1), 1);
  938 +
  939 + $rootScope.openViews.push(
  940 + {
  941 + "module": $rootScope.currentActiveModuleTitle, "bodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId,
  942 + "slug": $rootScope.currentSlug
  943 + }
  944 + );
  945 + }
  946 + }
  947 + }
  948 + if (state == 'max') {
  949 + $('#daBodyview').css('width', '100%')
  950 + }
  951 + }
  952 +
  953 + $rootScope.ClearIframe = function () {
  954 + if ($('#daImagePanel') != null)
  955 + $('#daImagePanel').remove();
  956 + if ($('#jsPanel-1').length > 0)
  957 + $('#jsPanel-1').remove();
  958 +
  959 + $rootScope.hideScrollbar();
  960 + }
  961 +
  962 + //ends
  963 +
  964 + $rootScope.hideScrollbar = function () {
  965 + $(".sidebar").mCustomScrollbar({
  966 + autoHideScrollbar: true,
  967 + //theme:"rounded"
  968 + });
  969 + }
  970 + $rootScope.isFontFamilyLoaded = false;
  971 + //annotation tool custom events
  972 + $rootScope.ShowAnnotationWindow = function () {
  973 + //7904
  974 +
  975 + $rootScope.isAnnotatiomToolBarPopupActive = true;
  976 + $rootScope.isAnnotatiomToolBarPopupClosed = false;
  977 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
  978 + if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "CI" || $rootScope.MenuModuleName == "AA") {
  979 + if ($rootScope.disableAnnotationtoolOnListManager == true) {
  980 + $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
  981 + $('#slider-range-min-2').slider('disable');
  982 + $("#annotationpaintbrushsize").attr('disabled', 'disabled');
  983 + $("#annotationpainteraser").attr('disabled', 'disabled');
  984 +
  985 + // $rootScope.disableAnnotationTB = false;
  986 + } else {
  987 + $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
  988 + $('#slider-range-min-2').slider('enable');
  989 + $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
  990 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  991 + }
  992 + // document.getElementById('modelbackground').style.display = "block";
  993 + // document.getElementById('modeleditstyle').style.display = "block";
  994 +
  995 + }
  996 + if ($rootScope.MenuModuleName == "CA") {
  997 + $("#annotationpaintbrushsize").attr("href", "#");
  998 + $("#annotationpainteraser").attr("href", "#");
  999 + $("#annotationpainteraser").attr('disabled', 'disabled');
  1000 + $("#annotationpainteraser").css('pointer-events', 'none');
  1001 + }
  1002 + else {
  1003 + $("#annotationpaintbrushsize").attr("href", "#canvasPaint");
  1004 + $("#annotationpainteraser").attr("href", "#canvasPaint");
  1005 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  1006 + $("#annotationpainteraser").css('pointer-events', 'auto');
  1007 + }
  1008 + $("#OnIdentify").addClass("annotationtoolbartab");
  1009 + $("#annotationToolBarOptions").addClass("active");
  1010 + $("#annotationButton").addClass("active");
  1011 +
  1012 + $rootScope.isAnnotationWindowOpen = true;
  1013 + $(".annotationTollbar").css("display", "block");
  1014 + $rootScope.$broadcast('annotationToolEvent', true);
  1015 + // $("#canvasPaint").css("display", "none");
  1016 + // $("#canvas").css("display", "none");
  1017 +
  1018 + var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json';
  1019 + if ($rootScope.isFontFamilyLoaded == false) {
  1020 +
  1021 +
  1022 + DataService.getJson(FontFamilyJson)
  1023 + .then(
  1024 + function (result) {
  1025 +
  1026 + $rootScope.AnnotationFontFamily = result;
  1027 + // alert($rootScope.AnnotationFontFamily.FontStyle.length);
  1028 +
  1029 + for (var i = 0; i <= $rootScope.AnnotationFontFamily.FontFamily.length - 1; i++) {
  1030 + var fontName = $rootScope.AnnotationFontFamily.FontFamily[i].FontName;
  1031 + if (/\s/g.test(fontName)) { //Check if white-space exists in between strings
  1032 + fontName = fontName.replace(" ", "_"); // replace white-space with an underscore
  1033 + }
  1034 + //$rootScope.AnnotationFontFamily.FontFamily[i].FontName
  1035 + $("#selected-font-family").append("<option value=" + fontName + ">" + $rootScope.AnnotationFontFamily.FontFamily[i].FontName + "</option>");
  1036 +
  1037 + }
  1038 + $rootScope.isFontFamilyLoaded = true;
  1039 +
  1040 + },
  1041 + function (error) {
  1042 + console.log(error.statusText)
  1043 + }
  1044 + )
  1045 +
  1046 + }
  1047 +
  1048 + if ($("#transparencyScale").css("display") == "block") {
  1049 +
  1050 + $rootScope.switchToTransparencycanvas();
  1051 + }
  1052 +
  1053 +
  1054 + if ($location.url() == "/module-item-view") {
  1055 +
  1056 + var canvasZIndex = $("#canvas").css("z-index");
  1057 + var canvasPaintZIndex = $("#canvasPaint").css("z-index");
  1058 +
  1059 + if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) {
  1060 + canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
  1061 + $("#aaDetailViewCanvas").css("z-index", canvasPaintZIndex);
  1062 +
  1063 + }
  1064 + else
  1065 + {
  1066 + canvasZIndex = parseInt(canvasZIndex) + 1;
  1067 + $("#aaDetailViewCanvas").css("z-index", canvasZIndex);
  1068 + }
  1069 +
  1070 + }
  1071 + }
  1072 +
  1073 + $rootScope.CloseAnnotationTool = function () {
  1074 + console.log('close');
  1075 + $rootScope.isAnnotatiomToolBarPopupActive = false;
  1076 + $rootScope.isAnnotatiomToolBarPopupClosed = true;
  1077 + $("#OnIdentify").removeClass("annotationtoolbartab");
  1078 + $("#DrawMode").removeClass("annotationtoolbartab");
  1079 + $('.btnCursor').removeClass('activebtncolor');
  1080 + $("#annotationButton").removeClass("active");
  1081 + $("#annotationButton").blur();
  1082 + $("#annotationToolBarOptions").removeClass("active");
  1083 +
  1084 +
  1085 + $(".annotationTollbar").css("display", "none");
  1086 + $rootScope.isAnnotationWindowClose = true;
  1087 + // $("#canvasPaint").css("display", "none");
  1088 + // $("#canvas").css("display", "none");
  1089 + $('.btnCursor').removeClass('activebtncolor');
  1090 + $(".btn-annotation").removeClass("activebtncolor");
  1091 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
  1092 +
  1093 + if ($("#transparencyScale").css("display") == "block") {
  1094 + $rootScope.switchToTransparencycanvas();
  1095 + }
  1096 + else {
  1097 + $rootScope.switchCanvas();
  1098 + }
  1099 + $rootScope.shapeType = '';
  1100 + if ($location.url() == "/module-item-view") {
  1101 +
  1102 + var canvasZIndex = $("#canvas").css("z-index");
  1103 + var canvasPaintZIndex = $("#canvasPaint").css("z-index");
  1104 +
  1105 + if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) {
  1106 + canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
  1107 + $("#aaDetailViewCanvas").css("z-index", canvasPaintZIndex);
  1108 +
  1109 + }
  1110 + else {
  1111 + canvasZIndex = parseInt(canvasZIndex) + 1;
  1112 + $("#aaDetailViewCanvas").css("z-index", canvasZIndex);
  1113 + }
  1114 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  1115 +
  1116 + for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) {
  1117 +
  1118 + if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) {
  1119 +
  1120 + var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId;
  1121 + var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId;
  1122 +
  1123 + $('#aaDetailViewCanvas').setLayer(pinName, {
  1124 + visible: false // set to true instead to show the layer again
  1125 + }).drawLayers();
  1126 +
  1127 + $('#aaDetailViewCanvas').setLayer(pinArcName, {
  1128 + visible: false // set to true instead to show the layer again
  1129 + }).drawLayers();
  1130 +
  1131 + }
  1132 +
  1133 + }
  1134 + }
  1135 + }
  1136 + }
  1137 + $rootScope.CIAnotationIdentifyModeOff = false;
  1138 + $rootScope.OnIdentifyClick = function () {
  1139 +
  1140 + $("#OnIdentify").addClass("annotationtoolbartab");
  1141 + $("#DrawMode").removeClass("annotationtoolbartab");
  1142 +
  1143 + if ($rootScope.CIAnotationIdentifyModeOff == true) {
  1144 + $('.btnCursor').removeClass('activebtncolor');
  1145 +
  1146 + } else {
  1147 +
  1148 + $('.btnCursor').removeClass('activebtncolor');
  1149 +
  1150 + }
  1151 +
  1152 + $("#annotationpaintbrushsize").removeClass("activebtncolor");
  1153 + $("#annotationpainteraser").removeClass("activebtncolor");
  1154 +
  1155 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
  1156 + $rootScope.switchCanvas();
  1157 +
  1158 + if ($("#transparencyScale").css("display") == "block") {
  1159 +
  1160 + $rootScope.switchToTransparencycanvas();
  1161 + }
  1162 + if ($location.url() == "/module-item-view") {
  1163 +
  1164 + var canvasZIndex = $("#canvas").css("z-index");
  1165 + var canvasPaintZIndex = $("#canvasPaint").css("z-index");
  1166 +
  1167 + if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) {
  1168 + canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
  1169 + $("#aaDetailViewCanvas").css("z-index", canvasPaintZIndex);
  1170 +
  1171 + }
  1172 + else {
  1173 + canvasZIndex = parseInt(canvasZIndex) + 1;
  1174 + $("#aaDetailViewCanvas").css("z-index", canvasZIndex);
  1175 + }
  1176 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  1177 +
  1178 + for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) {
  1179 +
  1180 + if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) {
  1181 +
  1182 + var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId;
  1183 + var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId;
  1184 +
  1185 + $('#aaDetailViewCanvas').setLayer(pinName, {
  1186 + visible: false // set to true instead to show the layer again
  1187 + }).drawLayers();
  1188 +
  1189 + $('#aaDetailViewCanvas').setLayer(pinArcName, {
  1190 + visible: false // set to true instead to show the layer again
  1191 + }).drawLayers();
  1192 +
  1193 + }
  1194 +
  1195 + }
  1196 + }
  1197 +
  1198 + }
  1199 + }
  1200 +
  1201 + $rootScope.switchToTransparencycanvas = function () {
  1202 +
  1203 + if ($rootScope.isTBoxModestyVisible == true) {
  1204 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  1205 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  1206 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  1207 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  1208 +
  1209 + if (ctx.style.visibility == "visible") {
  1210 +
  1211 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  1212 +
  1213 + var drawCanvasZindex = $("#canvas").css("z-index");
  1214 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1215 + var TransCanvasZindex = ctx.style.zIndex;
  1216 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  1217 + MaxZindexVal = MaxZindexVal + 1;
  1218 + $("#canvas").css("z-index", MaxZindexVal);
  1219 + if ($rootScope.currentBodyViewId == "11") {
  1220 + $(".ui-wrapper").css("z-index", MaxZindexVal + 1);
  1221 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1222 +
  1223 + }
  1224 + else {
  1225 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1226 + }
  1227 + }
  1228 + else {
  1229 + var drawCanvasZindex = $("#canvas").css("z-index");
  1230 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1231 + var TransCanvasZindex = ctx.style.zIndex;
  1232 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  1233 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  1234 +
  1235 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1236 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1237 + }
  1238 + else {
  1239 +
  1240 + $("#canvas").css("z-index", MaxZindexVal);
  1241 + if ($rootScope.currentBodyViewId == "11") {
  1242 + $(".ui-wrapper").css("z-index", MaxZindexVal);
  1243 + }
  1244 + else
  1245 + {
  1246 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1247 + }
  1248 +
  1249 + }
  1250 +
  1251 + }
  1252 + }
  1253 + else {
  1254 + var drawCanvasZindex = $("#canvas").css("z-index");
  1255 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1256 + drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
  1257 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  1258 + if (drawCanvasZindex > paintCanvasZindex) {
  1259 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  1260 + $("#canvas").css("z-index", drawCanvasZindex);
  1261 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
  1262 + }
  1263 + else {
  1264 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  1265 + $("#canvas").css("z-index", paintCanvasZindex);
  1266 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
  1267 + }
  1268 +
  1269 + }
  1270 + }
  1271 + }
  1272 +
  1273 + }
  1274 + else {
  1275 + var drawCanvasZindex = $("#canvas").css("z-index");
  1276 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1277 + drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
  1278 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  1279 + if (drawCanvasZindex > paintCanvasZindex) {
  1280 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  1281 + $("#canvas").css("z-index", drawCanvasZindex);
  1282 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
  1283 + }
  1284 + else {
  1285 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  1286 + $("#canvas").css("z-index", paintCanvasZindex);
  1287 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
  1288 + }
  1289 + }
  1290 + }
  1291 +
  1292 + $rootScope.DrawingMode = function () {
  1293 +
  1294 + //Annotation History
  1295 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1296 + $("#OnIdentify").removeClass("annotationtoolbartab");
  1297 + $("#DrawMode").addClass("annotationtoolbartab");
  1298 + $('.btnCursor').addClass('activebtncolor');
  1299 + $rootScope.switchCanvas();
  1300 + $("#annotationpaintbrushsize").removeClass("activebtncolor");
  1301 + $("#annotationpainteraser").removeClass("activebtncolor");
  1302 + $rootScope.isEraseToolSelected = false;
  1303 +
  1304 + if ($location.url() == "/module-item-view") {
  1305 +
  1306 + $rootScope.switchToAnnotationCanvas();
  1307 +
  1308 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  1309 +
  1310 + for (var j = 0; j <= $rootScope.aaPinDataArray.length - 1; j++) {
  1311 +
  1312 + if (($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._HeadX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._HeadY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._HeadX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._HeadY)) || ($rootScope.jcanvasObjectArray[i].x <= parseInt($rootScope.aaPinDataArray[j]._PinX) && $rootScope.jcanvasObjectArray[i].y <= parseInt($rootScope.aaPinDataArray[j]._PinY)) && (($rootScope.jcanvasObjectArray[i].x + $rootScope.jcanvasObjectArray[i].width) >= parseInt($rootScope.aaPinDataArray[j]._PinX) && ($rootScope.jcanvasObjectArray[i].y + $rootScope.jcanvasObjectArray[i].height) >= parseInt($rootScope.aaPinDataArray[j]._PinY))) {
  1313 +
  1314 + var pinName = 'Pin_' + $rootScope.aaPinDataArray[j]._PinId;
  1315 + var pinArcName = 'PinArc_' + $rootScope.aaPinDataArray[j]._PinId;
  1316 +
  1317 + $('#aaDetailViewCanvas').setLayer(pinName, {
  1318 + visible: true // set to true instead to show the layer again
  1319 + }).drawLayers();
  1320 +
  1321 + $('#aaDetailViewCanvas').setLayer(pinArcName, {
  1322 + visible: true // set to true instead to show the layer again
  1323 + }).drawLayers();
  1324 +
  1325 + }
  1326 + }
  1327 + }
  1328 +
  1329 + }
  1330 +
  1331 + }
  1332 +
  1333 + // Dissectible Anatomy > Settings should be disable if Annotation is Open.
  1334 + $rootScope.ShowSettingWindow = function () {
  1335 + if ($(".annotationTollbar").css("display") == "block") {
  1336 + // alert("already open");
  1337 + $('#modal-settings').css("display", "none");
  1338 + $("#modelsettingsbackground").css("display", "none");
  1339 + }
  1340 + else {
  1341 +
  1342 + $('#modal-settings').css("display", "block");
  1343 + $("#modelsettingsbackground").css("display", "block");
  1344 + }
  1345 +
  1346 + $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length;
  1347 + $rootScope.lexiconPrimaryLanguage = $("#primarylaxican").val();
  1348 + $rootScope.primaryLangID = $('#primarylaxican').attr("name");
  1349 + }
  1350 +
  1351 + //----Annotation Toolbar: Jcanvas-----
  1352 +
  1353 + $rootScope.DrawLine = function (e) {
  1354 + $rootScope.setListManagerZindex = true;
  1355 + $("#canvasPaint").css("display", "block");
  1356 + $("#canvas").css("display", "block");
  1357 +
  1358 + $('.btnCursor').removeClass('activebtncolor');
  1359 + $(".btn-annotation").removeClass("activebtncolor");
  1360 + $(".btn-annotation-line").addClass("activebtncolor");
  1361 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1362 + $("#DrawMode").addClass('annotationtoolbartab');
  1363 +
  1364 +
  1365 + $rootScope.switchCanvas();
  1366 + $rootScope.shapeType = "Line";
  1367 +
  1368 +
  1369 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1370 + if ($location.url() == "/module-item-view") {
  1371 +
  1372 + $rootScope.switchToAnnotationCanvas();
  1373 +
  1374 + }
  1375 + }
  1376 +
  1377 + $rootScope.switchToAnnotationCanvas = function () {
  1378 + var aaViewCanvasZIndex = $("#aaDetailViewCanvas").css("z-index");
  1379 + var canvasPaintZIndex = $("#canvasPaint").css("z-index");
  1380 + if (parseInt(aaViewCanvasZIndex) < parseInt(canvasPaintZIndex)) {
  1381 + canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1;
  1382 + $("#canvas").css("z-index", canvasPaintZIndex);
  1383 + }
  1384 + else {
  1385 + aaViewCanvasZIndex = parseInt(aaViewCanvasZIndex) + 1;
  1386 + $("#canvas").css("z-index", aaViewCanvasZIndex);
  1387 + }
  1388 + }
  1389 +
  1390 +
  1391 + $rootScope.DrawPin = function (e) {
  1392 + $("#canvasPaint").css("display", "block");
  1393 + $("#canvas").css("display", "block");
  1394 +
  1395 + $('.btnCursor').removeClass('activebtncolor');
  1396 + $(".btn-annotation").removeClass("activebtncolor");
  1397 + $(".btn-annotation-pin").addClass("activebtncolor");
  1398 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1399 + $("#DrawMode").addClass('annotationtoolbartab');
  1400 +
  1401 + $rootScope.switchCanvas();
  1402 + $rootScope.setListManagerZindex = true;
  1403 + $rootScope.shapeType = "Pin";
  1404 +
  1405 +
  1406 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1407 + if ($location.url() == "/module-item-view") {
  1408 +
  1409 + $rootScope.switchToAnnotationCanvas();
  1410 +
  1411 + }
  1412 + }
  1413 +
  1414 + $rootScope.Cursor = function () {
  1415 + $rootScope.switchCanvas();
  1416 + $rootScope.shapeType = "cursor";
  1417 +
  1418 + $(".btn-annotation").removeClass("activebtncolor");
  1419 + // $("#" + e.currentTarget.id).removeClass("activebtncolor");
  1420 + $('.btnCursor').addClass('activebtncolor');
  1421 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1422 + $("#DrawMode").addClass('annotationtoolbartab');
  1423 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1424 + if ($location.url() == "/module-item-view") {
  1425 +
  1426 + $rootScope.switchToAnnotationCanvas();
  1427 +
  1428 + }
  1429 + }
  1430 +
  1431 +
  1432 + $rootScope.DrawRectangle = function (e) {
  1433 + $rootScope.setListManagerZindex = true;
  1434 + $("#canvasPaint").css("display", "block");
  1435 + $("#canvas").css("display", "block");
  1436 +
  1437 + $('.btnCursor').removeClass('activebtncolor');
  1438 + $(".btn-annotation").removeClass("activebtncolor");
  1439 + $(".btn-annotation-rectangle").addClass("activebtncolor");
  1440 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1441 + $("#DrawMode").addClass('annotationtoolbartab');
  1442 +
  1443 + $rootScope.switchCanvas();
  1444 + $rootScope.shapeType = "Rectangle";
  1445 +
  1446 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1447 + if ($location.url() == "/module-item-view") {
  1448 +
  1449 + $rootScope.switchToAnnotationCanvas();
  1450 +
  1451 + }
  1452 + }
  1453 +
  1454 + $rootScope.paintBrush = function () {
  1455 +
  1456 + $('.btnCursor').removeClass('activebtncolor');
  1457 + $(".btn-annotation").removeClass("activebtncolor");
  1458 + $(".btn-annotation-brush").addClass("activebtncolor");
  1459 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1460 + $("#DrawMode").addClass('annotationtoolbartab');
  1461 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1462 + if ($rootScope.disableAnnotationtoolOnListManager == true) {
  1463 + $rootScope.switchCanvas();
  1464 + var canvasPaintZindex = $('#canvasPaint').css("z-index"); //x
  1465 +
  1466 + var canvasZindex = $('#canvas').css("z-index"); //y
  1467 + var listManagerZindex = $('#listManager').css("z-index"); //z
  1468 + if (canvasPaintZindex > canvasZindex) {
  1469 +
  1470 + $('#listManager').css("z-index", canvasPaintZindex);
  1471 +
  1472 + } else {
  1473 +
  1474 + $('#listManager').css("z-index", canvasZindex);
  1475 + }
  1476 +
  1477 + } else {
  1478 +
  1479 + $rootScope.setListManagerZindex = true;
  1480 + $("#canvasPaint").css("display", "block");
  1481 + $("#canvas").css("display", "block");
  1482 +
  1483 + if ((document.getElementById('fill-option').checked == false) && ($rootScope.isShapeSyleOkBtnClicked == true)) {
  1484 +
  1485 + $rootScope.switchCanvas();
  1486 + }
  1487 + else if (($("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color') == "transparent") || ($("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color') == "rgba(0, 0, 0, 0)")) {
  1488 + // we are switching canvas from paint to draw to prevent paint because it does not take transparent color and we need control default black color for the case where user has unchecked fill option from Edit Shape Style window
  1489 +
  1490 + $rootScope.switchCanvas();
  1491 + }
  1492 + else {
  1493 +
  1494 + $rootScope.switchCanvasToPaintCanvas();
  1495 + }
  1496 + $rootScope.shapeType = "FreeStylePaint";
  1497 + var btnBrushSizeValue = $("#btnBrushSize").val();
  1498 + $rootScope.shapeSize = parseInt(btnBrushSizeValue);
  1499 + $("#annotationpaintbrushsize").attr("data-size", $rootScope.shapeSize);
  1500 +
  1501 + $("#annotationpaintbrushsize").attr("data-color", $rootScope.shapestyleColorWithOpacity);
  1502 +
  1503 + if ($rootScope.shapeSize == '') {
  1504 + $('#canvasPaint').sketch({ defaultSize: 1 });
  1505 + }
  1506 + else {
  1507 + $('#canvasPaint').sketch();
  1508 +
  1509 + }
  1510 + }
  1511 +
  1512 +
  1513 + }
  1514 +
  1515 + $rootScope.switchCanvasToPaintCanvas = function (e) {
  1516 + if ($rootScope.isTBoxModestyVisible == true) {
  1517 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  1518 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  1519 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  1520 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  1521 + if (ctx.style.visibility == "visible") {
  1522 + var drawCanvasZindex = $("#canvas").css("z-index");
  1523 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1524 + var TransCanvasZindex = ctx.style.zIndex;
  1525 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  1526 + MaxZindexVal = MaxZindexVal + 1;
  1527 + if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
  1528 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  1529 + $("#canvas").css("z-index", MaxZindexVal);
  1530 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1531 + }
  1532 + else {
  1533 +
  1534 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1535 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1536 + }
  1537 + else {
  1538 + $("#canvas").css("z-index", MaxZindexVal);
  1539 + }
  1540 + }
  1541 + }
  1542 + }
  1543 + else {
  1544 +
  1545 + var drawCanvasZindex = $("#canvas").css("z-index");
  1546 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1547 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
  1548 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  1549 +
  1550 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1551 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1552 + }
  1553 +
  1554 + else {
  1555 + $("#canvas").css("z-index", MaxZindexVal);
  1556 + }
  1557 +
  1558 + }
  1559 + }
  1560 + }
  1561 +
  1562 + }
  1563 + else {
  1564 + var canvasPaint_zIndex = $('#canvasPaint').css("z-index");
  1565 + var canvas_zIndex = $('#canvas').css("z-index");
  1566 + if (canvas_zIndex > canvasPaint_zIndex) {
  1567 + canvasPaint_zIndex = parseInt(canvas_zIndex) + 1;
  1568 +
  1569 + }
  1570 + else {
  1571 + canvasPaint_zIndex = parseInt(canvasPaint_zIndex) + 1;
  1572 + }
  1573 + $('#canvasPaint').css("z-index", canvasPaint_zIndex);
  1574 + }
  1575 + }
  1576 +
  1577 + $rootScope.DrawCircle = function (e) {
  1578 + $rootScope.setListManagerZindex = true;
  1579 + $("#canvasPaint").css("display", "block");
  1580 + $("#canvas").css("display", "block");
  1581 +
  1582 + $('.btnCursor').removeClass('activebtncolor');
  1583 + $(".btn-annotation").removeClass("activebtncolor");
  1584 + $(".btn-annotation-circle").addClass("activebtncolor");
  1585 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1586 + $("#DrawMode").addClass('annotationtoolbartab');
  1587 +
  1588 + $rootScope.switchCanvas();
  1589 + $rootScope.shapeType = "Circle";
  1590 +
  1591 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1592 + if ($location.url() == "/module-item-view") {
  1593 +
  1594 + $rootScope.switchToAnnotationCanvas();
  1595 +
  1596 + }
  1597 + }
  1598 +
  1599 + $rootScope.DrawArrow = function (e) {
  1600 + $rootScope.setListManagerZindex = true;
  1601 + $("#canvasPaint").css("display", "block");
  1602 + $("#canvas").css("display", "block");
  1603 +
  1604 + $('.btnCursor').removeClass('activebtncolor');
  1605 + $(".btn-annotation").removeClass("activebtncolor");
  1606 + $(".btn-annotation-arrow").addClass("activebtncolor");
  1607 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1608 + $("#DrawMode").addClass('annotationtoolbartab');
  1609 +
  1610 + $rootScope.switchCanvas();
  1611 + $rootScope.shapeType = "Arrow";
  1612 +
  1613 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1614 + if ($location.url() == "/module-item-view") {
  1615 +
  1616 + $rootScope.switchToAnnotationCanvas();
  1617 +
  1618 + }
  1619 + }
  1620 + $rootScope.DrawText = function () {
  1621 +
  1622 + $rootScope.setListManagerZindex = true;
  1623 + $("#canvasPaint").css("display", "block");
  1624 + $("#canvas").css("display", "block");
  1625 +
  1626 + $('.btnCursor').removeClass('activebtncolor');
  1627 + $(".btn-annotation").removeClass("activebtncolor");
  1628 + $(".btn-annotation-Text").addClass("activebtncolor");
  1629 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1630 + $("#DrawMode").addClass('annotationtoolbartab');
  1631 +
  1632 + $rootScope.switchCanvas();
  1633 +
  1634 + $rootScope.shapeType = "TextArea";
  1635 +
  1636 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1637 + if ($location.url() == "/module-item-view") {
  1638 +
  1639 + $rootScope.switchToAnnotationCanvas();
  1640 +
  1641 + }
  1642 + }
  1643 +
  1644 + $rootScope.DrawPolygon = function () {
  1645 + $rootScope.setListManagerZindex = true;
  1646 + $("#canvasPaint").css("display", "block");
  1647 + $("#canvas").css("display", "block");
  1648 + $rootScope.shapeType = "DrawPolygon";
  1649 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1650 + $("#DrawMode").addClass('annotationtoolbartab');
  1651 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1652 + if ($location.url() == "/module-item-view") {
  1653 +
  1654 + $rootScope.switchToAnnotationCanvas();
  1655 +
  1656 + }
  1657 + }
  1658 +
  1659 +
  1660 + $rootScope.switchCanvas = function () {
  1661 +
  1662 + if ($rootScope.isTBoxModestyVisible == true) {
  1663 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  1664 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  1665 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  1666 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  1667 +
  1668 + if (ctx.style.visibility == "visible") {
  1669 +
  1670 + var drawCanvasZindex = $("#canvas").css("z-index");
  1671 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1672 + var TransCanvasZindex = ctx.style.zIndex;
  1673 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  1674 + MaxZindexVal = MaxZindexVal + 1;
  1675 +
  1676 +
  1677 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  1678 +
  1679 + $("#canvas").css("z-index", MaxZindexVal);
  1680 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1681 +
  1682 + }
  1683 + else {
  1684 +
  1685 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1686 + if ($rootScope.currentBodyViewId == "11") { $("#canvasPaint").css("z-index", MaxZindexVal + 1); }
  1687 + else{ $("#canvasPaint").css("z-index", MaxZindexVal);}
  1688 + }
  1689 + else {
  1690 + if ($rootScope.currentBodyViewId == "11") {
  1691 + $("#canvas").css("z-index", MaxZindexVal + 1);
  1692 + }
  1693 + else
  1694 + {
  1695 + $("#canvas").css("z-index", MaxZindexVal);
  1696 + }
  1697 + }
  1698 +
  1699 + }
  1700 + }
  1701 + else {
  1702 +
  1703 + var drawCanvasZindex = $("#canvas").css("z-index");
  1704 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1705 +
  1706 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
  1707 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  1708 +
  1709 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1710 +
  1711 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1712 + }
  1713 +
  1714 + else {
  1715 + $("#canvas").css("z-index", MaxZindexVal);
  1716 + }
  1717 + }
  1718 + }
  1719 + }
  1720 + }
  1721 + else {
  1722 +
  1723 + var drawCanvasZindex = $("#canvas").css("z-index");
  1724 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1725 +
  1726 +
  1727 + if (drawCanvasZindex > paintCanvasZindex) {
  1728 + paintCanvasZindex = parseInt(drawCanvasZindex) + 1;
  1729 + } else {
  1730 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  1731 + }
  1732 + $('#canvas').css("z-index", paintCanvasZindex);
  1733 + }
  1734 +
  1735 + }
  1736 + $rootScope.EraseDrawing = function () {
  1737 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  1738 + $('.btnCursor').removeClass('activebtncolor');
  1739 + $(".btn-annotation").removeClass("activebtncolor");
  1740 + $(".btn-annotation-erase").addClass("activebtncolor");
  1741 + $("#OnIdentify").removeClass('annotationtoolbartab');
  1742 + $("#DrawMode").addClass('annotationtoolbartab');
  1743 + $rootScope.switchCanvasToPaintCanvas();
  1744 + var btneraseBrushSizeValue = $("#btnBrushSize").val();
  1745 + $('#canvasPaint').sketch();
  1746 + $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
  1747 +
  1748 + $("#annotationpainteraser").attr("data-size", $rootScope.eraseshapeSize);
  1749 + return $.sketch.tools.eraser = {
  1750 + onEvent: function (e) {
  1751 + return $.sketch.tools.marker.onEvent.call(this, e);
  1752 + },
  1753 + draw: function (action) {
  1754 + var oldcomposite;
  1755 + oldcomposite = this.context.globalCompositeOperation;
  1756 + this.context.globalCompositeOperation = "destination-out";
  1757 + action.color = "#000000";
  1758 + $.sketch.tools.marker.draw.call(this, action);
  1759 + return this.context.globalCompositeOperation = oldcomposite;
  1760 + }
  1761 + }
  1762 +
  1763 +
  1764 + }
  1765 +
  1766 + $rootScope.isShapeSyleOkBtnClicked = false;
  1767 +
  1768 + $rootScope.setPropertiesForShapes = function (id) {
  1769 + isfilloptionChecked = document.getElementById('fill-option').checked;
  1770 + isOutlineOptionChecked = document.getElementById('Outline-Option').checked;
  1771 + $rootScope.isShapeSyleOkBtnClicked = true;
  1772 + if ($("#annotationpaintbrushsize").hasClass('activebtncolor')) {
  1773 + $("#annotationpaintbrushsize").removeClass('activebtncolor')
  1774 + $rootScope.switchCanvas();
  1775 +
  1776 + }
  1777 + if ($("#annotationpainteraser").hasClass('activebtncolor')) {
  1778 + $("#annotationpainteraser").removeClass('activebtncolor')
  1779 + $rootScope.switchCanvas();
  1780 +
  1781 + }
  1782 + if ((document.getElementById('fill-option').checked == false) && (document.getElementById('Outline-Option').checked == false)) {
  1783 + // $('#btnShapeStyle').attr('disabled', 'disabled');
  1784 + } else {
  1785 + //$('#btnShapeStyle').removeAttr('disabled', 'disabled');
  1786 + document.getElementById('modelbackground').style.display = "none";
  1787 + document.getElementById('modeleditstyle').style.display = "none";
  1788 +
  1789 + $rootScope.shapestyleOpacity = $("#" + id).css('opacity');
  1790 + $("#shapeStyleDiv").parent().css("opacity", $rootScope.shapestyleOpacity);
  1791 + $rootScope.shapestyleFillColor = $("#" + id).css('background-color');
  1792 + $rootScope.shapeStyleColorRGBA = $rootScope.shapestyleFillColor.replace("rgb", "rgba");
  1793 + $rootScope.shapestyleColorWithOpacity = $rootScope.shapeStyleColorRGBA.substring(0, $rootScope.shapeStyleColorRGBA.length - 1) + " " + "," + $rootScope.shapestyleOpacity + ")";
  1794 + $("#shapeStyleDiv").css("background-color", $rootScope.shapestyleFillColor);
  1795 + $rootScope.shapestyleborderColor = $("#" + id).parent().css("border-top-color");
  1796 + // $("#shapeStyleDiv").parent().css("border-color", $rootScope.shapestyleborderColor);
  1797 + $rootScope.borderDimensions = $("#" + id).parent().css("border-top-width");
  1798 +
  1799 + document.getElementById("shapeStyleDiv").parentNode.style.border = $rootScope.borderDimensions + " " + "solid" + " " + $rootScope.shapestyleborderColor;
  1800 +
  1801 + // $("#shapeStyleDiv").parent().css("border-width", $rootScope.shapestyleborderWidthSeparatingPixel);
  1802 +
  1803 + var borderDimensions = $rootScope.borderDimensions;
  1804 + var borderDimensionSplitArray = borderDimensions.split("p");
  1805 +
  1806 + $rootScope.shapestyleborderWidth = borderDimensionSplitArray[0];
  1807 + $rootScope.shapestyleborderStyles = "solid";
  1808 +
  1809 +
  1810 + $('#editshapestyle').modal('hide');
  1811 +
  1812 + //Edit Shape Style popup should open at it's default position
  1813 + $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" });
  1814 + }
  1815 + }
  1816 +
  1817 + $rootScope.enableAnnotationToolBar = function () {
  1818 + if ($rootScope.disableAnnotationTB == true) {
  1819 + document.getElementById('modelbackground').style.display = "none";
  1820 + document.getElementById('modeleditstyle').style.display = "none";
  1821 + }
  1822 + else {
  1823 + document.getElementById('modelbackground').style.display = "block";
  1824 + document.getElementById('modeleditstyle').style.display = "block";
  1825 +
  1826 + // alert(document.getElementById('outlinedivId').style.border);
  1827 + // alert(document.getElementById('imgOpacity').style.backgroundColor);
  1828 + $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('imgOpacity').style.backgroundColor);
  1829 + $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", document.getElementById('outlinedivId').style.border);
  1830 +
  1831 + if ($('#modeleditstyle').css("display") == "block") { //Check if the modal is already showing
  1832 + var previewOpacity = $('#imgOpacity').css("opacity");
  1833 + $('#slider-range-min-4 div.ui-slider-range-min').css("width", (previewOpacity * 100) + "%");
  1834 + $('#slider-range-min-4 span.ui-slider-handle').css("left", (previewOpacity * 100) + "%");
  1835 +
  1836 + };
  1837 +
  1838 + }
  1839 + }
  1840 +
  1841 +
  1842 + $rootScope.enableEditShapeTooltip = function () {
  1843 +
  1844 + $("#edit-block").addClass("custom-tooltip-annotation");
  1845 + $(".custom-tooltip-annotation").css('display', 'block');
  1846 +
  1847 + }
  1848 +
  1849 + $rootScope.disableEditShapeTooltip = function () {
  1850 +
  1851 + $(".custom-tooltip-annotation").css('display', 'none');
  1852 + $("#edit-block").removeClass("custom-tooltip-annotation");
  1853 + }
  1854 +
  1855 +
  1856 + $rootScope.disableAnnotationToolBar = function () {
  1857 +
  1858 + if ($rootScope.isShapeSyleOkBtnClicked == false) {
  1859 + $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)");
  1860 + $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(0,0,0)");
  1861 + var previewBorderColor = $("#outlineColor span.minicolors-swatch-color").css('background-color');
  1862 + $(".marginTopBtm10 div.outlinediv").css("border-color", previewBorderColor);
  1863 + var previewBgColor = $("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color');
  1864 + $("#imgOpacity").css("background-color", previewBgColor);
  1865 + $('#borderWidthCanvasElement').val(1);
  1866 + $('.marginTopBtm10 div.outlinediv').css("border-width", 1);
  1867 + $("#imgOpacity").css("opacity", 1);
  1868 + $(".marginTopBtm10 div.outlinediv").css("opacity", 1);
  1869 + document.getElementById("editStyleForm").reset();
  1870 + isOutlineOptionChecked = document.getElementById('Outline-Option').checked;
  1871 + isfilloptionChecked = document.getElementById('fill-option').checked;
  1872 + if (isOutlineOptionChecked == true) {
  1873 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" });
  1874 + $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
  1875 + $("#outlineColor").css({ "pointer-events": "auto" });
  1876 + }
  1877 + else {
  1878 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": ".5" });
  1879 + $("#borderWidthCanvasElement").css({ "pointer-events": "none" });
  1880 + $("#outlineColor").css({ "pointer-events": "none" });
  1881 + }
  1882 + if (isfilloptionChecked == true) {
  1883 + $(".enableDisableOpacity label").css({ "cursor": "pointer" });
  1884 + $(".enableDisableOpacity").css({ "opacity": "1" });
  1885 + $("#edit-slider-3").css({ "pointer-events": "auto" });
  1886 + $("#edit-slider-4").css({ "pointer-events": "auto" });
  1887 + $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
  1888 + }
  1889 + else {
  1890 + $(".enableDisableOpacity label").css({ "cursor": "pointer" });
  1891 + $(".enableDisableOpacity").css({ "opacity": ".5" });
  1892 + $("#edit-slider-3").css({ "pointer-events": "none" });
  1893 + $("#edit-slider-4").css({ "pointer-events": "none" });
  1894 + $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
  1895 + }
  1896 +
  1897 + } else {
  1898 +
  1899 + document.getElementById('fill-option').checked = isfilloptionChecked;
  1900 + document.getElementById('Outline-Option').checked = isOutlineOptionChecked;
  1901 + if (isfilloptionChecked == true) {
  1902 + $(".enableDisableOpacity label").css({ "cursor": "pointer" });
  1903 + $(".enableDisableOpacity").css({ "opacity": "1" });
  1904 + $("#edit-slider-3").css({ "pointer-events": "auto" });
  1905 + $("#edit-slider-4").css({ "pointer-events": "auto" });
  1906 + $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
  1907 + }
  1908 + else {
  1909 + $(".enableDisableOpacity label").css({ "cursor": "pointer" });
  1910 + $(".enableDisableOpacity").css({ "opacity": ".5" });
  1911 + $("#edit-slider-3").css({ "pointer-events": "none" });
  1912 + $("#edit-slider-4").css({ "pointer-events": "none" });
  1913 + $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
  1914 + }
  1915 + if (isOutlineOptionChecked == true) {
  1916 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" });
  1917 + $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
  1918 + $("#outlineColor").css({ "pointer-events": "auto" });
  1919 + }
  1920 + else {
  1921 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": ".5" });
  1922 + $("#borderWidthCanvasElement").css({ "pointer-events": "none" });
  1923 + $("#outlineColor").css({ "pointer-events": "none" });
  1924 + }
  1925 + if ((isfilloptionChecked == false) && (isOutlineOptionChecked == false)) {
  1926 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" });
  1927 + $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
  1928 + $("#outlineColor").css({ "pointer-events": "auto" });
  1929 + $(".enableDisableOpacity label").css({ "cursor": "pointer" });
  1930 + $(".enableDisableOpacity").css({ "opacity": "1" });
  1931 + $("#edit-slider-3").css({ "pointer-events": "auto" });
  1932 + $("#edit-slider-4").css({ "pointer-events": "auto" });
  1933 + $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
  1934 + document.getElementById("editStyleForm").reset();
  1935 + }
  1936 + var previewBgColor = $("#shapeStyleDiv").css('background-color');
  1937 + var previewBorderColor = $('#previewBorder').css('border-top-color');
  1938 + var previewBorderWidth = $('#previewBorder').css('border-top-width');
  1939 + var previewOpacity = $('#previewBorder').css('opacity');
  1940 + $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", previewBgColor);
  1941 + $("#imgOpacity").css("background-color", previewBgColor);
  1942 + $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", previewBorderColor);
  1943 + $(".marginTopBtm10 div.outlinediv").css("border-color", previewBorderColor);
  1944 + $('.marginTopBtm10 div.outlinediv').css("border-width", previewBorderWidth);
  1945 + $('#borderWidthCanvasElement').val(previewBorderWidth.split("px"));
  1946 + $("#imgOpacity").css("opacity", previewOpacity);
  1947 + $(".marginTopBtm10 div.outlinediv").css("opacity", previewOpacity);
  1948 +
  1949 + }
  1950 + document.getElementById('modelbackground').style.display = "none";
  1951 + document.getElementById('modeleditstyle').style.display = "none";
  1952 + //Edit Shape Style popup should open at it's default position
  1953 + $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" });
  1954 + }
  1955 + //--Common code of Annotation Toolbar for CI and DA-------
  1956 + $rootScope.DrawLineOnModuleItem = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
  1957 + // alert('inside DrawLineOnModuleItem');
  1958 + // alert("canvasId" + canvasId + ",LineNumber" + LineNumber + ",shapestyleborderColor" + shapestyleborderColor + ",shapestyleborderWidth" + shapestyleborderWidth + ",offsetX1" + offsetX1 + ",offsetY1" + offsetY1 + ",x" + x);
  1959 + if ($rootScope.isLinePreviewCompleted == true) {
  1960 + // alert('$rootScope.isLinePreviewCompleted == true')
  1961 + $rootScope.isLinePreviewCompleted = false;
  1962 + $(canvasId).addLayer({
  1963 + name: 'Line_' + LineNumber,
  1964 + layer: true,
  1965 + type: 'line',
  1966 + draggable: true,
  1967 + strokeStyle: shapestyleborderColor,
  1968 + strokeWidth: shapestyleborderWidth,
  1969 + rounded: true,
  1970 + x1: offsetX1, y1: offsetY1,
  1971 + x2: x, y2: y,
  1972 + click: function (layer) {
  1973 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1974 + //jcanvas property
  1975 + layer.draggable = true;
  1976 + $rootScope.canvasLayerNameCollection = [];
  1977 + $rootScope.canvasLayerNameCollection.push(layer.name);
  1978 + $(canvasId).setLayer(layer.name, {
  1979 + handle: {
  1980 + type: 'arc',
  1981 + fillStyle: '#fff',
  1982 + strokeStyle: '#c33',
  1983 + strokeWidth: 2,
  1984 + radius: 3
  1985 + }
  1986 + }).drawLayers();
  1987 +
  1988 + }
  1989 + else {
  1990 + //jcanvas property
  1991 + layer.draggable = false;
  1992 + }
  1993 + },
  1994 + mouseout: function (layer) {
  1995 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1996 + //jcanvas property
  1997 + layer.draggable = true;
  1998 + $rootScope.canvasLayerNameCollection = [];
  1999 + $(canvasId).setLayer(layer.name, {
  2000 + handle: {
  2001 + type: 'arc',
  2002 + fillStyle: '#fff',
  2003 + strokeStyle: '#c33',
  2004 + strokeWidth: 0,
  2005 + radius: 0
  2006 + }
  2007 +
  2008 + }).drawLayers();
  2009 + }
  2010 + else {
  2011 + //jcanvas property
  2012 + layer.draggable = false;
  2013 + }
  2014 + },
  2015 + mouseover: function (layer) {
  2016 +
  2017 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2018 + //jcanvas property
  2019 + layer.draggable = true;
  2020 +
  2021 + $(canvasId).setLayer(layer.name, {
  2022 + handle: {
  2023 + type: 'arc',
  2024 + fillStyle: '#fff',
  2025 + strokeStyle: '#c33',
  2026 + strokeWidth: 2,
  2027 + radius: 3
  2028 + }
  2029 + }).drawLayers();
  2030 + }
  2031 + else {
  2032 + //jcanvas property
  2033 + layer.draggable = false;
  2034 + }
  2035 + }
  2036 +
  2037 + }).drawLayers();
  2038 +
  2039 + }
  2040 +
  2041 +
  2042 + $('.btnCursor').trigger('click');
  2043 + $(".btn-annotation").removeClass("activebtncolor");
  2044 + $('.btnCursor').addClass('activebtncolor');
  2045 + }
  2046 + $rootScope.jcanvasObjectArray = [];
  2047 + $rootScope.DrawRectangleOnModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
  2048 + if ($rootScope.isRectanglePreviewCompleted == true) {
  2049 + $rootScope.isRectanglePreviewCompleted = false;
  2050 + $(canvasId).addLayer({
  2051 + layer: true,
  2052 + name: 'Rect_' + RectNumber,
  2053 + fillStyle: shapestyleFillColor,
  2054 + type: 'rectangle',
  2055 + draggable: true,
  2056 + strokeStyle: shapestyleborderColor,
  2057 + opacity: shapestyleOpacity,
  2058 + strokeWidth: shapestyleborderWidth,
  2059 + fromCenter: false,
  2060 + x: offsetX1, y: offsetY1,
  2061 + width: Math.abs(x - offsetX1),
  2062 + height: Math.abs(y - offsetY1),
  2063 + resizeFromCenter: false,
  2064 + add: function (layer) {
  2065 + if ($location.path() == "/module-item-view") {
  2066 + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
  2067 + }
  2068 + },
  2069 + dragstop: function (layer) {
  2070 + if ($location.path() == "/module-item-view") {
  2071 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  2072 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  2073 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  2074 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  2075 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  2076 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  2077 + }
  2078 + }
  2079 + }
  2080 + },
  2081 + change: function (layer) {
  2082 + if ($location.path() == "/module-item-view") {
  2083 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  2084 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  2085 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  2086 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  2087 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  2088 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  2089 + }
  2090 + }
  2091 + }
  2092 + },
  2093 + click: function (layer) {
  2094 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2095 + //jcanvas property
  2096 + layer.draggable = true;
  2097 + $rootScope.canvasLayerNameCollection = [];
  2098 + $rootScope.canvasLayerNameCollection.push(layer.name);
  2099 + $(canvasId).setLayer(layer.name, {
  2100 + handle: {
  2101 + type: 'rectangle',
  2102 + fillStyle: '#fff',
  2103 + strokeStyle: '#c33',
  2104 + strokeWidth: 2,
  2105 + width: 5, height: 5,
  2106 + cornerRadius: 3,
  2107 + }
  2108 + }).drawLayers();
  2109 + }
  2110 + else {
  2111 + //jcanvas property
  2112 + layer.draggable = false;
  2113 + }
  2114 + },
  2115 + mouseout: function (layer) {
  2116 +
  2117 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2118 + //jcanvas property
  2119 + layer.draggable = true;
  2120 + $rootScope.canvasLayerNameCollection = [];
  2121 + $(canvasId).setLayer(layer.name, {
  2122 + handle: {
  2123 + type: 'rectangle',
  2124 + fillStyle: 'pink',
  2125 + strokeStyle: 'yellow',
  2126 + strokeWidth: 0,
  2127 + width: 0, height: 0,
  2128 + cornerRadius: 0,
  2129 + }
  2130 +
  2131 + }).drawLayers();
  2132 + }
  2133 + else {
  2134 + //jcanvas property
  2135 + layer.draggable = false;
  2136 + }
  2137 + },
  2138 + mouseover: function (layer) {
  2139 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2140 + //jcanvas property
  2141 + layer.draggable = true;
  2142 +
  2143 + $(canvasId).setLayer(layer.name, {
  2144 + handle: {
  2145 + type: 'rectangle',
  2146 + fillStyle: '#fff',
  2147 + strokeStyle: '#c33',
  2148 + strokeWidth: 2,
  2149 + width: 5, height: 5,
  2150 + cornerRadius: 3,
  2151 + }
  2152 + }).drawLayers();
  2153 + }
  2154 + else {
  2155 + //jcanvas property
  2156 + layer.draggable = false;
  2157 + }
  2158 + }
  2159 + }).drawLayers();
  2160 + }
  2161 + $('.btnCursor').trigger('click');
  2162 + $(".btn-annotation").removeClass("activebtncolor");
  2163 + $('.btnCursor').addClass('activebtncolor');
  2164 +
  2165 + }
  2166 +
  2167 + $rootScope.DrawCircleOnModuleItem = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) {
  2168 +
  2169 + if ($rootScope.isCirclePreviewCompleted == true) {
  2170 + $rootScope.isCirclePreviewCompleted = false;
  2171 + $(canvasId).addLayer({
  2172 + layer: true,
  2173 + name: 'Circle_' + CircleNumber,
  2174 + type: 'ellipse',
  2175 + opacity: shapestyleOpacity,
  2176 + draggable: true,
  2177 + strokeStyle: shapestyleborderColor,
  2178 + strokeWidth: shapestyleborderWidth,
  2179 + fillStyle: shapestyleFillColor,
  2180 + fromCenter: false,
  2181 + x: (offsetX1), y: (offsetY1),
  2182 + //added abs
  2183 + width: Math.abs(x - offsetX1), height: Math.abs(y - offsetY1),
  2184 + // Place a handle at each side and each corner
  2185 + resizeFromCenter: false,
  2186 + handlePlacement: 'both',
  2187 +
  2188 + add: function (layer) {
  2189 +
  2190 + if ($location.path() == "/module-item-view") {
  2191 + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
  2192 + }
  2193 + },
  2194 + dragstop: function (layer) {
  2195 +
  2196 + if ($location.path() == "/module-item-view") {
  2197 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  2198 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  2199 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  2200 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  2201 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  2202 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  2203 + }
  2204 + }
  2205 + }
  2206 + },
  2207 + change: function (layer) {
  2208 + if ($location.path() == "/module-item-view") {
  2209 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  2210 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  2211 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  2212 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  2213 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  2214 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  2215 + }
  2216 + }
  2217 + }
  2218 + },
  2219 + click: function (layer) {
  2220 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2221 + //jcanvas property
  2222 + layer.draggable = true;
  2223 + $rootScope.canvasLayerNameCollection = [];
  2224 + $rootScope.canvasLayerNameCollection.push(layer.name);
  2225 + $(canvasId).setLayer(layer.name, {
  2226 + handle: {
  2227 + type: 'arc',
  2228 + fillStyle: '#fff',
  2229 + strokeStyle: '#c33',
  2230 + strokeWidth: 2,
  2231 + radius: 3
  2232 + }
  2233 + }).drawLayers();
  2234 + }
  2235 + else {
  2236 + //jcanvas property
  2237 + layer.draggable = false;
  2238 + }
  2239 + },
  2240 + mouseout: function (layer) {
  2241 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2242 + //jcanvas property
  2243 + layer.draggable = true;
  2244 + $rootScope.canvasLayerNameCollection = [];
  2245 +
  2246 + $(canvasId).setLayer(layer.name, {
  2247 + handle: {
  2248 + type: 'arc',
  2249 + fillStyle: '#fff',
  2250 + strokeStyle: '#c33',
  2251 + strokeWidth: 0,
  2252 + // width: 0, height: 0,
  2253 + radius: 0
  2254 + }
  2255 +
  2256 + }).drawLayers();
  2257 + }
  2258 + else {
  2259 + layer.draggable = false;
  2260 + }
  2261 + },
  2262 + mouseover: function (layer) {
  2263 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2264 + //jcanvas property
  2265 + layer.draggable = true;
  2266 +
  2267 + $(canvasId).setLayer(layer.name, {
  2268 + handle: {
  2269 + type: 'arc',
  2270 + fillStyle: '#fff',
  2271 + strokeStyle: '#c33',
  2272 + strokeWidth: 2,
  2273 + // width: 5, height: 5,
  2274 + radius: 3,
  2275 + }
  2276 + }).drawLayers();
  2277 + }
  2278 + else {
  2279 + //jcanvas property
  2280 + layer.draggable = false;
  2281 + }
  2282 + }
  2283 + }).drawLayers();
  2284 + }
  2285 + $('.btnCursor').trigger('click');
  2286 + $(".btn-annotation").removeClass("activebtncolor");
  2287 + $('.btnCursor').addClass('activebtncolor');
  2288 + }
  2289 +
  2290 + $rootScope.DrawArrowOnModuleItem = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
  2291 + if ($rootScope.isArrowPreviewCompleted == true) {
  2292 + $rootScope.isArrowPreviewCompleted = false;
  2293 + $('#canvas').drawLine({
  2294 + layer: true,
  2295 + name: 'Arrow_' + ArrowNumber,
  2296 + draggable: true,
  2297 + strokeStyle: shapestyleborderColor,
  2298 + strokeWidth: shapestyleborderWidth,
  2299 + rounded: true,
  2300 + startArrow: true,
  2301 + arrowRadius: 7,
  2302 + arrowAngle: 90,
  2303 + x1: offsetX1, y1: offsetY1,
  2304 + x2: x, y2: y,
  2305 +
  2306 + click: function (layer) {
  2307 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2308 + //jcanvas property
  2309 + layer.draggable = true;
  2310 + $rootScope.canvasLayerNameCollection = [];
  2311 + $rootScope.canvasLayerNameCollection.push(layer.name);
  2312 + $(canvasId).setLayer(layer.name, {
  2313 + handle: {
  2314 + type: 'arc',
  2315 + fillStyle: '#fff',
  2316 + strokeStyle: '#c33',
  2317 + strokeWidth: 2,
  2318 + // width: 5, height: 5,
  2319 + radius: 3
  2320 + }
  2321 + }).drawLayers();
  2322 + // $("#canvas").removeLayer(layer.name).drawLayers();
  2323 + }
  2324 + else {
  2325 + //jcanvas property
  2326 + layer.draggable = false;
  2327 + }
  2328 +
  2329 + },
  2330 + mouseout: function (layer) {
  2331 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2332 + //jcanvas property
  2333 + layer.draggable = true;
  2334 + $rootScope.canvasLayerNameCollection = [];
  2335 + $(canvasId).setLayer(layer.name, {
  2336 + handle: {
  2337 + type: 'arc',
  2338 + fillStyle: '#fff',
  2339 + strokeStyle: '#c33',
  2340 + strokeWidth: 0,
  2341 + // width: 0, height: 0,
  2342 + radius: 0
  2343 + }
  2344 +
  2345 + }).drawLayers();
  2346 + }
  2347 + else {
  2348 + //jcanvas property
  2349 + layer.draggable = false;
  2350 + }
  2351 + },
  2352 + mouseover: function (layer) {
  2353 +
  2354 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2355 + //jcanvas property
  2356 + layer.draggable = true;
  2357 + $(canvasId).setLayer(layer.name, {
  2358 + handle: {
  2359 + type: 'arc',
  2360 + fillStyle: '#fff',
  2361 + strokeStyle: '#c33',
  2362 + strokeWidth: 2,
  2363 + // width: 5, height: 5,
  2364 + radius: 3
  2365 + }
  2366 + }).drawLayers();
  2367 + }
  2368 + else {
  2369 + //jcanvas property
  2370 + layer.draggable = false;
  2371 + }
  2372 + }
  2373 +
  2374 + });
  2375 + }
  2376 +
  2377 + $('.btnCursor').trigger('click');
  2378 + $(".btn-annotation").removeClass("activebtncolor");
  2379 + $('.btnCursor').addClass('activebtncolor');
  2380 + }
  2381 +
  2382 + $rootScope.DrawPinOnModuleItem = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) {
  2383 +
  2384 + if ($rootScope.isPinPreviewCompleted == true) {
  2385 + $rootScope.isPinPreviewCompleted = false;
  2386 + var radial = $('#canvas').createGradient({
  2387 + x1: 50, y1: 50,
  2388 + x2: 50, y2: 50,
  2389 + r1: 10, r2: 30,
  2390 + c1: 'rgba(100, 50, 0,0)',
  2391 + c2: 'grey'
  2392 + });
  2393 + $(canvasId).drawLine({
  2394 + draggable: true,
  2395 + layer: true,
  2396 + name: "Pin_" + PinNumber,
  2397 + groups: ["Pin_" + PinNumber],
  2398 + dragGroups: ["Pin_" + PinNumber],
  2399 + strokeStyle: 'black',
  2400 + strokeWidth: 2,
  2401 + x1: offsetX1, y1: offsetY1,
  2402 + x2: x, y2: y,
  2403 +
  2404 + click: function (layer) {
  2405 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2406 + //jcanvas property
  2407 + layer.draggable = true;
  2408 + $rootScope.shapeTypePin = "Pin";
  2409 + $rootScope.canvasLayerNameCollection = [];
  2410 + var pinLine_layer = layer.name;
  2411 + var pinLine_layer_split = pinLine_layer.split("_");
  2412 + var pinArcName = "ArcPin_";
  2413 + var pinResult = pinArcName.concat(pinLine_layer_split[1]);
  2414 +
  2415 + $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult });
  2416 +
  2417 + $(canvasId).setLayer(layer.name, {
  2418 + handle: {
  2419 + type: 'arc',
  2420 + fillStyle: '#fff',
  2421 + strokeStyle: '#c33',
  2422 + strokeWidth: 2,
  2423 + // width: 5, height: 5,
  2424 + radius: 3
  2425 + }
  2426 + }).drawLayers();
  2427 +
  2428 + }
  2429 + else {
  2430 + //jcanvas property
  2431 + layer.draggable = false;
  2432 + }
  2433 + },
  2434 + mouseout: function (layer) {
  2435 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2436 + //jcanvas property
  2437 + layer.draggable = true;
  2438 + $rootScope.canvasLayerNameCollection = [];
  2439 + $(canvasId).setLayer(layer.name, {
  2440 + handle: {
  2441 + type: 'arc',
  2442 + fillStyle: '#fff',
  2443 + strokeStyle: '#c33',
  2444 + strokeWidth: 0,
  2445 + // width: 0, height: 0,
  2446 + radius: 0
  2447 + }
  2448 +
  2449 + }).drawLayers();
  2450 + }
  2451 + else {
  2452 + //jcanvas property
  2453 + layer.draggable = false;
  2454 + }
  2455 + },
  2456 + mouseover: function (layer) {
  2457 +
  2458 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2459 + //jcanvas property
  2460 + layer.draggable = true;
  2461 + $(canvasId).setLayer(layer.name, {
  2462 + handle: {
  2463 + type: 'arc',
  2464 + fillStyle: '#fff',
  2465 + strokeStyle: '#c33',
  2466 + strokeWidth: 2,
  2467 + // width: 5, height: 5,
  2468 + radius: 3
  2469 + }
  2470 + }).drawLayers();
  2471 + }
  2472 + else {
  2473 + //jcanvas property
  2474 + layer.draggable = false;
  2475 + }
  2476 + }
  2477 + }).drawArc({
  2478 + draggable: true,
  2479 + name: "ArcPin_" + PinArcNumber,
  2480 + // name: "Pin_" + $rootScope.resetPin,
  2481 + layer: true,
  2482 + groups: ["Pin_" + PinNumber],
  2483 + dragGroups: ["Pin_" + PinNumber],
  2484 + strokeStyle: 'grey',
  2485 + strokeWidth: 2,
  2486 + fillStyle: radial,
  2487 + x: offsetX1, y: offsetY1,
  2488 + radius: 5,
  2489 +
  2490 +
  2491 + add: function (layer) {
  2492 +
  2493 + $rootScope.PinArcNumber = layer.name;
  2494 + // $scope.arr = [];
  2495 +
  2496 +
  2497 + },
  2498 +
  2499 + }).drawLayers();
  2500 + }
  2501 +
  2502 +
  2503 + $('.btnCursor').trigger('click');
  2504 + $(".btn-annotation").removeClass("activebtncolor");
  2505 + $('.btnCursor').addClass('activebtncolor');
  2506 + }
  2507 + var isDoubleTouch = null;
  2508 + $rootScope.TextEditorFunctionality = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) {
  2509 + if ($rootScope.isTextAreaPreviewCompleted == true) {
  2510 + $rootScope.isTextAreaPreviewCompleted = false;
  2511 + $('#canvas').drawText({
  2512 + layer: true,
  2513 + draggable: true,
  2514 + // opacity: $rootScope.shapestyleOpacity,
  2515 + name: 'TextArea_' + $rootScope.TextNumber,
  2516 + groups: ['TextArea_' + $rootScope.TextNumber],
  2517 + dragGroups: ['TextArea_' + $rootScope.TextNumber],
  2518 + fillStyle: '#36c',
  2519 + strokeWidth: 0,
  2520 + x: $rootScope.offsetX1, y: $rootScope.offsetY1,
  2521 + fromCenter: false,
  2522 + fontSize: '14pt',
  2523 + align: "left",
  2524 + fontFamily: 'Verdana, sans-serif',
  2525 + text: '',
  2526 + add: function (layer) {
  2527 +
  2528 + $rootScope.TextID = layer.name;
  2529 + }
  2530 +
  2531 +
  2532 + })
  2533 + // Draw rect as wide as the text
  2534 + .drawRect({
  2535 + layer: true,
  2536 + name: "TextRect_" + $rootScope.TextNumber,
  2537 + dragGroups: ['shapes'],
  2538 + opacity: $rootScope.shapestyleOpacity,
  2539 + strokeStyle: $rootScope.shapestyleborderColor,
  2540 + fromCenter: false,
  2541 + strokeWidth: $rootScope.shapestyleborderWidth,
  2542 + fillStyle: $rootScope.shapestyleFillColor,
  2543 + x: $rootScope.offsetX1, y: $rootScope.offsetY1,
  2544 + width: Math.abs($rootScope.x - $rootScope.offsetX1),
  2545 + height: Math.abs($rootScope.y - $rootScope.offsetY1),
  2546 + resizeFromCenter: false,
  2547 + add: function (layer) {
  2548 +
  2549 + $rootScope.TextAreaRectID = layer.name;
  2550 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  2551 +
  2552 + if ($location.path() == "/module-item-view") {
  2553 + $rootScope.initialTextAreaName = layer.name;
  2554 + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
  2555 + }
  2556 +
  2557 + },
  2558 +
  2559 + dragstop: function (layer) {
  2560 +
  2561 + if ($location.path() == "/module-item-view") {
  2562 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  2563 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  2564 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  2565 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  2566 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  2567 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  2568 + }
  2569 + }
  2570 + }
  2571 + },
  2572 + change: function (layer) {
  2573 + if ($location.path() == "/module-item-view") {
  2574 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  2575 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  2576 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  2577 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  2578 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  2579 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  2580 + }
  2581 + }
  2582 + }
  2583 + },
  2584 +
  2585 + click: function (layer) {
  2586 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2587 + //jcanvas property
  2588 + layer.draggable = true;
  2589 + $rootScope.canvasLayerNameCollection = [];
  2590 + $rootScope.canvasLayerNameCollection.push(layer.name);
  2591 + $('#canvas').setLayer(layer.name, {
  2592 + handle: {
  2593 + type: 'rectangle',
  2594 + fillStyle: '#fff',
  2595 + strokeStyle: '#c33',
  2596 + strokeWidth: 2,
  2597 + width: 5, height: 5,
  2598 + cornerRadius: 3,
  2599 +
  2600 + }
  2601 + }).drawLayers();
  2602 + }
  2603 + else {
  2604 + //jcanvas property
  2605 + layer.draggable = false;
  2606 + }
  2607 + },
  2608 + dblclick: function (layer) {
  2609 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2610 + //jcanvas property
  2611 + layer.draggable = true;
  2612 + $rootScope.IsTextAlreadySave = false;
  2613 + var RectNameArray = (layer.name).split("_");
  2614 +
  2615 + var TextAreaRectangleName = "TextArea_";
  2616 + var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
  2617 + $rootScope.TextAreaRectID = layer.name;
  2618 + $rootScope.TextID = TextAreaRectNameConcat;
  2619 +
  2620 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  2621 + $("#annotationTextModal").css("padding-right", "0px");
  2622 + document.getElementById('modelbackground').style.display = "block";
  2623 + $("#annotationTextModal").modal("toggle");
  2624 +
  2625 + $("#text_area").val('');
  2626 + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  2627 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  2628 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  2629 +
  2630 + $("#selected-font-family option:eq(0)").prop('selected', true);
  2631 + $("#selected-font-size option:eq(0)").prop('selected', true);
  2632 +
  2633 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  2634 +
  2635 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  2636 +
  2637 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  2638 +
  2639 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  2640 +
  2641 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  2642 +
  2643 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  2644 + }
  2645 + else {
  2646 + //jcanvas property
  2647 + layer.draggable = false;
  2648 + }
  2649 + },
  2650 + touchstart: function (layer)
  2651 + {
  2652 + if (isDoubleTouch == null) {
  2653 + isDoubleTouch = setTimeout(function () {
  2654 + isDoubleTouch = null;
  2655 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2656 + //jcanvas property
  2657 + layer.draggable = true;
  2658 + $rootScope.canvasLayerNameCollection = [];
  2659 + $rootScope.canvasLayerNameCollection.push(layer.name);
  2660 + $('#canvas').setLayer(layer.name, {
  2661 + handle: {
  2662 + type: 'rectangle',
  2663 + fillStyle: '#fff',
  2664 + strokeStyle: '#c33',
  2665 + strokeWidth: 2,
  2666 + width: 5, height: 5,
  2667 + cornerRadius: 3,
  2668 +
  2669 + }
  2670 + }).drawLayers();
  2671 + }
  2672 + else {
  2673 + //jcanvas property
  2674 + layer.draggable = false;
  2675 + }
  2676 +
  2677 + }, 1000)
  2678 + } else {
  2679 + clearTimeout(isDoubleTouch);
  2680 + isDoubleTouch = null;
  2681 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2682 + //jcanvas property
  2683 + layer.draggable = true;
  2684 + $rootScope.IsTextAlreadySave = false;
  2685 + var RectNameArray = (layer.name).split("_");
  2686 +
  2687 + var TextAreaRectangleName = "TextArea_";
  2688 + var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
  2689 + $rootScope.TextAreaRectID = layer.name;
  2690 + $rootScope.TextID = TextAreaRectNameConcat;
  2691 +
  2692 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  2693 + $("#annotationTextModal").css("padding-right", "0px");
  2694 + document.getElementById('modelbackground').style.display = "block";
  2695 + $("#annotationTextModal").modal("toggle");
  2696 +
  2697 + $("#text_area").val('');
  2698 + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  2699 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  2700 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  2701 +
  2702 + $("#selected-font-family option:eq(0)").prop('selected', true);
  2703 + $("#selected-font-size option:eq(0)").prop('selected', true);
  2704 +
  2705 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  2706 +
  2707 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  2708 +
  2709 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  2710 +
  2711 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  2712 +
  2713 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  2714 +
  2715 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  2716 + }
  2717 + else {
  2718 + //jcanvas property
  2719 + layer.draggable = false;
  2720 + }
  2721 +
  2722 + }
  2723 + },
  2724 + mouseout: function (layer) {
  2725 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2726 + //jcanvas property
  2727 + layer.draggable = true;
  2728 + $rootScope.canvasLayerNameCollection = [];
  2729 + $('#canvas').setLayer(layer.name, {
  2730 + handle: {
  2731 + type: 'rectangle',
  2732 + fillStyle: 'pink',
  2733 + strokeStyle: 'yellow',
  2734 + strokeWidth: 0,
  2735 + width: 0, height: 0,
  2736 + cornerRadius: 0
  2737 + }
  2738 +
  2739 + }).drawLayers();
  2740 + }
  2741 + else {
  2742 + //jcanvas property
  2743 + layer.draggable = false;
  2744 + }
  2745 + },
  2746 + mouseover: function (layer) {
  2747 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  2748 + //jcanvas property
  2749 + layer.draggable = true;
  2750 + $('#canvas').setLayer(layer.name, {
  2751 + handle: {
  2752 + type: 'rectangle',
  2753 + fillStyle: '#fff',
  2754 + strokeStyle: '#c33',
  2755 + strokeWidth: 2,
  2756 + width: 5, height: 5,
  2757 + cornerRadius: 3,
  2758 + }
  2759 + }).drawLayers();
  2760 +
  2761 + }
  2762 + else {
  2763 + //jcanvas property
  2764 + layer.draggable = false;
  2765 + }
  2766 + }
  2767 + });
  2768 +
  2769 + // Annotation: Edit Text option is missing.
  2770 + $("#annotationTextModal").css("padding-right", "0px");
  2771 + $("#annotationTextModal").modal("toggle");
  2772 + document.getElementById('modelbackground').style.display = "block";
  2773 +
  2774 + }
  2775 + $('.btnCursor').trigger('click');
  2776 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  2777 +
  2778 + $("#text_area").val('');
  2779 +
  2780 + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  2781 +
  2782 + $("#selected-font-family option:eq(0)").prop('selected', true);
  2783 + $("#selected-font-size option:eq(0)").prop('selected', true);
  2784 +
  2785 + // $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  2786 +
  2787 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  2788 +
  2789 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  2790 +
  2791 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  2792 +
  2793 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  2794 +
  2795 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  2796 +
  2797 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  2798 +
  2799 + $(".btn-annotation").removeClass("activebtncolor");
  2800 +
  2801 + $('.btnCursor').addClass('activebtncolor');
  2802 +
  2803 + }
  2804 +
  2805 +
  2806 +
  2807 + $rootScope.clicked = true;
  2808 + $rootScope.offsetX1 = 0;
  2809 + $rootScope.offsetY1 = 0;
  2810 + $rootScope.x = 0;
  2811 + $rootScope.y = 0;
  2812 + $rootScope.mousePressed = false;
  2813 + $rootScope.lastX; $rootScope.lastY;
  2814 + var ctx;
  2815 + $rootScope.OnPaintCanvasMouseDown = function (event) {
  2816 + event.preventDefault();
  2817 + if ($rootScope.isAnnotatiomToolBarPopupClosed == false) {
  2818 + var canvasElement = document.getElementById("canvas");
  2819 + var ctx = canvasElement.getContext("2d");
  2820 + $rootScope.offsetX1 = 0;
  2821 + $rootScope.offsetY1 = 0;
  2822 + var canvasDiv = document.getElementById('canvasDiv');
  2823 + var verticalScrollPosition = canvasDiv.scrollTop;
  2824 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  2825 + var $ua = navigator.userAgent;
  2826 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  2827 + var verticalScrollPosition = canvasDiv.scrollTop;
  2828 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  2829 + $rootScope.offsetX1 = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
  2830 + $rootScope.offsetY1 = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
  2831 + }
  2832 + else
  2833 + {
  2834 + $rootScope.offsetX1 = event.offsetX;
  2835 + $rootScope.offsetY1 = event.offsetY;
  2836 + }
  2837 + ctx.clearRect(0, 0, 2277, 3248);
  2838 + $rootScope.clicked = true;
  2839 + canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false);
  2840 + canvasElement.addEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove, false);
  2841 + }
  2842 +
  2843 + }
  2844 + $rootScope.rectNumber = 0;
  2845 + $rootScope.LineNumber = 0;
  2846 + $rootScope.CircleNumber = 0;
  2847 + $rootScope.ArrowNumber = 0;
  2848 + $rootScope.PinNumber = 0;
  2849 + $rootScope.PinArcNumber = 0;
  2850 + $rootScope.ObjectIndex = 0;
  2851 + $rootScope.ArcObjectIndex = 0;
  2852 + $rootScope.PinObjectIndex = 0;
  2853 + $rootScope.TextNumber = 0;
  2854 + $rootScope.resetTextSave = 0;
  2855 + $rootScope.ObjectIndexSave = 0;
  2856 +
  2857 + var arrayRect = {};
  2858 +
  2859 + var storeLine = '';
  2860 +
  2861 + $rootScope.OnPaintCanvasMouseUp = function (event) {
  2862 + event.preventDefault();
  2863 + if (!$rootScope.clicked) {
  2864 + return;
  2865 + }
  2866 + if ($rootScope.isAnnotatiomToolBarPopupClosed == false) {
  2867 + var AnnotationCanvas = document.getElementById('canvas');
  2868 + AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false);
  2869 + AnnotationCanvas.removeEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove, false);
  2870 +
  2871 + $(".line").remove();
  2872 + $(".arrow").remove();
  2873 + $(".pin").remove();
  2874 + $(".circle").remove();
  2875 + $(".rectangle").remove();
  2876 + $(".textarea").remove();
  2877 + $rootScope.clicked = false;
  2878 + $rootScope.x = 0;
  2879 + $rootScope.y = 0;
  2880 + var canvasDiv = document.getElementById('canvasDiv');
  2881 + var verticalScrollPosition = canvasDiv.scrollTop;
  2882 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  2883 + $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
  2884 + $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
  2885 + var canvasElement = document.getElementById("canvas");
  2886 + var ctx = canvasElement.getContext("2d");
  2887 + var canvasPaintElement = document.getElementById("canvasPaint");
  2888 + var PaintCanvasctx = canvasPaintElement.getContext("2d");
  2889 + switch ($rootScope.shapeType) {
  2890 + case "cursor":
  2891 + ctx.beginPath();
  2892 + PaintCanvasctx.beginPath();
  2893 + break;
  2894 + case "Line":
  2895 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  2896 + $rootScope.LineNumber = $rootScope.ObjectIndex++;
  2897 + // $rootScope.isLinePreviewCompleted = true;
  2898 + $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y)
  2899 + break;
  2900 + case "Rectangle":
  2901 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  2902 + $rootScope.rectNumber = $rootScope.ObjectIndex++;
  2903 + // $rootScope.isRectanglePreviewCompleted = true;
  2904 + $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
  2905 +
  2906 + break;
  2907 + case "Circle":
  2908 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  2909 + $rootScope.CircleNumber = $rootScope.ObjectIndex++;
  2910 + // $rootScope.isCirclePreviewCompleted = true;
  2911 + $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
  2912 + break;
  2913 + case "Arrow":
  2914 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  2915 + $rootScope.ArrowNumber = $rootScope.ObjectIndex++;
  2916 + //$rootScope.isArrowPreviewCompleted = true;
  2917 + $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
  2918 + break;
  2919 + case "Pin":
  2920 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  2921 + $rootScope.PinNumber = $rootScope.PinObjectIndex++;
  2922 + $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++;
  2923 +
  2924 + //$rootScope.isPinPreviewCompleted = true;
  2925 +
  2926 + $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber);
  2927 + break;
  2928 + case "TextArea":
  2929 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
  2930 + $rootScope.IsTextAlreadySave = false;
  2931 + $("#text_area").val('');
  2932 + // Draw text
  2933 + $rootScope.resetTextRect = $rootScope.ObjectIndex++;
  2934 + $rootScope.TextNumber = $rootScope.ObjectIndex++;
  2935 + // $rootScope.isTextAreaPreviewCompleted = true;
  2936 + $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y);
  2937 + break;
  2938 + case "DrawPolygon":
  2939 + break;
  2940 +
  2941 + }
  2942 + }
  2943 + //}
  2944 +
  2945 + }
  2946 + $rootScope.OnPaintCanvasMouseMove = function (event) {
  2947 + event.preventDefault();
  2948 + var canvasDiv = document.getElementById('canvasDiv');
  2949 + var verticalScrollPosition = canvasDiv.scrollTop;
  2950 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  2951 + $rootScope.MouseMoveXAxis = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
  2952 + $rootScope.MouseMoveYAxis = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
  2953 + switch ($rootScope.shapeType) {
  2954 + case "Line":
  2955 + $(".line").remove();
  2956 + $rootScope.isLinePreviewCompleted = true;
  2957 + $("#canvasDiv").append("<div class='line' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
  2958 + $rootScope.Annotationangle();
  2959 + break;
  2960 + case "Arrow":
  2961 + $(".arrow").remove();
  2962 + $rootScope.isArrowPreviewCompleted = true;
  2963 + $("#canvasDiv").append("<div class='arrow' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='border-bottom: 9px solid transparent;border-right: 12px dashed #ccc;border-top: 7px solid transparent;height: 0;left: -6px;position: absolute;top: -8px;width: 0;'></div></div>");
  2964 + $rootScope.Annotationangle();
  2965 + break;
  2966 + case "Pin":
  2967 + $(".pin").remove();
  2968 + $rootScope.isPinPreviewCompleted = true;
  2969 + $("#canvasDiv").append("<div class='pin' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='background-color:#fff;left: -8px;position: absolute;top: -6px;width: 10;height:12px;width:12px;border:2px dashed #808080;border-radius:50%;'></div></div>");
  2970 + $rootScope.Annotationangle();
  2971 + break;
  2972 + case "Circle":
  2973 + $(".circle").remove();
  2974 + $rootScope.isCirclePreviewCompleted = true;
  2975 + $("#canvasDiv").append("<div class='circle' style='z-index:12001;border-radius:50%;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
  2976 + break;
  2977 + case "Rectangle":
  2978 + $(".rectangle").remove();
  2979 + $rootScope.isRectanglePreviewCompleted = true;
  2980 + $("#canvasDiv").append("<div class='rectangle' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
  2981 + break;
  2982 + case "TextArea":
  2983 + $(".textarea").remove();
  2984 + $rootScope.isTextAreaPreviewCompleted = true;
  2985 + $("#canvasDiv").append("<div class='textarea' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
  2986 + break;
  2987 +
  2988 + }
  2989 + }
  2990 + $rootScope.Annotationangle = function (event) {
  2991 + var dy = $rootScope.MouseMoveYAxis - $rootScope.offsetY1;
  2992 + var dx = $rootScope.MouseMoveXAxis - $rootScope.offsetX1;
  2993 + var theta = 0;
  2994 + if (dx < 0) {
  2995 + theta = Math.atan(dy / dx) * (180 / Math.PI);
  2996 + theta = theta + 180;
  2997 + }
  2998 + else if (dy < 0) {
  2999 + theta = Math.atan(dy / dx) * (180 / Math.PI);
  3000 + theta = theta + 360;
  3001 + }
  3002 + else {
  3003 + theta = Math.atan(dy / dx) * (180 / Math.PI);
  3004 + }
  3005 + var dottedLineWidth = Math.sqrt(($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) * ($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) + ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis) * ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis));
  3006 + switch ($rootScope.shapeType) {
  3007 + case "Line":
  3008 + $('.line').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  3009 + break;
  3010 + case "Arrow":
  3011 + $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  3012 + break;
  3013 + case "Pin":
  3014 + $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  3015 + break;
  3016 + }
  3017 + }
  3018 + $rootScope.iniiaTextAreaValues = [];
  3019 + $rootScope.initTextAreaValues = [];
  3020 + ///-----
  3021 +
  3022 + var isDoubleTouchSaveText = null;
  3023 + var isDoubleTouchSaveTextAgain = null;
  3024 + $rootScope.saveText = function () {
  3025 +
  3026 + document.getElementById('modelbackground').style.display = "none";
  3027 + $rootScope.selectedBGColorForTextArea = $("#drawTextBGColorpicker span.minicolors-swatch-color").css('background-color');
  3028 +
  3029 +
  3030 +
  3031 +
  3032 + // this part will work first time when save button will be clicked
  3033 + if ($rootScope.IsTextAlreadySave == false) {
  3034 +
  3035 +
  3036 + if ($location.path() == "/module-item-view") {
  3037 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  3038 + if ($rootScope.jcanvasObjectArray[i].name == $rootScope.initialTextAreaName) {
  3039 + $rootScope.jcanvasObjectArray.splice(i, 1);
  3040 + $rootScope.initialTextAreaName = '';
  3041 + }
  3042 + }
  3043 + }
  3044 +
  3045 +
  3046 +
  3047 + // getting textarea style properties
  3048 + $rootScope.fontSizes = $("#text_area").css("font-size");
  3049 + $rootScope.fontWeight = $("#text_area").css("font-weight");
  3050 + $rootScope.fontStyle = $("#text_area").css("font-style");
  3051 + $rootScope.textAlignmt = $("#text_area").css("text-align");
  3052 + $rootScope.fontColor = $("#text_area").css("color");
  3053 + $rootScope.fontFamily = $("#text_area").css("font-family");
  3054 + $rootScope.underlineText = $("#text_area").css("text-decoration");
  3055 + $rootScope.textArea = $("#text_area").val();
  3056 +
  3057 +
  3058 + // code for horizonatl text going out
  3059 + if (/\s/.test($rootScope.textArea)) {
  3060 +
  3061 + }
  3062 + else
  3063 + {
  3064 + var contentWidthArray = [];
  3065 + var contentWidth = Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width);
  3066 + $("#atTextDiv").css({ "width": contentWidth, "font-size": $rootScope.fontSizes});
  3067 + var text = $rootScope.textArea;
  3068 + $("#textspan").empty();
  3069 + $("#duptextspan").empty();
  3070 + for (var i = 0; i <= text.length - 1; i++) {
  3071 + if (contentWidthArray.length > 0) {
  3072 + if (parseInt(contentWidthArray[0]) < $("#atTextDiv").width()) {
  3073 + $("#duptextspan").append(text[i]);
  3074 + $("#textspan").append(text[i]);
  3075 + contentWidthArray = [];
  3076 + contentWidthArray.push(Math.ceil($("#textspan").width()));
  3077 + }
  3078 + else {
  3079 + contentWidthArray = [];
  3080 + $("#duptextspan").append("\r\n");
  3081 + $("#textspan").append("\r\n");
  3082 + $("#duptextspan").append(text[i]);
  3083 + $("#textspan").text('');
  3084 + $("#textspan").append(text[i]);
  3085 + contentWidthArray.push(Math.ceil($("#textspan").width()));
  3086 +
  3087 + }
  3088 + }
  3089 + else {
  3090 + $("#duptextspan").text(text[i]);
  3091 + $("#textspan").text(text[i]);
  3092 + contentWidthArray = [];
  3093 + contentWidthArray.push(Math.ceil($("#textspan").width()));
  3094 + }
  3095 + }
  3096 + $rootScope.textArea = $("#duptextspan").text();
  3097 + console.log($rootScope.textArea);
  3098 + }
  3099 + // code for horizonatl text going out
  3100 +
  3101 +
  3102 +
  3103 +
  3104 + // deleting previous text area
  3105 + $("#canvas").removeLayer($rootScope.TextID).drawLayers();
  3106 + $("#canvas").removeLayer($rootScope.TextAreaRectID).drawLayers();
  3107 + // Text After Saving in Rectangle
  3108 + $rootScope.resetTextRect = $rootScope.ObjectIndex++;
  3109 +
  3110 + $('#canvas').drawRect({
  3111 + name: 'TextArea1_' + $rootScope.resetTextRect,
  3112 + layer: true,
  3113 + draggable: true,
  3114 + groups: ['TextAreaNew_' + $rootScope.resetTextRect],
  3115 + dragGroups: ['TextAreaNew_' + $rootScope.resetTextRect],
  3116 + opacity: $rootScope.shapestyleOpacity,
  3117 + strokeStyle: $rootScope.shapestyleborderColor,
  3118 + strokeWidth: $rootScope.shapestyleborderWidth,
  3119 + fillStyle: $rootScope.selectedBGColorForTextArea,
  3120 + fromCenter: false,
  3121 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  3122 + width: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
  3123 + height: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
  3124 + resizeFromCenter: false,
  3125 + add: function (layer) {
  3126 + var TextAreaLayerName = layer.name;
  3127 + var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
  3128 + $rootScope.postFixLayerNumber = TextAreaLayerNameAftrSplit[1];
  3129 + $rootScope.iniiaTextAreaValues.push({ "name": layer.name, "width": layer.width, "height": layer.height });
  3130 + if ($location.path() == "/module-item-view") {
  3131 + $rootScope.initialTextAreaName = layer.name;
  3132 + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
  3133 + }
  3134 + },
  3135 + dragstop: function (layer) {
  3136 +
  3137 + if ($location.path() == "/module-item-view") {
  3138 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  3139 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  3140 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  3141 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  3142 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  3143 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  3144 + }
  3145 + }
  3146 + }
  3147 + },
  3148 +
  3149 + click: function (layer) {
  3150 +
  3151 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3152 + //jcanvas property
  3153 + layer.draggable = true;
  3154 + $rootScope.shapeTypeText = "textAreaRect";
  3155 + var layerName = layer.name;
  3156 + var splitedName = layerName.split("_");
  3157 + var textValName = "TextAreaNew_";
  3158 + var concatinateResult = textValName.concat(splitedName[1]);
  3159 + $rootScope.canvasLayerNameCollection = [];
  3160 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  3161 + $('#canvas').setLayer(layer.name, {
  3162 + handle: {
  3163 + type: 'rectangle',
  3164 + fillStyle: '#fff',
  3165 + strokeStyle: '#c33',
  3166 + strokeWidth: 2,
  3167 + width: 5, height: 5,
  3168 + cornerRadius: 3,
  3169 + }
  3170 + }).drawLayers();
  3171 +
  3172 + }
  3173 + else {
  3174 + //jcanvas property
  3175 + layer.draggable = false;
  3176 + }
  3177 + },
  3178 + dblclick: function (layer) {
  3179 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3180 + //jcanvas property
  3181 + layer.draggable = true;
  3182 + $rootScope.isTextAreaClosedButtonActive = false;
  3183 + $rootScope.IsTextAlreadySave = true;
  3184 +
  3185 + var _rectLayerOnSave = layer.name;
  3186 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  3187 + var TextAreaRectName = "TextAreaNew_";
  3188 + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
  3189 +
  3190 + $rootScope.layerNameArr = layer.name;
  3191 + $rootScope.rectTextArr = TextAreaRectNameConcatenated;
  3192 +
  3193 +
  3194 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  3195 +
  3196 + for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
  3197 + if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
  3198 +
  3199 + var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
  3200 + // this line of code replace the line breaks and convert into a single line.
  3201 + textArrVal = textArrVal.replace(/(\r\n)/gm, "");
  3202 +
  3203 + $("#text_area").val(textArrVal);
  3204 + var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
  3205 + var fontWeightProp = fontStyleProp.split(" ");
  3206 +
  3207 + $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
  3208 + $("#text_area").css("font-weight", fontWeightProp[0]);
  3209 + $("#text_area").css("font-style", fontWeightProp[1]);
  3210 + $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
  3211 + $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
  3212 + $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
  3213 + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
  3214 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
  3215 +
  3216 + var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
  3217 + var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
  3218 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  3219 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  3220 +
  3221 + CurrentFontFamily = '';
  3222 + CurrentFontSize = '';
  3223 +
  3224 +
  3225 + if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
  3226 +
  3227 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  3228 +
  3229 + }
  3230 +
  3231 + else {
  3232 +
  3233 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  3234 +
  3235 + }
  3236 +
  3237 + //adding text font weight active class in text edit pop-up
  3238 +
  3239 + if (fontWeightProp[0] == 700) {
  3240 +
  3241 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  3242 +
  3243 + }
  3244 +
  3245 + else {
  3246 +
  3247 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  3248 +
  3249 + }
  3250 +
  3251 + //adding text font style active class in text edit pop-up
  3252 +
  3253 + if (fontWeightProp[1] == "italic") {
  3254 +
  3255 +
  3256 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  3257 + }
  3258 + else {
  3259 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  3260 +
  3261 +
  3262 + }
  3263 +
  3264 + //adding text alignment active class in text edit pop-up
  3265 +
  3266 + if ($rootScope.TextPropertyArray[i].Align == "left") {
  3267 +
  3268 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3269 +
  3270 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3271 +
  3272 + $("#text-left").addClass("ActiveFormattingButtonClass");
  3273 +
  3274 + }
  3275 +
  3276 + else if ($rootScope.TextPropertyArray[i].Align == "right") {
  3277 +
  3278 +
  3279 +
  3280 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3281 +
  3282 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3283 +
  3284 + $("#text-right").addClass("ActiveFormattingButtonClass");
  3285 + }
  3286 +
  3287 + else if ($rootScope.TextPropertyArray[i].Align == "center") {
  3288 +
  3289 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3290 +
  3291 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3292 +
  3293 + $("#text-center").addClass("ActiveFormattingButtonClass");
  3294 +
  3295 + }
  3296 +
  3297 + }
  3298 + else {
  3299 + // alert("no");
  3300 +
  3301 + }
  3302 +
  3303 + }
  3304 +
  3305 +
  3306 + // _rectLayerOnSaveSplitInt = '';
  3307 + textArrVal = '';
  3308 + $("#annotationTextModal").css("padding-right", "0px");
  3309 + document.getElementById('modelbackground').style.display = "block";
  3310 + $("#annotationTextModal").modal("toggle");
  3311 +
  3312 + // $("#selected-font-family").val(CurrentFontFamily);
  3313 + // $("#selected-font-size").val(CurrentFontSize);
  3314 + }
  3315 + else {
  3316 + //jcanvas property
  3317 + layer.draggable = false;
  3318 + }
  3319 +
  3320 + },
  3321 + touchstart: function (layer) {
  3322 +
  3323 + if (isDoubleTouchSaveText == null) {
  3324 + isDoubleTouchSaveText = setTimeout(function () {
  3325 + isDoubleTouchSaveText = null;
  3326 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3327 + //jcanvas property
  3328 + layer.draggable = true;
  3329 + $rootScope.shapeTypeText = "textAreaRect";
  3330 + var layerName = layer.name;
  3331 + var splitedName = layerName.split("_");
  3332 + var textValName = "TextAreaNew_";
  3333 + var concatinateResult = textValName.concat(splitedName[1]);
  3334 + $rootScope.canvasLayerNameCollection = [];
  3335 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  3336 + $('#canvas').setLayer(layer.name, {
  3337 + handle: {
  3338 + type: 'rectangle',
  3339 + fillStyle: '#fff',
  3340 + strokeStyle: '#c33',
  3341 + strokeWidth: 2,
  3342 + width: 5, height: 5,
  3343 + cornerRadius: 3,
  3344 + }
  3345 + }).drawLayers();
  3346 +
  3347 + }
  3348 + else {
  3349 + //jcanvas property
  3350 + layer.draggable = false;
  3351 + }
  3352 +
  3353 + }, 1000)
  3354 + } else {
  3355 + clearTimeout(isDoubleTouchSaveText);
  3356 + isDoubleTouchSaveText = null;
  3357 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3358 + //jcanvas property
  3359 + layer.draggable = true;
  3360 + $rootScope.isTextAreaClosedButtonActive = false;
  3361 + $rootScope.IsTextAlreadySave = true;
  3362 +
  3363 + var _rectLayerOnSave = layer.name;
  3364 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  3365 + var TextAreaRectName = "TextAreaNew_";
  3366 + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
  3367 +
  3368 + $rootScope.layerNameArr = layer.name;
  3369 + $rootScope.rectTextArr = TextAreaRectNameConcatenated;
  3370 +
  3371 +
  3372 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  3373 +
  3374 + for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
  3375 + if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
  3376 +
  3377 + var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
  3378 + $("#text_area").val(textArrVal);
  3379 + var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
  3380 + var fontWeightProp = fontStyleProp.split(" ");
  3381 +
  3382 + $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
  3383 + $("#text_area").css("font-weight", fontWeightProp[0]);
  3384 + $("#text_area").css("font-style", fontWeightProp[1]);
  3385 + $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
  3386 + $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
  3387 + $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
  3388 + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
  3389 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
  3390 +
  3391 + var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
  3392 + var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
  3393 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  3394 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  3395 +
  3396 + CurrentFontFamily = '';
  3397 + CurrentFontSize = '';
  3398 +
  3399 +
  3400 + if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
  3401 +
  3402 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  3403 +
  3404 + }
  3405 +
  3406 + else {
  3407 +
  3408 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  3409 +
  3410 + }
  3411 +
  3412 + //adding text font weight active class in text edit pop-up
  3413 +
  3414 + if (fontWeightProp[0] == 700) {
  3415 +
  3416 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  3417 +
  3418 + }
  3419 +
  3420 + else {
  3421 +
  3422 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  3423 +
  3424 + }
  3425 +
  3426 + //adding text font style active class in text edit pop-up
  3427 +
  3428 + if (fontWeightProp[1] == "italic") {
  3429 +
  3430 +
  3431 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  3432 + }
  3433 + else {
  3434 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  3435 +
  3436 +
  3437 + }
  3438 +
  3439 + //adding text alignment active class in text edit pop-up
  3440 +
  3441 + if ($rootScope.TextPropertyArray[i].Align == "left") {
  3442 +
  3443 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3444 +
  3445 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3446 +
  3447 + $("#text-left").addClass("ActiveFormattingButtonClass");
  3448 +
  3449 + }
  3450 +
  3451 + else if ($rootScope.TextPropertyArray[i].Align == "right") {
  3452 +
  3453 +
  3454 +
  3455 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3456 +
  3457 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3458 +
  3459 + $("#text-right").addClass("ActiveFormattingButtonClass");
  3460 + }
  3461 +
  3462 + else if ($rootScope.TextPropertyArray[i].Align == "center") {
  3463 +
  3464 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3465 +
  3466 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3467 +
  3468 + $("#text-center").addClass("ActiveFormattingButtonClass");
  3469 +
  3470 + }
  3471 +
  3472 + }
  3473 + else {
  3474 + // alert("no");
  3475 +
  3476 + }
  3477 +
  3478 + }
  3479 +
  3480 +
  3481 + // _rectLayerOnSaveSplitInt = '';
  3482 + textArrVal = '';
  3483 + $("#annotationTextModal").css("padding-right", "0px");
  3484 + document.getElementById('modelbackground').style.display = "block";
  3485 + $("#annotationTextModal").modal("toggle");
  3486 +
  3487 + // $("#selected-font-family").val(CurrentFontFamily);
  3488 + // $("#selected-font-size").val(CurrentFontSize);
  3489 + }
  3490 + else {
  3491 + //jcanvas property
  3492 + layer.draggable = false;
  3493 + }
  3494 +
  3495 + }
  3496 + },
  3497 + mouseout: function (layer) {
  3498 +
  3499 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3500 + //jcanvas property
  3501 + layer.draggable = true;
  3502 + $rootScope.canvasLayerNameCollection = [];
  3503 + $('#canvas').setLayer(layer.name, {
  3504 + handle: {
  3505 + type: 'rectangle',
  3506 + fillStyle: 'pink',
  3507 + strokeStyle: 'yellow',
  3508 + strokeWidth: 0,
  3509 + width: 0, height: 0,
  3510 + cornerRadius: 0
  3511 +
  3512 + }
  3513 + }).drawLayers();
  3514 + }
  3515 + else {
  3516 + //jcanvas property
  3517 + layer.draggable = false;
  3518 + }
  3519 +
  3520 + },
  3521 + mouseover: function (layer) {
  3522 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3523 + //jcanvas property
  3524 + layer.draggable = true;
  3525 + $('#canvas').setLayer(layer.name, {
  3526 + handle: {
  3527 + type: 'rectangle',
  3528 + fillStyle: '#fff',
  3529 + strokeStyle: '#c33',
  3530 + strokeWidth: 2,
  3531 + width: 5, height: 5,
  3532 + cornerRadius: 3,
  3533 + click: function () {
  3534 + $rootScope.isTextAReaRectangleClicked = true;
  3535 +
  3536 + }
  3537 +
  3538 + }
  3539 + }).drawLayers();
  3540 + }
  3541 + else {
  3542 + //jcanvas property
  3543 + layer.draggable = false;
  3544 + }
  3545 + },
  3546 + change: function (layer) {
  3547 +
  3548 + if ($rootScope.isTextAReaRectangleClicked == true) {
  3549 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3550 + console.log(layer.x + " " + layer.y);
  3551 + console.log($rootScope.textXAxisAftrResize + " " + $rootScope.textYAxisAftrResize);
  3552 + $rootScope.isTextAReaRectangleClicked = false;
  3553 + for (var i = 0; i <= $rootScope.iniiaTextAreaValues.length-1; i++) {
  3554 +
  3555 + if ($rootScope.iniiaTextAreaValues[i].name == layer.name) {
  3556 +
  3557 + if (($rootScope.iniiaTextAreaValues[i].width == layer.width) || ($rootScope.iniiaTextAreaValues[i].height == layer.height))
  3558 + {
  3559 + }
  3560 + else
  3561 + {
  3562 + var textAreaName = layer.name;
  3563 + var textAreaNameAftrSplit = textAreaName.split("_");
  3564 + var CangedTextAreaName = 'TextAreaNew_' + textAreaNameAftrSplit[1];
  3565 + $('#canvas').setLayer(CangedTextAreaName, {
  3566 + x: layer.x,
  3567 + y: layer.y
  3568 + });
  3569 + }
  3570 + }
  3571 +
  3572 + }
  3573 +
  3574 + $rootScope.textXAxisAftrResize = layer.x;
  3575 + $rootScope.textYAxisAftrResize = layer.y;
  3576 +
  3577 +
  3578 + if ($location.path() == "/module-item-view") {
  3579 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  3580 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  3581 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  3582 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  3583 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  3584 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  3585 + }
  3586 + }
  3587 + }
  3588 + }
  3589 + }
  3590 + }
  3591 +
  3592 + }).drawText({
  3593 + layer: true,
  3594 + draggable: true,
  3595 + name: 'TextAreaNew_' + $rootScope.resetTextRect,
  3596 + groups: ['TextAreaNew_' + $rootScope.resetTextRect],
  3597 + dragGroups: ['TextAreaNew_' + $rootScope.resetTextRect],
  3598 + fillStyle: $rootScope.fontColor,
  3599 + fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle,
  3600 + fontSize: $rootScope.fontSizes,
  3601 + fromCenter: false,
  3602 + fontFamily: $rootScope.fontFamily,
  3603 + align: $rootScope.textAlignmt,
  3604 + strokeWidth: 0,
  3605 + text: $rootScope.textArea,
  3606 + x: ($rootScope.rectDimension[$rootScope.rectDimension.length - 1].x), y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  3607 + maxWidth: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
  3608 + maxHeight: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
  3609 + add: function (layer) {
  3610 + // console.log(layer.x + " " + layer.y);
  3611 + $rootScope.textXAxisAftrResize = layer.x;
  3612 + $rootScope.textYAxisAftrResize = layer.y;
  3613 +
  3614 + //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
  3615 + $rootScope.TextPropertyArray.push({ layerName: layer.name, Rect_Text: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText });
  3616 + },
  3617 + dblclick: function (layer) {
  3618 +
  3619 + }
  3620 +
  3621 + });
  3622 + $("#text_area").val('');
  3623 + $("#text_area").css({ " font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  3624 +
  3625 + $("#selected-font-family option:eq(0)").prop('selected', true);
  3626 + $("#selected-font-size option:eq(0)").prop('selected', true);
  3627 +
  3628 + // $("#selected-font-family option:eq(0)").prop('selected', true);
  3629 + // $("#selected-font-size option:eq(0)").prop('selected', true);
  3630 +
  3631 + // $("#selected-font-family option[value='Arial']").prop('selected', true);
  3632 + // $("#selected-font-size option[value=14]").prop('selected', true);
  3633 +
  3634 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  3635 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  3636 +
  3637 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  3638 +
  3639 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  3640 +
  3641 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3642 +
  3643 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3644 +
  3645 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  3646 +
  3647 +
  3648 + }
  3649 +
  3650 + // this part will work second time when save button will be clicked
  3651 + else {
  3652 +
  3653 +
  3654 + if ($location.path() == "/module-item-view") {
  3655 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  3656 + if ($rootScope.jcanvasObjectArray[i].name == $rootScope.initialTextAreaName) {
  3657 + $rootScope.jcanvasObjectArray.splice(i, 1);
  3658 + $rootScope.initialTextAreaName = '';
  3659 + }
  3660 + }
  3661 + }
  3662 +
  3663 +
  3664 + // getting textarea style properties
  3665 + var _modifiedText = $("#text_area").val();
  3666 + var _modifiedFontSize = $("#text_area").css("font-size");
  3667 + var _modifiedFontWeight = $("#text_area").css("font-weight");
  3668 + var _modifiedFontStyle = $("#text_area").css("font-style");
  3669 + var _modifiedTextAlign = $("#text_area").css("text-align");
  3670 + var _modifiedFontColor = $("#text_area").css("color");
  3671 + var _modifiedFontFamily = $("#text_area").css("font-family");
  3672 + var _modifiedFontDecoration = $("#text_area").css("text-decoration");
  3673 +
  3674 + // deleting previous textarea
  3675 +
  3676 +
  3677 + // code for horizonatl text going out
  3678 + if (/\s/.test(_modifiedText)) {
  3679 +
  3680 + }
  3681 + else {
  3682 + var contentWidthArray = [];
  3683 + var contentWidth = Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width);
  3684 + $("#atTextDiv").css({ "width": contentWidth, "font-size": _modifiedFontSize });
  3685 + var text = _modifiedText;
  3686 + $("#textspan").empty();
  3687 + $("#duptextspan").empty();
  3688 + for (var i = 0; i <= text.length - 1; i++) {
  3689 + if (contentWidthArray.length > 0) {
  3690 + if (parseInt(contentWidthArray[0]) < $("#atTextDiv").width()) {
  3691 + $("#duptextspan").append(text[i]);
  3692 + $("#textspan").append(text[i]);
  3693 + contentWidthArray = [];
  3694 + contentWidthArray.push(Math.ceil($("#textspan").width()));
  3695 + }
  3696 + else {
  3697 + contentWidthArray = [];
  3698 + $("#duptextspan").append("\r\n");
  3699 + $("#textspan").append("\r\n");
  3700 + $("#duptextspan").append(text[i]);
  3701 + $("#textspan").text('');
  3702 + $("#textspan").append(text[i]);
  3703 + contentWidthArray.push(Math.ceil($("#textspan").width()));
  3704 +
  3705 + }
  3706 + }
  3707 + else {
  3708 + $("#duptextspan").text(text[i]);
  3709 + $("#textspan").text(text[i]);
  3710 + contentWidthArray = [];
  3711 + contentWidthArray.push(Math.ceil($("#textspan").width()));
  3712 + }
  3713 + }
  3714 + _modifiedText = $("#duptextspan").text();
  3715 + console.log(_modifiedText);
  3716 + }
  3717 + // code for horizonatl text going out
  3718 +
  3719 +
  3720 + $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers();
  3721 + $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers();
  3722 +
  3723 + $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
  3724 + $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
  3725 +
  3726 + // generating new text area
  3727 + // $('#canvas')
  3728 + // Draw rect as wide as the text
  3729 + $('#canvas').drawRect({
  3730 + name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
  3731 + layer: true,
  3732 + draggable: true,
  3733 + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  3734 + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  3735 + opacity: $rootScope.shapestyleOpacity,
  3736 + fromCenter: false,
  3737 + strokeStyle: $rootScope.shapestyleborderColor,
  3738 + strokeWidth: $rootScope.shapestyleborderWidth,
  3739 + fillStyle: $rootScope.selectedBGColorForTextArea,
  3740 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  3741 + width: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
  3742 + height: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
  3743 + resizeFromCenter: false,
  3744 + add: function (layer) {
  3745 + var TextAreaLayerName = layer.name;
  3746 + var TextAreaLayerNameAftrSplit = TextAreaLayerName.split("_");
  3747 + $rootScope.postFixLayerNumberAftrEdit = TextAreaLayerNameAftrSplit[1];
  3748 + $rootScope.initTextAreaValues.push({ "name": layer.name, "width": layer.width, "height": layer.height });
  3749 + if ($location.path() == "/module-item-view") {
  3750 + $rootScope.jcanvasObjectArray.push({ "name": layer.name, "x": layer.x, "y": layer.y, "width": layer.width, "height": layer.height });
  3751 + }
  3752 + },
  3753 + dragstop: function (layer) {
  3754 +
  3755 + if ($location.path() == "/module-item-view") {
  3756 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  3757 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  3758 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  3759 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  3760 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  3761 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  3762 + }
  3763 + }
  3764 + }
  3765 + },
  3766 + click: function (layer) {
  3767 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3768 + //jcanvas property
  3769 + layer.draggable = true;
  3770 + $rootScope.shapeTypeText = "textAreaRect";
  3771 + var layerName = layer.name;
  3772 + var splitedName = layerName.split("_");
  3773 + var textValName = "TextAreaAfterEdit_";
  3774 + var concatinateResult = textValName.concat(splitedName[1]);
  3775 + $rootScope.canvasLayerNameCollection = [];
  3776 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  3777 +
  3778 + $('#canvas').setLayer(layer.name, {
  3779 + handle: {
  3780 + type: 'rectangle',
  3781 + fillStyle: '#fff',
  3782 + strokeStyle: '#c33',
  3783 + strokeWidth: 2,
  3784 + width: 5, height: 5,
  3785 + cornerRadius: 3,
  3786 + }
  3787 + }).drawLayers();
  3788 + }
  3789 + else {
  3790 + //jcanvas property
  3791 + layer.draggable = false;
  3792 + }
  3793 +
  3794 + },
  3795 + dblclick: function (layer) {
  3796 +
  3797 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3798 + //jcanvas property
  3799 + layer.draggable = true;
  3800 + $rootScope.isTextAreaClosedButtonActive = false;
  3801 + $rootScope.IsTextAlreadySave = true;
  3802 + var _rectLayerOnSave = layer.name;
  3803 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  3804 + var RectNameAfterEdit = "TextAreaAfterEdit_";
  3805 + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
  3806 + $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
  3807 +
  3808 + $rootScope.layerNameArr = layer.name;
  3809 + $rootScope.rectTextArr = RectNameAfterEditResult;
  3810 +
  3811 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  3812 + // this line of code replace the line breaks and convert into a single line.
  3813 + _modifiedText = _modifiedText.replace(/(\r\n)/gm, "");
  3814 + $("#text_area").val(_modifiedText);
  3815 + $("#text_area").css("font-size", _modifiedFontSize);
  3816 + $("#text_area").css("font-weight", _modifiedFontWeight);
  3817 + $("#text_area").css("font-style", _modifiedFontStyle);
  3818 + $("#text_area").css("text-align", _modifiedTextAlign);
  3819 + $("#text_area").css("color", _modifiedFontColor);
  3820 + $("#text_area").css("font-family", _modifiedFontFamily);
  3821 + $("#text_area").css("text-decoration", _modifiedFontDecoration);
  3822 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
  3823 +
  3824 + // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
  3825 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  3826 +
  3827 + //khushbu
  3828 + var CurrentFontFamily = _modifiedFontFamily;
  3829 + // alert(CurrentFontFamily);
  3830 + // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
  3831 + var CurrentFontSize = parseInt(_modifiedFontSize);
  3832 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  3833 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  3834 + CurrentFontFamily = '';
  3835 + CurrentFontSize = '';
  3836 + //adding text text decoration active class in text edit pop-up
  3837 + if (_modifiedFontDecoration == "underline") {
  3838 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  3839 + }
  3840 + else {
  3841 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  3842 + }
  3843 +
  3844 + //adding text font weight active class in text edit pop-up
  3845 + if (_modifiedFontWeight == 700) {
  3846 +
  3847 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  3848 + }
  3849 + else {
  3850 +
  3851 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  3852 +
  3853 + }
  3854 +
  3855 + //adding text font style active class in text edit pop-up
  3856 + if (_modifiedFontStyle == "italic") {
  3857 +
  3858 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  3859 + }
  3860 + else {
  3861 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  3862 +
  3863 + }
  3864 +
  3865 + //adding text alignment active class in text edit pop-up
  3866 + if (_modifiedTextAlign == "left") {
  3867 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3868 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3869 + $("#text-left").addClass("ActiveFormattingButtonClass");
  3870 + }
  3871 + else if (_modifiedTextAlign == "right") {
  3872 +
  3873 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3874 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3875 + $("#text-right").addClass("ActiveFormattingButtonClass");
  3876 +
  3877 + }
  3878 + else if (_modifiedTextAlign == "center") {
  3879 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  3880 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3881 + $("#text-center").addClass("ActiveFormattingButtonClass");
  3882 +
  3883 + }
  3884 +
  3885 + document.getElementById('modelbackground').style.display = "block";
  3886 + $("#annotationTextModal").modal("toggle");
  3887 + }
  3888 + else {
  3889 + //jcanvas property
  3890 + layer.draggable = false;
  3891 + }
  3892 + },
  3893 + touchstart: function (layer) {
  3894 +
  3895 + if (isDoubleTouchSaveTextAgain == null) {
  3896 + isDoubleTouchSaveTextAgain = setTimeout(function () {
  3897 + isDoubleTouchSaveTextAgain = null;
  3898 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3899 + //jcanvas property
  3900 + layer.draggable = true;
  3901 + $rootScope.shapeTypeText = "textAreaRect";
  3902 + var layerName = layer.name;
  3903 + var splitedName = layerName.split("_");
  3904 + var textValName = "TextAreaAfterEdit_";
  3905 + var concatinateResult = textValName.concat(splitedName[1]);
  3906 + $rootScope.canvasLayerNameCollection = [];
  3907 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  3908 +
  3909 + $('#canvas').setLayer(layer.name, {
  3910 + handle: {
  3911 + type: 'rectangle',
  3912 + fillStyle: '#fff',
  3913 + strokeStyle: '#c33',
  3914 + strokeWidth: 2,
  3915 + width: 5, height: 5,
  3916 + cornerRadius: 3,
  3917 + }
  3918 + }).drawLayers();
  3919 + }
  3920 + else {
  3921 + //jcanvas property
  3922 + layer.draggable = false;
  3923 + }
  3924 +
  3925 + }, 1000)
  3926 + } else {
  3927 + clearTimeout(isDoubleTouchSaveTextAgain);
  3928 + isDoubleTouchSaveTextAgain = null;
  3929 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3930 + //jcanvas property
  3931 + layer.draggable = true;
  3932 + $rootScope.isTextAreaClosedButtonActive = false;
  3933 + $rootScope.IsTextAlreadySave = true;
  3934 + var _rectLayerOnSave = layer.name;
  3935 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  3936 + var RectNameAfterEdit = "TextAreaAfterEdit_";
  3937 + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
  3938 + $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
  3939 +
  3940 + $rootScope.layerNameArr = layer.name;
  3941 + $rootScope.rectTextArr = RectNameAfterEditResult;
  3942 +
  3943 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  3944 + $("#text_area").val(_modifiedText);
  3945 + $("#text_area").css("font-size", _modifiedFontSize);
  3946 + $("#text_area").css("font-weight", _modifiedFontWeight);
  3947 + $("#text_area").css("font-style", _modifiedFontStyle);
  3948 + $("#text_area").css("text-align", _modifiedTextAlign);
  3949 + $("#text_area").css("color", _modifiedFontColor);
  3950 + $("#text_area").css("font-family", _modifiedFontFamily);
  3951 + $("#text_area").css("text-decoration", _modifiedFontDecoration);
  3952 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
  3953 +
  3954 + // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
  3955 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  3956 +
  3957 + //khushbu
  3958 + var CurrentFontFamily = _modifiedFontFamily;
  3959 + // alert(CurrentFontFamily);
  3960 + // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
  3961 + var CurrentFontSize = parseInt(_modifiedFontSize);
  3962 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  3963 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  3964 + CurrentFontFamily = '';
  3965 + CurrentFontSize = '';
  3966 + //adding text text decoration active class in text edit pop-up
  3967 + if (_modifiedFontDecoration == "underline") {
  3968 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  3969 + }
  3970 + else {
  3971 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  3972 + }
  3973 +
  3974 + //adding text font weight active class in text edit pop-up
  3975 + if (_modifiedFontWeight == 700) {
  3976 +
  3977 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  3978 + }
  3979 + else {
  3980 +
  3981 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  3982 +
  3983 + }
  3984 +
  3985 + //adding text font style active class in text edit pop-up
  3986 + if (_modifiedFontStyle == "italic") {
  3987 +
  3988 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  3989 + }
  3990 + else {
  3991 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  3992 +
  3993 + }
  3994 +
  3995 + //adding text alignment active class in text edit pop-up
  3996 + if (_modifiedTextAlign == "left") {
  3997 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  3998 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  3999 + $("#text-left").addClass("ActiveFormattingButtonClass");
  4000 + }
  4001 + else if (_modifiedTextAlign == "right") {
  4002 +
  4003 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  4004 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  4005 + $("#text-right").addClass("ActiveFormattingButtonClass");
  4006 +
  4007 + }
  4008 + else if (_modifiedTextAlign == "center") {
  4009 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  4010 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  4011 + $("#text-center").addClass("ActiveFormattingButtonClass");
  4012 +
  4013 + }
  4014 +
  4015 + document.getElementById('modelbackground').style.display = "block";
  4016 + $("#annotationTextModal").modal("toggle");
  4017 + }
  4018 + else {
  4019 + //jcanvas property
  4020 + layer.draggable = false;
  4021 + }
  4022 +
  4023 + }
  4024 + },
  4025 + mouseout: function (layer) {
  4026 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  4027 + //jcanvas property
  4028 + layer.draggable = true;
  4029 + $rootScope.canvasLayerNameCollection = [];
  4030 + $('#canvas').setLayer(layer.name, {
  4031 + handle: {
  4032 + type: 'rectangle',
  4033 + fillStyle: 'pink',
  4034 + strokeStyle: 'yellow',
  4035 + strokeWidth: 0,
  4036 + width: 0, height: 0,
  4037 + cornerRadius: 0
  4038 + }
  4039 + }).drawLayers();
  4040 +
  4041 + }
  4042 + else {
  4043 + //jcanvas property
  4044 + layer.draggable = false;
  4045 + }
  4046 + $rootScope.RectXAxisAftrResize = layer.x;
  4047 + $rootScope.RectYAxisAftrResize = layer.y;
  4048 + },
  4049 + mouseover: function (layer) {
  4050 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  4051 + //jcanvas property
  4052 + layer.draggable = true;
  4053 + $('#canvas').setLayer(layer.name, {
  4054 + handle: {
  4055 + type: 'rectangle',
  4056 + fillStyle: '#fff',
  4057 + strokeStyle: '#c33',
  4058 + strokeWidth: 2,
  4059 + width: 5, height: 5,
  4060 + cornerRadius: 3,
  4061 + click: function () {
  4062 + $rootScope.isTextAReaRectangleClickedAftrEdit = true;
  4063 + }
  4064 + }
  4065 + }).drawLayers();
  4066 +
  4067 + }
  4068 +
  4069 + else {
  4070 + //jcanvas property
  4071 + layer.draggable = false;
  4072 + }
  4073 + },
  4074 + change: function (layer) {
  4075 +
  4076 + if ($rootScope.isTextAReaRectangleClickedAftrEdit == true) {
  4077 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  4078 + console.log(layer.x + " " + layer.y);
  4079 + console.log($rootScope.textXAxisAftrResize + " " + $rootScope.textYAxisAftrResize);
  4080 + $rootScope.isTextAReaRectangleClickedAftrEdit = false;
  4081 +
  4082 + for (var i = 0; i <= $rootScope.initTextAreaValues.length - 1; i++) {
  4083 +
  4084 + if ($rootScope.initTextAreaValues[i].name == layer.name) {
  4085 +
  4086 + if (($rootScope.initTextAreaValues[i].width == layer.width) || ($rootScope.initTextAreaValues[i].height == layer.height)) {
  4087 +
  4088 + }
  4089 + else {
  4090 + var textAreaName = layer.name;
  4091 + var textAreaNameAftrSplit = textAreaName.split("_");
  4092 + var CangedTextAreaName = 'TextAreaAfterEdit_' + textAreaNameAftrSplit[1];
  4093 + $('#canvas').setLayer(CangedTextAreaName, {
  4094 + x: layer.x,
  4095 + y: layer.y
  4096 + });
  4097 + }
  4098 + }
  4099 +
  4100 + }
  4101 +
  4102 +
  4103 + $rootScope.editTextXAxisAftrResize = layer.x;
  4104 + $rootScope.editTextYAxisAftrResize = layer.y;
  4105 + if ($location.path() == "/module-item-view") {
  4106 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  4107 + if ($rootScope.jcanvasObjectArray[i].name == layer.name) {
  4108 + $rootScope.jcanvasObjectArray[i].x = layer.x;
  4109 + $rootScope.jcanvasObjectArray[i].y = layer.y;
  4110 + $rootScope.jcanvasObjectArray[i].width = layer.width;
  4111 + $rootScope.jcanvasObjectArray[i].height = layer.height;
  4112 + }
  4113 + }
  4114 +
  4115 + }
  4116 +
  4117 +
  4118 + }
  4119 + }
  4120 +
  4121 +
  4122 + }
  4123 +
  4124 + }).drawText({
  4125 + layer: true,
  4126 + draggable: true,
  4127 + name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
  4128 + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  4129 + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  4130 + fillStyle: _modifiedFontColor,
  4131 + fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle,
  4132 + fontSize: _modifiedFontSize,
  4133 + fontFamily: _modifiedFontFamily,
  4134 + align: _modifiedTextAlign,
  4135 + strokeWidth: 0,
  4136 + fromCenter: false,
  4137 + text: _modifiedText,
  4138 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  4139 + maxWidth: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].width),
  4140 + maxHeight: Math.abs($rootScope.rectDimension[$rootScope.rectDimension.length - 1].height),
  4141 + add: function (layer) {
  4142 + // console.log(layer.x + " " + layer.y);
  4143 + $rootScope.editTextXAxisAftrResize = layer.x;
  4144 + $rootScope.editTextYAxisAftrResize = layer.y;
  4145 + }
  4146 + });
  4147 +
  4148 + }
  4149 + }
  4150 + //----
  4151 +
  4152 + $rootScope.onDrawingCanvasClick = function (event) {
  4153 +
  4154 + $rootScope.clicked = true;
  4155 + // OnPaintCanvasMouseDown(event);
  4156 +
  4157 + var annotationCanvas = document.getElementById('canvas');
  4158 + if (annotationCanvas != null || annotationCanvas != undefined) {
  4159 +
  4160 + annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintCanvasMouseDown, false);
  4161 + annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false);
  4162 +
  4163 +
  4164 + annotationCanvas.addEventListener("touchstart", $rootScope.OnPaintCanvasMouseDown, false);
  4165 + annotationCanvas.addEventListener("touchend", $rootScope.OnPaintCanvasMouseUp, false);
  4166 +
  4167 + }
  4168 +
  4169 + // alert("doclick");
  4170 + // annotation history
  4171 + if (event != undefined) {
  4172 +
  4173 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  4174 +
  4175 + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event);
  4176 +
  4177 + }
  4178 + }
  4179 +
  4180 +
  4181 + };
  4182 +
  4183 +
  4184 + $(document).keydown(function (event) {
  4185 +
  4186 + // predefined function for detecting keyboard key
  4187 + if (event.which == 46) {
  4188 +
  4189 + if ($rootScope.shapeTypePin == "Pin") {
  4190 +
  4191 +
  4192 + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].pinName).drawLayers();
  4193 + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].ArcName).drawLayers();
  4194 + $rootScope.shapeTypePin = "";
  4195 +
  4196 + }
  4197 + else if ($rootScope.shapeTypeText == "textAreaRect") {
  4198 + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaRectangle).drawLayers();
  4199 + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaString).drawLayers();
  4200 + $rootScope.shapeTypeText = "";
  4201 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  4202 +
  4203 + if ($rootScope.canvasLayerNameCollection[0].textareaRectangle == $rootScope.jcanvasObjectArray[i].name) {
  4204 +
  4205 + $rootScope.jcanvasObjectArray.splice(i, 1);
  4206 +
  4207 + }
  4208 + // console.log($rootScope.jcanvasObjectArray);
  4209 + }
  4210 +
  4211 + }
  4212 + else {
  4213 +
  4214 + $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers();
  4215 + if ($location.path() == "/module-item-view") {
  4216 + for (var i = 0; i <= $rootScope.jcanvasObjectArray.length - 1; i++) {
  4217 +
  4218 + if ($rootScope.canvasLayerNameCollection == $rootScope.jcanvasObjectArray[i].name) {
  4219 +
  4220 + $rootScope.jcanvasObjectArray.splice(i, 1);
  4221 + }
  4222 + }
  4223 + }
  4224 + }
  4225 + }
  4226 +
  4227 + });
  4228 +
  4229 +
  4230 + $rootScope.closeModal = function () {
  4231 +
  4232 + document.getElementById('modelbackground').style.display = "none";
  4233 + $("#drawTextBGColorpicker span.minicolors-swatch-color").css('background-color', $rootScope.selectedBGColorForTextArea);
  4234 +
  4235 + }
  4236 + //-- End ----------------------------
  4237 +
  4238 +
  4239 + $rootScope.AddClick = function (x, y, dragging) {
  4240 + $rootScope.clickX.push(x);
  4241 + $rootScope.clickY.push(y);
  4242 + $rootScope.clickDrag.push(dragging);
  4243 + }
  4244 +
  4245 + $rootScope.Redraw = function () {
  4246 + var context = document.getElementById('paintCanvas').getContext('2d');
  4247 +
  4248 + context.clearRect(0, 0, context.canvas.width, context.canvas.height); // Clears the canvas
  4249 +
  4250 + context.strokeStyle = "#FFFFFF";
  4251 + context.lineJoin = "round";
  4252 + context.lineWidth = 5;
  4253 +
  4254 +
  4255 + for (var i = 0; i < $rootScope.clickX.length; i++) {
  4256 + context.beginPath();
  4257 + if ($rootScope.clickDrag[i] && i) {
  4258 + context.moveTo($rootScope.clickX[i - 1], $rootScope.clickY[i - 1]);
  4259 + } else {
  4260 + context.moveTo($rootScope.clickX[i] - 1, $rootScope.clickY[i]);
  4261 + }
  4262 + context.lineTo($rootScope.clickX[i], $rootScope.clickY[i]);
  4263 + context.closePath();
  4264 + context.stroke();
  4265 + }
  4266 + }
  4267 +
  4268 + $rootScope.PaintCanvasMousedownListener = function (canvasContext, x, y) {
  4269 + if ($rootScope.isLineDrawSelecyed == true) {
  4270 +
  4271 + canvasContext.lineWidth = 0.1;
  4272 + canvasContext.strokeStyle = 'red';
  4273 + canvasContext.beginPath();
  4274 + canvasContext.moveTo(x, y);
  4275 + }
  4276 +
  4277 + }
  4278 +
  4279 + $rootScope.PaintCanvasMouseupListener = function (canvasContext) {
  4280 + if ($scope.isLineDrawSelecyed == true) {
  4281 +
  4282 + }
  4283 + }
  4284 +
  4285 + $rootScope.PaintCanvasMousemoveListener = function (canvasContext, x, y) {
  4286 + if ($rootScope.isLineDrawSelecyed == true) {
  4287 + console.log('hm moving')
  4288 + canvasContext.lineTo(x, y);
  4289 + canvasContext.stroke();
  4290 + }
  4291 + }
  4292 +
  4293 + $rootScope.Draw = function (x, y, isDown, context) {
  4294 + if (isDown) {
  4295 + context.beginPath();
  4296 + context.strokeStyle = '#000000';
  4297 + context.lineWidth = 1//$('#selWidth').val();
  4298 + context.lineJoin = "round";
  4299 + context.moveTo($rootScope.lastX, $rootScope.lastY);
  4300 + context.lineTo(x, y);
  4301 + context.closePath();
  4302 + context.stroke();
  4303 + }
  4304 + $rootScope.lastX = x; $rootScope.lastY = y;
  4305 + }
  4306 +
  4307 + $rootScope.disableAnnotationTB = false;
  4308 + $rootScope.disableAnnotationTBFn = function () {
  4309 + $rootScope.disableAnnotationTB = true;
  4310 + }
  4311 +
  4312 + //list manager function
  4313 +
  4314 + //list manager function
  4315 +
  4316 + $rootScope.disableAnnotationtoolOnListManager = false;
  4317 + $rootScope.ShowListManager = function () {
  4318 +
  4319 + $rootScope.switchCanvas();
  4320 + $("#annotationpaintbrushsize").attr("href", "#");
  4321 + $("#annotationpainteraser").attr("href", "#");
  4322 + console.log('ShowListManager')
  4323 + $rootScope.disableAnnotationtoolOnListManager = true;
  4324 + $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
  4325 + $('#slider-range-min-2').slider('disable');
  4326 + $("#annotationpaintbrushsize").attr('disabled', 'disabled');
  4327 + $("#annotationpainteraser").attr('disabled', 'disabled');
  4328 + $("#annotationpaintbrushsize").css('pointer-events', 'none');
  4329 + $("#annotationpainteraser").css('pointer-events', 'none');
  4330 + $rootScope.isLoading = true;
  4331 + $('#spinner').css('visibility', 'visible');
  4332 +
  4333 + $('#listManager').css('display', 'block');
  4334 + $("#listManager").css("visibility", "visible");
  4335 +
  4336 + $('#listManager').draggable();
  4337 + $rootScope.islistManagerEventAlredayDispachted = true;
  4338 +
  4339 + $rootScope.$broadcast('listManagerEvent', true);
  4340 +
  4341 + if ($rootScope.selectedBodySystemName == undefined && $rootScope.slectedActualTermNumber == undefined) {
  4342 + if ($location.path() == "/module-item-view") {
  4343 + $timeout(function () {
  4344 + $('#termList option[selected="selected"]').prop("selected", false);
  4345 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
  4346 + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
  4347 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
  4348 +
  4349 + }, 1000);
  4350 + }
  4351 + else {
  4352 + $('#termList option[selected="selected"]').prop("selected", false);
  4353 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
  4354 + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
  4355 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
  4356 + }
  4357 + }
  4358 + else {
  4359 +
  4360 + if ($rootScope.selectedBodySystemId == undefined) {
  4361 + $rootScope.selectedBodySystemId = 0;
  4362 + if ($location.path() == "/module-item-view") {
  4363 + $rootScope.refreshTermListOnAASystemSelection($rootScope.selectedBodySystemId);
  4364 + }
  4365 + else {
  4366 + if ($location.path() == "/module-item-view") {
  4367 + $rootScope.refreshTermListOnAASystemSelection($rootScope.selectedBodySystemId);
  4368 + }
  4369 + else {
  4370 + $rootScope.refreshTermListOnSystemSelection($rootScope.selectedBodySystemId);
  4371 + }
  4372 +
  4373 + }
  4374 + }
  4375 + else {
  4376 + if ($location.path() == "/module-item-view") {
  4377 + $rootScope.refreshTermListOnAASystemSelection($rootScope.selectedBodySystemId);
  4378 + }
  4379 + else {
  4380 + $rootScope.refreshTermListOnSystemSelection($rootScope.selectedBodySystemId);
  4381 + }
  4382 +
  4383 + }
  4384 +
  4385 + $timeout(function () {
  4386 + $('#bodySystems option[selected="selected"]').prop("selected", false);
  4387 + $('#bodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').prop("selected", true);
  4388 + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
  4389 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
  4390 +
  4391 + }, 1000);
  4392 + }
  4393 + $("#optionsListManagerTab").addClass("active");
  4394 + var viewNameAftrSplit;
  4395 + if ($("#viewName").val() !== null) {
  4396 + viewNameAftrSplit = $("#viewName").val().split(" ");
  4397 +
  4398 + if (viewNameAftrSplit[0] == "null") {
  4399 + document.location.href = "/";
  4400 + }
  4401 + }
  4402 + if ($location.url() == "/module-item-view") {
  4403 + $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onSearchItemSelection(this.options[this.selectedIndex].id)");
  4404 + }
  4405 + else {
  4406 + $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id, true)");
  4407 + }
  4408 +
  4409 + }
  4410 +
  4411 + $rootScope.CloseListManager = function () {
  4412 + $("#btnTranparency").removeAttr('disabled', 'disabled');
  4413 + $("#optionsListManagerTab").removeClass("active");
  4414 + $rootScope.isListManagerMenuSelected = false;
  4415 + console.log('listManager closed');
  4416 + $rootScope.disableAnnotationtoolOnListManager = false;
  4417 + if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") {
  4418 + $("#annotationpaintbrushsize").attr("href", "#canvasPaint");
  4419 + $("#annotationpainteraser").attr("href", "#canvasPaint");
  4420 + if ($rootScope.disableAnnotationtoolOnListManager == false) {
  4421 + $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
  4422 + $('#slider-range-min-2').slider('enable');
  4423 + $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
  4424 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  4425 + $("#annotationpaintbrushsize").css('pointer-events', 'auto');
  4426 + $("#annotationpainteraser").css('pointer-events', 'auto');
  4427 + if ($(".annotationTollbar").css("display") == "block") {
  4428 + $rootScope.switchCanvasToPaintCanvas();
  4429 + }
  4430 + }
  4431 + }
  4432 + if ($location.path() == "/module-item-view") {
  4433 + $rootScope.selectedBodySystemName = $("#AABodySystems").val();
  4434 + $rootScope.selectedBodySystemId = $('#AABodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').attr("id");
  4435 + }
  4436 + $('#listManager').css('display', 'none');
  4437 + $("#listManager").css("visibility", "hidden");
  4438 +
  4439 + $rootScope.isLoading = false;
  4440 + $('#spinner').css('visibility', 'hidden');
  4441 + //$('#spinner').css('display', 'none');
  4442 + // $rootScope.isAnnotationWindowClose = true;
  4443 + // if('#termList')
  4444 + if ($('#termList option').length > 0) {
  4445 + //$('#termList option') = null;
  4446 + //$('#termList').innerHTML='';
  4447 + $('#termList')
  4448 + .find('option')
  4449 + .remove()
  4450 + .end()
  4451 + if ($('#termList option').length > 0) {
  4452 +
  4453 + }
  4454 + }
  4455 +
  4456 + $rootScope.prevId = "";
  4457 + }
  4458 +
  4459 + function fillListManagerTerms() {
  4460 +
  4461 + var len = $rootScope.openModules.length;
  4462 + var openViewLen = $rootScope.openViews.length;
  4463 +
  4464 + var currentOpenModuleId = $rootScope.openModules[len - 1].ModuleId;
  4465 + var currentOpenViewId = $rootScope.openViews[openViewLen - 1].BodyViewId;
  4466 + if (currentOpenModuleId == 1) {
  4467 +
  4468 + }
  4469 +
  4470 + }
  4471 +
  4472 + //setrtings
  4473 + $rootScope.SetSettingActiveTab = function (tabToSet) {
  4474 + $rootScope.SettingsTab = tabToSet;
  4475 + };
  4476 +
  4477 + $rootScope.loadsettings = function () {
  4478 +
  4479 + //1. For now we are by default opening DA settings tab
  4480 + $rootScope.SettingsTab = 3;
  4481 +
  4482 + //2.
  4483 + var curentEthnicity = $rootScope.getLocalStorageValue("globalEthnicity");
  4484 + if (typeof (curentEthnicity) !== "undefined" && curentEthnicity !== null) {
  4485 + $rootScope.globalSetting.ethnicity = curentEthnicity;
  4486 + }
  4487 + else {
  4488 + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity);
  4489 + }
  4490 +
  4491 + var curentmodesty = $rootScope.getLocalStorageValue("globalModesty");
  4492 + if (typeof (curentmodesty) !== "undefined" && curentmodesty !== null) {
  4493 + $rootScope.globalSetting.modesty = curentmodesty
  4494 + }
  4495 + else {
  4496 + localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty);
  4497 + }
  4498 +
  4499 + //3.
  4500 + $rootScope.setModestySettings($rootScope.globalSetting.modesty);
  4501 +
  4502 + //4.
  4503 + $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity);
  4504 +
  4505 +
  4506 + };
  4507 +
  4508 + $rootScope.setModestySettings = function (currentmodsetting) {
  4509 +
  4510 + if (currentmodsetting == 'Y') {
  4511 + $rootScope.isModestyOn = true;
  4512 + $rootScope.isModestyOff = false;
  4513 + }
  4514 + else {
  4515 + $rootScope.isModestyOn = false;
  4516 + $rootScope.isModestyOff = true;
  4517 + }
  4518 + }
  4519 +
  4520 + $rootScope.setEthncitySettings = function (currentEthncitysetting) {
  4521 +
  4522 + // this code is used for maintaing the currently selected Ethencity.
  4523 + if (currentEthncitysetting == 'L') {
  4524 + $("#btnEthnicA").addClass("skindefault");
  4525 + if ($("#btnEthnicB").hasClass("skindefault")) { $("#btnEthnicB").removeClass("skindefault"); }
  4526 + if ($("#btnEthnicL").hasClass("skindefault")) { $("#btnEthnicL").removeClass("skindefault"); }
  4527 + if ($("#btnEthnicW").hasClass("skindefault")) { $("#btnEthnicW").removeClass("skindefault"); }
  4528 + }
  4529 + if (currentEthncitysetting == 'B') {
  4530 + $("#btnEthnicB").addClass("skindefault");
  4531 + if ($("#btnEthnicL").hasClass("skindefault")) { $("#btnEthnicL").removeClass("skindefault"); }
  4532 + if ($("#btnEthnicW").hasClass("skindefault")) { $("#btnEthnicW").removeClass("skindefault"); }
  4533 + if ($("#btnEthnicA").hasClass("skindefault")) { $("#btnEthnicA").removeClass("skindefault"); }
  4534 + }
  4535 + if (currentEthncitysetting == 'A') {
  4536 + $("#btnEthnicL").addClass("skindefault");
  4537 + if ($("#btnEthnicB").hasClass("skindefault")) { $("#btnEthnicB").removeClass("skindefault"); }
  4538 + if ($("#btnEthnicW").hasClass("skindefault")) { $("#btnEthnicW").removeClass("skindefault"); }
  4539 + if ($("#btnEthnicA").hasClass("skindefault")) { $("#btnEthnicA").removeClass("skindefault"); }
  4540 + }
  4541 + if (currentEthncitysetting == 'W') {
  4542 + $("#btnEthnicW").addClass("skindefault");
  4543 + if ($("#btnEthnicB").hasClass("skindefault")) { $("#btnEthnicB").removeClass("skindefault"); }
  4544 + if ($("#btnEthnicL").hasClass("skindefault")) { $("#btnEthnicL").removeClass("skindefault"); }
  4545 + if ($("#btnEthnicA").hasClass("skindefault")) { $("#btnEthnicA").removeClass("skindefault"); }
  4546 + }
  4547 + }
  4548 +
  4549 + $rootScope.ChangeEthnicity = function (formsetting, skintone) {
  4550 +
  4551 + if ($rootScope.isCloseSettingClicked == true) {
  4552 + formsetting.ethnicity = localStorage.getItem("globalEthnicity");
  4553 + $rootScope.isCloseSettingClicked = false;
  4554 + }
  4555 + else {
  4556 + formsetting.ethnicity = skintone;
  4557 + }
  4558 + $rootScope.setEthncitySettings(formsetting.ethnicity);
  4559 +
  4560 +
  4561 +
  4562 + }
  4563 +
  4564 + $rootScope.ChangeModesty = function (formsetting, modestyValue) {
  4565 + formsetting.modesty = modestyValue;
  4566 + $rootScope.setModestySettings(formsetting.modesty);
  4567 +
  4568 + }
  4569 + $rootScope.isApplyBtnClicked = false;
  4570 + $rootScope.CloseSetting = function () {
  4571 + $rootScope.isCloseSettingClicked = true;
  4572 + $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity);
  4573 + $rootScope.setModestySettings($rootScope.globalSetting.modesty);
  4574 + if ($rootScope.isApplyBtnClicked == false) {
  4575 +
  4576 + $rootScope.deSelectLanguageOptions();
  4577 + }
  4578 + else {
  4579 +
  4580 + $rootScope.isApplyBtnClicked = false;
  4581 + }
  4582 + $('#modal-settings').css("display", "none");
  4583 + $("#modelsettingsbackground").css("display", "none");
  4584 + }
  4585 +
  4586 + $rootScope.UpdateAndCloseSetting = function (setting) {
  4587 +
  4588 + $rootScope.UpdateSetting(setting);
  4589 + if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") {
  4590 + $rootScope.loadSearchData();
  4591 + }
  4592 + $rootScope.isApplyBtnClicked = false;
  4593 + //$timeout(function () {
  4594 + $('#modal-settings').css("display", "none");
  4595 + $("#modelsettingsbackground").css("display", "none");
  4596 + // $("#setting-spinner").css("display", "none");
  4597 + if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "AA") {
  4598 + $("#setting-spinner").css("display", "block");
  4599 + }
  4600 +
  4601 + $rootScope.lexiconLanguageArrayLength = $rootScope.lexiconLanguageArray.length;
  4602 +
  4603 + // }, 6000);
  4604 + };
  4605 +
  4606 +
  4607 +
  4608 + $rootScope.deSelectLanguageOptions = function () {
  4609 +
  4610 + var languageDifference = ($rootScope.lexiconLanguageArrayLength) - ($rootScope.lexiconLanguageArray.length);
  4611 + languageDifference = parseInt(languageDifference);
  4612 + if (languageDifference > 0) {
  4613 + for (var i = 0; i <= $rootScope.lexiconRemovedLanguage.length - 1; i++) {
  4614 + $("#lexiconLangDropdown option").each(function () {
  4615 + if ($rootScope.lexiconRemovedLanguage[i].language == $(this).val()) {
  4616 + $(this).remove();
  4617 + $('#secondLax').append('<option val="' + $rootScope.lexiconRemovedLanguage[i].id + '">' + $rootScope.lexiconRemovedLanguage[i].language + '</option>');
  4618 + $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language });
  4619 + }
  4620 + });
  4621 +
  4622 + if ($rootScope.lexiconRemovedLanguage[i].language == $("#primarylaxican").val()) {
  4623 +
  4624 + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
  4625 + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
  4626 + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  4627 + $('#primarylaxican').attr("name", $rootScope.primaryLangID);
  4628 + $('#secondLax').append('<option val="' + $rootScope.lexiconRemovedLanguage[i].id + '">' + $rootScope.lexiconRemovedLanguage[i].language + '</option>');
  4629 + $rootScope.lexiconLanguageArray.push({ "id": $rootScope.lexiconRemovedLanguage[i].id, "language": $rootScope.lexiconRemovedLanguage[i].language });
  4630 + $("#lexiconLangDropdown option").each(function () {
  4631 + if($rootScope.lexiconPrimaryLanguage == $(this).val()){
  4632 + $(this).remove();
  4633 + }
  4634 + });
  4635 + }
  4636 +
  4637 + //$("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  4638 + //$('#primarylaxican').attr("name", $rootScope.primaryLangID);
  4639 +
  4640 + }
  4641 + }
  4642 + else if (languageDifference < 0) {
  4643 + languageDifference = Math.abs(languageDifference);
  4644 + for (var i = 1; i <= languageDifference; i++) {
  4645 + var lexiconArrayLength = $rootScope.lexiconLanguageArray.length;
  4646 +
  4647 + $("#secondLax option").each(function () {
  4648 + if ($rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language == $(this).val()) {
  4649 + $(this).remove();
  4650 + }
  4651 +
  4652 + })
  4653 + $('#lexiconLangDropdown').append('<option val="' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].id + '">' + $rootScope.lexiconLanguageArray[lexiconArrayLength - 1].language + '</option>');
  4654 + $rootScope.lexiconLanguageArray.pop();
  4655 + }
  4656 + if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {
  4657 + }
  4658 + else
  4659 + {
  4660 + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
  4661 + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
  4662 + $("#lexiconLangDropdown option").each(function () {
  4663 + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {
  4664 + $(this).remove();
  4665 + }
  4666 + })
  4667 + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');
  4668 + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  4669 + $('#primarylaxican').attr("name", $rootScope.primaryLangID);
  4670 + }
  4671 + }
  4672 +
  4673 + else if (languageDifference == 0) {
  4674 + if ($rootScope.lexiconPrimaryLanguage == $("#primarylaxican").val()) {
  4675 + // alert("same name");
  4676 + }
  4677 + else {
  4678 + $rootScope.lexiconLanguageArray[0].id = $rootScope.primaryLangID;
  4679 + $rootScope.lexiconLanguageArray[0].language = $rootScope.lexiconPrimaryLanguage;
  4680 + $("#lexiconLangDropdown option").each(function () {
  4681 + if ($rootScope.lexiconPrimaryLanguage == $(this).val()) {
  4682 + $(this).remove();
  4683 + }
  4684 + })
  4685 + $('#lexiconLangDropdown').append('<option val="' + $('#primarylaxican').attr("name") + '">' + $("#primarylaxican").val() + '</option>');
  4686 + $("#primarylaxican").val($rootScope.lexiconPrimaryLanguage);
  4687 + $('#primarylaxican').attr("name", $rootScope.primaryLangID);
  4688 + }
  4689 + }
  4690 + }
  4691 +
  4692 +
  4693 + $rootScope.UpdateSetting = function (setting) {
  4694 +
  4695 + $rootScope.isApplyBtnClicked = true;
  4696 + var isReloadingViewRequired = false;
  4697 + //1.
  4698 + if (typeof (setting.ethnicity) !== "undefined" && setting.ethnicity !== null) {
  4699 + $rootScope.ChangeEthnicity(setting, setting.ethnicity);
  4700 + }
  4701 + if (typeof (setting.modesty) !== "undefined" && setting.modesty !== null) {
  4702 + $rootScope.ChangeModesty(setting, setting.modesty);
  4703 + }
  4704 +
  4705 + //2.
  4706 + if ((setting.ethnicity != null && setting.ethnicity != $rootScope.globalSetting.ethnicity) && (setting.modesty != null && setting.modesty != $rootScope.globalSetting.modesty)) {
  4707 + $rootScope.globalSetting.ethnicity = setting.ethnicity;
  4708 + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity);
  4709 +
  4710 + $rootScope.globalSetting.modesty = setting.modesty;
  4711 + localStorage.setItem("globalModesty", setting.modesty);
  4712 +
  4713 + isReloadingViewRequired = true;
  4714 +
  4715 + }
  4716 +
  4717 + else if (setting.ethnicity != null && setting.ethnicity != $rootScope.globalSetting.ethnicity) {
  4718 +
  4719 + $rootScope.globalSetting.ethnicity = setting.ethnicity;
  4720 + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity);
  4721 +
  4722 + $rootScope.globalSetting.modesty = $rootScope.getLocalStorageValue("globalModesty");
  4723 +
  4724 + isReloadingViewRequired = true;
  4725 + }
  4726 + else if (setting.modesty != null && setting.modesty != $rootScope.globalSetting.modesty) {
  4727 + $rootScope.globalSetting.modesty = setting.modesty;
  4728 + localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty);
  4729 +
  4730 + $rootScope.globalSetting.ethnicity = $rootScope.getLocalStorageValue("globalEthnicity");
  4731 +
  4732 + if ($('.modestyImg') != null) {
  4733 + if (($rootScope.globalSetting.modesty == 'Y')) {
  4734 + $('.modestyImg').css('visibility', 'visible');
  4735 + }
  4736 +
  4737 + else {
  4738 + $('.modestyImg').css('visibility', 'hidden');
  4739 + }
  4740 + }
  4741 +
  4742 + if ($('.transModestyImg') != null) {
  4743 + if (($rootScope.globalSetting.modesty == 'Y')) {
  4744 + $('.transModestyImg').css('visibility', 'visible');
  4745 + }
  4746 +
  4747 + else {
  4748 + $('.transModestyImg').css('visibility', 'hidden');
  4749 + }
  4750 + }
  4751 + $rootScope.changeNavigatorModesty();
  4752 + }
  4753 +
  4754 + var len = $rootScope.openModules.length;
  4755 + if (len > 0) {
  4756 + if (isReloadingViewRequired == true) {
  4757 + $rootScope.reloadChildController();
  4758 + }
  4759 + }
  4760 + else {
  4761 +
  4762 + $('#modal-settings').css("display", "none");
  4763 + $("#modelsettingsbackground").css("display", "none");
  4764 + }
  4765 + $rootScope.lexiconRemovedLanguage = [];
  4766 + $("#secondLax option").each(function () {
  4767 + $rootScope.lexiconRemovedLanguage.push({ "id": $(this).attr("val"), "language": $(this).val() });
  4768 + });
  4769 + };
  4770 +
  4771 +
  4772 +
  4773 +
  4774 +
  4775 +
  4776 +
  4777 +
  4778 +
  4779 +
  4780 +
  4781 +
  4782 + $rootScope.reloadChildController = function () {
  4783 +
  4784 + var len = $rootScope.openModules.length;
  4785 +
  4786 + var currentOpenModuleId = $rootScope.openModules[len - 1].ModuleId;
  4787 +
  4788 + //checking is DA module is opend.
  4789 + if (currentOpenModuleId == 1) {
  4790 +
  4791 + //Check that what current bodyview is open
  4792 + if ($rootScope.openViews.length > 0) {
  4793 + var openViewLen = $rootScope.openViews.length;
  4794 + var currentOpenViewId = $rootScope.getLocalStorageValue("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId;
  4795 + $rootScope.isSettingEventAlredayDispachted = true;
  4796 + $rootScope.$broadcast('reloadDABodyViewEvent', { reloadDABodyViewId: currentOpenViewId }, true);
  4797 + }
  4798 + else {
  4799 + $rootScope.$broadcast('reloadDAControllerEvent', true);
  4800 +
  4801 + }
  4802 + }
  4803 + };
  4804 +
  4805 +
  4806 + $rootScope.changeNavigatorModesty = function () {
  4807 + var currentOpenViewId = $rootScope.getLocalStorageValue("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId;
  4808 +
  4809 + $rootScope.$broadcast('changeNavigatorModestyEvent', { bodyViewId: currentOpenViewId }, true);
  4810 +
  4811 + };
  4812 +
  4813 + $rootScope.ShowExportImageWindow = function () {
  4814 + $(".export-image").modal("show").draggable({ handle: ".modal-header" });
  4815 +
  4816 + $(".modal-backdrop").css("opacity", ".5");
  4817 + $(".modal-backdrop").css("z-index", "1200001");
  4818 + };
  4819 +
  4820 +
  4821 +
  4822 + $rootScope.ShowPrintWindow = function () { // Print Active Viewer
  4823 + html2canvas($("#canvasDiv"), {
  4824 + onrendered: function (canvas) {
  4825 + var dataURL = canvas.toDataURL("image/jpeg");
  4826 + var imageToPrint = new Image();
  4827 + imageToPrint.src = dataURL;
  4828 + $('#snipImage').attr('src', dataURL);
  4829 +
  4830 + $('#spnModule').text($rootScope.currentActiveModuleTitle);
  4831 + $('#spnBodyViewTitle').text($rootScope.getLocalStorageValue('currentViewTitle'));
  4832 +
  4833 + PrintDivContentByID('printBox'); // Open Print Window
  4834 + }
  4835 + });
  4836 + };
  4837 +
  4838 + $rootScope.ShowPrintPreviewWindow = function (event) { // Print Preview
  4839 + if ($location.url() == "/module-item-view") {
  4840 + if ($("#hidePinBtn").hasClass("btn-primary")) {
  4841 + $rootScope.isHidePinBtnActiveInPrintPreview = true;
  4842 + }
  4843 + if ($("#selectedPin").hasClass("btn-primary")) {
  4844 + $rootScope.isShowSelectedPinActiveInPrintPrevMode = true;
  4845 + }
  4846 + if ($("#allPinBtn").hasClass("btn-primary")) {
  4847 + $rootScope.isShowAllPinBtnActiveInPrintPreviewMode = true;
  4848 + }
  4849 + }
  4850 + $(".tools").css("z-index", "1029");
  4851 + $rootScope.CloseListManager();
  4852 + $rootScope.CloseAnnotationTool();
  4853 + $("#annotationButton").parent().addClass("disableMenuannotation");
  4854 + $("#annotationToolBarOptions").addClass("disableMenuoption");
  4855 + $("#optionsListManagerTab").addClass("disableMenuoption");
  4856 + $('#dvPrintPreview').css('display', 'block');
  4857 + html2canvas($("#canvasDiv"), {
  4858 + onrendered: function (canvas) {
  4859 + var dataURL = canvas.toDataURL("image/jpeg");
  4860 + var imageToPrint = new Image();
  4861 + imageToPrint.src = dataURL;
  4862 +
  4863 + OpenJSPanel(); // open jsPanel here
  4864 + if ($('#jsPanel-1').length > 0) {
  4865 + $('.jsPanel-btn-norm').attr('style', 'display: none');
  4866 + }
  4867 +
  4868 + console.log('jsPanel loaded exist= ' + document.getElementById('jsPanel-1')); // document.getElementsByClassName('ppImagePanel'));
  4869 +
  4870 + var curModule = $rootScope.currentActiveModuleTitle;
  4871 + var curPosture = $rootScope.getLocalStorageValue('currentViewTitle');
  4872 +
  4873 + if (document.getElementById('jsPanel-1')) { //document.getElementsByClassName('ppImagePanel')) {
  4874 + if (dataURL == "" || dataURL == undefined) {
  4875 +
  4876 + setTimeout(function () {
  4877 + document.getElementById('imgPortrait').setAttribute('src', dataURL);
  4878 + document.getElementById('imgLandscape').setAttribute('src', dataURL);
  4879 + document.getElementById('spnModulePor').innerHTML = curModule;
  4880 + document.getElementById('spnBodyViewTitlePor').innerHTML = curPosture;
  4881 + document.getElementById('spnModuleLan').innerHTML = curModule;
  4882 + document.getElementById('spnBodyViewTitleLan').innerHTML = curPosture;
  4883 + if ($('#printcontainer').length > 0) {
  4884 + $("#printcontainer").css('width', $(window).outerWidth());
  4885 + $("#printcontainer").css('height', $(window).outerHeight());
  4886 + }
  4887 + if ($location.url() == "/module-item-view") {
  4888 + $("#aaDetailViewCanvas").css("display", "none");
  4889 + $("#canvasPaint").css("display", "none");
  4890 + $("#canvas").css("display", "none");
  4891 +
  4892 + }
  4893 + }, 520);
  4894 + }
  4895 + else {
  4896 + setTimeout(function () {
  4897 + document.getElementById('imgPortrait').setAttribute('src', dataURL);
  4898 + document.getElementById('imgLandscape').setAttribute('src', dataURL);
  4899 + document.getElementById('spnModulePor').innerHTML = curModule;
  4900 + document.getElementById('spnBodyViewTitlePor').innerHTML = curPosture;
  4901 + document.getElementById('spnModuleLan').innerHTML = curModule;
  4902 + document.getElementById('spnBodyViewTitleLan').innerHTML = curPosture;
  4903 + if ($('#printcontainer').length > 0) {
  4904 + $("#printcontainer").css('width', $(window).outerWidth());
  4905 + $("#printcontainer").css('height', $(window).outerHeight());
  4906 + }
  4907 + if ($location.url() == "/module-item-view") {
  4908 + $("#aaDetailViewCanvas").css("display", "none");
  4909 + $("#canvasPaint").css("display", "none");
  4910 + $("#canvas").css("display", "none");
  4911 + }
  4912 + }, 320);
  4913 + }
  4914 +
  4915 + }
  4916 +
  4917 + $('#fileMenuAnchor').parent().addClass('disableFileMenu');
  4918 + if ($('#daImagePanel').length > 0) {
  4919 + console.log('close')
  4920 + //$('#daImagePanel').css('display', 'none');
  4921 + // $('#daImagePanel').remove();
  4922 + }
  4923 + }
  4924 + });
  4925 +
  4926 + if ($location.url() == "/module-item-view") {
  4927 + $timeout(function () {
  4928 + $rootScope.hidePins();
  4929 + }, 100);
  4930 + }
  4931 + $timeout(function () {
  4932 + var $ua = navigator.userAgent;
  4933 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  4934 + var printContainerWidth = $("#printcontainer").css("width");
  4935 + $("#printcontainer").css({ "width": "100%", "min-width": printContainerWidth });
  4936 + var jspanelContainerWidth = $("#jsPanel-1 .jsPanel-content").css("width");
  4937 + $("#jsPanel-1 .jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });
  4938 + $("#jsPanel-1").css("width", "100%");
  4939 +
  4940 + }
  4941 + }, 500)
  4942 + };
  4943 +
  4944 + function OpenJSPanel() {
  4945 + $("#daImagePanel").css({ "pointer-events": "none", "opacity": ".5" });
  4946 + $("#ciImagePanel").css({ "pointer-events": "none", "opacity": ".5" });
  4947 + $("#ImagePanel").css({ "pointer-events": "none", "opacity": ".5" });
  4948 + $.jsPanel({
  4949 + id: 'jsPanel-1',
  4950 + selector: '#dvPrintPreview',
  4951 + theme: 'success',
  4952 + currentController: 'HomeController',
  4953 + //parentSlug: 'da-view-list', //After closing panel, control moves to here
  4954 + ajax: {
  4955 + url: 'app/views/home/printPreview.html'
  4956 + },
  4957 + title: $rootScope.getLocalStorageValue("currentViewTitle"),
  4958 + position: {
  4959 + top: 70,
  4960 + left: 1,
  4961 + },
  4962 + controls: { buttons: 'closeonly' },
  4963 + size: { width: $(window).outerWidth(), height: $(window).outerHeight() + 60 },
  4964 + //size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 },
  4965 + });
  4966 + }
  4967 + $rootScope.getLocalStorageValue = function (localStorageParam) {
  4968 +
  4969 +
  4970 +
  4971 + if ((localStorage.getItem('loggedInUserDetails') == null) && ($rootScope.isVisibleLogin == false)) {
  4972 + if ($location.url().indexOf('?em') == -1 && $location.url().indexOf('?unb') == -1)
  4973 + $rootScope.LogoutUser();
  4974 +
  4975 +
  4976 + }
  4977 + else {
  4978 + return localStorage.getItem(localStorageParam);
  4979 + }
  4980 +
  4981 +
  4982 + }
  4983 + // $(<parent>).on('<event>', '<child>', callback);
  4984 + $(document).on('change', 'input[name=inlineRadioOptions]', function () {
  4985 + if ($(this).attr("value") == "Portrait") {
  4986 + $(".print-box").not(".portrait-box").hide();
  4987 + $(".portrait-box").show();
  4988 + }
  4989 + if ($(this).attr("value") == "Landscape") {
  4990 + $(".print-box").not(".landscape-box").hide();
  4991 + $(".landscape-box").show();
  4992 + }
  4993 + });
  4994 +
  4995 + $(document).on('change', '#printPSOptions', function () {
  4996 + var option = $('#printPSOptions').find(":selected").text();
  4997 + switch (option) {
  4998 + case ("10%"):
  4999 + ResizeImage(0.1);
  5000 + break;
  5001 + case ("25%"):
  5002 + ResizeImage(0.25);
  5003 + break;
  5004 + case ("50%"):
  5005 + ResizeImage(0.5);
  5006 + break;
  5007 + case ("75%"):
  5008 + ResizeImage(.75);
  5009 + break;
  5010 + case ("65%"):
  5011 + ResizeImage(0.65);
  5012 + break;
  5013 + case ("100%"):
  5014 + ResizeImage(1);
  5015 + break;
  5016 + case ("150%"):
  5017 + ResizeImage(1.5);
  5018 + break;
  5019 + case ("200%"):
  5020 + ResizeImage(2);
  5021 + break;
  5022 + case ("500%"):
  5023 + ResizeImage(5);
  5024 + break;
  5025 + case ("Auto"):
  5026 + ResizeImage(0);
  5027 + break;
  5028 + default:
  5029 + ResizeImage(0);
  5030 + }
  5031 + });
  5032 +
  5033 + $(document).on('click', '#btnPrint', function () {
  5034 + PrintDivContentByID('printBoxPor');
  5035 + });
  5036 +
  5037 + function PrintDivContentByID(id) {
  5038 +
  5039 + if (id == 'printBoxPor') {
  5040 + $("#printPSOptions").val("100%");
  5041 + ResizeImage(1);
  5042 + }
  5043 + var contents = document.getElementById(id).innerHTML;
  5044 + // code for printng in ipads
  5045 + var $ua = navigator.userAgent;
  5046 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  5047 + $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
  5048 + html2canvas($("#canvasDiv"), {
  5049 + onrendered: function (canvas) {
  5050 + var imgsrc = canvas.toDataURL("image/png");
  5051 + var printContent = '<div id="img1"><img src="' + imgsrc + '" id="newimg1" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>';
  5052 + var newPrintWindow = window.open();
  5053 + $(newPrintWindow.document.body).html(printContent);
  5054 + newPrintWindow.print();
  5055 + }
  5056 + });
  5057 + }
  5058 + else {
  5059 + var frame1 = $('<iframe />');
  5060 + frame1[0].name = "frame1";
  5061 + frame1.css({ "position": "absolute", "top": "-1000000px" });
  5062 + $("body").append(frame1);
  5063 + var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
  5064 + frameDoc.document.open();
  5065 + //Create a new HTML document.
  5066 + frameDoc.document.write('<html><head><title></title>');//Print Preview
  5067 + frameDoc.document.write('</head><body>');
  5068 + //Append the external CSS file.
  5069 + frameDoc.document.write('<link href="content/css/print-Portrait.css" rel="stylesheet" type="text/css" />');
  5070 + frameDoc.document.write('<link href="content/css/print-main.css" rel="stylesheet" type="text/css" />');
  5071 + //Append the DIV contents.
  5072 + frameDoc.document.write(contents);
  5073 + frameDoc.document.write('</body></html>');
  5074 + frameDoc.document.close();
  5075 + setTimeout(function () {
  5076 + window.frames["frame1"].focus();
  5077 + window.frames["frame1"].print();
  5078 + frame1.remove();
  5079 + }, 320);
  5080 + }
  5081 + console.log('close');
  5082 + }
  5083 +
  5084 + $(document).on('click', '#jsPanel-1 .jsglyph-remove', function () {
  5085 + $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" });
  5086 + $("#ciImagePanel").css({ "pointer-events": "auto", "opacity": "1" });
  5087 + $("#ImagePanel").css({ "pointer-events": "auto", "opacity": "1" });
  5088 + $("#annotationButton").parent().removeClass("disableMenuannotation");
  5089 + $("#annotationToolBarOptions").removeClass("disableMenuoption");
  5090 + $("#optionsListManagerTab").removeClass("disableMenuoption");
  5091 + $('#fileMenuAnchor').parent().removeClass('disableFileMenu');
  5092 + if ($location.url() == "/module-item-view") {
  5093 + $("#aaDetailViewCanvas").css("display", "block");
  5094 + $("#canvasPaint").css("display", "block");
  5095 + $("#canvas").css("display", "block");
  5096 + }
  5097 + if ($('#jsPanel-1').length > 0)
  5098 + $('#jsPanel-1').remove();
  5099 + console.log('close');
  5100 +
  5101 + });
  5102 +
  5103 + $rootScope.restrictBodySystemList = function () {
  5104 + var RestrictListDiv = document.getElementById("restrictListDiv");
  5105 + if (RestrictListDiv.style.display == 'block') {
  5106 + RestrictListDiv.style.display = 'none';
  5107 + $(".restrict-carret-icon").css({ "transform": "rotate(0deg)", "-moz-transform": "rotate(0deg)", "-webkit-transform": "rotate(0deg)", "-ms-transform": "rotate(0deg)" });
  5108 + return;
  5109 + }
  5110 + RestrictListDiv.style.display = 'block';
  5111 + $(".restrict-carret-icon").css({ "transform": "rotate(90deg)", "-moz-transform": "rotate(90deg)", "-webkit-transform": "rotate(90deg)", "-ms-transform": "rotate(90deg)" });
  5112 +
  5113 + }
  5114 +
  5115 + $rootScope.OpenAdminForm = function (userInfo) {
  5116 + $('#adminModal').css({ top: '50px' });
  5117 + if ($rootScope.userData) {
  5118 + $('#adminfName').val($rootScope.userData.FirstName);
  5119 + $('#adminlName').val($rootScope.userData.LastName);
  5120 + $('#adminEmailId').val($rootScope.userData.EmailId);
  5121 + }
  5122 + };
  5123 +
  5124 + $rootScope.SendAdminAccessRequestMail = function (userInfo) {
  5125 +
  5126 + if ($rootScope.userData) {
  5127 + userInfo.firstName = $rootScope.userData.FirstName;
  5128 + userInfo.lastName = $rootScope.userData.LastName;
  5129 + userInfo.emailId = $rootScope.userData.EmailId;
  5130 + }
  5131 +
  5132 + AdminService.SendAdminAccessRequestMail(userInfo)
  5133 + .then(function (result) {
  5134 + if (result == AdminConstants.MAIL_SENT) {
  5135 + $rootScope.errorMessage = AdminConstants.MAIL_SENT_SUCCESS_MESSAGE;
  5136 + $("#messageModal").modal('show');
  5137 + }
  5138 + $("#adminModal").fadeOut();
  5139 + $("#adminModal").modal('hide');
  5140 + $('[name="adminAccessTextArea"]').val('');
  5141 + },
  5142 + function (error) {
  5143 + console.log(' Error in sending mail to admin support = ' + error.statusText);
  5144 + $rootScope.errorMessage = AdminConstants.ERROR_IN_SENDING_MAIL;
  5145 + $("#messageModal").modal('show');
  5146 + });
  5147 + };
  5148 +
  5149 + $rootScope.CloseAAModal = function () {
  5150 + $("#adminModal").fadeOut();
  5151 + $("#adminModal").modal('hide');
  5152 + $("adminAccessTextArea").text('');
  5153 + }
  5154 +
  5155 +
  5156 + $rootScope.addToolTip = function (toolTipTopPosition, toolTipLeftPosition, toolTipWidth, toolTipText) {
  5157 +
  5158 + $("#cursor-block").addClass("custom-tooltip-annotation-toolbar");
  5159 + $(".custom-tooltip-annotation-toolbar").css({ "display": "block", "top": toolTipTopPosition + "px", "width": toolTipWidth + "px", "left": toolTipLeftPosition + "px" });
  5160 + $("#cursor-block").html(toolTipText);
  5161 + }
  5162 +
  5163 + $rootScope.removeToolTipOnMouseOut = function () {
  5164 +
  5165 + $(".custom-tooltip-annotation-toolbar").css('display', 'none');
  5166 + $("#cursor-block").removeClass("custom-tooltip-annotation-toolbar");
  5167 + $("#cursor-block").html();
  5168 +
  5169 + }
  5170 + var $ue = navigator.userAgent;
  5171 + if (($ue.match(/(iPod|iPhone|iPad|android)/i))) {
  5172 +
  5173 + $("#text_area").click(function () {
  5174 + $("#annotationTextModal").draggable('disable');
  5175 + }).blur(function () {
  5176 + $("#annotationTextModal").draggable('enable');
  5177 + });
  5178 + }
  5179 + $rootScope.CheckRefresh = function (e) {
  5180 + //Checking if 'REFRESHED' or 'RELOADED'
  5181 + if ((e.keyCode === 116) || (e.keyCode == 82 && e.ctrlKey))
  5182 + $location.path('/'); //Redirecting to landing page
  5183 + };
  5184 +
  5185 + $rootScope.resetDrawing = function (e) {
  5186 +
  5187 + $('#canvas').removeLayers();
  5188 +
  5189 + };
  5190 +
  5191 +}]
  5192 +);
  5193 +
  5194 +
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
1   -<!DOCTYPE html>
2   -<html lang="en" ng-cloak ng-app="AIA">
3   -<head>
4   - <!--<base href="/AIAHTML5/" />-->
5   - <!--<base href="/AIA/" />-->
6   - <base href="/" />
7   - <meta charset="utf-8">
8   - <meta http-equiv="X-UA-Compatible" content="IE=edge">
9   - <!--<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">-->
10   - <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0 maximum-scale=1.0" />
11   - <title>A.D.A.M. Interactive Anatomy</title>
12   -
13   - <link href="themes/default/css/bootstrap/3.3.6/bootstrap.css" rel="stylesheet" />
14   -
15   -
16   -
17   -
18   - <link href="themes/default/css/bootstrap/3.3.6/main.css" rel="stylesheet" />
19   -
20   - <link href="themes/default/css/bootstrap/3.3.6/secondeffect.css" rel="stylesheet" />
21   -
22   - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
23   - <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,800,700,600,400italic">
24   -
25   - <!--<link rel="styleSheet" href="themes/default/css/uigrid/ui-grid.min.css" />-->
26   - <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
27   - <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
28   - <!--[if lt IE 9]>
29   - <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
30   - <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
31   - <![endif]-->
32   - <link href="themes/default/css/bootstrap/3.3.6/jquery.mCustomScrollbar.css" rel="stylesheet" />
33   -
34   - <link href="themes/default/css/bootstrap/3.3.6/jquery-ui.css" rel="stylesheet" />
35   -
36   - <link href="libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css" rel="stylesheet" />
37   - <link href="libs/video_4_12_11/css/video-js_4_12_11.css" rel="stylesheet" />
38   - <link href="libs/jquery/jquery_plugin/SpeechBubble/css/bubble.css" rel="stylesheet" />
39   - <link href="libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.css" rel="stylesheet" />
40   - <link href="themes/default/css/bootstrap/3.3.6/jquery.minicolors.css" rel="stylesheet" />
41   - <link href="content/css/print-main.css" rel="stylesheet" />
42   -
43   - <!--Annotation Toolbar: Jcanvas-->
44   - <style>
45   - /*.ActiveDefaultColorAnnotation {
46   - background-color: #000000!important;
47   - }*/
48   -
49   -
50   - #termList option:hover {
51   - background-color: #3399FF !important;
52   - color: #fff !important;
53   - }
54   -
55   -
56   - .ActiveFormattingButtonClass {
57   - background-color: #1B92D0 !important;
58   - }
59   -
60   - .Edittext-btn-css {
61   - background: #4B4B4B;
62   - padding: 4px;
63   - cursor: pointer;
64   - margin-right: 2px;
65   - }
66   -
67   - /*.italic-btn-css {
68   - background: #4B4B4B;
69   - padding: 4px;
70   - cursor: pointer;
71   - margin-right: 2px;
72   - }*/
73   -
74   - .underline-btn-css {
75   - background: #4B4B4B;
76   - padding: 4px;
77   - cursor: pointer;
78   - margin-right: 5px;
79   - }
80   -
81   -
82   -
83   - .activebtncolor {
84   - background-color: #1B92D0 !important;
85   - border-color: #1B92D0 !important;
86   - color: #ffffff !important;
87   - }
88   -
89   - .btn-black-annotation {
90   - background-color: #4b4b4b;
91   - border-color: #3f3f3f;
92   - color: #ffffff;
93   - }
94   -
95   - /*.btn-black-annotation:hover {
96   - background-color: #1B92D0 !important;
97   - border-color: #1B92D0 !important;
98   - color: #ffffff !important;
99   - }*/
100   -
101   - .custom-tooltip-annotation {
102   - background-color: #fff;
103   - border: 0 none;
104   - color: #000;
105   - left: -52px;
106   - opacity: 0.9;
107   - padding: 3px 0;
108   - position: absolute;
109   - text-align: center;
110   - top: 41px;
111   - width: 120px;
112   - display: none;
113   - z-index: 10000;
114   - border: 1px solid #000;
115   - color: #000;
116   - border-radius: 0;
117   - }
118   -
119   - /*7931*/
120   - .custom-tooltip-annotation-edit {
121   - background-color: #fff;
122   - border: 0 none;
123   - color: #000;
124   - left: 80px;
125   - opacity: 0.9;
126   - padding: 3px 0;
127   - position: absolute;
128   - text-align: center;
129   - bottom: 50px;
130   - width: 120px;
131   - display: none;
132   - z-index: 10000;
133   - border: 1px solid #000;
134   - color: #000;
135   - border-radius: 0;
136   - }
137   -
138   - .custom-tooltip-annotation-toolbar {
139   - background-color: #fff;
140   - border: 0 none;
141   - color: #000;
142   - opacity: 0.9;
143   - padding: 3px 0;
144   - position: absolute;
145   - text-align: center;
146   - display: none;
147   - z-index: 10000;
148   - border: 1px solid #000;
149   - color: #000;
150   - border-radius: 0;
151   - }
152   -
153   - .restrict-carret-icon {
154   - font-size: 18px;
155   - position: relative;
156   - top: 1px;
157   - }
158   -
159   - #refreshBtn {
160   - color: #ffffff;
161   - }
162   - </style>
163   -
164   -
165   -
166   -</head>
167   -<body ng-controller="HomeController" id="bo" ng-init="initializeAIA()" ng-keydown="CheckRefresh($event)">
168   - <div ng-hide="isVisibleResetPass">
169   - <div id="login" ng-show="isVisibleLogin">
170   -
171   - <div class="container-fluid loginBg">
172   - <div class="row">
173   - <div class="col-xs-12 text-center">
174   - <a href="index.html" class="loginLogo"><img src="content/images/common/logo-large.png" class="img-responsive" alt=""></a>
175   - <div class="headerBand row">
176   - <div class="col-xs-12">
177   - <h1>A.D.A.M. Interactive Anatomy</h1>
178   - <p>The most compresive online interactive anatomy learning resource</p>
179   - </div>
180   - </div>
181   - </div>
182   - <!--LOGIN PANEL-->
183   - <div class="col-xs-12 loginPanel">
184   - <div class="loginBox clearfix">
185   - <div class="col-xs-12">
186   - <!--<strong>Login</strong>-->
187   - <form>
188   - <div class="form-group">
189   - <!--<label for="">User ID</label>-->
190   - <!--input type="email" class="form-control" placeholder="User ID">
191   - <span class="help-block text-right small"><a href="#" class="color-white">Forgot User ID?</a></span>-->
192   -
193   -
194   - <div class="input-group">
195   - <span class="input-group-addon"><i class="fa fa-user"></i></span>
196   - <input type="text" class="form-control" placeholder="Username" ng-model="userInfo.username">
197   - </div>
198   - <span class="help-block text-right small"><a href="#" class="color-white" id="forgotUserIdAnchor" data-toggle="modal" ng-click="forgotUserModalShow()" data-target=".forgot-sm">Forgot User ID?</a></span>
199   -
200   -
201   - </div>
202   - <div class="form-group">
203   - <!--<label for="">Password</label>-->
204   - <!--<input type="password" class="form-control" placeholder="Password">
205   - <span class="help-block text-right small "><a href="#" class="color-white">Forgot Password?</a></span>-->
206   - <div class="input-group">
207   - <span class="input-group-addon"><i class="fa fa-key"></i></span>
208   - <input type="password" class="form-control" placeholder="Password" ng-model="userInfo.password">
209   - </div>
210   - <span class="help-block text-right small "><a class="color-white" style="cursor: pointer;" id="forgotPasswordAnchor" data-toggle="modal" ng-click="forgotPwdModalShow();" data-target=".forgot-sm1">Forgot Password?</a></span> <!--#resetpass" href="/app/views/Home/resetPwd.html"-->
211   - </div>
212   - <div class="form-group">
213   - <button class="btn btn-primary pull-right" ng-click="AuthenticateUser(userInfo)">Log In</button>
214   - </div>
215   - </form>
216   - </div>
217   - </div>
218   - <div class="loginExBtn">
219   - <a href="https://store.adameducation.com/" target="_blank" class="btn btn-primary">Subscribe Now</a>
220   - <a href="http://adameducation.com/aiaonline" target="_blank" class="btn btn-primary pull-right">Learn More</a>
221   - </div>
222   - </div>
223   - </div>
224   - </div>
225   -
226   - <!-- Footer -->
227   - <footer class="dark">
228   - <div class="container-fluid text-center">Copyright &copy; 2017 Ebix Inc. All rights reserved.</div>
229   - </footer>
230   - </div>
231   - <!-- Forgot User ID (Small modal) -->
232   - <div class="modal fade" id="forgotUserModal" role="dialog" tabindex="-1" aria-labelledby="exampleModalLabel" data-target=".forgot-sm">
233   - <div class="modal-dialog modal-small" role="document">
234   - <div class="modal-content">
235   - <div class="modal-header">
236   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
237   - <h5 class="modal-title" id="exampleModalLabel">Enter your email id to recover User id</h5>
238   - </div>
239   - <div class="modal-body">
240   - <form id="forgetUSerIdForm">
241   - <div class="form-group">
242   - <div class="input-group">
243   - <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
244   - <input id="btnEmail" class="form-control" placeholder="Email" type="email" ng-model="userInfo.emailId">
245   - </div>
246   - </div>
247   - </form>
248   - </div>
249   - <div class="modal-footer" style="padding-bottom:10px;">
250   - <button type="button" class="btn btn-primary btn-block" ng-click="SendMailToUser(userInfo, false)">Send Mail</button>
251   - </div>
252   - <!--<div style="color: maroon; font-weight: bold; " ng-if="message">{{message}}</div>-->
253   - </div>
254   - </div>
255   - </div>
256   - <!-- Forgot Password (Small modal) -->
257   - <div class="modal fade" id="forgotPwdModal" role="dialog" tabindex="-1" aria-labelledby="exampleModalLabel" data-target=".forgot-sm1">
258   - <div class="modal-dialog modal-small" role="document">
259   - <div class="modal-content">
260   - <div class="modal-header">
261   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
262   - <h5 class="modal-title" id="exampleModalLabel">Enter your email id to unblock/ recover Password</h5>
263   - </div>
264   - <div class="modal-body" style="padding: 15px;">
265   - <form id="forgetPwdForm" class="ng-pristine ng-valid ng-valid-email">
266   - <div class="form-group">
267   - <div class="">
268   - <label class="radio-inline">
269   - <input name="inlineRadioOptions" id="inlineRadio1" value="unblock" type="radio"> Unblock
270   - </label>
271   - <label class="radio-inline">
272   - <input name="inlineRadioOptions" id="inlineRadio2" value="forgotpwd" type="radio"> Forgot Password
273   - </label>
274   - </div>
275   - </div>
276   -
277   -
278   - <div class="form-group">
279   - <div class="input-group" style="margin-top: 8px;">
280   - <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
281   - <input id="btnEmail2" class="form-control ng-pristine ng-untouched ng-valid ng-valid-email" placeholder="Email" ng-model="userInfo.emailId" type="email">
282   - </div>
283   - </div>
284   - </form>
285   - </div>
286   - <div class="modal-footer modal-footer-forgot-password" style="padding-bottom:10px;">
287   - <button type="button" class="btn btn-primary btn-block" ng-click="SendMailToUser(userInfo, true)">Send Mail</button>
288   - </div>
289   - <!--<div style="color: maroon; font-weight: bold; " ng-if="message">{{message}}</div>-->
290   - </div>
291   - </div>
292   - </div>
293   - <div id="index" ng-hide="isVisibleLogin">
294   - <div class="container-fluid ">
295   - <!--Header-->
296   -
297   - <nav class="navbar navbar-inverse navbar-fixed-top">
298   - <div class="container-fluid">
299   - <!-- Brand and toggle get grouped for better mobile display -->
300   - <div class="navbar-header">
301   - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false">
302   - <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
303   - </button>
304   - <a class="frameLogo navbar-brand"><img src="content/images/logo-main.png" class="img-responsive" alt=""></a>
305   - </div>
306   - <div ng-include="'app/widget/TopMenu.html'"></div>
307   - </div>
308   - </nav>
309   - <div class="bodyWrap row container-fluid">
310   -
311   - <div id="spinner" class="spinner" ng-show="isLoading" style="visibility:hidden">
312   - <img id="img-spinner" src="content/images/common/loading.gif" alt="Loading" />
313   - </div>
314   - <div ng-view></div>
315   -
316   - </div>
317   - </div>>
318   -
319   -
320   -
321   - <div class="modal fade" id="ShowListManager" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" ng-init="tab = 1" style="width:27%;left:50%;overflow:hidden;height:500px;top:100px">
322   - <div class="modal-dialog" role="document" style="width:400px;">
323   - <div class="modal-content" style="width:100%;max-width:400px;">
324   - <div class="modal-header setting-modal-header" style="padding: 5px 10px; border-bottom: 1px solid #e5e5e5;">
325   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
326   - <h4 class="modal-title" id="myModalLabel">Setting</h4>
327   - </div>
328   - <div class="modal-body">
329   - <div class="row" style="padding-top:20px;">
330   - <div class="col-sm-12">
331   -
332   - <div aria-label="..." role="group" class="btn-group btn-group-justified">
333   - <div role="group" class="btn-group">
334   - <button class="btn btn-sm btn-success" type="button" ng-click="tab = 1">Appearance</button>
335   - </div>
336   - <div role="group" class="btn-group">
337   - <button class="btn btn-sm btn-success" type="button" ng-click="tab = 2">Lexicons</button>
338   - </div>
339   - <div role="group" class="btn-group">
340   - <button class="btn btn-sm btn-success" type="button" ng-click="tab = 3">Dissectible</button>
341   - </div>
342   - </div>
343   -
344   - </div>
345   -
346   -
347   - <div class="col-sm-12" ng-show="tab === 1">
348   -
349   -
350   - <div class="row">
351   - <div class="center-block col-md-11" style="float: none; background-color:#E2E2E2;height:300px;">
352   - <div class="row" style="padding-top: 22px;">
353   - <div class="center-block col-md-10" style="float: none; ">
354   - <h5><strong>System Font</strong></h5>
355   -
356   - <div style="border:2px solid #ACACAC;float:left;padding:15px;background-color:#CCCCCC;">
357   - <div class="col-md-3" style="padding-left:0px;">
358   - Sample
359   - </div>
360   - <div class="col-md-6" style="padding-right:0px;">
361   - <input type="text" value="" style="width:85%;">
362   - </div>
363   - <div class="col-md-3" style="padding-left:0px;">
364   - <button class="btn btn-primary" style="margin-bottom:5px;">Change</button>
365   - <button class="btn btn-primary" style="margin-bottom:5px;">Default</button>
366   - </div>
367   -
368   - </div>
369   - </div>
370   - </div>
371   -
372   - </div>
373   - </div>
374   -
375   - </div>
376   - <div class="col-sm-12" ng-show="tab === 2">
377   -
378   -
379   - <div class="row">
380   - <div class="center-block col-md-11" style="float: none; background-color:#E2E2E2;height:300px;">
381   - <div class="col-md-6">
382   - <h6><strong>Primary Lexicon</strong></h6>
383   - <input type="text" value="English" style="width:90%;">
384   - <button class="btn btn-primary" style="float:right;margin-bottom:5px;margin-top:5px;">Change</button>
385   - <h6>Secondry Lexicon</h6>
386   - <textarea style="width:90%;"></textarea>
387   - <button>Change</button>
388   - <button>Change</button>
389   - </div>
390   - <div class="col-md-6">
391   - <h6>Available Lexicon</h6>
392   - <select multiple class="form-control" id="sel2">
393   - <option>1</option>
394   - <option>2</option>
395   - <option>3</option>
396   - <option>4</option>
397   - <option>5</option>
398   - </select>
399   -
400   - <p>Note: Some languages require special system fonts to display correctly</p>
401   - </div>
402   -
403   - </div>
404   - </div>
405   -
406   - </div>
407   - <div class="col-sm-12" ng-show="tab === 3">
408   -
409   - <div class="row">
410   - <div class="center-block col-md-11" style="float: none; background-color:#E2E2E2;height:300px;">
411   - <h6>Skin Tones</h6>
412   - <div class="center-block col-md-8" style="float: none;">
413   - <div class="col-md-6">
414   - <img class="img-responsive" alt="" src="http://placehold.it/400x300">
415   - </div>
416   - <div class="col-md-6">
417   - <img class="img-responsive" alt="" src="http://placehold.it/400x300">
418   - </div>
419   - <div class="col-md-6">
420   - <img class="img-responsive" alt="" src="http://placehold.it/400x300">
421   - </div>
422   - <div class="col-md-6">
423   - <img class="img-responsive" alt="" src="http://placehold.it/400x300">
424   - </div>
425   -
426   - </div>
427   - <h6>Modesty Setting</h6>
428   - <div class="col-md-6">
429   - <div class="col-md-4">
430   - <img class="img-responsive" alt="" src="http://placehold.it/400x300">
431   - </div>
432   - <div class="col-md-8">
433   -
434   - <div class="radio">
435   - <label><input type="radio" name="optradio" checked>On</label>
436   - </div>
437   - <div class="radio">
438   - <label><input type="radio" name="optradio">Off</label>
439   - </div>
440   -
441   - </div>
442   - </div>
443   - <div class="col-md-6">
444   - <h6>Annotaion</h6>
445   - <div class="checkbox">
446   - <label><input type="checkbox" value="" checked>Erase Annotations when changeing layers</label>
447   - </div>
448   - </div>
449   - </div>
450   -
451   - </div>
452   -
453   -
454   -
455   - </div>
456   - </div>
457   - <div class="modal-footer">
458   - <button type="button" class="btn btn-primary">Ok</button>
459   - <button type="button" class="btn btn-primary" data-dismiss="modal">Cancle</button>
460   - <button type="button" class="btn btn-primary">Apply</button>
461   - </div>
462   - </div>
463   - </div>
464   - </div>
465   - </div>
466   -
467   - <!--Settings modal-->
468   - <!--<div id="modal-settings" style="z-index: 1000000000; background: white;width: 302px;position:absolute;left:40%;right:0;top:70px;">-->
469   - <div id="modelsettingsbackground" style="background-color: black; bottom: 0; display: none; height: 100%; left: 0; opacity: 0.5; position: fixed; right: 0; top: 0; width: 100%; z-index: 12000000;"></div>
470   - <div id="modal-settings" style="display:none;z-index: 1000000000;height:auto;width: 300px;position:absolute;left:40%;right:0;top:70px;">
471   - <div role="document">
472   - <form>
473   - <div ng-init="loadsettings()" class="modal-content" id="setting-modal-dark">
474   - <div class="modal-header annotation-modal-header">
475   - <button type="button" class="close" data-dismiss="modal" ng-click="CloseSetting()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
476   - <h4 class="modal-title" id="myModalLabel2">Settings</h4>
477   - </div>
478   - <div class="modal-body">
479   - <div class="paddTop15">
480   - <!-- Nav tabs -->
481   - <ul class="nav nav-tabs" role="tablist">
482   - <li role="presentation" ng-class="{'active':SettingsTab==1}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(1)">Appearance</a></li>
483   - <li role="presentation" ng-class="{'active':SettingsTab==2}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(2);lexiconData()">Lexicons</a></li>
484   - <li role="presentation" ng-class="{'active':SettingsTab==3}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(3)">Dissectible</a></li>
485   -
486   - </ul>
487   - <!-- Tab panes -->
488   - <div class="tab-content">
489   - <div role="tabpanel" ng-class="{'tab-pane active' : SettingsTab === 1,'tab-pane' : SettingsTab !==1 }" id="appearance">
490   - <div class="row">
491   - <div class="col-sm-12">
492   - <div class="well well-sm no-margin-btm">
493   - <h5>System Font</h5>
494   - <div class="form-group">
495   - <label for="SystemFont" class="font13">Sample</label>
496   - <input type="text" class="form-control" id="SystemFont" value="AaBbYyZz" disabled>
497   - </div>
498   - <button class="btn btn-success btn-sm" data-toggle="modal" data-target="#modal-change">Change</button>
499   - <button class="btn btn-success btn-sm">Default</button>
500   - </div>
501   - </div>
502   - </div>
503   - </div>
504   - <div role="tabpanel" ng-class="{'tab-pane active' : SettingsTab === 2,'tab-pane' : SettingsTab !==2 }" id="lexicons">
505   - <div class="row paddingTopBtm10">
506   - <div class="col-sm-6">
507   - <div class="form-group">
508   - <label for="SystemFont" class="font13">Primary Lexicon</label>
509   - <input type="text" id="primarylaxican" class="form-control" value="English" name="1" disabled>
510   - <button class="btn btn-sm btn-success btn-block marginTop5" id="laxicanlanguageChagne" disabled>Change</button>
511   - </div>
512   -
513   - <div class="form-group">
514   - <label for="SystemFont" class="font13">Secondary Lexicons</label>
515   - <!--<textarea class="form-control" rows="3">-->
516   - <select class="form-control" size="5" id="secondLax"></select>
517   - <!--</textarea>-->
518   - </div>
519   - <div class="form-group">
520   - <button class="btn btn-sm btn-success" id="laxiconLangAdd" disabled>Add</button>
521   - <button class="btn btn-sm btn-success" id="laxiconLangRemove">Remove</button>
522   - </div>
523   - </div>
524   - <div class="col-sm-6" style="padding-left:13px;padding-right:13px;">
525   - <div class=" form-group">
526   - <label for="SystemFont" class="font13">Available Lexicons</label>
527   - <select class="form-control" size="8" id="lexiconLangDropdown"></select>
528   - </div>
529   - <p class="font11"><strong>Note :</strong> Some languages require special system fonts to display correctly</p>
530   - </div>
531   - <div class="clearfix"></div>
532   - </div>
533   - </div>
534   - <div role="tabpanel" id="dissectible" ng-class="{'tab-pane active' : SettingsTab === 3,'tab-pane' : SettingsTab !==3 }">
535   - <div class="">
536   - <div class="col-sm-12">
537   - <h5 class="bolder font13 no-margin-top">Skin Tones</h5>
538   - <div class="skin-tones">
539   - <div align="center">
540   - <div class="col-sm-5">
541   - <button id="btnEthnicW" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'W')">
542   - <img src="~/../content/images/common/skin1.jpg" alt="">
543   - </button>
544   - </div>
545   - <div class="col-sm-5">
546   - <button id="btnEthnicB" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'B')">
547   - <img src="~/../content/images/common/skin2.jpg" alt="">
548   - </button>
549   - </div>
550   - <div class="col-sm-5">
551   - <button id="btnEthnicL" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'A')">
552   - <img src="~/../content/images/common/skin3.jpg" alt="">
553   - </button>
554   - </div>
555   - <div class="col-sm-5">
556   - <button id="btnEthnicA" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'L')">
557   - <img src="~/../content/images/common/skin4.jpg" alt="">
558   - </button>
559   - </div>
560   - </div>
561   - </div>
562   -
563   - </div>
564   - </div>
565   - <div class="">
566   - <div class="col-sm-6">
567   - <h5 class="font13 bolder">Modesty Settings</h5>
568   - <img src="~/../content/images/common/adam-leaf.png" alt="" class="pull-left marginR5">
569   - <div class="radio">
570   - <label>
571   - <input type="radio" ng-checked="isModestyOn" ng-model="formsetting.modesty" value="Y" name="modestyRadios" id="modon" ng-click="ChangeModesty(formsetting,'Y')">
572   - <span class="">On</span>
573   - </label>
574   - </div>
575   - <div class="radio">
576   - <label>
577   - <input type="radio" ng-checked="isModestyOff" ng-model="formsetting.modesty" value="N" name="modestyRadios" id="modoff" ng-click="ChangeModesty(formsetting,'N')">
578   - <span class="">Off</span>
579   - </label>
580   - </div>
581   - </div>
582   - <div class="col-sm-6">
583   - <h5 class="font13 bolder">Annotation</h5>
584   - <div class="checkbox no-margin">
585   - <!--Settings > The entire highlighted part should be active-->
586   - <label class="font11 no-margin-btm">
587   - <input type="checkbox" value="" checked>
588   - Erase Annotations when changing layers
589   - </label>
590   - </div>
591   - </div>
592   - </div>
593   - </div>
594   - </div>
595   - </div>
596   - </div>
597   - <div class="modal-footer">
598   - <button type="button" class="btn btn-primary" ng-click="UpdateAndCloseSetting(formsetting)">OK</button>
599   -
600   - <!--<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>-->
601   - <button type="button" class="btn btn-primary" ng-click="CloseSetting()">Cancel</button>
602   - <button type="button" class="btn btn-primary" ng-click="UpdateSetting(formsetting)">Apply</button>
603   - </div>
604   - </div>
605   - </form>
606   - </div>
607   - </div>
608   - <div id="setting-spinner" style="display:none;position: fixed; top: 50%; left: 50%; margin-left: -50px; z-index: 15000; overflow: auto; width: 100px;">
609   - <img id="img-spinner" src="content/images/common/loading.gif" alt="Loading">
610   - </div>
611   - <!--Annotation Modal-->
612   - <div class="annotationTollbar" style="width: 300px;position: fixed; top: 80px; right: 20px; display: none; z-index: 1200000;">
613   - <div class="annotationbar">
614   - <div class="modal-content">
615   - <div class="modal-header annotation-modal-header">
616   - <button type="button" class="close" aria-label="Close" ng-click="CloseAnnotationTool()"><span aria-hidden="true">&times;</span></button>
617   - <h4 class="modal-title" id="myModalLabel">Annotation</h4>
618   - </div>
619   - <div class="modal-body" id="AnnotaionPopupDiv">
620   - <div class="row">
621   - <div class="col-sm-12">
622   - <h5>Mode</h5>
623   -
624   - <div class="btn-group btn-group-justified" role="group" aria-label="...">
625   - <div class="btn-group" role="group" tooltip>
626   - <div id="identify-block" style="display: none; font-size:13px;">Identify Mode</div>
627   - <button id="OnIdentify" type="button" class="btn btn-sm btn-success" ng-click="OnIdentifyClick()">Identify</button>
628   - </div>
629   - <div class="btn-group" role="group">
630   - <div id="draw-block" style="display: none; font-size: 13px;">Draw Mode</div>
631   - <button id="DrawMode" type="button" ng-click="DrawingMode()" class="btn btn-sm btn-success">Draw</button>
632   - </div>
633   - </div>
634   -
635   - </div>
636   - <div class="col-sm-12">
637   - <h5>Tools</h5>
638   - <div class="well well-popup">
639   - <div class="" aria-label="...">
640   - <div class="" role="group" align="center">
641   - <div id="cursor-block" style="display: none; font-size:13px;"></div>
642   - <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btnCursor" ng-mouseover="addToolTip(75, 60, 120, 'Select Cursor(s)')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="Cursor()"><img src="content/images/icon-identity.png" alt="" title=""></button>
643   - <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-pin" ng-mouseover="addToolTip(75, 100, 120, 'Draw Pin')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawPin($event)"><img src="content/images/draw-pin.png" alt="" title=""></button>
644   - <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-arrow" ng-mouseover="addToolTip(75, 120, 120, 'Draw Arrow')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawArrow($event)"><img src="content/images/draw-arrow.png" alt="" title=""></button>
645   - <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-Text" ng-mouseover="addToolTip(75, 140, 120, 'Draw Text')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawText($event)"><img src="content/images/draw-text.png" alt="" title=""></button>
646   - </div>
647   - <div class="" role="group" align="center">
648   - <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-line" ng-mouseover="addToolTip(95, 60, 120, 'Draw Line')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawLine($event)"><img src="content/images/draw-line.png" alt="" title=""></button>
649   - <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-rectangle" ng-mouseover="addToolTip(95, 100, 120, 'Draw Rectangle')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawRectangle($event)"><img src="content/images/draw-rec.png" alt="" title=""></button>
650   - <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-circle" ng-mouseover="addToolTip(95, 120, 120, 'Draw Circle')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawCircle($event)"><img src="content/images/draw-cir.png" alt="" title=""></button>
651   - <!--<button type="button" class="btn btn-black-annotation btn-xs btn-annotation" ng-mouseover="addToolTip(95, 140, 120, 'Draw Polygon')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawPolygon($event)"><img src="content/images/draw-poly.png" alt="" title=""></button>-->
652   - <button type="button" class="btn btn-black-annotation" id="resetBtn" style="padding:1px 7px;display:none;" ng-click="resetDrawing()" ng-mouseover="addToolTip(95, 140, 120, 'Reset')" ng-mouseleave="removeToolTipOnMouseOut()"><i class="fa fa-refresh"></i></button>
653   - </div>
654   - </div>
655   - </div>
656   - <div class="well-popup well blankshapediv" ng-mouseover="addToolTip(200, 170, 120, 'Edit Style')" ng-mouseleave="removeToolTipOnMouseOut()">
657   - <!--#7931-->
658   -
659   - <div id="edit-block" style="display: none; font-size: 13px;">Edit Shape Style</div>
660   - <div id="previewBorder" class="outlinediv" ng-mouseover="addToolTip(170, 170, 120, 'Edit Style')" ng-mouseleave="removeToolTipOnMouseOut()">
661   - <div id="shapeStyleDiv" style="background-color: #ffffff;" class="fullcolordiv" ng-click="disableAnnotationtoolOnListManager||enableAnnotationToolBar()">
662   -
663   - </div>
664   -
665   - </div>
666   - </div>
667   - <div class="well well-popup">
668   - <div class="" role="group" aria-label="...">
669   - <div>
670   - <a href="#canvasPaint" data-tool="marker" data-size="1" data-color="#fff" id="annotationpaintbrushsize" ng-mouseover="addToolTip(270, 50, 120, 'Paint')" ng-mouseleave="removeToolTipOnMouseOut()" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-brush" role="button" data-placement="top" style="margin-right:1%;" ng-click="paintBrush()"><i class="fa fa-paint-brush"></i></a>
671   - <a href="#canvasPaint" data-tool="eraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" data-size=" 1" id="annotationpainteraser" ng-click="EraseDrawing()" ng-mouseover="addToolTip(270, 70, 120, 'Erase')" ng-mouseleave="removeToolTipOnMouseOut()" role="button"><i class=" fa fa-eraser"></i></a>
672   -
673   - <!--<button type="button" id="annotationpainteraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" ng-click="EraseDrawing()" ng-mouseover="addToolTip(270, 70, 120, 'Erase')" ng-mouseleave="removeToolTipOnMouseOut()"><i class="fa fa-eraser"></i></button>-->&nbsp;
674   - <div style="width: 80px; margin: 0px 0px 0px 4px; display: inline-block;float:left;">
675   - <div style="width: 58px; float: left;" ng-mouseover="addToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()">
676   - <input type="text" id="btnBrushSize" class="form-control" value="1" style="height:32px;border-radius:0;" oninput="Brushsize(this)">
677   - </div>
678   - <div style="width: 22px; float: left;">
679   - <div style="width: 100%; float: left; height: 16px;">
680   - <button type="button" id="btnBrushSizeIncrement" ng-mouseover="addToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()" class="btn btn-default" style="padding:0 5px;border-radius:0;font-size: 10px;vertical-align:top;">
681   -
682   - <img style="width:10px;height:10px;" src="~/../content/images/DA/angle-up.png">
683   - </button>
684   - </div>
685   - <div style="width: 100%; float: left; height: 16px;">
686   - <button type="button" id="btnBrushSizeDecrease" ng-mouseover="addToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()" class="btn btn-default" style="padding:0 5px;border-radius:0;font-size: 10px;vertical-align:top;">
687   - <img style="width:10px;height:10px;" src="~/../content/images/DA/angle-down.png">
688   - </button>
689   - </div>
690   - </div>
691   -
692   - </div>
693   -
694   -
695   - <div class="pull-left pl-12" style="width:45%; margin-left:2%;margin-top:5px;">
696   - <div id="slider-range-min-2" ng-mouseover="addToolTip(270, 170, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()"></div>
697   - </div>
698   - <div class="clearfix"></div>
699   - </div>
700   -
701   - </div>
702   -
703   -
704   - </div>
705   -
706   - </div>
707   - </div>
708   - </div>
709   -
710   - </div>
711   - </div>
712   - </div>
713   -
714   - <!--Modal For Annotation Text Box-->
715   - <div id="annotationTextModal" style="display:none;z-index: 1000000000;width:500px;height:241px;padding-right:0!important;position:fixed;left:0;right:0;top:0px;bottom:0;margin:auto;">
716   -
717   - <div class="modal-content">
718   - <div class="modal-header" style="background-color: #808D43;padding:10px;border-bottom:0;">
719   - <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
720   - <h4 class="modal-title" id="myModalLabel" style="font-weight:bold;">Enter Text to be put in a box</h4>
721   - </div>
722   - <div class="modal-body">
723   - <div class="col-xs-12" style="padding:20px 0;">
724   - <div class="form-inline">
725   - <!--Annotation: Text in different font style is same.-->
726   - <select class="form-control" id="selected-font-family"></select>
727   - <select class="form-control" id="selected-font-size">
728   - <option>14</option>
729   - <option>16</option>
730   - <option>18</option>
731   - <option>20</option>
732   - <option>22</option>
733   - <option>24</option>
734   - <option>26</option>
735   - <option>28</option>
736   - <option>36</option>
737   - <option>48</option>
738   - <option>72</option>
739   - </select>
740   - <span style="vertical-align:middle;">
741   - <span id="text-bold" class="Edittext-btn-css">
742   - <i aria-hidden="true" class="fa fa-bold" style="color: #fff"></i>
743   - </span>
744   - <span id="text-italic" class="Edittext-btn-css">
745   - <i class="fa fa-italic" aria-hidden="true" style="color: #fff"></i>
746   -
747   - </span>
748   - <span id="text-underline" class="underline-btn-css">
749   - <i class="fa fa-underline" aria-hidden="true" style="color: #fff"></i>
750   - </span>
751   - </span>
752   -
753   - <div class="form-group" id="font-color" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;">
754   -
755   - <input type="text" id="saturation-demo" class="form-control demo" data-control="saturation" style="display:none;" value="#0088cc">
756   - </div>
757   - <div class="form-group" id="drawTextBGColorpicker" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;">
758   - <input type="text" id="saturation-demo-background" class="form-control drawTextBG" data-control="saturation" style="display:none;" value="#0088cc">
759   - </div>
760   -
761   - <span style="vertical-align:middle;">
762   - <span id="text-left" class="Edittext-btn-css">
763   - <i aria-hidden="true" class="fa fa-align-left" style="color: #fff"></i>
764   - </span>
765   - <span id="text-center" class="Edittext-btn-css">
766   - <i class="fa fa-align-center" aria-hidden="true" style="color: #fff"></i>
767   -
768   -
769   - </span>
770   - <span id="text-right" class="underline-btn-css">
771   - <i class="fa fa-align-right" aria-hidden="true" style="color: #fff"></i>
772   -
773   -
774   - </span>
775   - </span>
776   -
777   -
778   - </div>
779   - </div>
780   - <textarea class="form-control" id="text_area" rows="3" style="font-family: 'Verdana, sans-serif';font-size:14px; font-weight: normal; font-style: normal; color: #000; text-align: left; text-decoration: none;"></textarea>
781   - </div>
782   - <div class="modal-footer">
783   - <!--<button type="button" class="btn btn-default" ng-click="closeModal()" data-dismiss="modal">Close</button>-->
784   - <button type="button" class="btn btn-default" ng-click="closeModal()" id="closeEditText" data-dismiss="modal">Close</button>
785   - <button type="button" id="saveBtn" class="btn btn-primary" data-dismiss="modal" ng-click="saveText()">Save</button>
786   - </div>
787   - </div>
788   -
789   - </div>
790   -
791   -
792   -
793   -
794   - <!--List manager-->
795   - <!--List manager-->
796   - <style>
797   - #listManager {
798   - background: #fff;
799   - border-radius: 3px;
800   - border: 1px solid #ededed;
801   - -webkit-box-shadow: 0px 0px 2px 1px rgba(173,173,173,1);
802   - -moz-box-shadow: 0px 0px 2px 1px rgba(173,173,173,1);
803   - box-shadow: 0px 0px 2px 1px rgba(173,173,173,1);
804   - width: 350px;
805   - position: absolute;
806   - top: 170px;
807   - left: 140px;
808   - display: none;
809   - z-index: 780000;
810   - height: auto !important;
811   - }
812   -
813   - #listManager .annotation-modal-header {
814   - background: #818f44;
815   - padding: 2px 10px;
816   - }
817   -
818   - #listManager .annotation-modal-header h4 {
819   - color: #fff;
820   - font-size: 15px;
821   - line-height: 20px;
822   - }
823   -
824   - #listManager .modal-header .close {
825   - color: #fff;
826   - margin: 0;
827   - opacity: 10;
828   - text-shadow: none;
829   - }
830   -
831   - #listManager .modal-footer {
832   - padding: 5px 10px;
833   - }
834   - </style>
835   - <div id="listManager" style="">
836   - <div class="modal-header annotation-modal-header">
837   - <button type="button" class="close" aria-label="Close" ng-click="CloseListManager()"><span aria-hidden="true">&times;</span></button>
838   - <h4 class="modal-title" id="myModalLabel">List Manager</h4>
839   - </div>
840   - <div class="modal-body">
841   - <div class="row paddingTopBtm10">
842   - <div class="col-sm-12" ng-init="FillListManager()">
843   -
844   - <div class="form-group">
845   - <label for="sel1">Window</label>
846   - <select class="form-control" id="viewName" disabled>
847   - <!--<option>Male Lateral</option>-->
848   -
849   - </select>
850   - </div>
851   - <div style="">
852   - <div class="form-group">
853   - <div ng-click="restrictBodySystemList()" class="btn btn-success btn-block" style="padding:3px 12px;">
854   - <i class=" fa fa-caret-right restrict-carret-icon"></i> <span>Restrict List to</span>
855   - </div>
856   - </div>
857   -
858   - <div id="restrictListDiv" style="display:none;">
859   - <div class="well well-sm marginTopBtm10">
860   - <div class="form-horizontal">
861   - <div class="form-group">
862   - <label class="col-sm-4 control-label" for="System">System</label>
863   - <div class="col-sm-8">
864   - <select id="bodySystems" class="form-control" onchange="if (typeof (this.selectedIndex) != 'undefined') refreshTermListOnSystem(this.options[this.selectedIndex].id)"></select>
865   - <select id="AABodySystems" class="form-control" onchange="if (typeof (this.selectedIndex) != 'undefined') refreshTermListOnSystemSel(this.options[this.selectedIndex].id)" style="display:none;"></select>
866   - </div>
867   - </div>
868   - <div class="form-group">
869   - <label class="col-sm-4 control-label" for="inputPassword3">Area</label>
870   - <div class="col-sm-8">
871   - <select class="form-control" disabled>
872   - <option value="1" selected="">Entire View</option>
873   - </select>
874   - </div>
875   - </div>
876   - </div>
877   - </div>
878   -
879   -
880   - </div>
881   -
882   - <!--DA > List Manager > Multiple structure selection should not be available.-->
883   - <div class="form-group">
884   - <select id="termList" class="form-control" size="10" onclick="if (typeof (this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id, true)"></select>
885   - </div>
886   -
887   - </div>
888   - <div style="clear:both;"></div>
889   -
890   -
891   -
892   -
893   - </div>
894   - </div>
895   -
896   - </div>
897   - <div class="modal-footer" id="totalTerms">
898   - <!--<span class="pull-left marginTop5">424 Structures</span>-->
899   - <!--<button data-dismiss="modal" class="btn btn-primary" type="button"><i class="fa fa-arrow-circle-right"></i></button>-->
900   - </div>
901   - </div>
902   -
903   - <!--background disable div-->
904   -
905   - <div id="modelbackground"></div>
906   -
907   -
908   - <!--Edit Shape Modal-->
909   -
910   -
911   - <div class="modeleditstyle" id="modeleditstyle" style="z-index: 1000000000; background: white;width: 302px;position:absolute;left:40%;right:0;top:70px;">
912   - <div class="modal-content">
913   - <div class="modal-header annotation-modal-header">
914   - <h4 class="modal-title" id="myModalLabel33">Edit Shape Style</h4>
915   - </div>
916   - <form id="editStyleForm">
917   - <div class="modal-body">
918   - <div class="marginTopBtm10">
919   - <div class="well well-sm no-margin-btm">
920   - <div class="row">
921   - <div class="col-sm-12">
922   - <div class="checkbox no-margin">
923   - <label>
924   - <input id="fill-option" type="checkbox" checked onclick="enableDisableFillOption()"> Fill Option
925   - </label>
926   - </div>
927   - </div>
928   - <div class="col-sm-6 enableDisableOpacity">
929   - <!--<div class="radio">
930   - <label>
931   - <input type="radio" name="filloption" id="filloption1" value="filloption1">
932   - <span class="">Texture</span>
933   - <img id="editstyleTexture" src="~/../content/images/common/annotation-tool-bar/pattern-picker.png" alt="" class="pattern-picker" data-toggle="modal" data-target="#pattern">
934   - </label>
935   - </div>-->
936   - <div class="radio">
937   - <label>
938   - <input type="radio" name="filloption" id="filloption2" value="filloption2" checked style="margin-top:8px;">
939   -
940   -
941   - <div id="editstylebackgroundcolor" class="form-group" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;float:left;">
942   - <span style="font-weight: normal; float: left; padding-top: 5px; padding-right: 5px;">Color</span>
943   - <input type="text" class="form-control outerBackgroundColor" data-control="saturation" style="display:none;" value="#0088cc">
944   - </div>
945   -
946   -
947   - </label>
948   - </div>
949   - </div>
950   - <div class="col-sm-6 no-padding marginTop10 enableDisableOpacity">
951   - <div class="row">
952   - <label class="pull-left" style="font-weight:normal;">Scale</label>
953   - <div id="edit-slider-3" class="pull-left pl-12" style="width:62%; margin-left:3%; margin-top:2%;">
954   - <div id="slider-range-min-3"></div>
955   - </div>
956   - </div>
957   -
958   - <div class="row">
959   - <label class="pull-left" style="font-weight:normal;">Opacity</label>
960   - <div id="edit-slider-4" class="pull-left pl-12" style="width:53%; margin-left:3%; margin-top:2%;">
961   - <div id="slider-range-min-4"></div>
962   - </div>
963   - </div>
964   -
965   - <div class="clearfix"></div>
966   -
967   -
968   - </div>
969   - </div>
970   -
971   - </div>
972   - </div>
973   - <div class="marginTopBtm10">
974   - <div class="well well-sm no-margin-btm">
975   - <div class="row">
976   - <div class="col-sm-12">
977   - <div class="checkbox no-margin">
978   - <label>
979   - <input id="Outline-Option" onclick="enableDisableOutline()" type="checkbox" checked> Outline Option
980   - </label>
981   - </div>
982   - </div>
983   - <div class="col-sm-6 setEnableDisableForEditShapeStyle">
984   - <label class="marginTop5">
985   - <span style="font-weight: normal; float: left; padding-top: 5px; padding-right: 5px;">Color</span>
986   - <div class="form-group" id="outlineColor" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;float:left;">
987   -
988   - <input type="text" class="form-control borderColorCanvasPreview" data-control="saturation" style="display:none;" value="#0088cc">
989   - </div>
990   -
991   -
992   - </label>
993   - </div>
994   -
995   - <div class="col-sm-6 setEnableDisableForEditShapeStyle">
996   - <div class="form-horizontal">
997   - <div class="form-group">
998   - <label class="col-sm-3 control-label" style=" font-weight:normal; padding-top:9px;">Size</label>
999   - <div class="col-sm-9 marginTop5">
1000   - <select id="borderWidthCanvasElement" class="form-control input-sm">
1001   - <option value="1">1</option>
1002   - <option value="2">2</option>
1003   - <option value="3">3</option>
1004   - <option value="4">4</option>
1005   - <option value="5">5</option>
1006   - </select>
1007   - </div>
1008   - </div>
1009   - </div>
1010   - </div>
1011   -
1012   - </div>
1013   - </div>
1014   - </div>
1015   -
1016   - <div class="marginTopBtm10">
1017   -
1018   - <div class="well well-sm no-margin-btm blankshapediv">
1019   - <div class="outlinediv" id="outlinedivId" style="border: 1px solid #000000;">
1020   - <div id="imgOpacity" style="background-color: #ffffff" class="fullcolordiv imgopacity">
1021   - </div>
1022   - </div>
1023   - </div>
1024   -
1025   - </div>
1026   - </div>
1027   - <div class="modal-footer">
1028   - <button id="btnShapeStyle" type="button" class="btn btn-primary btn-sm" ng-click="setPropertiesForShapes('imgOpacity')">
1029   - OK
1030   - </button>
1031   - <button type="button" class="btn btn-primary btn-sm" data-dismiss="modal" ng-click="disableAnnotationToolBar()">Cancel</button>
1032   - </div>
1033   - </form>
1034   - </div>
1035   - </div>
1036   -
1037   - <!--Export Image Modal-->
1038   - <div class="modal fade export-image ui-draggable in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
1039   - style="z-index: 1200002;">
1040   - <div class="modal-dialog modal-sm" role="document">
1041   - <div class="modal-content">
1042   - <div class="modal-header annotation-modal-header ui-draggable-handle">
1043   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1044   - <h4 class="modal-title" id="">Save As</h4>
1045   - </div>
1046   - <div class="modal-body">
1047   - <div class="row paddTopbtm15">
1048   - <div class="col-sm-12">
1049   - <div class="form-group">
1050   - <label for="filename">Filename:</label>
1051   - <div class="input-group">
1052   - <input type="text" class="form-control" id="filename" placeholder="" ng-model="filename">
1053   - <div class="input-group-addon">.jpg</div>
1054   - </div>
1055   - </div>
1056   - </div>
1057   - </div>
1058   -
1059   - </div>
1060   - <div class="modal-footer">
1061   - <div class="row">
1062   - <input type="file" id="file1" style="display:none">
1063   - <!--<a href="data:application/xml;charset=utf-8,your code here" download="filename.html">Save</a-->
1064   - <div class="col-sm-12"><button id="btnSaveEI" class="btn btn-primary" data-dismiss="modal" type="button">Ok</button></div> <!--onclick="makeScreenshot();"--><!--ng-click="dialogs.saveAs()"--><!--ng-click="ShowAlert()"-->
1065   - </div>
1066   - </div>
1067   -
1068   - </div>
1069   - </div>
1070   - </div>
1071   -
1072   - <!--Print Active Viewer-->
1073   - <div class="print-box-active portrait-box-active" id="printBox" style="display: none;">
1074   - <div id="printDivContent">
1075   - <div class="">
1076   - <div class="print-col-sm-4" style="top: 10px; position: absolute; left: 10px;">
1077   - <span class="pull-left font12 print-span-font" id="spnModule"></span>
1078   - </div>
1079   - <div class="print-col-sm-4" style="top: 10px; position: absolute; right: 10px;">
1080   - <span class="pull-right font12 print-span-font" id="spnBodyViewTitle"></span>
1081   - </div>
1082   - </div>
1083   - <div class=" mar-top-25" align="center" id="dvPortrait" style="text-align: center;">
1084   - <img src="" alt="" class="logo-image" id="snipImage" style="width: 100%;" />
1085   - </div>
1086   - <div>
1087   - <div class="print-col-sm-4" style="position: absolute; bottom: 20px;">
1088   - <span class="pull-left marginTop10 font12 print-span-font">Copyright 2016 A.D.A.M., Inc. All Rights Reserved</span>
1089   - </div>
1090   - <div class="print-col-sm-4" style="position: absolute; bottom: 20px; right: 10px;">
1091   - <span class="pull-right print-marginTop10 bgnone no-margin">
1092   - <img class="logo-image" src="content/images/adam-logo-small.png" alt="">
1093   - </span>
1094   - </div>
1095   - </div>
1096   - <div class="clearfix"></div>
1097   - </div>
1098   - </div>
1099   -
1100   - <!--Print Preview Modal-->
1101   - <div id="dvPrintPreview" style="display: none;"></div>
1102   - </div>
1103   - </div>
1104   - <!--RESET PASSWORD FORM-->
1105   - <div id="passwordReset" ng-show="isVisibleResetPass">
1106   - <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
1107   - <tbody>
1108   - <tr>
1109   - <td align="center" valign="middle" bgcolor="#393939 " style="padding:30px 0 20px 0;"><a href="#"><img src="../content/images/logo.png" alt="AIA" title="AIA" /></a></td>
1110   - </tr>
1111   - <tr>
1112   - <td align="center" valign="top" bgcolor="#808d43" style="padding:20px; overflow:hidden;">
1113   - <form name="resetPasswordForm" novalidate>
1114   - <table width="100%" border="0" cellspacing="0" cellpadding="0" ng-controller="HomeController">
1115   - <tbody>
1116   -
1117   - <tr>
1118   - <td style=" font-size:26px; font-weight:bold; color:#fff; font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif"><strong>Reset Password</strong></td>
1119   - </tr>
1120   - <tr>
1121   - <td>&nbsp;</td>
1122   - </tr>
1123   - <tr>
1124   - <td style="font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#fff;">New Password </td>
1125   - </tr>
1126   - <tr>
1127   - <td>
1128   - <input class="form-control" name="newPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.newPassword" ng-minlength="8" ng-maxlength="20" required>
1129   - <span style="color: maroon; font-weight:bold" ng-show="resetPasswordForm.newPassword.$touched && resetPasswordForm.newPassword.$invalid && resetPasswordForm.newPassword.$pristine">The password is required.</span>
1130   - <p ng-show="resetPasswordForm.newPassword.$error.minlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p>
1131   - <p ng-show="resetPasswordForm.newPassword.$error.maxlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p>
1132   - </td>
1133   - </tr>
1134   - <tr>
1135   - <td>&nbsp;</td>
1136   - </tr>
1137   - <tr>
1138   - <td style="font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#fff;">Confirm Password </td>
1139   - </tr>
1140   -
1141   - <tr>
1142   - <td>
1143   - <input class="form-control" name="confirmPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.confirmPassword" required>
1144   - <span style="color: maroon; font-weight: bold; " ng-show="resetPasswordForm.confirmPassword.$touched && resetPasswordForm.confirmPassword.$invalid">Confirm password is required.</span>
1145   - <span style="color: maroon; font-weight: bold; " ng-if="resetPasswordForm.newPassword !== resetPasswordForm.confirmPassword">{{passwordMismatchMessage}}</span>
1146   - </td>
1147   - </tr>
1148   - <tr>
1149   - <td>&nbsp;</td>
1150   - </tr>
1151   - <tr>
1152   - <td>
1153   - <button type="submit" ng-disabled="resetPasswordForm.$invalid" ng-click="ResetUserPassword(userInfo)" style="background: #0072a7; border: 1px solid #005076; cursor: pointer; color: #fff; padding: 5px 10px; font-size: 16px; text-transform: uppercase; text-align: center; text-decoration: none; font-family: gotham, 'Helvetica Neue', helvetica, arial, sans-serif; " id="btnUpdatePassword">Submit</button> <!--ng-submit="submitForm(resetPwdForm.$valid)"--> <!--ng-click="ResetUserPassword(userInfo)"-->
1154   - </td>
1155   - </tr>
1156   - </tbody>
1157   - </table>
1158   - </form>
1159   - </tr>
1160   -
1161   -
1162   - </tbody>
1163   - </table>
1164   - </div>
1165   -
1166   - <div class="modal fade" id="messageModal" role="dialog">
1167   - <div class="modal-dialog">
1168   -
1169   - <div class="modal-content">
1170   - <div class="modal-header">
1171   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1172   - </div>
1173   - <div class="modal-title"></div>
1174   - <div class="modal-body">{{errorMessage}}</div>
1175   - <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">OK</button></div>
1176   - </div>
1177   - </div>
1178   - </div>
1179   -
1180   - <!--Admin Form (Under Process)-->
1181   - <div class="modal fade ui-draggable in" id="adminModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; ">
1182   - <div class="modal-dialog" role="document">
1183   - <div class="modal-content">
1184   - <div class="modal-header ui-draggable-handle" style="color: #e5e5e5;">
1185   - <!--bg-primary-->
1186   - <button type="button" class="close" data-dismiss="modal" aria-label="Close" id="btnCloseAAModal" ng-click="CloseAAModal()"><span aria-hidden="true">×</span></button>
1187   - <h5 class="text-left lhgt19 padd5" style="color:red; text-align:left;">*This module is not yet available to use, please fill in the form with complete details, a support request will be submitted to ADAM Education Sales and Support team. If needed someone from ADAM team will contact you ASAP.</h5>
1188   - </div>
1189   - <div class="modal-body">
1190   - <div class="panel-body">
1191   - <!-- form -->
1192   - <form class="form-horizontal" name="adminAccessRequestForm">
1193   - <div class="form-group">
1194   - <label for="inputEmail3" class="col-sm-3 control-label">First Name :</label>
1195   - <div class="col-sm-8">
1196   - <input class="form-control" id="adminfName" placeholder="" ng-model=" userinfo.firstname" ng-readonly="true">
1197   - </div>
1198   - </div>
1199   - <div class="form-group">
1200   - <label for="inputPassword3" class="col-sm-3 control-label">Last Name :</label>
1201   - <div class="col-sm-8">
1202   - <input class="form-control" id="adminlName" placeholder="" type="text" ng-model="userInfo.lastName" ng-readonly="true">
1203   - </div>
1204   - </div>
1205   - <div class="form-group">
1206   - <label for="inputPassword3" class="col-sm-3 control-label">Email Id <span class="red">*</span> :</label>
1207   - <div class="col-sm-8">
1208   - <input class="form-control" id="adminEmailId" placeholder="" type="text" ng-model="userInfo.emailId" ng-readonly="true">
1209   - </div>
1210   - </div>
1211   - <div class="form-group">
1212   - <label for="inputPassword3" class="col-sm-3 control-label">Message <span class="red">*</span> :</label>
1213   - <div class="col-sm-8">
1214   - <textarea name="adminAccessTextArea" class="form-control" rows="3" placeholder="Message" ng-model="userInfo.userMessage" required></textarea> <!--ng-show="!adminRequestTextArea.length-->
1215   - <span id="spnError" style="color: maroon; font-weight:bold" ng-show="adminAccessRequestForm.adminAccessTextArea.$invalid">Message required.</span>
1216   - </div>
1217   - </div>
1218   - <div class="form-group">
1219   - <div class="col-sm-offset-3 col-sm-8 mar-top17">
1220   - <button type="button" class="btn btn-primary btn-sm" ng-click="adminAccessRequestForm.$valid && SendAdminAccessRequestMail(userInfo)" data-toggle="modal" data-target="#mymodal"><i class="fa fa-check"></i> Submit</button>
1221   - </div>
1222   -
1223   - </div>
1224   - </form>
1225   - </div>
1226   - </div>
1227   -
1228   - </div>
1229   - </div>
1230   - </div>
1231   -
1232   - <!--Available modules list modal after login-->
1233   - <div class=" fade ui-draggable in" id="dvUserModulesInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; left: 0px !important; z-index: 111111; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; right: 0px; bottom: 0px; ">
1234   - <div class="modal-dialog" role="document">
1235   - <div class="modal-content">
1236   - <div class="modal-header ui-draggable-handle " style="color: #ffffff; background-color: #0095da; border-color: #007ab3;cursor:default;">
1237   - <!--color: #e5e5e5;-->
1238   - <!--bg-primary-->
1239   - <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
1240   - <h4 class="text-left lhgt19 padd5" style="color:#fff; text-align:left;">Modules Availability</h4>
1241   - </div>
1242   -
1243   - <div class="modal-body">
1244   - <div class="panel-body">
1245   - <!-- form -->
1246   - <form class="form-horizontal">
1247   - <div>
1248   - <div class="form-group" id="moduleDiv1">
1249   - <div class="col-sm-8">• Dissectible Anatomy</div>
1250   - </div>
1251   - <div class="form-group" id="moduleDiv2">
1252   - <div class="col-sm-8">• Atlas Anatomy</div>
1253   - </div>
1254   - <div class="form-group" id="moduleDiv3">
1255   - <div class="col-sm-8">• 3D Anatomy</div>
1256   - </div>
1257   - <div class="form-group" id="moduleDiv4">
1258   - <div class="col-sm-8">• Clinical Illustrations</div>
1259   - </div>
1260   - <div class="form-group" id="moduleDiv5">
1261   - <div class="col-sm-8">• Clinical Animations</div>
1262   - </div>
1263   - <div class="form-group" id="moduleDiv6">
1264   - <div class="col-sm-8">• Encyclopedia</div>
1265   - </div>
1266   - <div class="form-group" id="moduleDiv9">
1267   - <div class="col-sm-8">• IP 10</div>
1268   - </div>
1269   - <div class="form-group" id="moduleDiv11">
1270   - <div class="col-sm-8">• In - Depth Reports</div>
1271   - </div>
1272   - <div class="form-group" id="moduleDiv12">
1273   - <div class="col-sm-8">• Complementary and Alternative Medicine</div>
1274   - </div>
1275   -
1276   - <div class="form-group" id="moduleDiv14">
1277   - <div class="col-sm-8">• Body Guide</div>
1278   - </div>
1279   - <div class="form-group" id="moduleDiv15">
1280   - <div class="col-sm-8">• Symptom Navigator</div> <!--Health-->
1281   - </div>
1282   - <div class="form-group" id="moduleDiv16">
1283   - <div class="col-sm-8">• The Wellness Tools</div>
1284   - </div>
1285   - <div class="form-group" id="moduleDiv1017">
1286   - <div class="col-sm-8">• A.D.A.M on Demand</div>
1287   - </div>
1288   - </div>
1289   - <!--<hr style="border: 1px solid;"/>-->
1290   - <div id="dvPending" style="margin: 15px 0;"><b>Pending Modules</b></div>
1291   - <!--<hr style="border: 1px solid;" />-->
1292   - <div>
1293   - <div class="form-group" id="moduleDiv7">
1294   - <div class="col-sm-12"><i>• Curriculum Builder</i></div> <!--(To be available by 09/25/2017)-->
1295   - </div>
1296   - <div class="form-group" id="moduleDiv8">
1297   - <div class="col-sm-8"><i>• Anatomy Test</i></div> <!--(To be available by 08/28/2017)-->
1298   - </div>
1299   - <div class="form-group" id="moduleDiv10">
1300   - <div class="col-sm-8"><i>• Lab Exercises</i></div> <!--(To be available by 08/16/2017)-->
1301   - </div>
1302   - <div class="form-group" id="moduleDiv13">
1303   - <div class="col-sm-8">• A.D.A.M Images</div>
1304   - </div>
1305   - </div>
1306   - <div class="form-group">
1307   - <div style="text-align: center">
1308   - <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" data-dismiss="modal"><i class="fa fa-check"></i> OK</button>
1309   - </div>
1310   - </div>
1311   - </form>
1312   - </div>
1313   - </div>
1314   -
1315   - </div>
1316   - </div>
1317   - </div>
1318   -
1319   - <!-- Terms & Condition Modal -->
1320   - <div class=" fade ui-draggable in" id="dvTermCondition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; left: 0px !important; z-index: 111111; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; right: 0px; bottom: 0px; ">
1321   - <div class="modal-dialog" role="document">
1322   - <div class="modal-content">
1323   - <div class="modal-header ui-draggable-handle " style="color: #ffffff; background-color: #0095da; border-color: #007ab3;cursor:default;">
1324   - <!--color: #e5e5e5;-->
1325   - <h6 class="text-left lhgt19 padd5" style="color:#fff; text-align:left;">Terms and Conditions</h6>
1326   - </div>
1327   -
1328   - <div class="modal-body" style="width: 597px; height: 400px; overflow-x: auto;">
1329   - <div class="panel-body">
1330   - <div id="dvTerms" style="font-size: 13px;"></div>
1331   - </div>
1332   - </div>
1333   - <div class="modal-footer ui-draggable-handle " style="color: #ffffff; cursor:default;">
1334   - <!--background-color: #0095da; border-color: #007ab3;-->
1335   - <!-- form -->
1336   - <form class="form-horizontal">
1337   - <!--<div class="form-group">-->
1338   - <div style="clear: left; float: left; color: #000;"><input type="checkbox" id="chkAccept" ng-model="checked" style="vertical-align: top;" /> I accept</div>
1339   - <div style="float: right;"><button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" ng-disabled="!checked" data-dismiss="modal" ng-click="UpdateLicenseTermStatus()"><i class="fa fa-check"></i> Next</button></div>
1340   - <!--</div>-->
1341   - </form>
1342   - </div>
1343   - </div>
1344   - </div>
1345   - </div>
1346   - <script>
1347   - function enableDisableFillOption() {
1348   - if (document.getElementById('fill-option').checked) {
1349   - // $('#imgOpacity').attr("background-color");
1350   - //$('#imgOpacity').css({"background-color"})
1351   - //$("#filloption1").css({ "pointer-events": "auto" });
1352   - //$("#filloption12").css({ "pointer-events": "auto" });
1353   -
1354   - var x = $("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color');
1355   - $("#imgOpacity").css("background-color", x);
1356   - $("#edit-slider-3").css({ "pointer-events": "auto" });
1357   - $("#edit-slider-4").css({ "pointer-events": "auto" });
1358   - $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
1359   - $("#editstyleTexture").css({ "pointer-events": "auto" });
1360   - $(".enableDisableOpacity label").css({ "cursor": "pointer" });
1361   - $(".enableDisableOpacity").css({ "opacity": "1" })
1362   - document.getElementById("filloption1").disabled = false;
1363   - document.getElementById("filloption2").disabled = false;
1364   - document.getElementById("filloption1").style.cursor = "default";
1365   - document.getElementById("filloption2").style.cursor = "default";
1366   -
1367   -
1368   -
1369   - }
1370   - else {
1371   - $('#imgOpacity').css("background-color", "transparent");
1372   - //$("#filloption1").css({ "pointer-events": "none" });
1373   - //$("#filloption2").css({ "pointer-events": "none" });
1374   - $("#edit-slider-3").css({ "pointer-events": "none" });
1375   - $("#edit-slider-4").css({ "pointer-events": "none" });
1376   - $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
1377   - $("#editstyleTexture").css({ "pointer-events": "none" });
1378   - $(".enableDisableOpacity label").css({ "cursor": "default" });
1379   - $(".enableDisableOpacity").css({ "opacity": ".5" })
1380   - document.getElementById("filloption1").disabled = true;
1381   - document.getElementById("filloption2").disabled = true;
1382   - document.getElementById("filloption1").style.cursor = "default";
1383   - document.getElementById("filloption2").style.cursor = "default";
1384   -
1385   -
1386   -
1387   - }
1388   -
1389   - }
1390   - function enableDisableOutline() {
1391   -
1392   - if (document.getElementById('Outline-Option').checked) {
1393   - var x = $("#outlineColor span.minicolors-swatch-color").css('background-color');
1394   - $(".marginTopBtm10 div.outlinediv").css("border-color", x);
1395   - // var borderWidth = $("#outlineColor span.minicolors-swatch-color").css('border-width');
1396   - // $("#imgOpacity").css("border-width", borderWidth);
1397   -
1398   - $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
1399   - $("#outlineColor").css({ "pointer-events": "auto" });
1400   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" })
1401   - }
1402   - else {
1403   - $('.marginTopBtm10 div.outlinediv').css("border-color", "transparent");
1404   - $("#borderWidthCanvasElement").css({ "pointer-events": "none" });
1405   - $("#outlineColor").css({ "pointer-events": "none" });
1406   - $(".setEnableDisableForEditShapeStyle").css({ "opacity": ".5" })
1407   - }
1408   - }
1409   -
1410   - </script>
1411   -
1412   - <script>
1413   - function Brushsize(object) {
1414   -
1415   - object.value = object.value.replace(/[^0-9]/g, '');
1416   - if (parseInt(object.value) <= 0) {
1417   - object.value = 1;
1418   - }
1419   - if (parseInt(object.value) >= 1 && parseInt(object.value) <= 60) {
1420   - object.value = object.value;
1421   - }
1422   - if (parseInt(object.value) > 60) {
1423   - object.value = object.value.slice(0, 1);
1424   -
1425   - }
1426   -
1427   - }
1428   - </script>
1429   -
1430   -
1431   - <!--<script src="libs/jquery/1.11.3/jquery.min.js"></script>-->
1432   - <script src="libs/jquery/2.1.3/jquery.min.js"></script>
1433   - <script src="libs/jquery/1.11.4/jquery-ui.js"></script>
1434   -
1435   - <script src="libs/jquery/jquery_plugin/jquery.mCustomScrollbar.concat.min.js"></script>
1436   - <script src="themes/default/scripts/bootstrap/3.3.5/bootstrap.js"></script>
1437   - <script src="libs/angular/1.4.9/angular.min.js"></script>
1438   - <script src="libs/angular/1.4.9/angular-route.min.js"></script>
1439   - <script src="libs/angular/1.4.9/angular-sanitize.min.js"></script>
1440   - <script src="libs/angular/1.4.9/ngStorage.js"></script>
1441   - <script src="content/js/custom/custom.js"></script>
1442   - <!--Annotation Toolbar : jcanvas Library-->
1443   -
1444   - <script src="libs/jcanvas/jcanvas.min.js"></script>
1445   - <script src="libs/jcanvas/jcanvas.handle.min.js"></script>
1446   -
1447   - <script src="libs/jinqJs.js"></script>
1448   - <script src="libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js"></script>
1449   - <script src="libs/video_4_12_11/video_4_12_11.js"></script>
1450   - <script src="libs/jquery/jquery_plugin/SpeechBubble/bubble.js"></script>
1451   - <!--<script src="libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.min.js"></script>-->
1452   - <script src="app/main/AIA.js"></script>
1453   - <script src="app/main/Link.js"></script>
1454   - <script src="content/scripts/js/custom/custom.js"></script>
1455   - <script src="app/filters/ColorMatrixFilter.js"></script>
1456   - <script src="app/utility/Matrix.js"></script>
1457   - <script src="app/utility/Point.js"></script>
1458   - <script src="app/utility/Rectangle.js"></script>
1459   - <script src="app/utility/BitmapData.js"></script>
1460   - <script src="app/utility/Paint.js"></script>
1461   - <script src="app/controllers/DAController.js"></script>
1462   - <script src="app/controllers/CIController.js"></script>
1463   - <script src="app/controllers/CAController.js"></script>
1464   - <script src="app/controllers/3dAController.js"></script>
1465   - <script src="app/controllers/CurrBuildController.js"></script>
1466   - <script src="app/controllers/AnatTestController.js"></script>
1467   - <script src="app/controllers/LabExercController.js"></script>
1468   - <script src="app/controllers/ADAMImgController.js"></script>
1469   - <script src="app/controllers/AODController.js"></script>
1470   - <script src="app/controllers/HomeController.js"></script>
1471   - <script src="app/controllers/LinkController.js"></script>
1472   - <script src="app/services/AuthenticationService.js"></script>
1473   - <script src="app/services/AdminService.js"></script>
1474   - <script src="app/controllers/TileViewListController.js"></script>
1475   -
1476   - <script src="app/services/ModuleService.js"></script>
1477   -
1478   - <script src="app/services/DataService.js"></script>
1479   - <script src="app/services/TermService.js"></script>
1480   - <script src="libs/jquery/jquery_plugin/jqueryui.js"></script>
1481   - <script src="libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js"></script>
1482   -
1483   - <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
1484   -
1485   - <script src="libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js"></script>
1486   - <!--<script src="libs/colorpicker/jquery.minicolors.min.js"></script>-->
1487   - <!--<script src="libs/color-picker/jquery.minicolors.min.js"></script>-->
1488   -
1489   - <script src="libs/sketch.js"></script>
1490   -
1491   - <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>-->
1492   - <script src="libs/html2canvas.js"></script>
1493   - <script src="libs/FileSaver.js"></script>
1494   -
1495   - <!--<script type="text/javascript">
1496   - $(function () {
1497   - $('#canvas').sketch();
1498   - });
1499   - </script>-->
1500   -
1501   - <script>
1502   -
1503   - $(function () {
1504   - $('[data-toggle="tooltip"]').tooltip();
1505   - })
1506   -
1507   - </script>
1508   - <script>
1509   - (function ($) {
1510   - $(window).load(function () {
1511   - $(".sidebar").mCustomScrollbar({
1512   - autoHideScrollbar: true,
1513   - //theme:"rounded"
1514   - });
1515   -
1516   - });
1517   - })(jQuery);
1518   - </script>
1519   - <script>
1520   - $(function () {
1521   - $(".modal").draggable();
1522   - $(".annotationTollbar").draggable();
1523   - $(".modeleditstyle").draggable();
1524   - $("#annotationTextModal").draggable();
1525   - $("#modal-settings").draggable();
1526   - });
1527   - </script>
1528   -
1529   -
1530   -
1531   -
1532   - <script type="text/javascript">
1533   - $(function () {
1534   -
1535   - $("#text-left").on('click', function () {
1536   -
1537   - //Annotation: Formatting buttons color is not change when select.
1538   -
1539   - $("#text-center").removeClass("ActiveFormattingButtonClass");
1540   - $("#text-right").removeClass("ActiveFormattingButtonClass");
1541   - $("#text-left").addClass("ActiveFormattingButtonClass");
1542   - $("#text_area").css("text-align", "left");
1543   -
1544   -
1545   - });
1546   -
1547   -
1548   - $("#text-center").on('click', function () {
1549   -
1550   - //Annotation: Formatting buttons color is not change when select.
1551   -
1552   - $("#text-right").removeClass("ActiveFormattingButtonClass");
1553   - $("#text-left").removeClass("ActiveFormattingButtonClass");
1554   - $("#text-center").addClass("ActiveFormattingButtonClass");
1555   - $("#text_area").css("text-align", "center");
1556   -
1557   -
1558   - });
1559   -
1560   -
1561   - $("#text-right").on('click', function () {
1562   -
1563   - //Annotation: Formatting buttons color is not change when select.
1564   -
1565   - $("#text-left").removeClass("ActiveFormattingButtonClass");
1566   - $("#text-center").removeClass("ActiveFormattingButtonClass");
1567   - $("#text-right").addClass("ActiveFormattingButtonClass");
1568   - $("#text_area").css("text-align", "right");
1569   - });
1570   -
1571   -
1572   - $("#text-bold").on('click', function () {
1573   -
1574   - //Annotation: Formatting buttons color is not change when select.
1575   - $("#text-bold").toggleClass("ActiveFormattingButtonClass");
1576   -
1577   - if ($("#text-bold").hasClass("ActiveFormattingButtonClass")) {
1578   - $("#text_area").css("font-weight", "bold");
1579   - }
1580   - else {
1581   - $("#text_area").css("font-weight", "normal");
1582   - }
1583   -
1584   -
1585   - });
1586   -
1587   - $("#text-italic").on('click', function () {
1588   -
1589   - //Annotation: Formatting buttons color is not change when select.
1590   - $("#text-italic").toggleClass("ActiveFormattingButtonClass");
1591   - if ($("#text-italic").hasClass("ActiveFormattingButtonClass")) {
1592   - $("#text_area").css("font-style", "italic");
1593   - }
1594   - else {
1595   - $("#text_area").css("font-style", "normal");
1596   - }
1597   - });
1598   -
1599   - $("#text-underline").on('click', function () {
1600   -
1601   - //Annotation: Formatting buttons color is not change when select.
1602   - $("#text-underline").toggleClass("ActiveFormattingButtonClass");
1603   -
1604   - if ($("#text-underline").hasClass("ActiveFormattingButtonClass")) {
1605   - $("#text_area").css("text-decoration", "underline");
1606   - }
1607   - else {
1608   - $("#text_area").css("text-decoration", "none");
1609   - }
1610   -
1611   -
1612   - });
1613   -
1614   -
1615   - $("#selected-font-size").change(function () {
1616   -
1617   - $("#text_area").css("font-size", $(this).val() + "px");
1618   - });
1619   -
1620   - $("#selected-font-family").change(function () {
1621   -
1622   - $("#text_area").css("font-family", $(this).val());
1623   -
1624   - });
1625   -
1626   -
1627   - });
1628   -
1629   -
1630   -
1631   - </script>
1632   -
1633   -
1634   - <script>
1635   - $(document).ready(function () {
1636   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1637   -
1638   - var borderWidth = 1;
1639   - var borderColor = "#000";
1640   - $("#borderWidthCanvasElement").change(function () {
1641   - borderWidth = $(this).val();
1642   - borderColor = $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color");
1643   -
1644   - if (borderColor != null) {
1645   - document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
1646   - //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor);
1647   - } else {
1648   -
1649   - // $("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid");
1650   - document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
1651   -
1652   - }
1653   - });
1654   -
1655   -
1656   -
1657   - $('.borderColorCanvasPreview').each(function () {
1658   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1659   - $(this).minicolors({
1660   - control: $(this).attr('data-control') || 'hue',
1661   - defaultValue: $(this).attr('data-defaultValue') || '',
1662   - format: $(this).attr('data-format') || 'hex',
1663   - keywords: $(this).attr('data-keywords') || '',
1664   - inline: $(this).attr('data-inline') === 'true',
1665   - letterCase: $(this).attr('data-letterCase') || 'lowercase',
1666   - opacity: $(this).attr('data-opacity'),
1667   - position: $(this).attr('data-position') || 'bottom left',
1668   - swatches: $(this).attr('data-swatches') ? $(this).attr('data-swatches').split('|') : [],
1669   - change: function (value, opacity) {
1670   - if (!value) return;
1671   - if (opacity) value += ', ' + opacity;
1672   - if (typeof console === 'object') {
1673   - console.log(value);
1674   -
1675   - borderColor = value;
1676   - //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor);
1677   - document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
1678   -
1679   -
1680   - }
1681   - },
1682   - theme: 'bootstrap'
1683   - });
1684   -
1685   -
1686   - });
1687   -
1688   -
1689   - $('.outerBackgroundColor').each(function () {
1690   -
1691   - $(this).minicolors({
1692   - control: $(this).attr('data-control') || 'hue',
1693   - defaultValue: $(this).attr('data-defaultValue') || '',
1694   - format: $(this).attr('data-format') || 'hex',
1695   - keywords: $(this).attr('data-keywords') || '',
1696   - inline: $(this).attr('data-inline') === 'true',
1697   - letterCase: $(this).attr('data-letterCase') || 'lowercase',
1698   - opacity: $(this).attr('data-opacity'),
1699   - position: $(this).attr('data-position') || 'bottom left',
1700   - swatches: $(this).attr('data-swatches') ? $(this).attr('data-swatches').split('|') : [],
1701   - change: function (value, opacity) {
1702   - if (!value) return;
1703   - if (opacity) value += ', ' + opacity;
1704   - if (typeof console === 'object') {
1705   - console.log(value);
1706   - $("#imgOpacity").css("background-color", value);
1707   -
1708   - }
1709   - },
1710   - theme: 'bootstrap'
1711   - });
1712   -
1713   - });
1714   -
1715   -
1716   - });
1717   - </script>
1718   - <script>
1719   - $(function () {
1720   - function onBrushSizeChange() {
1721   - $('.btnCursor').addClass('activebtncolor');
1722   - $(".btn-annotation").removeClass("activebtncolor");
1723   - $(".btn-annotation-erase").removeClass("activebtncolor");
1724   - $(".btn-annotation-erase").removeClass("activebtncolor");
1725   - $(".annotationpaintbrushsize").removeClass("activebtncolor");
1726   - var x = $('#canvasPaint').css("z-index");
1727   -
1728   - var y = $('#canvas').css("z-index");
1729   - if (x > y) {
1730   - y = parseInt(x) + 1;
1731   - } else {
1732   - y = parseInt(y) + 1;
1733   - }
1734   - $('#canvas').css("z-index", y);
1735   - }
1736   -
1737   - $("#slider-range-min-2").slider({
1738   - range: "min",
1739   - min: 1,
1740   - max: 60,
1741   - value: 1,
1742   - slide: function (event, ui) {
1743   -
1744   - onBrushSizeChange();
1745   -
1746   -
1747   -
1748   - $("#btnBrushSize").val(ui.value);
1749   -
1750   - $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
1751   - $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
1752   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1753   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1754   -
1755   - },
1756   - stop: function (event, ui) {
1757   -
1758   - $("#paintLine").attr("data-size", ui.value);
1759   -
1760   - }
1761   -
1762   - });
1763   -
1764   -
1765   - $("#btnBrushSize").keydown(function () {
1766   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1767   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1768   - onBrushSizeChange();
1769   - var brushSizevalue = this.value;
1770   -
1771   - $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
1772   - });
1773   - $("#btnBrushSize").keyup(function () {
1774   - onBrushSizeChange();
1775   - var brushSizevalue = this.value;
1776   - if (brushSizevalue == "") {
1777   -
1778   - $("#slider-range-min-2").slider("value", 0);
1779   -
1780   - $("#annotationpaintbrushsize").css({ "pointer-events": "none", "opacity": ".5" });
1781   - $("#annotationpainteraser").css({ "pointer-events": "none", "opacity": ".5" });
1782   - }
1783   - else {
1784   - $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
1785   - $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
1786   - $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
1787   - }
1788   - // $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
1789   - });
1790   - $("#btnBrushSizeIncrement").click(function () {
1791   - if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
1792   - $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
1793   - $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
1794   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1795   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1796   - }
1797   -
1798   - onBrushSizeChange();
1799   - var brushIncrementVar = $("#btnBrushSize").val();
1800   - if (brushIncrementVar >= 60) {
1801   - $("#slider-range-min-2").slider("value", 60);
1802   - }
1803   - else if (brushIncrementVar == "") {
1804   - var brushIncrementedValue = 1;
1805   - $("#btnBrushSize").val(brushIncrementedValue);
1806   - $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
1807   - }
1808   - else {
1809   -
1810   - var brushIncrementedValue = parseInt(brushIncrementVar) + 1;
1811   -
1812   - $("#btnBrushSize").val(brushIncrementedValue);
1813   - $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
1814   - }
1815   - });
1816   - $("#btnBrushSizeDecrease").click(function () {
1817   -
1818   - onBrushSizeChange();
1819   - var brushDecreaseVar = $("#btnBrushSize").val();
1820   - if (brushDecreaseVar == "") {
1821   -
1822   - $("#btnBrushSizeDecrease").css({ "pointer-events": "none", "opacity": ".5" });
1823   - $("#btnBrushSizeDecrease").css({ "pointer-events": "none", "opacity": ".5" });
1824   -
1825   - }
1826   - else if (brushDecreaseVar <= 1) {
1827   - $("#slider-range-min-2").slider("value", 1);
1828   - if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
1829   - $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
1830   - $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
1831   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": ".5" });
1832   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": ".5" });
1833   - }
1834   -
1835   - }
1836   - else {
1837   - var brushDecrementedValue = parseInt(brushDecreaseVar) - 1;
1838   - if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
1839   - $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
1840   - $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
1841   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1842   - $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
1843   - }
1844   - $("#btnBrushSize").val(brushDecrementedValue);
1845   - $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue));
1846   - }
1847   - });
1848   -
1849   - $("#btnBrushSize").val($("#slider-range-min-2").slider("value"));
1850   - });
1851   - </script>
1852   -
1853   - <script>
1854   - $(function () {
1855   - $("#slider-range-min-3").slider({
1856   - range: "min",
1857   - min: 0,
1858   - max: 100,
1859   - value: 20,
1860   - change: function (event, ui) {
1861   -
1862   -
1863   - }
1864   - });
1865   -
1866   -
1867   -
1868   - });
1869   - </script>
1870   -
1871   - <script>
1872   - $(function () {
1873   -
1874   -
1875   -
1876   - $("#slider-range-min-4").slider(
1877   - {
1878   - range: "min",
1879   - value: .5,
1880   - min: 0,
1881   - max: 1,
1882   - step: .1,
1883   - slide: function (event, ui) {
1884   -
1885   - $(".marginTopBtm10 .imgopacity").css("opacity", ui.value);
1886   - $(".marginTopBtm10 div.outlinediv").css("opacity", ui.value);
1887   - }
1888   -
1889   - }
1890   -
1891   -);
1892   -
1893   - });
1894   -
1895   -
1896   -
1897   - </script>
1898   -
1899   -
1900   -
1901   - <script>
1902   - $(function () {
1903   -
1904   -
1905   - $("#OnIdentify").on('mouseover', function () {
1906   - $("#identify-block").addClass("custom-tooltip-annotation");
1907   - $(".custom-tooltip-annotation").css('display', 'block');
1908   - }).on('mouseout', function () {
1909   - // $("#identify-block").removeClass("custom-tooltip-annotation");
1910   - $(".custom-tooltip-annotation").css('display', 'none');
1911   - $("#identify-block").removeClass("custom-tooltip-annotation");
1912   - });
1913   -
1914   -
1915   - $("#DrawMode").on('mouseover', function () {
1916   - $("#draw-block").addClass("custom-tooltip-annotation");
1917   - $(".custom-tooltip-annotation").css('display', 'block');
1918   -
1919   - }).on('mouseout', function () {
1920   -
1921   - $(".custom-tooltip-annotation").css('display', 'none');
1922   - $("#draw-block").removeClass("custom-tooltip-annotation");
1923   - });
1924   -
1925   - //#7931
1926   - $("#OnEdtShape").on('mouseover', function () {
1927   - $("#edit-block").addClass("custom-tooltip-annotation-edit");
1928   - $(".custom-tooltip-annotation-edit").css('display', 'block');
1929   -
1930   - }).on('mouseout', function () {
1931   -
1932   - $(".custom-tooltip-annotation-edit").css('display', 'none');
1933   - $("#edit-block").removeClass("custom-tooltip-annotation-edit");
1934   - });
1935   -
1936   - });
1937   - </script>
1938   - <!-- Export Image Save Click-->
1939   - <script>
1940   - $(function () {
1941   - $("#btnSaveEI").click(function () {
1942   - var $ua = navigator.userAgent;
1943   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
1944   - $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
1945   - html2canvas($("#canvasDiv"), {
1946   - onrendered: function (canvas) {
1947   - var imgsrc = canvas.toDataURL("image/png");
1948   - console.log(imgsrc);
1949   - var html = '<div id="img"><img src="' + imgsrc + '" id="newimg" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>';
1950   - var w = window.open();
1951   - $(w.document.body).html(html);
1952   - $("#filename").val("");
1953   - }
1954   - });
1955   - }
1956   - else {
1957   - $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
1958   - html2canvas($("#canvasDiv"), {
1959   - onrendered: function (canvas) {
1960   - theCanvas = canvas;
1961   - var fileName = document.getElementById("filename").value + '.jpg';
1962   - if (typeof (fileName) == "undefined" || fileName == ".jpg")
1963   - fileName = "Untitled.jpg"
1964   - var dataURL = canvas.toDataURL("image/jpeg");
1965   - var blob = dataURItoBlob(dataURL);
1966   - console.log(blob);
1967   - saveAs(blob, fileName);
1968   - $("#exportlogo").remove();
1969   - $("#filename").val("");
1970   - }
1971   - });
1972   - $(".export-image").css("display", "none");
1973   - }
1974   - });
1975   - });
1976   - function dataURItoBlob(dataURI) {
1977   - var byteString = atob(dataURI.split(',')[1]);
1978   - var ab = new ArrayBuffer(byteString.length);
1979   - var ia = new Uint8Array(ab);
1980   - for (var i = 0; i < byteString.length; i++) {
1981   - ia[i] = byteString.charCodeAt(i);
1982   - }
1983   - return new Blob([ab], { type: 'image/jpeg' });
1984   - }
1985   - </script>
1986   - <script>
1987   - function ResizeImage(sizePercent) {
1988   - var autoWidth = 427;
1989   - var autoHeight = 547;
1990   - var dvAutoSpnFontSize = 12;
1991   - var imgLogoW = 77;
1992   - var fullWidth = 620; //$('#canvasDiv').width();
1993   - var fullHeight = 876; //$('#canvasDiv').height();
1994   -
1995   - if (sizePercent == 0) {
1996   - $('#printBoxPor').width(autoWidth).height(autoHeight);//.height(dvPrintBoxPorH * sizePercent);
1997   - $('#printBoxLan').width(autoHeight).height(autoWidth);
1998   - $('#dvPortrait').width(autoWidth);
1999   - $('#dvLandscape').width(autoHeight);
2000   - $('.span-font').attr('style', 'font-size: ' + (dvAutoSpnFontSize * .65).toFixed() + 'px');
2001   - $(".logo-image").attr('width', imgLogoW * .65);
2002   - }
2003   -
2004   - else if (sizePercent == 1) {
2005   - $('#dvPortrait').width(fullWidth * sizePercent);
2006   - $('#dvLandscape').width(fullHeight * sizePercent);
2007   - $('#printBoxPor').width(fullWidth * sizePercent).height(fullHeight * sizePercent);
2008   - $('#printBoxLan').width(fullHeight * sizePercent).height(fullWidth * sizePercent);
2009   - $('.span-font').attr('style', 'font-size: ' + dvAutoSpnFontSize + 'px');
2010   - $(".logo-image").attr('width', imgLogoW);
2011   - }
2012   -
2013   - else {
2014   - $('#dvPortrait').width(fullWidth * sizePercent);
2015   - $('#dvLandscape').width(fullHeight * sizePercent);
2016   - $('.span-font').attr('style', 'font-size: ' + (dvAutoSpnFontSize * sizePercent).toFixed() + 'px !important');
2017   - $(".logo-image").attr('width', (imgLogoW * sizePercent).toFixed());
2018   - if (sizePercent > 1) {
2019   - $('#printBoxPor').width(fullWidth * sizePercent).height(fullHeight * sizePercent);
2020   - $('#printBoxLan').width(fullHeight * sizePercent).height(fullWidth * sizePercent);
2021   - }
2022   - else {
2023   - $('#printBoxPor').width(fullWidth * sizePercent).height(fullHeight * sizePercent);
2024   - $('#printBoxLan').width(fullHeight * sizePercent).height(fullWidth * sizePercent);
2025   - }
2026   - }
2027   - }
2028   - </script>
2029   - <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-browser/0.1.0/jquery.browser.min.js"></script>
2030   -</body>
2031   -
  1 +<!DOCTYPE html>
  2 +<html lang="en" ng-cloak ng-app="AIA">
  3 +<head>
  4 + <!--<base href="/AIAHTML5/" />-->
  5 + <!--<base href="/AIA/" />-->
  6 + <base href="/" />
  7 + <meta charset="utf-8">
  8 + <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9 + <!--<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">-->
  10 + <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0 maximum-scale=1.0" />
  11 + <title>A.D.A.M. Interactive Anatomy</title>
  12 +
  13 + <link href="themes/default/css/bootstrap/3.3.6/bootstrap.css" rel="stylesheet" />
  14 +
  15 +
  16 +
  17 +
  18 + <link href="themes/default/css/bootstrap/3.3.6/main.css" rel="stylesheet" />
  19 +
  20 + <link href="themes/default/css/bootstrap/3.3.6/secondeffect.css" rel="stylesheet" />
  21 +
  22 + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  23 + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,800,700,600,400italic">
  24 +
  25 + <!--<link rel="styleSheet" href="themes/default/css/uigrid/ui-grid.min.css" />-->
  26 + <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  27 + <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  28 + <!--[if lt IE 9]>
  29 + <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  30 + <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  31 + <![endif]-->
  32 + <link href="themes/default/css/bootstrap/3.3.6/jquery.mCustomScrollbar.css" rel="stylesheet" />
  33 +
  34 + <link href="themes/default/css/bootstrap/3.3.6/jquery-ui.css" rel="stylesheet" />
  35 +
  36 + <link href="libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css" rel="stylesheet" />
  37 + <link href="libs/video_4_12_11/css/video-js_4_12_11.css" rel="stylesheet" />
  38 + <link href="libs/jquery/jquery_plugin/SpeechBubble/css/bubble.css" rel="stylesheet" />
  39 + <link href="libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.css" rel="stylesheet" />
  40 + <link href="themes/default/css/bootstrap/3.3.6/jquery.minicolors.css" rel="stylesheet" />
  41 + <link href="content/css/print-main.css" rel="stylesheet" />
  42 +
  43 + <!--Annotation Toolbar: Jcanvas-->
  44 + <style>
  45 + /*.ActiveDefaultColorAnnotation {
  46 + background-color: #000000!important;
  47 + }*/
  48 +
  49 +
  50 + #termList option:hover {
  51 + background-color: #3399FF !important;
  52 + color: #fff !important;
  53 + }
  54 +
  55 +
  56 + .ActiveFormattingButtonClass {
  57 + background-color: #1B92D0 !important;
  58 + }
  59 +
  60 + .Edittext-btn-css {
  61 + background: #4B4B4B;
  62 + padding: 4px;
  63 + cursor: pointer;
  64 + margin-right: 2px;
  65 + }
  66 +
  67 + /*.italic-btn-css {
  68 + background: #4B4B4B;
  69 + padding: 4px;
  70 + cursor: pointer;
  71 + margin-right: 2px;
  72 + }*/
  73 +
  74 + .underline-btn-css {
  75 + background: #4B4B4B;
  76 + padding: 4px;
  77 + cursor: pointer;
  78 + margin-right: 5px;
  79 + }
  80 +
  81 +
  82 +
  83 + .activebtncolor {
  84 + background-color: #1B92D0 !important;
  85 + border-color: #1B92D0 !important;
  86 + color: #ffffff !important;
  87 + }
  88 +
  89 + .btn-black-annotation {
  90 + background-color: #4b4b4b;
  91 + border-color: #3f3f3f;
  92 + color: #ffffff;
  93 + }
  94 +
  95 + /*.btn-black-annotation:hover {
  96 + background-color: #1B92D0 !important;
  97 + border-color: #1B92D0 !important;
  98 + color: #ffffff !important;
  99 + }*/
  100 +
  101 + .custom-tooltip-annotation {
  102 + background-color: #fff;
  103 + border: 0 none;
  104 + color: #000;
  105 + left: -52px;
  106 + opacity: 0.9;
  107 + padding: 3px 0;
  108 + position: absolute;
  109 + text-align: center;
  110 + top: 41px;
  111 + width: 120px;
  112 + display: none;
  113 + z-index: 10000;
  114 + border: 1px solid #000;
  115 + color: #000;
  116 + border-radius: 0;
  117 + }
  118 +
  119 + /*7931*/
  120 + .custom-tooltip-annotation-edit {
  121 + background-color: #fff;
  122 + border: 0 none;
  123 + color: #000;
  124 + left: 80px;
  125 + opacity: 0.9;
  126 + padding: 3px 0;
  127 + position: absolute;
  128 + text-align: center;
  129 + bottom: 50px;
  130 + width: 120px;
  131 + display: none;
  132 + z-index: 10000;
  133 + border: 1px solid #000;
  134 + color: #000;
  135 + border-radius: 0;
  136 + }
  137 +
  138 + .custom-tooltip-annotation-toolbar {
  139 + background-color: #fff;
  140 + border: 0 none;
  141 + color: #000;
  142 + opacity: 0.9;
  143 + padding: 3px 0;
  144 + position: absolute;
  145 + text-align: center;
  146 + display: none;
  147 + z-index: 10000;
  148 + border: 1px solid #000;
  149 + color: #000;
  150 + border-radius: 0;
  151 + }
  152 +
  153 + .restrict-carret-icon {
  154 + font-size: 18px;
  155 + position: relative;
  156 + top: 1px;
  157 + }
  158 +
  159 + #refreshBtn {
  160 + color: #ffffff;
  161 + }
  162 + </style>
  163 +
  164 +
  165 +
  166 +</head>
  167 +<body ng-controller="HomeController" id="bo" ng-init="initializeAIA()" ng-keydown="CheckRefresh($event)">
  168 + <div ng-hide="isVisibleResetPass">
  169 + <div id="login" ng-show="isVisibleLogin">
  170 +
  171 + <div class="container-fluid loginBg">
  172 + <div class="row">
  173 + <div class="col-xs-12 text-center">
  174 + <a href="index.html" class="loginLogo"><img src="content/images/common/logo-large.png" class="img-responsive" alt=""></a>
  175 + <div class="headerBand row">
  176 + <div class="col-xs-12">
  177 + <h1>A.D.A.M. Interactive Anatomy</h1>
  178 + <p>The most compresive online interactive anatomy learning resource</p>
  179 + </div>
  180 + </div>
  181 + </div>
  182 + <!--LOGIN PANEL-->
  183 + <div class="col-xs-12 loginPanel">
  184 + <div class="loginBox clearfix">
  185 + <div class="col-xs-12">
  186 + <!--<strong>Login</strong>-->
  187 + <form>
  188 + <div class="form-group">
  189 + <!--<label for="">User ID</label>-->
  190 + <!--input type="email" class="form-control" placeholder="User ID">
  191 + <span class="help-block text-right small"><a href="#" class="color-white">Forgot User ID?</a></span>-->
  192 +
  193 +
  194 + <div class="input-group">
  195 + <span class="input-group-addon"><i class="fa fa-user"></i></span>
  196 + <input type="text" class="form-control" placeholder="Username" ng-model="userInfo.username">
  197 + </div>
  198 + <span class="help-block text-right small"><a href="#" class="color-white" id="forgotUserIdAnchor" data-toggle="modal" ng-click="forgotUserModalShow()" data-target=".forgot-sm">Forgot User ID?</a></span>
  199 +
  200 +
  201 + </div>
  202 + <div class="form-group">
  203 + <!--<label for="">Password</label>-->
  204 + <!--<input type="password" class="form-control" placeholder="Password">
  205 + <span class="help-block text-right small "><a href="#" class="color-white">Forgot Password?</a></span>-->
  206 + <div class="input-group">
  207 + <span class="input-group-addon"><i class="fa fa-key"></i></span>
  208 + <input type="password" class="form-control" placeholder="Password" ng-model="userInfo.password">
  209 + </div>
  210 + <span class="help-block text-right small "><a class="color-white" style="cursor: pointer;" id="forgotPasswordAnchor" data-toggle="modal" ng-click="forgotPwdModalShow();" data-target=".forgot-sm1">Forgot Password?</a></span> <!--#resetpass" href="/app/views/Home/resetPwd.html"-->
  211 + </div>
  212 + <div class="form-group">
  213 + <button class="btn btn-primary pull-right" ng-click="AuthenticateUser(userInfo)">Log In</button>
  214 + </div>
  215 + </form>
  216 + </div>
  217 + </div>
  218 + <div class="loginExBtn">
  219 + <a href="https://store.adameducation.com/" target="_blank" class="btn btn-primary">Subscribe Now</a>
  220 + <a href="http://adameducation.com/aiaonline" target="_blank" class="btn btn-primary pull-right">Learn More</a>
  221 + </div>
  222 + </div>
  223 + </div>
  224 + </div>
  225 +
  226 + <!-- Footer -->
  227 + <footer class="dark">
  228 + <div class="container-fluid text-center">Copyright &copy; 2017 Ebix Inc. All rights reserved.</div>
  229 + </footer>
  230 + </div>
  231 + <!-- Forgot User ID (Small modal) -->
  232 + <div class="modal fade" id="forgotUserModal" role="dialog" tabindex="-1" aria-labelledby="exampleModalLabel" data-target=".forgot-sm">
  233 + <div class="modal-dialog modal-small" role="document">
  234 + <div class="modal-content">
  235 + <div class="modal-header">
  236 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  237 + <h5 class="modal-title" id="exampleModalLabel">Enter your email id to recover User id</h5>
  238 + </div>
  239 + <div class="modal-body">
  240 + <form id="forgetUSerIdForm">
  241 + <div class="form-group">
  242 + <div class="input-group">
  243 + <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
  244 + <input id="btnEmail" class="form-control" placeholder="Email" type="email" ng-model="userInfo.emailId">
  245 + </div>
  246 + </div>
  247 + </form>
  248 + </div>
  249 + <div class="modal-footer" style="padding-bottom:10px;">
  250 + <button type="button" class="btn btn-primary btn-block" ng-click="SendMailToUser(userInfo, false)">Send Mail</button>
  251 + </div>
  252 + <!--<div style="color: maroon; font-weight: bold; " ng-if="message">{{message}}</div>-->
  253 + </div>
  254 + </div>
  255 + </div>
  256 + <!-- Forgot Password (Small modal) -->
  257 + <div class="modal fade" id="forgotPwdModal" role="dialog" tabindex="-1" aria-labelledby="exampleModalLabel" data-target=".forgot-sm1">
  258 + <div class="modal-dialog modal-small" role="document">
  259 + <div class="modal-content">
  260 + <div class="modal-header">
  261 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  262 + <h5 class="modal-title" id="exampleModalLabel">Enter your email id to unblock/ recover Password</h5>
  263 + </div>
  264 + <div class="modal-body" style="padding: 15px;">
  265 + <form id="forgetPwdForm" class="ng-pristine ng-valid ng-valid-email">
  266 + <div class="form-group">
  267 + <div class="">
  268 + <label class="radio-inline">
  269 + <input name="inlineRadioOptions" id="inlineRadio1" value="unblock" type="radio"> Unblock
  270 + </label>
  271 + <label class="radio-inline">
  272 + <input name="inlineRadioOptions" id="inlineRadio2" value="forgotpwd" type="radio"> Forgot Password
  273 + </label>
  274 + </div>
  275 + </div>
  276 +
  277 +
  278 + <div class="form-group">
  279 + <div class="input-group" style="margin-top: 8px;">
  280 + <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
  281 + <input id="btnEmail2" class="form-control ng-pristine ng-untouched ng-valid ng-valid-email" placeholder="Email" ng-model="userInfo.emailId" type="email">
  282 + </div>
  283 + </div>
  284 + </form>
  285 + </div>
  286 + <div class="modal-footer modal-footer-forgot-password" style="padding-bottom:10px;">
  287 + <button type="button" class="btn btn-primary btn-block" ng-click="SendMailToUser(userInfo, true)">Send Mail</button>
  288 + </div>
  289 + <!--<div style="color: maroon; font-weight: bold; " ng-if="message">{{message}}</div>-->
  290 + </div>
  291 + </div>
  292 + </div>
  293 + <div id="index" ng-hide="isVisibleLogin">
  294 + <div class="container-fluid ">
  295 + <!--Header-->
  296 +
  297 + <nav class="navbar navbar-inverse navbar-fixed-top">
  298 + <div class="container-fluid">
  299 + <!-- Brand and toggle get grouped for better mobile display -->
  300 + <div class="navbar-header">
  301 + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false">
  302 + <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
  303 + </button>
  304 + <a class="frameLogo navbar-brand"><img src="content/images/logo-main.png" class="img-responsive" alt=""></a>
  305 + </div>
  306 + <div ng-include="'app/widget/TopMenu.html'"></div>
  307 + </div>
  308 + </nav>
  309 + <div class="bodyWrap row container-fluid">
  310 +
  311 + <div id="spinner" class="spinner" ng-show="isLoading" style="visibility:hidden">
  312 + <img id="img-spinner" src="content/images/common/loading.gif" alt="Loading" />
  313 + </div>
  314 + <div ng-view></div>
  315 +
  316 + </div>
  317 + </div>>
  318 +
  319 +
  320 +
  321 + <div class="modal fade" id="ShowListManager" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" ng-init="tab = 1" style="width:27%;left:50%;overflow:hidden;height:500px;top:100px">
  322 + <div class="modal-dialog" role="document" style="width:400px;">
  323 + <div class="modal-content" style="width:100%;max-width:400px;">
  324 + <div class="modal-header setting-modal-header" style="padding: 5px 10px; border-bottom: 1px solid #e5e5e5;">
  325 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  326 + <h4 class="modal-title" id="myModalLabel">Setting</h4>
  327 + </div>
  328 + <div class="modal-body">
  329 + <div class="row" style="padding-top:20px;">
  330 + <div class="col-sm-12">
  331 +
  332 + <div aria-label="..." role="group" class="btn-group btn-group-justified">
  333 + <div role="group" class="btn-group">
  334 + <button class="btn btn-sm btn-success" type="button" ng-click="tab = 1">Appearance</button>
  335 + </div>
  336 + <div role="group" class="btn-group">
  337 + <button class="btn btn-sm btn-success" type="button" ng-click="tab = 2">Lexicons</button>
  338 + </div>
  339 + <div role="group" class="btn-group">
  340 + <button class="btn btn-sm btn-success" type="button" ng-click="tab = 3">Dissectible</button>
  341 + </div>
  342 + </div>
  343 +
  344 + </div>
  345 +
  346 +
  347 + <div class="col-sm-12" ng-show="tab === 1">
  348 +
  349 +
  350 + <div class="row">
  351 + <div class="center-block col-md-11" style="float: none; background-color:#E2E2E2;height:300px;">
  352 + <div class="row" style="padding-top: 22px;">
  353 + <div class="center-block col-md-10" style="float: none; ">
  354 + <h5><strong>System Font</strong></h5>
  355 +
  356 + <div style="border:2px solid #ACACAC;float:left;padding:15px;background-color:#CCCCCC;">
  357 + <div class="col-md-3" style="padding-left:0px;">
  358 + Sample
  359 + </div>
  360 + <div class="col-md-6" style="padding-right:0px;">
  361 + <input type="text" value="" style="width:85%;">
  362 + </div>
  363 + <div class="col-md-3" style="padding-left:0px;">
  364 + <button class="btn btn-primary" style="margin-bottom:5px;">Change</button>
  365 + <button class="btn btn-primary" style="margin-bottom:5px;">Default</button>
  366 + </div>
  367 +
  368 + </div>
  369 + </div>
  370 + </div>
  371 +
  372 + </div>
  373 + </div>
  374 +
  375 + </div>
  376 + <div class="col-sm-12" ng-show="tab === 2">
  377 +
  378 +
  379 + <div class="row">
  380 + <div class="center-block col-md-11" style="float: none; background-color:#E2E2E2;height:300px;">
  381 + <div class="col-md-6">
  382 + <h6><strong>Primary Lexicon</strong></h6>
  383 + <input type="text" value="English" style="width:90%;">
  384 + <button class="btn btn-primary" style="float:right;margin-bottom:5px;margin-top:5px;">Change</button>
  385 + <h6>Secondry Lexicon</h6>
  386 + <textarea style="width:90%;"></textarea>
  387 + <button>Change</button>
  388 + <button>Change</button>
  389 + </div>
  390 + <div class="col-md-6">
  391 + <h6>Available Lexicon</h6>
  392 + <select multiple class="form-control" id="sel2">
  393 + <option>1</option>
  394 + <option>2</option>
  395 + <option>3</option>
  396 + <option>4</option>
  397 + <option>5</option>
  398 + </select>
  399 +
  400 + <p>Note: Some languages require special system fonts to display correctly</p>
  401 + </div>
  402 +
  403 + </div>
  404 + </div>
  405 +
  406 + </div>
  407 + <div class="col-sm-12" ng-show="tab === 3">
  408 +
  409 + <div class="row">
  410 + <div class="center-block col-md-11" style="float: none; background-color:#E2E2E2;height:300px;">
  411 + <h6>Skin Tones</h6>
  412 + <div class="center-block col-md-8" style="float: none;">
  413 + <div class="col-md-6">
  414 + <img class="img-responsive" alt="" src="http://placehold.it/400x300">
  415 + </div>
  416 + <div class="col-md-6">
  417 + <img class="img-responsive" alt="" src="http://placehold.it/400x300">
  418 + </div>
  419 + <div class="col-md-6">
  420 + <img class="img-responsive" alt="" src="http://placehold.it/400x300">
  421 + </div>
  422 + <div class="col-md-6">
  423 + <img class="img-responsive" alt="" src="http://placehold.it/400x300">
  424 + </div>
  425 +
  426 + </div>
  427 + <h6>Modesty Setting</h6>
  428 + <div class="col-md-6">
  429 + <div class="col-md-4">
  430 + <img class="img-responsive" alt="" src="http://placehold.it/400x300">
  431 + </div>
  432 + <div class="col-md-8">
  433 +
  434 + <div class="radio">
  435 + <label><input type="radio" name="optradio" checked>On</label>
  436 + </div>
  437 + <div class="radio">
  438 + <label><input type="radio" name="optradio">Off</label>
  439 + </div>
  440 +
  441 + </div>
  442 + </div>
  443 + <div class="col-md-6">
  444 + <h6>Annotaion</h6>
  445 + <div class="checkbox">
  446 + <label><input type="checkbox" value="" checked>Erase Annotations when changeing layers</label>
  447 + </div>
  448 + </div>
  449 + </div>
  450 +
  451 + </div>
  452 +
  453 +
  454 +
  455 + </div>
  456 + </div>
  457 + <div class="modal-footer">
  458 + <button type="button" class="btn btn-primary">Ok</button>
  459 + <button type="button" class="btn btn-primary" data-dismiss="modal">Cancle</button>
  460 + <button type="button" class="btn btn-primary">Apply</button>
  461 + </div>
  462 + </div>
  463 + </div>
  464 + </div>
  465 + </div>
  466 +
  467 + <!--Settings modal-->
  468 + <!--<div id="modal-settings" style="z-index: 1000000000; background: white;width: 302px;position:absolute;left:40%;right:0;top:70px;">-->
  469 + <div id="modelsettingsbackground" style="background-color: black; bottom: 0; display: none; height: 100%; left: 0; opacity: 0.5; position: fixed; right: 0; top: 0; width: 100%; z-index: 12000000;"></div>
  470 + <div id="modal-settings" style="display:none;z-index: 1000000000;height:auto;width: 300px;position:absolute;left:40%;right:0;top:70px;">
  471 + <div role="document">
  472 + <form>
  473 + <div ng-init="loadsettings()" class="modal-content" id="setting-modal-dark">
  474 + <div class="modal-header annotation-modal-header">
  475 + <button type="button" class="close" data-dismiss="modal" ng-click="CloseSetting()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  476 + <h4 class="modal-title" id="myModalLabel2">Settings</h4>
  477 + </div>
  478 + <div class="modal-body">
  479 + <div class="paddTop15">
  480 + <!-- Nav tabs -->
  481 + <ul class="nav nav-tabs" role="tablist">
  482 + <li role="presentation" ng-class="{'active':SettingsTab==1}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(1)">Appearance</a></li>
  483 + <li role="presentation" ng-class="{'active':SettingsTab==2}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(2);lexiconData()">Lexicons</a></li>
  484 + <li role="presentation" ng-class="{'active':SettingsTab==3}"><a role="tab" class="padd5" ng-click="SetSettingActiveTab(3)">Dissectible</a></li>
  485 +
  486 + </ul>
  487 + <!-- Tab panes -->
  488 + <div class="tab-content">
  489 + <div role="tabpanel" ng-class="{'tab-pane active' : SettingsTab === 1,'tab-pane' : SettingsTab !==1 }" id="appearance">
  490 + <div class="row">
  491 + <div class="col-sm-12">
  492 + <div class="well well-sm no-margin-btm">
  493 + <h5>System Font</h5>
  494 + <div class="form-group">
  495 + <label for="SystemFont" class="font13">Sample</label>
  496 + <input type="text" class="form-control" id="SystemFont" value="AaBbYyZz" disabled>
  497 + </div>
  498 + <button class="btn btn-success btn-sm" data-toggle="modal" data-target="#modal-change">Change</button>
  499 + <button class="btn btn-success btn-sm">Default</button>
  500 + </div>
  501 + </div>
  502 + </div>
  503 + </div>
  504 + <div role="tabpanel" ng-class="{'tab-pane active' : SettingsTab === 2,'tab-pane' : SettingsTab !==2 }" id="lexicons">
  505 + <div class="row paddingTopBtm10">
  506 + <div class="col-sm-6">
  507 + <div class="form-group">
  508 + <label for="SystemFont" class="font13">Primary Lexicon</label>
  509 + <input type="text" id="primarylaxican" class="form-control" value="English" name="1" disabled>
  510 + <button class="btn btn-sm btn-success btn-block marginTop5" id="laxicanlanguageChagne" disabled>Change</button>
  511 + </div>
  512 +
  513 + <div class="form-group">
  514 + <label for="SystemFont" class="font13">Secondary Lexicons</label>
  515 + <!--<textarea class="form-control" rows="3">-->
  516 + <select class="form-control" size="5" id="secondLax"></select>
  517 + <!--</textarea>-->
  518 + </div>
  519 + <div class="form-group">
  520 + <button class="btn btn-sm btn-success" id="laxiconLangAdd" disabled>Add</button>
  521 + <button class="btn btn-sm btn-success" id="laxiconLangRemove">Remove</button>
  522 + </div>
  523 + </div>
  524 + <div class="col-sm-6" style="padding-left:13px;padding-right:13px;">
  525 + <div class=" form-group">
  526 + <label for="SystemFont" class="font13">Available Lexicons</label>
  527 + <select class="form-control" size="8" id="lexiconLangDropdown"></select>
  528 + </div>
  529 + <p class="font11"><strong>Note :</strong> Some languages require special system fonts to display correctly</p>
  530 + </div>
  531 + <div class="clearfix"></div>
  532 + </div>
  533 + </div>
  534 + <div role="tabpanel" id="dissectible" ng-class="{'tab-pane active' : SettingsTab === 3,'tab-pane' : SettingsTab !==3 }">
  535 + <div class="">
  536 + <div class="col-sm-12">
  537 + <h5 class="bolder font13 no-margin-top">Skin Tones</h5>
  538 + <div class="skin-tones">
  539 + <div align="center">
  540 + <div class="col-sm-5">
  541 + <button id="btnEthnicW" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'W')">
  542 + <img src="~/../content/images/common/skin1.jpg" alt="">
  543 + </button>
  544 + </div>
  545 + <div class="col-sm-5">
  546 + <button id="btnEthnicB" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'B')">
  547 + <img src="~/../content/images/common/skin2.jpg" alt="">
  548 + </button>
  549 + </div>
  550 + <div class="col-sm-5">
  551 + <button id="btnEthnicL" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'A')">
  552 + <img src="~/../content/images/common/skin3.jpg" alt="">
  553 + </button>
  554 + </div>
  555 + <div class="col-sm-5">
  556 + <button id="btnEthnicA" class="thumbnail skinmarginbtm6" ng-model="formsetting.ethnicity" ng-click="ChangeEthnicity(formsetting,'L')">
  557 + <img src="~/../content/images/common/skin4.jpg" alt="">
  558 + </button>
  559 + </div>
  560 + </div>
  561 + </div>
  562 +
  563 + </div>
  564 + </div>
  565 + <div class="">
  566 + <div class="col-sm-6">
  567 + <h5 class="font13 bolder">Modesty Settings</h5>
  568 + <img src="~/../content/images/common/adam-leaf.png" alt="" class="pull-left marginR5">
  569 + <div class="radio">
  570 + <label>
  571 + <input type="radio" ng-checked="isModestyOn" ng-model="formsetting.modesty" value="Y" name="modestyRadios" id="modon" ng-click="ChangeModesty(formsetting,'Y')">
  572 + <span class="">On</span>
  573 + </label>
  574 + </div>
  575 + <div class="radio">
  576 + <label>
  577 + <input type="radio" ng-checked="isModestyOff" ng-model="formsetting.modesty" value="N" name="modestyRadios" id="modoff" ng-click="ChangeModesty(formsetting,'N')">
  578 + <span class="">Off</span>
  579 + </label>
  580 + </div>
  581 + </div>
  582 + <div class="col-sm-6">
  583 + <h5 class="font13 bolder">Annotation</h5>
  584 + <div class="checkbox no-margin">
  585 + <!--Settings > The entire highlighted part should be active-->
  586 + <label class="font11 no-margin-btm">
  587 + <input type="checkbox" value="" checked>
  588 + Erase Annotations when changing layers
  589 + </label>
  590 + </div>
  591 + </div>
  592 + </div>
  593 + </div>
  594 + </div>
  595 + </div>
  596 + </div>
  597 + <div class="modal-footer">
  598 + <button type="button" class="btn btn-primary" ng-click="UpdateAndCloseSetting(formsetting)">OK</button>
  599 +
  600 + <!--<button type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>-->
  601 + <button type="button" class="btn btn-primary" ng-click="CloseSetting()">Cancel</button>
  602 + <button type="button" class="btn btn-primary" ng-click="UpdateSetting(formsetting)">Apply</button>
  603 + </div>
  604 + </div>
  605 + </form>
  606 + </div>
  607 + </div>
  608 + <div id="setting-spinner" style="display:none;position: fixed; top: 50%; left: 50%; margin-left: -50px; z-index: 15000; overflow: auto; width: 100px;">
  609 + <img id="img-spinner" src="content/images/common/loading.gif" alt="Loading">
  610 + </div>
  611 + <!--Annotation Modal-->
  612 + <div class="annotationTollbar" style="width: 300px;position: fixed; top: 80px; right: 20px; display: none; z-index: 1200000;">
  613 + <div class="annotationbar">
  614 + <div class="modal-content">
  615 + <div class="modal-header annotation-modal-header">
  616 + <button type="button" class="close" aria-label="Close" ng-click="CloseAnnotationTool()"><span aria-hidden="true">&times;</span></button>
  617 + <h4 class="modal-title" id="myModalLabel">Annotation</h4>
  618 + </div>
  619 + <div class="modal-body" id="AnnotaionPopupDiv">
  620 + <div class="row">
  621 + <div class="col-sm-12">
  622 + <h5>Mode</h5>
  623 +
  624 + <div class="btn-group btn-group-justified" role="group" aria-label="...">
  625 + <div class="btn-group" role="group" tooltip>
  626 + <div id="identify-block" style="display: none; font-size:13px;">Identify Mode</div>
  627 + <button id="OnIdentify" type="button" class="btn btn-sm btn-success" ng-click="OnIdentifyClick()">Identify</button>
  628 + </div>
  629 + <div class="btn-group" role="group">
  630 + <div id="draw-block" style="display: none; font-size: 13px;">Draw Mode</div>
  631 + <button id="DrawMode" type="button" ng-click="DrawingMode()" class="btn btn-sm btn-success">Draw</button>
  632 + </div>
  633 + </div>
  634 +
  635 + </div>
  636 + <div class="col-sm-12">
  637 + <h5>Tools</h5>
  638 + <div class="well well-popup">
  639 + <div class="" aria-label="...">
  640 + <div class="" role="group" align="center">
  641 + <div id="cursor-block" style="display: none; font-size:13px;"></div>
  642 + <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btnCursor" ng-mouseover="addToolTip(75, 60, 120, 'Select Cursor(s)')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="Cursor()"><img src="content/images/icon-identity.png" alt="" title=""></button>
  643 + <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-pin" ng-mouseover="addToolTip(75, 100, 120, 'Draw Pin')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawPin($event)"><img src="content/images/draw-pin.png" alt="" title=""></button>
  644 + <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-arrow" ng-mouseover="addToolTip(75, 120, 120, 'Draw Arrow')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawArrow($event)"><img src="content/images/draw-arrow.png" alt="" title=""></button>
  645 + <button type="button" class="btn btn-black-annotation btn-xs mrgnBtm5 btn-annotation btn-annotation-Text" ng-mouseover="addToolTip(75, 140, 120, 'Draw Text')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawText($event)"><img src="content/images/draw-text.png" alt="" title=""></button>
  646 + </div>
  647 + <div class="" role="group" align="center">
  648 + <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-line" ng-mouseover="addToolTip(95, 60, 120, 'Draw Line')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawLine($event)"><img src="content/images/draw-line.png" alt="" title=""></button>
  649 + <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-rectangle" ng-mouseover="addToolTip(95, 100, 120, 'Draw Rectangle')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawRectangle($event)"><img src="content/images/draw-rec.png" alt="" title=""></button>
  650 + <button type="button" class="btn btn-black-annotation btn-xs btn-annotation btn-annotation-circle" ng-mouseover="addToolTip(95, 120, 120, 'Draw Circle')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawCircle($event)"><img src="content/images/draw-cir.png" alt="" title=""></button>
  651 + <!--<button type="button" class="btn btn-black-annotation btn-xs btn-annotation" ng-mouseover="addToolTip(95, 140, 120, 'Draw Polygon')" ng-mouseleave="removeToolTipOnMouseOut()" ng-click="DrawPolygon($event)"><img src="content/images/draw-poly.png" alt="" title=""></button>-->
  652 + <button type="button" class="btn btn-black-annotation" id="resetBtn" style="padding:1px 7px;display:none;" ng-click="resetDrawing()" ng-mouseover="addToolTip(95, 140, 120, 'Reset')" ng-mouseleave="removeToolTipOnMouseOut()"><i class="fa fa-refresh"></i></button>
  653 + </div>
  654 + </div>
  655 + </div>
  656 + <div class="well-popup well blankshapediv" ng-mouseover="addToolTip(200, 170, 120, 'Edit Style')" ng-mouseleave="removeToolTipOnMouseOut()">
  657 + <!--#7931-->
  658 +
  659 + <div id="edit-block" style="display: none; font-size: 13px;">Edit Shape Style</div>
  660 + <div id="previewBorder" class="outlinediv" ng-mouseover="addToolTip(170, 170, 120, 'Edit Style')" ng-mouseleave="removeToolTipOnMouseOut()">
  661 + <div id="shapeStyleDiv" style="background-color: #ffffff;" class="fullcolordiv" ng-click="disableAnnotationtoolOnListManager||enableAnnotationToolBar()">
  662 +
  663 + </div>
  664 +
  665 + </div>
  666 + </div>
  667 + <div class="well well-popup">
  668 + <div class="" role="group" aria-label="...">
  669 + <div>
  670 + <a href="#canvasPaint" data-tool="marker" data-size="1" data-color="#fff" id="annotationpaintbrushsize" ng-mouseover="addToolTip(270, 50, 120, 'Paint')" ng-mouseleave="removeToolTipOnMouseOut()" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-brush" role="button" data-placement="top" style="margin-right:1%;" ng-click="paintBrush()"><i class="fa fa-paint-brush"></i></a>
  671 + <a href="#canvasPaint" data-tool="eraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" data-size=" 1" id="annotationpainteraser" ng-click="EraseDrawing()" ng-mouseover="addToolTip(270, 70, 120, 'Erase')" ng-mouseleave="removeToolTipOnMouseOut()" role="button"><i class=" fa fa-eraser"></i></a>
  672 +
  673 + <!--<button type="button" id="annotationpainteraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" ng-click="EraseDrawing()" ng-mouseover="addToolTip(270, 70, 120, 'Erase')" ng-mouseleave="removeToolTipOnMouseOut()"><i class="fa fa-eraser"></i></button>-->&nbsp;
  674 + <div style="width: 80px; margin: 0px 0px 0px 4px; display: inline-block;float:left;">
  675 + <div style="width: 58px; float: left;" ng-mouseover="addToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()">
  676 + <input type="text" id="btnBrushSize" class="form-control" value="1" style="height:32px;border-radius:0;" oninput="Brushsize(this)">
  677 + </div>
  678 + <div style="width: 22px; float: left;">
  679 + <div style="width: 100%; float: left; height: 16px;">
  680 + <button type="button" id="btnBrushSizeIncrement" ng-mouseover="addToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()" class="btn btn-default" style="padding:0 5px;border-radius:0;font-size: 10px;vertical-align:top;">
  681 +
  682 + <img style="width:10px;height:10px;" src="~/../content/images/DA/angle-up.png">
  683 + </button>
  684 + </div>
  685 + <div style="width: 100%; float: left; height: 16px;">
  686 + <button type="button" id="btnBrushSizeDecrease" ng-mouseover="addToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()" class="btn btn-default" style="padding:0 5px;border-radius:0;font-size: 10px;vertical-align:top;">
  687 + <img style="width:10px;height:10px;" src="~/../content/images/DA/angle-down.png">
  688 + </button>
  689 + </div>
  690 + </div>
  691 +
  692 + </div>
  693 +
  694 +
  695 + <div class="pull-left pl-12" style="width:45%; margin-left:2%;margin-top:5px;">
  696 + <div id="slider-range-min-2" ng-mouseover="addToolTip(270, 170, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()"></div>
  697 + </div>
  698 + <div class="clearfix"></div>
  699 + </div>
  700 +
  701 + </div>
  702 +
  703 +
  704 + </div>
  705 +
  706 + </div>
  707 + </div>
  708 + </div>
  709 +
  710 + </div>
  711 + </div>
  712 + </div>
  713 +
  714 + <!--Modal For Annotation Text Box-->
  715 + <div id="annotationTextModal" style="display:none;z-index: 1000000000;width:500px;height:241px;padding-right:0!important;position:fixed;left:0;right:0;top:0px;bottom:0;margin:auto;">
  716 +
  717 + <div class="modal-content">
  718 + <div class="modal-header" style="background-color: #808D43;padding:10px;border-bottom:0;">
  719 + <!--<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>-->
  720 + <h4 class="modal-title" id="myModalLabel" style="font-weight:bold;">Enter Text to be put in a box</h4>
  721 + </div>
  722 + <div class="modal-body">
  723 + <div class="col-xs-12" style="padding:20px 0;">
  724 + <div class="form-inline">
  725 + <!--Annotation: Text in different font style is same.-->
  726 + <select class="form-control" id="selected-font-family"></select>
  727 + <select class="form-control" id="selected-font-size">
  728 + <option>14</option>
  729 + <option>16</option>
  730 + <option>18</option>
  731 + <option>20</option>
  732 + <option>22</option>
  733 + <option>24</option>
  734 + <option>26</option>
  735 + <option>28</option>
  736 + <option>36</option>
  737 + <option>48</option>
  738 + <option>72</option>
  739 + </select>
  740 + <span style="vertical-align:middle;">
  741 + <span id="text-bold" class="Edittext-btn-css">
  742 + <i aria-hidden="true" class="fa fa-bold" style="color: #fff"></i>
  743 + </span>
  744 + <span id="text-italic" class="Edittext-btn-css">
  745 + <i class="fa fa-italic" aria-hidden="true" style="color: #fff"></i>
  746 +
  747 + </span>
  748 + <span id="text-underline" class="underline-btn-css">
  749 + <i class="fa fa-underline" aria-hidden="true" style="color: #fff"></i>
  750 + </span>
  751 + </span>
  752 +
  753 + <div class="form-group" id="font-color" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;">
  754 +
  755 + <input type="text" id="saturation-demo" class="form-control demo" data-control="saturation" style="display:none;" value="#0088cc">
  756 + </div>
  757 + <div class="form-group" id="drawTextBGColorpicker" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;">
  758 + <input type="text" id="saturation-demo-background" class="form-control drawTextBG" data-control="saturation" style="display:none;" value="#0088cc">
  759 + </div>
  760 +
  761 + <span style="vertical-align:middle;">
  762 + <span id="text-left" class="Edittext-btn-css">
  763 + <i aria-hidden="true" class="fa fa-align-left" style="color: #fff"></i>
  764 + </span>
  765 + <span id="text-center" class="Edittext-btn-css">
  766 + <i class="fa fa-align-center" aria-hidden="true" style="color: #fff"></i>
  767 +
  768 +
  769 + </span>
  770 + <span id="text-right" class="underline-btn-css">
  771 + <i class="fa fa-align-right" aria-hidden="true" style="color: #fff"></i>
  772 +
  773 +
  774 + </span>
  775 + </span>
  776 +
  777 +
  778 + </div>
  779 + </div>
  780 + <textarea class="form-control" id="text_area" rows="3" style="font-family: 'Verdana, sans-serif';font-size:14px; font-weight: normal; font-style: normal; color: #000; text-align: left; text-decoration: none;"></textarea>
  781 +
  782 + <!--code for horizonatl text going out-->
  783 + <div id="atTextDiv" style="float:left;">
  784 + <span id="duptextspan" style="float: left; display: none;"></span>
  785 + <span id="textspan" style="display:none;"></span>
  786 + </div>
  787 + <!--code for horizonatl text going out-->
  788 +
  789 + </div>
  790 + <div class="modal-footer">
  791 + <!--<button type="button" class="btn btn-default" ng-click="closeModal()" data-dismiss="modal">Close</button>-->
  792 + <button type="button" class="btn btn-default" ng-click="closeModal()" id="closeEditText" data-dismiss="modal">Close</button>
  793 + <button type="button" id="saveBtn" class="btn btn-primary" data-dismiss="modal" ng-click="saveText()">Save</button>
  794 + </div>
  795 + </div>
  796 +
  797 + </div>
  798 +
  799 +
  800 +
  801 +
  802 + <!--List manager-->
  803 + <!--List manager-->
  804 + <style>
  805 + #listManager {
  806 + background: #fff;
  807 + border-radius: 3px;
  808 + border: 1px solid #ededed;
  809 + -webkit-box-shadow: 0px 0px 2px 1px rgba(173,173,173,1);
  810 + -moz-box-shadow: 0px 0px 2px 1px rgba(173,173,173,1);
  811 + box-shadow: 0px 0px 2px 1px rgba(173,173,173,1);
  812 + width: 350px;
  813 + position: absolute;
  814 + top: 170px;
  815 + left: 140px;
  816 + display: none;
  817 + z-index: 780000;
  818 + height: auto !important;
  819 + }
  820 +
  821 + #listManager .annotation-modal-header {
  822 + background: #818f44;
  823 + padding: 2px 10px;
  824 + }
  825 +
  826 + #listManager .annotation-modal-header h4 {
  827 + color: #fff;
  828 + font-size: 15px;
  829 + line-height: 20px;
  830 + }
  831 +
  832 + #listManager .modal-header .close {
  833 + color: #fff;
  834 + margin: 0;
  835 + opacity: 10;
  836 + text-shadow: none;
  837 + }
  838 +
  839 + #listManager .modal-footer {
  840 + padding: 5px 10px;
  841 + }
  842 + </style>
  843 + <div id="listManager" style="">
  844 + <div class="modal-header annotation-modal-header">
  845 + <button type="button" class="close" aria-label="Close" ng-click="CloseListManager()"><span aria-hidden="true">&times;</span></button>
  846 + <h4 class="modal-title" id="myModalLabel">List Manager</h4>
  847 + </div>
  848 + <div class="modal-body">
  849 + <div class="row paddingTopBtm10">
  850 + <div class="col-sm-12" ng-init="FillListManager()">
  851 +
  852 + <div class="form-group">
  853 + <label for="sel1">Window</label>
  854 + <select class="form-control" id="viewName" disabled>
  855 + <!--<option>Male Lateral</option>-->
  856 +
  857 + </select>
  858 + </div>
  859 + <div style="">
  860 + <div class="form-group">
  861 + <div ng-click="restrictBodySystemList()" class="btn btn-success btn-block" style="padding:3px 12px;">
  862 + <i class=" fa fa-caret-right restrict-carret-icon"></i> <span>Restrict List to</span>
  863 + </div>
  864 + </div>
  865 +
  866 + <div id="restrictListDiv" style="display:none;">
  867 + <div class="well well-sm marginTopBtm10">
  868 + <div class="form-horizontal">
  869 + <div class="form-group">
  870 + <label class="col-sm-4 control-label" for="System">System</label>
  871 + <div class="col-sm-8">
  872 + <select id="bodySystems" class="form-control" onchange="if (typeof (this.selectedIndex) != 'undefined') refreshTermListOnSystem(this.options[this.selectedIndex].id)"></select>
  873 + <select id="AABodySystems" class="form-control" onchange="if (typeof (this.selectedIndex) != 'undefined') refreshTermListOnSystemSel(this.options[this.selectedIndex].id)" style="display:none;"></select>
  874 + </div>
  875 + </div>
  876 + <div class="form-group">
  877 + <label class="col-sm-4 control-label" for="inputPassword3">Area</label>
  878 + <div class="col-sm-8">
  879 + <select class="form-control" disabled>
  880 + <option value="1" selected="">Entire View</option>
  881 + </select>
  882 + </div>
  883 + </div>
  884 + </div>
  885 + </div>
  886 +
  887 +
  888 + </div>
  889 +
  890 + <!--DA > List Manager > Multiple structure selection should not be available.-->
  891 + <div class="form-group">
  892 + <select id="termList" class="form-control" size="10" onclick="if (typeof (this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id, true)"></select>
  893 + </div>
  894 +
  895 + </div>
  896 + <div style="clear:both;"></div>
  897 +
  898 +
  899 +
  900 +
  901 + </div>
  902 + </div>
  903 +
  904 + </div>
  905 + <div class="modal-footer" id="totalTerms">
  906 + <!--<span class="pull-left marginTop5">424 Structures</span>-->
  907 + <!--<button data-dismiss="modal" class="btn btn-primary" type="button"><i class="fa fa-arrow-circle-right"></i></button>-->
  908 + </div>
  909 + </div>
  910 +
  911 + <!--background disable div-->
  912 +
  913 + <div id="modelbackground"></div>
  914 +
  915 +
  916 + <!--Edit Shape Modal-->
  917 +
  918 +
  919 + <div class="modeleditstyle" id="modeleditstyle" style="z-index: 1000000000; background: white;width: 302px;position:absolute;left:40%;right:0;top:70px;">
  920 + <div class="modal-content">
  921 + <div class="modal-header annotation-modal-header">
  922 + <h4 class="modal-title" id="myModalLabel33">Edit Shape Style</h4>
  923 + </div>
  924 + <form id="editStyleForm">
  925 + <div class="modal-body">
  926 + <div class="marginTopBtm10">
  927 + <div class="well well-sm no-margin-btm">
  928 + <div class="row">
  929 + <div class="col-sm-12">
  930 + <div class="checkbox no-margin">
  931 + <label>
  932 + <input id="fill-option" type="checkbox" checked onclick="enableDisableFillOption()"> Fill Option
  933 + </label>
  934 + </div>
  935 + </div>
  936 + <div class="col-sm-6 enableDisableOpacity">
  937 + <!--<div class="radio">
  938 + <label>
  939 + <input type="radio" name="filloption" id="filloption1" value="filloption1">
  940 + <span class="">Texture</span>
  941 + <img id="editstyleTexture" src="~/../content/images/common/annotation-tool-bar/pattern-picker.png" alt="" class="pattern-picker" data-toggle="modal" data-target="#pattern">
  942 + </label>
  943 + </div>-->
  944 + <div class="radio">
  945 + <label>
  946 + <input type="radio" name="filloption" id="filloption2" value="filloption2" checked style="margin-top:8px;">
  947 +
  948 +
  949 + <div id="editstylebackgroundcolor" class="form-group" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;float:left;">
  950 + <span style="font-weight: normal; float: left; padding-top: 5px; padding-right: 5px;">Color</span>
  951 + <input type="text" class="form-control outerBackgroundColor" data-control="saturation" style="display:none;" value="#0088cc">
  952 + </div>
  953 +
  954 +
  955 + </label>
  956 + </div>
  957 + </div>
  958 + <div class="col-sm-6 no-padding marginTop10 enableDisableOpacity">
  959 + <div class="row">
  960 + <label class="pull-left" style="font-weight:normal;">Scale</label>
  961 + <div id="edit-slider-3" class="pull-left pl-12" style="width:62%; margin-left:3%; margin-top:2%;">
  962 + <div id="slider-range-min-3"></div>
  963 + </div>
  964 + </div>
  965 +
  966 + <div class="row">
  967 + <label class="pull-left" style="font-weight:normal;">Opacity</label>
  968 + <div id="edit-slider-4" class="pull-left pl-12" style="width:53%; margin-left:3%; margin-top:2%;">
  969 + <div id="slider-range-min-4"></div>
  970 + </div>
  971 + </div>
  972 +
  973 + <div class="clearfix"></div>
  974 +
  975 +
  976 + </div>
  977 + </div>
  978 +
  979 + </div>
  980 + </div>
  981 + <div class="marginTopBtm10">
  982 + <div class="well well-sm no-margin-btm">
  983 + <div class="row">
  984 + <div class="col-sm-12">
  985 + <div class="checkbox no-margin">
  986 + <label>
  987 + <input id="Outline-Option" onclick="enableDisableOutline()" type="checkbox" checked> Outline Option
  988 + </label>
  989 + </div>
  990 + </div>
  991 + <div class="col-sm-6 setEnableDisableForEditShapeStyle">
  992 + <label class="marginTop5">
  993 + <span style="font-weight: normal; float: left; padding-top: 5px; padding-right: 5px;">Color</span>
  994 + <div class="form-group" id="outlineColor" style="display:inline-flex;vertical-align:top;cursor:pointer;margin-right:36px;float:left;">
  995 +
  996 + <input type="text" class="form-control borderColorCanvasPreview" data-control="saturation" style="display:none;" value="#0088cc">
  997 + </div>
  998 +
  999 +
  1000 + </label>
  1001 + </div>
  1002 +
  1003 + <div class="col-sm-6 setEnableDisableForEditShapeStyle">
  1004 + <div class="form-horizontal">
  1005 + <div class="form-group">
  1006 + <label class="col-sm-3 control-label" style=" font-weight:normal; padding-top:9px;">Size</label>
  1007 + <div class="col-sm-9 marginTop5">
  1008 + <select id="borderWidthCanvasElement" class="form-control input-sm">
  1009 + <option value="1">1</option>
  1010 + <option value="2">2</option>
  1011 + <option value="3">3</option>
  1012 + <option value="4">4</option>
  1013 + <option value="5">5</option>
  1014 + </select>
  1015 + </div>
  1016 + </div>
  1017 + </div>
  1018 + </div>
  1019 +
  1020 + </div>
  1021 + </div>
  1022 + </div>
  1023 +
  1024 + <div class="marginTopBtm10">
  1025 +
  1026 + <div class="well well-sm no-margin-btm blankshapediv">
  1027 + <div class="outlinediv" id="outlinedivId" style="border: 1px solid #000000;">
  1028 + <div id="imgOpacity" style="background-color: #ffffff" class="fullcolordiv imgopacity">
  1029 + </div>
  1030 + </div>
  1031 + </div>
  1032 +
  1033 + </div>
  1034 + </div>
  1035 + <div class="modal-footer">
  1036 + <button id="btnShapeStyle" type="button" class="btn btn-primary btn-sm" ng-click="setPropertiesForShapes('imgOpacity')">
  1037 + OK
  1038 + </button>
  1039 + <button type="button" class="btn btn-primary btn-sm" data-dismiss="modal" ng-click="disableAnnotationToolBar()">Cancel</button>
  1040 + </div>
  1041 + </form>
  1042 + </div>
  1043 + </div>
  1044 +
  1045 + <!--Export Image Modal-->
  1046 + <div class="modal fade export-image ui-draggable in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  1047 + style="z-index: 1200002;">
  1048 + <div class="modal-dialog modal-sm" role="document">
  1049 + <div class="modal-content">
  1050 + <div class="modal-header annotation-modal-header ui-draggable-handle">
  1051 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  1052 + <h4 class="modal-title" id="">Save As</h4>
  1053 + </div>
  1054 + <div class="modal-body">
  1055 + <div class="row paddTopbtm15">
  1056 + <div class="col-sm-12">
  1057 + <div class="form-group">
  1058 + <label for="filename">Filename:</label>
  1059 + <div class="input-group">
  1060 + <input type="text" class="form-control" id="filename" placeholder="" ng-model="filename">
  1061 + <div class="input-group-addon">.jpg</div>
  1062 + </div>
  1063 + </div>
  1064 + </div>
  1065 + </div>
  1066 +
  1067 + </div>
  1068 + <div class="modal-footer">
  1069 + <div class="row">
  1070 + <input type="file" id="file1" style="display:none">
  1071 + <!--<a href="data:application/xml;charset=utf-8,your code here" download="filename.html">Save</a-->
  1072 + <div class="col-sm-12"><button id="btnSaveEI" class="btn btn-primary" data-dismiss="modal" type="button">Ok</button></div> <!--onclick="makeScreenshot();"--><!--ng-click="dialogs.saveAs()"--><!--ng-click="ShowAlert()"-->
  1073 + </div>
  1074 + </div>
  1075 +
  1076 + </div>
  1077 + </div>
  1078 + </div>
  1079 +
  1080 + <!--Print Active Viewer-->
  1081 + <div class="print-box-active portrait-box-active" id="printBox" style="display: none;">
  1082 + <div id="printDivContent">
  1083 + <div class="">
  1084 + <div class="print-col-sm-4" style="top: 10px; position: absolute; left: 10px;">
  1085 + <span class="pull-left font12 print-span-font" id="spnModule"></span>
  1086 + </div>
  1087 + <div class="print-col-sm-4" style="top: 10px; position: absolute; right: 10px;">
  1088 + <span class="pull-right font12 print-span-font" id="spnBodyViewTitle"></span>
  1089 + </div>
  1090 + </div>
  1091 + <div class=" mar-top-25" align="center" id="dvPortrait" style="text-align: center;">
  1092 + <img src="" alt="" class="logo-image" id="snipImage" style="width: 100%;" />
  1093 + </div>
  1094 + <div>
  1095 + <div class="print-col-sm-4" style="position: absolute; bottom: 20px;">
  1096 + <span class="pull-left marginTop10 font12 print-span-font">Copyright 2016 A.D.A.M., Inc. All Rights Reserved</span>
  1097 + </div>
  1098 + <div class="print-col-sm-4" style="position: absolute; bottom: 20px; right: 10px;">
  1099 + <span class="pull-right print-marginTop10 bgnone no-margin">
  1100 + <img class="logo-image" src="content/images/adam-logo-small.png" alt="">
  1101 + </span>
  1102 + </div>
  1103 + </div>
  1104 + <div class="clearfix"></div>
  1105 + </div>
  1106 + </div>
  1107 +
  1108 + <!--Print Preview Modal-->
  1109 + <div id="dvPrintPreview" style="display: none;"></div>
  1110 + </div>
  1111 + </div>
  1112 + <!--RESET PASSWORD FORM-->
  1113 + <div id="passwordReset" ng-show="isVisibleResetPass">
  1114 + <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
  1115 + <tbody>
  1116 + <tr>
  1117 + <td align="center" valign="middle" bgcolor="#393939 " style="padding:30px 0 20px 0;"><a href="#"><img src="../content/images/logo.png" alt="AIA" title="AIA" /></a></td>
  1118 + </tr>
  1119 + <tr>
  1120 + <td align="center" valign="top" bgcolor="#808d43" style="padding:20px; overflow:hidden;">
  1121 + <form name="resetPasswordForm" novalidate>
  1122 + <table width="100%" border="0" cellspacing="0" cellpadding="0" ng-controller="HomeController">
  1123 + <tbody>
  1124 +
  1125 + <tr>
  1126 + <td style=" font-size:26px; font-weight:bold; color:#fff; font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif"><strong>Reset Password</strong></td>
  1127 + </tr>
  1128 + <tr>
  1129 + <td>&nbsp;</td>
  1130 + </tr>
  1131 + <tr>
  1132 + <td style="font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#fff;">New Password </td>
  1133 + </tr>
  1134 + <tr>
  1135 + <td>
  1136 + <input class="form-control" name="newPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.newPassword" ng-minlength="8" ng-maxlength="20" required>
  1137 + <span style="color: maroon; font-weight:bold" ng-show="resetPasswordForm.newPassword.$touched && resetPasswordForm.newPassword.$invalid && resetPasswordForm.newPassword.$pristine">The password is required.</span>
  1138 + <p ng-show="resetPasswordForm.newPassword.$error.minlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p>
  1139 + <p ng-show="resetPasswordForm.newPassword.$error.maxlength" style="font-weight: bold; color: maroon;">Password length must be between 8 - 20 characters.</p>
  1140 + </td>
  1141 + </tr>
  1142 + <tr>
  1143 + <td>&nbsp;</td>
  1144 + </tr>
  1145 + <tr>
  1146 + <td style="font-family:Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color:#fff;">Confirm Password </td>
  1147 + </tr>
  1148 +
  1149 + <tr>
  1150 + <td>
  1151 + <input class="form-control" name="confirmPassword" value="*****" type="password" style="padding:3px 5px; height:25px; width:98%;" ng-model="userInfo.confirmPassword" required>
  1152 + <span style="color: maroon; font-weight: bold; " ng-show="resetPasswordForm.confirmPassword.$touched && resetPasswordForm.confirmPassword.$invalid">Confirm password is required.</span>
  1153 + <span style="color: maroon; font-weight: bold; " ng-if="resetPasswordForm.newPassword !== resetPasswordForm.confirmPassword">{{passwordMismatchMessage}}</span>
  1154 + </td>
  1155 + </tr>
  1156 + <tr>
  1157 + <td>&nbsp;</td>
  1158 + </tr>
  1159 + <tr>
  1160 + <td>
  1161 + <button type="submit" ng-disabled="resetPasswordForm.$invalid" ng-click="ResetUserPassword(userInfo)" style="background: #0072a7; border: 1px solid #005076; cursor: pointer; color: #fff; padding: 5px 10px; font-size: 16px; text-transform: uppercase; text-align: center; text-decoration: none; font-family: gotham, 'Helvetica Neue', helvetica, arial, sans-serif; " id="btnUpdatePassword">Submit</button> <!--ng-submit="submitForm(resetPwdForm.$valid)"--> <!--ng-click="ResetUserPassword(userInfo)"-->
  1162 + </td>
  1163 + </tr>
  1164 + </tbody>
  1165 + </table>
  1166 + </form>
  1167 + </tr>
  1168 +
  1169 +
  1170 + </tbody>
  1171 + </table>
  1172 + </div>
  1173 +
  1174 + <div class="modal fade" id="messageModal" role="dialog">
  1175 + <div class="modal-dialog">
  1176 +
  1177 + <div class="modal-content">
  1178 + <div class="modal-header">
  1179 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  1180 + </div>
  1181 + <div class="modal-title"></div>
  1182 + <div class="modal-body">{{errorMessage}}</div>
  1183 + <div class="modal-footer"> <button type="button" class="btn btn-primary" data-dismiss="modal">OK</button></div>
  1184 + </div>
  1185 + </div>
  1186 + </div>
  1187 +
  1188 + <!--Admin Form (Under Process)-->
  1189 + <div class="modal fade ui-draggable in" id="adminModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; ">
  1190 + <div class="modal-dialog" role="document">
  1191 + <div class="modal-content">
  1192 + <div class="modal-header ui-draggable-handle" style="color: #e5e5e5;">
  1193 + <!--bg-primary-->
  1194 + <button type="button" class="close" data-dismiss="modal" aria-label="Close" id="btnCloseAAModal" ng-click="CloseAAModal()"><span aria-hidden="true">×</span></button>
  1195 + <h5 class="text-left lhgt19 padd5" style="color:red; text-align:left;">*This module is not yet available to use, please fill in the form with complete details, a support request will be submitted to ADAM Education Sales and Support team. If needed someone from ADAM team will contact you ASAP.</h5>
  1196 + </div>
  1197 + <div class="modal-body">
  1198 + <div class="panel-body">
  1199 + <!-- form -->
  1200 + <form class="form-horizontal" name="adminAccessRequestForm">
  1201 + <div class="form-group">
  1202 + <label for="inputEmail3" class="col-sm-3 control-label">First Name :</label>
  1203 + <div class="col-sm-8">
  1204 + <input class="form-control" id="adminfName" placeholder="" ng-model=" userinfo.firstname" ng-readonly="true">
  1205 + </div>
  1206 + </div>
  1207 + <div class="form-group">
  1208 + <label for="inputPassword3" class="col-sm-3 control-label">Last Name :</label>
  1209 + <div class="col-sm-8">
  1210 + <input class="form-control" id="adminlName" placeholder="" type="text" ng-model="userInfo.lastName" ng-readonly="true">
  1211 + </div>
  1212 + </div>
  1213 + <div class="form-group">
  1214 + <label for="inputPassword3" class="col-sm-3 control-label">Email Id <span class="red">*</span> :</label>
  1215 + <div class="col-sm-8">
  1216 + <input class="form-control" id="adminEmailId" placeholder="" type="text" ng-model="userInfo.emailId" ng-readonly="true">
  1217 + </div>
  1218 + </div>
  1219 + <div class="form-group">
  1220 + <label for="inputPassword3" class="col-sm-3 control-label">Message <span class="red">*</span> :</label>
  1221 + <div class="col-sm-8">
  1222 + <textarea name="adminAccessTextArea" class="form-control" rows="3" placeholder="Message" ng-model="userInfo.userMessage" required></textarea> <!--ng-show="!adminRequestTextArea.length-->
  1223 + <span id="spnError" style="color: maroon; font-weight:bold" ng-show="adminAccessRequestForm.adminAccessTextArea.$invalid">Message required.</span>
  1224 + </div>
  1225 + </div>
  1226 + <div class="form-group">
  1227 + <div class="col-sm-offset-3 col-sm-8 mar-top17">
  1228 + <button type="button" class="btn btn-primary btn-sm" ng-click="adminAccessRequestForm.$valid && SendAdminAccessRequestMail(userInfo)" data-toggle="modal" data-target="#mymodal"><i class="fa fa-check"></i> Submit</button>
  1229 + </div>
  1230 +
  1231 + </div>
  1232 + </form>
  1233 + </div>
  1234 + </div>
  1235 +
  1236 + </div>
  1237 + </div>
  1238 + </div>
  1239 +
  1240 + <!--Available modules list modal after login-->
  1241 + <div class=" fade ui-draggable in" id="dvUserModulesInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; left: 0px !important; z-index: 111111; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; right: 0px; bottom: 0px; ">
  1242 + <div class="modal-dialog" role="document">
  1243 + <div class="modal-content">
  1244 + <div class="modal-header ui-draggable-handle " style="color: #ffffff; background-color: #0095da; border-color: #007ab3;cursor:default;">
  1245 + <!--color: #e5e5e5;-->
  1246 + <!--bg-primary-->
  1247 + <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
  1248 + <h4 class="text-left lhgt19 padd5" style="color:#fff; text-align:left;">Modules Availability</h4>
  1249 + </div>
  1250 +
  1251 + <div class="modal-body">
  1252 + <div class="panel-body">
  1253 + <!-- form -->
  1254 + <form class="form-horizontal">
  1255 + <div>
  1256 + <div class="form-group" id="moduleDiv1">
  1257 + <div class="col-sm-8">• Dissectible Anatomy</div>
  1258 + </div>
  1259 + <div class="form-group" id="moduleDiv2">
  1260 + <div class="col-sm-8">• Atlas Anatomy</div>
  1261 + </div>
  1262 + <div class="form-group" id="moduleDiv3">
  1263 + <div class="col-sm-8">• 3D Anatomy</div>
  1264 + </div>
  1265 + <div class="form-group" id="moduleDiv4">
  1266 + <div class="col-sm-8">• Clinical Illustrations</div>
  1267 + </div>
  1268 + <div class="form-group" id="moduleDiv5">
  1269 + <div class="col-sm-8">• Clinical Animations</div>
  1270 + </div>
  1271 + <div class="form-group" id="moduleDiv6">
  1272 + <div class="col-sm-8">• Encyclopedia</div>
  1273 + </div>
  1274 + <div class="form-group" id="moduleDiv9">
  1275 + <div class="col-sm-8">• IP 10</div>
  1276 + </div>
  1277 + <div class="form-group" id="moduleDiv11">
  1278 + <div class="col-sm-8">• In - Depth Reports</div>
  1279 + </div>
  1280 + <div class="form-group" id="moduleDiv12">
  1281 + <div class="col-sm-8">• Complementary and Alternative Medicine</div>
  1282 + </div>
  1283 +
  1284 + <div class="form-group" id="moduleDiv14">
  1285 + <div class="col-sm-8">• Body Guide</div>
  1286 + </div>
  1287 + <div class="form-group" id="moduleDiv15">
  1288 + <div class="col-sm-8">• Symptom Navigator</div> <!--Health-->
  1289 + </div>
  1290 + <div class="form-group" id="moduleDiv16">
  1291 + <div class="col-sm-8">• The Wellness Tools</div>
  1292 + </div>
  1293 + <div class="form-group" id="moduleDiv1017">
  1294 + <div class="col-sm-8">• A.D.A.M on Demand</div>
  1295 + </div>
  1296 + </div>
  1297 + <!--<hr style="border: 1px solid;"/>-->
  1298 + <div id="dvPending" style="margin: 15px 0;"><b>Pending Modules</b></div>
  1299 + <!--<hr style="border: 1px solid;" />-->
  1300 + <div>
  1301 + <div class="form-group" id="moduleDiv7">
  1302 + <div class="col-sm-12"><i>• Curriculum Builder</i></div> <!--(To be available by 09/25/2017)-->
  1303 + </div>
  1304 + <div class="form-group" id="moduleDiv8">
  1305 + <div class="col-sm-8"><i>• Anatomy Test</i></div> <!--(To be available by 08/28/2017)-->
  1306 + </div>
  1307 + <div class="form-group" id="moduleDiv10">
  1308 + <div class="col-sm-8"><i>• Lab Exercises</i></div> <!--(To be available by 08/16/2017)-->
  1309 + </div>
  1310 + <div class="form-group" id="moduleDiv13">
  1311 + <div class="col-sm-8">• A.D.A.M Images</div>
  1312 + </div>
  1313 + </div>
  1314 + <div class="form-group">
  1315 + <div style="text-align: center">
  1316 + <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" data-dismiss="modal"><i class="fa fa-check"></i> OK</button>
  1317 + </div>
  1318 + </div>
  1319 + </form>
  1320 + </div>
  1321 + </div>
  1322 +
  1323 + </div>
  1324 + </div>
  1325 + </div>
  1326 +
  1327 + <!-- Terms & Condition Modal -->
  1328 + <div class=" fade ui-draggable in" id="dvTermCondition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="padding-left: 17px; display: none; left: 0px !important; z-index: 111111; position: fixed; top: 0; overflow-x: hidden; overflow-y: auto; right: 0px; bottom: 0px; ">
  1329 + <div class="modal-dialog" role="document">
  1330 + <div class="modal-content">
  1331 + <div class="modal-header ui-draggable-handle " style="color: #ffffff; background-color: #0095da; border-color: #007ab3;cursor:default;">
  1332 + <!--color: #e5e5e5;-->
  1333 + <h6 class="text-left lhgt19 padd5" style="color:#fff; text-align:left;">Terms and Conditions</h6>
  1334 + </div>
  1335 +
  1336 + <div class="modal-body" style="width: 597px; height: 400px; overflow-x: auto;">
  1337 + <div class="panel-body">
  1338 + <div id="dvTerms" style="font-size: 13px;"></div>
  1339 + </div>
  1340 + </div>
  1341 + <div class="modal-footer ui-draggable-handle " style="color: #ffffff; cursor:default;">
  1342 + <!--background-color: #0095da; border-color: #007ab3;-->
  1343 + <!-- form -->
  1344 + <form class="form-horizontal">
  1345 + <!--<div class="form-group">-->
  1346 + <div style="clear: left; float: left; color: #000;"><input type="checkbox" id="chkAccept" ng-model="checked" style="vertical-align: top;" /> I accept</div>
  1347 + <div style="float: right;"><button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#mymodal" ng-disabled="!checked" data-dismiss="modal" ng-click="UpdateLicenseTermStatus()"><i class="fa fa-check"></i> Next</button></div>
  1348 + <!--</div>-->
  1349 + </form>
  1350 + </div>
  1351 + </div>
  1352 + </div>
  1353 + </div>
  1354 + <script>
  1355 + function enableDisableFillOption() {
  1356 + if (document.getElementById('fill-option').checked) {
  1357 + // $('#imgOpacity').attr("background-color");
  1358 + //$('#imgOpacity').css({"background-color"})
  1359 + //$("#filloption1").css({ "pointer-events": "auto" });
  1360 + //$("#filloption12").css({ "pointer-events": "auto" });
  1361 +
  1362 + var x = $("#editstylebackgroundcolor span.minicolors-swatch-color").css('background-color');
  1363 + $("#imgOpacity").css("background-color", x);
  1364 + $("#edit-slider-3").css({ "pointer-events": "auto" });
  1365 + $("#edit-slider-4").css({ "pointer-events": "auto" });
  1366 + $("#editstylebackgroundcolor").css({ "pointer-events": "auto" });
  1367 + $("#editstyleTexture").css({ "pointer-events": "auto" });
  1368 + $(".enableDisableOpacity label").css({ "cursor": "pointer" });
  1369 + $(".enableDisableOpacity").css({ "opacity": "1" })
  1370 + document.getElementById("filloption1").disabled = false;
  1371 + document.getElementById("filloption2").disabled = false;
  1372 + document.getElementById("filloption1").style.cursor = "default";
  1373 + document.getElementById("filloption2").style.cursor = "default";
  1374 +
  1375 +
  1376 +
  1377 + }
  1378 + else {
  1379 + $('#imgOpacity').css("background-color", "transparent");
  1380 + //$("#filloption1").css({ "pointer-events": "none" });
  1381 + //$("#filloption2").css({ "pointer-events": "none" });
  1382 + $("#edit-slider-3").css({ "pointer-events": "none" });
  1383 + $("#edit-slider-4").css({ "pointer-events": "none" });
  1384 + $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
  1385 + $("#editstyleTexture").css({ "pointer-events": "none" });
  1386 + $(".enableDisableOpacity label").css({ "cursor": "default" });
  1387 + $(".enableDisableOpacity").css({ "opacity": ".5" })
  1388 + document.getElementById("filloption1").disabled = true;
  1389 + document.getElementById("filloption2").disabled = true;
  1390 + document.getElementById("filloption1").style.cursor = "default";
  1391 + document.getElementById("filloption2").style.cursor = "default";
  1392 +
  1393 +
  1394 +
  1395 + }
  1396 +
  1397 + }
  1398 + function enableDisableOutline() {
  1399 +
  1400 + if (document.getElementById('Outline-Option').checked) {
  1401 + var x = $("#outlineColor span.minicolors-swatch-color").css('background-color');
  1402 + $(".marginTopBtm10 div.outlinediv").css("border-color", x);
  1403 + // var borderWidth = $("#outlineColor span.minicolors-swatch-color").css('border-width');
  1404 + // $("#imgOpacity").css("border-width", borderWidth);
  1405 +
  1406 + $("#borderWidthCanvasElement").css({ "pointer-events": "auto" });
  1407 + $("#outlineColor").css({ "pointer-events": "auto" });
  1408 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": "1" })
  1409 + }
  1410 + else {
  1411 + $('.marginTopBtm10 div.outlinediv').css("border-color", "transparent");
  1412 + $("#borderWidthCanvasElement").css({ "pointer-events": "none" });
  1413 + $("#outlineColor").css({ "pointer-events": "none" });
  1414 + $(".setEnableDisableForEditShapeStyle").css({ "opacity": ".5" })
  1415 + }
  1416 + }
  1417 +
  1418 + </script>
  1419 +
  1420 + <script>
  1421 + function Brushsize(object) {
  1422 +
  1423 + object.value = object.value.replace(/[^0-9]/g, '');
  1424 + if (parseInt(object.value) <= 0) {
  1425 + object.value = 1;
  1426 + }
  1427 + if (parseInt(object.value) >= 1 && parseInt(object.value) <= 60) {
  1428 + object.value = object.value;
  1429 + }
  1430 + if (parseInt(object.value) > 60) {
  1431 + object.value = object.value.slice(0, 1);
  1432 +
  1433 + }
  1434 +
  1435 + }
  1436 + </script>
  1437 +
  1438 +
  1439 + <!--<script src="libs/jquery/1.11.3/jquery.min.js"></script>-->
  1440 + <script src="libs/jquery/2.1.3/jquery.min.js"></script>
  1441 + <script src="libs/jquery/1.11.4/jquery-ui.js"></script>
  1442 +
  1443 + <script src="libs/jquery/jquery_plugin/jquery.mCustomScrollbar.concat.min.js"></script>
  1444 + <script src="themes/default/scripts/bootstrap/3.3.5/bootstrap.js"></script>
  1445 + <script src="libs/angular/1.4.9/angular.min.js"></script>
  1446 + <script src="libs/angular/1.4.9/angular-route.min.js"></script>
  1447 + <script src="libs/angular/1.4.9/angular-sanitize.min.js"></script>
  1448 + <script src="libs/angular/1.4.9/ngStorage.js"></script>
  1449 + <script src="content/js/custom/custom.js"></script>
  1450 + <!--Annotation Toolbar : jcanvas Library-->
  1451 +
  1452 + <script src="libs/jcanvas/jcanvas.min.js"></script>
  1453 + <script src="libs/jcanvas/jcanvas.handle.min.js"></script>
  1454 +
  1455 + <script src="libs/jinqJs.js"></script>
  1456 + <script src="libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js"></script>
  1457 + <script src="libs/video_4_12_11/video_4_12_11.js"></script>
  1458 + <script src="libs/jquery/jquery_plugin/SpeechBubble/bubble.js"></script>
  1459 + <!--<script src="libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.min.js"></script>-->
  1460 + <script src="app/main/AIA.js"></script>
  1461 + <script src="app/main/Link.js"></script>
  1462 + <script src="content/scripts/js/custom/custom.js"></script>
  1463 + <script src="app/filters/ColorMatrixFilter.js"></script>
  1464 + <script src="app/utility/Matrix.js"></script>
  1465 + <script src="app/utility/Point.js"></script>
  1466 + <script src="app/utility/Rectangle.js"></script>
  1467 + <script src="app/utility/BitmapData.js"></script>
  1468 + <script src="app/utility/Paint.js"></script>
  1469 + <script src="app/controllers/DAController.js"></script>
  1470 + <script src="app/controllers/CIController.js"></script>
  1471 + <script src="app/controllers/CAController.js"></script>
  1472 + <script src="app/controllers/3dAController.js"></script>
  1473 + <script src="app/controllers/CurrBuildController.js"></script>
  1474 + <script src="app/controllers/AnatTestController.js"></script>
  1475 + <script src="app/controllers/LabExercController.js"></script>
  1476 + <script src="app/controllers/ADAMImgController.js"></script>
  1477 + <script src="app/controllers/AODController.js"></script>
  1478 + <script src="app/controllers/HomeController.js"></script>
  1479 + <script src="app/controllers/LinkController.js"></script>
  1480 + <script src="app/services/AuthenticationService.js"></script>
  1481 + <script src="app/services/AdminService.js"></script>
  1482 + <script src="app/controllers/TileViewListController.js"></script>
  1483 +
  1484 + <script src="app/services/ModuleService.js"></script>
  1485 +
  1486 + <script src="app/services/DataService.js"></script>
  1487 + <script src="app/services/TermService.js"></script>
  1488 + <script src="libs/jquery/jquery_plugin/jqueryui.js"></script>
  1489 + <script src="libs/jquery/jquery_plugin/slider-pips/jquery-ui-slider-pips.js"></script>
  1490 +
  1491 + <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
  1492 +
  1493 + <script src="libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js"></script>
  1494 + <!--<script src="libs/colorpicker/jquery.minicolors.min.js"></script>-->
  1495 + <!--<script src="libs/color-picker/jquery.minicolors.min.js"></script>-->
  1496 +
  1497 + <script src="libs/sketch.js"></script>
  1498 +
  1499 + <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>-->
  1500 + <script src="libs/html2canvas.js"></script>
  1501 + <script src="libs/FileSaver.js"></script>
  1502 +
  1503 + <!--<script type="text/javascript">
  1504 + $(function () {
  1505 + $('#canvas').sketch();
  1506 + });
  1507 + </script>-->
  1508 +
  1509 + <script>
  1510 +
  1511 + $(function () {
  1512 + $('[data-toggle="tooltip"]').tooltip();
  1513 + })
  1514 +
  1515 + </script>
  1516 + <script>
  1517 + (function ($) {
  1518 + $(window).load(function () {
  1519 + $(".sidebar").mCustomScrollbar({
  1520 + autoHideScrollbar: true,
  1521 + //theme:"rounded"
  1522 + });
  1523 +
  1524 + });
  1525 + })(jQuery);
  1526 + </script>
  1527 + <script>
  1528 + $(function () {
  1529 + $(".modal").draggable();
  1530 + $(".annotationTollbar").draggable();
  1531 + $(".modeleditstyle").draggable();
  1532 + $("#annotationTextModal").draggable();
  1533 + $("#modal-settings").draggable();
  1534 + });
  1535 + </script>
  1536 +
  1537 +
  1538 +
  1539 +
  1540 + <script type="text/javascript">
  1541 + $(function () {
  1542 +
  1543 + $("#text-left").on('click', function () {
  1544 +
  1545 + //Annotation: Formatting buttons color is not change when select.
  1546 +
  1547 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  1548 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1549 + $("#text-left").addClass("ActiveFormattingButtonClass");
  1550 + $("#text_area").css("text-align", "left");
  1551 +
  1552 +
  1553 + });
  1554 +
  1555 +
  1556 + $("#text-center").on('click', function () {
  1557 +
  1558 + //Annotation: Formatting buttons color is not change when select.
  1559 +
  1560 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1561 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1562 + $("#text-center").addClass("ActiveFormattingButtonClass");
  1563 + $("#text_area").css("text-align", "center");
  1564 +
  1565 +
  1566 + });
  1567 +
  1568 +
  1569 + $("#text-right").on('click', function () {
  1570 +
  1571 + //Annotation: Formatting buttons color is not change when select.
  1572 +
  1573 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1574 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  1575 + $("#text-right").addClass("ActiveFormattingButtonClass");
  1576 + $("#text_area").css("text-align", "right");
  1577 + });
  1578 +
  1579 +
  1580 + $("#text-bold").on('click', function () {
  1581 +
  1582 + //Annotation: Formatting buttons color is not change when select.
  1583 + $("#text-bold").toggleClass("ActiveFormattingButtonClass");
  1584 +
  1585 + if ($("#text-bold").hasClass("ActiveFormattingButtonClass")) {
  1586 + $("#text_area").css("font-weight", "bold");
  1587 + }
  1588 + else {
  1589 + $("#text_area").css("font-weight", "normal");
  1590 + }
  1591 +
  1592 +
  1593 + });
  1594 +
  1595 + $("#text-italic").on('click', function () {
  1596 +
  1597 + //Annotation: Formatting buttons color is not change when select.
  1598 + $("#text-italic").toggleClass("ActiveFormattingButtonClass");
  1599 + if ($("#text-italic").hasClass("ActiveFormattingButtonClass")) {
  1600 + $("#text_area").css("font-style", "italic");
  1601 + }
  1602 + else {
  1603 + $("#text_area").css("font-style", "normal");
  1604 + }
  1605 + });
  1606 +
  1607 + $("#text-underline").on('click', function () {
  1608 +
  1609 + //Annotation: Formatting buttons color is not change when select.
  1610 + $("#text-underline").toggleClass("ActiveFormattingButtonClass");
  1611 +
  1612 + if ($("#text-underline").hasClass("ActiveFormattingButtonClass")) {
  1613 + $("#text_area").css("text-decoration", "underline");
  1614 + }
  1615 + else {
  1616 + $("#text_area").css("text-decoration", "none");
  1617 + }
  1618 +
  1619 +
  1620 + });
  1621 +
  1622 +
  1623 + $("#selected-font-size").change(function () {
  1624 +
  1625 + $("#text_area").css("font-size", $(this).val() + "px");
  1626 + });
  1627 +
  1628 + $("#selected-font-family").change(function () {
  1629 +
  1630 + $("#text_area").css("font-family", $(this).val());
  1631 +
  1632 + });
  1633 +
  1634 +
  1635 + });
  1636 +
  1637 +
  1638 +
  1639 + </script>
  1640 +
  1641 +
  1642 + <script>
  1643 + $(document).ready(function () {
  1644 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  1645 +
  1646 + var borderWidth = 1;
  1647 + var borderColor = "#000";
  1648 + $("#borderWidthCanvasElement").change(function () {
  1649 + borderWidth = $(this).val();
  1650 + borderColor = $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color");
  1651 +
  1652 + if (borderColor != null) {
  1653 + document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
  1654 + //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor);
  1655 + } else {
  1656 +
  1657 + // $("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid");
  1658 + document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
  1659 +
  1660 + }
  1661 + });
  1662 +
  1663 +
  1664 +
  1665 + $('.borderColorCanvasPreview').each(function () {
  1666 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  1667 + $(this).minicolors({
  1668 + control: $(this).attr('data-control') || 'hue',
  1669 + defaultValue: $(this).attr('data-defaultValue') || '',
  1670 + format: $(this).attr('data-format') || 'hex',
  1671 + keywords: $(this).attr('data-keywords') || '',
  1672 + inline: $(this).attr('data-inline') === 'true',
  1673 + letterCase: $(this).attr('data-letterCase') || 'lowercase',
  1674 + opacity: $(this).attr('data-opacity'),
  1675 + position: $(this).attr('data-position') || 'bottom left',
  1676 + swatches: $(this).attr('data-swatches') ? $(this).attr('data-swatches').split('|') : [],
  1677 + change: function (value, opacity) {
  1678 + if (!value) return;
  1679 + if (opacity) value += ', ' + opacity;
  1680 + if (typeof console === 'object') {
  1681 + console.log(value);
  1682 +
  1683 + borderColor = value;
  1684 + //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor);
  1685 + document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
  1686 +
  1687 +
  1688 + }
  1689 + },
  1690 + theme: 'bootstrap'
  1691 + });
  1692 +
  1693 +
  1694 + });
  1695 +
  1696 +
  1697 + $('.outerBackgroundColor').each(function () {
  1698 +
  1699 + $(this).minicolors({
  1700 + control: $(this).attr('data-control') || 'hue',
  1701 + defaultValue: $(this).attr('data-defaultValue') || '',
  1702 + format: $(this).attr('data-format') || 'hex',
  1703 + keywords: $(this).attr('data-keywords') || '',
  1704 + inline: $(this).attr('data-inline') === 'true',
  1705 + letterCase: $(this).attr('data-letterCase') || 'lowercase',
  1706 + opacity: $(this).attr('data-opacity'),
  1707 + position: $(this).attr('data-position') || 'bottom left',
  1708 + swatches: $(this).attr('data-swatches') ? $(this).attr('data-swatches').split('|') : [],
  1709 + change: function (value, opacity) {
  1710 + if (!value) return;
  1711 + if (opacity) value += ', ' + opacity;
  1712 + if (typeof console === 'object') {
  1713 + console.log(value);
  1714 + $("#imgOpacity").css("background-color", value);
  1715 +
  1716 + }
  1717 + },
  1718 + theme: 'bootstrap'
  1719 + });
  1720 +
  1721 + });
  1722 +
  1723 +
  1724 + });
  1725 + </script>
  1726 + <script>
  1727 + $(function () {
  1728 + function onBrushSizeChange() {
  1729 + $('.btnCursor').addClass('activebtncolor');
  1730 + $(".btn-annotation").removeClass("activebtncolor");
  1731 + $(".btn-annotation-erase").removeClass("activebtncolor");
  1732 + $(".btn-annotation-erase").removeClass("activebtncolor");
  1733 + $(".annotationpaintbrushsize").removeClass("activebtncolor");
  1734 + var x = $('#canvasPaint').css("z-index");
  1735 +
  1736 + var y = $('#canvas').css("z-index");
  1737 + if (x > y) {
  1738 + y = parseInt(x) + 1;
  1739 + } else {
  1740 + y = parseInt(y) + 1;
  1741 + }
  1742 + $('#canvas').css("z-index", y);
  1743 + }
  1744 +
  1745 + $("#slider-range-min-2").slider({
  1746 + range: "min",
  1747 + min: 1,
  1748 + max: 60,
  1749 + value: 1,
  1750 + slide: function (event, ui) {
  1751 +
  1752 + onBrushSizeChange();
  1753 +
  1754 +
  1755 +
  1756 + $("#btnBrushSize").val(ui.value);
  1757 +
  1758 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1759 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1760 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1761 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1762 +
  1763 + },
  1764 + stop: function (event, ui) {
  1765 +
  1766 + $("#paintLine").attr("data-size", ui.value);
  1767 +
  1768 + }
  1769 +
  1770 + });
  1771 +
  1772 +
  1773 + $("#btnBrushSize").keydown(function () {
  1774 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1775 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1776 + onBrushSizeChange();
  1777 + var brushSizevalue = this.value;
  1778 +
  1779 + $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
  1780 + });
  1781 + $("#btnBrushSize").keyup(function () {
  1782 + onBrushSizeChange();
  1783 + var brushSizevalue = this.value;
  1784 + if (brushSizevalue == "") {
  1785 +
  1786 + $("#slider-range-min-2").slider("value", 0);
  1787 +
  1788 + $("#annotationpaintbrushsize").css({ "pointer-events": "none", "opacity": ".5" });
  1789 + $("#annotationpainteraser").css({ "pointer-events": "none", "opacity": ".5" });
  1790 + }
  1791 + else {
  1792 + $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
  1793 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1794 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1795 + }
  1796 + // $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
  1797 + });
  1798 + $("#btnBrushSizeIncrement").click(function () {
  1799 + if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
  1800 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1801 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1802 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1803 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1804 + }
  1805 +
  1806 + onBrushSizeChange();
  1807 + var brushIncrementVar = $("#btnBrushSize").val();
  1808 + if (brushIncrementVar >= 60) {
  1809 + $("#slider-range-min-2").slider("value", 60);
  1810 + }
  1811 + else if (brushIncrementVar == "") {
  1812 + var brushIncrementedValue = 1;
  1813 + $("#btnBrushSize").val(brushIncrementedValue);
  1814 + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
  1815 + }
  1816 + else {
  1817 +
  1818 + var brushIncrementedValue = parseInt(brushIncrementVar) + 1;
  1819 +
  1820 + $("#btnBrushSize").val(brushIncrementedValue);
  1821 + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue));
  1822 + }
  1823 + });
  1824 + $("#btnBrushSizeDecrease").click(function () {
  1825 +
  1826 + onBrushSizeChange();
  1827 + var brushDecreaseVar = $("#btnBrushSize").val();
  1828 + if (brushDecreaseVar == "") {
  1829 +
  1830 + $("#btnBrushSizeDecrease").css({ "pointer-events": "none", "opacity": ".5" });
  1831 + $("#btnBrushSizeDecrease").css({ "pointer-events": "none", "opacity": ".5" });
  1832 +
  1833 + }
  1834 + else if (brushDecreaseVar <= 1) {
  1835 + $("#slider-range-min-2").slider("value", 1);
  1836 + if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
  1837 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1838 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1839 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": ".5" });
  1840 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": ".5" });
  1841 + }
  1842 +
  1843 + }
  1844 + else {
  1845 + var brushDecrementedValue = parseInt(brushDecreaseVar) - 1;
  1846 + if ($("#annotationpaintbrushsize").css('pointer-events') == 'none') {
  1847 + $("#annotationpaintbrushsize").css({ "pointer-events": "auto", "opacity": "1" });
  1848 + $("#annotationpainteraser").css({ "pointer-events": "auto", "opacity": "1" });
  1849 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1850 + $("#btnBrushSizeDecrease").css({ "pointer-events": "auto", "opacity": "1" });
  1851 + }
  1852 + $("#btnBrushSize").val(brushDecrementedValue);
  1853 + $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue));
  1854 + }
  1855 + });
  1856 +
  1857 + $("#btnBrushSize").val($("#slider-range-min-2").slider("value"));
  1858 + });
  1859 + </script>
  1860 +
  1861 + <script>
  1862 + $(function () {
  1863 + $("#slider-range-min-3").slider({
  1864 + range: "min",
  1865 + min: 0,
  1866 + max: 100,
  1867 + value: 20,
  1868 + change: function (event, ui) {
  1869 +
  1870 +
  1871 + }
  1872 + });
  1873 +
  1874 +
  1875 +
  1876 + });
  1877 + </script>
  1878 +
  1879 + <script>
  1880 + $(function () {
  1881 +
  1882 +
  1883 +
  1884 + $("#slider-range-min-4").slider(
  1885 + {
  1886 + range: "min",
  1887 + value: .5,
  1888 + min: 0,
  1889 + max: 1,
  1890 + step: .1,
  1891 + slide: function (event, ui) {
  1892 +
  1893 + $(".marginTopBtm10 .imgopacity").css("opacity", ui.value);
  1894 + $(".marginTopBtm10 div.outlinediv").css("opacity", ui.value);
  1895 + }
  1896 +
  1897 + }
  1898 +
  1899 +);
  1900 +
  1901 + });
  1902 +
  1903 +
  1904 +
  1905 + </script>
  1906 +
  1907 +
  1908 +
  1909 + <script>
  1910 + $(function () {
  1911 +
  1912 +
  1913 + $("#OnIdentify").on('mouseover', function () {
  1914 + $("#identify-block").addClass("custom-tooltip-annotation");
  1915 + $(".custom-tooltip-annotation").css('display', 'block');
  1916 + }).on('mouseout', function () {
  1917 + // $("#identify-block").removeClass("custom-tooltip-annotation");
  1918 + $(".custom-tooltip-annotation").css('display', 'none');
  1919 + $("#identify-block").removeClass("custom-tooltip-annotation");
  1920 + });
  1921 +
  1922 +
  1923 + $("#DrawMode").on('mouseover', function () {
  1924 + $("#draw-block").addClass("custom-tooltip-annotation");
  1925 + $(".custom-tooltip-annotation").css('display', 'block');
  1926 +
  1927 + }).on('mouseout', function () {
  1928 +
  1929 + $(".custom-tooltip-annotation").css('display', 'none');
  1930 + $("#draw-block").removeClass("custom-tooltip-annotation");
  1931 + });
  1932 +
  1933 + //#7931
  1934 + $("#OnEdtShape").on('mouseover', function () {
  1935 + $("#edit-block").addClass("custom-tooltip-annotation-edit");
  1936 + $(".custom-tooltip-annotation-edit").css('display', 'block');
  1937 +
  1938 + }).on('mouseout', function () {
  1939 +
  1940 + $(".custom-tooltip-annotation-edit").css('display', 'none');
  1941 + $("#edit-block").removeClass("custom-tooltip-annotation-edit");
  1942 + });
  1943 +
  1944 + });
  1945 + </script>
  1946 + <!-- Export Image Save Click-->
  1947 + <script>
  1948 + $(function () {
  1949 + $("#btnSaveEI").click(function () {
  1950 + var $ua = navigator.userAgent;
  1951 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  1952 + $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
  1953 + html2canvas($("#canvasDiv"), {
  1954 + onrendered: function (canvas) {
  1955 + var imgsrc = canvas.toDataURL("image/png");
  1956 + console.log(imgsrc);
  1957 + var html = '<div id="img"><img src="' + imgsrc + '" id="newimg" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>';
  1958 + var w = window.open();
  1959 + $(w.document.body).html(html);
  1960 + $("#filename").val("");
  1961 + }
  1962 + });
  1963 + }
  1964 + else {
  1965 + $("#canvasDiv").append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
  1966 + html2canvas($("#canvasDiv"), {
  1967 + onrendered: function (canvas) {
  1968 + theCanvas = canvas;
  1969 + var fileName = document.getElementById("filename").value + '.jpg';
  1970 + if (typeof (fileName) == "undefined" || fileName == ".jpg")
  1971 + fileName = "Untitled.jpg"
  1972 + var dataURL = canvas.toDataURL("image/jpeg");
  1973 + var blob = dataURItoBlob(dataURL);
  1974 + console.log(blob);
  1975 + saveAs(blob, fileName);
  1976 + $("#exportlogo").remove();
  1977 + $("#filename").val("");
  1978 + }
  1979 + });
  1980 + $(".export-image").css("display", "none");
  1981 + }
  1982 + });
  1983 + });
  1984 + function dataURItoBlob(dataURI) {
  1985 + var byteString = atob(dataURI.split(',')[1]);
  1986 + var ab = new ArrayBuffer(byteString.length);
  1987 + var ia = new Uint8Array(ab);
  1988 + for (var i = 0; i < byteString.length; i++) {
  1989 + ia[i] = byteString.charCodeAt(i);
  1990 + }
  1991 + return new Blob([ab], { type: 'image/jpeg' });
  1992 + }
  1993 + </script>
  1994 + <script>
  1995 + function ResizeImage(sizePercent) {
  1996 + var autoWidth = 427;
  1997 + var autoHeight = 547;
  1998 + var dvAutoSpnFontSize = 12;
  1999 + var imgLogoW = 77;
  2000 + var fullWidth = 620; //$('#canvasDiv').width();
  2001 + var fullHeight = 876; //$('#canvasDiv').height();
  2002 +
  2003 + if (sizePercent == 0) {
  2004 + $('#printBoxPor').width(autoWidth).height(autoHeight);//.height(dvPrintBoxPorH * sizePercent);
  2005 + $('#printBoxLan').width(autoHeight).height(autoWidth);
  2006 + $('#dvPortrait').width(autoWidth);
  2007 + $('#dvLandscape').width(autoHeight);
  2008 + $('.span-font').attr('style', 'font-size: ' + (dvAutoSpnFontSize * .65).toFixed() + 'px');
  2009 + $(".logo-image").attr('width', imgLogoW * .65);
  2010 + }
  2011 +
  2012 + else if (sizePercent == 1) {
  2013 + $('#dvPortrait').width(fullWidth * sizePercent);
  2014 + $('#dvLandscape').width(fullHeight * sizePercent);
  2015 + $('#printBoxPor').width(fullWidth * sizePercent).height(fullHeight * sizePercent);
  2016 + $('#printBoxLan').width(fullHeight * sizePercent).height(fullWidth * sizePercent);
  2017 + $('.span-font').attr('style', 'font-size: ' + dvAutoSpnFontSize + 'px');
  2018 + $(".logo-image").attr('width', imgLogoW);
  2019 + }
  2020 +
  2021 + else {
  2022 + $('#dvPortrait').width(fullWidth * sizePercent);
  2023 + $('#dvLandscape').width(fullHeight * sizePercent);
  2024 + $('.span-font').attr('style', 'font-size: ' + (dvAutoSpnFontSize * sizePercent).toFixed() + 'px !important');
  2025 + $(".logo-image").attr('width', (imgLogoW * sizePercent).toFixed());
  2026 + if (sizePercent > 1) {
  2027 + $('#printBoxPor').width(fullWidth * sizePercent).height(fullHeight * sizePercent);
  2028 + $('#printBoxLan').width(fullHeight * sizePercent).height(fullWidth * sizePercent);
  2029 + }
  2030 + else {
  2031 + $('#printBoxPor').width(fullWidth * sizePercent).height(fullHeight * sizePercent);
  2032 + $('#printBoxLan').width(fullHeight * sizePercent).height(fullWidth * sizePercent);
  2033 + }
  2034 + }
  2035 + }
  2036 + </script>
  2037 + <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-browser/0.1.0/jquery.browser.min.js"></script>
  2038 +</body>
  2039 +
2032 2040 </html>
2033 2041 \ No newline at end of file
... ...