Commit 16ed404300c925a0cc6b92578fca6e4ba5e1c0f8

Authored by Amrita Vishnoi
1 parent ad97d9e9

Issues fixed:

1. unhighlight was not working in mirrored body region- Fixed.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -44,8 +44,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
44 44 $scope.previousSelectedTermList = [];
45 45  
46 46  
47   -
48   - $scope.machedBodyRegion = [];
  47 + // This variable is used for unhighlight previously highlighted body portion, if multiAnnotation is false.
  48 + $scope.machedIcolorInBodyRegion = [];
49 49  
50 50 //array for bodyviewid correspoing to male female(used for gender change)
51 51 $scope.correspondingBodyViewIds = {
... ... @@ -918,24 +918,57 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
918 918 var RGBColor = (Red + Green + Blue);
919 919  
920 920 if ($rootScope.isHighLight) {
921   - //2. Find Actul Term No Based on Icolor.
922   - var ActualTermNo = $scope.getActualTermNumber(RGBColor);
923   - //alert('actual term no: ' + ActualTermNo);
  921 + ////2. Find Actul Term No Based on Icolor.
  922 + //var ActualTermNo = $scope.getActualTermNumber(RGBColor);
  923 + ////alert('actual term no: ' + ActualTermNo);
  924 +
  925 + ////3. Find Term No List Based on ActualTermNo
  926 + //var TermList = $scope.getTermNumberList(ActualTermNo);
  927 + //// alert('termList.count: ' + TermList.length);
  928 +
  929 + ////4.
  930 +
  931 + //$scope.machedTermNoLocation = [];
  932 + //for (var i = 0; i < TermList.length; i++) {
  933 +
  934 + // var termNumber = parseInt(TermList[i]._TermNumber);
  935 +
  936 + // //Match Term No List in each bodyRegion
  937 + // $scope.getLocationsForMatchedTermsInWholeBody(termNumber);
  938 + //}
  939 +
  940 + if ($scope.machedIcolorInBodyRegion.length > 0) {
  941 + if ($scope.multiAnnotationIsON == false) {
  942 + for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
  943 + var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
924 944  
925   - //3. Find Term No List Based on ActualTermNo
926   - var TermList = $scope.getTermNumberList(ActualTermNo);
927   - // alert('termList.count: ' + TermList.length);
  945 + var grayCanvasID = 'imageCanvas' + bodyRegionId;
  946 + var grayCanvas = document.getElementById(grayCanvasID);
  947 +
  948 + var grayCanvasContext = grayCanvas.getContext("2d");
  949 +
  950 + var grayImageData = $rootScope.grayImageDataList[bodyRegionId - 1];
  951 +
  952 + grayCanvasContext.putImageData(grayImageData, 0, 0)
928 953  
929   - //4.
  954 + // for mirrored canvas
930 955  
931   - $scope.machedTermNoLocation = [];
932   - for (var i = 0; i < TermList.length; i++) {
  956 + if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
  957 + var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR';
  958 + var grayCanvasMR = document.getElementById(grayCanvasID);
933 959  
934   - var termNumber = parseInt(TermList[i]._TermNumber);
  960 + var grayCanvasContextMR = grayCanvasMR.getContext("2d");
935 961  
936   - //Match Term No List in each bodyRegion
937   - $scope.getLocationsForMatchedTermsInWholeBody(termNumber);
  962 + var grayImageDataMR = $rootScope.grayImageMRDataList[bodyRegionId];
  963 +
  964 + grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0)
  965 + }
  966 +
  967 + }
  968 + }
938 969 }
  970 +
  971 + $scope.highLightBodyBasedOnIcolor(RGBColor);
939 972 }
940 973  
941 974  
... ... @@ -951,8 +984,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
951 984  
952 985 }
953 986 else {
954   - if ($('#speechBubble').length > 0) {
955   - $('#speechBubble').remove();
  987 +
  988 + if ($('#dot').length > 0) {
  989 + $('#dot').remove();
  990 + }
  991 +
  992 + if ($('#sppeachBubble').length > 0) {
  993 + $('#sppeachBubble').remove();
956 994  
957 995  
958 996 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
... ... @@ -1048,6 +1086,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1048 1086 imgCanvas.style.zIndex = "500";
1049 1087 }
1050 1088 }
  1089 +
1051 1090 imgCanvas.addEventListener('click', function (evt) {
1052 1091  
1053 1092 if (evt.ctrlKey)
... ... @@ -1098,12 +1137,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1098 1137  
1099 1138 if ($rootScope.isHighLight)
1100 1139 {
1101   - if ($scope.machedBodyRegion.length > 0)
  1140 + if ($scope.machedIcolorInBodyRegion.length > 0)
1102 1141 {
1103 1142 if ($scope.multiAnnotationIsON == false)
1104 1143 {
1105   - for (var i = 0; i < $scope.machedBodyRegion.length; i++) {
1106   - var bodyRegionId = $scope.machedBodyRegion[i];
  1144 + for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
  1145 + var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
1107 1146  
1108 1147 var grayCanvasID = 'imageCanvas' + bodyRegionId;
1109 1148 var grayCanvas = document.getElementById(grayCanvasID);
... ... @@ -1151,7 +1190,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1151 1190  
1152 1191 else
1153 1192 {
1154   - $scope.highLightBodyBasedOnIcolor(RGBColor);
  1193 + // $scope.highLightBodyBasedOnIcolor(RGBColor);
1155 1194  
1156 1195 ////2. Find Actul Term No Based on Icolor.
1157 1196 //var ActualTermNo = $scope.getActualTermNumber(RGBColor);
... ... @@ -1214,8 +1253,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1214 1253  
1215 1254 }
1216 1255 else {
1217   - if ($('#speechBubble').length > 0) {
1218   - $('#speechBubble').remove();
  1256 + if ($('#dot').length > 0) {
  1257 + $('#dot').remove();
  1258 +
  1259 + if ($('#sppeachBubble').length > 0) {
  1260 + $('#sppeachBubble').remove();
  1261 + }
  1262 +
1219 1263  
1220 1264  
1221 1265 $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
... ... @@ -1395,12 +1439,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1395 1439  
1396 1440 if (parseInt(termNo) == parseInt(Icolor)) {
1397 1441 counter++;
1398   - var have = $scope.machedBodyRegion.indexOf(bodyRegionId);
  1442 + var have = $scope.machedIcolorInBodyRegion.indexOf(bodyRegionId);
1399 1443  
1400 1444  
1401 1445 if (have == -1)
1402 1446 {
1403   - $scope.machedBodyRegion.push(bodyRegionId);
  1447 + $scope.machedIcolorInBodyRegion.push(bodyRegionId);
1404 1448 }
1405 1449 else
1406 1450 {
... ... @@ -1731,7 +1775,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1731 1775  
1732 1776 $(".com").css("display", "none");
1733 1777 $("#bord").css({ "width": "0px", "display": "none" });
1734   - $('<div style="position:absolute;height:15px;width:35px;display:none;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);" id="dot"></div>'
  1778 +
  1779 + $('<div id="dot" style="position:absolute;height:15px;width:35px;display:none;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
1735 1780 + '<div id="sppeachBubble" style="height:auto!important;z-index:10000;margin-left:25px;border:1px solid #000;display:none;padding:5px 10px;width:200px;position:absolute;color:#000;text-align:left;font-size:12px;background-color:#fff;font-weight:bold;"><span>'+text+'</span>'
1736 1781 + '<span style="position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;">'
1737 1782 + '<img class="crossDiv_temp" src="/AIA/content/images/speeachBubbleClose.png"></span></div>'
... ...