Commit 5e186125c2ed93ac7449b3cd81ee4fda3c51a556

Authored by Nikita Kulshreshtha
1 parent 0746dd80

Refs: #7245

Each functionality is working in this.
Along with the list manager close on any button click in left toolbar.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -95,7 +95,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -95,7 +95,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
95 $scope.dragdivleft = 0; 95 $scope.dragdivleft = 0;
96 $scope.dragdivtop = 0; 96 $scope.dragdivtop = 0;
97 97
98 -  
99 $scope.IsSearchVisible = false; 98 $scope.IsSearchVisible = false;
100 $scope.shapesize = 1; 99 $scope.shapesize = 1;
101 $scope.dragdivposition = { 100 $scope.dragdivposition = {
@@ -663,8 +662,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -663,8 +662,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
663 //calculate coordinates for body region images 662 //calculate coordinates for body region images
664 $scope.CalculateImageCordinates = function (viewOrientationId) { 663 $scope.CalculateImageCordinates = function (viewOrientationId) {
665 664
666 - console.log('CalculateImageCordinates is called')  
667 -  
668 $scope.terminateCurrentlyRunningWPs(); 665 $scope.terminateCurrentlyRunningWPs();
669 666
670 var drawnBodyRegionCount = []; 667 var drawnBodyRegionCount = [];
@@ -693,8 +690,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -693,8 +690,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
693 $('#leftToolBar').css('height', $('#daImagePanel').outerHeight()) 690 $('#leftToolBar').css('height', $('#daImagePanel').outerHeight())
694 691
695 692
696 - $scope.counter = 0;  
697 - $scope.MCounter = 0; 693 +
698 //calculate image coordinates and draw image 694 //calculate image coordinates and draw image
699 var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews; 695 var bodyRegionCoordinates = $rootScope.BodyRegionData.BodyRegionViews;
700 // var viewOrientationId = String($rootScope.voId); 696 // var viewOrientationId = String($rootScope.voId);
@@ -713,20 +709,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -713,20 +709,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
713 .where('_ViewOrientationId == ' + viewOrientationId) 709 .where('_ViewOrientationId == ' + viewOrientationId)
714 .select(); 710 .select();
715 711
716 - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length > 0) {  
717 - $scope.ColoredImageSRC.length = 0;  
718 - // $scope.ColoredImageSRC = undefined; 712 + if ($scope.ColoredImageSRC != null && $scope.ColoredImageSRC.length > 0) {
  713 + $scope.ColoredImageSRC = null;
719 $scope.ColoredImageSRC = []; 714 $scope.ColoredImageSRC = [];
720 $scope.flushCanvas(); 715 $scope.flushCanvas();
721 } 716 }
722 else { 717 else {
723 $scope.ColoredImageSRC = []; 718 $scope.ColoredImageSRC = [];
724 } 719 }
725 - var counter = 0; 720 +
726 if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) { 721 if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) {
727 angular.forEach($scope.bodyRegionCoordinates, function (value, key) { 722 angular.forEach($scope.bodyRegionCoordinates, function (value, key) {
728 - counter++;  
729 - //console.log('loop call=' + counter) 723 +
730 if (value._HaveMirrorImage == 'Y') { 724 if (value._HaveMirrorImage == 'Y') {
731 725
732 //DrawMirroredImage 726 //DrawMirroredImage
@@ -1011,7 +1005,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1011,7 +1005,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1011 $scope.one = 1; 1005 $scope.one = 1;
1012 1006
1013 $scope.userInput = parseInt($scope.layerNumber); 1007 $scope.userInput = parseInt($scope.layerNumber);
1014 -  
1015 $scope.skinTone = $rootScope.globalSetting.ethnicity; 1008 $scope.skinTone = $rootScope.globalSetting.ethnicity;
1016 1009
1017 var SelectedLayerData = []; 1010 var SelectedLayerData = [];
@@ -1019,7 +1012,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1019,7 +1012,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1019 if ((SelectedLayerData != null || SelectedLayerData != undefined)) 1012 if ((SelectedLayerData != null || SelectedLayerData != undefined))
1020 1013
1021 if ($scope.layerNumber == 0) { 1014 if ($scope.layerNumber == 0) {
1022 - //console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length); 1015 + console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length);
1023 1016
1024 if (SelectedLayerData.BodyRegion.length > 0) { 1017 if (SelectedLayerData.BodyRegion.length > 0) {
1025 for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) { 1018 for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) {
@@ -1118,11 +1111,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1118,11 +1111,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1118 1111
1119 $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { 1112 $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1120 1113
1121 - $scope.counterFlip++;  
1122 -  
1123 - //console.log('DrawMirroredImage called for bodyRegionId= ' + bodyRegionId + ' and counterFlip=: ' + $scope.counterFlip);  
1124 -  
1125 -  
1126 var FlipedImgCanvas = document.createElement('canvas'); 1114 var FlipedImgCanvas = document.createElement('canvas');
1127 FlipedImgCanvas.height = h; 1115 FlipedImgCanvas.height = h;
1128 FlipedImgCanvas.width = w; 1116 FlipedImgCanvas.width = w;
@@ -1338,31 +1326,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1338,31 +1326,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1338 var cw, ch, imgW, imgH, mouseX, mouseY; 1326 var cw, ch, imgW, imgH, mouseX, mouseY;
1339 var scaleFactor = 1.00; 1327 var scaleFactor = 1.00;
1340 1328
  1329 + //$scaler = $("#scaler");
  1330 + //$scaler.val(scaleFactor);
  1331 + //$scaler.hide();
  1332 +
1341 var img = new Image(); 1333 var img = new Image();
1342 img.onload = start; 1334 img.onload = start;
1343 1335
  1336 + // img.src = "~/../content/images/" + src;;
1344 img.src = src; 1337 img.src = src;
1345 1338
1346 - //if (isMaskImage == 'N') {  
1347 - // $scope.MCounter++;  
1348 -  
1349 -  
1350 - // $scope.ColoredImageSRC.push(  
1351 - // {  
1352 - // "bodyRegionId": bodyRegionId, "SRC": src,  
1353 - // "Height": h,  
1354 - // "Width": w,  
1355 - // "x": x,  
1356 - // "y": y,  
1357 - // "haveMirror": 'true'  
1358 - // }  
1359 - // );  
1360 - // console.log('$scope.ColoredImageSRC.length inside flipped = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= ' + $scope.layerNumber);  
1361 -  
1362 - //}  
1363 1339
1364 function start() { 1340 function start() {
1365 -  
1366 context.save(); 1341 context.save();
1367 context.translate(w, 0); 1342 context.translate(w, 0);
1368 context.scale(-1, 1); 1343 context.scale(-1, 1);
@@ -1371,9 +1346,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1371,9 +1346,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1371 1346
1372 1347
1373 if (isMaskImage == 'N') { 1348 if (isMaskImage == 'N') {
1374 - //$scope.MCounter++;  
1375 -  
1376 -  
1377 $scope.ColoredImageSRC.push( 1349 $scope.ColoredImageSRC.push(
1378 { 1350 {
1379 "bodyRegionId": bodyRegionId, "SRC": src, 1351 "bodyRegionId": bodyRegionId, "SRC": src,
@@ -1384,7 +1356,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1384,7 +1356,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1384 "haveMirror": 'true' 1356 "haveMirror": 'true'
1385 } 1357 }
1386 ); 1358 );
1387 - //console.log('$scope.ColoredImageSRC.length inside flipped = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= ' + $scope.layerNumber);  
1388 1359
1389 // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) 1360 // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length)
1390 1361
@@ -1408,23 +1379,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1408,23 +1379,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1408 } 1379 }
1409 1380
1410 if ($scope.isEligibleForHighlight == true) { 1381 if ($scope.isEligibleForHighlight == true) {
1411 -  
1412 - //set scroll position  
1413 - if ($scope.isLayerChange) {  
1414 - console.log('$scope.imageHorizontlScrollPosition = ' + $scope.imageHorizontlScrollPosition + ' and $scope.imageVerticalScrollPosition = ' + $scope.imageVerticalScrollPosition)  
1415 -  
1416 - var isiOSSafari = (navigator.userAgent.match(/iPad/i)) ? true : false;  
1417 -  
1418 - if (isiOSSafari) {  
1419 - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition);  
1420 -  
1421 - }  
1422 - else {  
1423 - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)  
1424 - }  
1425 - // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)  
1426 - $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition)  
1427 - }  
1428 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { 1382 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1429 1383
1430 $rootScope.isLoading = false; 1384 $rootScope.isLoading = false;
@@ -1471,11 +1425,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1471,11 +1425,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1471 1425
1472 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { 1426 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1473 1427
1474 - $scope.counter++;  
1475 -  
1476 - //console.log('normal image called for bodyRegionId= ' + bodyRegionId+' and counter=: ' +$scope.counter);  
1477 -  
1478 -  
1479 var imgCanvas = document.createElement('canvas'); 1428 var imgCanvas = document.createElement('canvas');
1480 1429
1481 imgCanvas.height = h; 1430 imgCanvas.height = h;
@@ -1663,7 +1612,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1663,7 +1612,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1663 1612
1664 $scope.MultiLanguageAnnationArray = []; 1613 $scope.MultiLanguageAnnationArray = [];
1665 1614
1666 - //console.log('1. annotationText: ' + annotationText); 1615 + console.log('1. annotationText: ' + annotationText);
1667 1616
1668 if ($('#dot').length > 0) { 1617 if ($('#dot').length > 0) {
1669 $('#dot').remove(); 1618 $('#dot').remove();
@@ -1710,32 +1659,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1710,32 +1659,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1710 1659
1711 img.src = src; 1660 img.src = src;
1712 1661
1713 - //if (isMaskImage == 'N') {  
1714 - // if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') {  
1715 - // //do nothing  
1716 - // }  
1717 - // else {  
1718 - // $scope.counter++;  
1719 -  
1720 -  
1721 -  
1722 - // $scope.ColoredImageSRC.push(  
1723 - // {  
1724 - // "bodyRegionId": bodyRegionId, "SRC": src,  
1725 - // "Height": h,  
1726 - // "Width": w,  
1727 - // "x": x,  
1728 - // "y": y,  
1729 - // "haveMirror": 'false'  
1730 - // }  
1731 -  
1732 - // );  
1733 - // console.log('$scope.ColoredImageSRC.length inside normal = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= ' + $scope.layerNumber);  
1734 - // }  
1735 - //}  
1736 -  
1737 function start() { 1662 function start() {
1738 - 1663 + //debugger;
1739 context.drawImage(img, 0, 0); 1664 context.drawImage(img, 0, 0);
1740 1665
1741 if (isMaskImage == 'N') { 1666 if (isMaskImage == 'N') {
@@ -1743,10 +1668,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1743,10 +1668,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1743 //do nothing 1668 //do nothing
1744 } 1669 }
1745 else { 1670 else {
1746 - $scope.counter++;  
1747 -  
1748 -  
1749 -  
1750 $scope.ColoredImageSRC.push( 1671 $scope.ColoredImageSRC.push(
1751 { 1672 {
1752 "bodyRegionId": bodyRegionId, "SRC": src, 1673 "bodyRegionId": bodyRegionId, "SRC": src,
@@ -1757,8 +1678,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1757,8 +1678,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1757 "haveMirror": 'false' 1678 "haveMirror": 'false'
1758 } 1679 }
1759 1680
1760 - );  
1761 - // console.log('$scope.ColoredImageSRC.length inside normal = ' + $scope.ColoredImageSRC.length + ', for $scope.layerNumber= ' + $scope.layerNumber); 1681 + );
1762 1682
1763 if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { 1683 if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
1764 1684
@@ -1779,23 +1699,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1779,23 +1699,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1779 } 1699 }
1780 1700
1781 if ($scope.isEligibleForHighlight == true) { 1701 if ($scope.isEligibleForHighlight == true) {
1782 -  
1783 - //set scroll position  
1784 - if ($scope.isLayerChange) {  
1785 - console.log('$scope.imageHorizontlScrollPosition = ' + $scope.imageHorizontlScrollPosition + ' and $scope.imageVerticalScrollPosition = ' + $scope.imageVerticalScrollPosition)  
1786 -  
1787 - var isiOSSafari = (navigator.userAgent.match(/iPad/i)) ? true : false;  
1788 -  
1789 - if (isiOSSafari) {  
1790 - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition);  
1791 -  
1792 - }  
1793 - else {  
1794 - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)  
1795 - }  
1796 - // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)  
1797 - $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition)  
1798 - }  
1799 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { 1702 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1800 1703
1801 $rootScope.isLoading = false; 1704 $rootScope.isLoading = false;
@@ -1815,11 +1718,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1815,11 +1718,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1815 } 1718 }
1816 } 1719 }
1817 1720
1818 - 1721 + console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
1819 } 1722 }
1820 } 1723 }
1821 1724
1822 -  
1823 if (imgCanvas.id.match('_mci')) { 1725 if (imgCanvas.id.match('_mci')) {
1824 var maskImgData = context.getImageData(0, 0, w, h); 1726 var maskImgData = context.getImageData(0, 0, w, h);
1825 $rootScope.MaskCanvasData.push( 1727 $rootScope.MaskCanvasData.push(
@@ -1840,7 +1742,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1840,7 +1742,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1840 1742
1841 1743
1842 1744
1843 -  
1844 $scope.highLightBodyBasedOnIcolor = function (RGBColor) { 1745 $scope.highLightBodyBasedOnIcolor = function (RGBColor) {
1845 1746
1846 1747
@@ -1864,14 +1765,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1864,14 +1765,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1864 1765
1865 $scope.HighlightBodyOnExtract = function () { 1766 $scope.HighlightBodyOnExtract = function () {
1866 1767
  1768 +
1867 var multiTermList = []; 1769 var multiTermList = [];
1868 var CallBackBodyRegion = []; 1770 var CallBackBodyRegion = [];
1869 1771
1870 - if ($rootScope.isListManagerSelected) {  
1871 - multiTermList = $scope.AllTerms;  
1872 - }  
1873 -  
1874 - else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { 1772 + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
1875 angular.forEach($rootScope.previousHighlightList, function (value, key) { 1773 angular.forEach($rootScope.previousHighlightList, function (value, key) {
1876 1774
1877 var ActualTermNo = $scope.getActualTermNumber(value); 1775 var ActualTermNo = $scope.getActualTermNumber(value);
@@ -1975,7 +1873,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1975,7 +1873,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1975 //} 1873 //}
1976 1874
1977 worker.onmessage = function (e) { 1875 worker.onmessage = function (e) {
1978 - //console.log('callback in extract for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); 1876 + console.log('callback in extract for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
1979 1877
1980 1878
1981 var updatedData = e.data.value; 1879 var updatedData = e.data.value;
@@ -2070,7 +1968,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2070,7 +1968,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2070 // $rootScope.updatedGrayDataList = []; 1968 // $rootScope.updatedGrayDataList = [];
2071 //} 1969 //}
2072 1970
2073 - //console.log('HighlightBodyByTermList is called'); 1971 + console.log('HighlightBodyByTermList is called');
2074 1972
2075 // $scope.highlightedBR = null; 1973 // $scope.highlightedBR = null;
2076 $scope.highlightedBR = []; 1974 $scope.highlightedBR = [];
@@ -2191,7 +2089,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2191,7 +2089,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2191 $scope.runningWorkers.push({ 'workerName': worker }) 2089 $scope.runningWorkers.push({ 'workerName': worker })
2192 2090
2193 // console.log('for bodyRegionId = ' + bodyRegionId+ ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")) 2091 // console.log('for bodyRegionId = ' + bodyRegionId+ ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"))
2194 - //console.log('before worker call BRID: ' + bodyRegionId) 2092 + console.log('before worker call BRID: ' + bodyRegionId)
2195 2093
2196 if (grayImageDataVar != null && coloredImageDataVar != null && maskData != null) { 2094 if (grayImageDataVar != null && coloredImageDataVar != null && maskData != null) {
2197 worker.postMessage({ 2095 worker.postMessage({
@@ -2209,7 +2107,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2209,7 +2107,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2209 2107
2210 2108
2211 worker.onmessage = function (e) { 2109 worker.onmessage = function (e) {
2212 - //console.log('callback for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1")); 2110 + console.log('callback for e.data.bodyRegionId: ' + e.data.bodyRegionId + ', time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
2213 2111
2214 var updatedData = e.data.value; 2112 var updatedData = e.data.value;
2215 2113
@@ -2249,7 +2147,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2249,7 +2147,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2249 2147
2250 //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId }); 2148 //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
2251 2149
2252 - //console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length) 2150 + console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
2253 2151
2254 if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) { 2152 if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) {
2255 2153
@@ -2314,7 +2212,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2314,7 +2212,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2314 2212
2315 }); 2213 });
2316 2214
2317 - //console.log('createTermListByPreviousTermsAndHighlight is called'); 2215 + console.log('createTermListByPreviousTermsAndHighlight is called');
2318 2216
2319 if ((multiTermList != undefined || multiTermList != null) && multiTermList.length > 0) { 2217 if ((multiTermList != undefined || multiTermList != null) && multiTermList.length > 0) {
2320 2218
@@ -2426,24 +2324,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2426,24 +2324,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2426 //layer change function 2324 //layer change function
2427 $scope.LayerChange = function () { 2325 $scope.LayerChange = function () {
2428 2326
2429 - //get current scroll postion to set it after layer change  
2430 - var canvasDiv = document.getElementById('canvasDiv');  
2431 - $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;  
2432 - $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft;  
2433 - console.log('LAYERCHANGE $scope.imageHorizontlScrollPosition = ' + $scope.imageHorizontlScrollPosition + ' and $scope.imageVerticalScrollPosition = ' + $scope.imageVerticalScrollPosition)  
2434 -  
2435 -  
2436 -  
2437 -  
2438 - $scope.counter = 0;  
2439 - $scope.counterFlip = 0;  
2440 -  
2441 - console.log('$scope.ColoredImageSRC.length OUTSIDE= ' + $scope.ColoredImageSRC.length)  
2442 -  
2443 -  
2444 - //if listanager is visisble then close it  
2445 - $rootScope.isListManagerSelected = false;  
2446 - $rootScope.CloseListManager(); 2327 +
  2328 + //if listanager is visisble then close it
  2329 + $rootScope.isListManagerSelected = false;
  2330 +
  2331 + $rootScope.CloseListManager();
2447 2332
2448 2333
2449 2334
@@ -2454,6 +2339,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2454,6 +2339,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2454 //1. 2339 //1.
2455 $scope.terminateCurrentlyRunningWPs(); 2340 $scope.terminateCurrentlyRunningWPs();
2456 2341
  2342 + var canvasDiv = document.getElementById('canvasDiv');
  2343 + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
  2344 + $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft;
2457 2345
2458 // debugger; 2346 // debugger;
2459 // $('#daLoaderLabel').css('visibility', 'visible'); 2347 // $('#daLoaderLabel').css('visibility', 'visible');
@@ -2517,7 +2405,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2517,7 +2405,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2517 // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom) 2405 // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom)
2518 if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { 2406 if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
2519 //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value); 2407 //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
2520 - 2408 + // debugger;
2521 $scope.layerNumber = parseInt(txtlayerNumber.value); 2409 $scope.layerNumber = parseInt(txtlayerNumber.value);
2522 2410
2523 2411
@@ -2529,14 +2417,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2529,14 +2417,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2529 } 2417 }
2530 2418
2531 else { 2419 else {
2532 -  
2533 -  
2534 //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box. 2420 //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box.
2535 var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; 2421 var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
2536 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) { 2422 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
2537 $('#txtlayerNumber').val(dataLength - 1); 2423 $('#txtlayerNumber').val(dataLength - 1);
2538 $scope.currentLayerNumber = parseInt(dataLength - 1); 2424 $scope.currentLayerNumber = parseInt(dataLength - 1);
2539 -  
2540 $scope.layerNumber = parseInt(dataLength - 1); 2425 $scope.layerNumber = parseInt(dataLength - 1);
2541 } 2426 }
2542 else 2427 else
@@ -2550,18 +2435,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2550,18 +2435,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2550 canDiv.innerHTML = ''; 2435 canDiv.innerHTML = '';
2551 } 2436 }
2552 2437
2553 - $scope.flushCanvas();  
2554 //2. 2438 //2.
2555 - //existing data  
2556 - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) && $scope.ColoredImageSRC.length > 0) {  
2557 - $scope.ColoredImageSRC.length = 0;  
2558 - // $scope.ColoredImageSRC = undefined;  
2559 - $scope.ColoredImageSRC = [];  
2560 -  
2561 - }  
2562 -  
2563 - //console.log('layer changed is called');  
2564 -  
2565 $scope.CalculateImageCordinates($rootScope.viewOrientationId); 2439 $scope.CalculateImageCordinates($rootScope.viewOrientationId);
2566 2440
2567 //3. 2441 //3.
@@ -2585,7 +2459,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2585,7 +2459,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2585 $('#btnHighLight').removeClass('btn btn-black'); 2459 $('#btnHighLight').removeClass('btn btn-black');
2586 $('#btnHighLight').addClass('btn-primary'); 2460 $('#btnHighLight').addClass('btn-primary');
2587 2461
2588 - // console.log('highLightBody call from DisableProgressBar') 2462 + console.log('highLightBody call from DisableProgressBar')
2589 // $scope.highLightBody(); 2463 // $scope.highLightBody();
2590 2464
2591 2465
@@ -2633,7 +2507,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2633,7 +2507,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2633 //2. 2507 //2.
2634 if (event.ctrlKey) { 2508 if (event.ctrlKey) {
2635 2509
2636 - // console.log('ctrl pressed'); 2510 + console.log('ctrl pressed');
2637 2511
2638 $scope.multiAnnotationIsON = true; 2512 $scope.multiAnnotationIsON = true;
2639 2513
@@ -2646,11 +2520,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2646,11 +2520,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2646 2520
2647 var isClickedOnSamePoint = $("#canvasDiv").find("div[id=" + pointClicked + "]").length; 2521 var isClickedOnSamePoint = $("#canvasDiv").find("div[id=" + pointClicked + "]").length;
2648 2522
2649 - // console.log('isClickedOnSamePoint: ' + isClickedOnSamePoint); 2523 + console.log('isClickedOnSamePoint: ' + isClickedOnSamePoint);
2650 2524
2651 // if user has not clciked on smae point then create speech bubble otherwise not 2525 // if user has not clciked on smae point then create speech bubble otherwise not
2652 if (isClickedOnSamePoint == 0) { 2526 if (isClickedOnSamePoint == 0) {
2653 - // console.log('not clicked on same point') 2527 + console.log('not clicked on same point')
2654 $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id); 2528 $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id);
2655 2529
2656 $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id }); 2530 $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id });
@@ -2711,7 +2585,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2711,7 +2585,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2711 } 2585 }
2712 } 2586 }
2713 else { 2587 else {
2714 - // console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length) 2588 + console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length)
2715 } 2589 }
2716 if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { 2590 if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) {
2717 if ($scope.longestAnnotation.length <= 10) { 2591 if ($scope.longestAnnotation.length <= 10) {
@@ -3396,8 +3270,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3396,8 +3270,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3396 3270
3397 3271
3398 //if listanager is visisble then close it 3272 //if listanager is visisble then close it
3399 - $rootScope.isListManagerSelected = false;  
3400 - $rootScope.CloseListManager(); 3273 +
  3274 + $rootScope.isListManagerSelected = false;
  3275 + $rootScope.CloseListManager();
3401 3276
3402 3277
3403 $scope.isTransparencyActivated = true; 3278 $scope.isTransparencyActivated = true;
@@ -3803,7 +3678,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3803,7 +3678,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3803 //do nothing 3678 //do nothing
3804 } 3679 }
3805 else if (isLayerChanged) { 3680 else if (isLayerChanged) {
3806 - 3681 + // debugger
3807 $scope.layerNumber = parseInt($('#txtlayerNumber').val()); 3682 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
3808 3683
3809 } 3684 }
@@ -3811,7 +3686,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3811,7 +3686,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3811 var currentLayer = parseInt($('#txtlayerNumber').val()); 3686 var currentLayer = parseInt($('#txtlayerNumber').val());
3812 3687
3813 var tranparencyLayer = currentLayer + 1; 3688 var tranparencyLayer = currentLayer + 1;
3814 -  
3815 $scope.layerNumber = tranparencyLayer; 3689 $scope.layerNumber = tranparencyLayer;
3816 } 3690 }
3817 3691
@@ -4535,7 +4409,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4535,7 +4409,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4535 4409
4536 //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']")) 4410 //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']"))
4537 //.remove(); 4411 //.remove();
4538 -  
4539 $scope.layerNumber = $scope.currentLayerNumber; 4412 $scope.layerNumber = $scope.currentLayerNumber;
4540 $scope.transNumber = 50; 4413 $scope.transNumber = 50;
4541 $(".slider").slider({ value: 50 }) 4414 $(".slider").slider({ value: 50 })
@@ -4599,11 +4472,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4599,11 +4472,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4599 4472
4600 $scope.OnIdentityClick = function () { 4473 $scope.OnIdentityClick = function () {
4601 4474
4602 - // $('#btnIdentity').addClass('btn-primary'); 4475 +
4603 //if listanager is visisble then close it 4476 //if listanager is visisble then close it
  4477 +
4604 $rootScope.isListManagerSelected = false; 4478 $rootScope.isListManagerSelected = false;
4605 $rootScope.CloseListManager(); 4479 $rootScope.CloseListManager();
4606 - 4480 + // $('#btnIdentity').addClass('btn-primary');
4607 4481
4608 if ($scope.isTransparencyActivated == true) { 4482 if ($scope.isTransparencyActivated == true) {
4609 4483
@@ -4623,11 +4497,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4623,11 +4497,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4623 4497
4624 $scope.enableZoom = function () { 4498 $scope.enableZoom = function () {
4625 4499
  4500 +
4626 //if listanager is visisble then close it 4501 //if listanager is visisble then close it
  4502 +
4627 $rootScope.isListManagerSelected = false; 4503 $rootScope.isListManagerSelected = false;
4628 $rootScope.CloseListManager(); 4504 $rootScope.CloseListManager();
4629 4505
4630 - //remove speech bubble  
4631 $('#sppeachBubble').css('display', 'none'); 4506 $('#sppeachBubble').css('display', 'none');
4632 4507
4633 $("#dot").css("display", "none"); 4508 $("#dot").css("display", "none");
@@ -4642,6 +4517,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4642,6 +4517,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4642 4517
4643 $rootScope.isZoomed = true; 4518 $rootScope.isZoomed = true;
4644 //1. 4519 //1.
  4520 +
4645 $scope.flushCanvas(); 4521 $scope.flushCanvas();
4646 4522
4647 if ($scope.zoomInOut == 25) { 4523 if ($scope.zoomInOut == 25) {
@@ -4680,73 +4556,30 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4680,73 +4556,30 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4680 4556
4681 $scope.flushCanvas = function () { 4557 $scope.flushCanvas = function () {
4682 4558
4683 - if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {  
4684 - angular.forEach($scope.ColoredImageSRC, function (value, key) { 4559 + //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
  4560 + // angular.forEach($scope.ColoredImageSRC, function (value, key) {
4685 4561
4686 - var id;  
4687 - var maskId;  
4688 - if (value.haveMirror == 'true') {  
4689 - id = 'imageCanvas' + value.bodyRegionId + '_MR';  
4690 - maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'  
4691 - }  
4692 - else {  
4693 - id = 'imageCanvas' + value.bodyRegionId;  
4694 - maskId = 'imageCanvas' + value.bodyRegionId + '_mci';  
4695 - }  
4696 -  
4697 - var canvas = document.getElementById(id);  
4698 - if (canvas != null || canvas != undefined) {  
4699 - document.getElementById('canvasDiv').removeChild(canvas);  
4700 - }  
4701 -  
4702 - var maskcanvas = document.getElementById(maskId);  
4703 - if (maskcanvas != null || maskcanvas != undefined) {  
4704 - document.getElementById('canvasDiv').removeChild(maskcanvas);  
4705 -  
4706 - }  
4707 - if (i == 4 || i == 5 || i == 6) {  
4708 - id = 'imageCanvas' + i + '_MR';  
4709 - maskId = 'imageCanvas' + i + '_MR_mci';  
4710 -  
4711 - var canvas = document.getElementById(id);  
4712 - if (canvas != null || canvas != undefined)  
4713 - document.getElementById('canvasDiv').removeChild(canvas);  
4714 -  
4715 - var maskcanvas = document.getElementById(maskId);  
4716 - if (maskcanvas != null || maskcanvas != undefined)  
4717 - document.getElementById('canvasDiv').removeChild(maskcanvas);  
4718 - }  
4719 -  
4720 - var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");  
4721 - for (var i = 0; i < modestyCanvases.length; i++) {  
4722 - modestyCanvases[i].remove();  
4723 - }  
4724 - });  
4725 - //remove modesty canavs  
4726 - var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");  
4727 - if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {  
4728 - for (var j = 0; j < modestyCanvases.length; j++) {  
4729 - modestyCanvases[j].remove();  
4730 - }  
4731 - }  
4732 - }  
4733 -  
4734 - //for (var i = 1; i < 7; i++) {  
4735 -  
4736 - // var id;  
4737 - // var maskId;  
4738 -  
4739 - // id = 'imageCanvas' + i;  
4740 - // maskId = 'imageCanvas' + i + '_mci'; 4562 + // var id;
  4563 + // var maskId;
  4564 + // if (value.haveMirror == 'true') {
  4565 + // id = 'imageCanvas' + value.bodyRegionId + '_MR';
  4566 + // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
  4567 + // }
  4568 + // else {
  4569 + // id = 'imageCanvas' + value.bodyRegionId;
  4570 + // maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
  4571 + // }
4741 4572
4742 - // var canvas = document.getElementById(id);  
4743 - // if (canvas != null || canvas != undefined)  
4744 - // document.getElementById('canvasDiv').removeChild(canvas); 4573 + // var canvas = document.getElementById(id);
  4574 + // if (canvas != null || canvas != undefined) {
  4575 + // document.getElementById('canvasDiv').removeChild(canvas);
  4576 + // }
4745 4577
4746 - // var maskcanvas = document.getElementById(maskId);  
4747 - // if (maskcanvas != null || maskcanvas != undefined)  
4748 - // document.getElementById('canvasDiv').removeChild(maskcanvas); 4578 + // var maskcanvas = document.getElementById(maskId);
  4579 + // if (maskcanvas != null || maskcanvas != undefined) {
  4580 + // document.getElementById('canvasDiv').removeChild(maskcanvas);
4749 4581
  4582 + // }
4750 // if (i == 4 || i == 5 || i == 6) { 4583 // if (i == 4 || i == 5 || i == 6) {
4751 // id = 'imageCanvas' + i + '_MR'; 4584 // id = 'imageCanvas' + i + '_MR';
4752 // maskId = 'imageCanvas' + i + '_MR_mci'; 4585 // maskId = 'imageCanvas' + i + '_MR_mci';
@@ -4760,6 +4593,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4760,6 +4593,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4760 // document.getElementById('canvasDiv').removeChild(maskcanvas); 4593 // document.getElementById('canvasDiv').removeChild(maskcanvas);
4761 // } 4594 // }
4762 4595
  4596 + // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
  4597 + // for (var i = 0; i < modestyCanvases.length; i++) {
  4598 + // modestyCanvases[i].remove();
  4599 + // }
  4600 + // });
4763 // //remove modesty canavs 4601 // //remove modesty canavs
4764 // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); 4602 // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
4765 // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) { 4603 // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
@@ -4768,6 +4606,44 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4768,6 +4606,44 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4768 // } 4606 // }
4769 // } 4607 // }
4770 //} 4608 //}
  4609 +
  4610 + for (var i = 1; i < 7; i++) {
  4611 +
  4612 + var id;
  4613 + var maskId;
  4614 +
  4615 + id = 'imageCanvas' + i;
  4616 + maskId = 'imageCanvas' + i + '_mci';
  4617 +
  4618 + var canvas = document.getElementById(id);
  4619 + if (canvas != null || canvas != undefined)
  4620 + document.getElementById('canvasDiv').removeChild(canvas);
  4621 +
  4622 + var maskcanvas = document.getElementById(maskId);
  4623 + if (maskcanvas != null || maskcanvas != undefined)
  4624 + document.getElementById('canvasDiv').removeChild(maskcanvas);
  4625 +
  4626 + if (i == 4 || i == 5 || i == 6) {
  4627 + id = 'imageCanvas' + i + '_MR';
  4628 + maskId = 'imageCanvas' + i + '_MR_mci';
  4629 +
  4630 + var canvas = document.getElementById(id);
  4631 + if (canvas != null || canvas != undefined)
  4632 + document.getElementById('canvasDiv').removeChild(canvas);
  4633 +
  4634 + var maskcanvas = document.getElementById(maskId);
  4635 + if (maskcanvas != null || maskcanvas != undefined)
  4636 + document.getElementById('canvasDiv').removeChild(maskcanvas);
  4637 + }
  4638 +
  4639 + //remove modesty canavs
  4640 + var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
  4641 + if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
  4642 + for (var j = 0; j < modestyCanvases.length; j++) {
  4643 + modestyCanvases[j].remove();
  4644 + }
  4645 + }
  4646 + }
4771 } 4647 }
4772 4648
4773 $scope.terminateCurrentlyRunningWPs = function () { 4649 $scope.terminateCurrentlyRunningWPs = function () {
@@ -4787,11 +4663,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4787,11 +4663,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4787 4663
4788 $scope.enableHighlight = function () { 4664 $scope.enableHighlight = function () {
4789 4665
  4666 + console.log('enableHighlight is called')
  4667 +
  4668 +
4790 //if listanager is visisble then close it 4669 //if listanager is visisble then close it
4791 - // $rootScope.isListManagerSelected = false;  
4792 - $rootScope.CloseListManager();  
4793 4670
4794 - // console.log('enableHighlight is called') 4671 + // $rootScope.isListManagerSelected = false;
  4672 + $rootScope.CloseListManager();
4795 4673
4796 if ($rootScope.isHighLight == true) { 4674 if ($rootScope.isHighLight == true) {
4797 4675
@@ -4814,7 +4692,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4814,7 +4692,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4814 4692
4815 } 4693 }
4816 else { 4694 else {
4817 - // console.log('highLightBody from enableHighlight') 4695 + console.log('highLightBody from enableHighlight')
4818 $timeout(function () { $scope.highLightBody() }, 50); 4696 $timeout(function () { $scope.highLightBody() }, 50);
4819 } 4697 }
4820 4698
@@ -4829,8 +4707,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4829,8 +4707,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4829 4707
4830 $scope.enableNormalMode = function () { 4708 $scope.enableNormalMode = function () {
4831 4709
  4710 +
4832 //if listanager is visisble then close it 4711 //if listanager is visisble then close it
4833 - // $rootScope.isListManagerSelected = false; 4712 +
  4713 + // $rootScope.isListManagerSelected = false;
4834 $rootScope.CloseListManager(); 4714 $rootScope.CloseListManager();
4835 4715
4836 if ($rootScope.isNormalMode == true) { 4716 if ($rootScope.isNormalMode == true) {
@@ -4866,10 +4746,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4866,10 +4746,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4866 4746
4867 $scope.enableExtract = function () { 4747 $scope.enableExtract = function () {
4868 4748
  4749 +
  4750 +
4869 //if listanager is visisble then close it 4751 //if listanager is visisble then close it
4870 - // $rootScope.isListManagerSelected = false;  
4871 - $rootScope.CloseListManager();  
4872 4752
  4753 + // $rootScope.isListManagerSelected = false;
  4754 + $rootScope.CloseListManager();
4873 //1. 4755 //1.
4874 $rootScope.isLoading = true; 4756 $rootScope.isLoading = true;
4875 $('#spinner').css('visibility', 'visible'); 4757 $('#spinner').css('visibility', 'visible');
@@ -4896,7 +4778,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4896,7 +4778,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4896 } 4778 }
4897 4779
4898 //4. 4780 //4.
4899 - //console.log('highLightBody from enableExtract') 4781 + console.log('highLightBody from enableExtract')
4900 $scope.highLightBody(); 4782 $scope.highLightBody();
4901 4783
4902 4784
@@ -4910,11 +4792,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4910,11 +4792,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4910 4792
4911 $scope.enableShowHideStructureBox = function () { 4793 $scope.enableShowHideStructureBox = function () {
4912 4794
  4795 +
4913 //if listanager is visisble then close it 4796 //if listanager is visisble then close it
  4797 +
4914 $rootScope.isListManagerSelected = false; 4798 $rootScope.isListManagerSelected = false;
4915 $rootScope.CloseListManager(); 4799 $rootScope.CloseListManager();
4916 4800
4917 -  
4918 $(".com").toggle(); 4801 $(".com").toggle();
4919 $('#dot').toggle(); 4802 $('#dot').toggle();
4920 $('#sppeachBubble').toggle() 4803 $('#sppeachBubble').toggle()
@@ -4924,7 +4807,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4924,7 +4807,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4924 4807
4925 $scope.highLightBody = function () { 4808 $scope.highLightBody = function () {
4926 4809
4927 - // console.log('highLightBody is called and ColoredImageSRC length: ' + $scope.ColoredImageSRC.length); 4810 + console.log('highLightBody is called and ColoredImageSRC length: ' + $scope.ColoredImageSRC.length);
4928 4811
4929 $scope.terminateCurrentlyRunningWPs(); 4812 $scope.terminateCurrentlyRunningWPs();
4930 4813
@@ -4954,7 +4837,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4954,7 +4837,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4954 $scope.grayedBR = []; 4837 $scope.grayedBR = [];
4955 4838
4956 angular.forEach($scope.ColoredImageSRC, function (value, key) { 4839 angular.forEach($scope.ColoredImageSRC, function (value, key) {
4957 - //console.log('$scope.ColoredImageSRC length before gray= ' + $scope.ColoredImageSRC.length) 4840 + console.log('$scope.ColoredImageSRC length before gray= ' + $scope.ColoredImageSRC.length)
4958 var id; 4841 var id;
4959 if (value.haveMirror == 'true') { 4842 if (value.haveMirror == 'true') {
4960 id = 'imageCanvas' + value.bodyRegionId + '_MR'; 4843 id = 'imageCanvas' + value.bodyRegionId + '_MR';
@@ -4994,8 +4877,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4994,8 +4877,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4994 img.src = dataURL; 4877 img.src = dataURL;
4995 4878
4996 img.onload = function () { 4879 img.onload = function () {
4997 - // console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= '  
4998 - //+ value.bodyRegionId) 4880 + console.log('Before BitmapData call, width: ' + Math.max(img.width) + ', height: ' + Math.max(img.height) + ' value.bodyRegionId= '
  4881 + + value.bodyRegionId)
4999 4882
5000 var DAData = new BitmapData(Math.max(img.width), Math.max(img.height)); 4883 var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
5001 DAData.draw(img); 4884 DAData.draw(img);
@@ -5123,10 +5006,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5123,10 +5006,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5123 5006
5124 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); 5007 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5125 } 5008 }
5126 - else if ($rootScope.isListManagerSelected == true) {  
5127 - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);  
5128 -  
5129 - }  
5130 } 5009 }
5131 //else { 5010 //else {
5132 // // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode 5011 // // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode
@@ -5183,6 +5062,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5183,6 +5062,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5183 5062
5184 else { 5063 else {
5185 // This code will execute when user will select normal Mode but this time isHighlight will be false 5064 // This code will execute when user will select normal Mode but this time isHighlight will be false
  5065 +
5186 angular.forEach($scope.ColoredImageSRC, function (value, key) { 5066 angular.forEach($scope.ColoredImageSRC, function (value, key) {
5187 var id; 5067 var id;
5188 if (value.haveMirror == 'true') { 5068 if (value.haveMirror == 'true') {
@@ -5277,9 +5157,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5277,9 +5157,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5277 5157
5278 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); 5158 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5279 5159
5280 - }  
5281 - else if ($rootScope.isListManagerSelected == true) {  
5282 - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); 5160 + // to do
5283 5161
5284 } 5162 }
5285 } 5163 }
@@ -5362,9 +5240,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5362,9 +5240,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5362 $scope.OnGenderChange = function (event) { 5240 $scope.OnGenderChange = function (event) {
5363 5241
5364 //if listanager is visisble then close it 5242 //if listanager is visisble then close it
5365 - $rootScope.isListManagerSelected = false;  
5366 - $rootScope.CloseListManager();  
5367 - 5243 +
  5244 + $rootScope.isListManagerSelected = false;
  5245 + $rootScope.CloseListManager();
5368 5246
5369 $rootScope.isLoading = true; 5247 $rootScope.isLoading = true;
5370 $('#spinner').css('visibility', 'visible'); 5248 $('#spinner').css('visibility', 'visible');
@@ -5456,7 +5334,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5456,7 +5334,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5456 5334
5457 5335
5458 5336
5459 - // console.log('terminate worker process') 5337 + console.log('terminate worker process')
5460 //terminate previous running workers to create space for new workers 5338 //terminate previous running workers to create space for new workers
5461 $scope.terminateCurrentlyRunningWPs(); 5339 $scope.terminateCurrentlyRunningWPs();
5462 5340
@@ -5523,11 +5401,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5523,11 +5401,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5523 5401
5524 $scope.OnViewChange = function (event) { 5402 $scope.OnViewChange = function (event) {
5525 5403
5526 -  
5527 //if listanager is visisble then close it 5404 //if listanager is visisble then close it
  5405 +
5528 $rootScope.isListManagerSelected = false; 5406 $rootScope.isListManagerSelected = false;
5529 $rootScope.CloseListManager(); 5407 $rootScope.CloseListManager();
5530 5408
  5409 +
5531 $rootScope.isLoading = true; 5410 $rootScope.isLoading = true;
5532 $('#spinner').css('visibility', 'visible'); 5411 $('#spinner').css('visibility', 'visible');
5533 5412
@@ -5537,7 +5416,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5537,7 +5416,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5537 } 5416 }
5538 5417
5539 $rootScope.isViewChange = true; 5418 $rootScope.isViewChange = true;
5540 -  
5541 $scope.layerNumber = 0; 5419 $scope.layerNumber = 0;
5542 // debugger; 5420 // debugger;
5543 var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; 5421 var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
@@ -5673,7 +5551,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5673,7 +5551,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5673 5551
5674 //Reload DA controller event listener after setting change 5552 //Reload DA controller event listener after setting change
5675 $scope.$on('reloadDAControllerEvent', function (event, data) { 5553 $scope.$on('reloadDAControllerEvent', function (event, data) {
5676 - //console.log('reloadDAControllerEvent'); 5554 + console.log('reloadDAControllerEvent');
5677 5555
5678 $scope.loadDissectibleAnatomyData(); 5556 $scope.loadDissectibleAnatomyData();
5679 5557
@@ -5682,7 +5560,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5682,7 +5560,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5682 //Reload DA controller Body View after setting Change 5560 //Reload DA controller Body View after setting Change
5683 $scope.$on('reloadDABodyViewEvent', function (event, data) { 5561 $scope.$on('reloadDABodyViewEvent', function (event, data) {
5684 //console.log('reloadDABodyViewEvent'); 5562 //console.log('reloadDABodyViewEvent');
5685 -  
5686 $scope.layerNumber = parseInt($('#txtlayerNumber').val()); 5563 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
5687 //$scope.ReloadBodyViewId = data.reloadDABodyViewId; 5564 //$scope.ReloadBodyViewId = data.reloadDABodyViewId;
5688 // $scope.layerNumber = 0; 5565 // $scope.layerNumber = 0;
@@ -6632,13 +6509,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6632,13 +6509,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6632 6509
6633 $scope.HighlightBodysystem = function (event) { 6510 $scope.HighlightBodysystem = function (event) {
6634 6511
6635 -  
6636 -  
6637 //if listanager is visisble then close it 6512 //if listanager is visisble then close it
  6513 +
6638 $rootScope.isListManagerSelected = false; 6514 $rootScope.isListManagerSelected = false;
6639 $rootScope.CloseListManager(); 6515 $rootScope.CloseListManager();
6640 6516
6641 6517
  6518 + //NIKITA
6642 $scope.isHighlightBodysystem = true; 6519 $scope.isHighlightBodysystem = true;
6643 $scope.systemMatchedTermList = new jinqJs() 6520 $scope.systemMatchedTermList = new jinqJs()
6644 .from($rootScope.BodySystemData.BodySystem.BodySystemTerm) 6521 .from($rootScope.BodySystemData.BodySystem.BodySystemTerm)
@@ -6648,7 +6525,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6648,7 +6525,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6648 if ($rootScope.isHighLight == false) { 6525 if ($rootScope.isHighLight == false) {
6649 //color the body gray 6526 //color the body gray
6650 $rootScope.isHighLight = true 6527 $rootScope.isHighLight = true
6651 - //console.log('highLightBody from HighlightBodysystem') 6528 + console.log('highLightBody from HighlightBodysystem')
6652 $scope.highLightBody(); 6529 $scope.highLightBody();
6653 } 6530 }
6654 //now highlight the selected body system in whole body 6531 //now highlight the selected body system in whole body
@@ -6657,7 +6534,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6657,7 +6534,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6657 //$rootScope.isLoading = true; 6534 //$rootScope.isLoading = true;
6658 $('#spinner').css('visibility', 'visible'); 6535 $('#spinner').css('visibility', 'visible');
6659 6536
  6537 + //NIKITA
  6538 + // $scope.isHighlightBodysystem = true;
6660 6539
  6540 + //if (systemMatchedTermList != null || systemMatchedTermList != undefined) {
  6541 +
  6542 + // $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);
  6543 + //}
6661 6544
6662 6545
6663 var viewtarget_highlightbody = angular.element(event.currentTarget); 6546 var viewtarget_highlightbody = angular.element(event.currentTarget);
@@ -6851,7 +6734,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6851,7 +6734,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6851 6734
6852 $scope.ShowSearch = function () { 6735 $scope.ShowSearch = function () {
6853 6736
6854 - // console.log('ShowSearch is called'); 6737 + console.log('ShowSearch is called');
6855 6738
6856 $timeout(function () { 6739 $timeout(function () {
6857 $scope.IsSearchVisible = true; 6740 $scope.IsSearchVisible = true;
@@ -7089,7 +6972,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7089,7 +6972,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7089 layerNumber = parseInt(layerNumber) - 1; 6972 layerNumber = parseInt(layerNumber) - 1;
7090 } 6973 }
7091 6974
7092 -  
7093 $scope.layerNumber = layerNumber; 6975 $scope.layerNumber = layerNumber;
7094 6976
7095 //4.get scroll position 6977 //4.get scroll position
@@ -7221,7 +7103,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7221,7 +7103,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7221 } 7103 }
7222 7104
7223 $scope.aligneCanvasWithTerm = function () { 7105 $scope.aligneCanvasWithTerm = function () {
7224 - // console.log('aligneCanvasWithTerm') 7106 + console.log('aligneCanvasWithTerm')
7225 var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); 7107 var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA));
7226 var newY = parseInt($scope.scaleValue($scope.termCoordinate.y, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); 7108 var newY = parseInt($scope.scaleValue($scope.termCoordinate.y, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA));
7227 7109
@@ -7244,7 +7126,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7244,7 +7126,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7244 7126
7245 7127
7246 7128
7247 - // console.log('newX =' + newX + ',newY= ' + newY) 7129 + console.log('newX =' + newX + ',newY= ' + newY)
7248 $('#canvasDiv').scrollLeft(newX); 7130 $('#canvasDiv').scrollLeft(newX);
7249 $('#canvasDiv').scrollTop(newY); 7131 $('#canvasDiv').scrollTop(newY);
7250 7132