diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 55d1459..4d58633 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -1365,6 +1365,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } else { //Added Code by sandeep for user story-52696 + $("#viwerSelect").empty(); var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); if (modulePanel != undefined && modulePanel != null) { // $('#viwerSelect').append(''); @@ -1398,60 +1399,39 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.loadModuleWithCB = function (moduleName) { - if (moduleName == "DISSECTIBLE_ANATOMY") { - var DAData = ModuleService.getModuleData(moduleName); - - if (DAData != undefined && DAData.length > 0) { - $scope.loadDissectibleAnatomyModule(); - } - - } - else if (moduleName == "ATLAS_ANATOMY") { - var AAData = ModuleService.getModuleData(moduleName); - - if (AAData != undefined && AAData.length > 0) { - $scope.loadAtlasAnatomyModule(); - } - - } - else if (moduleName == "CLINICAL_ILLUSTRATIONS") { - var CIData = ModuleService.getModuleData(moduleName); - - if (CIData != undefined && CIData.length > 0) { - $scope.loadClinicalIllustrationModule(); - } - - } - else if (moduleName == "CLINICAL_ANIMATIONS") { - var CAData = ModuleService.getModuleData(moduleName); - - if (CAData != undefined && CAData.length > 0) { - $scope.loadClinicalAnimationModule(); - } + switch (moduleName) { + case "DISSECTIBLE_ANATOMY": + $scope.loadDissectibleAnatomyModule(moduleName); + break; + case "ATLAS_ANATOMY": + $scope.loadAtlasAnatomyModule(moduleName); + break; + case "CLINICAL_ILLUSTRATIONS": + $scope.loadClinicalIllustrationModule(moduleName); + break; + case "CLINICAL_ANIMATIONS": + $scope.loadClinicalAnimationModule(moduleName); + break; + case "THREE_D_ANATOMY": + $scope.load3DAnatomyModule(moduleName); + break; } - else if (moduleName == "THREE_D_ANATOMY") { - var ThreeDData = ModuleService.getModuleData(moduleName); - if (ThreeDData != undefined && ThreeDData.length > 0) { - $scope.load3DAnatomyModule(); - } - } - } - $scope.load3DAnatomyModule = function () { + $scope.load3DAnatomyModule = function (moduleName) { $rootScope.isCallFromOtherModule = true; $('#parentcustomDiv').append($('
')); $e = $('#theeDCustomModuleDiv' + $scope.Slidenumber).append(""); $compile($e)($scope); } - $scope.loadClinicalAnimationModule = function () { + $scope.loadClinicalAnimationModule = function (moduleName) { $rootScope.isCallFromOtherModule = true; $('#parentcustomDiv').append($('
')); $e = $('#caCustomModuleDiv' + $scope.Slidenumber).append(""); $compile($e)($scope); } - $scope.loadClinicalIllustrationModule = function () { + $scope.loadClinicalIllustrationModule = function (moduleName) { $rootScope.isCallFromOtherModule = true; //slide number to terminate last load module on prev slide // aaCustomModuleDiv new div create for new slide load @@ -1460,25 +1440,42 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $compile($e)($scope); } - $scope.loadAtlasAnatomyModule = function () { + $scope.loadAtlasAnatomyModule = function (moduleName) { $rootScope.isCallFromOtherModule = true; + //slide number to terminate last load module on prev slide // aaCustomModuleDiv new div create for new slide load $('#parentcustomDiv').append($('
')); $e = $('#aaCustomModuleDiv' + $scope.Slidenumber).append(""); $compile($e)($scope); } - $scope.loadDissectibleAnatomyModule = function () { - $rootScope.isCallFromOtherModule = true; + $scope.loadDissectibleAnatomyModule = function (moduleName) { + var DAData = ModuleService.getModuleData(moduleName); - //slide number to terminate last load module on prev slide - // daCustomModuleDiv new div create for new slide load - $('#parentcustomDiv').append($('
')); + if (DAData != undefined && DAData.length > 0) { + $rootScope.isCallFromOtherModule = true; - $e = $('#daCustomModuleDiv' + $scope.Slidenumber).append(""); + var daSectionExist = document.getElementById('daCustomModuleDiv' + $scope.Slidenumber); + + if (daSectionExist==null) + { + $('#parentcustomDiv').append($('
')); - $compile($e)($scope); + $e = $('#daCustomModuleDiv' + $scope.Slidenumber).append(""); + + $compile($e)($scope); + } + else + { + // open new da panel on same slide by open resource + $rootScope.openDABodyViewMain(); + } + + + } + + } //Added code by sandeep for user story-52696 @@ -1493,16 +1490,17 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //open resoruce on slide $scope.loadResourceOnCurrentSlide = function (newWindowData) { - - //var windowData = JSON.parse(newWindowData); + var newwindowid = 0; - - + var ExistData = ModuleService.getModuleData(newWindowData.mType); if (ExistData != undefined && ExistData.length > 0) { newwindowid = newwindowid + ExistData.length; + + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(newWindowData.mType); } var isFound = jQuery.inArray(newWindowData.mType, $scope.LoadModuleName) if (isFound == -1) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 91ebd38..f671a78 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -493,19 +493,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - // var u = $location.url(); + // open module bu openresource var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource'); if (isopenResourceRequest == "true") { - // $rootScope.MULTI_VIEW_ID = $rootScope.MULTI_VIEW_ID + 1; - //$rootScope.multiViewInfoIndex = 0; - //$rootScope.multiViewInfo.push({ "Target": $event.currentTarget, "id": $rootScope.MULTI_VIEW_ID, "bodyViewID": $event.currentTarget.id, "bodyName": $event.currentTarget.textContent }); - //// $rootScope.multiSearchData = []; - //localStorage.setItem("multiViewInfo", JSON.stringify($rootScope.multiViewInfo)); - //console.log($rootScope.multiViewInfo); - //$location.url('/curriculum-builder-detail'); - // $(document, parent.window.document).trigger('myCustomTrigger'); - + // create json object var userEthnicity; @@ -525,7 +517,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { userModestysettings = $rootScope.globalSetting.modesty; } - + //set default module data var DaopenData= { "id": $event.currentTarget.id, "layerNumber": 1, @@ -539,11 +531,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } ; - parent.AIAModuleOpenResourceInfo(DaopenData); - - parent.closeIFrame(); - + window.parent.AIAModuleOpenResourceInfo(DaopenData); + window.parent.closeIFrame(); + } else { $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'currentViewTitle',$event.currentTarget.textContent); @@ -561,16 +552,17 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // clear data set by curriculum builder $rootScope.isCallFromOtherModule = undefined; - $rootScope.isOpenResourceBtnClicked = undefined; - + $rootScope.MULTI_VIEW_ID += 1 + var windowviewid = $rootScope.MULTI_VIEW_ID; + if ($rootScope.refreshcheck == null) { $location.path('/'); } $scope.ScopeVariablesDeclare(); - $scope.initializeDAWindowData($rootScope.MULTI_VIEW_ID,true,undefined); + $scope.initializeDAWindowData(windowviewid, true, undefined); //get current path var currentURL = $location.path(); @@ -622,7 +614,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.openBodyViewMain = function () { + $rootScope.openDABodyViewMain = function () { $scope.ScopeVariablesDeclare(); if ($rootScope.isCallFromOtherModule) { $scope.DAModuleData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); @@ -679,11 +671,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.openBodyView = function (damoduledata) { $scope.daOpenInOtherModules = damoduledata; + var windowviewid = $rootScope.MULTI_VIEW_ID; if ($rootScope.isCallFromOtherModule) { $rootScope.MULTI_VIEW_ID += 1; - var windowviewid= $rootScope.MULTI_VIEW_ID; - + windowviewid = $rootScope.MULTI_VIEW_ID; $scope.initializeDAWindowData(windowviewid,false,$scope.daOpenInOtherModules.currentWindowId); //$scope.daOpenInOtherModules = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); @@ -742,32 +734,17 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - } - else if ($rootScope.isOpenResourceBtnClicked == true) { - $rootScope.MULTI_VIEW_ID = $rootScope.multiViewInfo[$rootScope.multiViewInfoIndex].id; - $rootScope.multiViewCounter = $rootScope.MULTI_VIEW_ID; - - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'voId',$rootScope.multiViewInfo[$rootScope.multiViewInfoIndex].bodyViewID); - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'currentViewTitle',$rootScope.multiViewInfo[$rootScope.multiViewInfoIndex].bodyName); - - $scope.jsPanelID = 'daImagePanel' + '_' + $rootScope.multiViewCounter; - $scope.viewID = 'daViewDA' + '_' + $rootScope.multiViewCounter; - console.log('$location.url = ' + $location.url()); - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'parentSlugName',($location.url()).replace('/', '')); - - //'clinical-illustrations'; // - $scope.loadBodyView($rootScope.MULTI_VIEW_ID); - - } - else { + } + else + { - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'voId',$rootScope.getLocalStorageValue("currentBodyViewId")); + $scope.SetwindowStoreData(windowviewid, 'voId', $rootScope.getLocalStorageValue("currentBodyViewId")); - $scope.jsPanelID = 'daImagePanel' + '_' + $rootScope.MULTI_VIEW_ID; - $scope.viewID = 'daViewDA' + '_' + $rootScope.MULTI_VIEW_ID; - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'parentSlugName','da-view-list'); + $scope.jsPanelID = 'daImagePanel' + '_' + windowviewid; + $scope.viewID = 'daViewDA' + '_' + windowviewid; + $scope.SetwindowStoreData(windowviewid, 'parentSlugName', 'da-view-list'); - $scope.loadBodyView($rootScope.MULTI_VIEW_ID); + $scope.loadBodyView(windowviewid); } } @@ -822,13 +799,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.loadSearchData(windowviewid); - if ($rootScope.isOpenResourceBtnClicked == true) { - - $rootScope.jsPanelWidth = $(window).outerWidth() - 310; - $rootScope.jsPanelHeight = $(window).outerHeight() - 110; - $rootScope.jsPanelLeft = 302; - } - else if ($rootScope.isCallFromOtherModule) { + if ($rootScope.isCallFromOtherModule) { // open JS panel for curriculum with define cornonate in CB jason $rootScope.jsPanelWidth = $scope.daOpenInOtherModules.size.width;//1000; $rootScope.jsPanelHeight = $scope.daOpenInOtherModules.size.height; @@ -929,14 +900,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.IdMale = "IdMale"; $scope.IdFemale = "IdFemale"; - //if ($rootScope.isOpenResourceBtnClicked || $rootScope.isCallFromOtherModule) { $scope.setControlIDs(); - // use for isOpenResourceBtnClicked - // $scope.setScopeVariables(); - // } - if ($rootScope.isCallFromOtherModule) { $scope.JsPanelclick(windowviewid); } @@ -956,12 +922,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.removeBodySyetemSelectionClass(windowviewid,'Current Structure'); - // console.log('html is compiled ' + document.getElementById('daView')) - //if ($('#' + $scope.jsPanelID).offset().top == 0) - // $('#' + $scope.jsPanelID).css("top", '70px'); - - //if ($('#' + $scope.jsPanelID).offset().left == 0) - // $('#' + $scope.jsPanelID).css("left", '1px'); }, 350); } @@ -1006,12 +966,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#daBodyview').css("width", $(window).outerWidth()); - if ($rootScope.isOpenResourceBtnClicked) { - //var multiv = JSON.parse($rootScope.getLocalStorageValue("multiViewInfo")); - - } - else - $scope.SetwindowStoreData(windowviewid,'voId',currentBodyViewId); + $scope.SetwindowStoreData(windowviewid,'voId',currentBodyViewId); //1. load navigator man first console.log('before LoadBodyViewNavigatorImage call') $scope.LoadBodyViewNavigatorImage(currentBodyViewId, windowviewid); @@ -1151,8 +1106,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.setControlIDs = function () { - //if ($rootScope.isOpenResourceBtnClicked == true || $rootScope.isCallFromOtherModule == true) { - $("#daView").attr("id", "daViewDA_" + $rootScope.MULTI_VIEW_ID); $scope.daViewID = "daViewDA_" + $rootScope.MULTI_VIEW_ID; @@ -1292,60 +1245,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.setScopeVariables = function () { - $scope.daViewID = "daViewDA_" + $rootScope.multiViewCounter; - $scope.btnIdentifyID = "btnIdentify_" + $rootScope.multiViewCounter; - $scope.btnZoomID = "btnZoom_" + $rootScope.multiViewCounter; - $scope.btnTranparencyID = "btnTranparency_" + $rootScope.multiViewCounter; - $scope.btnNormalModeID = "btnNormalMode_" + $rootScope.multiViewCounter; - $scope.btnExtractID = "btnExtract_" + $rootScope.multiViewCounter; - $scope.btnHighLightID = "btnHighLight_" + $rootScope.multiViewCounter; - $scope.genderChangeID = "genderChangeId_" + $rootScope.multiViewCounter; - $scope.structureDropdownID = "structureDropdown_" + $rootScope.multiViewCounter; - $scope.viewID = "daViewDA_" + $rootScope.multiViewCounter; - $scope.btnStrutureBoxID = "btnStrutureBox_" + $rootScope.multiViewCounter; - $scope.typedTermNameID = "typedTermName_" + $rootScope.multiViewCounter; - $scope.searchListDivID = "searchListDiv_" + $rootScope.multiViewCounter; - $scope.btnDATermSearchID = "btnDATermSearch_" + $rootScope.multiViewCounter; - $scope.navigatorBtnID = "navigatorBtn_" + $rootScope.multiViewCounter; - $scope.transparencyScaleID = "transparencyScale_" + $rootScope.multiViewCounter; - $scope.btnTBoxCloseID = "btnTBoxClose_" + $rootScope.multiViewCounter; - $scope.canvasDivID = "canvasDivDA_" + $rootScope.multiViewCounter; - - $scope.dropdownMenu3ID = "dropdownMenu3_" + $rootScope.multiViewCounter; - $scope.dropdownMenu2ID = "dropdownMenu2_" + $rootScope.multiViewCounter; - $scope.navigatorDivID = "navigatorDiv_" + $rootScope.multiViewCounter; - $scope.navDivID = "navDiv_" + $rootScope.multiViewCounter; - $scope.navimgID = "navimg_" + $rootScope.multiViewCounter; - $scope.draggableID = "draggable_" + $rootScope.multiViewCounter; - - - $scope.txtLayerNumberID = "txtLayerNumberDA_" + $rootScope.multiViewCounter; - $scope.layerChangeSliderID = "layerChangeSliderDA_" + $rootScope.multiViewCounter; - $scope.leftToolBarID = "leftToolBarDA_" + $rootScope.multiViewCounter; - // $scope.transparencyScaleID = "transparencyScaleDA_" + $rootScope.multiViewCounter; - $scope.canvasPaintID = "canvasPaintDA_" + $rootScope.multiViewCounter; - $scope.canvasID = "canvasDA_" + $rootScope.multiViewCounter; - $scope.zoomValueID = "zoomValueDA_" + $rootScope.multiViewCounter; - $scope.jsPanelID = 'daImagePanel_' + $rootScope.multiViewCounter - ////set default zoom value; - - if (!$scope.GetwindowStoreData(windowviewid,'isViewChange')) { - var viewDataFromMultiViewInfo = new jinqJs() - .from($rootScope.multiViewInfo) - .where('id == ' + $rootScope.multiViewCounter) - .select(); - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'voId',viewDataFromMultiViewInfo[0].bodyViewID); - - $scope.SetwindowStoreData(windowviewid,'viewOrientationId',$scope.GetwindowStoreData($rootScope.MULTI_VIEW_ID,'voId')); - $scope.setViewOrientationId($rootScope.MULTI_VIEW_ID); - - $scope.viewID = 'daViewDA' + '_' + $rootScope.multiViewCounter; - - // $scope.loadView(); - } - } - angular.element(document).ready(function (e) { var $ua = navigator.userAgent; @@ -1427,6 +1326,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $(document).on("click", "#" + $scope.jsPanelID + " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { //$(document).on("click", " .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { + var panelid = $(event.target).parent().parent().parent().parent().attr('id'); + + var len = (panelid).split("_").length; + var windowviewid = (panelid).split("_")[len - 1]; + + // remove old stored data after close panel + for (var index = 0 ; index < $rootScope.DaWindowData.length; index++) { + + if ($rootScope.DaWindowData[index].multiwinid == windowviewid) { + + if (index != -1) { + // remove module which one is loaded + $scope.DaWindowData.splice(index, 1); + } + } + } + $rootScope.selectedBodySystemName = 'All'; $rootScope.selectedBodySystemId = 0; $rootScope.searchSelectedText = ''; @@ -1472,21 +1388,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'vocabTermDataArray', null); var languageArray = $rootScope.lexiconLanguageArray; console.log('loadSearchDataForBodyView'); - var currentBodyViewId; - var currentViewID; - if ($rootScope.isOpenResourceBtnClicked) { - var viewDataFromMultiViewInfo = new jinqJs() - .from($rootScope.multiViewInfo) - .where('id == ' + $rootScope.multiViewCounter) - .select(); - - - currentBodyViewId = viewDataFromMultiViewInfo[0].bodyViewID; - currentViewID = viewDataFromMultiViewInfo[0].id; - - } - else - currentBodyViewId = $scope.GetwindowStoreData(windowviewid,'voId'); + + var currentBodyViewId = $scope.GetwindowStoreData(windowviewid, 'voId'); for (var i = 0; i <= languageArray.length - 1; i++) { var searchWorker = new Worker('search-wp.js'); @@ -1511,55 +1414,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log("$scope.BodyViewIDs" + e.data.bodyViewID); $scope.vocabTempTermArray = []; - if ($rootScope.isOpenResourceBtnClicked) { - var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray'); - if (vocabTermDataArray.length == 0) { - $scope.vocabTempTermArray.push({ "viewID": e.data.bodyViewID, "currentBodyViewId": currentViewID, "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt }); - } - else { - var dataForCurrentView = new jinqJs() - .from($scope.vocabTempTermArray) - .where("viewID == " + e.data.bodyViewID) - .select(); - if (dataForCurrentView != undefined && dataForCurrentView.length > 0) { - var dataForCurrentLang = new jinqJs() - .from(dataForCurrentView[0]) - .where("language == " + e.data.language) - .select(); - - if (dataForCurrentLang != undefined && dataForCurrentLang.length > 0) { - - } - else { - $scope.vocabTempTermArray.push({ "viewID": e.data.bodyViewID, "currentBodyViewId": currentViewID, "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt }); - - } - } - else { - $scope.vocabTempTermArray.push({ "viewID": e.data.bodyViewID, "currentBodyViewId": currentViewID, "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt }); - - } - - } - } - else { - $scope.vocabTempTermArray.push({ "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt }); - } - - if ($rootScope.isOpenResourceBtnClicked) { + + $scope.vocabTempTermArray.push({ "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt }); - for (var i = 0; i <= $scope.vocabTempTermArray.length - 1; i++) { - - $scope.vocabTempTermArray[i].vocabTermTxt = new jinqJs() - .from($scope.vocabTempTermArray[i].vocabTermTxt) - .distinct('_TermText', '_ActualTermNumber') - .orderBy([{ field: '_TermText', sort: 'asc' }]) - .select('_ActualTermNumber', '_TermText', '_cdId'); - - } - - } - else { for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) { $scope.vocabTempTermArray[i].vocabTermTxt = new jinqJs() @@ -1567,9 +1424,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .distinct('_TermText', '_ActualTermNumber') .orderBy([{ field: '_TermText', sort: 'asc' }]) .select('_ActualTermNumber', '_TermText', '_cdId'); - } - } - + } if ($scope.vocabTempTermArray.length == $rootScope.lexiconLanguageArray.length) { $("#setting-spinner").css("display", "none"); @@ -1693,11 +1548,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if(ModestyValue=="Y") { - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'isModestyOn',true); + $scope.SetwindowStoreData(windowviewid, 'isModestyOn', true); } else { - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'isModestyOn',false); + $scope.SetwindowStoreData(windowviewid, 'isModestyOn', false); } var navigatorManData = new jinqJs() @@ -2081,14 +1936,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - if ($rootScope.isOpenResourceBtnClicked) { - - } - else { $scope.ColoredImageSRC = []; $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); - } - + $scope.SetwindowStoreData(windowviewid,'updatedGrayDataList',[]); $scope.SetwindowStoreData(windowviewid,'updatedGrayMRDataList',[]); @@ -2328,21 +2178,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - if ($rootScope.isOpenResourceBtnClicked) { - $('#draggable_' + $rootScope.MULTI_VIEW_ID).css('width', dragdivw); - $('#draggable_' + $rootScope.MULTI_VIEW_ID).css('height', dragdivh); - $('#draggable_' + $rootScope.MULTI_VIEW_ID).css("left", dragdivleft); - $('#draggable_' + $rootScope.MULTI_VIEW_ID).css("top", dragdivtop); - } - else { - $('#draggable_' +windowviewid).css('width', dragdivw); - $('#draggable_' + windowviewid).css('height', dragdivh); - $('#draggable_' + windowviewid).css("left", dragdivleft); - $('#draggable_' + windowviewid).css("top", dragdivtop); - - } - - + $('#draggable_' + windowviewid).css('width', dragdivw); + $('#draggable_' + windowviewid).css('height', dragdivh); + $('#draggable_' + windowviewid).css("left", dragdivleft); + $('#draggable_' + windowviewid).css("top", dragdivtop); + } @@ -2548,36 +2388,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l FlipedImgCanvas.style.left = x + "px"; FlipedImgCanvas.style.top = y + "px"; - - - if (isMaskImage == 'Y') { - if ($rootScope.isOpenResourceBtnClicked) { - FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci' + "_" + windowviewid; - } - else { - FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci'+ "_" + windowviewid; - - } - - FlipedImgCanvas.style.visibility = 'hidden'; - + if (isMaskImage == 'Y') { + FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci' + "_" + windowviewid; + FlipedImgCanvas.style.visibility = 'hidden'; } - else { - - if ($rootScope.isOpenResourceBtnClicked) { - FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid; - } - else { - FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid; - - } - + else + { + FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid; + if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) { FlipedImgCanvas.style.visibility = 'visible' } - else { - - } + } @@ -2847,23 +2669,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.ColoredImageSRC.length < totalCanvas) { - - if ($rootScope.isOpenResourceBtnClicked) { - - $scope.ColoredImageSRC.push( - { - "viewID": $rootScope.multiViewCounter, - "bodyRegionId": bodyRegionId, "SRC": src, - "Height": h, - "Width": w, - "x": x, - "y": y, - "haveMirror": 'true' - } - ); - - } - else { $scope.ColoredImageSRC.push( { "bodyRegionId": bodyRegionId, "SRC": src, @@ -2872,23 +2677,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l "x": x, "y": y, "haveMirror": 'true' - } - - ); - } + } ); } var imageCanvas; - if ($rootScope.multiViewCounter != undefined) { imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid); - } - else { - imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid); - } - - + if (imageCanvas != null || imageCanvas != undefined) { var width = imageCanvas.width; var ht = imageCanvas.height; @@ -2933,18 +2729,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'CanvasDivTopPosition', $("#canvasDivDA_" + windowviewid).scrollTop()); $scope.SetwindowStoreData(windowviewid, 'CanvasDivLeftPosition', $("#canvasDivDA_" + windowviewid).scrollLeft()); } - - if ($rootScope.isOpenResourceBtnClicked && $rootScope.isTermClicked == false) { - $scope.EnableUI(); - if (($rootScope.multiViewInfoIndex + 1) < $rootScope.multiViewInfo.length) { - $scope.DisableUI(); - $rootScope.intSearch = $rootScope.multiViewInfoIndex; - $rootScope.multiViewInfoIndex = $rootScope.multiViewInfoIndex + 1; - $scope.openBodyView(); - } - } - - else { + $scope.DisableUI(); if ($scope.isSearchDataLoaded) { $rootScope.isLoading = false; @@ -2984,8 +2769,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.EnableUI(); } - } - } } @@ -2997,28 +2780,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var maskImgData = context.getImageData(0, 0, w, h); var MaskCanvasData = $scope.GetwindowStoreData(windowviewid,'MaskCanvasData'); - if ($rootScope.isOpenResourceBtnClicked) { MaskCanvasData.push( { - "viewID": $rootScope.multiViewCounter, "bodyRegionId": bodyRegionId, "canvasId": FlipedImgCanvas.id, "maskData": maskImgData, - } - ); - - } - else { - MaskCanvasData.push( - { - "bodyRegionId": bodyRegionId, - "canvasId": FlipedImgCanvas.id, - "maskData": maskImgData, - } - ); - } - + } ); + } }; @@ -3045,23 +2814,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (isMaskImage == 'Y') { imgCanvas.style.visibility = 'hidden'; - if ($rootScope.isOpenResourceBtnClicked) { - imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid; - } - else { - imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid; - } - + imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid; } else { - if ($rootScope.isOpenResourceBtnClicked) { imgCanvas.id = 'imageCanvas' + bodyRegionId + "_" + windowviewid; - } - else { - imgCanvas.id = 'imageCanvas' + bodyRegionId + "_" + windowviewid; - } - - + if (bodyRegionId == 3) { //set z index of hip canavs to fix the issue caused by overlapping of arm canavs on hip canavs. imgCanvas.style.zIndex = "100"; @@ -3352,45 +3109,22 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.ColoredImageSRC.length < totalCanvas) { - if ($rootScope.isOpenResourceBtnClicked) { - $scope.ColoredImageSRC.push( { - "viewID": $rootScope.multiViewCounter, "bodyRegionId": bodyRegionId, "SRC": src, "Height": h, "Width": w, "x": x, "y": y, "haveMirror": 'false' - } - ); - - } - else { - $scope.ColoredImageSRC.push( - { - "bodyRegionId": bodyRegionId, "SRC": src, - "Height": h, - "Width": w, - "x": x, - "y": y, - "haveMirror": 'false' - } - - ); - } + } ); } var imageCanvas; - if ($rootScope.multiViewCounter != undefined) { - imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + "_" + windowviewid); - } - else { - imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + "_" + windowviewid); - } + imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + "_" + windowviewid); + if (imageCanvas != null || imageCanvas != undefined) { var width = imageCanvas.width; var ht = imageCanvas.height; @@ -3434,16 +3168,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'CanvasDivTopPosition', $("#canvasDivDA_" + windowviewid).scrollTop()); $scope.SetwindowStoreData(windowviewid, 'CanvasDivLeftPosition', $("#canvasDivDA_" + windowviewid).scrollLeft()); } - - if ($rootScope.isOpenResourceBtnClicked && $rootScope.isTermClicked == false) { - $scope.EnableUI(); - if (($rootScope.multiViewInfoIndex + 1) < $rootScope.multiViewInfo.length) { - $scope.DisableUI(); - $rootScope.multiViewInfoIndex = $rootScope.multiViewInfoIndex + 1; - $scope.openBodyView(); - } - } - else { + $scope.DisableUI(); if ($scope.isSearchDataLoaded) { $rootScope.isLoading = false; @@ -3489,7 +3214,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'hidden'); $scope.EnableUI(); } - } + } } @@ -3502,25 +3227,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var maskImgData = context.getImageData(0, 0, w, h); var MaskCanvasData = $scope.GetwindowStoreData(windowviewid,'MaskCanvasData'); - if ($rootScope.isOpenResourceBtnClicked) { - MaskCanvasData.push( - { - "viewID": $rootScope.multiViewCounter, - "bodyRegionId": bodyRegionId, - "canvasId": imgCanvas.id, - "maskData": maskImgData, - } - ); - } - else { + MaskCanvasData.push( { "bodyRegionId": bodyRegionId, "canvasId": imgCanvas.id, "maskData": maskImgData, - } - ); - } + } ); + } }; @@ -7805,15 +7519,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var len= (event.currentTarget.id).split("_").length; var windowviewid = (event.currentTarget.id).split("_")[len-1]; - if ($rootScope.isOpenResourceBtnClicked) { - - var btnId = (event.currentTarget).id; - if (btnId.indexOf('_') != -1) { - $rootScope.multiViewCounter = (btnId).split("_")[1]; - $scope.setScopeVariables(); - } - } - $("#OnIdentify").removeClass("annotationtoolbartab"); $("#DrawMode").removeClass("annotationtoolbartab"); $('.btnCursor').removeClass('activebtncolor'); @@ -7856,21 +7561,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //1. $scope.flushCanvas(windowviewid); - - if ($rootScope.isOpenResourceBtnClicked) { - var zoomVal = $('#zoomValueDA_' + windowviewid).val(); - if (zoomVal == 25) { - $scope.SetwindowStoreData(windowviewid,'zoomInOut',75); - $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); - } - else { - $scope.SetwindowStoreData(windowviewid,'zoomInOut',25); - $('#$zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); - - } - } - else - { + var zoomVal = $('#zoomValueDA_' +windowviewid).val(); if (zoomVal == 25) { $scope.SetwindowStoreData(windowviewid,'zoomInOut',75); @@ -7880,8 +7571,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'zoomInOut',25); $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); } - } - + var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); $scope.CalculateImageCordinates(viewOrientationId,windowviewid); @@ -7939,16 +7629,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var id; var maskId; - if ($rootScope.isOpenResourceBtnClicked) { - id = 'imageCanvas' + i + "_" + windowviewid; - maskId = 'imageCanvas' + i + '_mci' + "_" + windowviewid; - } - else { id = 'imageCanvas' + i + "_" + windowviewid; maskId = 'imageCanvas' + i + '_mci'+"_"+ windowviewid; - } - - + var canvas = document.getElementById(id); if (canvas != null || canvas != undefined) document.getElementById('canvasDivDA_' + windowviewid).removeChild(canvas); @@ -7961,16 +7644,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (i == 4 || i == 5 || i == 6) { - if ($rootScope.isOpenResourceBtnClicked) { - id = 'imageCanvas' + i + '_MR' + "_" + windowviewid; - maskId = 'imageCanvas' + i + '_MR_mci' + "_" + windowviewid; - } - else { id = 'imageCanvas' + i + '_MR'+"_"+ windowviewid; maskId = 'imageCanvas' + i + '_MR_mci'+"_"+ windowviewid; - } - - + var canvas = document.getElementById(id); if (canvas != null || canvas != undefined) document.getElementById('canvasDivDA_' + windowviewid).removeChild(canvas); @@ -8385,20 +8061,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('ColoredImageSRC length before gray= ' + ColoredImageSRC.length) var id; if (value.haveMirror == 'true') { - if ($rootScope.multiViewCounter != undefined) { - id = 'imageCanvas' + value.bodyRegionId + '_MR' + "_" + windowviewid; - } - else { - id = 'imageCanvas' + value.bodyRegionId + '_MR' + "_" + windowviewid; - } + id = 'imageCanvas' + value.bodyRegionId + '_MR' + "_" + windowviewid; + } else { - if ($rootScope.multiViewCounter != undefined) { - id = 'imageCanvas' + value.bodyRegionId + "_" + windowviewid; - } - else { id = 'imageCanvas' + value.bodyRegionId + "_" + windowviewid; - } } @@ -8653,20 +8320,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l angular.forEach(ColoredImageSRC, function (value, key) { var id; if (value.haveMirror == 'true') { - if ($rootScope.multiViewCounter != undefined) { - id = 'imageCanvas' + value.bodyRegionId + '_MR' + "_" + windowviewid; - } - else { - id = 'imageCanvas' + value.bodyRegionId + '_MR'+"_" + windowviewid;; - } + id = 'imageCanvas' + value.bodyRegionId + '_MR'+"_" + windowviewid; } else { - if ($rootScope.multiViewCounter != undefined) { - id = 'imageCanvas' + value.bodyRegionId + "_" + windowviewid; - } - else { id = 'imageCanvas' + value.bodyRegionId + "_" + windowviewid; - } } var imageCanvas = document.getElementById(id); @@ -9238,12 +8895,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } }) - - if ($rootScope.isOpenResourceBtnClicked && isSameViewClicked) { - - } - else - { var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList'); if (previousHighlightList.length > 0) { @@ -9252,13 +8903,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.DisableUI(); $scope.SetwindowStoreData(windowviewid,'isViewChange',true); - if ($rootScope.isOpenResourceBtnClicked) { - - var multiViewInfo = $rootScope.multiViewInfo; - //var windowviewid = event.target.parentElement.parentElement.id.split('_')[1]; - $rootScope.multiViewCounter = windowviewid; - $scope.setScopeVariables(); - } + var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid); $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; @@ -9407,7 +9052,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.CloseAnnotationTool(); $('#typedTermName_' + windowviewid).val(''); - } } @@ -9472,11 +9116,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if(ModestyValue=="Y") { - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'isModestyOn',true); + $scope.SetwindowStoreData(windowviewid, 'isModestyOn', true); } else { - $scope.SetwindowStoreData($rootScope.MULTI_VIEW_ID,'isModestyOn',false); + $scope.SetwindowStoreData(windowviewid, 'isModestyOn', false); } if (!$rootScope.isCallFromOtherModule) { @@ -9915,13 +9559,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'visible'); //1. - if ($rootScope.isOpenResourceBtnClicked) { - $("#typedTermName_" + windowviewid).val(event.currentTarget.innerHTML); - } - else { - $("#typedTermName_" + windowviewid).val(event.currentTarget.innerHTML); - } - + $("#typedTermName_" + windowviewid).val(event.currentTarget.innerHTML); + //2. $scope.HighlightBodyOnListManagerSelection(event.currentTarget.id, false, windowviewid); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index f41b13a..84c3ca6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -116,10 +116,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A var isfilloptionChecked = ""; var isOutlineOptionChecked = ""; - $rootScope.isOpenResourceBtnClicked = false; - $rootScope.multiViewInfo = []; $rootScope.openResource = function () { - // $rootScope.isOpenResourceBtnClicked = true; // $rootScope.isTermClicked = false; //switch ($location.url()) { // case '/curriculum-builder-detail': @@ -206,23 +203,32 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A ''; $(header).append(css); + $(iframe).contents().on("mousedown, mouseup, click", function(){ + alert("Click detected inside iframe."); + }); $timeout(function () { - // var elmnt = iframe.contentWindow.document.getElementById("da-view-list"); + var elmnt = iframe.contentWindow.document.getElementById("da-view-list"); // var location1 = iframe.contentWindow.document.location.href; - // $('#' + elmnt.id).trigger('click'); + // $('#' + elmnt.id).trigger('click'); // $("#" + elmnt.id).css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); // iframe.setAttribute("src", location + "/da-view-list"); //window.location.href = location; // var currentlocation = iframe.contentWindow.document.location.href; // iframe.contentWindow.document.locatiom.replace(currentlocation + "da-view-list"); - // document.getElementById("OpenModuleInCB").src = "http://stackoverflow.com"; - // location.replace("https://www.w3schools.com") + // document.getElementById("OpenModuleInCB").src = "http://stackoverflow.com"; + // location.replace(elmnt.href); + + // URLUtils.href='/da-body-view'; + // $location.url('/da-body-view'); + // var hrf=iframe.contentWindow.location.href; + // iframe.contentWindow.location.href=hrf+'da-body-view'; + // iframe.onload = null; // window.top.location.href = "http://www.example.com"; - var myframe = iframe; + // var myframe = iframe; - }, 1000); + }, 2000); } @@ -1658,13 +1664,6 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $('#ImagePanel').remove(); - - if ($rootScope.isOpenResourceBtnClicked == true) { - - if ($('#daImagePanel_' + $rootScope.MULTI_VIEW_ID).length > 0) - $('#daImagePanel_' + $rootScope.MULTI_VIEW_ID).remove(); - } - $location.url('/' + slug); $rootScope.$broadcast('jsPanelCloseEvent', true); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index b3388fe..627a358 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -291,6 +291,32 @@ AIA.service('ModuleService', function ($http, DataService) { moduleDataObj.CAData = []; moduleDataObj.ThreeDData = []; - } + }, + ClearWinDataByModule: function (moduleName) { + if (moduleName == "ATLAS_ANATOMY") + { + moduleDataObj.AAData = []; + } + else if (moduleName == "DISSECTIBLE_ANATOMY") + { + moduleDataObj.DAData = []; + } + else if (moduleName == "CLINICAL_ILLUSTRATIONS") + { + moduleDataObj.CIData = []; + } + else if (moduleName == "CLINICAL_ANIMATIONS") + { + moduleDataObj.CAData = []; + } + else if (moduleName == "THREE_D_ANATOMY") + { + moduleDataObj.ThreeDData = []; + } + + }, + + + }; }); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html index e6bcaf3..e7371a7 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view.html @@ -1,6 +1,6 @@ 
-
+