Commit 5ff311337e6184d76695f75e673514d4b8e39575
1 parent
0a2ac62a
Annotation Globalization Issue
Showing
1 changed file
with
87 additions
and
71 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -3479,6 +3479,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3479 | 3479 | |
3480 | 3480 | } |
3481 | 3481 | $scope.createSpeechBubbleBasedOnTransparencyWithCtrl = function (pointClicked_annotation, Exists_annotation, x, y, sub_id_annotation) { |
3482 | + | |
3482 | 3483 | 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>"; |
3483 | 3484 | if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { |
3484 | 3485 | if (Exists_annotation == 0) { |
... | ... | @@ -3904,7 +3905,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3904 | 3905 | |
3905 | 3906 | |
3906 | 3907 | function mouseUpListener(e) { |
3907 | - | |
3908 | + | |
3908 | 3909 | $scope.isTBDrawnOnBodyRegion = false; |
3909 | 3910 | |
3910 | 3911 | $(".com").remove(); |
... | ... | @@ -5215,7 +5216,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5215 | 5216 | |
5216 | 5217 | |
5217 | 5218 | function TransparencyCanvasClickListener(evt) { |
5218 | - //alert('tb clicked') | |
5219 | + // alert('tb clicked'); | |
5219 | 5220 | // debugger; |
5220 | 5221 | var pixelData; |
5221 | 5222 | var pixelDataTrans; |
... | ... | @@ -5391,7 +5392,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5391 | 5392 | } |
5392 | 5393 | //$scope.annotationTextArrayT1.push(annotations.annotationT1); |
5393 | 5394 | // $scope.annotationTextArrayT2.push(annotations.annotationT2); |
5394 | - | |
5395 | + | |
5395 | 5396 | $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); |
5396 | 5397 | } |
5397 | 5398 | else |
... | ... | @@ -5408,7 +5409,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5408 | 5409 | } |
5409 | 5410 | //$scope.annotationTextArrayT1.push(annotations.annotationT1); |
5410 | 5411 | // $scope.annotationTextArrayT2.push(annotations.annotationT2); |
5411 | - | |
5412 | + | |
5412 | 5413 | $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); |
5413 | 5414 | } |
5414 | 5415 | |
... | ... | @@ -5418,7 +5419,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5418 | 5419 | } |
5419 | 5420 | |
5420 | 5421 | function OnClickModestyTransCanvas(evt) { |
5421 | - | |
5422 | + var tCanvasLeft = $(".ui-wrapper").css("left"); | |
5423 | + var tCanvasLeftAftrSplit = tCanvasLeft.split("p"); | |
5424 | + var tCanvasTop = $(".ui-wrapper").css("top"); | |
5425 | + var tCanvasTopAftrSplit = tCanvasTop.split("p"); | |
5426 | + var tCanvasWidth = $(".ui-wrapper").css("width"); | |
5427 | + var tCanvasWidthAftrSplit = tCanvasWidth.split("p"); | |
5428 | + var tCanvasHeight = $(".ui-wrapper").css("height"); | |
5429 | + var tCanvasHeightAftrSplit = tCanvasHeight.split("p"); | |
5430 | + // alert("modesty"); | |
5431 | + var tCanvasTotalWidth = parseInt(tCanvasLeftAftrSplit[0]) + parseInt(tCanvasWidthAftrSplit[0]); | |
5432 | + var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]); | |
5422 | 5433 | var mousePos = $scope.getMousePos(evt); |
5423 | 5434 | var canvasDiv = document.getElementById('canvasDiv'); |
5424 | 5435 | var verticalScrollPosition = canvasDiv.scrollTop; |
... | ... | @@ -5430,94 +5441,95 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5430 | 5441 | var canavsX = evt.currentTarget.offsetLeft; |
5431 | 5442 | var canvasY = evt.currentTarget.offsetTop; |
5432 | 5443 | |
5433 | - var canvasId = evt.currentTarget.id; | |
5434 | - var canavsContext = document.getElementById(canvasId).getContext('2d'); | |
5435 | - var RGBColor = $scope.GetRGBColor(canavsContext, actulalX, actualY, canavsX, canvasY); | |
5444 | + if ((tCanvasLeftAftrSplit[0] <= actulalX && (actulalX <= tCanvasTotalWidth)) && (tCanvasTopAftrSplit[0] <= actualY && actualY <= tCanvasTotalHeight)) { | |
5445 | + var canvasId = evt.currentTarget.id; | |
5446 | + var canavsContext = document.getElementById(canvasId).getContext('2d'); | |
5447 | + var RGBColor = $scope.GetRGBColor(canavsContext, actulalX, actualY, canavsX, canvasY); | |
5436 | 5448 | |
5437 | - var annotationText; | |
5438 | - | |
5439 | - //Modesty ON | |
5440 | - if (canvasId.match('modestyImg') && RGBColor != '000000') { | |
5441 | - RGBColor = DA[0].figLeafTermId; | |
5442 | - annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor); | |
5443 | - $scope.annotationTextArrayT1 = []; | |
5444 | - $scope.annotationTextArrayT2 = []; | |
5445 | - $scope.annotationTextArrayT1.push(annotationText); | |
5446 | - $scope.annotationTextArrayT2.push(annotationText); | |
5447 | - } | |
5448 | - //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to | |
5449 | - //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er | |
5450 | - // | |
5451 | - else if (canvasId.match('modestyImg') && RGBColor == '000000') { | |
5449 | + var annotationText; | |
5452 | 5450 | |
5453 | - var bodyRegionId = canvasId.slice(-1); | |
5451 | + //Modesty ON | |
5452 | + if (canvasId.match('modestyImg') && RGBColor != '000000') { | |
5453 | + RGBColor = DA[0].figLeafTermId; | |
5454 | + annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor); | |
5455 | + $scope.annotationTextArrayT1 = []; | |
5456 | + $scope.annotationTextArrayT2 = []; | |
5457 | + $scope.annotationTextArrayT1.push(annotationText); | |
5458 | + $scope.annotationTextArrayT2.push(annotationText); | |
5459 | + } | |
5460 | + //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to | |
5461 | + //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er | |
5462 | + // | |
5463 | + else if (canvasId.match('modestyImg') && RGBColor == '000000') { | |
5454 | 5464 | |
5455 | - var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci'; | |
5456 | - var maskCanvas = document.getElementById(maskCanvasId); | |
5457 | - var maskCanvasContext = maskCanvas.getContext("2d"); | |
5458 | - //RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY); | |
5459 | - //annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); | |
5465 | + var bodyRegionId = canvasId.slice(-1); | |
5460 | 5466 | |
5461 | - //transparecncy canvas | |
5462 | - var maskCanvasTransId = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci'; | |
5463 | - var maskCanvastrans = document.getElementById(maskCanvasTransId); | |
5464 | - var maskCanvasContexttrans = maskCanvastrans.getContext("2d"); | |
5467 | + var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci'; | |
5468 | + var maskCanvas = document.getElementById(maskCanvasId); | |
5469 | + var maskCanvasContext = maskCanvas.getContext("2d"); | |
5470 | + //RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY); | |
5471 | + //annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); | |
5465 | 5472 | |
5466 | - var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1); | |
5473 | + //transparecncy canvas | |
5474 | + var maskCanvasTransId = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci'; | |
5475 | + var maskCanvastrans = document.getElementById(maskCanvasTransId); | |
5476 | + var maskCanvasContexttrans = maskCanvastrans.getContext("2d"); | |
5467 | 5477 | |
5468 | - var pixelDataTrans = maskCanvasContexttrans.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1); | |
5478 | + var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1); | |
5469 | 5479 | |
5470 | - var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope); | |
5480 | + var pixelDataTrans = maskCanvasContexttrans.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1); | |
5471 | 5481 | |
5482 | + var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope); | |
5472 | 5483 | |
5473 | - // var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci'; | |
5474 | - // var maskCanvas = document.getElementById(maskCanvasId); | |
5475 | - // var maskCanvasContext = maskCanvas.getContext("2d"); | |
5476 | - // RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY); | |
5477 | - // annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); | |
5478 | 5484 | |
5485 | + // var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci'; | |
5486 | + // var maskCanvas = document.getElementById(maskCanvasId); | |
5487 | + // var maskCanvasContext = maskCanvas.getContext("2d"); | |
5488 | + // RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY); | |
5489 | + // annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); | |
5479 | 5490 | |
5480 | - // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) | |
5481 | 5491 | |
5482 | - $scope.annotationTextArrayT1 = []; | |
5483 | - $scope.annotationTextArrayT2 = []; | |
5484 | - for (var i = 0; i <= annotations.annotationT1.length - 1; i++) { | |
5485 | - $scope.annotationTextArrayT1.push(annotations.annotationT1[i]); | |
5486 | - } | |
5487 | - for (var i = 0; i <= annotations.annotationT2.length - 1; i++) { | |
5488 | - $scope.annotationTextArrayT2.push(annotations.annotationT1[i]); | |
5489 | - } | |
5490 | - //$scope.annotationTextArrayT1.push(annotations.annotationT1); | |
5491 | - // $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
5492 | + // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) | |
5492 | 5493 | |
5493 | - } | |
5494 | + $scope.annotationTextArrayT1 = []; | |
5495 | + $scope.annotationTextArrayT2 = []; | |
5496 | + for (var i = 0; i <= annotations.annotationT1.length - 1; i++) { | |
5497 | + $scope.annotationTextArrayT1.push(annotations.annotationT1[i]); | |
5494 | 5498 | |
5495 | - if ($('#speechBubble').length > 0) | |
5496 | - $('#speechBubble').remove(); | |
5499 | + } | |
5500 | + for (var i = 0; i <= annotations.annotationT2.length - 1; i++) { | |
5501 | + $scope.annotationTextArrayT2.push(annotations.annotationT2[i]); | |
5502 | + } | |
5503 | + //$scope.annotationTextArrayT1.push(annotations.annotationT1); | |
5504 | + // $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
5497 | 5505 | |
5506 | + } | |
5498 | 5507 | |
5499 | - if ($('#speechBubbleTrns').length > 0) { | |
5500 | - $('#speechBubbleTrns').remove(); | |
5501 | - } | |
5508 | + if ($('#speechBubble').length > 0) | |
5509 | + $('#speechBubble').remove(); | |
5502 | 5510 | |
5503 | - var tCanvasTopPos = $(".ui-wrapper").css("top"); | |
5504 | - var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p"); | |
5505 | - var tCanvasHeight = $(".ui-wrapper").css("height"); | |
5506 | - var tCanvasHeightAftrSplit = tCanvasHeight.split("p"); | |
5507 | - var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]); | |
5508 | 5511 | |
5509 | - if ((evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) >= parseInt(tCanvasTopPosAftrSplit[0]) && (evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) <= tCanvasAttr) { | |
5512 | + if ($('#speechBubbleTrns').length > 0) { | |
5513 | + $('#speechBubbleTrns').remove(); | |
5514 | + } | |
5510 | 5515 | |
5511 | - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
5516 | + var tCanvasTopPos = $(".ui-wrapper").css("top"); | |
5517 | + var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p"); | |
5518 | + var tCanvasHeight = $(".ui-wrapper").css("height"); | |
5519 | + var tCanvasHeightAftrSplit = tCanvasHeight.split("p"); | |
5520 | + var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]); | |
5512 | 5521 | |
5522 | + // if ((evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) >= parseInt(tCanvasTopPosAftrSplit[0]) && (evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) <= tCanvasAttr) { | |
5523 | + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
5524 | + //} | |
5525 | + //else { | |
5526 | + // $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(evt); | |
5527 | + //} | |
5513 | 5528 | } |
5514 | - else { | |
5515 | - | |
5529 | + else | |
5530 | + { | |
5516 | 5531 | $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(evt); |
5517 | - | |
5518 | 5532 | } |
5519 | - | |
5520 | - | |
5521 | 5533 | } |
5522 | 5534 | |
5523 | 5535 | function getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt) { |
... | ... | @@ -5983,6 +5995,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5983 | 5995 | } |
5984 | 5996 | |
5985 | 5997 | $scope.enableZoom = function () { |
5998 | + $("#OnIdentify").removeClass("annotationtoolbartab"); | |
5999 | + $("#DrawMode").removeClass("annotationtoolbartab"); | |
6000 | + $('.btnCursor').removeClass('activebtncolor'); | |
5986 | 6001 | $(".annotationTollbar").css("display", "none"); |
5987 | 6002 | $("#annotationButton").removeClass("active"); |
5988 | 6003 | $("#btnExtract").removeClass("disabled"); |
... | ... | @@ -5991,13 +6006,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5991 | 6006 | $rootScope.isNormalMode = false; |
5992 | 6007 | $rootScope.isGenderChnage = false; |
5993 | 6008 | $rootScope.isViewChange = false; |
6009 | + | |
5994 | 6010 | //if listanager is visisble then close it |
5995 | 6011 | |
5996 | 6012 | $rootScope.CloseListManager(); |
5997 | 6013 | |
5998 | 6014 | $rootScope.isHighlightBodyByBodySystem = false; |
5999 | 6015 | |
6000 | - | |
6016 | + | |
6001 | 6017 | $('#sppeachBubble').css('display', 'none'); |
6002 | 6018 | |
6003 | 6019 | $("#dot").css("display", "none"); | ... | ... |