diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 5190381..8f2a509 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -440,23 +440,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } // 0.2 getting corresponding body view title - var counter = 1; + //var counter = 1; var tittle = localStorage.getItem("currentViewTitleFromJson"); + localStorage.setItem("currentViewTitle", tittle); - if (openViews != null && openViews != undefined) { - angular.forEach(openViews, function (value, key) { + //WILL BE USED WHEN MULTI VIEWOPEN FUNCTIONALITY IS IMPELMNETD + //if (openViews != null && openViews != undefined) { + // angular.forEach(openViews, function (value, key) { - if (value.bodyView == tittle) { - tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; - $rootScope.currentActiveViewTitle = tittle; - localStorage.setItem("currentViewTitle", tittle); - } + // if (value.bodyView == tittle) { + // tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + // $rootScope.currentActiveViewTitle = tittle; + // localStorage.setItem("currentViewTitle", tittle); + // } - }); - } - else { - localStorage.setItem("currentViewTitle", tittle); - } + // }); + //} + //else { + // localStorage.setItem("currentViewTitle", tittle); + //} //0.3 @@ -470,6 +472,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo url: 'app/views/da/da-view.html' }, title: localStorage.getItem("currentViewTitle"), + position: { top: 70, left: 1, @@ -737,6 +740,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + // annotation toolbar canvas if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { @@ -746,6 +752,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + + $scope.terminateCurrentlyRunningWPs(); var drawnBodyRegionCount = []; @@ -950,8 +958,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }); - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + //$rootScope.isLoading = false; + //$('#spinner').css('visibility', 'hidden'); } if (($rootScope.globalSetting.modesty == 'Y')) { @@ -1207,6 +1215,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + var FlipedImgCanvas = document.createElement('canvas'); FlipedImgCanvas.height = h; FlipedImgCanvas.width = w; @@ -1518,7 +1529,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#spinner').css('visibility', 'visible'); $scope.highLightBody(); } - else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $rootScope.isHighlightBodyByBodySystem == true) { + else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) + || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $rootScope.isHighlightBodyByBodySystem == true) { console.log('1. $rootScope.isHighLight= ' + $rootScope.isHighLight) @@ -1533,6 +1545,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //}, 500); } } + else { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } } // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); @@ -1565,6 +1581,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + var imgCanvas = document.createElement('canvas'); imgCanvas.height = h; @@ -1877,7 +1896,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#spinner').css('visibility', 'visible'); $scope.highLightBody(); } - else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) { + else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) + || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) { console.log('2. $rootScope.isHighLight= ' + $rootScope.isHighLight) @@ -1895,6 +1915,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } + else { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } } console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); @@ -1969,6 +1993,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var CallBackBodyRegion = []; var selectedAnnotation; + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0) && $rootScope.isListManagerSelected) { + + multiTermList = $scope.AllTerms; + angular.forEach($rootScope.previousHighlightList, function (value, key) { + + var ActualTermNo = $scope.getActualTermNumber(value); + selectedAnnotation = ActualTermNo; + if (ActualTermNo != null) { + var TermList = $scope.getTermNumberList(ActualTermNo); + if (TermList != null) { + for (var i = 0; i < TermList.length; i++) { + multiTermList.push(TermList[i]); + } + } + } + + // to do + }); + } + if ($rootScope.isListManagerSelected) { multiTermList = $scope.AllTerms; @@ -2165,7 +2209,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.aligneCanvasWithTerm() } - $timeout(function () { $scope.DisableProgressBar() }, 1000); + // $timeout(function () { $scope.DisableProgressBar() }, 1000); @@ -2399,16 +2443,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.doAligneCanvasWithTerm == true) { - if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) + if ($rootScope.isListManagerSelected == true) + $scope.aligneCanvasWithTerm(); + + else if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) { $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + $('#spinner').css('visibility', 'hidden'); + } // $rootScope.isHighlightBodyByBodySystem = false; - if ($rootScope.isListManagerSelected == true) - $scope.aligneCanvasWithTerm(); + } } // @@ -5018,56 +5065,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.flushCanvas = function () { - //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) { - // angular.forEach($scope.ColoredImageSRC, function (value, key) { - - // var id; - // var maskId; - // if (value.haveMirror == 'true') { - // id = 'imageCanvas' + value.bodyRegionId + '_MR'; - // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci' - // } - // else { - // id = 'imageCanvas' + value.bodyRegionId; - // maskId = 'imageCanvas' + value.bodyRegionId + '_mci'; - // } - - // var canvas = document.getElementById(id); - // if (canvas != null || canvas != undefined) { - // document.getElementById('canvasDiv').removeChild(canvas); - // } - - // var maskcanvas = document.getElementById(maskId); - // if (maskcanvas != null || maskcanvas != undefined) { - // document.getElementById('canvasDiv').removeChild(maskcanvas); - // } - // if (i == 4 || i == 5 || i == 6) { - // id = 'imageCanvas' + i + '_MR'; - // maskId = 'imageCanvas' + i + '_MR_mci'; - - // var canvas = document.getElementById(id); - // if (canvas != null || canvas != undefined) - // document.getElementById('canvasDiv').removeChild(canvas); - - // var maskcanvas = document.getElementById(maskId); - // if (maskcanvas != null || maskcanvas != undefined) - // document.getElementById('canvasDiv').removeChild(maskcanvas); - // } + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); - // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); - // for (var i = 0; i < modestyCanvases.length; i++) { - // modestyCanvases[i].remove(); - // } - // }); - // //remove modesty canavs - // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); - // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) { - // for (var j = 0; j < modestyCanvases.length; j++) { - // modestyCanvases[j].remove(); - // } - // } - //} var endIndex = 0; var startIndex = 0; if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) { @@ -5123,7 +5124,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) { for (var j = 0; j < modestyCanvases.length; j++) { - modestyCanvases[j].remove(); + + modestyCanvases[j].parentNode.removeChild(modestyCanvases[j]); } } } @@ -5259,7 +5261,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isZoomed = false; //6. - $rootScope.isListManagerSelected = false; + // $rootScope.isListManagerSelected = false; + if ($rootScope.actualTermNumber != null && $rootScope.actualTermNumber!=undefined && $rootScope.isListManagerSelected == true) { + $rootScope.isListManagerSelected = false; + $rootScope.isListManagerAlreadySelected = true; + } //7. @@ -5621,9 +5627,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.isEligibleForHighlightBodyByTermList == true) { //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { - $scope.isLoading = false; + //$scope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + //$('#spinner').css('visibility', 'hidden'); //} if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { @@ -5634,7 +5640,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#spinner').css('visibility', 'visible'); $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); } - else if (($rootScope.isListManagerSelected == true) || ($rootScope.previousHighlightList != null && $rootScope.previousHighlightList.length > 0) && ($rootScope.isGenderChnage==true || $rootScope.isViewChange==true)) { + else if (($rootScope.isListManagerSelected == true) || ($rootScope.previousHighlightList != null && $rootScope.previousHighlightList.length > 0) && ($rootScope.isGenderChnage==true || $rootScope.isViewChange==true) || $rootScope.isListManagerAlreadySelected==true) { // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length); $timeout(function () { @@ -5914,11 +5920,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isGenderChnage = true; + + if ($rootScope.isExtract == true) { + $rootScope.isExtract = false; + $rootScope.isHighLight = true; + } + + var viewname = localStorage.getItem("currentViewTitle") var currentBodyViewId = $scope.correspondingBodyViewIds[$rootScope.voId]; - if ((event.currentTarget.attributes[1].value == 'Male') && (localStorage.getItem("genderId") == 'Female')) { + if ((event.currentTarget.title == 'Male') && (localStorage.getItem("genderId") == 'Female')) { //1. localStorage.setItem("genderId", 'Male'); @@ -5950,7 +5963,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - else if ((event.currentTarget.attributes[1].value == 'Female') && (localStorage.getItem("genderId") == 'Male')) { + else if ((event.currentTarget.title == 'Female') && (localStorage.getItem("genderId") == 'Male')) { //1. localStorage.setItem("genderId", 'Female'); @@ -6126,9 +6139,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $rootScope.isViewChange = true; + + if ($rootScope.isExtract == true) { + $rootScope.isExtract = false; + $rootScope.isHighLight = true; + } + $scope.layerNumber = 0; // debugger; - var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; + //var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; + var selectedViewId = $scope.bodyViews[event.currentTarget.title]; + $rootScope.viewOrientationId = selectedViewId; if (localStorage.getItem("genderId") == 'Male') { if ($rootScope.voId != selectedViewId) { @@ -6193,8 +6214,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + $scope.bodyViews[event.currentTarget.attributes[1].value; } - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value; - localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.attributes[1].value); + $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("genderId") + " " + event.currentTarget.title; + localStorage.setItem("currentViewTitle", localStorage.getItem("genderId") + " " + event.currentTarget.title); $rootScope.openViews.push( @@ -6962,7 +6983,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var j = 0; j < $scope.VocabTermTxt.length; j++) { - var $el = $('').appendTo('#termList') + var $el = $('').appendTo('#termList') $compile($el)($scope); } @@ -6988,6 +7009,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#spinner').css('visibility', 'hidden'); } else { + + $rootScope.isLoading = true; + + $('#spinner').css('visibility', 'visible'); + + $rootScope.prevId = event.currentTarget.id; $("#termList").find("option").attr('selected', false); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); @@ -7010,10 +7037,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } //--- - $rootScope.isLoading = true; - - $('#spinner').css('visibility', 'visible'); - + $rootScope.isHighlightBodyByBodySystem = false; //1. @@ -7119,8 +7143,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //8.remove current layer canavses $scope.flushCanvas(); - - + //9. $timeout(function () { @@ -7135,6 +7158,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //DA > Annotation's Line should not displayed. $("#bord").css("display", "none"); + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + //redraw body of respective layer $scope.CalculateImageCordinates($rootScope.viewOrientationId) }, 500); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 1ccfff6..6b6858a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -964,6 +964,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $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) { @@ -1045,9 +1047,14 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } }); - + // Annotation: Edit Text option is missing. + // alert($rootScope.CurrentWidth); + // alert($rootScope.CurrentHeight); $("#annotationTextModal").css("padding-right", "0px"); - $("#annotationTextModal").modal("toggle"); + 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'); $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" }); @@ -1182,7 +1189,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", break; case "TextArea": - document.getElementById('modelbackground').style.display = "block"; + $rootScope.IsTextAlreadySave = false; $("#text_area").val(''); // Draw text