From e2e2cd6d40dbd4381f372170d077f260f84a1ec2 Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Date: Wed, 22 Apr 2020 00:44:12 +0530 Subject: [PATCH] Create automeically TBox for display after SaveCB --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js | 6 ++++-- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js | 3 ++- 3 files changed, 92 insertions(+), 41 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 121628c..042f8df 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -2384,12 +2384,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ searchSelectedText: $rootScope.DaWindowData[i].searchSelectedText, prevId: $rootScope.DaWindowData[i].prevId, //ActualTermnumber for chnages body image - isTransparent: $rootScope.DaWindowData[i].isTransparencyActivated, + isTransparent: $rootScope.DaWindowData[i].isTransparent, transparencyBounds: $rootScope.DaWindowData[i].transparencyBounds, transparencyValue: $rootScope.DaWindowData[i].transNumber, layerNumberTransparency: $rootScope.DaWindowData[i].layerNumberTransparency, transparencyX: $rootScope.DaWindowData[i].transparencyX, - transparencyY: $rootScope.DaWindowData[i].transparencyY + transparencyY: $rootScope.DaWindowData[i].transparencyY, + layerNumberBeforeTBDraw: $rootScope.DaWindowData[i].layerNumberBeforeTBDraw + }); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index c5224dd..cb39e1d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -153,7 +153,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'layerNumberTransparency': 0, 'transparencyValue': 0, 'transparencyX': 0, - 'transparencyY': 0 + 'transparencyY': 0, + 'isTransparent': false }); @@ -260,7 +261,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'layerNumberTransparency': 0, 'transparencyValue': 0, 'transparencyX': 0, - 'transparencyY': 0 + 'transparencyY': 0, + 'isTransparent': false }); } @@ -768,7 +770,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'minimised', isMinimize); $scope.SetwindowStoreData(windowviewid, 'moduleName', "DISSECTIBLE_ANATOMY"); $scope.SetwindowStoreData(windowviewid, 'mode', $scope.daOpenInOtherModules.mode); - $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', $scope.daOpenInOtherModules.isTransparent); + //$scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', $scope.daOpenInOtherModules.isTransparent); + $scope.SetwindowStoreData(windowviewid, 'isTransparent', $scope.daOpenInOtherModules.isTransparent); if ($scope.daOpenInOtherModules.transparencyBounds != undefined) { $scope.SetwindowStoreData(windowviewid, 'transparencyBounds', $scope.daOpenInOtherModules.transparencyBounds); } @@ -778,9 +781,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'transparencyY', $scope.daOpenInOtherModules.transparencyY); $scope.SetwindowStoreData(windowviewid, 'transNumber', $scope.daOpenInOtherModules.transparencyValue) if ($scope.daOpenInOtherModules.transparencyValue == 0.5) { - $scope.SetwindowStoreData(windowviewid, 'transNumber', 50); + $scope.SetwindowStoreData(windowviewid, 'transNumber', 100); + } + $scope.SetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw', $scope.daOpenInOtherModules.layerNumberBeforeTBDraw); + if ($scope.daOpenInOtherModules.isTransparent) { + $scope.SetwindowStoreData(windowviewid, 'layerNumber', $scope.daOpenInOtherModules.layerNumberBeforeTBDraw); } - $scope.SetwindowStoreData(windowviewid,'parentSlugName',($location.url()).replace('/', '')); @@ -1151,6 +1157,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l scope.LayerChange(windviewid); $("#annotationpaintbrushsize").removeClass("activebtncolor"); $("#annotationpainteraser").removeClass("activebtncolor"); + + if ($scope.GetwindowStoreData(windviewid, 'isTransparent')) { + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', slideVal); + } //else { $scope.SetwindowStoreData(windowviewid, 'currentLayerNumber', slideVal); } }); }, @@ -3346,6 +3356,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.EnableUI(); } + //Added Code by sandy to create Draw transparencybox autometically for save CB + if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) { + $scope.CalculateDimensionsAndDrawTBox(windowviewid); + //$scope.setOriginalDataAndChangeTransparency(windowviewid); + // finish CB window load + $rootScope.DAWindowLoadComplete = true; + + } + } } @@ -5648,7 +5667,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //to prevent screen scroll on ipad while drawing TB e.preventDefault(); - + //$scope.SetwindowStoreData(windowviewid, 'isTransparent', true); $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false); $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true); $scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode')); @@ -5954,9 +5973,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#transparencyScale_' + windowviewid).draggable({ containment: '#canvasDivDA_' + windowviewid }); $scope.SetwindowStoreData(windowviewid, 'transparencyBounds', transparencyBounds); - $scope.SetwindowStoreData(windowviewid, 'transparencyValue', 0); - $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', 0); - $scope.SetwindowStoreData(windowviewid, 'transparencyX', $scope.TBDrawStart); + //$scope.SetwindowStoreData(windowviewid, 'transparencyValue', 0); + //$scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', 0); + $scope.SetwindowStoreData(windowviewid, 'transparencyX', $scope.TBDrawStartX); $scope.SetwindowStoreData(windowviewid, 'transparencyY', $scope.TBDrawStartY ); } $('#transparencyScale_' + windowviewid).css('top', $scope.TBDrawStartY - 10) @@ -6047,6 +6066,17 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //$scope.TransparencyBoxStartY = $rootScope.CommonTBSartY; //$scope.TransparencyEndX = $rootScope.commonTBEndX; //$scope.TransparencyBoxEndY = $rootScope.commonTBEndY; + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []); + $scope.SetwindowStoreData(windowviewid, 'isTransparent', true); + $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false); + $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true); + $scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode')); + $scope.SetwindowStoreData(windowviewid, 'IsHighlightModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isHighlight')); + $('.com_' + windowviewid).remove(); + $('#dot_' + windowviewid).remove(); + $('#bord_' + windowviewid).remove(); + $('#sppeachBubble_' + windowviewid).remove(); + //Get Transparecy attributes from save CB var transparencyBounds = $scope.GetwindowStoreData(windowviewid, 'transparencyBounds'); $.each(transparencyBounds, function (index, value){ @@ -6057,29 +6087,32 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.TransparencyEndX = value.h; $scope.TransparencyBoxEndY = value.w; }) - + $scope.TBDrawStartX = $scope.GetwindowStoreData(windowviewid, 'transparencyX'); + $scope.TBDrawStartY = $scope.GetwindowStoreData(windowviewid, 'transparencyY'); $scope.IncludedBodyRegions = []; $scope.transparencyDrawnRegions = []; $scope.canThirdBRDrawn = false; - var tranparencyLayer; - // alert($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated")+"---"+($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked"))) - if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true))) { - tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val()); - $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false); - $scope.SetwindowStoreData(windowviewid, 'isHighlightlBtnClicked', false); - } - else { - var currentLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); - - var totalLayers = $scope.GetwindowStoreData(windowviewid, 'totalLayers'); - if (currentLayer == totalLayers) { - tranparencyLayer = currentLayer; - } - else { - tranparencyLayer = currentLayer + 1; - } - } + //var tranparencyLayer; + + //if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && (($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked") == true || $scope.GetwindowStoreData(windowviewid, "isHighlightlBtnClicked") == true))) { + // tranparencyLayer = parseInt($('#txtLayerNumberDA_' + windowviewid).val()); + // $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false); + // $scope.SetwindowStoreData(windowviewid, 'isHighlightlBtnClicked', false); + //} + //else if ($scope.GetwindowStoreData(windowviewid, "isTransparent") == true && $scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true) { + // var tranparencyLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberTransparency'); + //} + //else { + // var currentLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); + // var totalLayers = $scope.GetwindowStoreData(windowviewid, 'totalLayers'); + // if (currentLayer == totalLayers) { + // tranparencyLayer = currentLayer; + // } + // else { + // tranparencyLayer = currentLayer + 1; + // } + //} var $container = document.getElementById("canvasDivDA_" + windowviewid); var $selection = $('
').addClass('rectangle'); @@ -6113,7 +6146,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l document.getElementById("canvasDivDA_" + windowviewid).appendChild(tempCanvas); } - $scope.SetwindowStoreData(windowviewid, 'layerNumber', tranparencyLayer); + //$scope.SetwindowStoreData(windowviewid, 'layerNumber', tranparencyLayer); var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData'); @@ -6274,8 +6307,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $('#transparencyScale_' + windowviewid).css('position', 'fixed') - $('#transparencyScale_' + windowviewid).css('top', $scope.startY) - $('#transparencyScale_' + windowviewid).css('left', $scope.startX) + $('#transparencyScale_' + windowviewid).css('top', $scope.TransparencyBoxEndY - $scope.startY);//$scope.startY $scope.TBDrawStartY + $('#transparencyScale_' + windowviewid).css('left', $scope.TransparencyEndX - $scope.startX) $('#transparencyScale_' + windowviewid).css('visibility', 'visible') $('#transparencyScale_' + windowviewid).css("z-index", "100000") //Dated:16-07-2016 Issue#4962:Transparency box should be on top. $('#transparencyScale_' + windowviewid).draggable({ containment: '#canvasDivDA_' + windowviewid, drag: function (evt) { } }); @@ -6424,6 +6457,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'isNormalBtnClicked', false); $scope.SetwindowStoreData(windowviewid, 'isHighlightlBtnClicked', false); } + else if ($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated") == true && $scope.GetwindowStoreData(windowviewid, "isTransparent") == true) { + tranparencyLayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberTransparency'); + } else{ var currentLayer = $scope.GetwindowStoreData(windowviewid,'layerNumberBeforeTBDraw'); @@ -6436,11 +6472,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer); - + } $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber')); - + $scope.SetwindowStoreData(windowviewid, 'isTransparent', true); + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', tranparencyLayer); var tranparencyImgSrc; var tranparencyMaskImgSrc; @@ -8169,6 +8206,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // $rootScope.switchCanvas(); //To enable extract button + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', 0); + //$scope.SetwindowStoreData(windowviewid, 'isTransparent', false); $scope.SetwindowStoreData(windowviewid,'isTransparencyActivated',false); // $rootScope.isTransparencyActivated = false; $("#btnExtract_" + windowviewid).removeClass("disabled"); @@ -8209,8 +8248,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l elements[0].parentNode.removeChild(elements[0]); } var totalayer=$scope.GetwindowStoreData(windowviewid,'totalLayers'); - var currentlayer=$scope.GetwindowStoreData(windowviewid,'currentLayerNumber'); + var currentlayer = $scope.GetwindowStoreData(windowviewid, 'currentLayerNumber'); + if ($scope.GetwindowStoreData(windowviewid, 'isTransparent')) { + currentlayer = $scope.GetwindowStoreData(windowviewid, 'layerNumberBeforeTBDraw'); + } var sliderVal = parseInt(totalayer) - parseInt(currentlayer); console.log('inside mouseDownListener. document.getElementById layerChangeSlider value : ' + document.getElementById('layerChangeSlider') + '$rootScope.totalLayers: ' + totalayer + ' - $rootScope.currentLayerNumber: ' + currentlayer + ' = set value for layerChangeSlider: ' + sliderVal); @@ -8219,6 +8261,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#txtLayerNumberDA_' + windowviewid).val(parseInt(currentlayer)); + $scope.SetwindowStoreData(windowviewid, 'isTransparent', false); if (document.getElementById('tempCanvas_' + windowviewid) != null) { $('#tempCanvas_' + windowviewid).remove(); @@ -8850,14 +8893,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'isGlobalSettingChanged',false); } - if ($scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated')) { + if ($scope.GetwindowStoreData(windowviewid, 'isTransparencyActivated') && $scope.GetwindowStoreData(windowviewid, 'isTransparent')) { // $scope.CloseTransparencyBox(windowviewid); $scope.GetwindowStoreData(windowviewid, 'isHighLight', true); + //Added Code by sandy to create Draw transparencybox autometically for save CB + //$scope.CalculateDimensionsAndDrawTBox(windowviewid); + //$timeout(function () { - $scope.CalculateDimensionsAndDrawTBox(windowviewid); - - $scope.setOriginalDataAndChangeTransparency(windowviewid); + $scope.setOriginalDataAndChangeTransparency(windowviewid); + //}, 300); + // finish CB window load + $rootScope.DAWindowLoadComplete = true; } else { @@ -8869,6 +8916,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.Normal = ""; $scope.Extract = ""; + $scope.Highlight = "LeftButtonsDefaultState"; $('#btnTranparency_' + windowviewid).removeAttr('disabled', 'disabled'); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index 4984a0c..102d6e5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -309,7 +309,8 @@ AIA.service('ModuleService', function ($http, DataService) { transparencyBounds: windowData.transparencyBounds, transparencyX: windowData.transparencyX, - transparencyY: windowData.transparencyY + transparencyY: windowData.transparencyY, + layerNumberBeforeTBDraw: windowData.layerNumberBeforeTBDraw }); } -- libgit2 0.21.4