From 0c78030d28d84ac3a06b791012912ffda622f940 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 9 Jun 2017 15:51:31 +0530 Subject: [PATCH] added ATBar code in AA. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 28 +++++++++++++++++++--------- 400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html | 55 ++++++++++++++++++++++++++++++++++++++----------------- 400-SOURCECODE/AIAHTML5.Web/index.html | 102 ++---------------------------------------------------------------------------------------------------- 4 files changed, 151 insertions(+), 126 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 4ade3ec..bdd6394 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -353,6 +353,98 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.lexiconLanguageArray = []; $rootScope.lexiconLanguageArray.push({ id: "1", language: "English" }); $(document).ready(function () { + + + // annotation slider starts + function onBrushSizeChange() { + $('.btnCursor').addClass('activebtncolor'); + $(".btn-annotation").removeClass("activebtncolor"); + $(".btn-annotation-erase").removeClass("activebtncolor"); + $(".btn-annotation-erase").removeClass("activebtncolor"); + $(".annotationpaintbrushsize").removeClass("activebtncolor"); + var x = $('#canvasPaint').css("z-index"); + + var y = $('#canvas').css("z-index"); + if (x > y) { + y = parseInt(x) + 1; + } else { + y = parseInt(y) + 1; + } + $('#canvas').css("z-index", y); + } + + $("#slider-range-min-2").slider({ + range: "min", + min: 1, + max: 60, + value: 1, + slide: function (event, ui) { + + onBrushSizeChange(); + console.log("sliding"); + $("#btnBrushSize").val(ui.value); + + }, + stop: function (event, ui) { + + $("#paintLine").attr("data-size", ui.value); + + } + + }); + + + $("#btnBrushSize").keydown(function () { + onBrushSizeChange(); + var brushSizevalue = this.value; + $("#slider-range-min-2").slider("value", parseInt(brushSizevalue)); + }); + $("#btnBrushSize").keyup(function () { + onBrushSizeChange(); + var brushSizevalue = this.value; + $("#slider-range-min-2").slider("value", parseInt(brushSizevalue)); + }); + $("#btnBrushSizeIncrement").click(function () { + onBrushSizeChange(); + var brushIncrementVar = $("#btnBrushSize").val(); + if (brushIncrementVar >= 60) { + $("#slider-range-min-2").slider("value", 60); + } + else if (brushIncrementVar == "") { + var brushIncrementedValue = 1; + $("#btnBrushSize").val(brushIncrementedValue); + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue)); + } + else { + var brushIncrementedValue = parseInt(brushIncrementVar) + 1; + $("#btnBrushSize").val(brushIncrementedValue); + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue)); + } + }); + $("#btnBrushSizeDecrease").click(function () { + onBrushSizeChange(); + var brushDecreaseVar = $("#btnBrushSize").val(); + if (brushDecreaseVar == "") { + var brushDecrementedValue = 1; + $("#btnBrushSize").val(brushDecrementedValue); + $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue)); + } + else if (brushDecreaseVar <= 1) { + $("#slider-range-min-2").slider("value", 1); + } + else { + var brushDecrementedValue = parseInt(brushDecreaseVar) - 1; + $("#btnBrushSize").val(brushDecrementedValue); + $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue)); + } + }); + + $("#btnBrushSize").val($("#slider-range-min-2").slider("value")); + + + // annotation slider ends + + // getUserDetails(); // var ajaxResult = []; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 35e6cb7..03333b1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -155,7 +155,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo canvas.style.top = '0px'; canvas.style.position = "absolute"; - $("#imageDiv").append(canvas); + $("#canvasDiv").append(canvas); $scope.context = canvas.getContext("2d") //6. Show all pins on AA opened item @@ -197,8 +197,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo angular.element(document).ready(function (e) { $("#ImagePanel").resize(function () { - $("#imageDiv").scrollLeft($rootScope.CanvasDivLeftPosition); - $("#imageDiv").scrollTop($rootScope.CanvasDivTopPosition); + $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); + $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition); }); }) @@ -610,7 +610,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#dot").css("visibility", "hidden"); var verticalScrollPosition = canvasDiv.scrollTop; var horizontlScrollPosition = canvasDiv.scrollLeft; - $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); + $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); }, }); @@ -634,7 +634,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (MultipleLanguage == undefined) { console.log("No text is found"); } else { - $('#imageDiv').append(speechBubbleHTML); + $('#canvasDiv').append(speechBubbleHTML); if ($scope.MultiLanguageAnnationArray.length > 0) { for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { @@ -709,8 +709,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo drag: function (evt) { - var verticalScrollPosition = document.getElementById('imageDiv').scrollTop; - var horizontlScrollPosition = document.getElementById('imageDiv').scrollLeft; + var verticalScrollPosition = document.getElementById('canvasDiv').scrollTop; + var horizontlScrollPosition = document.getElementById('canvasDiv').scrollLeft; var clickedSpeechBubbleId = $(this).attr("id"); var clickedPinId = clickedSpeechBubbleId.substring(12, clickedSpeechBubbleId.length); @@ -720,7 +720,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var i = 0; i <= $rootScope.speechBubbleDimaensions.length - 1; i++) { if ($rootScope.speechBubbleDimaensions[i].id == clickedPinId) { - $scope.angle(clickedPinId, $rootScope.speechBubbleDimaensions[i].currentX, $rootScope.speechBubbleDimaensions[i].currentY, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); + $scope.angle(clickedPinId, $rootScope.speechBubbleDimaensions[i].currentX, $rootScope.speechBubbleDimaensions[i].currentY, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } } @@ -766,7 +766,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo fillStyle: radialAfterClick, }).drawLayers(); } - + $rootScope.$on('annotationToolEvent', function (event, data) { + $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)") + $('#editstylebackgroundcolor .minicolors >.minicolors-panel > .minicolors-grid >.minicolors-picker').css({ "top": "145px", "left": "4px" }); + $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(0,0,0)") + $('#outlineColor .minicolors >.minicolors-panel > .minicolors-grid >.minicolors-picker').css({ "top": "145px", "left": "4px" }); + + $("#canvas").css("display", "block"); + $("#canvasPaint").css("display", "block"); + $rootScope.onDrawingCanvasClick(); + $rootScope.FreeStylePaint(); + }); $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html index 333edc6..913fd7d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html @@ -1,4 +1,23 @@ - + +