diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 431e6e3..121628c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -2339,11 +2339,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ selectedStructureID: 0,//N contentDescriptorId: 0, callOuts: $rootScope.DaWindowData[i].CurriculumTermData, - //hideAllPins: $rootScope.DaWindowData[i].isHidePinBtnClicked, + //selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate, layerNumber: parseInt($rootScope.DaWindowData[i].layerNumber) + 1, isModestyOn: $rootScope.DaWindowData[i].ModestyValue, - isTransparent: $rootScope.DaWindowData[i].isTransparencyActivated, + isTopToolBarVisible: false, //$rootScope.DaWindowData[i].isTopToolBarVisible, clickedTermList: $rootScope.DaWindowData[i].fullTermlist, minimised: $rootScope.DaWindowData[i].minimised, @@ -2352,19 +2352,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // vertical: $rootScope.DaWindowData[i].verticalScroll, // horizontal: $rootScope.DaWindowData[i].horizontalScroll //}, - //selectedPins: $rootScope.DaWindowData[i].clickedPins, + maximised: $rootScope.DaWindowData[i].maximised, size: { width: $rootScope.DaWindowData[i].width, height: $rootScope.DaWindowData[i].height }, - id: $rootScope.DaWindowData[i].voId, - //showSelectedPins: $rootScope.DaWindowData[i].isShowSelectedSystemPinsClicked, - // hideCallOuts: false,//N - //showAllPins: $rootScope.DaWindowData[i].isShowBodyWithCBPinData,//N - //scaleIndex: 0,//N - //bodySystemId: $rootScope.DaWindowData[i].SelectedSystemID, - //position: { x: 840, y: 263 }, + id: $rootScope.DaWindowData[i].voId, + imageId: $rootScope.DaWindowData[i].imageId, position: { top: $rootScope.DaWindowData[i].top, @@ -2377,20 +2372,24 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //sliderVal: $rootScope.DaWindowData[i].sliderVal, zoom: $rootScope.DaWindowData[i].zoomInOut, skinId: $rootScope.DaWindowData[i].curentEthnicity, - isResizeLock: false , //.isResizeLock,//N + isResizeLock: false , //N mode: $rootScope.DaWindowData[i].mode, - windowListId: 0,//windowData.windowListId,//25 + windowListId: 0,//N canvasVScrollX: $rootScope.DaWindowData[i].CanvasDivTopPosition, canvasHScrollX: $rootScope.DaWindowData[i].CanvasDivLeftPosition, isCallOutVisible: false, - annotationData: "", // .annotationData,//24 - transparencyBounds: 0,//windowData.transparencyBounds, - isLeftToolBarVisible: false, //windowData.isLeftToolBarVisible,//N - isModuleLoaded: false, //.isModuleLoaded,//N - transparencyValue: 0,//N - layerNumberTransparency: false, //layerNumberTransparency,//N + annotationData: "", // .annotationData, + isLeftToolBarVisible: false, //N + isModuleLoaded: false, //N searchSelectedText: $rootScope.DaWindowData[i].searchSelectedText, - prevId: $rootScope.DaWindowData[i].prevId //ActualTermnumber for chnages body image + prevId: $rootScope.DaWindowData[i].prevId, //ActualTermnumber for chnages body image + + isTransparent: $rootScope.DaWindowData[i].isTransparencyActivated, + 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 }); } @@ -2416,6 +2415,13 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if ($scope.selectedKey.windows.window != undefined) { $scope.selectedKey.windows.window.push(arrToStrWinObj); } + else if ($scope.selectedKey.windows == "") { + $scope.selectedKey.windows = []; + $scope.selectedKey.windows.push({ 'window': [] }); + $scope.selectedKey.windows.window = []; + $scope.selectedKey.windows.window.push(arrToStrWinObj); + } + } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index d245687..c5224dd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -148,7 +148,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'maximised': false, 'id': 0, 'moduleName': '', - 'mode': '' + 'mode': '', + 'transparencyBounds': [], + 'layerNumberTransparency': 0, + 'transparencyValue': 0, + 'transparencyX': 0, + 'transparencyY': 0 }); @@ -250,7 +255,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'maximised': false, 'id': 0, 'moduleName': '', - 'mode': '' + 'mode': '', + 'transparencyBounds': [], + 'layerNumberTransparency': 0, + 'transparencyValue': 0, + 'transparencyX': 0, + 'transparencyY': 0 }); } @@ -758,6 +768,19 @@ 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); + if ($scope.daOpenInOtherModules.transparencyBounds != undefined) { + $scope.SetwindowStoreData(windowviewid, 'transparencyBounds', $scope.daOpenInOtherModules.transparencyBounds); + } + $scope.SetwindowStoreData(windowviewid, 'layerNumberTransparency', $scope.daOpenInOtherModules.layerNumberTransparency); + //$scope.SetwindowStoreData(windowviewid, 'transparencyValue', $scope.daOpenInOtherModules.transparencyValue); + $scope.SetwindowStoreData(windowviewid, 'transparencyX', $scope.daOpenInOtherModules.transparencyX); + $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,'parentSlugName',($location.url()).replace('/', '')); @@ -1080,7 +1103,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $(".containment-wrapper-"+windowviewid).css("min-width", "auto"); } $("#transparencyScale_" + windowviewid).draggable({containment:'window'}); - $("#draggable_"+windowviewid).draggable({ containment: ".containment-wrapper-"+windowviewid, scroll: false }); + $("#draggable_" + windowviewid).draggable({ containment: ".containment-wrapper-" + windowviewid, scroll: false }); } @@ -1137,11 +1160,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.TbSelSlider = function (windowviewid) { - + var sliderValue = 50; + var tbValue = $scope.GetwindowStoreData(windowviewid, 'transNumber'); + if (tbValue != undefined) { + sliderValue = tbValue; + } $("#tbSlider_" + windowviewid).slider({ min: 0, max: 100, - value: 50, + value: sliderValue, range: "min", orientation: "horizontal", // change: function (event, ui) { @@ -5540,6 +5567,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $selection.appendTo($container); } + //$rootScope.commonTBStartX = actulalX; + //$rootScope.CommonTBSartY = actualY; + //$rootScope.SliderStartX = $scope.TBDrawStartX; + //$rootScope.SliderStartY = $scope.TBDrawStartY; + document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mousedown", mouseDownListener); document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchstart", mouseDownListener); @@ -5618,7 +5650,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l e.preventDefault(); $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')); @@ -5650,6 +5682,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.TransparencyEndX = TransparencyEndX; $scope.TransparencyBoxEndY = TransparencyBoxEndY; + //Save TranparencyBox and slider for CurriculmBuilder + //$rootScope.commonTBEndX = TransparencyEndX; + //$rootScope.commonTBEndY = TransparencyBoxEndY; + var transparencyBounds = $scope.GetwindowStoreData(windowviewid,'transparencyBounds'); + transparencyBounds.push({ + 'h': $scope.TransparencyEndX, 'x': $scope.TransparencyBoxStartX, + 'w': $scope.TransparencyBoxEndY, 'y': $scope.TransparencyBoxStartY + }); + if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) { $("#btnExtract_" + windowviewid).removeClass("disabled"); @@ -5730,7 +5771,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l TransparencyBoxEndY = new_endy; - + var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData'); $.each(BodyRegionDictionary, function (index, value) { @@ -5909,6 +5950,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // $('#transparencyScale').modal('show'); $('#transparencyScale_' + windowviewid).css('position', 'fixed'); $('#transparencyScale_' + windowviewid).draggable({ containment: 'window', scroll: false }); + if ($rootScope.isCallFromOtherModule) { + $('#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, 'transparencyY', $scope.TBDrawStartY ); + } $('#transparencyScale_' + windowviewid).css('top', $scope.TBDrawStartY - 10) $('#transparencyScale_' + windowviewid).css('left', $scope.TBDrawStartX + 130) $('#transparencyScale_' + windowviewid).css('visibility', 'visible') @@ -5991,6 +6041,26 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.CalculateDimensionsAndDrawTBox = function (windowviewid) { + //$scope.startX = $rootScope.commonTBStartX; + //$scope.startY = $rootScope.CommonTBSartY; + //$scope.TransparencyBoxStartX = $rootScope.commonTBStartX; + //$scope.TransparencyBoxStartY = $rootScope.CommonTBSartY; + //$scope.TransparencyEndX = $rootScope.commonTBEndX; + //$scope.TransparencyBoxEndY = $rootScope.commonTBEndY; + //Get Transparecy attributes from save CB + var transparencyBounds = $scope.GetwindowStoreData(windowviewid, 'transparencyBounds'); + $.each(transparencyBounds, function (index, value){ + $scope.startX = value.x; + $scope.startY = value.y + $scope.TransparencyBoxStartX = value.x; + $scope.TransparencyBoxStartY = value.y; + $scope.TransparencyEndX = value.h; + $scope.TransparencyBoxEndY = value.w; + }) + + $scope.IncludedBodyRegions = []; + $scope.transparencyDrawnRegions = []; + $scope.canThirdBRDrawn = false; var tranparencyLayer; // alert($scope.GetwindowStoreData(windowviewid, "isTransparencyActivated")+"---"+($scope.GetwindowStoreData(windowviewid, "isNormalBtnClicked"))) @@ -6010,6 +6080,39 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l tranparencyLayer = currentLayer + 1; } } + + var $container = document.getElementById("canvasDivDA_" + windowviewid); + var $selection = $('
').addClass('rectangle'); + //document.getElementById("daViewDA_" + windowviewid) + $selection.css({ + 'position': 'absolute', + 'border': '1px dotted #000', + 'top': $scope.TransparencyBoxStartY, + 'left': $scope.TransparencyBoxStartX, + 'width': 0, + 'height': 0, + 'z-index': 1000 + }); + $selection.appendTo($container); + + //draw temp box to store the canvas data with original transparecy + if (document.getElementById('tempCanvas_' + windowviewid) != null) { + $('#tempCanvas_' + windowviewid).remove(); + } + if (document.getElementById('tempCanvas_' + windowviewid) == null || document.getElementById('tempCanvas_' + windowviewid) == undefined) { + var tempCanvas = document.createElement('canvas'); + tempCanvas.id = 'tempCanvas_' + windowviewid; + tempCanvas.height = $scope.TransparencyBoxEndY - $scope.startY; + tempCanvas.width = $scope.TransparencyEndX - $scope.startX; + tempCanvas.style.position = "absolute"; + tempCanvas.style.left = 200 + 'px'; + tempCanvas.style.top = 200 + 'px'; + tempCanvas.style.backgroundColor = "transparent"; + tempCanvas.style.visibility = 'hidden'; + tempCanvas.style.border = "black 1px solid"; + document.getElementById("canvasDivDA_" + windowviewid).appendChild(tempCanvas); + } + $scope.SetwindowStoreData(windowviewid, 'layerNumber', tranparencyLayer); var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData'); @@ -6171,12 +6274,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $('#transparencyScale_' + windowviewid).css('position', 'fixed') - $('#transparencyScale_' + windowviewid).css('top', $scope.TBDrawStartY - 10) - $('#transparencyScale_' + windowviewid).css('left', $scope.TBDrawStartX + 130) + $('#transparencyScale_' + windowviewid).css('top', $scope.startY) + $('#transparencyScale_' + windowviewid).css('left', $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) { } }); var transNumber = $scope.GetwindowStoreData(windowviewid, 'transNumber'); $("#tbSlider_" + windowviewid + " .ui-slider-handle").css("left", transNumber + "%"); $("#tbSlider_" + windowviewid + " .ui-slider-range-min").css("width", transNumber + "%"); @@ -6312,30 +6414,30 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#tbSlider_" + windowviewid).slider('value', 100); } - //else { + else { - // 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 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; - // } - // } - // $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer); + var totalLayers=$scope.GetwindowStoreData(windowviewid,'totalLayers'); + if (currentLayer == totalLayers) { + tranparencyLayer = currentLayer; + } + else { + tranparencyLayer = currentLayer + 1; + } + } + $scope.SetwindowStoreData(windowviewid,'layerNumber',tranparencyLayer); - //} + } $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber')); @@ -7875,7 +7977,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var len= (ev.target.id).split("_").length; var windowviewid = (ev.target.id).split("_")[len-1]; - + //$scope.SetwindowStoreData(windowviewid, 'transparencyValue', ui.value); $scope.SetwindowStoreData(windowviewid,'transNumber',ui.value); $scope.setOriginalDataAndChangeTransparency(windowviewid); @@ -8010,7 +8112,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //black issue - var imgData = ctx.getImageData(0, 0, ocument.getElementById(modestyTransTempCanvasId).ocument.getElementById(modestyTransTempCanvasId), transCanvas.height); + var imgData = ctx.getImageData(0, 0, document.getElementById(modestyTransTempCanvasId).document.getElementById(modestyTransTempCanvasId), transCanvas.height); var data = imgData.data; var c = 0; for (var i = 0; i < data.length; i += 4) { @@ -8752,8 +8854,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // $scope.CloseTransparencyBox(windowviewid); $scope.GetwindowStoreData(windowviewid, 'isHighLight', true); - // $scope.CalculateDimensionsAndDrawTBox(windowviewid); - $scope.setOriginalDataAndChangeTransparency(windowviewid); + + $scope.CalculateDimensionsAndDrawTBox(windowviewid); + + $scope.setOriginalDataAndChangeTransparency(windowviewid); } else { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index cd3d55d..4984a0c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -307,7 +307,9 @@ AIA.service('ModuleService', function ($http, DataService) { minimised: windowData.minimised, annotationData: windowData.annotationData, - transparencyBounds: windowData.transparencyBounds + transparencyBounds: windowData.transparencyBounds, + transparencyX: windowData.transparencyX, + transparencyY: windowData.transparencyY }); }