diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index b1ff198..1965d93 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -84,7 +84,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.updatedWhiteImageMRDataList = []; //normal mode - $rootScope.isNormalMode = false; + $rootScope.isNormalMode = true; $rootScope.isZoomed = false; //navigator man functionality @@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //get the DA body view list based on selected gender $scope.getDAViewList = function ($event) { - + if ($('#MainImage') != null) { $('#MainImage').remove(); } @@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; - + var $el = $('
' + '' @@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.openView = function ($event) { - + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -682,7 +682,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.LoadDefaultLayerImage = function () { - + $rootScope.isNormalMode = true; $scope.layerNumber = 0; @@ -954,7 +954,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //set scrollbars on canvas and hide loading label $('#daLoaderLabel').css('visibility', 'hidden') - + $('#canvasDiv').css('overflow', 'scroll') if (isiOSSafari) { $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150) @@ -963,7 +963,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) } - + // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) $('#canvasDiv').scrollTop(50) @@ -1005,7 +1005,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }; } - + $('#draggable').css('width', dragdivw); $('#draggable').css('height', dragdivh) @@ -1068,7 +1068,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.GetImageSource = function (bodyRegionId) { - + var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; //set max for LayerNumber input @@ -1086,7 +1086,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.userInput = parseInt($scope.layerNumber); - + $scope.skinTone = $rootScope.globalSetting.ethnicity; var SelectedLayerData = []; @@ -1148,7 +1148,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.GetBackgroundImgSource = function (bodyRegionId) { - + var selectedGender; if (localStorage.getItem("genderId") == "Male") { @@ -1166,7 +1166,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) { //filter bodyRegion data basd on skintone - $scope.skinTone = $rootScope.globalSetting.ethnicity + $scope.skinTone = $rootScope.globalSetting.ethnicity $scope.bagartDetailsOnSktn = new jinqJs() .from($scope.bagartBodyRegionDetails) .where('_Skintone == ' + $scope.skinTone) @@ -1306,6 +1306,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } var RGBColor = (Red + Green + Blue); + $rootScope.previousHighlightList.push(RGBColor); + + if ($rootScope.isHighLight) { if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) { @@ -1343,15 +1346,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $rootScope.previousHighlightList.push(RGBColor); + // $rootScope.previousHighlightList.push(RGBColor); $scope.highLightBodyBasedOnIcolor(RGBColor); } - if ($rootScope.isNormalMode == true) { + //if ($rootScope.isNormalMode == true) { + + // $rootScope.previousHighlightList.push(RGBColor); + //} - $rootScope.previousHighlightList.push(RGBColor); + //extarct clicked body part is extarct button is already enabled. + debugger; + if ($rootScope.isExtract == true) { + $scope.enableExtract(false); } var annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); @@ -1433,18 +1442,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (isMaskImage == 'N') { - - $scope.ColoredImageSRC.push( - { - "bodyRegionId": bodyRegionId, "SRC": src, - "Height": h, - "Width": w, - "x": x, - "y": y, - "haveMirror": 'true' - } - ); - + + $scope.ColoredImageSRC.push( + { + "bodyRegionId": bodyRegionId, "SRC": src, + "Height": h, + "Width": w, + "x": x, + "y": y, + "haveMirror": 'true' + } + ); + // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) @@ -1467,9 +1476,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isEligibleForHighlight = false; } - if ($scope.isEligibleForHighlight == true) - { - if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { + if ($scope.isEligibleForHighlight == true) { + 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) { $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1634,6 +1642,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + $rootScope.previousHighlightList.push(RGBColor); if ($rootScope.isHighLight == true) { if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) { @@ -1672,7 +1681,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $rootScope.previousHighlightList.push(RGBColor); + // $rootScope.previousHighlightList.push(RGBColor); if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { } @@ -1683,8 +1692,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - if ($rootScope.isNormalMode == true) { - $rootScope.previousHighlightList.push(RGBColor); + //if ($rootScope.isNormalMode == true) { + // $rootScope.previousHighlightList.push(RGBColor); + //} + + debugger; + //extarct clisked body part is extarct button is already enabled. + if ($rootScope.isExtract == true) { + $scope.enableExtract(false); } if ($('#speechBubbleTrns').length > 0) @@ -1748,7 +1763,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo img.src = src; - + function start() { @@ -1761,19 +1776,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //do nothing } else { - - $scope.ColoredImageSRC.push( - { - "bodyRegionId": bodyRegionId, "SRC": src, - "Height": h, - "Width": w, - "x": x, - "y": y, - "haveMirror": 'false' - } - - ); - + + $scope.ColoredImageSRC.push( + { + "bodyRegionId": bodyRegionId, "SRC": src, + "Height": h, + "Width": w, + "x": x, + "y": y, + "haveMirror": 'false' + } + + ); + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { @@ -1793,15 +1808,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isEligibleForHighlight = false; } - if ($scope.isEligibleForHighlight == true) - { - - if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { + if ($scope.isEligibleForHighlight == true) { + + 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) { $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - + console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) $rootScope.isHighLight = true; @@ -1810,7 +1824,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.highLightBody(); console.log('just after highLightBody call'); - + } } } @@ -1861,16 +1875,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.HighlightBodyOnExtract = function () { + console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length) - var multiTermList = []; var CallBackBodyRegion = []; if ($rootScope.isListManagerSelected) { - + multiTermList = $scope.AllTerms; - - } + + } else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { angular.forEach($rootScope.previousHighlightList, function (value, key) { @@ -2275,13 +2289,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.doAligneCanvasWithTerm == true) { - if ( $rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) + if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + $('#spinner').css('visibility', 'hidden'); - //$rootScope.isHighlightBodyByBodySystem = false; + // $rootScope.isHighlightBodyByBodySystem = false; if ($rootScope.isListManagerSelected == true) $scope.aligneCanvasWithTerm(); @@ -2428,10 +2442,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //layer change function $scope.LayerChange = function () { - + //if listanager is visisble then close it - // $rootScope.isListManagerSelected = false; - + // $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); @@ -2520,7 +2534,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { - + //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box. var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) { @@ -2553,11 +2567,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition) - if ( $rootScope.isHighlightBodyByBodySystem) { + if ($rootScope.isHighlightBodyByBodySystem) { $timeout(function () { $scope.DisableProgressBar() }, 20000); } - else - { + else { $timeout(function () { $scope.DisableProgressBar() }, 2000); } } @@ -2565,9 +2578,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber)); } - $scope.LayerChangeOnMouseUpDown = function (e) - { - + $scope.LayerChangeOnMouseUpDown = function (e) { + $scope.LayerChange(); } @@ -2605,6 +2617,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } console.log('highLightBody call from DisableProgressBar') + // $scope.highLightBody(); @@ -3435,7 +3448,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isTransparencyActivated = true; - //do not create TBOX if in extarct mode otherwise create + //do not create TBOX if in extarct mode otherwise create if ($rootScope.isExtract == false) { $("#btnExtract").addClass("disabled"); @@ -3445,7 +3458,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.CloseListManager(); - + // alert('transparencyClicked' + $scope.isTransparencyActivated) $('#btnTranparency').addClass('tButtonActive'); $('#btnIdentity').removeClass(' btn-primary'); @@ -3694,7 +3707,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#btnTranparency').addClass('tButtonActive'); //debugger; - // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1); + // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1); //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected. $('#btnTranparency').removeClass('tButtonActive'); $('#btnTranparency').addClass('btn-black'); @@ -3857,8 +3870,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //do nothing } else if (isLayerChanged) { - - // alert('isMousUp on isLayerChanged'); + + // alert('isMousUp on isLayerChanged'); $scope.layerNumber = parseInt($('#txtlayerNumber').val()); @@ -3871,23 +3884,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var tranparencyLayer; var currentLayer = parseInt($('#txtlayerNumber').val()); - if (currentLayer == $rootScope.totalLayers) { - - tranparencyLayer = currentLayer; - - } - - else - { - + if (currentLayer == $rootScope.totalLayers) { + + tranparencyLayer = currentLayer; + + } + + else { + tranparencyLayer = currentLayer + 1; - - } - - $scope.layerNumber = tranparencyLayer; + + } + + $scope.layerNumber = tranparencyLayer; } - + $('#txtlayerNumber').val($scope.layerNumber); //dedebugger; @@ -4679,7 +4691,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //if listanager is visisble then close it - + $rootScope.isListManagerSelected = false; $rootScope.CloseListManager(); // $('#btnIdentity').addClass('btn-primary'); @@ -4727,7 +4739,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isZoomed = true; //1. - + $scope.flushCanvas(); if ($scope.zoomInOut == 25) { @@ -4766,48 +4778,102 @@ 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) { + //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 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 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); + // 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'; + // } + // 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); + // } + + // 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 loopLength = 0; + if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) { + loopLength = 7; + } + else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')){ + loopLength = 5; + } + else if (($rootScope.viewOrientationId == '5')) { + loopLength = 4; + } + else if (($rootScope.viewOrientationId == '6')) { + loopLength = 1; + } - var canvas = document.getElementById(id); - if (canvas != null || canvas != undefined) - document.getElementById('canvasDiv').removeChild(canvas); + for (var i = 1; i < loopLength; i++) { - var maskcanvas = document.getElementById(maskId); - if (maskcanvas != null || maskcanvas != undefined) - document.getElementById('canvasDiv').removeChild(maskcanvas); - } + var id; + var maskId; + + id = 'imageCanvas' + i; + maskId = 'imageCanvas' + i + '_mci'; + + var canvas = document.getElementById(id); + if (canvas != null || canvas != undefined) + document.getElementById('canvasDiv').removeChild(canvas); - var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); - for (var i = 0; i < modestyCanvases.length; i++) { - modestyCanvases[i].remove(); + var maskcanvas = document.getElementById(maskId); + if (maskcanvas != null || maskcanvas != undefined) + document.getElementById('canvasDiv').removeChild(maskcanvas); + + if (loopLength == 7) { + + 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); } - }); + } + //remove modesty canavs var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']"); if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) { @@ -4817,7 +4883,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - + } $scope.terminateCurrentlyRunningWPs = function () { @@ -4837,11 +4903,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.enableHighlight = function () { - + // $("#btnExtract").removeClass("disabled"); - $("#btnTranparency").removeClass("disabled"); - // $rootScope.isTransparencyBoxActivated = false; - // $rootScope.isNormalMode = false; + $("#btnTranparency").removeClass("disabled"); + // $rootScope.isTransparencyBoxActivated = false; + // $rootScope.isNormalMode = false; //if listanager is visisble then close it @@ -4909,12 +4975,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isNormalMode = false; console.log('enableNormalMode is called'); - + // $rootScope.isHighLight = false; //to do should not call every time $rootScope.CloseListManager(); - + $rootScope.isHighlightBodyByBodySystem = false; @@ -4947,7 +5013,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition); $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); - + } @@ -4974,7 +5040,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $scope.enableExtract = function () { + $scope.enableExtract = function (isCalledFromButton) { + + console.log('isCalledFromButton= ' + isCalledFromButton); $rootScope.isHighlightBodyByBodySystem = false; @@ -4982,7 +5050,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop(); $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); - + if ($scope.isTransparencyActivated == true) { @@ -4994,42 +5062,70 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { - + $rootScope.CloseListManager(); //1. - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); + //$rootScope.isLoading = true; + //$('#spinner').css('visibility', 'visible'); //2. $scope.terminateCurrentlyRunningWPs(); - //3. - if ($rootScope.isExtract == true) { + //3. + //if extarct is alraedy enabled and user cliked on any body part then extract that. + if (isCalledFromButton == false) { + + $rootScope.isExtract = true; + //disable transparency button + + $("#btnTranparency").addClass("disabled"); - } - else { - $rootScope.isExtract = true; - //disable transparency button - - $("#btnTranparency").addClass("disabled"); + if ($rootScope.isNormalMode == true) { - if ($rootScope.isNormalMode == true) { + $rootScope.isHighLight = false; + $rootScope.isNormalMode = false; + } + else { + + $rootScope.isHighLight = false; + } + + //4. + console.log('highLightBody from enableExtract') + $scope.highLightBody(); - $rootScope.isHighLight = false; - $rootScope.isNormalMode = false; } else { - $rootScope.isNormalMode = false; - $rootScope.isHighLight = false; - } - //4. - console.log('highLightBody from enableExtract') - $scope.highLightBody(); + if ($rootScope.isExtract == true) { + } + else { + $rootScope.isExtract = true; + //disable transparency button + + $("#btnTranparency").addClass("disabled"); + + + if ($rootScope.isNormalMode == true) { + + $rootScope.isHighLight = false; + $rootScope.isNormalMode = false; + } + else { + + $rootScope.isHighLight = false; + } + + //4. + console.log('highLightBody from enableExtract') + $scope.highLightBody(); - } + + } + } + //5. unhighlight other //$scope.Normal = ""; @@ -5075,9 +5171,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.highLightBody = function () { - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); - $scope.Normal = ""; $scope.Extract = ""; @@ -5162,194 +5255,160 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var colorMode; if ($scope.isExtract == true) { - colorMode = $scope.applyWhiteMatrix(img, context_gray); + + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) { + + colorMode = $scope.applyWhiteMatrix(img, context_gray); + } } else { colorMode = $scope.applyGrayMatrix(img, context_gray); } - var zeroPoint = new Point(); + console.log('colorMode inside if = ' + colorMode); - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); + if (colorMode != undefined || colorMode != null) { - context_gray.putImageData(DAData.data, 0, 0) + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); - //NIKI- to resolve lateral arm black issue in highlight mode - if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) { + var zeroPoint = new Point(); - var imgData = context_gray.getImageData(0, 0, width, ht); - var data = imgData.data; - var c = 0; - for (var i = 0; i < data.length; i += 4) { - if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { - data[i + 3] = 0; - } + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - } - context_gray.putImageData(imgData, 0, 0); - } - //push BRID into array - $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); + context_gray.putImageData(DAData.data, 0, 0) - var grayImageData = context_gray.getImageData(0, 0, width, ht); - var grayImageImageDataVar = grayImageData.data; + //NIKI- to resolve lateral arm black issue in highlight mode - if ($scope.isExtract == true) { - if (value.haveMirror == 'true') { - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { + if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) { - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } - } - else { + var imgData = context_gray.getImageData(0, 0, width, ht); + var data = imgData.data; + var c = 0; + for (var i = 0; i < data.length; i += 4) { + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { + data[i + 3] = 0; + } - if (value.haveMirror == 'true') { - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + } + context_gray.putImageData(imgData, 0, 0); } - else { - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } - } + //push BRID into array + $scope.grayedBR.push({ 'BRID': value.bodyRegionId }); + var grayImageData = context_gray.getImageData(0, 0, width, ht); + var grayImageImageDataVar = grayImageData.data; - if ($scope.grayedBR != null || $scope.grayedBR != undefined) { - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; - } - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; - } - else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; - } - else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { - $scope.isEligibleForHighlightBodyByTermList = true; - $scope.doHighlightOrExtract = false; + if ($scope.isExtract == true) { + if (value.haveMirror == 'true') { + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + } + else { + + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } } else { - $scope.isEligibleForHighlightBodyByTermList = false; + if (value.haveMirror == 'true') { + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + } + else { + + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } } - if ($scope.isEligibleForHighlightBodyByTermList == true) { - //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE - // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { - $scope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); - //} + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { + $scope.isEligibleForHighlightBodyByTermList = true; + $scope.doHighlightOrExtract = false; + } + else { - - if (( $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { + $scope.isEligibleForHighlightBodyByTermList = false; + } + if ($scope.isEligibleForHighlightBodyByTermList == true) { + //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE + // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { + $scope.isLoading = false; - $scope.isLoading = true; + $('#spinner').css('visibility', 'hidden'); + //} - $('#spinner').css('visibility', 'visible'); - $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); - } - else if ($rootScope.isListManagerSelected == true) { + if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { - // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length); - $timeout(function () { $scope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); + } + else if ($rootScope.isListManagerSelected == true) { - $scope.HighlightBodyByTermList($scope.AllTerms) - }, 800); + // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length); + $timeout(function () { + + $scope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + + $scope.HighlightBodyByTermList($scope.AllTerms) + }, 800); + + } + else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { + $scope.createTermListByPreviousTermsAndHighlight(); + } - } - else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - $scope.createTermListByPreviousTermsAndHighlight(); } } } - } + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); + console.log('highlightboy. $rootScope.isExtract= '+$rootScope.isExtract+', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length) + if ($rootScope.isExtract == true) { + if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { + console.log('1. $rootScope.isExtract=true and $rootScope.previousHighlightList != null') + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); + } + else if ($rootScope.isListManagerSelected == true) { + console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') - if ($rootScope.isExtract == true) { - if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - console.log('1. $rootScope.isExtract=true and $rootScope.previousHighlightList != null') + $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - } - else if ($rootScope.isListManagerSelected == true) { - console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') - - $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - + } } } - //else { - // // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode - // //and then highlight the previously selected body regions at the time of normal mode. - // if ($scope.grayedBR != null || $scope.grayedBR != undefined) { - // if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { - // $scope.isEligibleForHighlightBodyByTermList = true; - // } - // else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { - // $scope.isEligibleForHighlightBodyByTermList = true; - // } - // else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { - // $scope.isEligibleForHighlightBodyByTermList = true; - // } - // else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { - // $scope.isEligibleForHighlightBodyByTermList = true; - // } - - - // } - - // // - //} }) - //if ($scope.isEligibleForHighlightBodyByTermList == true) { - // if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) { - - // var multiTermList = []; - // angular.forEach($rootScope.previousHighlightList, function (value, key) { - - // //debugger; - - // var ActualTermNo = $scope.getActualTermNumber(value); - // if (ActualTermNo != null) { - // var TermList = $scope.getTermNumberList(ActualTermNo); - // if (TermList != null) { - // for (var i = 0; i < TermList.length; i++) { - - // multiTermList.push(TermList[i]); - // } - // } - // } - - // }); - // console.log('HighlightBodyByTermList call with multiTermList') - - // $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80); - // } - //} - } else { // This code will execute when user will select normal Mode but this time isHighlight will be false + console.log('highlightboy ELSE. $rootScope.isExtract= ' + $rootScope.isExtract + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length) angular.forEach($scope.ColoredImageSRC, function (value, key) { var id; @@ -5404,40 +5463,50 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var colorMode; if ($scope.isExtract == true) { - colorMode = $scope.applyWhiteMatrix(img, context); + if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) { + + colorMode = $scope.applyWhiteMatrix(img, context); + } } - var zeroPoint = new Point(); + console.log('colorMode inside else = ' + colorMode); + if (colorMode != undefined || colorMode != null) { - DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); - context.putImageData(DAData.data, 0, 0) + var zeroPoint = new Point(); - var grayImageData = context.getImageData(0, 0, width, ht); - var grayImageImageDataVar = grayImageData.data; + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); - if ($scope.isExtract == true) { - if (value.haveMirror == 'true') { - $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; - } - else { + context.putImageData(DAData.data, 0, 0) - $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; - } - } - else { + var grayImageData = context.getImageData(0, 0, width, ht); + var grayImageImageDataVar = grayImageData.data; + + if ($scope.isExtract == true) { + if (value.haveMirror == 'true') { + $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + } + else { - if (value.haveMirror == 'true') { - $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } } else { - $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + if (value.haveMirror == 'true') { + $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData; + } + else { + + $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData; + } } } - } - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); + } }) if ($rootScope.isExtract == true) { @@ -5453,7 +5522,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else if ($rootScope.isListManagerSelected == true) { console.log('2. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); - + } } @@ -5541,12 +5610,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isTransparencyBoxActivated = false; $rootScope.isNormalMode = false; + //close transparecny box + $scope.CloseTransparencyBox(); + //if listanager is visisble then close it - - // $rootScope.isListManagerSelected = false; + + // $rootScope.isListManagerSelected = false; $rootScope.CloseListManager(); - $rootScope.isHighlightBodyByBodySystem = false; + // $rootScope.isHighlightBodyByBodySystem = false; @@ -5567,6 +5639,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo localStorage.setItem("currentBodyViewId", currentBodyViewId); //3. + $scope.layerNumber = 0; $scope.loadSelectedBodyView(currentBodyViewId); //4. @@ -5594,6 +5667,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo localStorage.setItem("currentBodyViewId", currentBodyViewId); //3. + $scope.layerNumber = 0; $scope.loadSelectedBodyView(currentBodyViewId); //4. @@ -5650,7 +5724,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //To fix issue of gray maintained in after closing jspanel after listmanager selection $rootScope.isListManagerSelected = false; $rootScope.isHighLight = false; - $rootScope.isNormalMode = false; + //$rootScope.isNormalMode = false; + $rootScope.isHighlightBodyByBodySystem = false; $rootScope.CloseListManager(); }) @@ -5689,18 +5764,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo canDiv.innerHTML = ''; } //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender - + if (($rootScope.isListManagerSelected == true) && (($rootScope.isGenderChnage == true) || $rootScope.isViewChange == true)) { - - $scope.setLayerNumberAndHighlightByTermList(); - - } - - else { - - $scope.CalculateImageCordinates($rootScope.viewOrientationId); - - } + + $scope.setLayerNumberAndHighlightByTermList(); + + } + + else { + + $scope.CalculateImageCordinates($rootScope.viewOrientationId); + + } $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); }, @@ -5726,13 +5801,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isTransparencyBoxActivated = false; $rootScope.isNormalMode = false; + //close transparency box + $scope.CloseTransparencyBox(); //if listanager is visisble then close it //$rootScope.isListManagerSelected = false; $rootScope.CloseListManager(); - $rootScope.isHighlightBodyByBodySystem = false; + // $rootScope.isHighlightBodyByBodySystem = false; $rootScope.isLoading = true; @@ -5891,22 +5968,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.layerNumber = parseInt($('#txtlayerNumber').val()); //alert('mouseUp'); - + if ($scope.layerNumber == 0) { $scope.loadSelectedBodyView(data.reloadDABodyViewId); } - // $scope.loadSelectedBodyView(data.reloadDABodyViewId); + // $scope.loadSelectedBodyView(data.reloadDABodyViewId); $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId); - // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); + // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); //$rootScope.isSettingEventAlredayDispachted = false; //} }) - + $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) { @@ -6157,10 +6234,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo resizeFromCenter: false, - dblclick: function () { - $rootScope.backOpacity(); - - }, + dblclick: function () { + $rootScope.backOpacity(); + + }, click: function (layer) { $rootScope.canvasLayerNameCollection = []; @@ -6253,7 +6330,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }, mouseout: function (layer) { $rootScope.canvasLayerNameCollection = []; - + $('#canvas').setLayer(layer.name, { handle: { type: 'arc', @@ -6380,7 +6457,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo x2: $scope.x, y2: $scope.y, click: function (layer) { - + $rootScope.shapeTypePin = "Pin"; $rootScope.canvasLayerNameCollection = []; var pinLine_layer = layer.name; @@ -6404,7 +6481,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }, mouseout: function (layer) { - + $rootScope.canvasLayerNameCollection = []; $('#canvas').setLayer(layer.name, { handle: { @@ -6467,8 +6544,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('.btnCursor').addClass('activebtncolor'); break; case "TextArea": - $rootScope.IsTextAlreadySave = false; - $("#text_area").val(''); + $rootScope.IsTextAlreadySave = false; + $("#text_area").val(''); // Draw text $rootScope.resetTextRect = $rootScope.ObjectIndex++; $rootScope.resetText = $rootScope.ObjectIndex++; @@ -6486,7 +6563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo align: "left", fontFamily: 'Verdana, sans-serif', text: '' - + }) // Draw rect as wide as the text .drawRect({ @@ -6581,271 +6658,271 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.modifySavedText = []; $rootScope.TextRectangleArr = []; $rootScope.rectDimension = []; - + // will refactor this code later - + $rootScope.saveText = function () { // this part will work first time when save button will be clicked if ($rootScope.IsTextAlreadySave == false) { // getting textarea style properties - $rootScope.fontSizes = $("#text_area").css("font-size"); - $rootScope.fontWeight = $("#text_area").css("font-weight"); - $rootScope.fontStyle = $("#text_area").css("font-style"); - $rootScope.textAlignmt = $("#text_area").css("text-align"); - $rootScope.fontColor = $("#text_area").css("color"); - $rootScope.fontFamily = $("#text_area").css("font-family"); - $rootScope.underlineText = $("#text_area").css("text-decoration"); - $rootScope.textArea = $("#text_area").val(); + $rootScope.fontSizes = $("#text_area").css("font-size"); + $rootScope.fontWeight = $("#text_area").css("font-weight"); + $rootScope.fontStyle = $("#text_area").css("font-style"); + $rootScope.textAlignmt = $("#text_area").css("text-align"); + $rootScope.fontColor = $("#text_area").css("color"); + $rootScope.fontFamily = $("#text_area").css("font-family"); + $rootScope.underlineText = $("#text_area").css("text-decoration"); + $rootScope.textArea = $("#text_area").val(); // deleting previous text area - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); - - // Text After Saving in Rectangle - $('#canvas').drawText({ - layer: true, - draggable: true, - name: 'TextArea_' + $rootScope.resetText, - groups: ['TextArea_' + $rootScope.resetText], - dragGroups: ['TextArea_' + $rootScope.resetText], - fillStyle: $rootScope.fontColor, - fontStyle: $rootScope.fontStyle, - fontSize: $rootScope.fontSizes, - fontFamily: $rootScope.fontFamily, - align: $rootScope.textAlignmt, - strokeWidth: 0, - text: $rootScope.textArea, - x: $scope.offsetX1, y: $scope.offsetY1, - maxWidth: $scope.x - $scope.offsetX1, - maxHeight: $scope.y - $scope.offsetY1, - add: function (layer) { - $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); - $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily }); + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); + + // Text After Saving in Rectangle + $('#canvas').drawText({ + layer: true, + draggable: true, + name: 'TextArea_' + $rootScope.resetText, + groups: ['TextArea_' + $rootScope.resetText], + dragGroups: ['TextArea_' + $rootScope.resetText], + fillStyle: $rootScope.fontColor, + fontStyle: $rootScope.fontStyle, + fontSize: $rootScope.fontSizes, + fontFamily: $rootScope.fontFamily, + align: $rootScope.textAlignmt, + strokeWidth: 0, + text: $rootScope.textArea, + x: $scope.offsetX1, y: $scope.offsetY1, + maxWidth: $scope.x - $scope.offsetX1, + maxHeight: $scope.y - $scope.offsetY1, + add: function (layer) { + $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); + $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily }); } - }) - // Draw rectangle - .drawRect({ - name: 'TextArea1_' + $rootScope.resetText, - layer: true, - draggable: true, - groups: ['TextArea_' + $rootScope.resetText], - dragGroups: ['TextArea_' + $rootScope.resetText], - opacity: $rootScope.shapestyleOpacity, - strokeStyle: $rootScope.shapestyleborderColor, - strokeWidth: $rootScope.shapestyleborderWidth, - x: $scope.offsetX1, y: $scope.offsetY1, - width: $scope.x - $scope.offsetX1, - height: $scope.y - $scope.offsetY1, - click: function (layer) { - $rootScope.shapeTypeText = "textAreaRect"; - - var layerNameSplit = layer.name; - var splitedName = layerNameSplit.split("_"); - var textValName = "TextArea_"; - var concatinateResult = textValName.concat(splitedName[1]); - $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); - $('#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 = true; - - var _rectLayerOnSave = layer.name; - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); - var TextAreaRectName = "TextArea_"; - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]); - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated }); - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - var _rectLayerOnSaveSplitInt; - if (_rectLayerOnSaveSplit[1] >= 3) - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); - else - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); - var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1; - $("#text_area").val(b); - $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize); - $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); - $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); - $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align); - $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor); - $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily); - $("#text_area").css("text-decoration", $rootScope.underlineText); - _rectLayerOnSaveSplitInt = ''; b = ''; - $("#annotationTextModal").modal("toggle"); - }, - 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(); - - } - }); - $("#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" }); - - } - -// this part will work second time when save button will be clicked - else { - // getting textarea style properties - var _modifiedText = $("#text_area").val(); - var _modifiedFontSize = $("#text_area").css("font-size"); - var _modifiedFontWeight = $("#text_area").css("font-weight"); - var _modifiedFontStyle = $("#text_area").css("font-style"); - var _modifiedTextAlign = $("#text_area").css("text-align"); - var _modifiedFontColor = $("#text_area").css("color"); - var _modifiedFontFamily = $("#text_area").css("font-family"); - var _modifiedFontDecoration = $("#text_area").css("text-decoration"); - - // deleting previous textarea - $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers(); - $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers(); - $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++; - $rootScope.resetTextSave = $rootScope.ObjectIndexSave++; - - // generating new text area - $('#canvas').drawText({ - layer: true, - draggable: true, - name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave, - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], - fillStyle: _modifiedFontColor, - fontStyle: _modifiedFontStyle, - fontSize: _modifiedFontSize, - fontFamily: _modifiedFontFamily, - align: _modifiedTextAlign, - strokeWidth: 0, - 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, - maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height - - }) - // Draw rect as wide as the text - .drawRect({ - name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave, - layer: true, - draggable: true, - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], - opacity: $rootScope.shapestyleOpacity, - strokeStyle: $rootScope.shapestyleborderColor, - strokeWidth: $rootScope.shapestyleborderWidth, - 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, - click: function (layer) { - $rootScope.shapeTypeText = "textAreaRect"; - var layerNameSplit = layer.name; - var splitedName = layerNameSplit.split("_"); - var textValName = "TextAreaAfterEdit_"; + }) + // Draw rectangle + .drawRect({ + name: 'TextArea1_' + $rootScope.resetText, + layer: true, + draggable: true, + groups: ['TextArea_' + $rootScope.resetText], + dragGroups: ['TextArea_' + $rootScope.resetText], + opacity: $rootScope.shapestyleOpacity, + strokeStyle: $rootScope.shapestyleborderColor, + strokeWidth: $rootScope.shapestyleborderWidth, + x: $scope.offsetX1, y: $scope.offsetY1, + width: $scope.x - $scope.offsetX1, + height: $scope.y - $scope.offsetY1, + click: function (layer) { + $rootScope.shapeTypeText = "textAreaRect"; + + var layerNameSplit = layer.name; + var splitedName = layerNameSplit.split("_"); + var textValName = "TextArea_"; var concatinateResult = textValName.concat(splitedName[1]); $rootScope.canvasLayerNameCollection = []; - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); - - $('#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 = true; - var _rectLayerOnSave = layer.name; - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); - var RectNameAfterEdit = "TextAreaAfterEdit_"; - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]); - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult }); - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); - $("#text_area").val(_modifiedText); - $("#text_area").css("font-size", _modifiedFontSize); - $("#text_area").css("font-weight", _modifiedFontWeight); - $("#text_area").css("font-style", _modifiedFontStyle); - $("#text_area").css("text-align", _modifiedTextAlign); - $("#text_area").css("color", _modifiedFontColor); - $("#text_area").css("font-family", _modifiedFontFamily); - $("#text_area").css("text-decoration", _modifiedFontDecoration); - $("#annotationTextModal").modal("toggle"); - }, - 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(); - - } - }); + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); + $('#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 = true; + + var _rectLayerOnSave = layer.name; + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); + var TextAreaRectName = "TextArea_"; + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]); + $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated }); + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + var _rectLayerOnSaveSplitInt; + if (_rectLayerOnSaveSplit[1] >= 3) + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); + else + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); + var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1; + $("#text_area").val(b); + $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize); + $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); + $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); + $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align); + $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor); + $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily); + $("#text_area").css("text-decoration", $rootScope.underlineText); + _rectLayerOnSaveSplitInt = ''; b = ''; + $("#annotationTextModal").modal("toggle"); + }, + 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(); + + } + }); + $("#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" }); + + } + + // this part will work second time when save button will be clicked + else { + // getting textarea style properties + var _modifiedText = $("#text_area").val(); + var _modifiedFontSize = $("#text_area").css("font-size"); + var _modifiedFontWeight = $("#text_area").css("font-weight"); + var _modifiedFontStyle = $("#text_area").css("font-style"); + var _modifiedTextAlign = $("#text_area").css("text-align"); + var _modifiedFontColor = $("#text_area").css("color"); + var _modifiedFontFamily = $("#text_area").css("font-family"); + var _modifiedFontDecoration = $("#text_area").css("text-decoration"); + + // deleting previous textarea + $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers(); + $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers(); + $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++; + $rootScope.resetTextSave = $rootScope.ObjectIndexSave++; + + // generating new text area + $('#canvas').drawText({ + layer: true, + draggable: true, + name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave, + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], + fillStyle: _modifiedFontColor, + fontStyle: _modifiedFontStyle, + fontSize: _modifiedFontSize, + fontFamily: _modifiedFontFamily, + align: _modifiedTextAlign, + strokeWidth: 0, + 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, + maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height + + }) + // Draw rect as wide as the text + .drawRect({ + name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave, + layer: true, + draggable: true, + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], + opacity: $rootScope.shapestyleOpacity, + strokeStyle: $rootScope.shapestyleborderColor, + strokeWidth: $rootScope.shapestyleborderWidth, + 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, + click: function (layer) { + $rootScope.shapeTypeText = "textAreaRect"; + var layerNameSplit = layer.name; + var splitedName = layerNameSplit.split("_"); + var textValName = "TextAreaAfterEdit_"; + var concatinateResult = textValName.concat(splitedName[1]); + $rootScope.canvasLayerNameCollection = []; + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); + + $('#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 = true; + var _rectLayerOnSave = layer.name; + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); + var RectNameAfterEdit = "TextAreaAfterEdit_"; + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]); + $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult }); + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + $("#text_area").val(_modifiedText); + $("#text_area").css("font-size", _modifiedFontSize); + $("#text_area").css("font-weight", _modifiedFontWeight); + $("#text_area").css("font-style", _modifiedFontStyle); + $("#text_area").css("text-align", _modifiedTextAlign); + $("#text_area").css("color", _modifiedFontColor); + $("#text_area").css("font-family", _modifiedFontFamily); + $("#text_area").css("text-decoration", _modifiedFontDecoration); + $("#annotationTextModal").modal("toggle"); + }, + 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(); + + } + }); $rootScope.modifySavedText = []; - } + } } - + // deleting text area on close button $rootScope.closeModal = function () { - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); - - } + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); + + } function OnPaintCanvasMouseMove(event) { @@ -6854,7 +6931,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $rootScope.FreeStylePaint = function (e) { - + } $scope.OnPaintBrushCanvasMouseDown = function (event) { @@ -6862,22 +6939,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo 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 }); + // $('#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; @@ -6895,7 +6972,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // case "FreeStylePaint": - + // if ($("#amount-2").val() == '') // { // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); @@ -6923,7 +7000,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // predefined function for detecting keyboard key if (event.which == 46) { - + if ($rootScope.shapeTypePin == "Pin") { @@ -7003,7 +7080,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('highLightBody from HighlightBodyByBodySystem') $scope.highLightBody(); } - + else { + //This else is when user seraced anything then change the view and clicked on highlight options + //in this case body is already highlihted(gray) so no need to + if ($scope.grayedBR != null || $scope.grayedBR != undefined) { + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) { + $scope.isAlreadyHighlighted = true; + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) { + $scope.isAlreadyHighlighted = true; + } + else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) { + $scope.isAlreadyHighlighted = true; + } + else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) { + $scope.isAlreadyHighlighted = true; + } + if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) { + + $scope.isLoading = true; + + $('#spinner').css('visibility', 'visible'); + $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); + } + } + } //$rootScope.isLoading = true; @@ -7307,7 +7408,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#canvasDiv").scrollTop(scrolly); $("#canvasDiv").scrollLeft(scrollx); - if (( $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { + if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { $timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100); } @@ -7315,7 +7416,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //list manager $scope.$on('listManagerEvent', function (event, data) { - + $('#spinner').css('visibility', 'visible'); console.log('listManagerEvent'); @@ -7410,7 +7511,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var j = 0; j < $scope.VocabTermTxt.length; j++) { var $el = $('').appendTo('#termList') $compile($el)($scope); - + $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); } @@ -7420,7 +7521,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - } + } $scope.HighlightBodyOnListManagerSelection = function (event) { @@ -7529,24 +7630,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } } - $('#txtlayerNumber').val((parseInt($scope.layerNumber))); - $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber)); + $('#txtlayerNumber').val((parseInt($scope.layerNumber))); + $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber)); - //8.remove current layer canavses - $scope.flushCanvas(); + //8.remove current layer canavses + $scope.flushCanvas(); - //9. - $timeout(function () { - $rootScope.isHighLight = false; - $('#sppeachBubble').css('display', 'none'); - $("#dot").css("display", "none"); + //9. + $timeout(function () { + $rootScope.isHighLight = false; + $('#sppeachBubble').css('display', 'none'); + $("#dot").css("display", "none"); + + //redraw body of respective layer + $scope.CalculateImageCordinates($rootScope.viewOrientationId) + }, 500); - //redraw body of respective layer - $scope.CalculateImageCordinates($rootScope.viewOrientationId) - }, 500); - } $scope.getChildTermList = function (termNo) { @@ -7616,7 +7717,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - + $scope.aligneCanvasWithTerm = function () { console.log('aligneCanvasWithTerm') var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); @@ -7631,7 +7732,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var canvasRight = canvasX + canvasWidth if (newX < canvasX || newX > canvasRight || newY < canvasY || newY > canvasBottom) { - + newX = newX - canvasWidth / 2; newY = newY - canvasHeight / 2; @@ -7660,7 +7761,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop(); $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); - + } @@ -7779,12 +7880,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.LayerChangeBasedOnKeyPressed = function (e) { - - if(e.keyCode==13) - { - $scope.LayerChange(); + + if (e.keyCode == 13) { + $scope.LayerChange(); } - + } }] 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 cee9bae..f0be624 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -159,7 +159,7 @@
- +