From dec151af0325bc9f4179c49ab0d1fb560f92c7c7 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 9 Jun 2017 16:54:54 +0530 Subject: [PATCH] merged AAATbar. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 28 ++++++++++++++++++++-------- 400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html | 41 ++++++++++++++++++++++++----------------- 400-SOURCECODE/AIAHTML5.Web/index.html | 100 +--------------------------------------------------------------------------------------------------- 4 files changed, 142 insertions(+), 124 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 9e2fb8b..8a74f02 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -357,6 +357,95 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic // var ajaxResult = []; // var ajaxResult1 = []; + + 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 + $rootScope.isLexiconTabClicked = true; $rootScope.lexiconData = function () { if ($rootScope.isLexiconTabClicked == true) { @@ -531,6 +620,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $("#annotationToolBarOptions").removeClass("disableSubMenu"); $rootScope.disableFileMenu = " "; } + else if ($location.url() == "/module-item-view") { + $rootScope.disableMenuannotation = " "; + $rootScope.disableMenuoption = " "; + $rootScope.disableSubMenu = "disableSubMenu"; + $("#annotationToolBarOptions").removeClass("disableSubMenu"); + $rootScope.disableFileMenu = " "; + } + else if ($location.url() == "/clinical-animations-detail") { $rootScope.disableMenuannotation = "disableMenuannotation"; $rootScope.disableMenuoption = " "; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 35e6cb7..6af8722 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); } } @@ -879,6 +879,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.removeSpeechBubble(); } + + $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(); + }); }]); function showSelectedSystemPins(event) { 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..eebf2b1 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,22 @@ - +