diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index b88ca1e..7778607 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -58,9 +58,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { $scope.setActiveTab(1); + $scope.reRunSearchOnLoad(); } - $scope.reRunSearchOnLoad(); + }); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index 15f0753..916f317 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -64,9 +64,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { $scope.setActiveTab(1); + $scope.reRunSearchOnLoad(); } - $scope.reRunSearchOnLoad(); + }); @@ -562,7 +563,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout theme: 'success', currentController: 'CIController', parentSlug: 'clinical-illustrations', - content: '
' + + content: '
' + '
' + '
' + '

' + $scope.clickedCISummary + '

' + @@ -619,7 +620,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $("#canvasPaint").css("display", "block"); $rootScope.BindCanvasDrawingListners(); - // $rootScope.FreeStylePaint(); + $rootScope.FreeStylePaint(); }); $scope.ReloadListViewImageDiv = function (id) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index f81d04d..7043864 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -89,7 +89,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //navigator man functionality $scope.navigatorImage; - $scope.NavigatorData; + $rootScope.NavigatorData; $scope.navimgsrc; $scope.dragdivleft = 0; @@ -140,6 +140,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); @@ -666,12 +667,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $http({ method: 'GET', url: NavigatorManJsonPath }) .success(function (data) { - $scope.NavigatorData = data; + $rootScope.NavigatorData = data; $scope.skinTone = $rootScope.globalSetting.ethnicity; var navigatorManData = new jinqJs() - .from($scope.NavigatorData.Navigtor.ViewOrientation) + .from($rootScope.NavigatorData.Navigtor.ViewOrientation) .where("_ViewOrientationId == " + $rootScope.currentBodyViewId) .select(); @@ -706,7 +707,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo navImageModesty = $scope.navigatorImage[0]._ImageName; } - $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; + // $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; + document.getElementById('navimg').src = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; $('#navigatorDiv').css('visibility', 'visible'); @@ -776,7 +778,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // annotation toolbar canvas if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { - $("#canvasDiv").append(''); + var $layerChange = $("#canvasDiv").append(''); + $compile($layerChange)($scope); $scope.BindCanvasDrawingListners(); // $rootScope.FreeStylePaint(); @@ -3568,6 +3571,41 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + + if (document.getElementById("btnStrutureBox").name == "showAnnotationStructure") { + $scope.showAnnotation() + + } + else { + $scope.hideAnnotation() + + + } + } + + $scope.showAnnotation = function() + { + $(".com").show(); + $('#dot').show(); + $('#bord').show(); + $('#sppeachBubble').show(); + $('#sppeachBubble_annotation').show(); + + $("#bord_annotation").show(); + $("#dot_annotation").show(); + $(".dynCross_anno").parent().parent().parent().show(); + } + + $scope.hideAnnotation=function() + { + $(".com").hide(); + $('#dot').hide(); + $('#bord').hide(); + $('#sppeachBubble').hide(); + $('#sppeachBubble_annotation').hide(); + $("#bord_annotation").hide(); + $("#dot_annotation").hide(); + $(".dynCross_anno").parent().parent().parent().hide(); } $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) { @@ -5877,20 +5915,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //if listanager is visisble then close it + $rootScope.isListManagerSelected = false; $rootScope.CloseListManager(); + var btnStrutureBoxname = document.getElementById("btnStrutureBox").name; - $(".com").toggle(); - $('#dot').toggle(); - $('#bord').toggle(); - $('#sppeachBubble').toggle(); - $('#sppeachBubble_annotation').toggle(); - - $("#bord_annotation").toggle(); - $("#dot_annotation").toggle(); - $(".dynCross_anno").parent().parent().parent().toggle(); + if (btnStrutureBoxname == "showAnnotationStructure") { + $("#btnStrutureBox").addClass("disableHideShowStructure"); + $scope.hideAnnotation(); + document.getElementById("btnStrutureBox").name = "hideAnnotationStructure"; + } + else { + $("#btnStrutureBox").removeClass("disableHideShowStructure"); + $scope.showAnnotation(); + document.getElementById("btnStrutureBox").name = "showAnnotationStructure"; + } + } @@ -6405,7 +6447,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //4. - $scope.loadSelectedBodyViewNavigator(currentBodyViewId); + $scope.loadNavigatorForSelectedBodyView(currentBodyViewId); //5. change the search terms as per the selected bodyview $scope.loadSearchDataForBodyView(); @@ -6437,7 +6479,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //4. - $scope.loadSelectedBodyViewNavigator(currentBodyViewId); + $scope.loadNavigatorForSelectedBodyView(currentBodyViewId); //5. change the search terms as per the selected bodyview $scope.loadSearchDataForBodyView(); @@ -6637,7 +6679,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadSelectedBodyView($rootScope.voId); //3. load corresponding navigator man - $scope.loadSelectedBodyViewNavigator($rootScope.voId); + $scope.loadNavigatorForSelectedBodyView($rootScope.voId); //4. change the search terms as per the selected bodyview $scope.loadSearchDataForBodyView(); @@ -6671,7 +6713,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadSelectedBodyView($rootScope.voId); //2. - $scope.loadSelectedBodyViewNavigator($rootScope.voId); + $scope.loadNavigatorForSelectedBodyView($rootScope.voId); }; @@ -6757,20 +6799,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) + $scope.$on('changeNavigatorModestyEvent', function (event, data) { + console.log('changeNavigatorModestyEvent'); + + $scope.loadNavigatorForSelectedBodyView(data.bodyViewId); + + }) //Reload DA controller Body View after setting Change $scope.$on('reloadDABodyViewEvent', function (event, data) { //console.log('reloadDABodyViewEvent'); - $scope.layerNumber = parseInt($('#txtlayerNumber').val()); - //alert('mouseUp'); + if ($rootScope.isSettingEventAlredayDispachted == true) { + $rootScope.isSettingEventAlredayDispachted = false; + $scope.layerNumber = parseInt($('#txtlayerNumber').val()); + //alert('mouseUp'); - if ($scope.layerNumber == 0) { - $scope.loadSelectedBodyView(data.reloadDABodyViewId); - } - // $scope.loadSelectedBodyView(data.reloadDABodyViewId); - - $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId); + if ($scope.layerNumber == 0) { + $scope.loadSelectedBodyView(data.reloadDABodyViewId); + } + // $scope.loadSelectedBodyView(data.reloadDABodyViewId); + $scope.loadNavigatorForSelectedBodyView(data.reloadDABodyViewId); + } // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); //$rootScope.isSettingEventAlredayDispachted = false; @@ -6778,17 +6828,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) - - - $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) { + $scope.loadNavigatorForSelectedBodyView = function (currentBodyViewId) { //$rootScope.voId = currentBodyViewId; //$scope.skinTone = $rootScope.globalSetting.ethnicity; - if ($scope.NavigatorData != null || $scope.NavigatorData != undefined) { + if ($rootScope.NavigatorData != null || $rootScope.NavigatorData != undefined) { var navdtlOrient = new jinqJs() - .from($scope.NavigatorData.Navigtor.ViewOrientation) + .from($rootScope.NavigatorData.Navigtor.ViewOrientation) .where("_ViewOrientationId == " + currentBodyViewId) .select(); @@ -6818,7 +6866,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; + // $scope.navimgsrc = 'http://localhost/AIAHTML5/content/images/DA/ethnicity/body-views/' + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty;//"~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; + document.getElementById('navimg').src = '~/../content/images/DA/ethnicity/body-views/' + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty;//"~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; } } @@ -6857,114 +6906,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo - $rootScope.FreeStylePaint = function (e) { - - var annotationCanvas = document.getElementById("canvas"); - // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp); - - annotationCanvas.addEventListener('mousedown', $scope.OnPaintCanvasMouseDown, false); - - annotationCanvas.addEventListener('mouseup', $scope.OnPaintBrushCanvasMouseUp, false); - } - $scope.OnPaintCanvasMouseDown = function (event) { - $rootScope.isMousedownOnPaintCanvas = true; - $scope.isStartPointDeleted = false; - var annotationCanvas = document.getElementById("canvas"); - $scope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left)); - $scope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top)); - - annotationCanvas.addEventListener('mousemove', $scope.OnPaintCanvasMouseMove, false); - - - - } - $scope.OnPaintCanvasMouseMove = function (event) { - - - $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left)); - $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top)); - - var btneraseBrushSizeValue = $("#btnBrushSize").val(); - $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue); - - if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) { - - var sktch = $('#canvasPaint').sketch(); - $('#canvasPaint').sketch().actions = []; - var paintCanvas = document.getElementById("canvasPaint"); - var paintCanvasContext = paintCanvas.getContext('2d'); - if ($scope.isStartPointDeleted == false) { - - paintCanvasContext.clearRect($scope.startPageX, $scope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize); - - $scope.isStartPointDeleted = true; - } - - paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize); - - - } - } - $scope.OnPaintBrushCanvasMouseDown = function (event) { - switch ($rootScope.shapeType) { - - case "FreeStylePaint": - - - - // $('#canvasPaint').sketch(); - // $('#canvasPaint').sketch({ defaultSize: 1 }); - // if ($("#amount-2").val() == '') { - // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); - // $('#canvasPaint').sketch(); - // } - // else { - - // // var a = $("#amount-2").val(); - //// $scope.shapesize = parseInt(a); - // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize }); - // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); - - // } - - - break; - - } - } - $scope.OnPaintBrushCanvasMouseUp = function (event) { - $rootScope.isMousedownOnPaintCanvas = false; - $rootScope.isEraseToolSelected = false; - - // var canvasElement1 = document.getElementById("canvasPaint"); - // var ctx1 = canvasElement1.getContext("2d"); - - //switch($rootScope.shapeType) - //{ - - // case "FreeStylePaint": - - - // if ($("#amount-2").val() == '') - // { - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); - // } - // else - // { - - // var a = $("#amount-2").val(); - // $scope.shapesize = parseInt(a); - // alert(JSON.stringify({ defaultSize: $scope.shapesize })); - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); - - // } - - - // break; - - //} - - } + + @@ -7314,6 +7257,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); + + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index aa2487a..9a69c4e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -64,19 +64,30 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.isEraseToolSelected = false; $rootScope.isMousedownOnPaintCanvas = false; + //opacity code + $rootScope.shapestyleOpacity = 1; + $rootScope.shapestyleFillColor = "#fff"; + $rootScope.shapestyleFillBorderColor = "black"; + $rootScope.shapestyleborderWidth = 2; + $rootScope.shapestyleborderStyles = "solid"; $rootScope.$on("$locationChangeSuccess", function () { - if (($location.url() == "/da-body-view") || ($location.url() == "/clinical-illustrations-detail") || ($location.url() == "/clinical-animations-detail")) { + if (($location.url() == "/da-body-view")) { $rootScope.disableMenuannotation = " "; $rootScope.disableMenuoption = " "; - + } + else if (($location.url() == "/clinical-illustrations-detail") || ($location.url() == "/clinical-animations-detail")) { + $rootScope.disableMenuannotation = " "; + $rootScope.disableMenuoption = " "; + $rootScope.disableSubMenu = "disableSubMenu"; } else { $rootScope.disableMenuannotation = "disableMenuannotation"; $rootScope.disableMenuoption = "disableMenuoption"; + $rootScope.disableSubMenu = ""; $rootScope.CloseAnnotationTool(); $rootScope.CloseListManager(); angular.element('#modal-settings').modal('hide'); @@ -140,16 +151,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } } - // $rootScope.DrawLine = function () { - //$rootScope.isIdetifyClicked = false; - //$rootScope.isDrawingToolSelected = true; - //$rootScope.isLineDrawSelecyed = true; - // $rootScope.shapeType = "Line"; - // alert($rootScope.shapeType); - - - // } - $rootScope.ClearIframe = function () { if ($('#daImagePanel') != null) $('#daImagePanel').remove(); @@ -287,14 +288,12 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('#modal-settings').modal('toggle'); } - } - - //----Annotation Toolbar: Jcanvas----- - $rootScope.DrLine = function (e) { + $rootScope.DrawLine = function (e) + { $rootScope.setListManagerZindex = true; $("#canvasPaint").css("display", "block"); $("#canvas").css("display", "block"); @@ -302,7 +301,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.switchCanvas(); $rootScope.shapeType = "Line"; - $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-line").addClass("activebtncolor"); @@ -311,7 +309,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } - $rootScope.DrPin = function (e) { + $rootScope.DrawPin = function (e) { $("#canvasPaint").css("display", "block"); $("#canvas").css("display", "block"); @@ -386,13 +384,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } - - // $('#canvasPaint').sketch(); - - } - } @@ -441,23 +434,16 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-Text").addClass("activebtncolor"); - // $("#text_area").val(''); - // $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); - } + } $rootScope.DrawPolygon = function () { $rootScope.setListManagerZindex = true; $("#canvasPaint").css("display", "block"); $("#canvas").css("display", "block"); $rootScope.shapeType = "DrawPolygon"; - } - $rootScope.OpacityModal = function () { - - - } $rootScope.switchCanvas = function () { var x = $('#canvasPaint').css("z-index"); @@ -473,23 +459,11 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.switchCanvas(); $rootScope.isEraseToolSelected = true; //$rootScope.switchCanvasToPaintCanvas(); - //// $('#canvasPaint').sketch({ defaultColor: "yellow", defaultSize: 1 }); - //var sktch = $('#canvasPaint').sketch(); - //$('#canvasPaint').sketch().actions = []; // this line empties the actions. - //var myCanvas = document.getElementById("canvasPaint"); - //var ctx = myCanvas.getContext('2d'); - //ctx.clearRect(0, 0, myCanvas.width, myCanvas.height); - //$rootScope.switchCanvas(); - } - //opacity code - $rootScope.shapestyleOpacity = 1; - $rootScope.shapestyleFillColor = "#fff"; - $rootScope.shapestyleFillBorderColor = "black"; - $rootScope.shapestyleborderWidth = 2; - $rootScope.shapestyleborderStyles = "solid"; - $rootScope.shapestyle = function (id) { + + $rootScope.setPropertiesForShapes = function (id) { + if ((document.getElementById('fill-option').checked == false) && (document.getElementById('Outline-Option').checked == false)) { // $('#btnShapeStyle').attr('disabled', 'disabled'); @@ -503,22 +477,22 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.shapestyleFillColor = $("#" + id).css('background-color'); $("#shapeStyleDiv").css("background-color", $rootScope.shapestyleFillColor); $rootScope.shapestyleborderColor = $("#" + id).parent().css("border-top-color"); - $("#shapeStyleDiv").parent().css("border-color", $rootScope.shapestyleborderColor); - $rootScope.shapestyleborderWidthSeparatingPixel = $("#" + id).parent().css("border-top-width"); - $("#shapeStyleDiv").parent().css("border-width", $rootScope.shapestyleborderWidthSeparatingPixel); - var pixelSeparation = $rootScope.shapestyleborderWidthSeparatingPixel; - var intPart = pixelSeparation.split("p"); - - $rootScope.shapestyleborderWidth = intPart[0]; - $rootScope.shapestyleborderStyles = "solid"; + // $("#shapeStyleDiv").parent().css("border-color", $rootScope.shapestyleborderColor); + $rootScope.borderDimensions = $("#" + id).parent().css("border-top-width"); + + document.getElementById("shapeStyleDiv").parentNode.style.border = $rootScope.borderDimensions + " " + "solid" + " " + $rootScope.shapestyleborderColor; + // $("#shapeStyleDiv").parent().css("border-width", $rootScope.shapestyleborderWidthSeparatingPixel); - $('#editshapestyle').modal('hide'); - // name: 'Circle_' + $rootScope.resetCircle, + var borderDimensions = $rootScope.borderDimensions; + var borderDimensionSplitArray = borderDimensions.split("p"); + $rootScope.shapestyleborderWidth = borderDimensionSplitArray[0]; + $rootScope.shapestyleborderStyles = "solid"; - // $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); + $('#editshapestyle').modal('hide'); + //Edit Shape Style popup should open at it's default position $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" }); } @@ -527,12 +501,10 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.enableAnnotationToolBar = function () { if ($rootScope.disableAnnotationTB == true) { document.getElementById('modelbackground').style.display = "none"; - //$("#editshapestyle").modal('show'); document.getElementById('modeleditstyle').style.display = "none"; } else { document.getElementById('modelbackground').style.display = "block"; - //$("#editshapestyle").modal('show'); document.getElementById('modeleditstyle').style.display = "block"; if ($('#modeleditstyle').css("display") == "block") { //Check if the modal is already showing var previewOpacity = $('#imgOpacity').css("opacity"); @@ -556,8 +528,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $(".custom-tooltip-annotation").css('display', 'none'); $("#edit-block").removeClass("custom-tooltip-annotation"); - - } @@ -570,299 +540,299 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //Edit Shape Style popup should open at it's default position $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" }); - } - + //--Common code of Annotation Toolbar for CI and DA------- + $rootScope.DrawLineOnModuleItem = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + if ($rootScope.isLinePreviewCompleted == true) { + $rootScope.isLinePreviewCompleted = false; + $(canvasId).addLayer({ + name: 'Line_' + LineNumber, + layer: true, + type: 'line', + draggable: true, + strokeStyle: shapestyleborderColor, + strokeWidth: shapestyleborderWidth, + rounded: true, + x1: offsetX1, y1: offsetY1, + x2: x, y2: y, - //----End------------- + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + radius: 3 + } + }).drawLayers(); - //--Common code of Annotation Toolbar for CI and DA------- - $rootScope.LineFn = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { - $(canvasId).addLayer({ - name: 'Line_' + LineNumber, - layer: true, - type: 'line', - draggable: true, - strokeStyle: shapestyleborderColor, - strokeWidth: shapestyleborderWidth, - rounded: true, - x1: offsetX1, y1: offsetY1, - x2: x, y2: y, - - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - radius: 3 - } - }).drawLayers(); - - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 0, - radius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - radius: 3 - } - }).drawLayers(); - } + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 0, + radius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { - }).drawLayers(); + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + radius: 3 + } + }).drawLayers(); + + } + + }).drawLayers(); + + } + $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - $rootScope.RectangleFn = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) { - // alert("offsetX:" + offsetX1 + " offsetY:" + offsetY1 + " x:" + x + " y:" + y); - $(canvasId).addLayer({ - layer: true, - name: 'Rect_' + RectNumber, - fillStyle: shapestyleFillColor, - type: 'rectangle', - draggable: true, - strokeStyle: shapestyleborderColor, - opacity: shapestyleOpacity, - strokeWidth: shapestyleborderWidth, - x: offsetX1, y: offsetY1, - width: x - offsetX1, - height: y - offsetY1, + $rootScope.DrawRectangleOnModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + if ($rootScope.isRectanglePreviewCompleted == true) { + $rootScope.isRectanglePreviewCompleted = false; + $(canvasId).addLayer({ + layer: true, + name: 'Rect_' + RectNumber, + fillStyle: shapestyleFillColor, + type: 'rectangle', + draggable: true, + strokeStyle: shapestyleborderColor, + opacity: shapestyleOpacity, + strokeWidth: shapestyleborderWidth, + fromCenter: false, + x: offsetX1, y: offsetY1, + width: (x - offsetX1), + height: (y - offsetY1), resizeFromCenter: true, - dblclick: function () { - // $rootScope.backOpacity(); - - }, - - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $(canvasId).setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: 'pink', - strokeStyle: 'yellow', - strokeWidth: 0, - width: 0, height: 0, - cornerRadius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); + dblclick: function () { - } - }).drawLayers(); + }, + + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $(canvasId).setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: 'pink', + strokeStyle: 'yellow', + strokeWidth: 0, + width: 0, height: 0, + cornerRadius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { + $(canvasId).setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + } + }).drawLayers(); + } $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - $rootScope.CircleFn = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) { + $rootScope.DrawCircleOnModuleItem = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) { + // console.log("up"+ offsetX1 + " " + offsetY1 + " " + (x - offsetX1) + " " + (y - offsetY1)); + if ($rootScope.isCirclePreviewCompleted == true) { + $rootScope.isCirclePreviewCompleted = false; + $(canvasId).addLayer({ + layer: true, + name: 'Circle_' + CircleNumber, + type: 'ellipse', + opacity: shapestyleOpacity, + draggable: true, + strokeStyle: shapestyleborderColor, + strokeWidth: shapestyleborderWidth, + fillStyle: shapestyleFillColor, + fromCenter: false, + x: (offsetX1), y: (offsetY1), + width: (x - offsetX1), height: (y - offsetY1), + // Place a handle at each side and each corner + handlePlacement: 'both', + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + radius: 3 + } + }).drawLayers(); + + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 0, + // width: 0, height: 0, + radius: 0 + } - $(canvasId).addLayer({ - layer: true, - name: 'Circle_' + CircleNumber, - type: 'ellipse', - opacity: shapestyleOpacity, - draggable: true, - strokeStyle: shapestyleborderColor, - strokeWidth: shapestyleborderWidth, - fillStyle: shapestyleFillColor, - x: offsetX1, y: offsetY1, - width: (x - offsetX1) * 2, height: (y - offsetY1) * 2, - // Place a handle at each side and each corner - handlePlacement: 'both', - - - - click: function (layer) { - - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - radius: 3 - } - }).drawLayers(); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 0, - // width: 0, height: 0, - radius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - radius: 3 - } - }).drawLayers(); + }).drawLayers(); - } - }).drawLayers(); + }, + mouseover: function (layer) { + + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + radius: 3 + } + }).drawLayers(); + + } + }).drawLayers(); + } $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - $rootScope.ArrowFn = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + $rootScope.DrawArrowOnModuleItem = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + if ($rootScope.isArrowPreviewCompleted == true) { + $rootScope.isArrowPreviewCompleted = false; + $('#canvas').drawLine({ + layer: true, + name: 'Arrow_' + ArrowNumber, + draggable: true, + strokeStyle: shapestyleborderColor, + strokeWidth: shapestyleborderWidth, + rounded: true, + startArrow: true, + arrowRadius: 7, + arrowAngle: 90, + x1: offsetX1, y1: offsetY1, + x2: x, y2: y, - $('#canvas').drawLine({ - layer: true, - name: 'Arrow_' + ArrowNumber, - draggable: true, - strokeStyle: shapestyleborderColor, - strokeWidth: shapestyleborderWidth, - rounded: true, - startArrow: true, - arrowRadius: 7, - arrowAngle: 90, - x1: offsetX1, y1: offsetY1, - x2: x, y2: y, - - click: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - radius: 3 - } - }).drawLayers(); - // $("#canvas").removeLayer(layer.name).drawLayers(); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 0, - // width: 0, height: 0, - radius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - - $(canvasId).setLayer(layer.name, { - handle: { - type: 'arc', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - // width: 5, height: 5, - radius: 3 - } - }).drawLayers(); + click: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + radius: 3 + } + }).drawLayers(); + // $("#canvas").removeLayer(layer.name).drawLayers(); - } + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 0, + // width: 0, height: 0, + radius: 0 + } - }); + }).drawLayers(); + + }, + mouseover: function (layer) { + + + $(canvasId).setLayer(layer.name, { + handle: { + type: 'arc', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + // width: 5, height: 5, + radius: 3 + } + }).drawLayers(); + + } + + }); + } + $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { - - var xAxisPinDiff = offsetX1 - x; - var yAxisPinDiff = offsetY1 - y; - if (xAxisPinDiff != 0 && yAxisPinDiff != 0) - { + $rootScope.DrawPinOnModuleItem = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { + + if ($rootScope.isPinPreviewCompleted == true) { + $rootScope.isPinPreviewCompleted = false; var radial = $('#canvas').createGradient({ x1: 50, y1: 50, x2: 50, y2: 50, @@ -948,13 +918,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fillStyle: radial, x: offsetX1, y: offsetY1, radius: 5, - //handle: { - // type: 'arc', - // fillStyle: '#fff', - // strokeStyle: '#c33', - // strokeWidth: 2, - // radius: 3 - //}, + add: function (layer) { @@ -966,17 +930,16 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", }).drawLayers(); } - + + $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - $rootScope.TextAreaFn = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { - - - debugger; - + $rootScope.TextEditorFunctionality = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { + if ($rootScope.isTextAreaPreviewCompleted == true) { + $rootScope.isTextAreaPreviewCompleted = false; $('#canvas').drawText({ layer: true, draggable: true, @@ -987,6 +950,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fillStyle: '#36c', strokeWidth: 0, x: $rootScope.offsetX1, y: $rootScope.offsetY1, + fromCenter: false, fontSize: '14pt', align: "left", fontFamily: 'Verdana, sans-serif', @@ -998,117 +962,119 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", }) - // Draw rect as wide as the text - .drawRect({ - layer: true, - name: "TextRect_" + $rootScope.TextNumber, - dragGroups: ['shapes'], - opacity: $rootScope.shapestyleOpacity, - strokeStyle: $rootScope.shapestyleborderColor, - strokeWidth: $rootScope.shapestyleborderWidth, - fillStyle: $rootScope.shapestyleFillColor, - x: $rootScope.offsetX1, y: $rootScope.offsetY1, - width: $rootScope.x - $rootScope.offsetX1, - height: $rootScope.y - $rootScope.offsetY1, - add: function (layer) { - - $rootScope.TextAreaRectID = layer.name; - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - $rootScope.CurrentWidth = layer.width; - $rootScope.CurrentHeight = layer.height; - - }, - click: function (layer) { - - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push(layer.name); - $('#canvas').setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); - - }, - dblclick: function (layer) { - - $rootScope.IsTextAlreadySave = false; - var RectNameArray = (layer.name).split("_"); - - var TextAreaRectangleName = "TextArea_"; - var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]); - $rootScope.TextAreaRectID = layer.name; - $rootScope.TextID = TextAreaRectNameConcat; - - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - $("#annotationTextModal").css("padding-right", "0px"); - document.getElementById('modelbackground').style.display = "block"; - $("#annotationTextModal").modal("toggle"); - - $("#text_area").val(''); - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); - - $("#selected-font-family option:eq(0)").prop('selected', true); - $("#selected-font-size option:eq(0)").prop('selected', true); - - $("#text-italic").removeClass("ActiveFormattingButtonClass"); - - $("#text-bold").removeClass("ActiveFormattingButtonClass"); - - $("#text-underline").removeClass("ActiveFormattingButtonClass"); - - $("#text-left").removeClass("ActiveFormattingButtonClass"); - - $("#text-right").removeClass("ActiveFormattingButtonClass"); - - $("#text-center").removeClass("ActiveFormattingButtonClass"); - - }, - mouseout: function (layer) { - $rootScope.canvasLayerNameCollection = []; - $('#canvas').setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: 'pink', - strokeStyle: 'yellow', - strokeWidth: 0, - width: 0, height: 0, - cornerRadius: 0 - } - - }).drawLayers(); - - }, - mouseover: function (layer) { - - $('#canvas').setLayer(layer.name, { - handle: { - type: 'rectangle', - fillStyle: '#fff', - strokeStyle: '#c33', - strokeWidth: 2, - width: 5, height: 5, - cornerRadius: 3 - } - }).drawLayers(); - - } - }); + // Draw rect as wide as the text + .drawRect({ + layer: true, + name: "TextRect_" + $rootScope.TextNumber, + dragGroups: ['shapes'], + opacity: $rootScope.shapestyleOpacity, + strokeStyle: $rootScope.shapestyleborderColor, + fromCenter: false, + strokeWidth: $rootScope.shapestyleborderWidth, + fillStyle: $rootScope.shapestyleFillColor, + x: $rootScope.offsetX1, y: $rootScope.offsetY1, + width: ($rootScope.x - $rootScope.offsetX1), + height: ($rootScope.y - $rootScope.offsetY1), + add: function (layer) { + + $rootScope.TextAreaRectID = layer.name; + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + // $rootScope.CurrentWidth = layer.width; + // $rootScope.CurrentHeight = layer.height; + + }, + click: function (layer) { + + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push(layer.name); + $('#canvas').setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + }, + dblclick: function (layer) { + + $rootScope.IsTextAlreadySave = false; + var RectNameArray = (layer.name).split("_"); + + var TextAreaRectangleName = "TextArea_"; + var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]); + $rootScope.TextAreaRectID = layer.name; + $rootScope.TextID = TextAreaRectNameConcat; + + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + $("#annotationTextModal").css("padding-right", "0px"); + document.getElementById('modelbackground').style.display = "block"; + $("#annotationTextModal").modal("toggle"); + + $("#text_area").val(''); + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); + + $("#selected-font-family option:eq(0)").prop('selected', true); + $("#selected-font-size option:eq(0)").prop('selected', true); + + $("#text-italic").removeClass("ActiveFormattingButtonClass"); + + $("#text-bold").removeClass("ActiveFormattingButtonClass"); + + $("#text-underline").removeClass("ActiveFormattingButtonClass"); + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").removeClass("ActiveFormattingButtonClass"); + + }, + mouseout: function (layer) { + $rootScope.canvasLayerNameCollection = []; + $('#canvas').setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: 'pink', + strokeStyle: 'yellow', + strokeWidth: 0, + width: 0, height: 0, + cornerRadius: 0 + } + + }).drawLayers(); + + }, + mouseover: function (layer) { + + $('#canvas').setLayer(layer.name, { + handle: { + type: 'rectangle', + fillStyle: '#fff', + strokeStyle: '#c33', + strokeWidth: 2, + width: 5, height: 5, + cornerRadius: 3 + } + }).drawLayers(); + + } + }); + + + // Annotation: Edit Text option is missing. - // alert($rootScope.CurrentWidth); - // alert($rootScope.CurrentHeight); $("#annotationTextModal").css("padding-right", "0px"); - if (($rootScope.CurrentWidth > 0 && $rootScope.CurrentHeight > 0) || ($rootScope.CurrentWidth > 0 && $rootScope.CurrentHeight <= 0) || ($rootScope.CurrentWidth <= 0 && $rootScope.CurrentHeight > 0)) { - $("#annotationTextModal").modal("toggle"); - document.getElementById('modelbackground').style.display = "block"; - } - $('.btnCursor').trigger('click'); + $("#annotationTextModal").modal("toggle"); + document.getElementById('modelbackground').style.display = "block"; + + } + $('.btnCursor').trigger('click'); $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); $("#text_area").val(''); @@ -1136,8 +1102,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').addClass('activebtncolor'); - - } @@ -1159,15 +1123,18 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", // var y = event.clientY; $rootScope.offsetX1 = 0; $rootScope.offsetY1 = 0; + //alert($location.path()); + + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; $rootScope.offsetX1 = event.offsetX; $rootScope.offsetY1 = event.offsetY; - ctx.clearRect(0, 0, 2277, 3248); $rootScope.clicked = true; - // alert("x:"+$rootScope.offsetX1 + " y:" + $rootScope.offsetY1); + canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); } - $rootScope.rectNumber = 0; $rootScope.LineNumber = 0; $rootScope.CircleNumber = 0; @@ -1184,98 +1151,157 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", var arrayRect = {}; var storeLine = ''; - //$rootScope.canvasLayerNameCollection1 = []; + $rootScope.OnPaintCanvasMouseUp = function (event) { if (!$rootScope.clicked) { return; } + var AnnotationCanvas = document.getElementById('canvas'); + AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); + + $(".line").remove(); + $(".arrow").remove(); + $(".pin").remove(); + $(".circle").remove(); + $(".rectangle").remove(); + $(".textarea").remove(); $rootScope.clicked = false; $rootScope.x = 0; $rootScope.y = 0; - - $rootScope.x = parseInt(event.clientX - ($("#canvas").offset().left)); - $rootScope.y = parseInt(event.clientY - ($("#canvas").offset().top)); - - + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; + $rootScope.x = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left; + $rootScope.y = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top; var canvasElement = document.getElementById("canvas"); var ctx = canvasElement.getContext("2d"); - var canvasPaintElement = document.getElementById("canvasPaint"); var PaintCanvasctx = canvasPaintElement.getContext("2d"); - - switch ($rootScope.shapeType) { - case "cursor": - // ctx.clearRect(0, 0, 2277, 3248); ctx.beginPath(); PaintCanvasctx.beginPath(); - - break; - case "Line": - //$rootScope.canvasLayerNameCollection = []; $rootScope.LineNumber = $rootScope.ObjectIndex++; - - $rootScope.LineFn('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) - + // $rootScope.isLinePreviewCompleted = true; + $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) break; - case "Rectangle": $rootScope.rectNumber = $rootScope.ObjectIndex++; - $rootScope.RectangleFn('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + // $rootScope.isRectanglePreviewCompleted = true; + $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); break; - case "Circle": - // alert($rootScope.shapestyleborderWidth); $rootScope.CircleNumber = $rootScope.ObjectIndex++; - - $rootScope.CircleFn('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + // $rootScope.isCirclePreviewCompleted = true; + $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); break; case "Arrow": $rootScope.ArrowNumber = $rootScope.ObjectIndex++; - - $rootScope.ArrowFn('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); - - // $scope.resetRect += 1; + //$rootScope.isArrowPreviewCompleted = true; + $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); break; case "Pin": $rootScope.PinNumber = $rootScope.PinObjectIndex++; $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++; - $rootScope.PinFn('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); + //$rootScope.isPinPreviewCompleted = true; + + $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); break; case "TextArea": - $rootScope.IsTextAlreadySave = false; $("#text_area").val(''); // Draw text $rootScope.resetTextRect = $rootScope.ObjectIndex++; $rootScope.TextNumber = $rootScope.ObjectIndex++; - $rootScope.TextAreaFn('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); + // $rootScope.isTextAreaPreviewCompleted = true; + $rootScope.TextEditorFunctionality('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); break; - case "DrawPolygon": - break; } //} } - - - - - + $rootScope.OnPaintCanvasMouseMove = function (event) { + var canvasDiv = document.getElementById('canvasDiv'); + var verticalScrollPosition = canvasDiv.scrollTop; + var horizontlScrollPosition = canvasDiv.scrollLeft; + $rootScope.MouseMoveXAxis = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left; + $rootScope.MouseMoveYAxis = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top; + switch ($rootScope.shapeType) { + case "Line": + $(".line").remove(); + $rootScope.isLinePreviewCompleted = true; + $("#canvasDiv").append("
"); + $rootScope.Annotationangle(); + break; + case "Arrow": + $(".arrow").remove(); + $rootScope.isArrowPreviewCompleted = true; + $("#canvasDiv").append("
"); + $rootScope.Annotationangle(); + break; + case "Pin": + $(".pin").remove(); + $rootScope.isPinPreviewCompleted = true; + $("#canvasDiv").append("
"); + $rootScope.Annotationangle(); + break; + case "Circle": + $(".circle").remove(); + $rootScope.isCirclePreviewCompleted = true; + $("#canvasDiv").append("
"); + break; + case "Rectangle": + $(".rectangle").remove(); + $rootScope.isRectanglePreviewCompleted = true; + $("#canvasDiv").append("
"); + break; + case "TextArea": + $(".textarea").remove(); + $rootScope.isTextAreaPreviewCompleted = true; + $("#canvasDiv").append("
"); + break; + } + } + $rootScope.Annotationangle = function (event) { + var dy = $rootScope.MouseMoveYAxis - $rootScope.offsetY1; + var dx = $rootScope.MouseMoveXAxis - $rootScope.offsetX1; + var theta = 0; + if (dx < 0) { + theta = Math.atan(dy / dx) * (180 / Math.PI); + theta = theta + 180; + } + else if (dy < 0) { + theta = Math.atan(dy / dx) * (180 / Math.PI); + theta = theta + 360; + } + else { + theta = Math.atan(dy / dx) * (180 / Math.PI); + } + var dottedLineWidth = Math.sqrt(($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) * ($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) + ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis) * ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis)); + switch ($rootScope.shapeType) { + case "Line": + $('.line').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); + break; + case "Arrow": + $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); + break; + case "Pin": + $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); + break; + } + } ///----- - $rootScope.saveText = function () { - debugger; + document.getElementById('modelbackground').style.display = "none"; // this part will work first time when save button will be clicked if ($rootScope.IsTextAlreadySave == false) { @@ -1290,15 +1316,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.textArea = $("#text_area").val(); // deleting previous text area - - $("#canvas").removeLayer($rootScope.TextID).drawLayers(); $("#canvas").removeLayer($rootScope.TextAreaRectID).drawLayers(); - - - // $("#canvas").removeLayer('TextArea_' + $rootScope.TextNumber).drawLayers(); - // $("#canvas").removeLayer("TextRect_" + $rootScope.TextNumber).drawLayers(); - // Text After Saving in Rectangle $rootScope.resetTextRect = $rootScope.ObjectIndex++; $('#canvas').drawText({ @@ -1310,6 +1329,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fillStyle: $rootScope.fontColor, fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle, fontSize: $rootScope.fontSizes, + fromCenter: false, fontFamily: $rootScope.fontFamily, align: $rootScope.textAlignmt, strokeWidth: 0, @@ -1333,6 +1353,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", opacity: $rootScope.shapestyleOpacity, strokeStyle: $rootScope.shapestyleborderColor, strokeWidth: $rootScope.shapestyleborderWidth, + fromCenter: false, x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, @@ -1365,31 +1386,12 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); var TextAreaRectName = "TextAreaNew_"; var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]); - // alert(TextAreaRectNameConcatenated); - //if (_rectLayerOnSaveSplit[1]%2 == 0) - //{ - // _rectLayerOnSaveSplit[1] = _rectLayerOnSaveSplit[1] - 1; - - //} - //else - //{ - - // _rectLayerOnSaveSplit[1] = _rectLayerOnSaveSplit[1]; - //} $rootScope.layerNameArr = layer.name; $rootScope.rectTextArr = TextAreaRectNameConcatenated; $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - // var _rectLayerOnSaveSplitInt; - - - // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); - - //alert(_rectLayerOnSaveSplitInt); - // alert($rootScope.TextPropertyArray.length); - for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) { if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) { @@ -1418,14 +1420,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", CurrentFontFamily = ''; CurrentFontSize = ''; - // $(".ActiveDefaultColorAnnotation").css({ "background-color": $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor + "!important" }); - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); - - - //adding text text decoration active class in text edit pop-up - - - if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") { @@ -1439,14 +1433,10 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } - - //adding text font weight active class in text edit pop-up if (fontWeightProp[0] == 700) { - - $("#text-bold").addClass("ActiveFormattingButtonClass"); } @@ -1491,9 +1481,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $("#text-left").removeClass("ActiveFormattingButtonClass"); $("#text-right").addClass("ActiveFormattingButtonClass"); - - - } else if ($rootScope.TextPropertyArray[i].Align == "center") { @@ -1504,12 +1491,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $("#text-center").addClass("ActiveFormattingButtonClass"); - - } - - } else { // alert("no"); @@ -1620,6 +1603,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fontFamily: _modifiedFontFamily, align: _modifiedTextAlign, strokeWidth: 0, + fromCenter: false, text: _modifiedText, x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, @@ -1634,6 +1618,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], opacity: $rootScope.shapestyleOpacity, + fromCenter: false, strokeStyle: $rootScope.shapestyleborderColor, strokeWidth: $rootScope.shapestyleborderWidth, x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, @@ -1809,9 +1794,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } else if ($rootScope.shapeTypeText == "textAreaRect") { - - - $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaRectangle).drawLayers(); $("#canvas").removeLayer($rootScope.canvasLayerNameCollection[0].textareaString).drawLayers(); $rootScope.shapeTypeText = ""; @@ -1819,7 +1801,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } else { - // alert($rootScope.canvasLayerNameCollection); $("#canvas").removeLayer($rootScope.canvasLayerNameCollection).drawLayers(); } @@ -1833,12 +1814,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", document.getElementById('modelbackground').style.display = "none"; - //if ($rootScope.isTextAreaClosedButtonActive == true) { - // $("#canvas").removeLayer('TextArea_' + $rootScope.TextNumber).drawLayers(); - // $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); - - //} - } //-- End ---------------------------- @@ -1875,17 +1850,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.PaintCanvasMousedownListener = function (canvasContext, x, y) { if ($rootScope.isLineDrawSelecyed == true) { - canvasContext.lineWidth = 0.1; - //$scope.paintCanvasContext.lineJoin = 'round'; - //$scope.paintCanvasContext.lineCap = 'round'; + canvasContext.lineWidth = 0.1; canvasContext.strokeStyle = 'red'; - - canvasContext.beginPath(); - - //var canvasOffset = $("#myCanvas").offset(); - //var offsetX = canvasOffset.left; - //var offsetY = canvasOffset.top; canvasContext.moveTo(x, y); } @@ -1942,22 +1909,24 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('#listManager').css('display', 'block'); $("#listManager").css("visibility", "visible"); - - // $('#termList option[selected="selected"]').prop("selected", false); - // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").prop("selected", true); - // $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); - // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); + + // $('#termList option[selected="selected"]').prop("selected", false); + // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").prop("selected", true); + // $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); + // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); $('#listManager').draggable(); $rootScope.islistManagerEventAlredayDispachted = true; $rootScope.$broadcast('listManagerEvent', true); - + $('#termList option[selected="selected"]').prop("selected", false); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); + + } $rootScope.CloseListManager = function () { @@ -1994,7 +1963,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } } - + $rootScope.prevId = ""; } function fillListManagerTerms() { @@ -2114,40 +2083,125 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", }; $rootScope.UpdateSetting = function (setting) { - + var isReloadingViewRequired = false; //1. if (typeof (setting.ethnicity) !== "undefined" && setting.ethnicity !== null) { $rootScope.ChangeEthnicity(setting, setting.ethnicity); - $rootScope.globalSetting.ethnicity = setting.ethnicity; - localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); - $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity); - } + } if (typeof (setting.modesty) !== "undefined" && setting.modesty !== null) { $rootScope.ChangeModesty(setting, setting.modesty); - $rootScope.globalSetting.modesty = setting.modesty; - localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); - $rootScope.setModestySettings($rootScope.globalSetting.modesty); } //2. - //localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); + if((setting.ethnicity!=null && setting.ethnicity!= $rootScope.globalSetting.ethnicity) && (setting.modesty!=null && setting.modesty != $rootScope.globalSetting.modesty) ){ + $rootScope.globalSetting.ethnicity = setting.ethnicity; + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); + + $rootScope.globalSetting.modesty = setting.modesty; + localStorage.setItem("globalModesty", setting.modesty); + + isReloadingViewRequired = true; + + } + + else if (setting.ethnicity!=null && setting.ethnicity != $rootScope.globalSetting.ethnicity) { - //3. - //localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); + $rootScope.globalSetting.ethnicity = setting.ethnicity; + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); - //4. - //$rootScope.reloadChildController(); + $rootScope.globalSetting.modesty = localStorage.getItem("globalModesty"); - var len = $rootScope.openModules.length; - if (len > 0) { - $rootScope.reloadChildController(); + isReloadingViewRequired = true; } - else { - $('#modal-settings').modal('hide'); + else if (setting.modesty!= null && setting.modesty != $rootScope.globalSetting.modesty) { + $rootScope.globalSetting.modesty = setting.modesty; + localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); + + $rootScope.globalSetting.ethnicity = localStorage.getItem("globalEthnicity"); + + if ($('.modestyImg') != null) { + if (($rootScope.globalSetting.modesty == 'Y')) { + $('.modestyImg').css('visibility', 'visible'); + } + + else { + $('.modestyImg').css('visibility', 'hidden'); + } + } + $rootScope.changeNavigatorModesty(); } + + var len = $rootScope.openModules.length; + if (len > 0) { + if (isReloadingViewRequired == true) { + $rootScope.reloadChildController(); + } + } + else { + $('#modal-settings').modal('hide'); + } }; + + + $rootScope.FreeStylePaint = function (e) { + + var annotationCanvas = document.getElementById("canvas"); + // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp); + + annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false); + + annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false); + } + + + + + $rootScope.OnPaintBrushCanvasMouseDown = function (event) { + $rootScope.isMousedownOnPaintCanvas = true; + $rootScope.isStartPointDeleted = false; + var annotationCanvas = document.getElementById("canvas"); + $rootScope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left)); + $rootScope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top)); + + annotationCanvas.addEventListener('mousemove', $rootScope.OnPaintBrushCanvasMouseMove, false); + + } + $rootScope.OnPaintBrushCanvasMouseMove = function (event) { + + $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left)); + $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top)); + + var btneraseBrushSizeValue = $("#btnBrushSize").val(); + $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue); + + if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) { + + var sktch = $('#canvasPaint').sketch(); + $('#canvasPaint').sketch().actions = []; + var paintCanvas = document.getElementById("canvasPaint"); + var paintCanvasContext = paintCanvas.getContext('2d'); + if ($rootScope.isStartPointDeleted == false) { + + paintCanvasContext.clearRect($rootScope.startPageX, $rootScope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize); + + $rootScope.isStartPointDeleted = true; + } + + paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize); + + + } + } + $rootScope.OnPaintBrushCanvasMouseUp = function (event) { + $rootScope.isMousedownOnPaintCanvas = false; + $rootScope.isEraseToolSelected = false; + + + } + + $rootScope.reloadChildController = function () { var len = $rootScope.openModules.length; @@ -2160,8 +2214,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //Check that what current bodyview is open if ($rootScope.openViews.length > 0) { var openViewLen = $rootScope.openViews.length; - var currentOpenViewId = $rootScope.openViews[openViewLen - 1].BodyViewId; - //$rootScope.isSettingEventAlredayDispachted = true; + var currentOpenViewId = localStorage.getItem("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId; + $rootScope.isSettingEventAlredayDispachted = true; $rootScope.$broadcast('reloadDABodyViewEvent', { reloadDABodyViewId: currentOpenViewId }, true); } else { @@ -2171,6 +2225,11 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } }; + $rootScope.changeNavigatorModesty = function () { + var currentOpenViewId = localStorage.getItem("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId; + + $rootScope.$broadcast('changeNavigatorModestyEvent', { bodyViewId: currentOpenViewId }, true); + }; }] ); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html index feb1045..e408134 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html @@ -59,43 +59,43 @@
- +
- - - - - + + + + + - - - - - - - - diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index 5934b62..e120ad1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -238,7 +238,7 @@
- +
@@ -313,7 +313,7 @@
TitleRegionSystemSpecialty
TitleRegionSystemSpecialty
+ {{item._Title}} + {{item._BodyRegion}} + {{item._BodySystem}} + {{item._MedicalSpecialty}}
+ {{item._Title}} + {{item._BodyRegion}} + {{item._BodySystem}} + {{item._MedicalSpecialty}}