Commit c2d51addae7ef58f4e5f5e9afec76b5f11f99bff
1 parent
3959ad25
now we can draw transparency box when annotation box is open
Showing
2 changed files
with
68 additions
and
18 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -855,7 +855,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
855 | 855 | // annotation toolbar canvas |
856 | 856 | |
857 | 857 | //history code |
858 | - | |
858 | + | |
859 | 859 | if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { |
860 | 860 | var ATBarHtml = $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" height="3248" ng-click="FreeStylePaint($event)" class="canvas-annotationStyle1"></canvas><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>'); |
861 | 861 | $compile(ATBarHtml)($scope); |
... | ... | @@ -910,7 +910,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
910 | 910 | $scope.bagartDetails = new jinqJs() |
911 | 911 | .from($rootScope.bgartData.BackgroundArts.BackgroundArtDetail) |
912 | 912 | .where('_ViewOrientationId == ' + viewOrientationId) |
913 | - .select(); | |
913 | + .select(); | |
914 | 914 | |
915 | 915 | if ($scope.ColoredImageSRC != null && $scope.ColoredImageSRC.length > 0) { |
916 | 916 | $scope.ColoredImageSRC = null; |
... | ... | @@ -3690,6 +3690,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3690 | 3690 | |
3691 | 3691 | |
3692 | 3692 | } |
3693 | + | |
3694 | + if ($rootScope.isTBCompleted == true) { | |
3695 | + $('#sppeachBubble').remove(); | |
3696 | + $('#dot').remove(); | |
3697 | + $('#bord').remove(); | |
3698 | + $('.com').remove(); | |
3699 | + $rootScope.isTBCompleted = false; | |
3700 | + } | |
3693 | 3701 | } |
3694 | 3702 | |
3695 | 3703 | $scope.showAnnotation = function() |
... | ... | @@ -3856,14 +3864,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3856 | 3864 | }); |
3857 | 3865 | |
3858 | 3866 | $('#canvasDiv').attr("data-bubbleid", "speechBubble") |
3859 | - | |
3860 | - | |
3867 | + | |
3861 | 3868 | }; |
3862 | 3869 | |
3863 | 3870 | |
3864 | 3871 | $scope.createTransparencyBox = function () { |
3865 | 3872 | |
3866 | - | |
3867 | 3873 | $scope.isTransparencyBtnClicked = true; |
3868 | 3874 | |
3869 | 3875 | //do not create TBOX if in extarct mode otherwise create |
... | ... | @@ -3899,6 +3905,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3899 | 3905 | // console.log("extract button is active"); |
3900 | 3906 | |
3901 | 3907 | } |
3908 | + //in case of annotation toolbar is open below code will be executed to draw Tbox | |
3909 | + if ($rootScope.isAnnotationWindowOpen == true) { | |
3910 | + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { | |
3911 | + $rootScope.DrawingMode(); | |
3912 | + $rootScope.shapeType = ""; | |
3913 | + $(".btn-annotation").removeClass("activebtncolor"); | |
3914 | + $("#annotationpaintbrushsize").removeClass("activebtncolor"); | |
3915 | + $("#annotationpainteraser").removeClass("activebtncolor"); | |
3916 | + } | |
3917 | + else { | |
3918 | + | |
3919 | + $rootScope.switchCanvas(); | |
3920 | + } | |
3921 | + } | |
3922 | + | |
3923 | + | |
3902 | 3924 | } |
3903 | 3925 | |
3904 | 3926 | function mouseDownListener(e) { |
... | ... | @@ -3954,6 +3976,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3954 | 3976 | $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.currentLayerNumber)); |
3955 | 3977 | $("#txtlayerNumber").val(parseInt($scope.currentLayerNumber)); |
3956 | 3978 | } |
3979 | + | |
3957 | 3980 | } |
3958 | 3981 | |
3959 | 3982 | function mouseMoveListener(e) { |
... | ... | @@ -3980,13 +4003,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3980 | 4003 | |
3981 | 4004 | }); |
3982 | 4005 | |
3983 | - | |
3984 | - | |
3985 | 4006 | } |
3986 | 4007 | |
3987 | 4008 | |
3988 | 4009 | function mouseUpListener(e) { |
3989 | - | |
4010 | + | |
3990 | 4011 | $scope.isTBDrawnOnBodyRegion = false; |
3991 | 4012 | |
3992 | 4013 | $(".com").remove(); |
... | ... | @@ -3994,7 +4015,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3994 | 4015 | $('#bord').remove(); |
3995 | 4016 | $('#sppeachBubble').remove(); |
3996 | 4017 | |
3997 | - | |
3998 | 4018 | var previewRectangleWidth = $('.rectangle').width(); |
3999 | 4019 | var previewRectangleHeight = $('.rectangle').height() |
4000 | 4020 | |
... | ... | @@ -4157,13 +4177,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4157 | 4177 | $('#btnTranparency').removeClass('btn-black'); |
4158 | 4178 | |
4159 | 4179 | $('#btnTranparency').addClass('tButtonActive'); |
4160 | - //debugger; | |
4180 | + | |
4161 | 4181 | // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1); |
4162 | 4182 | //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected. |
4163 | 4183 | $('#btnTranparency').removeClass('tButtonActive'); |
4164 | 4184 | $('#btnTranparency').addClass('btn-black'); |
4165 | 4185 | $('#btnIdentity').removeClass('btn-black'); |
4166 | 4186 | $('#btnIdentity').addClass('btn-primary'); |
4187 | + | |
4188 | + // clear canvas before drawing transparency box | |
4189 | + $('#canvas').removeLayers(); | |
4190 | + var paintCanvasObj = document.getElementById("canvasPaint"); | |
4191 | + var ctx = paintCanvasObj.getContext("2d"); | |
4192 | + ctx.clearRect(0, 0, 2277, 3248); | |
4193 | + var sktch = $('#canvasPaint').sketch(); | |
4194 | + $('#canvasPaint').sketch().actions = []; | |
4195 | + $("#annotationpaintbrushsize").removeClass("activebtncolor"); | |
4196 | + $("#annotationpainteraser").removeClass("activebtncolor"); | |
4197 | + | |
4198 | + //hide the speechbubble | |
4199 | + | |
4200 | + | |
4201 | + if($rootScope.isAnnotationWindowOpen == true) | |
4202 | + $rootScope.isTBCompleted = true; | |
4167 | 4203 | } |
4168 | 4204 | |
4169 | 4205 | $scope.getCanavsDivScrollPosition = function () { |
... | ... | @@ -4868,9 +4904,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4868 | 4904 | |
4869 | 4905 | // History Maintained Issue// |
4870 | 4906 | |
4871 | - $rootScope.getAnnotationTextBasedOnSelectedBodyRegion = function (event) { | |
4907 | + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion = function (event) { | |
4872 | 4908 | |
4873 | - | |
4874 | 4909 | var canvasDiv = document.getElementById('canvasDiv'); |
4875 | 4910 | var verticalScrollPosition = canvasDiv.scrollTop; |
4876 | 4911 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
... | ... | @@ -4903,7 +4938,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4903 | 4938 | //alert(mirrorCanvasX); |
4904 | 4939 | var mirrorImageCanvas = document.getElementById(maskCanvasId); |
4905 | 4940 | var mirrorCanvasWidth = mirrorImageCanvas.clientWidth; |
4906 | - // alert(mirrorCanvasWidth); | |
4941 | + // alert(mirrorCanvasWidth); | |
4907 | 4942 | var maskCanvas = document.getElementById(maskCanvasId); |
4908 | 4943 | var maskCanvasContext = maskCanvas.getContext("2d"); |
4909 | 4944 | |
... | ... | @@ -4938,7 +4973,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4938 | 4973 | Blue = (pixelData.data[2]).toString() |
4939 | 4974 | } |
4940 | 4975 | var RGBColor = (Red + Green + Blue); |
4941 | - // alert(RGBColor); | |
4976 | + // alert(RGBColor); | |
4942 | 4977 | //$rootScope.previousHighlightList.push(RGBColor); |
4943 | 4978 | |
4944 | 4979 | } |
... | ... | @@ -4953,8 +4988,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4953 | 4988 | else { |
4954 | 4989 | $scope.createDynamicSpeechBubble(event, event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true) |
4955 | 4990 | } |
4956 | - | |
4957 | - | |
4991 | + | |
4958 | 4992 | } |
4959 | 4993 | |
4960 | 4994 | |
... | ... | @@ -5625,6 +5659,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5625 | 5659 | $('#dot_annotation').remove(); |
5626 | 5660 | $('#bord_annotation').remove(); |
5627 | 5661 | |
5662 | + $('#dot').remove(); | |
5663 | + $('#sppeachBubble').remove(); | |
5664 | + $(".com").remove(); | |
5665 | + $("#bord").remove(); | |
5666 | + | |
5667 | + // clear canvas on closing of transparency box | |
5668 | + $('#canvas').removeLayers(); | |
5669 | + var paintCanvasObj = document.getElementById("canvasPaint"); | |
5670 | + var ctx = paintCanvasObj.getContext("2d"); | |
5671 | + ctx.clearRect(0, 0, 2277, 3248); | |
5672 | + var sktch = $('#canvasPaint').sketch(); | |
5673 | + $('#canvasPaint').sketch().actions = []; | |
5674 | + // $("#annotationpaintbrushsize").removeClass("activebtncolor"); | |
5675 | + // $("#annotationpainteraser").removeClass("activebtncolor"); | |
5676 | + | |
5677 | + | |
5628 | 5678 | var tBox = document.getElementById('transparencyCanvas'); |
5629 | 5679 | |
5630 | 5680 | |
... | ... | @@ -5691,7 +5741,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5691 | 5741 | $('#btnIdentity').addClass('btn-primary'); |
5692 | 5742 | |
5693 | 5743 | document.getElementById('btnTranparency').removeEventListener("click", $scope.createTransparencyBox); |
5694 | - | |
5744 | + | |
5695 | 5745 | } |
5696 | 5746 | |
5697 | 5747 | $scope.createSpeechBubbleOnTransparencyBox = function (event, text1, text2, x, y) { | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -2402,7 +2402,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
2402 | 2402 | // annotation history |
2403 | 2403 | if (event != undefined) { |
2404 | 2404 | if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { |
2405 | - | |
2405 | + | |
2406 | 2406 | $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event); |
2407 | 2407 | |
2408 | 2408 | } | ... | ... |