Commit 6db064dba8a23b46575894b057c284e7bb72fecc

Authored by Amrita Vishnoi
2 parents 22a7eb90 dfb983ae

Against Merge Request #459

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -3510,6 +3510,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3510 3510  
3511 3511 }
3512 3512 $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation) {
  3513 +
3513 3514 var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno'><div style='z-index:59000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.j + "'></div><div data=" + $scope.j + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.j + " class='dynCross_anno' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + $scope.j + "'></div></div>";
3514 3515 if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
3515 3516 if (Exists_annotation == 0) {
... ... @@ -3935,7 +3936,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3935 3936  
3936 3937  
3937 3938 function mouseUpListener(e) {
3938   -
  3939 +
3939 3940 $scope.isTBDrawnOnBodyRegion = false;
3940 3941  
3941 3942 $(".com").remove();
... ... @@ -5284,7 +5285,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5284 5285  
5285 5286  
5286 5287 function TransparencyCanvasClickListener(evt) {
5287   - //alert('tb clicked')
  5288 + // alert('tb clicked');
5288 5289 // debugger;
5289 5290 var pixelData;
5290 5291 var pixelDataTrans;
... ... @@ -5460,7 +5461,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5460 5461 }
5461 5462 //$scope.annotationTextArrayT1.push(annotations.annotationT1);
5462 5463 // $scope.annotationTextArrayT2.push(annotations.annotationT2);
5463   -
  5464 +
5464 5465 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5465 5466 }
5466 5467 else
... ... @@ -5477,7 +5478,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5477 5478 }
5478 5479 //$scope.annotationTextArrayT1.push(annotations.annotationT1);
5479 5480 // $scope.annotationTextArrayT2.push(annotations.annotationT2);
5480   -
  5481 +
5481 5482 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5482 5483 }
5483 5484  
... ... @@ -5487,7 +5488,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5487 5488 }
5488 5489  
5489 5490 function OnClickModestyTransCanvas(evt) {
5490   -
  5491 + var tCanvasLeft = $(".ui-wrapper").css("left");
  5492 + var tCanvasLeftAftrSplit = tCanvasLeft.split("p");
  5493 + var tCanvasTop = $(".ui-wrapper").css("top");
  5494 + var tCanvasTopAftrSplit = tCanvasTop.split("p");
  5495 + var tCanvasWidth = $(".ui-wrapper").css("width");
  5496 + var tCanvasWidthAftrSplit = tCanvasWidth.split("p");
  5497 + var tCanvasHeight = $(".ui-wrapper").css("height");
  5498 + var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
  5499 + // alert("modesty");
  5500 + var tCanvasTotalWidth = parseInt(tCanvasLeftAftrSplit[0]) + parseInt(tCanvasWidthAftrSplit[0]);
  5501 + var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
5491 5502 var mousePos = $scope.getMousePos(evt);
5492 5503 var canvasDiv = document.getElementById('canvasDiv');
5493 5504 var verticalScrollPosition = canvasDiv.scrollTop;
... ... @@ -5499,94 +5510,95 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5499 5510 var canavsX = evt.currentTarget.offsetLeft;
5500 5511 var canvasY = evt.currentTarget.offsetTop;
5501 5512  
5502   - var canvasId = evt.currentTarget.id;
5503   - var canavsContext = document.getElementById(canvasId).getContext('2d');
5504   - var RGBColor = $scope.GetRGBColor(canavsContext, actulalX, actualY, canavsX, canvasY);
5505   -
5506   - var annotationText;
  5513 + if ((tCanvasLeftAftrSplit[0] <= actulalX && (actulalX <= tCanvasTotalWidth)) && (tCanvasTopAftrSplit[0] <= actualY && actualY <= tCanvasTotalHeight)) {
  5514 + var canvasId = evt.currentTarget.id;
  5515 + var canavsContext = document.getElementById(canvasId).getContext('2d');
  5516 + var RGBColor = $scope.GetRGBColor(canavsContext, actulalX, actualY, canavsX, canvasY);
5507 5517  
5508   - //Modesty ON
5509   - if (canvasId.match('modestyImg') && RGBColor != '000000') {
5510   - RGBColor = DA[0].figLeafTermId;
5511   - annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor);
5512   - $scope.annotationTextArrayT1 = [];
5513   - $scope.annotationTextArrayT2 = [];
5514   - $scope.annotationTextArrayT1.push(annotationText);
5515   - $scope.annotationTextArrayT2.push(annotationText);
5516   - }
5517   - //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
5518   - //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
5519   - //
5520   - else if (canvasId.match('modestyImg') && RGBColor == '000000') {
  5518 + var annotationText;
5521 5519  
5522   - var bodyRegionId = canvasId.slice(-1);
  5520 + //Modesty ON
  5521 + if (canvasId.match('modestyImg') && RGBColor != '000000') {
  5522 + RGBColor = DA[0].figLeafTermId;
  5523 + annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor);
  5524 + $scope.annotationTextArrayT1 = [];
  5525 + $scope.annotationTextArrayT2 = [];
  5526 + $scope.annotationTextArrayT1.push(annotationText);
  5527 + $scope.annotationTextArrayT2.push(annotationText);
  5528 + }
  5529 + //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
  5530 + //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
  5531 + //
  5532 + else if (canvasId.match('modestyImg') && RGBColor == '000000') {
5523 5533  
5524   - var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci';
5525   - var maskCanvas = document.getElementById(maskCanvasId);
5526   - var maskCanvasContext = maskCanvas.getContext("2d");
5527   - //RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY);
5528   - //annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  5534 + var bodyRegionId = canvasId.slice(-1);
5529 5535  
5530   - //transparecncy canvas
5531   - var maskCanvasTransId = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci';
5532   - var maskCanvastrans = document.getElementById(maskCanvasTransId);
5533   - var maskCanvasContexttrans = maskCanvastrans.getContext("2d");
  5536 + var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci';
  5537 + var maskCanvas = document.getElementById(maskCanvasId);
  5538 + var maskCanvasContext = maskCanvas.getContext("2d");
  5539 + //RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY);
  5540 + //annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
5534 5541  
5535   - var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1);
  5542 + //transparecncy canvas
  5543 + var maskCanvasTransId = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci';
  5544 + var maskCanvastrans = document.getElementById(maskCanvasTransId);
  5545 + var maskCanvasContexttrans = maskCanvastrans.getContext("2d");
5536 5546  
5537   - var pixelDataTrans = maskCanvasContexttrans.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1);
  5547 + var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1);
5538 5548  
5539   - var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope);
  5549 + var pixelDataTrans = maskCanvasContexttrans.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1);
5540 5550  
  5551 + var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope);
5541 5552  
5542   - // var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci';
5543   - // var maskCanvas = document.getElementById(maskCanvasId);
5544   - // var maskCanvasContext = maskCanvas.getContext("2d");
5545   - // RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY);
5546   - // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
5547 5553  
  5554 + // var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci';
  5555 + // var maskCanvas = document.getElementById(maskCanvasId);
  5556 + // var maskCanvasContext = maskCanvas.getContext("2d");
  5557 + // RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY);
  5558 + // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
5548 5559  
5549   - // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50)
5550 5560  
5551   - $scope.annotationTextArrayT1 = [];
5552   - $scope.annotationTextArrayT2 = [];
5553   - for (var i = 0; i <= annotations.annotationT1.length - 1; i++) {
5554   - $scope.annotationTextArrayT1.push(annotations.annotationT1[i]);
5555   - }
5556   - for (var i = 0; i <= annotations.annotationT2.length - 1; i++) {
5557   - $scope.annotationTextArrayT2.push(annotations.annotationT1[i]);
5558   - }
5559   - //$scope.annotationTextArrayT1.push(annotations.annotationT1);
5560   - // $scope.annotationTextArrayT2.push(annotations.annotationT2);
  5561 + // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50)
5561 5562  
5562   - }
  5563 + $scope.annotationTextArrayT1 = [];
  5564 + $scope.annotationTextArrayT2 = [];
  5565 + for (var i = 0; i <= annotations.annotationT1.length - 1; i++) {
  5566 + $scope.annotationTextArrayT1.push(annotations.annotationT1[i]);
5563 5567  
5564   - if ($('#speechBubble').length > 0)
5565   - $('#speechBubble').remove();
  5568 + }
  5569 + for (var i = 0; i <= annotations.annotationT2.length - 1; i++) {
  5570 + $scope.annotationTextArrayT2.push(annotations.annotationT2[i]);
  5571 + }
  5572 + //$scope.annotationTextArrayT1.push(annotations.annotationT1);
  5573 + // $scope.annotationTextArrayT2.push(annotations.annotationT2);
5566 5574  
  5575 + }
5567 5576  
5568   - if ($('#speechBubbleTrns').length > 0) {
5569   - $('#speechBubbleTrns').remove();
5570   - }
  5577 + if ($('#speechBubble').length > 0)
  5578 + $('#speechBubble').remove();
5571 5579  
5572   - var tCanvasTopPos = $(".ui-wrapper").css("top");
5573   - var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p");
5574   - var tCanvasHeight = $(".ui-wrapper").css("height");
5575   - var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
5576   - var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
5577 5580  
5578   - if ((evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) >= parseInt(tCanvasTopPosAftrSplit[0]) && (evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) <= tCanvasAttr) {
  5581 + if ($('#speechBubbleTrns').length > 0) {
  5582 + $('#speechBubbleTrns').remove();
  5583 + }
5579 5584  
5580   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
  5585 + var tCanvasTopPos = $(".ui-wrapper").css("top");
  5586 + var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p");
  5587 + var tCanvasHeight = $(".ui-wrapper").css("height");
  5588 + var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
  5589 + var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
5581 5590  
  5591 + // if ((evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) >= parseInt(tCanvasTopPosAftrSplit[0]) && (evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) <= tCanvasAttr) {
  5592 + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
  5593 + //}
  5594 + //else {
  5595 + // $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(evt);
  5596 + //}
5582 5597 }
5583   - else {
5584   -
  5598 + else
  5599 + {
5585 5600 $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(evt);
5586   -
5587 5601 }
5588   -
5589   -
5590 5602 }
5591 5603  
5592 5604 function getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt) {
... ... @@ -6052,6 +6064,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6052 6064 }
6053 6065  
6054 6066 $scope.enableZoom = function () {
  6067 + $("#OnIdentify").removeClass("annotationtoolbartab");
  6068 + $("#DrawMode").removeClass("annotationtoolbartab");
  6069 + $('.btnCursor').removeClass('activebtncolor');
6055 6070 $(".annotationTollbar").css("display", "none");
6056 6071 $("#annotationButton").removeClass("active");
6057 6072 $("#btnExtract").removeClass("disabled");
... ... @@ -6060,13 +6075,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6060 6075 $rootScope.isNormalMode = false;
6061 6076 $rootScope.isGenderChnage = false;
6062 6077 $rootScope.isViewChange = false;
  6078 +
6063 6079 //if listanager is visisble then close it
6064 6080  
6065 6081 $rootScope.CloseListManager();
6066 6082  
6067 6083 $rootScope.isHighlightBodyByBodySystem = false;
6068 6084  
6069   -
  6085 +
6070 6086 $('#sppeachBubble').css('display', 'none');
6071 6087  
6072 6088 $("#dot").css("display", "none");
... ...