diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index ebc7ce5..84b7506 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -3704,7 +3704,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) { - var sppechBubbleHTML = "
"; + var sppechBubbleHTML = "
"; //Issue #7286 :Undefined annotation should not appear for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { var annotation = $scope.MultiLanguageAnnationArray[i]; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 7d56ac7..a66922f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -264,6 +264,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic //annotation tool custom events $rootScope.ShowAnnotationWindow = function () { //7904 + $rootScope.isAnnotatiomToolBarPopupClosed = false; $rootScope.isAnnotaionToolBarDrawingModeActive = false; if ($rootScope.MenuModuleName == "DA" || $rootScope.MenuModuleName == "CI") { if ($rootScope.disableAnnotationtoolOnListManager == true) { @@ -326,6 +327,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.CloseAnnotationTool = function () { console.log('close'); + $rootScope.isAnnotatiomToolBarPopupClosed = true; $("#OnIdentify").removeClass("annotationtoolbartab"); $("#DrawMode").removeClass("annotationtoolbartab"); $('.btnCursor').removeClass('activebtncolor'); @@ -340,6 +342,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $rootScope.isAnnotaionToolBarDrawingModeActive = false; + $rootScope.switchCanvas(); } $rootScope.CIAnotationIdentifyModeOff = false; @@ -1390,25 +1393,27 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.lastX; $rootScope.lastY; var ctx; $rootScope.OnPaintCanvasMouseDown = function (event) { - - var canvasElement = document.getElementById("canvas"); - var ctx = canvasElement.getContext("2d"); - - // var x = event.clientX; - // var y = event.clientY; - $rootScope.offsetX1 = 0; - $rootScope.offsetY1 = 0; - //alert($location.path()); - - var canvasDiv = document.getElementById('canvasDiv'); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; - $rootScope.offsetX1 = event.offsetX; - $rootScope.offsetY1 = event.offsetY; - ctx.clearRect(0, 0, 2277, 3248); - $rootScope.clicked = true; - // alert("x:"+$rootScope.offsetX1 + " y:" + $rootScope.offsetY1); - canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); + if ($rootScope.isAnnotatiomToolBarPopupClosed == false) { + var canvasElement = document.getElementById("canvas"); + var ctx = canvasElement.getContext("2d"); + + // var x = event.clientX; + // var y = event.clientY; + $rootScope.offsetX1 = 0; + $rootScope.offsetY1 = 0; + //alert($location.path()); + + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; + $rootScope.offsetX1 = event.offsetX; + $rootScope.offsetY1 = event.offsetY; + ctx.clearRect(0, 0, 2277, 3248); + $rootScope.clicked = true; + // alert("x:"+$rootScope.offsetX1 + " y:" + $rootScope.offsetY1); + canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); + } + } $rootScope.rectNumber = 0; $rootScope.LineNumber = 0; @@ -1428,83 +1433,85 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var storeLine = ''; $rootScope.OnPaintCanvasMouseUp = function (event) { - + if (!$rootScope.clicked) { return; } - var AnnotationCanvas = document.getElementById('canvas'); - AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); - - $(".line").remove(); - $(".arrow").remove(); - $(".pin").remove(); - $(".circle").remove(); - $(".rectangle").remove(); - $(".textarea").remove(); - $rootScope.clicked = false; - $rootScope.x = 0; - $rootScope.y = 0; - var canvasDiv = document.getElementById('canvasDiv'); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; - $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left; - $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top; - var canvasElement = document.getElementById("canvas"); - var ctx = canvasElement.getContext("2d"); - var canvasPaintElement = document.getElementById("canvasPaint"); - var PaintCanvasctx = canvasPaintElement.getContext("2d"); - switch ($rootScope.shapeType) { - case "cursor": - ctx.beginPath(); - PaintCanvasctx.beginPath(); - break; - case "Line": - $rootScope.isAnnotaionToolBarDrawingModeActive = true; - $rootScope.LineNumber = $rootScope.ObjectIndex++; - // $rootScope.isLinePreviewCompleted = true; - $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) - break; - case "Rectangle": - $rootScope.isAnnotaionToolBarDrawingModeActive = true; - $rootScope.rectNumber = $rootScope.ObjectIndex++; - // $rootScope.isRectanglePreviewCompleted = true; - $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); - - break; - case "Circle": - $rootScope.isAnnotaionToolBarDrawingModeActive = true; - $rootScope.CircleNumber = $rootScope.ObjectIndex++; - // $rootScope.isCirclePreviewCompleted = true; - $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); - break; - case "Arrow": - $rootScope.isAnnotaionToolBarDrawingModeActive = true; - $rootScope.ArrowNumber = $rootScope.ObjectIndex++; - //$rootScope.isArrowPreviewCompleted = true; - $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); - break; - case "Pin": - $rootScope.isAnnotaionToolBarDrawingModeActive = true; - $rootScope.PinNumber = $rootScope.PinObjectIndex++; - $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++; - - //$rootScope.isPinPreviewCompleted = true; - - $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); - break; - case "TextArea": - $rootScope.isAnnotaionToolBarDrawingModeActive = true; - $rootScope.IsTextAlreadySave = false; - $("#text_area").val(''); - // Draw text - $rootScope.resetTextRect = $rootScope.ObjectIndex++; - $rootScope.TextNumber = $rootScope.ObjectIndex++; - // $rootScope.isTextAreaPreviewCompleted = true; - $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); - break; - case "DrawPolygon": - break; + if ($rootScope.isAnnotatiomToolBarPopupClosed == false) { + var AnnotationCanvas = document.getElementById('canvas'); + AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); + + $(".line").remove(); + $(".arrow").remove(); + $(".pin").remove(); + $(".circle").remove(); + $(".rectangle").remove(); + $(".textarea").remove(); + $rootScope.clicked = false; + $rootScope.x = 0; + $rootScope.y = 0; + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; + $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left; + $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top; + var canvasElement = document.getElementById("canvas"); + var ctx = canvasElement.getContext("2d"); + var canvasPaintElement = document.getElementById("canvasPaint"); + var PaintCanvasctx = canvasPaintElement.getContext("2d"); + switch ($rootScope.shapeType) { + case "cursor": + ctx.beginPath(); + PaintCanvasctx.beginPath(); + break; + case "Line": + $rootScope.isAnnotaionToolBarDrawingModeActive = true; + $rootScope.LineNumber = $rootScope.ObjectIndex++; + // $rootScope.isLinePreviewCompleted = true; + $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) + break; + case "Rectangle": + $rootScope.isAnnotaionToolBarDrawingModeActive = true; + $rootScope.rectNumber = $rootScope.ObjectIndex++; + // $rootScope.isRectanglePreviewCompleted = true; + $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + + break; + case "Circle": + $rootScope.isAnnotaionToolBarDrawingModeActive = true; + $rootScope.CircleNumber = $rootScope.ObjectIndex++; + // $rootScope.isCirclePreviewCompleted = true; + $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + break; + case "Arrow": + $rootScope.isAnnotaionToolBarDrawingModeActive = true; + $rootScope.ArrowNumber = $rootScope.ObjectIndex++; + //$rootScope.isArrowPreviewCompleted = true; + $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + break; + case "Pin": + $rootScope.isAnnotaionToolBarDrawingModeActive = true; + $rootScope.PinNumber = $rootScope.PinObjectIndex++; + $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++; + + //$rootScope.isPinPreviewCompleted = true; + + $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); + break; + case "TextArea": + $rootScope.isAnnotaionToolBarDrawingModeActive = true; + $rootScope.IsTextAlreadySave = false; + $("#text_area").val(''); + // Draw text + $rootScope.resetTextRect = $rootScope.ObjectIndex++; + $rootScope.TextNumber = $rootScope.ObjectIndex++; + // $rootScope.isTextAreaPreviewCompleted = true; + $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); + break; + case "DrawPolygon": + break; + } } //} @@ -2112,15 +2119,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic //---- $rootScope.onDrawingCanvasClick = function (event) { - + $rootScope.clicked = true; // OnPaintCanvasMouseDown(event); var annotationCanvas = document.getElementById('canvas'); if (annotationCanvas != null || annotationCanvas != undefined) { - annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintCanvasMouseDown, false); - annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false); + + annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintCanvasMouseDown, false); + annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false); + } + // alert("doclick"); // annotation history if (event != undefined) { @@ -2519,10 +2529,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false); annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false); // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp); - //alert($rootScope.isAnnotaionToolBarDrawingModeActive); + //if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { - // alert($rootScope.isAnnotaionToolBarDrawingModeActive); + // $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(e); //} @@ -2540,14 +2550,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.OnPaintBrushCanvasMouseDown = function (event) { - $rootScope.isMousedownOnPaintCanvas = true; - $rootScope.isStartPointDeleted = false; - var annotationCanvas = document.getElementById("canvas"); - $rootScope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left)); - $rootScope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top)); - - annotationCanvas.addEventListener('mousemove', $rootScope.OnPaintBrushCanvasMouseMove, false); + if ($rootScope.isAnnotatiomToolBarPopupClosed == false) { + $rootScope.isMousedownOnPaintCanvas = true; + $rootScope.isStartPointDeleted = false; + var annotationCanvas = document.getElementById("canvas"); + $rootScope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left)); + $rootScope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top)); + annotationCanvas.addEventListener('mousemove', $rootScope.OnPaintBrushCanvasMouseMove, false); + } } $rootScope.OnPaintBrushCanvasMouseMove = function (event) { @@ -2576,10 +2587,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } } $rootScope.OnPaintBrushCanvasMouseUp = function (event) { - $rootScope.isMousedownOnPaintCanvas = false; - $rootScope.isEraseToolSelected = false; - $(".btn-annotation-erase").removeClass("activebtncolor"); - + if ($rootScope.isAnnotatiomToolBarPopupClosed == false) { + $rootScope.isMousedownOnPaintCanvas = false; + $rootScope.isEraseToolSelected = false; + $(".btn-annotation-erase").removeClass("activebtncolor"); + } }