Commit 73cd792c6456a47363766ec71c4118a49f2226d2

Authored by Amrita Vishnoi
2 parents 6d6934c4 6bc1bf7b

Against #240 merge request

400-SOURCECODE/AIAHTML5.API/Models/WebApiConfig.cs 0 → 100644
  1 +using System;
  2 +using System.Collections.Generic;
  3 +using System.Linq;
  4 +using System.Web.Http;
  5 +
  6 +namespace AIAHTML5.API
  7 +{
  8 + public static class WebApiConfig
  9 + {
  10 + public static void Register(HttpConfiguration config)
  11 + {
  12 + // Web API configuration and services
  13 +
  14 + // Web API routes
  15 + config.MapHttpAttributeRoutes();
  16 +
  17 + config.Routes.MapHttpRoute(
  18 + name: "DefaultApi",
  19 + routeTemplate: "api/{controller}/{id}",
  20 + defaults: new { id = RouteParameter.Optional }
  21 + );
  22 + }
  23 + }
  24 +}
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -536,31 +536,38 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -536,31 +536,38 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
536 } 536 }
537 537
538 angular.element(document).ready(function (e) { 538 angular.element(document).ready(function (e) {
539 - $("#daImagePanel").resize(function () {  
540 - $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);  
541 - $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);  
542 - }); 539 + $("#daImagePanel").resize(function () {
  540 + $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
  541 + $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
  542 + });
543 543
544 $(document).on("mouseover", "#termList option", function (e) { 544 $(document).on("mouseover", "#termList option", function (e) {
545 $('#termList option[selected="selected"]').attr("selected", false); 545 $('#termList option[selected="selected"]').attr("selected", false);
546 $(this).attr("selected", true); 546 $(this).attr("selected", true);
547 - });  
548 -  
549 - $(document).keypress(function (e) {  
550 - if ($('#termList option[selected="selected"]').attr("id") == "undefined") {  
551 - return false;  
552 - }  
553 - else {  
554 - var originator = e.keyCode || e.which;  
555 - // alert($('#termList option[selected="selected"]').attr("id"));  
556 - if ($('#termList option[selected="selected"]').attr("id")) {  
557 - if (e.keyCode == 13) {  
558 - onListManagerTermSelection($('#termList option[selected="selected"]').attr("id"));  
559 - } 547 + });
  548 +
  549 + $(document).keypress(function (e) {
  550 + if ($('#termList option[selected="selected"]').attr("id") == "undefined") {
  551 + return false;
  552 + }
  553 + else {
  554 + var originator = e.keyCode || e.which;
  555 + // alert($('#termList option[selected="selected"]').attr("id"));
  556 + if ($('#termList option[selected="selected"]').attr("id")) {
  557 + if (e.keyCode == 13) {
  558 + onListManagerTermSelection($('#termList option[selected="selected"]').attr("id"));
560 } 559 }
561 } 560 }
562 - });  
563 - }) 561 + }
  562 + });
  563 + });
  564 +
  565 +
  566 +
  567 +
  568 +
  569 +
  570 +
564 571
565 $scope.loadSearchDataForBodyView = function () { 572 $scope.loadSearchDataForBodyView = function () {
566 573
@@ -777,12 +784,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -777,12 +784,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
777 $scope.modestyImageInfo = []; 784 $scope.modestyImageInfo = [];
778 // annotation toolbar canvas 785 // annotation toolbar canvas
779 if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { 786 if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
780 -  
781 - var $layerChange = $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" ng-click="FreeStylePaint($event)" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="canvas" width="2277" height="3248" class="canvas-annotationStyle"></canvas>'); 787 + var annotationAppendedCanvas = $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="canvas" ng-click="BindCanvasDrawingListners($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
  788 + $compile(annotationAppendedCanvas)($scope);
782 $compile($layerChange)($scope); 789 $compile($layerChange)($scope);
783 $scope.BindCanvasDrawingListners(); 790 $scope.BindCanvasDrawingListners();
784 // $rootScope.FreeStylePaint(); 791 // $rootScope.FreeStylePaint();
785 - 792 +
786 } 793 }
787 794
788 795
@@ -2986,6 +2993,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2986,6 +2993,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2986 2993
2987 //$(".com").css("display", "none"); 2994 //$(".com").css("display", "none");
2988 //$("#bord").css({ "width": "0px", "display": "none" }); 2995 //$("#bord").css({ "width": "0px", "display": "none" });
  2996 +
  2997 + //history maintained issue
  2998 +
  2999 +
  3000 +
  3001 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  3002 + $("#sppeachBubble").remove();
  3003 + $("#dot").remove();
  3004 + }
  3005 +
  3006 +
  3007 +
2989 $(".com").remove(); 3008 $(".com").remove();
2990 $("#bord").remove(); 3009 $("#bord").remove();
2991 3010
@@ -3088,6 +3107,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3088,6 +3107,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3088 document.getElementById('sppeachBubble').style.left = (Globe[0].currentX) + 'px'; 3107 document.getElementById('sppeachBubble').style.left = (Globe[0].currentX) + 'px';
3089 document.getElementById('sppeachBubble').style.top = (Globe[0].currentY) + 'px'; 3108 document.getElementById('sppeachBubble').style.top = (Globe[0].currentY) + 'px';
3090 3109
  3110 +
  3111 +
  3112 + //history maintained issue
  3113 +
  3114 +
  3115 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { document.getElementById('sppeachBubble').style.zIndex = "100000000000"; }
  3116 +
  3117 +
  3118 +
3091 $('#sppeachBubble').draggable( 3119 $('#sppeachBubble').draggable(
3092 { 3120 {
3093 drag: function (evt) { 3121 drag: function (evt) {
@@ -3872,7 +3900,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3872,7 +3900,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3872 3900
3873 function mouseUpListener(e) { 3901 function mouseUpListener(e) {
3874 // $selection.remove(); 3902 // $selection.remove();
3875 - // debugger; 3903 +
3876 3904
3877 //alert('mouse up'); 3905 //alert('mouse up');
3878 console.log('MOUSE UP'); 3906 console.log('MOUSE UP');
@@ -3928,7 +3956,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3928,7 +3956,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3928 var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; 3956 var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
3929 3957
3930 $scope.IncludedBodyRegions = []; 3958 $scope.IncludedBodyRegions = [];
3931 - ////debugger; 3959 +
3932 $.each(BodyRegionDictionary, function (index, value) { 3960 $.each(BodyRegionDictionary, function (index, value) {
3933 // alert(' $.each(BodyRegionDictionary1') 3961 // alert(' $.each(BodyRegionDictionary1')
3934 var transparencyBoxHeight = parseInt(TransparencyBoxEndY) - parseInt($scope.TransparencyBoxStartY); 3962 var transparencyBoxHeight = parseInt(TransparencyBoxEndY) - parseInt($scope.TransparencyBoxStartY);
@@ -4645,6 +4673,107 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4645,6 +4673,107 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4645 //} 4673 //}
4646 } 4674 }
4647 4675
  4676 + // History Maintained Issue/////////////////
  4677 +
  4678 + $rootScope.DrawingListners_Canvas = function (event) {
  4679 +
  4680 +
  4681 + var canvasDiv = document.getElementById('canvasDiv');
  4682 + var verticalScrollPosition = canvasDiv.scrollTop;
  4683 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  4684 +
  4685 +
  4686 + $rootScope.Xaxis = event.pageX - $('#canvasDiv').offset().left + horizontlScrollPosition;
  4687 + $rootScope.Yaxis = event.pageY - $('#canvasDiv').offset().top + verticalScrollPosition;
  4688 +
  4689 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
  4690 +
  4691 + $.each(BodyRegionDictionary, function (index, value) {
  4692 + var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
  4693 + var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
  4694 + if ($rootScope.Xaxis <= bodyRegionRight && $rootScope.Yaxis <= bodyRegionBottom && value.X <= $rootScope.Xaxis && value.Y <= $rootScope.Yaxis) {
  4695 + $rootScope.MaskedCanvasIDForAnnotation = value.bodyRegionId;
  4696 + $rootScope.MaskedCanvasXForAnotation = value.X;
  4697 + $rootScope.MaskedCanvasYForAnotation = value.Y;
  4698 + $rootScope.MaskedCanvasMrImageForAnotation = value.IsMirror;
  4699 + return false;
  4700 + }
  4701 + });
  4702 + if ($rootScope.MaskedCanvasMrImageForAnotation == "No") {
  4703 + var maskCanvasIdForAnnotation = "imageCanvas" + $rootScope.MaskedCanvasIDForAnnotation + "_mci";
  4704 + var maskCanvas = document.getElementById(maskCanvasIdForAnnotation);
  4705 + var maskCanvasContext = maskCanvas.getContext("2d");
  4706 + var canvasDiv = document.getElementById('canvasDiv');
  4707 + var verticalScrollPosition = canvasDiv.scrollTop;
  4708 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  4709 + var actulalX = $rootScope.Xaxis;
  4710 + var actualY = $rootScope.Yaxis;
  4711 + var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, $rootScope.MaskedCanvasXForAnotation, $rootScope.MaskedCanvasYForAnotation);
  4712 + var annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  4713 +
  4714 + }
  4715 + else {
  4716 + // debugger;
  4717 + var maskCanvasIdForAnnotation = "imageCanvas" + $rootScope.MaskedCanvasIDForAnnotation + "_MR_mci";
  4718 + var maskoffsetval = $('#' + maskCanvasIdForAnnotation).offset();
  4719 + var mirrorCanvasX = maskoffsetval.left;
  4720 + //alert(mirrorCanvasX);
  4721 + var mirrorImageCanvas = document.getElementById(maskCanvasIdForAnnotation);
  4722 + var mirrorCanvasWidth = mirrorImageCanvas.clientWidth;
  4723 + // alert(mirrorCanvasWidth);
  4724 + var maskCanvas = document.getElementById(maskCanvasIdForAnnotation);
  4725 + var maskCanvasContext = maskCanvas.getContext("2d");
  4726 +
  4727 + var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(event.pageX) + horizontlScrollPosition);// - 135);
  4728 + var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
  4729 + var actulalX = mirrorXOnNormalImage;
  4730 + var actualY = event.pageY + verticalScrollPosition;
  4731 + var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - $rootScope.MaskedCanvasYForAnotation), 1, 1);
  4732 + pixelData.data[0] = pixelData.data[0] - 9;
  4733 + pixelData.data[1] = pixelData.data[1] - 9;
  4734 + pixelData.data[2] = pixelData.data[2] - 9
  4735 + var Red;
  4736 + var Green;
  4737 + var Blue;
  4738 + var zero = "0";
  4739 + if ((pixelData.data[0]).toString().length != 2) {
  4740 + Red = zero.concat((pixelData.data[0]).toString())
  4741 + }
  4742 + else {
  4743 + Red = (pixelData.data[0]).toString()
  4744 + }
  4745 + if ((pixelData.data[1]).toString().length != 2) {
  4746 + Green = zero.concat((pixelData.data[1]).toString())
  4747 + }
  4748 + else {
  4749 + Green = (pixelData.data[1]).toString()
  4750 + }
  4751 + if ((pixelData.data[2]).toString().length != 2) {
  4752 + Blue = zero.concat((pixelData.data[2]).toString())
  4753 + }
  4754 + else {
  4755 + Blue = (pixelData.data[2]).toString()
  4756 + }
  4757 + var RGBColor = (Red + Green + Blue);
  4758 + // alert(RGBColor);
  4759 + //$rootScope.previousHighlightList.push(RGBColor);
  4760 +
  4761 + }
  4762 +
  4763 + // var maskCanvasIdForAnnotation = "imageCanvas" + $rootScope.MaskedCanvasIDForAnnotation + "_mci";
  4764 +
  4765 + // alert(annotationText);
  4766 + $scope.MultiLanguageAnnationArray = [];
  4767 + $scope.MultiLanguageAnnationArray.push(annotationText);
  4768 + if (annotationText == "undefined") {
  4769 + }
  4770 + else {
  4771 + $scope.createDynamicSpeechBubble(event, event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true)
  4772 + }
  4773 +
  4774 +
  4775 + }
  4776 +
4648 4777
4649 4778
4650 function resizeCanvas() { 4779 function resizeCanvas() {
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -169,6 +169,9 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -169,6 +169,9 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
169 $rootScope.isFontFamilyLoaded = false; 169 $rootScope.isFontFamilyLoaded = false;
170 //annotation tool custom events 170 //annotation tool custom events
171 $rootScope.ShowAnnotationWindow = function () { 171 $rootScope.ShowAnnotationWindow = function () {
  172 +
  173 + // $rootScope.isAnnotaionToolBarDrawingModeActive == true;
  174 +
172 //7904 175 //7904
173 if ($rootScope.MenuModuleName == "DA") { 176 if ($rootScope.MenuModuleName == "DA") {
174 if ($rootScope.disableAnnotationtoolOnListManager == true) { 177 if ($rootScope.disableAnnotationtoolOnListManager == true) {
@@ -198,8 +201,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -198,8 +201,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
198 $rootScope.isAnnotationWindowOpen = true; 201 $rootScope.isAnnotationWindowOpen = true;
199 $(".annotationTollbar").css("display", "block"); 202 $(".annotationTollbar").css("display", "block");
200 $rootScope.$broadcast('annotationToolEvent', true); 203 $rootScope.$broadcast('annotationToolEvent', true);
201 - $("#canvasPaint").css("display", "none");  
202 - $("#canvas").css("display", "none"); 204 + // $("#canvasPaint").css("display", "none");
  205 + // $("#canvas").css("display", "none");
203 206
204 var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json'; 207 var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json';
205 if ($rootScope.isFontFamilyLoaded == false) { 208 if ($rootScope.isFontFamilyLoaded == false) {
@@ -240,10 +243,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -240,10 +243,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
240 243
241 $(".annotationTollbar").css("display", "none"); 244 $(".annotationTollbar").css("display", "none");
242 $rootScope.isAnnotationWindowClose = true; 245 $rootScope.isAnnotationWindowClose = true;
243 - $("#canvasPaint").css("display", "none");  
244 - $("#canvas").css("display", "none"); 246 + // $("#canvasPaint").css("display", "none");
  247 + // $("#canvas").css("display", "none");
245 $('.btnCursor').removeClass('activebtncolor'); 248 $('.btnCursor').removeClass('activebtncolor');
246 $(".btn-annotation").removeClass("activebtncolor"); 249 $(".btn-annotation").removeClass("activebtncolor");
  250 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
247 } 251 }
248 $rootScope.CIAnotationIdentifyModeOff = false; 252 $rootScope.CIAnotationIdentifyModeOff = false;
249 $rootScope.OnIdentifyClick = function () { 253 $rootScope.OnIdentifyClick = function () {
@@ -257,25 +261,27 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -257,25 +261,27 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
257 $('.btnCursor').removeClass('activebtncolor'); 261 $('.btnCursor').removeClass('activebtncolor');
258 262
259 } else { 263 } else {
260 - $("#canvasPaint").css("display", "none");  
261 - $("#canvas").css("display", "none"); 264 + // $("#canvasPaint").css("display", "none");
  265 + // $("#canvas").css("display", "none");
262 266
263 // $("#canvasPaint").css("z-index", "0"); 267 // $("#canvasPaint").css("z-index", "0");
264 // $("#canvas").css("z-index", "0"); 268 // $("#canvas").css("z-index", "0");
265 $('.btnCursor').removeClass('activebtncolor'); 269 $('.btnCursor').removeClass('activebtncolor');
266 270
267 } 271 }
  272 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
268 } 273 }
269 274
270 275
271 276
272 $rootScope.DrawingMode = function () { 277 $rootScope.DrawingMode = function () {
  278 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
273 $("#OnIdentify").removeClass("annotationtoolbartab"); 279 $("#OnIdentify").removeClass("annotationtoolbartab");
274 $("#DrawMode").addClass("annotationtoolbartab"); 280 $("#DrawMode").addClass("annotationtoolbartab");
275 $('.btnCursor').addClass('activebtncolor'); 281 $('.btnCursor').addClass('activebtncolor');
276 $rootScope.switchCanvas(); 282 $rootScope.switchCanvas();
277 - $("#canvasPaint").css("display", "block");  
278 - $("#canvas").css("display", "block"); 283 + // $("#canvasPaint").css("display", "block");
  284 + // $("#canvas").css("display", "block");
279 285
280 } 286 }
281 287
@@ -563,6 +569,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -563,6 +569,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
563 x2: x, y2: y, 569 x2: x, y2: y,
564 570
565 click: function (layer) { 571 click: function (layer) {
  572 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  573 + layer.draggable = true;
566 $rootScope.canvasLayerNameCollection = []; 574 $rootScope.canvasLayerNameCollection = [];
567 $rootScope.canvasLayerNameCollection.push(layer.name); 575 $rootScope.canvasLayerNameCollection.push(layer.name);
568 $(canvasId).setLayer(layer.name, { 576 $(canvasId).setLayer(layer.name, {
@@ -574,10 +582,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -574,10 +582,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
574 radius: 3 582 radius: 3
575 } 583 }
576 }).drawLayers(); 584 }).drawLayers();
577 - 585 + }
  586 + else {
  587 + layer.draggable = false;
  588 + }
578 589
579 }, 590 },
580 mouseout: function (layer) { 591 mouseout: function (layer) {
  592 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  593 + layer.draggable = true;
581 $rootScope.canvasLayerNameCollection = []; 594 $rootScope.canvasLayerNameCollection = [];
582 $(canvasId).setLayer(layer.name, { 595 $(canvasId).setLayer(layer.name, {
583 handle: { 596 handle: {
@@ -589,10 +602,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -589,10 +602,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
589 } 602 }
590 603
591 }).drawLayers(); 604 }).drawLayers();
592 - 605 + }
  606 + else {
  607 + layer.draggable = false;
  608 + }
593 }, 609 },
594 mouseover: function (layer) { 610 mouseover: function (layer) {
595 - 611 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  612 + layer.draggable = true;
596 613
597 $(canvasId).setLayer(layer.name, { 614 $(canvasId).setLayer(layer.name, {
598 handle: { 615 handle: {
@@ -605,6 +622,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -605,6 +622,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
605 }).drawLayers(); 622 }).drawLayers();
606 623
607 } 624 }
  625 + else {
  626 + layer.draggable = false;
  627 + }
  628 + }
608 629
609 }).drawLayers(); 630 }).drawLayers();
610 631
@@ -640,6 +661,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -640,6 +661,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
640 }, 661 },
641 662
642 click: function (layer) { 663 click: function (layer) {
  664 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  665 + layer.draggable = true;
643 $rootScope.canvasLayerNameCollection = []; 666 $rootScope.canvasLayerNameCollection = [];
644 $rootScope.canvasLayerNameCollection.push(layer.name); 667 $rootScope.canvasLayerNameCollection.push(layer.name);
645 $(canvasId).setLayer(layer.name, { 668 $(canvasId).setLayer(layer.name, {
@@ -652,9 +675,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -652,9 +675,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
652 cornerRadius: 3 675 cornerRadius: 3
653 } 676 }
654 }).drawLayers(); 677 }).drawLayers();
655 - 678 + }
  679 + else {
  680 + layer.draggable = false;
  681 + }
656 }, 682 },
657 mouseout: function (layer) { 683 mouseout: function (layer) {
  684 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  685 + layer.draggable = true;
658 $rootScope.canvasLayerNameCollection = []; 686 $rootScope.canvasLayerNameCollection = [];
659 $(canvasId).setLayer(layer.name, { 687 $(canvasId).setLayer(layer.name, {
660 handle: { 688 handle: {
@@ -667,11 +695,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -667,11 +695,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
667 } 695 }
668 696
669 }).drawLayers(); 697 }).drawLayers();
670 - 698 + }
  699 + else {
  700 + layer.draggable = false;
  701 + }
671 }, 702 },
672 mouseover: function (layer) { 703 mouseover: function (layer) {
673 704
674 - 705 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  706 + layer.draggable = true;
675 $(canvasId).setLayer(layer.name, { 707 $(canvasId).setLayer(layer.name, {
676 handle: { 708 handle: {
677 type: 'rectangle', 709 type: 'rectangle',
@@ -682,7 +714,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -682,7 +714,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
682 cornerRadius: 3 714 cornerRadius: 3
683 } 715 }
684 }).drawLayers(); 716 }).drawLayers();
685 - 717 + }
  718 + else {
  719 + layer.draggable = false;
  720 + }
686 } 721 }
687 }).drawLayers(); 722 }).drawLayers();
688 } 723 }
@@ -712,6 +747,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -712,6 +747,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
712 resizeFromCenter: false, 747 resizeFromCenter: false,
713 handlePlacement: 'both', 748 handlePlacement: 'both',
714 click: function (layer) { 749 click: function (layer) {
  750 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  751 + layer.draggable = true;
715 $rootScope.canvasLayerNameCollection = []; 752 $rootScope.canvasLayerNameCollection = [];
716 $rootScope.canvasLayerNameCollection.push(layer.name); 753 $rootScope.canvasLayerNameCollection.push(layer.name);
717 $(canvasId).setLayer(layer.name, { 754 $(canvasId).setLayer(layer.name, {
@@ -723,11 +760,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -723,11 +760,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
723 radius: 3 760 radius: 3
724 } 761 }
725 }).drawLayers(); 762 }).drawLayers();
726 - 763 + }
  764 + else {
  765 + layer.draggable = false;
  766 + }
727 }, 767 },
728 mouseout: function (layer) { 768 mouseout: function (layer) {
  769 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  770 + layer.draggable = true;
729 $rootScope.canvasLayerNameCollection = []; 771 $rootScope.canvasLayerNameCollection = [];
730 -  
731 $(canvasId).setLayer(layer.name, { 772 $(canvasId).setLayer(layer.name, {
732 handle: { 773 handle: {
733 type: 'arc', 774 type: 'arc',
@@ -740,9 +781,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -740,9 +781,15 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
740 781
741 }).drawLayers(); 782 }).drawLayers();
742 783
  784 + }
  785 +
  786 + else {
  787 + layer.draggable = false;
  788 + }
743 }, 789 },
744 mouseover: function (layer) { 790 mouseover: function (layer) {
745 - 791 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  792 + layer.draggable = true;
746 793
747 $(canvasId).setLayer(layer.name, { 794 $(canvasId).setLayer(layer.name, {
748 handle: { 795 handle: {
@@ -754,8 +801,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -754,8 +801,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
754 radius: 3 801 radius: 3
755 } 802 }
756 }).drawLayers(); 803 }).drawLayers();
757 -  
758 } 804 }
  805 + else {
  806 + layer.draggable = false;
  807 + }
  808 + }
  809 +
759 }).drawLayers(); 810 }).drawLayers();
760 } 811 }
761 $('.btnCursor').trigger('click'); 812 $('.btnCursor').trigger('click');
@@ -780,6 +831,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -780,6 +831,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
780 x2: x, y2: y, 831 x2: x, y2: y,
781 832
782 click: function (layer) { 833 click: function (layer) {
  834 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  835 + layer.draggable = true;
783 $rootScope.canvasLayerNameCollection = []; 836 $rootScope.canvasLayerNameCollection = [];
784 $rootScope.canvasLayerNameCollection.push(layer.name); 837 $rootScope.canvasLayerNameCollection.push(layer.name);
785 $(canvasId).setLayer(layer.name, { 838 $(canvasId).setLayer(layer.name, {
@@ -793,9 +846,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -793,9 +846,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
793 } 846 }
794 }).drawLayers(); 847 }).drawLayers();
795 // $("#canvas").removeLayer(layer.name).drawLayers(); 848 // $("#canvas").removeLayer(layer.name).drawLayers();
796 - 849 + }
  850 + else {
  851 + layer.draggable = false;
  852 + }
797 }, 853 },
798 mouseout: function (layer) { 854 mouseout: function (layer) {
  855 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  856 + layer.draggable = true;
799 $rootScope.canvasLayerNameCollection = []; 857 $rootScope.canvasLayerNameCollection = [];
800 $(canvasId).setLayer(layer.name, { 858 $(canvasId).setLayer(layer.name, {
801 handle: { 859 handle: {
@@ -808,10 +866,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -808,10 +866,14 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
808 } 866 }
809 867
810 }).drawLayers(); 868 }).drawLayers();
811 - 869 + }
  870 + else {
  871 + layer.draggable = false;
  872 + }
812 }, 873 },
813 mouseover: function (layer) { 874 mouseover: function (layer) {
814 - 875 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  876 + layer.draggable = true;
815 877
816 $(canvasId).setLayer(layer.name, { 878 $(canvasId).setLayer(layer.name, {
817 handle: { 879 handle: {
@@ -825,6 +887,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -825,6 +887,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
825 }).drawLayers(); 887 }).drawLayers();
826 888
827 } 889 }
  890 + else {
  891 + layer.draggable = false;
  892 + }
  893 +
  894 + }
828 895
829 }); 896 });
830 } 897 }
@@ -838,6 +905,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -838,6 +905,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
838 905
839 if ($rootScope.isPinPreviewCompleted == true) { 906 if ($rootScope.isPinPreviewCompleted == true) {
840 $rootScope.isPinPreviewCompleted = false; 907 $rootScope.isPinPreviewCompleted = false;
  908 + if (xAxisPinDiff != 0 && yAxisPinDiff != 0) {
841 var radial = $('#canvas').createGradient({ 909 var radial = $('#canvas').createGradient({
842 x1: 50, y1: 50, 910 x1: 50, y1: 50,
843 x2: 50, y2: 50, 911 x2: 50, y2: 50,
@@ -857,59 +925,71 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -857,59 +925,71 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
857 x2: x, y2: y, 925 x2: x, y2: y,
858 926
859 click: function (layer) { 927 click: function (layer) {
860 -  
861 - $rootScope.shapeTypePin = "Pin";  
862 - $rootScope.canvasLayerNameCollection = [];  
863 - var pinLine_layer = layer.name;  
864 - var pinLine_layer_split = pinLine_layer.split("_");  
865 - var pinArcName = "ArcPin_";  
866 - var pinResult = pinArcName.concat(pinLine_layer_split[1]);  
867 -  
868 - $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult });  
869 -  
870 - $(canvasId).setLayer(layer.name, {  
871 - handle: {  
872 - type: 'arc',  
873 - fillStyle: '#fff',  
874 - strokeStyle: '#c33',  
875 - strokeWidth: 2,  
876 - // width: 5, height: 5,  
877 - radius: 3  
878 - }  
879 - }).drawLayers();  
880 -  
881 - 928 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  929 + layer.draggable = true;
  930 + $rootScope.shapeTypePin = "Pin";
  931 + $rootScope.canvasLayerNameCollection = [];
  932 + var pinLine_layer = layer.name;
  933 + var pinLine_layer_split = pinLine_layer.split("_");
  934 + var pinArcName = "ArcPin_";
  935 + var pinResult = pinArcName.concat(pinLine_layer_split[1]);
  936 +
  937 + $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult });
  938 +
  939 + $(canvasId).setLayer(layer.name, {
  940 + handle: {
  941 + type: 'arc',
  942 + fillStyle: '#fff',
  943 + strokeStyle: '#c33',
  944 + strokeWidth: 2,
  945 + // width: 5, height: 5,
  946 + radius: 3
  947 + }
  948 + }).drawLayers();
  949 +
  950 + }
  951 + else {
  952 + layer.draggable = false;
  953 + }
882 }, 954 },
883 mouseout: function (layer) { 955 mouseout: function (layer) {
884 -  
885 - $rootScope.canvasLayerNameCollection = [];  
886 - $(canvasId).setLayer(layer.name, {  
887 - handle: {  
888 - type: 'arc',  
889 - fillStyle: '#fff',  
890 - strokeStyle: '#c33',  
891 - strokeWidth: 0,  
892 - // width: 0, height: 0,  
893 - radius: 0  
894 - }  
895 -  
896 - }).drawLayers();  
897 - 956 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  957 + layer.draggable = true;
  958 + $rootScope.canvasLayerNameCollection = [];
  959 + $(canvasId).setLayer(layer.name, {
  960 + handle: {
  961 + type: 'arc',
  962 + fillStyle: '#fff',
  963 + strokeStyle: '#c33',
  964 + strokeWidth: 0,
  965 + // width: 0, height: 0,
  966 + radius: 0
  967 + }
  968 +
  969 + }).drawLayers();
  970 + }
  971 + else {
  972 + layer.draggable = false;
  973 + }
898 }, 974 },
899 mouseover: function (layer) { 975 mouseover: function (layer) {
900 976
901 -  
902 - $(canvasId).setLayer(layer.name, {  
903 - handle: {  
904 - type: 'arc',  
905 - fillStyle: '#fff',  
906 - strokeStyle: '#c33',  
907 - strokeWidth: 2,  
908 - // width: 5, height: 5,  
909 - radius: 3  
910 - }  
911 - }).drawLayers();  
912 - 977 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  978 + layer.draggable = true;
  979 + $(canvasId).setLayer(layer.name, {
  980 + handle: {
  981 + type: 'arc',
  982 + fillStyle: '#fff',
  983 + strokeStyle: '#c33',
  984 + strokeWidth: 2,
  985 + // width: 5, height: 5,
  986 + radius: 3
  987 + }
  988 + }).drawLayers();
  989 + }
  990 + else {
  991 + layer.draggable = false;
  992 + }
913 } 993 }
914 }).drawArc({ 994 }).drawArc({
915 draggable: true, 995 draggable: true,
@@ -945,6 +1025,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -945,6 +1025,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
945 $rootScope.TextEditorFunctionality = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { 1025 $rootScope.TextEditorFunctionality = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) {
946 if ($rootScope.isTextAreaPreviewCompleted == true) { 1026 if ($rootScope.isTextAreaPreviewCompleted == true) {
947 $rootScope.isTextAreaPreviewCompleted = false; 1027 $rootScope.isTextAreaPreviewCompleted = false;
  1028 + // debugger;
948 $('#canvas').drawText({ 1029 $('#canvas').drawText({
949 layer: true, 1030 layer: true,
950 draggable: true, 1031 draggable: true,
@@ -990,85 +1071,102 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -990,85 +1071,102 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
990 1071
991 }, 1072 },
992 click: function (layer) { 1073 click: function (layer) {
993 -  
994 - $rootScope.canvasLayerNameCollection = [];  
995 - $rootScope.canvasLayerNameCollection.push(layer.name);  
996 - $('#canvas').setLayer(layer.name, {  
997 - handle: {  
998 - type: 'rectangle',  
999 - fillStyle: '#fff',  
1000 - strokeStyle: '#c33',  
1001 - strokeWidth: 2,  
1002 - width: 5, height: 5,  
1003 - cornerRadius: 3  
1004 - }  
1005 - }).drawLayers();  
1006 - 1074 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1075 + layer.draggable = true;
  1076 + $rootScope.canvasLayerNameCollection = [];
  1077 + $rootScope.canvasLayerNameCollection.push(layer.name);
  1078 + $('#canvas').setLayer(layer.name, {
  1079 + handle: {
  1080 + type: 'rectangle',
  1081 + fillStyle: '#fff',
  1082 + strokeStyle: '#c33',
  1083 + strokeWidth: 2,
  1084 + width: 5, height: 5,
  1085 + cornerRadius: 3
  1086 + }
  1087 + }).drawLayers();
  1088 + }
  1089 + else {
  1090 + layer.draggable = false;
  1091 + }
1007 }, 1092 },
1008 dblclick: function (layer) { 1093 dblclick: function (layer) {
  1094 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1095 + layer.draggable = true;
  1096 + $rootScope.IsTextAlreadySave = false;
  1097 + var RectNameArray = (layer.name).split("_");
1009 1098
1010 - $rootScope.IsTextAlreadySave = false;  
1011 - var RectNameArray = (layer.name).split("_"); 1099 + var TextAreaRectangleName = "TextArea_";
  1100 + var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
  1101 + $rootScope.TextAreaRectID = layer.name;
  1102 + $rootScope.TextID = TextAreaRectNameConcat;
1012 1103
1013 - var TextAreaRectangleName = "TextArea_";  
1014 - var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);  
1015 - $rootScope.TextAreaRectID = layer.name;  
1016 - $rootScope.TextID = TextAreaRectNameConcat;  
1017 -  
1018 - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });  
1019 - $("#annotationTextModal").css("padding-right", "0px");  
1020 - document.getElementById('modelbackground').style.display = "block";  
1021 - $("#annotationTextModal").modal("toggle");  
1022 -  
1023 - $("#text_area").val('');  
1024 - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });  
1025 - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });  
1026 - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); 1104 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  1105 + $("#annotationTextModal").css("padding-right", "0px");
  1106 + document.getElementById('modelbackground').style.display = "block";
  1107 + $("#annotationTextModal").modal("toggle");
1027 1108
1028 - $("#selected-font-family option:eq(0)").prop('selected', true);  
1029 - $("#selected-font-size option:eq(0)").prop('selected', true); 1109 + $("#text_area").val('');
  1110 + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  1111 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  1112 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1030 1113
1031 - $("#text-italic").removeClass("ActiveFormattingButtonClass"); 1114 + $("#selected-font-family option:eq(0)").prop('selected', true);
  1115 + $("#selected-font-size option:eq(0)").prop('selected', true);
1032 1116
1033 - $("#text-bold").removeClass("ActiveFormattingButtonClass"); 1117 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
1034 1118
1035 - $("#text-underline").removeClass("ActiveFormattingButtonClass"); 1119 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
1036 1120
1037 - $("#text-left").removeClass("ActiveFormattingButtonClass"); 1121 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
1038 1122
1039 - $("#text-right").removeClass("ActiveFormattingButtonClass"); 1123 + $("#text-left").removeClass("ActiveFormattingButtonClass");
1040 1124
1041 - $("#text-center").removeClass("ActiveFormattingButtonClass"); 1125 + $("#text-right").removeClass("ActiveFormattingButtonClass");
1042 1126
  1127 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  1128 + }
  1129 + else {
  1130 + layer.draggable = false;
  1131 + }
1043 }, 1132 },
1044 mouseout: function (layer) { 1133 mouseout: function (layer) {
1045 - $rootScope.canvasLayerNameCollection = [];  
1046 - $('#canvas').setLayer(layer.name, {  
1047 - handle: {  
1048 - type: 'rectangle',  
1049 - fillStyle: 'pink',  
1050 - strokeStyle: 'yellow',  
1051 - strokeWidth: 0,  
1052 - width: 0, height: 0,  
1053 - cornerRadius: 0  
1054 - }  
1055 -  
1056 - }).drawLayers(); 1134 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1135 + layer.draggable = true;
  1136 + $rootScope.canvasLayerNameCollection = [];
  1137 + $('#canvas').setLayer(layer.name, {
  1138 + handle: {
  1139 + type: 'rectangle',
  1140 + fillStyle: 'pink',
  1141 + strokeStyle: 'yellow',
  1142 + strokeWidth: 0,
  1143 + width: 0, height: 0,
  1144 + cornerRadius: 0
  1145 + }
1057 1146
  1147 + }).drawLayers();
  1148 + }
  1149 + else {
  1150 + layer.draggable = false;
  1151 + }
1058 }, 1152 },
1059 mouseover: function (layer) { 1153 mouseover: function (layer) {
1060 -  
1061 - $('#canvas').setLayer(layer.name, {  
1062 - handle: {  
1063 - type: 'rectangle',  
1064 - fillStyle: '#fff',  
1065 - strokeStyle: '#c33',  
1066 - strokeWidth: 2,  
1067 - width: 5, height: 5,  
1068 - cornerRadius: 3  
1069 - }  
1070 - }).drawLayers();  
1071 - 1154 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1155 + layer.draggable = true;
  1156 + $('#canvas').setLayer(layer.name, {
  1157 + handle: {
  1158 + type: 'rectangle',
  1159 + fillStyle: '#fff',
  1160 + strokeStyle: '#c33',
  1161 + strokeWidth: 2,
  1162 + width: 5, height: 5,
  1163 + cornerRadius: 3
  1164 + }
  1165 + }).drawLayers();
  1166 + }
  1167 + else {
  1168 + layer.draggable = false;
  1169 + }
1072 } 1170 }
1073 }); 1171 });
1074 1172
@@ -1175,42 +1273,54 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1175,42 +1273,54 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1175 $rootScope.clicked = false; 1273 $rootScope.clicked = false;
1176 $rootScope.x = 0; 1274 $rootScope.x = 0;
1177 $rootScope.y = 0; 1275 $rootScope.y = 0;
1178 - var canvasDiv = document.getElementById('canvasDiv');  
1179 - var verticalScrollPosition = canvasDiv.scrollTop;  
1180 - var horizontlScrollPosition = canvasDiv.scrollLeft; 1276 +
  1277 + $rootScope.x = parseInt(event.clientX - ($("#canvas").offset().left));
  1278 + $rootScope.y = parseInt(event.clientY - ($("#canvas").offset().top));
1181 $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left; 1279 $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left;
1182 $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top; 1280 $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top;
1183 var canvasElement = document.getElementById("canvas"); 1281 var canvasElement = document.getElementById("canvas");
1184 var ctx = canvasElement.getContext("2d"); 1282 var ctx = canvasElement.getContext("2d");
  1283 +
1185 var canvasPaintElement = document.getElementById("canvasPaint"); 1284 var canvasPaintElement = document.getElementById("canvasPaint");
1186 var PaintCanvasctx = canvasPaintElement.getContext("2d"); 1285 var PaintCanvasctx = canvasPaintElement.getContext("2d");
  1286 +
  1287 +
1187 switch ($rootScope.shapeType) { 1288 switch ($rootScope.shapeType) {
  1289 +
1188 case "cursor": 1290 case "cursor":
  1291 + // ctx.clearRect(0, 0, 2277, 3248);
1189 ctx.beginPath(); 1292 ctx.beginPath();
1190 PaintCanvasctx.beginPath(); 1293 PaintCanvasctx.beginPath();
  1294 +
  1295 +
1191 break; 1296 break;
1192 case "Line": 1297 case "Line":
  1298 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1193 $rootScope.LineNumber = $rootScope.ObjectIndex++; 1299 $rootScope.LineNumber = $rootScope.ObjectIndex++;
1194 // $rootScope.isLinePreviewCompleted = true; 1300 // $rootScope.isLinePreviewCompleted = true;
1195 $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) 1301 $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y)
1196 break; 1302 break;
1197 case "Rectangle": 1303 case "Rectangle":
  1304 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1198 $rootScope.rectNumber = $rootScope.ObjectIndex++; 1305 $rootScope.rectNumber = $rootScope.ObjectIndex++;
1199 // $rootScope.isRectanglePreviewCompleted = true; 1306 // $rootScope.isRectanglePreviewCompleted = true;
1200 $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); 1307 $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
1201 1308
1202 break; 1309 break;
1203 case "Circle": 1310 case "Circle":
  1311 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1204 $rootScope.CircleNumber = $rootScope.ObjectIndex++; 1312 $rootScope.CircleNumber = $rootScope.ObjectIndex++;
1205 // $rootScope.isCirclePreviewCompleted = true; 1313 // $rootScope.isCirclePreviewCompleted = true;
1206 $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); 1314 $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
1207 break; 1315 break;
1208 case "Arrow": 1316 case "Arrow":
  1317 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1209 $rootScope.ArrowNumber = $rootScope.ObjectIndex++; 1318 $rootScope.ArrowNumber = $rootScope.ObjectIndex++;
1210 //$rootScope.isArrowPreviewCompleted = true; 1319 //$rootScope.isArrowPreviewCompleted = true;
1211 $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); 1320 $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
1212 break; 1321 break;
1213 case "Pin": 1322 case "Pin":
  1323 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1214 $rootScope.PinNumber = $rootScope.PinObjectIndex++; 1324 $rootScope.PinNumber = $rootScope.PinObjectIndex++;
1215 $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++; 1325 $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++;
1216 1326
@@ -1219,6 +1329,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1219,6 +1329,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1219 $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); 1329 $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber);
1220 break; 1330 break;
1221 case "TextArea": 1331 case "TextArea":
  1332 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1222 $rootScope.IsTextAlreadySave = false; 1333 $rootScope.IsTextAlreadySave = false;
1223 $("#text_area").val(''); 1334 $("#text_area").val('');
1224 // Draw text 1335 // Draw text
@@ -1228,6 +1339,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1228,6 +1339,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1228 $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); 1339 $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y);
1229 break; 1340 break;
1230 case "DrawPolygon": 1341 case "DrawPolygon":
  1342 + // $rootScope.isAnnotaionToolBarDrawingModeActive = false;
1231 break; 1343 break;
1232 1344
1233 } 1345 }
@@ -1307,7 +1419,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1307,7 +1419,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1307 1419
1308 ///----- 1420 ///-----
1309 $rootScope.saveText = function () { 1421 $rootScope.saveText = function () {
1310 - 1422 +
1311 document.getElementById('modelbackground').style.display = "none"; 1423 document.getElementById('modelbackground').style.display = "none";
1312 // this part will work first time when save button will be clicked 1424 // this part will work first time when save button will be clicked
1313 if ($rootScope.IsTextAlreadySave == false) { 1425 if ($rootScope.IsTextAlreadySave == false) {
@@ -1341,8 +1453,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1341,8 +1453,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1341 strokeWidth: 0, 1453 strokeWidth: 0,
1342 text: $rootScope.textArea, 1454 text: $rootScope.textArea,
1343 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, 1455 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
1344 - maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,  
1345 - maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 1456 + //maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
  1457 + // maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1346 add: function (layer) { 1458 add: function (layer) {
1347 1459
1348 //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); 1460 //$rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
@@ -1365,186 +1477,223 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1365,186 +1477,223 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1365 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 1477 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1366 resizeFromCenter: false, 1478 resizeFromCenter: false,
1367 click: function (layer) { 1479 click: function (layer) {
1368 - $rootScope.shapeTypeText = "textAreaRect";  
1369 -  
1370 - var layerNameSplit = layer.name;  
1371 - var splitedName = layerNameSplit.split("_");  
1372 - var textValName = "TextAreaNew_";  
1373 - var concatinateResult = textValName.concat(splitedName[1]);  
1374 - $rootScope.canvasLayerNameCollection = [];  
1375 - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });  
1376 - $('#canvas').setLayer(layer.name, {  
1377 - handle: {  
1378 - type: 'rectangle',  
1379 - fillStyle: '#fff',  
1380 - strokeStyle: '#c33',  
1381 - strokeWidth: 2,  
1382 - width: 5, height: 5,  
1383 - cornerRadius: 3  
1384 - }  
1385 - }).drawLayers(); 1480 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1481 + layer.draggable = true;
  1482 + $rootScope.shapeTypeText = "textAreaRect";
  1483 +
  1484 + var layerNameSplit = layer.name;
  1485 + var splitedName = layerNameSplit.split("_");
  1486 + var textValName = "TextAreaNew_";
  1487 + var concatinateResult = textValName.concat(splitedName[1]);
  1488 + $rootScope.canvasLayerNameCollection = [];
  1489 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  1490 + $('#canvas').setLayer(layer.name, {
  1491 + handle: {
  1492 + type: 'rectangle',
  1493 + fillStyle: '#fff',
  1494 + strokeStyle: '#c33',
  1495 + strokeWidth: 2,
  1496 + width: 5, height: 5,
  1497 + cornerRadius: 3
  1498 + }
  1499 + }).drawLayers();
  1500 + }
  1501 + else {
  1502 + layer.draggable = false;
  1503 + }
1386 }, 1504 },
1387 dblclick: function (layer) { 1505 dblclick: function (layer) {
  1506 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1507 + layer.draggable = true;
  1508 + $rootScope.isTextAreaClosedButtonActive = false;
  1509 + $rootScope.IsTextAlreadySave = true;
1388 1510
1389 - $rootScope.isTextAreaClosedButtonActive = false;  
1390 - $rootScope.IsTextAlreadySave = true; 1511 + var _rectLayerOnSave = layer.name;
  1512 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  1513 + var TextAreaRectName = "TextAreaNew_";
  1514 + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
  1515 + // alert(TextAreaRectNameConcatenated);
  1516 + //if (_rectLayerOnSaveSplit[1]%2 == 0)
  1517 + //{
  1518 + // _rectLayerOnSaveSplit[1] = _rectLayerOnSaveSplit[1] - 1;
  1519 + //}
  1520 + //else
  1521 + //{
  1522 + // _rectLayerOnSaveSplit[1] = _rectLayerOnSaveSplit[1];
  1523 + //}
1391 1524
1392 - var _rectLayerOnSave = layer.name;  
1393 - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");  
1394 - var TextAreaRectName = "TextAreaNew_";  
1395 - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]); 1525 + $rootScope.layerNameArr = layer.name;
  1526 + $rootScope.rectTextArr = TextAreaRectNameConcatenated;
1396 1527
1397 - $rootScope.layerNameArr = layer.name;  
1398 - $rootScope.rectTextArr = TextAreaRectNameConcatenated;  
1399 1528
  1529 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  1530 + // var _rectLayerOnSaveSplitInt;
  1531 + // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
  1532 + //alert(_rectLayerOnSaveSplitInt);
  1533 + // alert($rootScope.TextPropertyArray.length);
1400 1534
1401 - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); 1535 + for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
  1536 + if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
1402 1537
1403 - for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {  
1404 - if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) { 1538 + var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
  1539 + $("#text_area").val(textArrVal);
  1540 + var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
  1541 + var fontWeightProp = fontStyleProp.split(" ");
1405 1542
1406 - var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;  
1407 - $("#text_area").val(textArrVal);  
1408 - var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;  
1409 - var fontWeightProp = fontStyleProp.split(" "); 1543 + $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
  1544 + $("#text_area").css("font-weight", fontWeightProp[0]);
  1545 + $("#text_area").css("font-style", fontWeightProp[1]);
  1546 + $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
  1547 + $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
  1548 + $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
  1549 + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
  1550 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
1410 1551
1411 - $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);  
1412 - $("#text_area").css("font-weight", fontWeightProp[0]);  
1413 - $("#text_area").css("font-style", fontWeightProp[1]);  
1414 - $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);  
1415 - $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);  
1416 - $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);  
1417 - $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);  
1418 - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor }); 1552 + var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
  1553 + // alert(CurrentFontFamily);
  1554 + // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
  1555 + var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
  1556 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  1557 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
1419 1558
1420 - var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;  
1421 - // alert(CurrentFontFamily);  
1422 - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");  
1423 - var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);  
1424 - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);  
1425 - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true); 1559 + CurrentFontFamily = '';
  1560 + CurrentFontSize = '';
1426 1561
1427 - CurrentFontFamily = '';  
1428 - CurrentFontSize = ''; 1562 + // $(".ActiveDefaultColorAnnotation").css({ "background-color": $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor + "!important" });
  1563 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  1564 + //adding text text decoration active class in text edit pop-up
1429 1565
  1566 + if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
1430 1567
1431 - if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") { 1568 + $("#text-underline").addClass("ActiveFormattingButtonClass");
1432 1569
1433 - $("#text-underline").addClass("ActiveFormattingButtonClass"); 1570 + }
1434 1571
1435 - } 1572 + else {
1436 1573
1437 - else { 1574 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
1438 1575
1439 - $("#text-underline").removeClass("ActiveFormattingButtonClass"); 1576 + }
1440 1577
1441 - } 1578 + //adding text font weight active class in text edit pop-up
1442 1579
1443 - //adding text font weight active class in text edit pop-up 1580 + if (fontWeightProp[0] == 700) {
1444 1581
1445 - if (fontWeightProp[0] == 700) { 1582 + $("#text-bold").addClass("ActiveFormattingButtonClass");
1446 1583
1447 - $("#text-bold").addClass("ActiveFormattingButtonClass"); 1584 + }
1448 1585
1449 - } 1586 + else {
1450 1587
1451 - else { 1588 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
1452 1589
1453 - $("#text-bold").removeClass("ActiveFormattingButtonClass"); 1590 + }
1454 1591
1455 - } 1592 + //adding text font style active class in text edit pop-up
1456 1593
1457 - //adding text font style active class in text edit pop-up 1594 + if (fontWeightProp[1] == "italic") {
1458 1595
1459 - if (fontWeightProp[1] == "italic") {  
1460 1596
  1597 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  1598 + }
  1599 + else {
  1600 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
1461 1601
1462 - $("#text-italic").addClass("ActiveFormattingButtonClass");  
1463 - }  
1464 - else {  
1465 - $("#text-italic").removeClass("ActiveFormattingButtonClass");  
1466 1602
  1603 + }
1467 1604
1468 - } 1605 + //adding text alignment active class in text edit pop-up
1469 1606
1470 - //adding text alignment active class in text edit pop-up 1607 + if ($rootScope.TextPropertyArray[i].Align == "left") {
1471 1608
1472 - if ($rootScope.TextPropertyArray[i].Align == "left") { 1609 + $("#text-right").removeClass("ActiveFormattingButtonClass");
1473 1610
1474 - $("#text-right").removeClass("ActiveFormattingButtonClass"); 1611 + $("#text-center").removeClass("ActiveFormattingButtonClass")
1475 1612
1476 - $("#text-center").removeClass("ActiveFormattingButtonClass") 1613 + $("#text-left").addClass("ActiveFormattingButtonClass");
1477 1614
1478 - $("#text-left").addClass("ActiveFormattingButtonClass"); 1615 + }
1479 1616
1480 - } 1617 + else if ($rootScope.TextPropertyArray[i].Align == "right") {
1481 1618
1482 - else if ($rootScope.TextPropertyArray[i].Align == "right") {  
1483 1619
1484 1620
  1621 + $("#text-center").removeClass("ActiveFormattingButtonClass")
1485 1622
1486 - $("#text-center").removeClass("ActiveFormattingButtonClass") 1623 + $("#text-left").removeClass("ActiveFormattingButtonClass");
1487 1624
1488 - $("#text-left").removeClass("ActiveFormattingButtonClass"); 1625 + $("#text-right").addClass("ActiveFormattingButtonClass");
  1626 + }
1489 1627
1490 - $("#text-right").addClass("ActiveFormattingButtonClass");  
1491 - } 1628 + else if ($rootScope.TextPropertyArray[i].Align == "center") {
1492 1629
1493 - else if ($rootScope.TextPropertyArray[i].Align == "center") { 1630 + $("#text-left").removeClass("ActiveFormattingButtonClass");
1494 1631
1495 - $("#text-left").removeClass("ActiveFormattingButtonClass"); 1632 + $("#text-right").removeClass("ActiveFormattingButtonClass");
1496 1633
1497 - $("#text-right").removeClass("ActiveFormattingButtonClass"); 1634 + $("#text-center").addClass("ActiveFormattingButtonClass");
1498 1635
1499 - $("#text-center").addClass("ActiveFormattingButtonClass"); 1636 + }
1500 1637
1501 } 1638 }
  1639 + else {
  1640 + // alert("no");
1502 1641
1503 - }  
1504 - else {  
1505 - // alert("no"); 1642 + }
1506 1643
1507 } 1644 }
1508 1645
1509 - }  
1510 -  
1511 -  
1512 - // _rectLayerOnSaveSplitInt = '';  
1513 - textArrVal = '';  
1514 - $("#annotationTextModal").css("padding-right", "0px");  
1515 - document.getElementById('modelbackground').style.display = "block";  
1516 - $("#annotationTextModal").modal("toggle");  
1517 1646
1518 - // $("#selected-font-family").val(CurrentFontFamily);  
1519 - // $("#selected-font-size").val(CurrentFontSize); 1647 + // _rectLayerOnSaveSplitInt = '';
  1648 + textArrVal = '';
  1649 + $("#annotationTextModal").css("padding-right", "0px");
  1650 + document.getElementById('modelbackground').style.display = "block";
  1651 + $("#annotationTextModal").modal("toggle");
1520 1652
  1653 + // $("#selected-font-family").val(CurrentFontFamily);
  1654 + // $("#selected-font-size").val(CurrentFontSize);
1521 1655
  1656 + }
  1657 + else {
  1658 + layer.draggable = false;
  1659 + }
1522 }, 1660 },
1523 mouseout: function (layer) { 1661 mouseout: function (layer) {
1524 - $rootScope.canvasLayerNameCollection = [];  
1525 - $('#canvas').setLayer(layer.name, {  
1526 - handle: {  
1527 - type: 'rectangle',  
1528 - fillStyle: 'pink',  
1529 - strokeStyle: 'yellow',  
1530 - strokeWidth: 0,  
1531 - width: 0, height: 0,  
1532 - cornerRadius: 0  
1533 - }  
1534 - }).drawLayers(); 1662 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1663 + layer.draggable = true;
  1664 + $rootScope.canvasLayerNameCollection = [];
  1665 + $('#canvas').setLayer(layer.name, {
  1666 + handle: {
  1667 + type: 'rectangle',
  1668 + fillStyle: 'pink',
  1669 + strokeStyle: 'yellow',
  1670 + strokeWidth: 0,
  1671 + width: 0, height: 0,
  1672 + cornerRadius: 0
  1673 + }
  1674 + }).drawLayers();
  1675 + }
  1676 + else {
  1677 + layer.draggable = false;
  1678 + }
1535 }, 1679 },
1536 mouseover: function (layer) { 1680 mouseover: function (layer) {
1537 - $('#canvas').setLayer(layer.name, {  
1538 - handle: {  
1539 - type: 'rectangle',  
1540 - fillStyle: '#fff',  
1541 - strokeStyle: '#c33',  
1542 - strokeWidth: 2,  
1543 - width: 5, height: 5,  
1544 - cornerRadius: 3  
1545 - }  
1546 - }).drawLayers();  
1547 - 1681 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1682 + layer.draggable = true;
  1683 + $('#canvas').setLayer(layer.name, {
  1684 + handle: {
  1685 + type: 'rectangle',
  1686 + fillStyle: '#fff',
  1687 + strokeStyle: '#c33',
  1688 + strokeWidth: 2,
  1689 + width: 5, height: 5,
  1690 + cornerRadius: 3
  1691 + }
  1692 + }).drawLayers();
  1693 + }
  1694 + else {
  1695 + layer.draggable = false;
  1696 + }
1548 } 1697 }
1549 }); 1698 });
1550 $("#text_area").val(''); 1699 $("#text_area").val('');
@@ -1633,140 +1782,164 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1633,140 +1782,164 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1633 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 1782 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1634 resizeFromCenter: false, 1783 resizeFromCenter: false,
1635 click: function (layer) { 1784 click: function (layer) {
1636 - $rootScope.shapeTypeText = "textAreaRect";  
1637 - var layerNameSplit = layer.name;  
1638 - var splitedName = layerNameSplit.split("_");  
1639 - var textValName = "TextAreaAfterEdit_";  
1640 - var concatinateResult = textValName.concat(splitedName[1]);  
1641 - $rootScope.canvasLayerNameCollection = [];  
1642 - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });  
1643 -  
1644 - $('#canvas').setLayer(layer.name, {  
1645 - handle: {  
1646 - type: 'rectangle',  
1647 - fillStyle: '#fff',  
1648 - strokeStyle: '#c33',  
1649 - strokeWidth: 2,  
1650 - width: 5, height: 5,  
1651 - cornerRadius: 3  
1652 - }  
1653 - }).drawLayers(); 1785 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1786 + layer.draggable = true;
  1787 + $rootScope.shapeTypeText = "textAreaRect";
  1788 + var layerNameSplit = layer.name;
  1789 + var splitedName = layerNameSplit.split("_");
  1790 + var textValName = "TextAreaAfterEdit_";
  1791 + var concatinateResult = textValName.concat(splitedName[1]);
  1792 + $rootScope.canvasLayerNameCollection = [];
  1793 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  1794 +
  1795 + $('#canvas').setLayer(layer.name, {
  1796 + handle: {
  1797 + type: 'rectangle',
  1798 + fillStyle: '#fff',
  1799 + strokeStyle: '#c33',
  1800 + strokeWidth: 2,
  1801 + width: 5, height: 5,
  1802 + cornerRadius: 3
  1803 + }
  1804 + }).drawLayers();
  1805 + }
1654 1806
  1807 + else {
  1808 + layer.draggable = false;
  1809 + }
1655 }, 1810 },
1656 dblclick: function (layer) { 1811 dblclick: function (layer) {
  1812 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1813 + layer.draggable = true;
  1814 +
  1815 + $rootScope.isTextAreaClosedButtonActive = false;
  1816 + $rootScope.IsTextAlreadySave = true;
  1817 + var _rectLayerOnSave = layer.name;
  1818 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  1819 + var RectNameAfterEdit = "TextAreaAfterEdit_";
  1820 + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
  1821 + $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
  1822 +
  1823 + $rootScope.layerNameArr = layer.name;
  1824 + $rootScope.rectTextArr = RectNameAfterEditResult;
  1825 +
  1826 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  1827 + $("#text_area").val(_modifiedText);
  1828 + $("#text_area").css("font-size", _modifiedFontSize);
  1829 + $("#text_area").css("font-weight", _modifiedFontWeight);
  1830 + $("#text_area").css("font-style", _modifiedFontStyle);
  1831 + $("#text_area").css("text-align", _modifiedTextAlign);
  1832 + $("#text_area").css("color", _modifiedFontColor);
  1833 + $("#text_area").css("font-family", _modifiedFontFamily);
  1834 + $("#text_area").css("text-decoration", _modifiedFontDecoration);
  1835 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
  1836 +
  1837 + // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
  1838 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  1839 +
  1840 + //khushbu
  1841 + var CurrentFontFamily = _modifiedFontFamily;
  1842 + // alert(CurrentFontFamily);
  1843 + // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
  1844 + var CurrentFontSize = parseInt(_modifiedFontSize);
  1845 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  1846 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  1847 + CurrentFontFamily = '';
  1848 + CurrentFontSize = '';
  1849 + //adding text text decoration active class in text edit pop-up
  1850 + if (_modifiedFontDecoration == "underline") {
  1851 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  1852 + }
  1853 + else {
  1854 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  1855 + }
1657 1856
  1857 + //adding text font weight active class in text edit pop-up
  1858 + if (_modifiedFontWeight == 700) {
1658 1859
1659 - $rootScope.isTextAreaClosedButtonActive = false;  
1660 - $rootScope.IsTextAlreadySave = true;  
1661 - var _rectLayerOnSave = layer.name;  
1662 - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");  
1663 - var RectNameAfterEdit = "TextAreaAfterEdit_";  
1664 - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);  
1665 - $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];  
1666 -  
1667 - $rootScope.layerNameArr = layer.name;  
1668 - $rootScope.rectTextArr = RectNameAfterEditResult;  
1669 -  
1670 - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });  
1671 - $("#text_area").val(_modifiedText);  
1672 - $("#text_area").css("font-size", _modifiedFontSize);  
1673 - $("#text_area").css("font-weight", _modifiedFontWeight);  
1674 - $("#text_area").css("font-style", _modifiedFontStyle);  
1675 - $("#text_area").css("text-align", _modifiedTextAlign);  
1676 - $("#text_area").css("color", _modifiedFontColor);  
1677 - $("#text_area").css("font-family", _modifiedFontFamily);  
1678 - $("#text_area").css("text-decoration", _modifiedFontDecoration);  
1679 - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });  
1680 -  
1681 - // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });  
1682 - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");  
1683 -  
1684 - //khushbu  
1685 - var CurrentFontFamily = _modifiedFontFamily;  
1686 - // alert(CurrentFontFamily);  
1687 - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");  
1688 - var CurrentFontSize = parseInt(_modifiedFontSize);  
1689 - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);  
1690 - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);  
1691 - CurrentFontFamily = '';  
1692 - CurrentFontSize = '';  
1693 - //adding text text decoration active class in text edit pop-up  
1694 - if (_modifiedFontDecoration == "underline") {  
1695 - $("#text-underline").addClass("ActiveFormattingButtonClass");  
1696 - }  
1697 - else {  
1698 - $("#text-underline").removeClass("ActiveFormattingButtonClass");  
1699 - } 1860 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  1861 + }
  1862 + else {
1700 1863
1701 - //adding text font weight active class in text edit pop-up  
1702 - if (_modifiedFontWeight == 700) { 1864 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
1703 1865
1704 - $("#text-bold").addClass("ActiveFormattingButtonClass");  
1705 - }  
1706 - else { 1866 + }
1707 1867
1708 - $("#text-bold").removeClass("ActiveFormattingButtonClass"); 1868 + //adding text font style active class in text edit pop-up
  1869 + if (_modifiedFontStyle == "italic") {
1709 1870
1710 - } 1871 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  1872 + }
  1873 + else {
  1874 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
1711 1875
1712 - //adding text font style active class in text edit pop-up  
1713 - if (_modifiedFontStyle == "italic") { 1876 + }
1714 1877
1715 - $("#text-italic").addClass("ActiveFormattingButtonClass");  
1716 - }  
1717 - else {  
1718 - $("#text-italic").removeClass("ActiveFormattingButtonClass"); 1878 + //adding text alignment active class in text edit pop-up
  1879 + if (_modifiedTextAlign == "left") {
  1880 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1881 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  1882 + $("#text-left").addClass("ActiveFormattingButtonClass");
  1883 + }
  1884 + else if (_modifiedTextAlign == "right") {
1719 1885
1720 - } 1886 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  1887 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1888 + $("#text-right").addClass("ActiveFormattingButtonClass");
1721 1889
1722 - //adding text alignment active class in text edit pop-up  
1723 - if (_modifiedTextAlign == "left") {  
1724 - $("#text-right").removeClass("ActiveFormattingButtonClass");  
1725 - $("#text-center").removeClass("ActiveFormattingButtonClass")  
1726 - $("#text-left").addClass("ActiveFormattingButtonClass");  
1727 - }  
1728 - else if (_modifiedTextAlign == "right") { 1890 + }
  1891 + else if (_modifiedTextAlign == "center") {
  1892 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1893 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1894 + $("#text-center").addClass("ActiveFormattingButtonClass");
1729 1895
1730 - $("#text-center").removeClass("ActiveFormattingButtonClass")  
1731 - $("#text-left").removeClass("ActiveFormattingButtonClass");  
1732 - $("#text-right").addClass("ActiveFormattingButtonClass"); 1896 + }
1733 1897
  1898 + document.getElementById('modelbackground').style.display = "block";
  1899 + $("#annotationTextModal").modal("toggle");
1734 } 1900 }
1735 - else if (_modifiedTextAlign == "center") {  
1736 - $("#text-left").removeClass("ActiveFormattingButtonClass");  
1737 - $("#text-right").removeClass("ActiveFormattingButtonClass");  
1738 - $("#text-center").addClass("ActiveFormattingButtonClass");  
1739 1901
  1902 + else {
  1903 + layer.draggable = false;
1740 } 1904 }
1741 -  
1742 - document.getElementById('modelbackground').style.display = "block";  
1743 - $("#annotationTextModal").modal("toggle");  
1744 }, 1905 },
1745 mouseout: function (layer) { 1906 mouseout: function (layer) {
1746 - $rootScope.canvasLayerNameCollection = [];  
1747 - $('#canvas').setLayer(layer.name, {  
1748 - handle: {  
1749 - type: 'rectangle',  
1750 - fillStyle: 'pink',  
1751 - strokeStyle: 'yellow',  
1752 - strokeWidth: 0,  
1753 - width: 0, height: 0,  
1754 - cornerRadius: 0  
1755 - }  
1756 - }).drawLayers(); 1907 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1908 + layer.draggable = true;
  1909 + $rootScope.canvasLayerNameCollection = [];
  1910 + $('#canvas').setLayer(layer.name, {
  1911 + handle: {
  1912 + type: 'rectangle',
  1913 + fillStyle: 'pink',
  1914 + strokeStyle: 'yellow',
  1915 + strokeWidth: 0,
  1916 + width: 0, height: 0,
  1917 + cornerRadius: 0
  1918 + }
  1919 + }).drawLayers();
  1920 + }
  1921 + else {
  1922 + layer.draggable = false;
  1923 + }
1757 }, 1924 },
1758 mouseover: function (layer) { 1925 mouseover: function (layer) {
1759 - $('#canvas').setLayer(layer.name, {  
1760 - handle: {  
1761 - type: 'rectangle',  
1762 - fillStyle: '#fff',  
1763 - strokeStyle: '#c33',  
1764 - strokeWidth: 2,  
1765 - width: 5, height: 5,  
1766 - cornerRadius: 3  
1767 - }  
1768 - }).drawLayers(); 1926 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1927 + layer.draggable = true;
  1928 + $('#canvas').setLayer(layer.name, {
  1929 + handle: {
  1930 + type: 'rectangle',
  1931 + fillStyle: '#fff',
  1932 + strokeStyle: '#c33',
  1933 + strokeWidth: 2,
  1934 + width: 5, height: 5,
  1935 + cornerRadius: 3
  1936 + }
  1937 + }).drawLayers();
1769 1938
  1939 + }
  1940 + else {
  1941 + layer.draggable = false;
  1942 + }
1770 } 1943 }
1771 }); 1944 });
1772 1945
@@ -1775,7 +1948,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1775,7 +1948,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1775 //---- 1948 //----
1776 1949
1777 $rootScope.BindCanvasDrawingListners = function (event) { 1950 $rootScope.BindCanvasDrawingListners = function (event) {
1778 - 1951 +
1779 $rootScope.clicked = true; 1952 $rootScope.clicked = true;
1780 // OnPaintCanvasMouseDown(event); 1953 // OnPaintCanvasMouseDown(event);
1781 1954
@@ -1785,6 +1958,13 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1785,6 +1958,13 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1785 annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false); 1958 annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false);
1786 } 1959 }
1787 // alert("doclick"); 1960 // alert("doclick");
  1961 + if (event != undefined) {
  1962 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1963 +
  1964 + $rootScope.DrawingListners_Canvas(event);
  1965 +
  1966 + }
  1967 + }
1788 }; 1968 };
1789 1969
1790 1970