Commit ef72daa80dab8d3ef5006741408e9aacf08fde56

Authored by unknown
2 parents 254b8ac9 7d2b7051

Merge branch 'Develop' of http://52.6.196.163/ADAM/AIAHTML5 into ReplicatedCodeForAnnotation

Conflicts:
	400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -84,7 +84,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
84 84 $rootScope.updatedWhiteImageMRDataList = [];
85 85  
86 86 //normal mode
87   - $rootScope.isNormalMode = false;
  87 + $rootScope.isNormalMode = true;
88 88 $rootScope.isZoomed = false;
89 89  
90 90 //navigator man functionality
... ... @@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
165 165 //get the DA body view list based on selected gender
166 166 $scope.getDAViewList = function ($event) {
167 167  
168   -
  168 +
169 169 if ($('#MainImage') != null) {
170 170 $('#MainImage').remove();
171 171 }
... ... @@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
244 244 }
245 245  
246 246 $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
247   -
  247 +
248 248  
249 249 var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >'
250 250 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >'
... ... @@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
265 265  
266 266  
267 267 $scope.openView = function ($event) {
268   -
  268 +
269 269 $rootScope.isLoading = true;
270 270 $('#spinner').css('visibility', 'visible');
271 271  
... ... @@ -682,7 +682,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
682 682  
683 683  
684 684 $scope.LoadDefaultLayerImage = function () {
685   -
  685 +
686 686 $rootScope.isNormalMode = true;
687 687  
688 688 $scope.layerNumber = 0;
... ... @@ -954,7 +954,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
954 954 //set scrollbars on canvas and hide loading label
955 955 $('#daLoaderLabel').css('visibility', 'hidden')
956 956  
957   -
  957 +
958 958 $('#canvasDiv').css('overflow', 'scroll')
959 959 if (isiOSSafari) {
960 960 $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150)
... ... @@ -963,7 +963,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
963 963 else {
964 964 $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
965 965 }
966   -
  966 +
967 967  
968 968 // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
969 969 $('#canvasDiv').scrollTop(50)
... ... @@ -1005,7 +1005,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1005 1005 };
1006 1006 }
1007 1007  
1008   -
  1008 +
1009 1009  
1010 1010 $('#draggable').css('width', dragdivw);
1011 1011 $('#draggable').css('height', dragdivh)
... ... @@ -1068,7 +1068,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1068 1068  
1069 1069  
1070 1070 $scope.GetImageSource = function (bodyRegionId) {
1071   -
  1071 +
1072 1072 var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
1073 1073  
1074 1074 //set max for LayerNumber input
... ... @@ -1086,7 +1086,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1086 1086  
1087 1087 $scope.userInput = parseInt($scope.layerNumber);
1088 1088  
1089   -
  1089 +
1090 1090 $scope.skinTone = $rootScope.globalSetting.ethnicity;
1091 1091  
1092 1092 var SelectedLayerData = [];
... ... @@ -1148,7 +1148,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1148 1148 }
1149 1149  
1150 1150 $scope.GetBackgroundImgSource = function (bodyRegionId) {
1151   -
  1151 +
1152 1152  
1153 1153 var selectedGender;
1154 1154 if (localStorage.getItem("genderId") == "Male") {
... ... @@ -1166,7 +1166,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1166 1166 if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) {
1167 1167  
1168 1168 //filter bodyRegion data basd on skintone
1169   - $scope.skinTone = $rootScope.globalSetting.ethnicity
  1169 + $scope.skinTone = $rootScope.globalSetting.ethnicity
1170 1170 $scope.bagartDetailsOnSktn = new jinqJs()
1171 1171 .from($scope.bagartBodyRegionDetails)
1172 1172 .where('_Skintone == ' + $scope.skinTone)
... ... @@ -1306,6 +1306,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1306 1306 }
1307 1307 var RGBColor = (Red + Green + Blue);
1308 1308  
  1309 + $rootScope.previousHighlightList.push(RGBColor);
  1310 +
  1311 +
1309 1312 if ($rootScope.isHighLight) {
1310 1313  
1311 1314 if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
... ... @@ -1343,15 +1346,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1343 1346 }
1344 1347 }
1345 1348  
1346   - $rootScope.previousHighlightList.push(RGBColor);
  1349 + // $rootScope.previousHighlightList.push(RGBColor);
1347 1350  
1348 1351 $scope.highLightBodyBasedOnIcolor(RGBColor);
1349 1352 }
1350 1353  
1351   - if ($rootScope.isNormalMode == true) {
  1354 + //if ($rootScope.isNormalMode == true) {
  1355 +
1352 1356  
  1357 + // $rootScope.previousHighlightList.push(RGBColor);
  1358 + //}
1353 1359  
1354   - $rootScope.previousHighlightList.push(RGBColor);
  1360 + //extarct clicked body part is extarct button is already enabled.
  1361 + debugger;
  1362 + if ($rootScope.isExtract == true) {
  1363 + $scope.enableExtract(false);
1355 1364 }
1356 1365  
1357 1366 var annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
... ... @@ -1433,18 +1442,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1433 1442  
1434 1443 if (isMaskImage == 'N') {
1435 1444  
1436   -
1437   - $scope.ColoredImageSRC.push(
1438   - {
1439   - "bodyRegionId": bodyRegionId, "SRC": src,
1440   - "Height": h,
1441   - "Width": w,
1442   - "x": x,
1443   - "y": y,
1444   - "haveMirror": 'true'
1445   - }
1446   - );
1447   -
  1445 +
  1446 + $scope.ColoredImageSRC.push(
  1447 + {
  1448 + "bodyRegionId": bodyRegionId, "SRC": src,
  1449 + "Height": h,
  1450 + "Width": w,
  1451 + "x": x,
  1452 + "y": y,
  1453 + "haveMirror": 'true'
  1454 + }
  1455 + );
  1456 +
1448 1457  
1449 1458 // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length)
1450 1459  
... ... @@ -1467,9 +1476,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1467 1476 $scope.isEligibleForHighlight = false;
1468 1477 }
1469 1478  
1470   - if ($scope.isEligibleForHighlight == true)
1471   - {
1472   - if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
  1479 + if ($scope.isEligibleForHighlight == true) {
  1480 + if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) {
1473 1481  
1474 1482 $rootScope.isLoading = true;
1475 1483 $('#spinner').css('visibility', 'visible');
... ... @@ -1634,6 +1642,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1634 1642  
1635 1643 }
1636 1644  
  1645 + $rootScope.previousHighlightList.push(RGBColor);
1637 1646  
1638 1647 if ($rootScope.isHighLight == true) {
1639 1648 if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
... ... @@ -1672,7 +1681,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1672 1681 }
1673 1682 }
1674 1683  
1675   - $rootScope.previousHighlightList.push(RGBColor);
  1684 + // $rootScope.previousHighlightList.push(RGBColor);
1676 1685  
1677 1686  
1678 1687 if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { }
... ... @@ -1683,8 +1692,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1683 1692  
1684 1693 }
1685 1694  
1686   - if ($rootScope.isNormalMode == true) {
1687   - $rootScope.previousHighlightList.push(RGBColor);
  1695 + //if ($rootScope.isNormalMode == true) {
  1696 + // $rootScope.previousHighlightList.push(RGBColor);
  1697 + //}
  1698 +
  1699 + debugger;
  1700 + //extarct clisked body part is extarct button is already enabled.
  1701 + if ($rootScope.isExtract == true) {
  1702 + $scope.enableExtract(false);
1688 1703 }
1689 1704  
1690 1705 if ($('#speechBubbleTrns').length > 0)
... ... @@ -1748,7 +1763,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1748 1763  
1749 1764 img.src = src;
1750 1765  
1751   -
  1766 +
1752 1767  
1753 1768 function start() {
1754 1769  
... ... @@ -1761,19 +1776,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1761 1776 //do nothing
1762 1777 }
1763 1778 else {
1764   -
1765   - $scope.ColoredImageSRC.push(
1766   - {
1767   - "bodyRegionId": bodyRegionId, "SRC": src,
1768   - "Height": h,
1769   - "Width": w,
1770   - "x": x,
1771   - "y": y,
1772   - "haveMirror": 'false'
1773   - }
1774   -
1775   - );
1776   -
  1779 +
  1780 + $scope.ColoredImageSRC.push(
  1781 + {
  1782 + "bodyRegionId": bodyRegionId, "SRC": src,
  1783 + "Height": h,
  1784 + "Width": w,
  1785 + "x": x,
  1786 + "y": y,
  1787 + "haveMirror": 'false'
  1788 + }
  1789 +
  1790 + );
  1791 +
1777 1792  
1778 1793 if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
1779 1794  
... ... @@ -1793,15 +1808,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1793 1808 $scope.isEligibleForHighlight = false;
1794 1809 }
1795 1810  
1796   - if ($scope.isEligibleForHighlight == true)
1797   - {
1798   -
1799   - if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
  1811 + if ($scope.isEligibleForHighlight == true) {
  1812 +
  1813 + if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) {
1800 1814  
1801 1815  
1802 1816 $rootScope.isLoading = true;
1803 1817 $('#spinner').css('visibility', 'visible');
1804   -
  1818 +
1805 1819 console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length)
1806 1820 $rootScope.isHighLight = true;
1807 1821  
... ... @@ -1810,7 +1824,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1810 1824 $scope.highLightBody();
1811 1825  
1812 1826 console.log('just after highLightBody call');
1813   -
  1827 +
1814 1828 }
1815 1829 }
1816 1830 }
... ... @@ -1861,16 +1875,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1861 1875  
1862 1876  
1863 1877 $scope.HighlightBodyOnExtract = function () {
  1878 + console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
1864 1879  
1865   -
1866 1880 var multiTermList = [];
1867 1881 var CallBackBodyRegion = [];
1868 1882  
1869 1883 if ($rootScope.isListManagerSelected) {
1870   -
  1884 +
1871 1885 multiTermList = $scope.AllTerms;
1872   -
1873   - }
  1886 +
  1887 + }
1874 1888 else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
1875 1889 angular.forEach($rootScope.previousHighlightList, function (value, key) {
1876 1890  
... ... @@ -2275,13 +2289,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2275 2289  
2276 2290 if ($scope.doAligneCanvasWithTerm == true) {
2277 2291  
2278   - if ( $rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)
  2292 + if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)
2279 2293  
2280 2294 $rootScope.isLoading = false;
2281 2295  
2282   - $('#spinner').css('visibility', 'hidden');
  2296 + $('#spinner').css('visibility', 'hidden');
2283 2297  
2284   - //$rootScope.isHighlightBodyByBodySystem = false;
  2298 + // $rootScope.isHighlightBodyByBodySystem = false;
2285 2299  
2286 2300 if ($rootScope.isListManagerSelected == true)
2287 2301 $scope.aligneCanvasWithTerm();
... ... @@ -2428,10 +2442,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2428 2442 //layer change function
2429 2443 $scope.LayerChange = function () {
2430 2444  
2431   -
  2445 +
2432 2446 //if listanager is visisble then close it
2433   - // $rootScope.isListManagerSelected = false;
2434   -
  2447 + // $rootScope.isListManagerSelected = false;
  2448 +
2435 2449 $rootScope.CloseListManager();
2436 2450  
2437 2451  
... ... @@ -2520,7 +2534,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2520 2534  
2521 2535 else {
2522 2536  
2523   -
  2537 +
2524 2538 //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box.
2525 2539 var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
2526 2540 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
... ... @@ -2553,11 +2567,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2553 2567 $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition)
2554 2568  
2555 2569  
2556   - if ( $rootScope.isHighlightBodyByBodySystem) {
  2570 + if ($rootScope.isHighlightBodyByBodySystem) {
2557 2571 $timeout(function () { $scope.DisableProgressBar() }, 20000);
2558 2572 }
2559   - else
2560   - {
  2573 + else {
2561 2574 $timeout(function () { $scope.DisableProgressBar() }, 2000);
2562 2575 }
2563 2576 }
... ... @@ -2565,9 +2578,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2565 2578 $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
2566 2579 }
2567 2580  
2568   - $scope.LayerChangeOnMouseUpDown = function (e)
2569   - {
2570   -
  2581 + $scope.LayerChangeOnMouseUpDown = function (e) {
  2582 +
2571 2583 $scope.LayerChange();
2572 2584  
2573 2585 }
... ... @@ -2605,6 +2617,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2605 2617 }
2606 2618  
2607 2619 console.log('highLightBody call from DisableProgressBar')
  2620 +
2608 2621 // $scope.highLightBody();
2609 2622  
2610 2623  
... ... @@ -3435,7 +3448,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3435 3448  
3436 3449 $scope.isTransparencyActivated = true;
3437 3450  
3438   - //do not create TBOX if in extarct mode otherwise create
  3451 + //do not create TBOX if in extarct mode otherwise create
3439 3452 if ($rootScope.isExtract == false) {
3440 3453  
3441 3454 $("#btnExtract").addClass("disabled");
... ... @@ -3445,7 +3458,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3445 3458 $rootScope.CloseListManager();
3446 3459  
3447 3460  
3448   -
  3461 +
3449 3462 // alert('transparencyClicked' + $scope.isTransparencyActivated)
3450 3463 $('#btnTranparency').addClass('tButtonActive');
3451 3464 $('#btnIdentity').removeClass(' btn-primary');
... ... @@ -3694,7 +3707,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3694 3707  
3695 3708 $('#btnTranparency').addClass('tButtonActive');
3696 3709 //debugger;
3697   - // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1);
  3710 + // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1);
3698 3711 //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
3699 3712 $('#btnTranparency').removeClass('tButtonActive');
3700 3713 $('#btnTranparency').addClass('btn-black');
... ... @@ -3857,8 +3870,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3857 3870 //do nothing
3858 3871 }
3859 3872 else if (isLayerChanged) {
3860   -
3861   - // alert('isMousUp on isLayerChanged');
  3873 +
  3874 + // alert('isMousUp on isLayerChanged');
3862 3875  
3863 3876 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
3864 3877  
... ... @@ -3871,23 +3884,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3871 3884  
3872 3885 var tranparencyLayer;
3873 3886 var currentLayer = parseInt($('#txtlayerNumber').val());
3874   - if (currentLayer == $rootScope.totalLayers) {
3875   -
3876   - tranparencyLayer = currentLayer;
3877   -
3878   - }
3879   -
3880   - else
3881   - {
3882   -
  3887 + if (currentLayer == $rootScope.totalLayers) {
  3888 +
  3889 + tranparencyLayer = currentLayer;
  3890 +
  3891 + }
  3892 +
  3893 + else {
  3894 +
3883 3895 tranparencyLayer = currentLayer + 1;
3884   -
3885   - }
3886   -
3887   - $scope.layerNumber = tranparencyLayer;
  3896 +
  3897 + }
  3898 +
  3899 + $scope.layerNumber = tranparencyLayer;
3888 3900  
3889 3901 }
3890   -
  3902 +
3891 3903 $('#txtlayerNumber').val($scope.layerNumber);
3892 3904  
3893 3905 //dedebugger;
... ... @@ -4679,7 +4691,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4679 4691  
4680 4692  
4681 4693 //if listanager is visisble then close it
4682   -
  4694 +
4683 4695 $rootScope.isListManagerSelected = false;
4684 4696 $rootScope.CloseListManager();
4685 4697 // $('#btnIdentity').addClass('btn-primary');
... ... @@ -4727,7 +4739,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4727 4739  
4728 4740 $rootScope.isZoomed = true;
4729 4741 //1.
4730   -
  4742 +
4731 4743 $scope.flushCanvas();
4732 4744  
4733 4745 if ($scope.zoomInOut == 25) {
... ... @@ -4766,48 +4778,102 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4766 4778  
4767 4779 $scope.flushCanvas = function () {
4768 4780  
4769   - if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
4770   - angular.forEach($scope.ColoredImageSRC, function (value, key) {
  4781 + //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
  4782 + // angular.forEach($scope.ColoredImageSRC, function (value, key) {
4771 4783  
4772   - var id;
4773   - var maskId;
4774   - if (value.haveMirror == 'true') {
4775   - id = 'imageCanvas' + value.bodyRegionId + '_MR';
4776   - maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
4777   - }
4778   - else {
4779   - id = 'imageCanvas' + value.bodyRegionId;
4780   - maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
4781   - }
  4784 + // var id;
  4785 + // var maskId;
  4786 + // if (value.haveMirror == 'true') {
  4787 + // id = 'imageCanvas' + value.bodyRegionId + '_MR';
  4788 + // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
  4789 + // }
  4790 + // else {
  4791 + // id = 'imageCanvas' + value.bodyRegionId;
  4792 + // maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
  4793 + // }
4782 4794  
4783   - var canvas = document.getElementById(id);
4784   - if (canvas != null || canvas != undefined) {
4785   - document.getElementById('canvasDiv').removeChild(canvas);
4786   - }
  4795 + // var canvas = document.getElementById(id);
  4796 + // if (canvas != null || canvas != undefined) {
  4797 + // document.getElementById('canvasDiv').removeChild(canvas);
  4798 + // }
4787 4799  
4788   - var maskcanvas = document.getElementById(maskId);
4789   - if (maskcanvas != null || maskcanvas != undefined) {
4790   - document.getElementById('canvasDiv').removeChild(maskcanvas);
  4800 + // var maskcanvas = document.getElementById(maskId);
  4801 + // if (maskcanvas != null || maskcanvas != undefined) {
  4802 + // document.getElementById('canvasDiv').removeChild(maskcanvas);
4791 4803  
4792   - }
4793   - if (i == 4 || i == 5 || i == 6) {
4794   - id = 'imageCanvas' + i + '_MR';
4795   - maskId = 'imageCanvas' + i + '_MR_mci';
  4804 + // }
  4805 + // if (i == 4 || i == 5 || i == 6) {
  4806 + // id = 'imageCanvas' + i + '_MR';
  4807 + // maskId = 'imageCanvas' + i + '_MR_mci';
  4808 +
  4809 + // var canvas = document.getElementById(id);
  4810 + // if (canvas != null || canvas != undefined)
  4811 + // document.getElementById('canvasDiv').removeChild(canvas);
  4812 +
  4813 + // var maskcanvas = document.getElementById(maskId);
  4814 + // if (maskcanvas != null || maskcanvas != undefined)
  4815 + // document.getElementById('canvasDiv').removeChild(maskcanvas);
  4816 + // }
  4817 +
  4818 + // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
  4819 + // for (var i = 0; i < modestyCanvases.length; i++) {
  4820 + // modestyCanvases[i].remove();
  4821 + // }
  4822 + // });
  4823 + // //remove modesty canavs
  4824 + // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
  4825 + // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
  4826 + // for (var j = 0; j < modestyCanvases.length; j++) {
  4827 + // modestyCanvases[j].remove();
  4828 + // }
  4829 + // }
  4830 + //}
  4831 + var loopLength = 0;
  4832 + if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
  4833 + loopLength = 7;
  4834 + }
  4835 + else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')){
  4836 + loopLength = 5;
  4837 + }
  4838 + else if (($rootScope.viewOrientationId == '5')) {
  4839 + loopLength = 4;
  4840 + }
  4841 + else if (($rootScope.viewOrientationId == '6')) {
  4842 + loopLength = 1;
  4843 + }
4796 4844  
4797   - var canvas = document.getElementById(id);
4798   - if (canvas != null || canvas != undefined)
4799   - document.getElementById('canvasDiv').removeChild(canvas);
  4845 + for (var i = 1; i < loopLength; i++) {
4800 4846  
4801   - var maskcanvas = document.getElementById(maskId);
4802   - if (maskcanvas != null || maskcanvas != undefined)
4803   - document.getElementById('canvasDiv').removeChild(maskcanvas);
4804   - }
  4847 + var id;
  4848 + var maskId;
  4849 +
  4850 + id = 'imageCanvas' + i;
  4851 + maskId = 'imageCanvas' + i + '_mci';
  4852 +
  4853 + var canvas = document.getElementById(id);
  4854 + if (canvas != null || canvas != undefined)
  4855 + document.getElementById('canvasDiv').removeChild(canvas);
4805 4856  
4806   - var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
4807   - for (var i = 0; i < modestyCanvases.length; i++) {
4808   - modestyCanvases[i].remove();
  4857 + var maskcanvas = document.getElementById(maskId);
  4858 + if (maskcanvas != null || maskcanvas != undefined)
  4859 + document.getElementById('canvasDiv').removeChild(maskcanvas);
  4860 +
  4861 + if (loopLength == 7) {
  4862 +
  4863 + if (i == 4 || i == 5 || i == 6) {
  4864 + id = 'imageCanvas' + i + '_MR';
  4865 + maskId = 'imageCanvas' + i + '_MR_mci';
  4866 +
  4867 + var canvas = document.getElementById(id);
  4868 + if (canvas != null || canvas != undefined)
  4869 + document.getElementById('canvasDiv').removeChild(canvas);
  4870 +
  4871 + var maskcanvas = document.getElementById(maskId);
  4872 + if (maskcanvas != null || maskcanvas != undefined)
  4873 + document.getElementById('canvasDiv').removeChild(maskcanvas);
4809 4874 }
4810   - });
  4875 + }
  4876 +
4811 4877 //remove modesty canavs
4812 4878 var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
4813 4879 if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
... ... @@ -4817,7 +4883,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4817 4883 }
4818 4884 }
4819 4885  
4820   -
  4886 +
4821 4887 }
4822 4888  
4823 4889 $scope.terminateCurrentlyRunningWPs = function () {
... ... @@ -4837,11 +4903,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4837 4903  
4838 4904 $scope.enableHighlight = function () {
4839 4905  
4840   -
  4906 +
4841 4907 // $("#btnExtract").removeClass("disabled");
4842   - $("#btnTranparency").removeClass("disabled");
4843   - // $rootScope.isTransparencyBoxActivated = false;
4844   - // $rootScope.isNormalMode = false;
  4908 + $("#btnTranparency").removeClass("disabled");
  4909 + // $rootScope.isTransparencyBoxActivated = false;
  4910 + // $rootScope.isNormalMode = false;
4845 4911  
4846 4912 //if listanager is visisble then close it
4847 4913  
... ... @@ -4909,12 +4975,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4909 4975 $rootScope.isNormalMode = false;
4910 4976 console.log('enableNormalMode is called');
4911 4977  
4912   -
  4978 +
4913 4979 // $rootScope.isHighLight = false;
4914 4980  
4915 4981 //to do should not call every time
4916 4982 $rootScope.CloseListManager();
4917   -
  4983 +
4918 4984  
4919 4985 $rootScope.isHighlightBodyByBodySystem = false;
4920 4986  
... ... @@ -4947,7 +5013,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4947 5013  
4948 5014 $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
4949 5015 $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
4950   -
  5016 +
4951 5017  
4952 5018 }
4953 5019  
... ... @@ -4974,7 +5040,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4974 5040 }
4975 5041 }
4976 5042  
4977   - $scope.enableExtract = function () {
  5043 + $scope.enableExtract = function (isCalledFromButton) {
  5044 +
  5045 + console.log('isCalledFromButton= ' + isCalledFromButton);
4978 5046  
4979 5047 $rootScope.isHighlightBodyByBodySystem = false;
4980 5048  
... ... @@ -4982,7 +5050,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4982 5050 $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
4983 5051  
4984 5052 $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft();
4985   -
  5053 +
4986 5054  
4987 5055  
4988 5056 if ($scope.isTransparencyActivated == true) {
... ... @@ -4994,42 +5062,70 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4994 5062  
4995 5063 else {
4996 5064  
4997   -
  5065 +
4998 5066 $rootScope.CloseListManager();
4999 5067 //1.
5000   - $rootScope.isLoading = true;
5001   - $('#spinner').css('visibility', 'visible');
  5068 + //$rootScope.isLoading = true;
  5069 + //$('#spinner').css('visibility', 'visible');
5002 5070  
5003 5071 //2.
5004 5072 $scope.terminateCurrentlyRunningWPs();
5005 5073  
5006   - //3.
5007   - if ($rootScope.isExtract == true) {
  5074 + //3.
  5075 + //if extarct is alraedy enabled and user cliked on any body part then extract that.
  5076 + if (isCalledFromButton == false) {
  5077 +
  5078 + $rootScope.isExtract = true;
  5079 + //disable transparency button
  5080 +
  5081 + $("#btnTranparency").addClass("disabled");
5008 5082  
5009   - }
5010   - else {
5011   - $rootScope.isExtract = true;
5012   - //disable transparency button
5013   -
5014   - $("#btnTranparency").addClass("disabled");
5015 5083  
  5084 + if ($rootScope.isNormalMode == true) {
5016 5085  
5017   - if ($rootScope.isNormalMode == true) {
  5086 + $rootScope.isHighLight = false;
  5087 + $rootScope.isNormalMode = false;
  5088 + }
  5089 + else {
  5090 +
  5091 + $rootScope.isHighLight = false;
  5092 + }
  5093 +
  5094 + //4.
  5095 + console.log('highLightBody from enableExtract')
  5096 + $scope.highLightBody();
5018 5097  
5019   - $rootScope.isHighLight = false;
5020   - $rootScope.isNormalMode = false;
5021 5098 }
5022 5099 else {
5023   - $rootScope.isNormalMode = false;
5024   - $rootScope.isHighLight = false;
5025   - }
5026 5100  
5027   - //4.
5028   - console.log('highLightBody from enableExtract')
5029   - $scope.highLightBody();
  5101 + if ($rootScope.isExtract == true) {
5030 5102  
  5103 + }
  5104 + else {
  5105 + $rootScope.isExtract = true;
  5106 + //disable transparency button
  5107 +
  5108 + $("#btnTranparency").addClass("disabled");
  5109 +
  5110 +
  5111 + if ($rootScope.isNormalMode == true) {
  5112 +
  5113 + $rootScope.isHighLight = false;
  5114 + $rootScope.isNormalMode = false;
  5115 + }
  5116 + else {
  5117 +
  5118 + $rootScope.isHighLight = false;
  5119 + }
  5120 +
  5121 + //4.
  5122 + console.log('highLightBody from enableExtract')
  5123 + $scope.highLightBody();
5031 5124  
5032   - }
  5125 +
  5126 + }
  5127 + }
  5128 +
5033 5129  
5034 5130 //5. unhighlight other
5035 5131 //$scope.Normal = "";
... ... @@ -5075,9 +5171,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5075 5171  
5076 5172 $scope.highLightBody = function () {
5077 5173  
5078   - $rootScope.isLoading = true;
5079   - $('#spinner').css('visibility', 'visible');
5080   -
5081 5174  
5082 5175 $scope.Normal = "";
5083 5176 $scope.Extract = "";
... ... @@ -5162,194 +5255,160 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5162 5255 var colorMode;
5163 5256  
5164 5257 if ($scope.isExtract == true) {
5165   - colorMode = $scope.applyWhiteMatrix(img, context_gray);
  5258 +
  5259 + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) {
  5260 +
  5261 + colorMode = $scope.applyWhiteMatrix(img, context_gray);
  5262 + }
5166 5263 }
5167 5264 else {
5168 5265 colorMode = $scope.applyGrayMatrix(img, context_gray);
5169 5266 }
5170 5267  
5171   - var zeroPoint = new Point();
  5268 + console.log('colorMode inside if = ' + colorMode);
5172 5269  
5173   - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
5174 5270  
  5271 + if (colorMode != undefined || colorMode != null) {
5175 5272  
5176   - context_gray.putImageData(DAData.data, 0, 0)
  5273 + $rootScope.isLoading = true;
  5274 + $('#spinner').css('visibility', 'visible');
5177 5275  
5178   - //NIKI- to resolve lateral arm black issue in highlight mode
5179 5276  
5180   - if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) {
  5277 + var zeroPoint = new Point();
5181 5278  
5182   - var imgData = context_gray.getImageData(0, 0, width, ht);
5183   - var data = imgData.data;
5184   - var c = 0;
5185   - for (var i = 0; i < data.length; i += 4) {
5186   - if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
5187   - data[i + 3] = 0;
5188   - }
  5279 + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
5189 5280  
5190   - }
5191   - context_gray.putImageData(imgData, 0, 0);
5192   - }
5193 5281  
5194   - //push BRID into array
5195   - $scope.grayedBR.push({ 'BRID': value.bodyRegionId });
  5282 + context_gray.putImageData(DAData.data, 0, 0)
5196 5283  
5197   - var grayImageData = context_gray.getImageData(0, 0, width, ht);
5198   - var grayImageImageDataVar = grayImageData.data;
  5284 + //NIKI- to resolve lateral arm black issue in highlight mode
5199 5285  
5200   - if ($scope.isExtract == true) {
5201   - if (value.haveMirror == 'true') {
5202   - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
5203   - }
5204   - else {
  5286 + if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) {
5205 5287  
5206   - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
5207   - }
5208   - }
5209   - else {
  5288 + var imgData = context_gray.getImageData(0, 0, width, ht);
  5289 + var data = imgData.data;
  5290 + var c = 0;
  5291 + for (var i = 0; i < data.length; i += 4) {
  5292 + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
  5293 + data[i + 3] = 0;
  5294 + }
5210 5295  
5211   - if (value.haveMirror == 'true') {
5212   - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  5296 + }
  5297 + context_gray.putImageData(imgData, 0, 0);
5213 5298 }
5214   - else {
5215 5299  
5216   - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
5217   - }
5218   - }
  5300 + //push BRID into array
  5301 + $scope.grayedBR.push({ 'BRID': value.bodyRegionId });
5219 5302  
  5303 + var grayImageData = context_gray.getImageData(0, 0, width, ht);
  5304 + var grayImageImageDataVar = grayImageData.data;
5220 5305  
5221   - if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
5222   - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
5223   - $scope.isEligibleForHighlightBodyByTermList = true;
5224   - $scope.doHighlightOrExtract = false;
5225   - }
5226   - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
5227   - $scope.isEligibleForHighlightBodyByTermList = true;
5228   - $scope.doHighlightOrExtract = false;
5229   - }
5230   - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
5231   - $scope.isEligibleForHighlightBodyByTermList = true;
5232   - $scope.doHighlightOrExtract = false;
5233   - }
5234   - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
5235   - $scope.isEligibleForHighlightBodyByTermList = true;
5236   - $scope.doHighlightOrExtract = false;
  5306 + if ($scope.isExtract == true) {
  5307 + if (value.haveMirror == 'true') {
  5308 + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  5309 + }
  5310 + else {
  5311 +
  5312 + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  5313 + }
5237 5314 }
5238 5315 else {
5239 5316  
5240   - $scope.isEligibleForHighlightBodyByTermList = false;
  5317 + if (value.haveMirror == 'true') {
  5318 + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  5319 + }
  5320 + else {
  5321 +
  5322 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  5323 + }
5241 5324 }
5242 5325  
5243   - if ($scope.isEligibleForHighlightBodyByTermList == true) {
5244   - //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE
5245   - // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) {
5246   - $scope.isLoading = false;
5247 5326  
5248   - $('#spinner').css('visibility', 'hidden');
5249   - //}
  5327 + if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
  5328 + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
  5329 + $scope.isEligibleForHighlightBodyByTermList = true;
  5330 + $scope.doHighlightOrExtract = false;
  5331 + }
  5332 + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
  5333 + $scope.isEligibleForHighlightBodyByTermList = true;
  5334 + $scope.doHighlightOrExtract = false;
  5335 + }
  5336 + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
  5337 + $scope.isEligibleForHighlightBodyByTermList = true;
  5338 + $scope.doHighlightOrExtract = false;
  5339 + }
  5340 + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
  5341 + $scope.isEligibleForHighlightBodyByTermList = true;
  5342 + $scope.doHighlightOrExtract = false;
  5343 + }
  5344 + else {
5250 5345  
5251   -
5252   - if (( $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
  5346 + $scope.isEligibleForHighlightBodyByTermList = false;
  5347 + }
5253 5348  
  5349 + if ($scope.isEligibleForHighlightBodyByTermList == true) {
  5350 + //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE
  5351 + // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) {
  5352 + $scope.isLoading = false;
5254 5353  
5255   - $scope.isLoading = true;
  5354 + $('#spinner').css('visibility', 'hidden');
  5355 + //}
5256 5356  
5257   - $('#spinner').css('visibility', 'visible');
5258   - $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
5259   - }
5260   - else if ($rootScope.isListManagerSelected == true) {
  5357 + if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
5261 5358  
5262   - // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
5263   - $timeout(function () {
5264 5359  
5265 5360 $scope.isLoading = true;
  5361 +
5266 5362 $('#spinner').css('visibility', 'visible');
  5363 + $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
  5364 + }
  5365 + else if ($rootScope.isListManagerSelected == true) {
5267 5366  
5268   - $scope.HighlightBodyByTermList($scope.AllTerms)
5269   - }, 800);
  5367 + // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
  5368 + $timeout(function () {
  5369 +
  5370 + $scope.isLoading = true;
  5371 + $('#spinner').css('visibility', 'visible');
  5372 +
  5373 + $scope.HighlightBodyByTermList($scope.AllTerms)
  5374 + }, 800);
  5375 +
  5376 + }
  5377 + else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
  5378 + $scope.createTermListByPreviousTermsAndHighlight();
  5379 + }
5270 5380  
5271   - }
5272   - else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
5273   - $scope.createTermListByPreviousTermsAndHighlight();
5274 5381 }
5275 5382  
5276 5383 }
5277 5384  
5278 5385 }
5279 5386  
5280   - }
  5387 + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
5281 5388  
5282   - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
  5389 + console.log('highlightboy. $rootScope.isExtract= '+$rootScope.isExtract+', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
  5390 + if ($rootScope.isExtract == true) {
  5391 + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
  5392 + console.log('1. $rootScope.isExtract=true and $rootScope.previousHighlightList != null')
5283 5393  
  5394 + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
  5395 + }
  5396 + else if ($rootScope.isListManagerSelected == true) {
  5397 + console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
5284 5398  
5285   - if ($rootScope.isExtract == true) {
5286   - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
5287   - console.log('1. $rootScope.isExtract=true and $rootScope.previousHighlightList != null')
  5399 + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5288 5400  
5289   - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5290   - }
5291   - else if ($rootScope.isListManagerSelected == true) {
5292   - console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
5293   -
5294   - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5295   -
  5401 + }
5296 5402 }
5297 5403 }
5298   - //else {
5299   - // // 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
5300   - // //and then highlight the previously selected body regions at the time of normal mode.
5301   - // if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
5302   - // if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
5303   - // $scope.isEligibleForHighlightBodyByTermList = true;
5304   - // }
5305   - // else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
5306   - // $scope.isEligibleForHighlightBodyByTermList = true;
5307   - // }
5308   - // else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
5309   - // $scope.isEligibleForHighlightBodyByTermList = true;
5310   - // }
5311   - // else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
5312   - // $scope.isEligibleForHighlightBodyByTermList = true;
5313   - // }
5314   -
5315   -
5316   - // }
5317   -
5318   - // //
5319   - //}
5320 5404 })
5321 5405  
5322   - //if ($scope.isEligibleForHighlightBodyByTermList == true) {
5323   - // if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
5324   -
5325   - // var multiTermList = [];
5326   - // angular.forEach($rootScope.previousHighlightList, function (value, key) {
5327   -
5328   - // //debugger;
5329   -
5330   - // var ActualTermNo = $scope.getActualTermNumber(value);
5331   - // if (ActualTermNo != null) {
5332   - // var TermList = $scope.getTermNumberList(ActualTermNo);
5333   - // if (TermList != null) {
5334   - // for (var i = 0; i < TermList.length; i++) {
5335   -
5336   - // multiTermList.push(TermList[i]);
5337   - // }
5338   - // }
5339   - // }
5340   -
5341   - // });
5342   - // console.log('HighlightBodyByTermList call with multiTermList')
5343   -
5344   - // $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80);
5345   - // }
5346   - //}
5347   -
5348 5406 }
5349 5407  
5350 5408  
5351 5409 else {
5352 5410 // This code will execute when user will select normal Mode but this time isHighlight will be false
  5411 + console.log('highlightboy ELSE. $rootScope.isExtract= ' + $rootScope.isExtract + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
5353 5412  
5354 5413 angular.forEach($scope.ColoredImageSRC, function (value, key) {
5355 5414 var id;
... ... @@ -5404,40 +5463,50 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5404 5463 var colorMode;
5405 5464  
5406 5465 if ($scope.isExtract == true) {
5407   - colorMode = $scope.applyWhiteMatrix(img, context);
  5466 + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) {
  5467 +
  5468 + colorMode = $scope.applyWhiteMatrix(img, context);
  5469 + }
5408 5470 }
5409 5471  
5410   - var zeroPoint = new Point();
  5472 + console.log('colorMode inside else = ' + colorMode);
  5473 + if (colorMode != undefined || colorMode != null) {
5411 5474  
5412   - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
  5475 + $rootScope.isLoading = true;
  5476 + $('#spinner').css('visibility', 'visible');
5413 5477  
5414   - context.putImageData(DAData.data, 0, 0)
  5478 + var zeroPoint = new Point();
5415 5479  
5416   - var grayImageData = context.getImageData(0, 0, width, ht);
5417   - var grayImageImageDataVar = grayImageData.data;
  5480 + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
5418 5481  
5419   - if ($scope.isExtract == true) {
5420   - if (value.haveMirror == 'true') {
5421   - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
5422   - }
5423   - else {
  5482 + context.putImageData(DAData.data, 0, 0)
5424 5483  
5425   - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
5426   - }
5427   - }
5428   - else {
  5484 + var grayImageData = context.getImageData(0, 0, width, ht);
  5485 + var grayImageImageDataVar = grayImageData.data;
  5486 +
  5487 + if ($scope.isExtract == true) {
  5488 + if (value.haveMirror == 'true') {
  5489 + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  5490 + }
  5491 + else {
5429 5492  
5430   - if (value.haveMirror == 'true') {
5431   - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  5493 + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  5494 + }
5432 5495 }
5433 5496 else {
5434 5497  
5435   - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  5498 + if (value.haveMirror == 'true') {
  5499 + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
  5500 + }
  5501 + else {
  5502 +
  5503 + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
  5504 + }
5436 5505 }
5437 5506 }
5438   - }
5439 5507  
5440   - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
  5508 + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
  5509 + }
5441 5510 })
5442 5511  
5443 5512 if ($rootScope.isExtract == true) {
... ... @@ -5453,7 +5522,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5453 5522 else if ($rootScope.isListManagerSelected == true) {
5454 5523 console.log('2. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
5455 5524 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5456   -
  5525 +
5457 5526 }
5458 5527 }
5459 5528  
... ... @@ -5541,12 +5610,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5541 5610 $rootScope.isTransparencyBoxActivated = false;
5542 5611 $rootScope.isNormalMode = false;
5543 5612  
  5613 + //close transparecny box
  5614 + $scope.CloseTransparencyBox();
  5615 +
5544 5616 //if listanager is visisble then close it
5545   -
5546   - // $rootScope.isListManagerSelected = false;
  5617 +
  5618 + // $rootScope.isListManagerSelected = false;
5547 5619 $rootScope.CloseListManager();
5548 5620  
5549   - $rootScope.isHighlightBodyByBodySystem = false;
  5621 + // $rootScope.isHighlightBodyByBodySystem = false;
5550 5622  
5551 5623  
5552 5624  
... ... @@ -5567,6 +5639,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5567 5639 localStorage.setItem("currentBodyViewId", currentBodyViewId);
5568 5640  
5569 5641 //3.
  5642 + $scope.layerNumber = 0;
5570 5643 $scope.loadSelectedBodyView(currentBodyViewId);
5571 5644  
5572 5645 //4.
... ... @@ -5594,6 +5667,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5594 5667 localStorage.setItem("currentBodyViewId", currentBodyViewId);
5595 5668  
5596 5669 //3.
  5670 + $scope.layerNumber = 0;
5597 5671 $scope.loadSelectedBodyView(currentBodyViewId);
5598 5672  
5599 5673 //4.
... ... @@ -5650,7 +5724,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5650 5724 //To fix issue of gray maintained in after closing jspanel after listmanager selection
5651 5725 $rootScope.isListManagerSelected = false;
5652 5726 $rootScope.isHighLight = false;
5653   - $rootScope.isNormalMode = false;
  5727 + //$rootScope.isNormalMode = false;
  5728 + $rootScope.isHighlightBodyByBodySystem = false;
5654 5729 $rootScope.CloseListManager();
5655 5730 })
5656 5731  
... ... @@ -5689,18 +5764,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5689 5764 canDiv.innerHTML = '';
5690 5765 }
5691 5766 //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender
5692   -
  5767 +
5693 5768 if (($rootScope.isListManagerSelected == true) && (($rootScope.isGenderChnage == true) || $rootScope.isViewChange == true)) {
5694   -
5695   - $scope.setLayerNumberAndHighlightByTermList();
5696   -
5697   - }
5698   -
5699   - else {
5700   -
5701   - $scope.CalculateImageCordinates($rootScope.viewOrientationId);
5702   -
5703   - }
  5769 +
  5770 + $scope.setLayerNumberAndHighlightByTermList();
  5771 +
  5772 + }
  5773 +
  5774 + else {
  5775 +
  5776 + $scope.CalculateImageCordinates($rootScope.viewOrientationId);
  5777 +
  5778 + }
5704 5779  
5705 5780 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
5706 5781 },
... ... @@ -5726,13 +5801,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5726 5801 $rootScope.isTransparencyBoxActivated = false;
5727 5802 $rootScope.isNormalMode = false;
5728 5803  
  5804 + //close transparency box
  5805 + $scope.CloseTransparencyBox();
5729 5806  
5730 5807 //if listanager is visisble then close it
5731 5808  
5732 5809 //$rootScope.isListManagerSelected = false;
5733 5810 $rootScope.CloseListManager();
5734 5811  
5735   - $rootScope.isHighlightBodyByBodySystem = false;
  5812 + // $rootScope.isHighlightBodyByBodySystem = false;
5736 5813  
5737 5814  
5738 5815 $rootScope.isLoading = true;
... ... @@ -5891,22 +5968,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5891 5968 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
5892 5969 //alert('mouseUp');
5893 5970  
5894   -
  5971 +
5895 5972 if ($scope.layerNumber == 0) {
5896 5973 $scope.loadSelectedBodyView(data.reloadDABodyViewId);
5897 5974 }
5898   - // $scope.loadSelectedBodyView(data.reloadDABodyViewId);
  5975 + // $scope.loadSelectedBodyView(data.reloadDABodyViewId);
5899 5976  
5900 5977 $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId);
5901 5978  
5902   - // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
  5979 + // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
5903 5980  
5904 5981 //$rootScope.isSettingEventAlredayDispachted = false;
5905 5982 //}
5906 5983  
5907 5984 })
5908 5985  
5909   -
  5986 +
5910 5987  
5911 5988 $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) {
5912 5989  
... ... @@ -6157,10 +6234,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6157 6234  
6158 6235 resizeFromCenter: false,
6159 6236  
6160   - dblclick: function () {
6161   - $rootScope.backOpacity();
6162   -
6163   - },
  6237 + dblclick: function () {
  6238 + $rootScope.backOpacity();
  6239 +
  6240 + },
6164 6241  
6165 6242 click: function (layer) {
6166 6243 $rootScope.canvasLayerNameCollection = [];
... ... @@ -6253,7 +6330,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6253 6330 },
6254 6331 mouseout: function (layer) {
6255 6332 $rootScope.canvasLayerNameCollection = [];
6256   -
  6333 +
6257 6334 $('#canvas').setLayer(layer.name, {
6258 6335 handle: {
6259 6336 type: 'arc',
... ... @@ -6380,7 +6457,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6380 6457 x2: $scope.x, y2: $scope.y,
6381 6458  
6382 6459 click: function (layer) {
6383   -
  6460 +
6384 6461 $rootScope.shapeTypePin = "Pin";
6385 6462 $rootScope.canvasLayerNameCollection = [];
6386 6463 var pinLine_layer = layer.name;
... ... @@ -6404,7 +6481,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6404 6481  
6405 6482 },
6406 6483 mouseout: function (layer) {
6407   -
  6484 +
6408 6485 $rootScope.canvasLayerNameCollection = [];
6409 6486 $('#canvas').setLayer(layer.name, {
6410 6487 handle: {
... ... @@ -6467,8 +6544,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6467 6544 $('.btnCursor').addClass('activebtncolor');
6468 6545 break;
6469 6546 case "TextArea":
6470   - $rootScope.IsTextAlreadySave = false;
6471   - $("#text_area").val('');
  6547 + $rootScope.IsTextAlreadySave = false;
  6548 + $("#text_area").val('');
6472 6549 // Draw text
6473 6550 $rootScope.resetTextRect = $rootScope.ObjectIndex++;
6474 6551 $rootScope.resetText = $rootScope.ObjectIndex++;
... ... @@ -6486,7 +6563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6486 6563 align: "left",
6487 6564 fontFamily: 'Verdana, sans-serif',
6488 6565 text: ''
6489   -
  6566 +
6490 6567 })
6491 6568 // Draw rect as wide as the text
6492 6569 .drawRect({
... ... @@ -6581,271 +6658,271 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6581 6658 $rootScope.modifySavedText = [];
6582 6659 $rootScope.TextRectangleArr = [];
6583 6660 $rootScope.rectDimension = [];
6584   -
  6661 +
6585 6662  
6586 6663 // will refactor this code later
6587 6664  
6588   -
  6665 +
6589 6666 $rootScope.saveText = function () {
6590 6667 // this part will work first time when save button will be clicked
6591 6668 if ($rootScope.IsTextAlreadySave == false) {
6592 6669 // getting textarea style properties
6593   - $rootScope.fontSizes = $("#text_area").css("font-size");
6594   - $rootScope.fontWeight = $("#text_area").css("font-weight");
6595   - $rootScope.fontStyle = $("#text_area").css("font-style");
6596   - $rootScope.textAlignmt = $("#text_area").css("text-align");
6597   - $rootScope.fontColor = $("#text_area").css("color");
6598   - $rootScope.fontFamily = $("#text_area").css("font-family");
6599   - $rootScope.underlineText = $("#text_area").css("text-decoration");
6600   - $rootScope.textArea = $("#text_area").val();
  6670 + $rootScope.fontSizes = $("#text_area").css("font-size");
  6671 + $rootScope.fontWeight = $("#text_area").css("font-weight");
  6672 + $rootScope.fontStyle = $("#text_area").css("font-style");
  6673 + $rootScope.textAlignmt = $("#text_area").css("text-align");
  6674 + $rootScope.fontColor = $("#text_area").css("color");
  6675 + $rootScope.fontFamily = $("#text_area").css("font-family");
  6676 + $rootScope.underlineText = $("#text_area").css("text-decoration");
  6677 + $rootScope.textArea = $("#text_area").val();
6601 6678  
6602 6679 // deleting previous text area
6603 6680  
6604   - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
6605   - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
6606   -
6607   - // Text After Saving in Rectangle
6608   - $('#canvas').drawText({
6609   - layer: true,
6610   - draggable: true,
6611   - name: 'TextArea_' + $rootScope.resetText,
6612   - groups: ['TextArea_' + $rootScope.resetText],
6613   - dragGroups: ['TextArea_' + $rootScope.resetText],
6614   - fillStyle: $rootScope.fontColor,
6615   - fontStyle: $rootScope.fontStyle,
6616   - fontSize: $rootScope.fontSizes,
6617   - fontFamily: $rootScope.fontFamily,
6618   - align: $rootScope.textAlignmt,
6619   - strokeWidth: 0,
6620   - text: $rootScope.textArea,
6621   - x: $scope.offsetX1, y: $scope.offsetY1,
6622   - maxWidth: $scope.x - $scope.offsetX1,
6623   - maxHeight: $scope.y - $scope.offsetY1,
6624   - add: function (layer) {
6625   - $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
6626   - $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });
  6681 + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
  6682 + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
  6683 +
  6684 + // Text After Saving in Rectangle
  6685 + $('#canvas').drawText({
  6686 + layer: true,
  6687 + draggable: true,
  6688 + name: 'TextArea_' + $rootScope.resetText,
  6689 + groups: ['TextArea_' + $rootScope.resetText],
  6690 + dragGroups: ['TextArea_' + $rootScope.resetText],
  6691 + fillStyle: $rootScope.fontColor,
  6692 + fontStyle: $rootScope.fontStyle,
  6693 + fontSize: $rootScope.fontSizes,
  6694 + fontFamily: $rootScope.fontFamily,
  6695 + align: $rootScope.textAlignmt,
  6696 + strokeWidth: 0,
  6697 + text: $rootScope.textArea,
  6698 + x: $scope.offsetX1, y: $scope.offsetY1,
  6699 + maxWidth: $scope.x - $scope.offsetX1,
  6700 + maxHeight: $scope.y - $scope.offsetY1,
  6701 + add: function (layer) {
  6702 + $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
  6703 + $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });
6627 6704 }
6628   - })
6629   - // Draw rectangle
6630   - .drawRect({
6631   - name: 'TextArea1_' + $rootScope.resetText,
6632   - layer: true,
6633   - draggable: true,
6634   - groups: ['TextArea_' + $rootScope.resetText],
6635   - dragGroups: ['TextArea_' + $rootScope.resetText],
6636   - opacity: $rootScope.shapestyleOpacity,
6637   - strokeStyle: $rootScope.shapestyleborderColor,
6638   - strokeWidth: $rootScope.shapestyleborderWidth,
6639   - x: $scope.offsetX1, y: $scope.offsetY1,
6640   - width: $scope.x - $scope.offsetX1,
6641   - height: $scope.y - $scope.offsetY1,
6642   - click: function (layer) {
6643   - $rootScope.shapeTypeText = "textAreaRect";
6644   -
6645   - var layerNameSplit = layer.name;
6646   - var splitedName = layerNameSplit.split("_");
6647   - var textValName = "TextArea_";
6648   - var concatinateResult = textValName.concat(splitedName[1]);
6649   - $rootScope.canvasLayerNameCollection = [];
6650   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
6651   - $('#canvas').setLayer(layer.name, {
6652   - handle: {
6653   - type: 'rectangle',
6654   - fillStyle: '#fff',
6655   - strokeStyle: '#c33',
6656   - strokeWidth: 2,
6657   - width: 5, height: 5,
6658   - cornerRadius: 3
6659   - }
6660   - }).drawLayers();
6661   - },
6662   - dblclick: function (layer) {
6663   - $rootScope.IsTextAlreadySave = true;
6664   -
6665   - var _rectLayerOnSave = layer.name;
6666   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
6667   - var TextAreaRectName = "TextArea_";
6668   - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
6669   - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
6670   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
6671   - var _rectLayerOnSaveSplitInt;
6672   - if (_rectLayerOnSaveSplit[1] >= 3)
6673   - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
6674   - else
6675   - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
6676   - var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
6677   - $("#text_area").val(b);
6678   - $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
6679   - $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
6680   - $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
6681   - $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);
6682   - $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);
6683   - $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);
6684   - $("#text_area").css("text-decoration", $rootScope.underlineText);
6685   - _rectLayerOnSaveSplitInt = ''; b = '';
6686   - $("#annotationTextModal").modal("toggle");
6687   - },
6688   - mouseout: function (layer) {
6689   - $rootScope.canvasLayerNameCollection = [];
6690   - $('#canvas').setLayer(layer.name, {
6691   - handle: {
6692   - type: 'rectangle',
6693   - fillStyle: 'pink',
6694   - strokeStyle: 'yellow',
6695   - strokeWidth: 0,
6696   - width: 0, height: 0,
6697   - cornerRadius: 0
6698   - }
6699   - }).drawLayers();
6700   - },
6701   - mouseover: function (layer) {
6702   - $('#canvas').setLayer(layer.name, {
6703   - handle: {
6704   - type: 'rectangle',
6705   - fillStyle: '#fff',
6706   - strokeStyle: '#c33',
6707   - strokeWidth: 2,
6708   - width: 5, height: 5,
6709   - cornerRadius: 3
6710   - }
6711   - }).drawLayers();
6712   -
6713   - }
6714   - });
6715   - $("#text_area").val('');
6716   - $("#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" });
6717   -
6718   - }
6719   -
6720   -// this part will work second time when save button will be clicked
6721   - else {
6722   - // getting textarea style properties
6723   - var _modifiedText = $("#text_area").val();
6724   - var _modifiedFontSize = $("#text_area").css("font-size");
6725   - var _modifiedFontWeight = $("#text_area").css("font-weight");
6726   - var _modifiedFontStyle = $("#text_area").css("font-style");
6727   - var _modifiedTextAlign = $("#text_area").css("text-align");
6728   - var _modifiedFontColor = $("#text_area").css("color");
6729   - var _modifiedFontFamily = $("#text_area").css("font-family");
6730   - var _modifiedFontDecoration = $("#text_area").css("text-decoration");
6731   -
6732   - // deleting previous textarea
6733   - $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers();
6734   - $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers();
6735   - $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
6736   - $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
6737   -
6738   - // generating new text area
6739   - $('#canvas').drawText({
6740   - layer: true,
6741   - draggable: true,
6742   - name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
6743   - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6744   - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6745   - fillStyle: _modifiedFontColor,
6746   - fontStyle: _modifiedFontStyle,
6747   - fontSize: _modifiedFontSize,
6748   - fontFamily: _modifiedFontFamily,
6749   - align: _modifiedTextAlign,
6750   - strokeWidth: 0,
6751   - text: _modifiedText,
6752   - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
6753   - maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
6754   - maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height
6755   -
6756   - })
6757   - // Draw rect as wide as the text
6758   - .drawRect({
6759   - name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
6760   - layer: true,
6761   - draggable: true,
6762   - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6763   - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6764   - opacity: $rootScope.shapestyleOpacity,
6765   - strokeStyle: $rootScope.shapestyleborderColor,
6766   - strokeWidth: $rootScope.shapestyleborderWidth,
6767   - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
6768   - width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
6769   - height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
6770   - click: function (layer) {
6771   - $rootScope.shapeTypeText = "textAreaRect";
6772   - var layerNameSplit = layer.name;
6773   - var splitedName = layerNameSplit.split("_");
6774   - var textValName = "TextAreaAfterEdit_";
  6705 + })
  6706 + // Draw rectangle
  6707 + .drawRect({
  6708 + name: 'TextArea1_' + $rootScope.resetText,
  6709 + layer: true,
  6710 + draggable: true,
  6711 + groups: ['TextArea_' + $rootScope.resetText],
  6712 + dragGroups: ['TextArea_' + $rootScope.resetText],
  6713 + opacity: $rootScope.shapestyleOpacity,
  6714 + strokeStyle: $rootScope.shapestyleborderColor,
  6715 + strokeWidth: $rootScope.shapestyleborderWidth,
  6716 + x: $scope.offsetX1, y: $scope.offsetY1,
  6717 + width: $scope.x - $scope.offsetX1,
  6718 + height: $scope.y - $scope.offsetY1,
  6719 + click: function (layer) {
  6720 + $rootScope.shapeTypeText = "textAreaRect";
  6721 +
  6722 + var layerNameSplit = layer.name;
  6723 + var splitedName = layerNameSplit.split("_");
  6724 + var textValName = "TextArea_";
6775 6725 var concatinateResult = textValName.concat(splitedName[1]);
6776 6726 $rootScope.canvasLayerNameCollection = [];
6777   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
6778   -
6779   - $('#canvas').setLayer(layer.name, {
6780   - handle: {
6781   - type: 'rectangle',
6782   - fillStyle: '#fff',
6783   - strokeStyle: '#c33',
6784   - strokeWidth: 2,
6785   - width: 5, height: 5,
6786   - cornerRadius: 3
6787   - }
6788   - }).drawLayers();
6789   -
6790   - },
6791   - dblclick: function (layer) {
6792   -
6793   - $rootScope.IsTextAlreadySave = true;
6794   - var _rectLayerOnSave = layer.name;
6795   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
6796   - var RectNameAfterEdit = "TextAreaAfterEdit_";
6797   - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
6798   - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
6799   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
6800   - $("#text_area").val(_modifiedText);
6801   - $("#text_area").css("font-size", _modifiedFontSize);
6802   - $("#text_area").css("font-weight", _modifiedFontWeight);
6803   - $("#text_area").css("font-style", _modifiedFontStyle);
6804   - $("#text_area").css("text-align", _modifiedTextAlign);
6805   - $("#text_area").css("color", _modifiedFontColor);
6806   - $("#text_area").css("font-family", _modifiedFontFamily);
6807   - $("#text_area").css("text-decoration", _modifiedFontDecoration);
6808   - $("#annotationTextModal").modal("toggle");
6809   - },
6810   - mouseout: function (layer) {
6811   - $rootScope.canvasLayerNameCollection = [];
6812   - $('#canvas').setLayer(layer.name, {
6813   - handle: {
6814   - type: 'rectangle',
6815   - fillStyle: 'pink',
6816   - strokeStyle: 'yellow',
6817   - strokeWidth: 0,
6818   - width: 0, height: 0,
6819   - cornerRadius: 0
6820   - }
6821   - }).drawLayers();
6822   - },
6823   - mouseover: function (layer) {
6824   - $('#canvas').setLayer(layer.name, {
6825   - handle: {
6826   - type: 'rectangle',
6827   - fillStyle: '#fff',
6828   - strokeStyle: '#c33',
6829   - strokeWidth: 2,
6830   - width: 5, height: 5,
6831   - cornerRadius: 3
6832   - }
6833   - }).drawLayers();
6834   -
6835   - }
6836   - });
  6727 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  6728 + $('#canvas').setLayer(layer.name, {
  6729 + handle: {
  6730 + type: 'rectangle',
  6731 + fillStyle: '#fff',
  6732 + strokeStyle: '#c33',
  6733 + strokeWidth: 2,
  6734 + width: 5, height: 5,
  6735 + cornerRadius: 3
  6736 + }
  6737 + }).drawLayers();
  6738 + },
  6739 + dblclick: function (layer) {
  6740 + $rootScope.IsTextAlreadySave = true;
  6741 +
  6742 + var _rectLayerOnSave = layer.name;
  6743 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  6744 + var TextAreaRectName = "TextArea_";
  6745 + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
  6746 + $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
  6747 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  6748 + var _rectLayerOnSaveSplitInt;
  6749 + if (_rectLayerOnSaveSplit[1] >= 3)
  6750 + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
  6751 + else
  6752 + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
  6753 + var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
  6754 + $("#text_area").val(b);
  6755 + $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
  6756 + $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
  6757 + $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
  6758 + $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);
  6759 + $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);
  6760 + $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);
  6761 + $("#text_area").css("text-decoration", $rootScope.underlineText);
  6762 + _rectLayerOnSaveSplitInt = ''; b = '';
  6763 + $("#annotationTextModal").modal("toggle");
  6764 + },
  6765 + mouseout: function (layer) {
  6766 + $rootScope.canvasLayerNameCollection = [];
  6767 + $('#canvas').setLayer(layer.name, {
  6768 + handle: {
  6769 + type: 'rectangle',
  6770 + fillStyle: 'pink',
  6771 + strokeStyle: 'yellow',
  6772 + strokeWidth: 0,
  6773 + width: 0, height: 0,
  6774 + cornerRadius: 0
  6775 + }
  6776 + }).drawLayers();
  6777 + },
  6778 + mouseover: function (layer) {
  6779 + $('#canvas').setLayer(layer.name, {
  6780 + handle: {
  6781 + type: 'rectangle',
  6782 + fillStyle: '#fff',
  6783 + strokeStyle: '#c33',
  6784 + strokeWidth: 2,
  6785 + width: 5, height: 5,
  6786 + cornerRadius: 3
  6787 + }
  6788 + }).drawLayers();
  6789 +
  6790 + }
  6791 + });
  6792 + $("#text_area").val('');
  6793 + $("#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" });
  6794 +
  6795 + }
  6796 +
  6797 + // this part will work second time when save button will be clicked
  6798 + else {
  6799 + // getting textarea style properties
  6800 + var _modifiedText = $("#text_area").val();
  6801 + var _modifiedFontSize = $("#text_area").css("font-size");
  6802 + var _modifiedFontWeight = $("#text_area").css("font-weight");
  6803 + var _modifiedFontStyle = $("#text_area").css("font-style");
  6804 + var _modifiedTextAlign = $("#text_area").css("text-align");
  6805 + var _modifiedFontColor = $("#text_area").css("color");
  6806 + var _modifiedFontFamily = $("#text_area").css("font-family");
  6807 + var _modifiedFontDecoration = $("#text_area").css("text-decoration");
  6808 +
  6809 + // deleting previous textarea
  6810 + $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers();
  6811 + $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers();
  6812 + $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
  6813 + $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
  6814 +
  6815 + // generating new text area
  6816 + $('#canvas').drawText({
  6817 + layer: true,
  6818 + draggable: true,
  6819 + name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
  6820 + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  6821 + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  6822 + fillStyle: _modifiedFontColor,
  6823 + fontStyle: _modifiedFontStyle,
  6824 + fontSize: _modifiedFontSize,
  6825 + fontFamily: _modifiedFontFamily,
  6826 + align: _modifiedTextAlign,
  6827 + strokeWidth: 0,
  6828 + text: _modifiedText,
  6829 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  6830 + maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
  6831 + maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height
  6832 +
  6833 + })
  6834 + // Draw rect as wide as the text
  6835 + .drawRect({
  6836 + name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
  6837 + layer: true,
  6838 + draggable: true,
  6839 + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  6840 + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  6841 + opacity: $rootScope.shapestyleOpacity,
  6842 + strokeStyle: $rootScope.shapestyleborderColor,
  6843 + strokeWidth: $rootScope.shapestyleborderWidth,
  6844 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  6845 + width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
  6846 + height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
  6847 + click: function (layer) {
  6848 + $rootScope.shapeTypeText = "textAreaRect";
  6849 + var layerNameSplit = layer.name;
  6850 + var splitedName = layerNameSplit.split("_");
  6851 + var textValName = "TextAreaAfterEdit_";
  6852 + var concatinateResult = textValName.concat(splitedName[1]);
  6853 + $rootScope.canvasLayerNameCollection = [];
  6854 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  6855 +
  6856 + $('#canvas').setLayer(layer.name, {
  6857 + handle: {
  6858 + type: 'rectangle',
  6859 + fillStyle: '#fff',
  6860 + strokeStyle: '#c33',
  6861 + strokeWidth: 2,
  6862 + width: 5, height: 5,
  6863 + cornerRadius: 3
  6864 + }
  6865 + }).drawLayers();
  6866 +
  6867 + },
  6868 + dblclick: function (layer) {
  6869 +
  6870 + $rootScope.IsTextAlreadySave = true;
  6871 + var _rectLayerOnSave = layer.name;
  6872 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  6873 + var RectNameAfterEdit = "TextAreaAfterEdit_";
  6874 + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
  6875 + $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
  6876 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  6877 + $("#text_area").val(_modifiedText);
  6878 + $("#text_area").css("font-size", _modifiedFontSize);
  6879 + $("#text_area").css("font-weight", _modifiedFontWeight);
  6880 + $("#text_area").css("font-style", _modifiedFontStyle);
  6881 + $("#text_area").css("text-align", _modifiedTextAlign);
  6882 + $("#text_area").css("color", _modifiedFontColor);
  6883 + $("#text_area").css("font-family", _modifiedFontFamily);
  6884 + $("#text_area").css("text-decoration", _modifiedFontDecoration);
  6885 + $("#annotationTextModal").modal("toggle");
  6886 + },
  6887 + mouseout: function (layer) {
  6888 + $rootScope.canvasLayerNameCollection = [];
  6889 + $('#canvas').setLayer(layer.name, {
  6890 + handle: {
  6891 + type: 'rectangle',
  6892 + fillStyle: 'pink',
  6893 + strokeStyle: 'yellow',
  6894 + strokeWidth: 0,
  6895 + width: 0, height: 0,
  6896 + cornerRadius: 0
  6897 + }
  6898 + }).drawLayers();
  6899 + },
  6900 + mouseover: function (layer) {
  6901 + $('#canvas').setLayer(layer.name, {
  6902 + handle: {
  6903 + type: 'rectangle',
  6904 + fillStyle: '#fff',
  6905 + strokeStyle: '#c33',
  6906 + strokeWidth: 2,
  6907 + width: 5, height: 5,
  6908 + cornerRadius: 3
  6909 + }
  6910 + }).drawLayers();
  6911 +
  6912 + }
  6913 + });
6837 6914 $rootScope.modifySavedText = [];
6838 6915  
6839   - }
  6916 + }
6840 6917 }
6841   -
  6918 +
6842 6919 // deleting text area on close button
6843 6920 $rootScope.closeModal = function () {
6844 6921  
6845   - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
6846   - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
6847   -
6848   - }
  6922 + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
  6923 + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
  6924 +
  6925 + }
6849 6926  
6850 6927  
6851 6928 function OnPaintCanvasMouseMove(event) {
... ... @@ -6854,7 +6931,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6854 6931 }
6855 6932  
6856 6933 $rootScope.FreeStylePaint = function (e) {
6857   -
  6934 +
6858 6935  
6859 6936 }
6860 6937 $scope.OnPaintBrushCanvasMouseDown = function (event) {
... ... @@ -6862,22 +6939,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6862 6939  
6863 6940 case "FreeStylePaint":
6864 6941  
6865   -
6866 6942  
6867   - // $('#canvasPaint').sketch();
6868   - // $('#canvasPaint').sketch({ defaultSize: 1 });
6869   - // if ($("#amount-2").val() == '') {
6870   - // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6871   - // $('#canvasPaint').sketch();
6872   - // }
6873   - // else {
6874 6943  
6875   - // // var a = $("#amount-2").val();
6876   - //// $scope.shapesize = parseInt(a);
6877   - // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });
6878   - // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
  6944 + // $('#canvasPaint').sketch();
  6945 + // $('#canvasPaint').sketch({ defaultSize: 1 });
  6946 + // if ($("#amount-2").val() == '') {
  6947 + // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
  6948 + // $('#canvasPaint').sketch();
  6949 + // }
  6950 + // else {
  6951 +
  6952 + // // var a = $("#amount-2").val();
  6953 + //// $scope.shapesize = parseInt(a);
  6954 + // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });
  6955 + // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6879 6956  
6880   - // }
  6957 + // }
6881 6958  
6882 6959  
6883 6960 break;
... ... @@ -6895,7 +6972,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6895 6972  
6896 6973 // case "FreeStylePaint":
6897 6974  
6898   -
  6975 +
6899 6976 // if ($("#amount-2").val() == '')
6900 6977 // {
6901 6978 // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
... ... @@ -6923,7 +7000,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6923 7000  
6924 7001 // predefined function for detecting keyboard key
6925 7002 if (event.which == 46) {
6926   -
  7003 +
6927 7004 if ($rootScope.shapeTypePin == "Pin") {
6928 7005  
6929 7006  
... ... @@ -7003,7 +7080,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7003 7080 console.log('highLightBody from HighlightBodyByBodySystem')
7004 7081 $scope.highLightBody();
7005 7082 }
7006   -
  7083 + else {
  7084 + //This else is when user seraced anything then change the view and clicked on highlight options
  7085 + //in this case body is already highlihted(gray) so no need to
  7086 + if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
  7087 + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
  7088 + $scope.isAlreadyHighlighted = true;
  7089 + }
  7090 + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
  7091 + $scope.isAlreadyHighlighted = true;
  7092 + }
  7093 + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
  7094 + $scope.isAlreadyHighlighted = true;
  7095 + }
  7096 + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
  7097 + $scope.isAlreadyHighlighted = true;
  7098 + }
  7099 + if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) {
  7100 +
  7101 + $scope.isLoading = true;
  7102 +
  7103 + $('#spinner').css('visibility', 'visible');
  7104 + $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
  7105 + }
  7106 + }
  7107 + }
7007 7108  
7008 7109  
7009 7110 //$rootScope.isLoading = true;
... ... @@ -7307,7 +7408,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7307 7408 $("#canvasDiv").scrollTop(scrolly);
7308 7409 $("#canvasDiv").scrollLeft(scrollx);
7309 7410  
7310   - if (( $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
  7411 + if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
7311 7412 $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);
7312 7413 }
7313 7414  
... ... @@ -7315,7 +7416,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7315 7416  
7316 7417 //list manager
7317 7418 $scope.$on('listManagerEvent', function (event, data) {
7318   -
  7419 +
7319 7420 $('#spinner').css('visibility', 'visible');
7320 7421 console.log('listManagerEvent');
7321 7422  
... ... @@ -7410,7 +7511,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7410 7511 for (var j = 0; j < $scope.VocabTermTxt.length; j++) {
7411 7512 var $el = $('<option ng-click=HighlightBodyOnListManagerSelection($event) id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList')
7412 7513 $compile($el)($scope);
7413   -
  7514 +
7414 7515 $rootScope.isLoading = false;
7415 7516 $('#spinner').css('visibility', 'hidden');
7416 7517 }
... ... @@ -7420,7 +7521,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7420 7521  
7421 7522  
7422 7523 }
7423   - }
  7524 + }
7424 7525  
7425 7526  
7426 7527 $scope.HighlightBodyOnListManagerSelection = function (event) {
... ... @@ -7529,24 +7630,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7529 7630 }
7530 7631 }
7531 7632 }
7532   - $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
7533   - $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
  7633 + $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
  7634 + $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
7534 7635  
7535   - //8.remove current layer canavses
7536   - $scope.flushCanvas();
  7636 + //8.remove current layer canavses
  7637 + $scope.flushCanvas();
7537 7638  
7538 7639  
7539 7640  
7540   - //9.
7541   - $timeout(function () {
7542   - $rootScope.isHighLight = false;
7543   - $('#sppeachBubble').css('display', 'none');
7544   - $("#dot").css("display", "none");
  7641 + //9.
  7642 + $timeout(function () {
  7643 + $rootScope.isHighLight = false;
  7644 + $('#sppeachBubble').css('display', 'none');
  7645 + $("#dot").css("display", "none");
  7646 +
  7647 + //redraw body of respective layer
  7648 + $scope.CalculateImageCordinates($rootScope.viewOrientationId)
  7649 + }, 500);
7545 7650  
7546   - //redraw body of respective layer
7547   - $scope.CalculateImageCordinates($rootScope.viewOrientationId)
7548   - }, 500);
7549   -
7550 7651 }
7551 7652  
7552 7653 $scope.getChildTermList = function (termNo) {
... ... @@ -7616,7 +7717,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7616 7717 }
7617 7718 }
7618 7719  
7619   -
  7720 +
7620 7721 $scope.aligneCanvasWithTerm = function () {
7621 7722 console.log('aligneCanvasWithTerm')
7622 7723 var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA));
... ... @@ -7631,7 +7732,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7631 7732 var canvasRight = canvasX + canvasWidth
7632 7733  
7633 7734 if (newX < canvasX || newX > canvasRight || newY < canvasY || newY > canvasBottom) {
7634   -
  7735 +
7635 7736 newX = newX - canvasWidth / 2;
7636 7737 newY = newY - canvasHeight / 2;
7637 7738  
... ... @@ -7660,7 +7761,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7660 7761  
7661 7762 $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
7662 7763 $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft();
7663   -
  7764 +
7664 7765 }
7665 7766  
7666 7767  
... ... @@ -7779,12 +7880,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7779 7880 }
7780 7881  
7781 7882 $scope.LayerChangeBasedOnKeyPressed = function (e) {
7782   -
7783   - if(e.keyCode==13)
7784   - {
7785   - $scope.LayerChange();
  7883 +
  7884 + if (e.keyCode == 13) {
  7885 + $scope.LayerChange();
7786 7886 }
7787   -
  7887 +
7788 7888 }
7789 7889 }]
7790 7890  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -159,7 +159,7 @@
159 159 <button id="btnNormalMode" class="btn btn-primary btn-sm marginTop5 tooltip-custom" ng-click="enableNormalMode()" data-toggle="tooltip" data-placement="bottom" title="Normal"> <img src="content/images/bulb1.png" alt=""></button>
160 160 </div>
161 161 <div class="col-sm-6">
162   - <button id="btnExtract" class="btn btn-black btn-sm pull-right marginTop5 tooltip-custom" ng-click="enableExtract()" data-toggle="tooltip" data-placement="bottom" title="Extract"><img src="content/images/bulb1.png" alt=""></button>
  162 + <button id="btnExtract" class="btn btn-black btn-sm pull-right marginTop5 tooltip-custom" ng-click="enableExtract(true)" data-toggle="tooltip" data-placement="bottom" title="Extract"><img src="content/images/bulb1.png" alt=""></button>
163 163 </div>
164 164  
165 165 <div class="col-sm-6">
... ...