diff --git a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj index 924bed4..89b040c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj +++ b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj @@ -52307,6 +52307,7 @@ + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 6c93e4d..4daaede 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -1,8 +1,8 @@ AIA.controller("3dAController", ["$scope", "$rootScope", "pages", "$log", '$http', 'DataService', '$filter', '$location', '$document', '$sce', "$compile", "$timeout", "ModuleService", "$interval", function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location, $document, $sce, $compile, $timeout, ModuleService, $interval) { - $scope.initialize3DWindowData = function (windowviewid, isOpenWithExistsModule, cbwindowid) { - if (isOpenWithExistsModule || cbwindowid == 0) { + $scope.initialize3DWindowData = function (windowviewid, isOpenWithExistsModule, openPanelNo) { + if (isOpenWithExistsModule || openPanelNo == 0) { if ($rootScope.TheeDWindowData != undefined) { $rootScope.TheeDWindowData.length = 0; } @@ -133,6 +133,11 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location if (index != -1) { // remove module which one is loaded $scope.TheeDWindowData.splice(index, 1); + if ($('#' + panelid).html() != undefined) { + + $('#' + panelid).remove(); + + } $rootScope.resetjsPanelTop(); } } @@ -146,6 +151,18 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $rootScope.MULTI_VIEW_ID += 1 + // store exist module in module service + var ExistData = ModuleService.getModuleData("THREE_D_ANATOMY"); + + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); + } + var newWindowData = { + "mType": 'THREE_D_ANATOMY', + }; + ModuleService.setModuleData(newWindowData, 0); + $scope.initialize3DWindowData($rootScope.MULTI_VIEW_ID, true, undefined); $scope.DisableUI(); @@ -236,8 +253,6 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location window.parent.AIAModuleOpenResourceInfo(ThreeDopenData); - window.parent.closeIFrame(); - } else { @@ -285,12 +300,10 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.wincount = 1; var winlen = $scope.ThreeDModuleData.length; var timeint = null; - var slideId = ""; timeint = $interval(function () { if ($scope.readyToLoad == true) { var windata = $scope.ThreeDModuleData[$scope.wincount - 1]; - slideId = windata.slideId; $scope.Open3DModelBody(windata); } @@ -303,7 +316,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location if ($scope.wincount == winlen && $rootScope.ThreeDWindowLoadComplete == true) { $scope.stopInterval(); - $scope.$emit("LoadModuleComplete", "THREE_D_ANATOMY", slideId); + $scope.$emit("LoadModuleComplete", "THREE_D_ANATOMY"); } @@ -408,7 +421,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } else { - $scope.jsPanelWidth = $(window).outerWidth() - 10; + $scope.jsPanelWidth = $(window).outerWidth() - 20; $scope.jsPanelHeight = $(window).outerHeight() - 105; $scope.jsPanelLeft = 1; $scope.jsPanelTop = 70; @@ -465,9 +478,10 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location if ($rootScope.isCallFromOtherModule) { - $scope.JsPanelMouseEnter(windowviewid); + // $scope.JsPanelMouseEnter(windowviewid); $rootScope.ThreeDWindowLoadComplete = true; } + $scope.JsPanelMouseEnter(windowviewid); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index f123574..f8753c8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -1,9 +1,6 @@ -AIA.controller("AIController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "DataService", "AIAConstants", -function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, DataService, AIAConstants) { - // $rootScope.currentActiveModuleTitle = pages[3].name; +AIA.controller("AIController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "DataService", "AIAConstants","ModuleService", "$interval", +function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, DataService, AIAConstants, ModuleService, $interval) { $scope.showTabButton = true; - $scope.IllustrationData; - $scope.searchAIListViewData = []; $scope.SelectedAIthumbImage = []; $scope.SelectedAIImage = []; $scope.SelectedAIId = []; @@ -17,22 +14,227 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout SearchTextByAlphabet: '', SelectedDiv: '' }; - var Count = 200; - localStorage.setItem("ImageCount", Count); + + + $scope.numPerImage = 100; + $scope.maxSize = 5; + $scope.totalimage =0; + + $scope.numPages = function () { + return Math.ceil($scope.totalimage / $scope.numPerImage); + }; + + $scope.$watch('currentPage + numPerPage', function () { + var begin = (($scope.currentPage - 1) * $scope.numPerImage) + , end = begin + $scope.numPerImage; + + if ($scope.filterstring) + { + + if ($scope.AllsearchAIViewData != undefined) { + localStorage.setItem("currentpage", $scope.currentPage); + if ($scope.activeTab == 1) { + $scope.searchAIImageViewData = $scope.AllsearchAIViewData.slice(begin, end); + } + else { + $scope.searchAIListViewData = $scope.AllsearchAIViewData.slice(begin, end); + } + } + } + else + { + + if ($scope.AllAIListViewData != undefined) { + localStorage.setItem("currentpage", $scope.currentPage); + $scope.selectedAIListViewData = $scope.AllAIListViewData.slice(begin, end); + } + + } + + }); + + var searchByText = $rootScope.getLocalStorageValue("SearchText"); var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView"); + $scope.initializeAIWindowData = function (windowviewid, isOpenWithExistsModule, openPanelNo) { + if (isOpenWithExistsModule || openPanelNo == 0) { + if ($rootScope.AIWindowData != undefined) { + $rootScope.AIWindowData.length = 0; + } + else { + $rootScope.AIWindowData = []; + } + + $rootScope.AIWindowData.push( + { + 'multiwinid': windowviewid, + 'IllustrationData': [], + 'searchAIListViewData': [], + 'ImageCount':200, + 'AIImagePath': '', + 'moduleName': '', + 'currentViewTitle': '', + 'parentSlugName': '', + 'currentSlug': '', + 'imageId': '', + 'imageName': '', + }); + + } + else { + var isNewWindow = true; + for (var k = 0; k < $rootScope.AIWindowData.length; k++) { + if ($rootScope.AIWindowData[k].multiwinid == windowviewid) { + isNewWindow = false; + break; + } + } + + if (isNewWindow) { + $rootScope.AIWindowData.push( + { + 'multiwinid': windowviewid, + 'IllustrationData': [], + 'searchAIListViewData': [], + 'ImageCount': 200, + 'AIImagePath': '', + 'moduleName': '', + 'currentViewTitle': '', + 'parentSlugName': '', + 'currentSlug': '', + 'imageId': '', + 'imageName': '', + }); + + } + } + } + + $scope.GetAIwindowStoreData = function (windowviewid, keyname) { + for (var x = 0 ; x < $rootScope.AIWindowData.length; x++) { + + if ($rootScope.AIWindowData[x].multiwinid == windowviewid) { + return $rootScope.AIWindowData[x][keyname]; + } + } + } + + $scope.SetAIwindowStoreData = function (windowviewid, keyname, value) { + for (var x = 0 ; x < $rootScope.AIWindowData.length; x++) { + + if ($rootScope.AIWindowData[x].multiwinid == windowviewid) { + $rootScope.AIWindowData[x][keyname] = value; + } + } + } + + $rootScope.GetAIWindowId = function () { + // handle for single window + if ($rootScope.AIWindowData.length > 0) { + for (var x = 0 ; x < $rootScope.AIWindowData.length; x++) { + + return $rootScope.AIWindowData[x].multiwinid; + } + } + else return 0; + } + + $scope.DisableUI = function () { + + var aiImagePanelConetent = document.getElementsByClassName("jsPanel-content"); + for (var i = 0; i < aiImagePanelConetent.length; i++) { + aiImagePanelConetent[i].style.pointerEvents = "none"; + aiImagePanelConetent[i].style.opacity = "0.7"; + + } + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + + // CB module disable all + $('#CBDetailPageDiv').css('pointer-events', 'none'); + $('#CBDetailPageDiv').css('opacity', '0.7'); + + //$('#imgParent').css('z-index', '1'); + //document.getElementById("imgParent").style.pointerEvents = "none"; + //document.getElementById("imgParent").style.opacity = "0.5"; + } + + $scope.EnableUI = function () { + + var aiImagePanelConetent = document.getElementsByClassName("jsPanel-content"); + for (var i = 0; i < aiImagePanelConetent.length; i++) { + aiImagePanelConetent[i].style.pointerEvents = "auto"; + aiImagePanelConetent[i].style.opacity = "1"; + } + + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + // CB module enable all + $('#CBDetailPageDiv').css('pointer-events', 'auto'); + $('#CBDetailPageDiv').css('opacity', '1'); + + //document.getElementById("imgParent").style.pointerEvents = "auto"; + //document.getElementById("imgParent").style.opacity = "1.0"; + } + + $scope.PanelActivity = function () { + + $("#" + $scope.jsPanelID).resize(function (event) { + //work on it + // alert('test'); + }); + // close panel + $(document).on("click", "#" + $scope.jsPanelID + " .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.AIWindowData.length; index++) { + + if ($rootScope.AIWindowData[index].multiwinid == windowviewid) { + + if (index != -1) { + // remove module which one is loaded + $scope.AIWindowData.splice(index, 1); + if ($('#' + panelid).html() != undefined) { + + $('#' + panelid).remove(); + + } + $rootScope.resetjsPanelTop(); + } + } + } + + }); + } //Modified code by sandeep for fixed Bugs of ADAM Images - $scope.setActiveTab = function (tabToSet, inderectCall) { - + $scope.setActiveTab = function (tabToSet, inderectCall, windowviewid) { + if (windowviewid == undefined) + windowviewid = $rootScope.MULTI_VIEW_ID; + $scope.DisableUI(); $scope.activeTab = tabToSet; - localStorage.setItem("currentAITabView", ""); + + var pretab = $rootScope.getLocalStorageValue("currentAITabView"); + + if (pretab != tabToSet) { + $scope.currentPage = 1; + localStorage.setItem("currentpage", $scope.currentPage); + } + else { + $scope.currentPage = parseInt($rootScope.getLocalStorageValue("currentpage")); + } + localStorage.setItem("currentAITabView", $scope.activeTab); - var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); + var ImageCount = $scope.GetAIwindowStoreData(windowviewid, 'ImageCount'); var searchText = $rootScope.getLocalStorageValue("SearchText"); var SearchByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); - + $scope.hiderow = false; if (tabToSet == 2) { var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected"); @@ -40,46 +242,46 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId"); var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId"); if (searchText != '' && searchText != null && searchText != undefined) { - $scope.ApplySearch(searchText); + $scope.ApplySearch(searchText, windowviewid); if (inderectCall == true) { if (curSelectedRowId != "") { - $scope.showItem(curSelectedRowId); + $scope.showItem(curSelectedRowId, windowviewid); } } else { if (selectedImageId != "") { $scope.filterstring = false; - $scope.showItem(selectedImageId); + $scope.showItem(selectedImageId, windowviewid); $scope.filterstring = true; } - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount); + } } else if (SearchByAlphabet != "" && SearchByAlphabet != null && SearchByAlphabet != undefined) { - $scope.ApplySearchByAlphabet(SearchByAlphabet); + $scope.ApplySearchByAlphabet(SearchByAlphabet, windowviewid); if (inderectCall == true) { if (curSelectedRowId != "") { - $scope.showItem(curSelectedRowId); + $scope.showItem(curSelectedRowId, windowviewid); } } else { if (selectedImageId != "") { $scope.filterstring = false; - $scope.showItem(selectedImageId); + $scope.showItem(selectedImageId, windowviewid); $scope.filterstring = true; } } } else { - $scope.loadAllAI(ImageCount); + $scope.loadAllAI(ImageCount, windowviewid); if (inderectCall == true) { if (curSelectedRowId != "") { $scope.filterstring = true; - $scope.showItem(curSelectedRowId); + $scope.showItem(curSelectedRowId, windowviewid); $scope.filterstring = false; } } else { if (selectedImageId != "") { $scope.filterstring = false; - $scope.showItem(selectedImageId); + $scope.showItem(selectedImageId, windowviewid); } } } @@ -95,13 +297,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //Modified Code by sandeep for fixed bug-45300 if (searchText != '' && searchText != null && searchText != undefined) { - $scope.ApplySearch(searchText); + $scope.ApplySearch(searchText, windowviewid); } else if (SearchByAlphabet != "" && SearchByAlphabet != null && SearchByAlphabet != undefined) { - $scope.ApplySearchByAlphabet(SearchByAlphabet); + $scope.ApplySearchByAlphabet(SearchByAlphabet, windowviewid); } else { - $scope.loadAllAI(ImageCount); + $scope.loadAllAI(ImageCount, windowviewid); } $('#grid-view').css("display", "block"); @@ -110,26 +312,42 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout setTimeout(function () { $scope.setImgPosition(); - }, 100); + }, 500); }; $scope.loadAIModuleById = function (moduleId) { - + $rootScope.isCallFromOtherModule = undefined; + $rootScope.MULTI_VIEW_ID += 1; + + $scope.DisableUI(); + + // store exist module in module service + var ExistData = ModuleService.getModuleData("ADAM_IMAGES"); + + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); + } + var newWindowData = { + "mType": 'ADAM_IMAGES', + }; + ModuleService.setModuleData(newWindowData, 0); + + $scope.initializeAIWindowData($rootScope.MULTI_VIEW_ID, true, undefined); + if ($rootScope.checkRefreshButtonClick == 1) { var query = $scope.query; - $scope.Reset(query); + $scope.ResetCurrentModule(query, $rootScope.MULTI_VIEW_ID); $rootScope.checkRefreshButtonClick = 0; } - var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); + var ImageCount = $scope.GetAIwindowStoreData($rootScope.MULTI_VIEW_ID, 'ImageCount'); + if ($rootScope.refreshcheck == null) { $location.path('/'); } - // code that will be executed ... - // every time this view is loaded - //get current path var currentURL = $location.path(); var selectedModuleName = ''; @@ -141,40 +359,41 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.currentActiveModuleTitle = selectedModuleName; }) - $scope.LoadAIJsonData(ImageCount); + $scope.SetAIwindowStoreData($rootScope.MULTI_VIEW_ID, 'moduleName', "Adam Images"); + + $scope.LoadAIJsonData(ImageCount, $rootScope.MULTI_VIEW_ID); $scope.scroll(); //push the details of open module in array $rootScope.openModules - $rootScope.openModules.push({ "ModuleId": 13 }); - + $rootScope.openModules.push({ "ModuleId": 13 }); //set the local storage - var curtab = $rootScope.getLocalStorageValue("currentAITabView"); - var inderectCall = true; - if (curtab == 2) { - $scope.setActiveTab(2, inderectCall); - var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); - if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { - $scope.reRunSearchOnLoad(); - $scope.idSelected = curSelectedRowId; - $scope.ReloadListViewImageDiv($scope.idSelected, ImageCount); + setTimeout(function () { + var curtab = $rootScope.getLocalStorageValue("currentAITabView"); + var inderectCall = true; + if (curtab == 2) { + $scope.setActiveTab(2, inderectCall); + var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); + if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { + $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID); + $scope.idSelected = curSelectedRowId; + $scope.ReloadListViewImageDiv($scope.idSelected, ImageCount, $rootScope.MULTI_VIEW_ID); + } + else { + $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID) + $scope.idSelected = ''; + } } else { - $scope.reRunSearchOnLoad() - $scope.idSelected = ''; - } - } - else { - $scope.setActiveTab(1, inderectCall); - $scope.reRunSearchOnLoad(); - } - + $scope.setActiveTab(1, inderectCall); + $scope.reRunSearchOnLoad($rootScope.MULTI_VIEW_ID); + } + }, 500); } - $scope.reRunSearchOnLoad = function () { + $scope.reRunSearchOnLoad = function (windowviewid) { var searchByText = $rootScope.getLocalStorageValue("SearchText"); var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); - var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); - + if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { $scope.query.SearchText = searchByText; } @@ -185,84 +404,71 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.query.SearchTextByAlphabet = ""; } - //if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { - - // $scope.loadAllAI(ImageCount); - //} - } - $scope.LoadAIJsonData = function (ImageCount) { + $scope.LoadAIJsonData = function (ImageCount, windowviewid) { + $('ul li span').removeAttr("style"); + var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') promise.then( function (result) { - $scope.IllustrationData = result; - $scope.selectedAIListViewData = new jinqJs() - .from($scope.IllustrationData.root.AIData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select().slice(0, ImageCount); + + var IllustrationData = new jinqJs() + .from(result.root.AIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + //.select().slice(0, ImageCount); + .select(); + $scope.AllAIListViewData = IllustrationData; + $scope.totalimage = IllustrationData.length; + // $scope.currentPage = 1; + $scope.SetAIwindowStoreData(windowviewid, 'IllustrationData', IllustrationData); + }, function (error) { + $scope.EnableUI(); // handle errors here console.log(' $scope.IllustrationData = ' + error.statusText); } ); + + }; - $scope.loadAllAI = function (ImageCount) { + $scope.loadAllAI = function (ImageCount, windowviewid) { $rootScope.isLoading = true; localStorage.setItem("SearchText", ''); localStorage.setItem("SearchByAlphabet", ''); $('ul li span').removeAttr("style"); - $('#aiSpinner').css('visibility', 'visible'); - $('#aiSpinner').css('zIndex', '20000'); - if ($location.url() == "/ADAM-images") { - $scope.DisableUI(); - } - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') - promise.then( - function (result) { - $scope.IllustrationData = result; - - $scope.selectedAIListViewData = new jinqJs() - .from($scope.IllustrationData.root.AIData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - //.select().slice(0, ImageCount); - .select(); //Fixed Bug-58419 by Sandeep - - //console.log($scope.selectedAIListViewData); - - $('#grid-view').empty(); - var $e1 = $('
  • ' - + '
    ' - + ''//alt="{{value._Title}}" >' - + '

    {{value._Title}}

').appendTo('#grid-view'); - $compile($e1)($scope); - - $timeout(function () { - $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); - if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images" && $scope.query.SelectedDiv == 1) { - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); - } + + var IllustrationData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); + // $scope.selectedAIListViewData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); + + $scope.AllAIListViewData = IllustrationData; + $scope.totalimage = IllustrationData.length; + + $scope.selectedAIListViewData = new jinqJs() + .from(IllustrationData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select().slice(0, $scope.numPerImage); + + $('#grid-view').empty(); + var $e1 = $('').appendTo('#grid-view'); + $compile($e1)($scope); + + $timeout(function () { + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); + if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images" && $scope.query.SelectedDiv == 1) { + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); + } - }, 100); - - $rootScope.isLoading = false; - $('#aiSpinner').css('visibility', 'hidden'); - if ($location.url() == "/ADAM-images") { - setTimeout(function () { - $scope.EnableUI(); - }, 10); - } - - }, - function (error) { - // handle errors here - console.log(' $scope.IllustrationData = ' + error.statusText); - } - ); + }, 100); + + $timeout(function () { $scope.EnableUI(); }, 500); } @@ -271,7 +477,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - $scope.showItem = function (id) { + $scope.showItem = function (id, windowviewid) { + if (windowviewid == undefined) + windowviewid = $rootScope.MULTI_VIEW_ID; + //Modified code by sandeep for fixed issue of ADAM Images $scope.idSelected = id; localStorage.setItem("AISelectedRowId", id); @@ -280,7 +489,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("AIListViewScroll", y); //$('#' + id).find('.thumbnail').addClass('HightLightThumbnail'); localStorage.setItem("currentAIImageId", id); - $scope.hiderow = true; + if ($scope.filterstring == false) { var SelectedAIthumbImage = []; @@ -293,14 +502,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage; $scope.SelectedAIId = SelectedAIthumbImage[0]._id; $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title; - } else { $scope.hiderow = false; } + $scope.hiderow = true; + } + else + { $scope.hiderow = false; } } else { - if ($scope.searchAIListViewData.length > 0) { + var searchAIListViewData = $scope.GetAIwindowStoreData(windowviewid, 'searchAIListViewData'); + if (searchAIListViewData.length > 0) { var SelectedAIthumbImage = []; SelectedAIthumbImage = new jinqJs() - .from($scope.searchAIListViewData) + .from(searchAIListViewData) .where('_id = ' + id) .select('_ThumbnailImage', '_id', '_Title'); @@ -308,14 +521,41 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage; $scope.SelectedAIId = SelectedAIthumbImage[0]._id; $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title; + $scope.hiderow = true; } else { $scope.hiderow = false; } } } }; + $scope.ResetCurrentModule = function (query) { + + $('ul li span').removeAttr("style"); + query.SearchText = ""; + $scope.idSelected = ''; + $scope.hideListViewDiv(); + //set localstorage values + localStorage.setItem("SearchText", ''); + localStorage.setItem("SearchByAlphabet", ''); + localStorage.setItem("AIListViewScroll", ''); + localStorage.setItem("AIGridViewScroll", ''); + localStorage.setItem("currentAITabView", ''); + localStorage.setItem("AIListViewScrollPosition", ''); + localStorage.setItem("AISelectedRowId", ''); + localStorage.setItem("currentAIImageId", ''); + localStorage.setItem("listViewSelectedID", ''); + localStorage.setItem("AIGridViewHighlightThumbnail", ''); + localStorage.setItem("currentViewTitle", ''); + if ($('.selected').hasClass("selected")) { + $('.selected').removeClass("selected"); + } + $('#ListViewDiv').scrollTop(0); + $scope.currentPage = 1; + } //Code changes by Sandeep for fixed bug-57854 - $scope.Reset = function (query) { + $scope.Reset = function (query, windowviewid) { + if (windowviewid == undefined) + windowviewid = $rootScope.MULTI_VIEW_ID; $('ul li span').removeAttr("style"); query.SearchText = ""; $scope.idSelected = ''; @@ -332,32 +572,34 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("listViewSelectedID", ''); localStorage.setItem("AIGridViewHighlightThumbnail", ''); localStorage.setItem("currentViewTitle", ''); - localStorage.setItem("currentImageTitleFromJson", ''); - //localStorage.setItem("", ''); - //localStorage.setItem("", ''); - var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); + + var ImageCount = $scope.GetAIwindowStoreData(windowviewid, 'ImageCount'); if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } - $('#ListViewDiv').scrollTop(0); - - //$scope.hideListViewDiv(); - + $scope.SetAIwindowStoreData(windowviewid, 'searchAIListViewData', []); $scope.filterstring = false; - while ($scope.searchAIListViewData.length) { - $scope.searchAIListViewData.pop(); - } - //$scope.loadAllAI(ImageCount); + $scope.currentPage = 1; + + $scope.DisableUI(); + $scope.loadAllAI(ImageCount, windowviewid); } - $scope.ApplySearch = function (query) { + $scope.ApplySearch = function (query, windowviewid) { + if (windowviewid == undefined) + { + $scope.currentPage = 1; + windowviewid = $rootScope.MULTI_VIEW_ID; + } + + $scope.DisableUI(); + $scope.SetAIwindowStoreData(windowviewid, 'searchAIListViewData', []); //Modified code by sandeep for fixed issue of ADAM Images $('ul li span').removeAttr("style"); $scope.idSelected = ''; - //$scope.hiderow = false; - $scope.hiderow = true; + $scope.hiderow = false; var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); //localStorage.setItem("SearchText", ''); localStorage.setItem("SearchByAlphabet", ''); @@ -375,20 +617,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($scope.query.SearchText == "undefined" || ($scope.query.SearchText == null || $scope.query.SearchText == "")) { $rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT; $("#messageModal").modal('show'); + $scope.EnableUI(); return false; } } - - - //$scope.filterstring = false; - while ($scope.searchAIListViewData.length) { - $scope.searchAIListViewData.pop(); - } - - $rootScope.isLoading = true; - $('#aiSpinner').css('visibility', 'visible'); - $('#aiSpinner').css('zIndex', '20000'); - //$scope.DisableUI(); + $scope.filterstring = true; if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) { //localStorage.setItem("SearchText", query.SearchText); @@ -397,83 +630,92 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout else { localStorage.setItem("SearchText", ''); } + var selectedAIListViewData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') - promise.then( - function (result) { - $scope.IllustrationData = result; + //$scope.selectedAIListViewData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); + var ailistviewdata = []; + $('#grid-view').empty(); + angular.forEach(selectedAIListViewData, function (value, key) { + + var selectimg = true; + //var count = 0; + if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) { + var SearchText = $scope.query.SearchText + var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); + if (posbodyregion > -1) { + selectimg = true; + //count = count + 1; + } + else { + selectimg = false; + //count = count - 1; + } + } - $scope.selectedAIListViewData = new jinqJs() - .from($scope.IllustrationData.root.AIData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); + if (selectimg === true) { + //$scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; - $('#grid-view').empty(); - angular.forEach($scope.selectedAIListViewData, function (value, key) { - - var selectimg = true; - //var count = 0; - if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) { - var SearchText = $scope.query.SearchText - var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); - if (posbodyregion > -1) { - selectimg = true; - //count = count + 1; - } - else { - selectimg = false; - //count = count - 1; - } - } - - if (selectimg === true) { - $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; - - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); - - $compile($el)($scope); - - $scope.searchAIListViewData.push( - { - "_id": value._id, - //"_ImageId": value._ImageId, - "_Title": value._Title, - "_contentImage": value._contentImage, - "_ThumbnailImage": value._ThumbnailImage, - }); - } - }); - $('table > #ListViewDiv > #searchItem').remove(); - - //Show Error Message in case of gridview if no data is found - if ($scope.searchAIListViewData.length == 0) { - var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); - $compile($el)($scope); - $('table > #ListViewDiv > #searchItem').remove(); - - $('#ListViewDiv').append('No illustration found for the selected search criteria!'); - localStorage.setItem("SearchText", ''); - } + //var $el = $('').appendTo('#grid-view'); - setTimeout(function () { - //$scope.setImgPosition(); - $scope.EnableUI(); + //$compile($el)($scope); - }, 10); + ailistviewdata.push( + { + "_id": value._id, + //"_ImageId": value._ImageId, + "_Title": value._Title, + "_contentImage": value._contentImage, + "_ThumbnailImage": value._ThumbnailImage, + }); + } + }); + $('table > #ListViewDiv > #searchItem').remove(); + $scope.SetAIwindowStoreData(windowviewid, 'searchAIListViewData', ailistviewdata); - $rootScope.isLoading = false; - $('#aiSpinner').css('visibility', 'hidden'); - - }, - - function (error) { - // handle errors here - console.log(' $scope.IllustrationData = ' + error.statusText); - } - ); + $scope.totalimage = ailistviewdata.length; + + $scope.AllsearchAIViewData = ailistviewdata; + + if ($scope.activeTab == 1) { + //for image view + $scope.searchAIImageViewData = new jinqJs() + .from(ailistviewdata) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select().slice(0, $scope.numPerImage); + + + var $e1 = $('').appendTo('#grid-view'); + $compile($e1)($scope); + + } + else { + // for list view + $scope.searchAIListViewData = new jinqJs() + .from(ailistviewdata) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select().slice(0, $scope.numPerImage); + + } + + + //Show Error Message in case of gridview if no data is found + if ($scope.AllsearchAIViewData.length == 0) { + var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); + $compile($el)($scope); + $('table > #ListViewDiv > #searchItem').remove(); + + $('#ListViewDiv').append('No illustration found for the selected search criteria!'); + localStorage.setItem("SearchText", ''); + } + + $timeout(function () { $scope.EnableUI(); }, 500); + } //Added method by sandeep for fixed Bug-57978 to selected Image @@ -481,8 +723,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var _currentImgId = $rootScope.getLocalStorageValue("currentAIImageId"); var aISelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); if (_currentImgId != "null" && _currentImgId != null) { + var dd = $('#' + _currentImgId).find('.thumbnail'); $('#' + _currentImgId).find('.thumbnail').addClass('HightLightThumbnail'); - $scope.hiderow = true; + // $scope.hiderow = true; } if ($('#grid-view').css("display") == "block") { var aiGridViewScroll = $rootScope.getLocalStorageValue('AIGridViewScroll'); @@ -507,254 +750,401 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } } + - $scope.DisableUI = function () { - - $('#imgParent').css('z-index', '1'); - document.getElementById("imgParent").style.pointerEvents = "none"; - document.getElementById("imgParent").style.opacity = "0.5"; - } + $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet, windowviewid) { + if (windowviewid == undefined) { + $scope.currentPage = 1; + windowviewid = $rootScope.MULTI_VIEW_ID; + } - $scope.EnableUI = function () { - document.getElementById("imgParent").style.pointerEvents = "auto"; - document.getElementById("imgParent").style.opacity = "1.0"; - } - $scope.counter = 1; - $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { //Modified code by sandeep for fixed issue of ADAM Images $rootScope.SearchTextByAlphabet = SearchTextByAlphabet; localStorage.setItem("SearchText", ''); $('#txtSerachInput').val(""); - //$rootScope.isLoading = true; $scope.idSelected = ''; - //$scope.hiderow = false;//Comment by Sandeep - $scope.hiderow = true; + $scope.hiderow = false; $scope.DisableUI(); $('ul li span').removeAttr("style"); $('#' + $rootScope.SearchTextByAlphabet).css({ "color": "white", "background-color": "#1B92D0" }); $scope.filterstring = true; - while ($scope.searchAIListViewData.length) { - $scope.searchAIListViewData.pop(); - } - $rootScope.isLoading = true; - $('#aiSpinner').css('visibility', 'visible'); - $('#aiSpinner').css('zIndex', '20000'); + $scope.SetAIwindowStoreData(windowviewid, 'searchAIListViewData', []); + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); } else { localStorage.setItem("SearchByAlphabet", ''); } - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') - promise.then( - function (result) { - $scope.IllustrationData = result; - - $scope.selectedAIListViewData = new jinqJs() - .from($scope.IllustrationData.root.AIData) - .orderBy([{ field: '_Title', sort: 'asc' }]).select(); - - $('#grid-view').empty(); - - angular.forEach($scope.selectedAIListViewData, function (value, key) { - var selectimg = true; - //var count = 0; - if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { - var firstChar = value._Title[0]; - if (firstChar == SearchTextByAlphabet) { - selectimg = true; - } - else { - selectimg = false; - } - } - if (selectimg === true) { - $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; - - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); - - $compile($el)($scope); - - $scope.searchAIListViewData.push( - { - "_id": value._id, - //"_ImageId": value._ImageId, - "_Title": value._Title, - "_contentImage": value._contentImage, - "_ThumbnailImage": value._ThumbnailImage, - }); + + var selectedAIListViewData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); + + + //$scope.selectedAIListViewData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); + + var ailistviewdata = []; + $('#grid-view').empty(); + + angular.forEach(selectedAIListViewData, function (value, key) { + var selectimg = true; + //var count = 0; + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { + var firstChar = value._Title[0]; + if (firstChar == SearchTextByAlphabet) { + selectimg = true; + } + else { + selectimg = false; + } + } + if (selectimg === true) { + //$scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; + + //var $el = $('').appendTo('#grid-view'); + + //$compile($el)($scope); + + ailistviewdata.push( + { + "_id": value._id, + //"_ImageId": value._ImageId, + "_Title": value._Title, + "_contentImage": value._contentImage, + "_ThumbnailImage": value._ThumbnailImage, + }); - } - - }); - $('table > #ListViewDiv > #searchItem').remove(); - //Show Error Message in case of gridview if no data is found - if ($scope.searchAIListViewData.length == 0) { - var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); - $compile($el)($scope); - $('table > #ListViewDiv > #searchItem').remove(); - - $('#ListViewDiv').append('No illustration found for the selected search criteria!'); - } - - setTimeout(function () { - //$scope.setImgPosition(); - $scope.EnableUI(); - }, 10); - - $rootScope.isLoading = false; - $('#aiSpinner').css('visibility', 'hidden'); - }, - function (error) { - console.log(' $scope.IllustrationData = ' + error.statusText); - } - ); - } + } + + }); + + $('table > #ListViewDiv > #searchItem').remove(); + + $scope.SetAIwindowStoreData(windowviewid, 'searchAIListViewData', ailistviewdata); + + $scope.totalimage = ailistviewdata.length; + + $scope.AllsearchAIViewData = ailistviewdata; + + if ($scope.activeTab == 1) + { + //for image view + $scope.searchAIImageViewData = new jinqJs() + .from(ailistviewdata) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select().slice(0, $scope.numPerImage); + + var $e1 = $('').appendTo('#grid-view'); + $compile($e1)($scope); + } + else + { + // for list view + $scope.searchAIListViewData = new jinqJs() + .from(ailistviewdata) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select().slice(0, $scope.numPerImage); + + } + + //Show Error Message in case of gridview if no data is found + if ($scope.AllsearchAIViewData.length == 0) { + var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); + $compile($el)($scope); + $('table > #ListViewDiv > #searchItem').remove(); + + $('#ListViewDiv').append('No illustration found for the selected search criteria!'); + } + + $timeout(function () { $scope.EnableUI(); }, 500); + } $scope.scroll = function () { //$("html,body").scrollTop(0); } - $scope.OpenAdamImage = function ($event) { - + var windowviewid = $rootScope.MULTI_VIEW_ID; $rootScope.MenuModuleName = "AI"; $rootScope.disableAnnotationTB = false; $rootScope.AIAnotationIdentifyModeOff = true; $rootScope.currentAIImageId = $event.currentTarget.id; if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { var AITitle = []; - AITitle = new jinqJs() - .from($scope.selectedAIListViewData) - .where('_id = ' + $event.currentTarget.id) - .select('_Title'); + + AITitle = new jinqJs() + .from($scope.AllAIListViewData) + .where('_id = ' + $event.currentTarget.id) + .select(); + $rootScope.ViewTitle = AITitle[0]._Title; } else { $rootScope.ViewTitle = $event.currentTarget.textContent; } + // open module bu openresource + var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource'); + if (isopenResourceRequest == "true") { + + //set default module data + var AIDopenData = { + "id": $event.currentTarget.id, + "mType": 'ADAM_IMAGES', + "windowTitle": $rootScope.ViewTitle, + "size": { height: 600, width: 900 } + }; + + window.parent.AIAModuleOpenResourceInfo(AIDopenData); + + } + else { + localStorage.setItem("currentViewTitle", $rootScope.ViewTitle); + localStorage.setItem("currentAIImageId", $event.currentTarget.id); + + $scope.SetAIwindowStoreData(windowviewid, 'currentViewTitle', $rootScope.ViewTitle); + $scope.SetAIwindowStoreData(windowviewid, 'imageId', $event.currentTarget.id); + + var imageName = AITitle[0]._contentImage; + + $scope.SetAIwindowStoreData(windowviewid, 'imageName', imageName); + + var imagePath = "~/../content/images/ai/images/" + imageName; + + $scope.SetAIwindowStoreData(windowviewid, 'AIImagePath', imagePath); - localStorage.setItem("currentImageTitleFromJson", $rootScope.ViewTitle); - localStorage.setItem("currentAIImageId", $event.currentTarget.id); + + // store image for export + var tittle = $rootScope.getLocalStorageValue("currentViewTitle"); + $rootScope.StoreTitleName(tittle); + $rootScope.StoreOrgImageName(imageName); - var moduleItemDataToBeSavedID = $event.currentTarget.id; - $("#list-view table tbody tr").removeClass("active"); - localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); - $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active"); - localStorage.setItem("AIListViewScrollPosition", $("#list-view table tbody").scrollTop()); + var moduleItemDataToBeSavedID = $event.currentTarget.id; + $("#list-view table tbody tr").removeClass("active"); + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); + $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active"); + localStorage.setItem("AIListViewScrollPosition", $("#list-view table tbody").scrollTop()); - //Set the vertical scroll value of the Grid-View. - var y = $($window).scrollTop(); - localStorage.setItem("AIGridViewScroll", y); - localStorage.setItem("AIGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); - var u = $location.url(); - $location.url('/adam-images-detail'); + //Set the vertical scroll value of the Grid-View. + var y = $($window).scrollTop(); + localStorage.setItem("AIGridViewScroll", y); + localStorage.setItem("AIGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); + var u = $location.url(); + $location.url('/adam-images-detail'); + } + + } - $scope.OpenAdamImageView = function () { + $rootScope.OpenAdamImageViewMain = function () { + + if ($rootScope.isCallFromOtherModule) { + $scope.AIModuleData = ModuleService.getModuleData("ADAM_IMAGES"); + $scope.readyToLoad = true; + $rootScope.AIWindowLoadComplete = false; + $scope.wincount = 1; + var winlen = $scope.AIModuleData.length; + var timeint = null; + timeint = $interval(function () { + + if ($scope.readyToLoad == true) { + var windata = $scope.AIModuleData[$scope.wincount - 1]; + $scope.OpenAdamImageView(windata); + + } + $scope.readyToLoad = false; + if ($scope.wincount < winlen && $rootScope.AIWindowLoadComplete == true) { + $scope.wincount = $scope.wincount + 1; + $rootScope.AIWindowLoadComplete = false; + $scope.readyToLoad = true; + } + + if ($scope.wincount == winlen && $rootScope.AIWindowLoadComplete == true) { + $scope.stopInterval(); + $scope.$emit("LoadModuleComplete", "ADAM_IMAGES"); + } + + + }, 100); + + $scope.stopInterval = function () { + if (angular.isDefined(timeint)) { + $interval.cancel(timeint); + timeint = undefined; + } + + }; + + } + else { + $scope.OpenAdamImageView(null); + } + } + + $scope.OpenAdamImageView = function (aiModuleData) { + + if ($rootScope.isCallFromOtherModule == true) { + $scope.aiOpenInOtherModules = aiModuleData; + $rootScope.MULTI_VIEW_ID += 1; + var windowviewid = $rootScope.MULTI_VIEW_ID; + + $scope.initializeAIWindowData(windowviewid, false, $scope.aiOpenInOtherModules.currentWindowId); + + var moduleName = $scope.aiOpenInOtherModules.mType; + $scope.SetAIwindowStoreData(windowviewid, 'moduleName', moduleName); + + var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json'); + promise.then( + function (result) { + var IllustrationData = new jinqJs() + .from(result.root.AIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + // serial no of imageid + var imageId = $scope.aiOpenInOtherModules.id; + + $scope.SetAIwindowStoreData(windowviewid, 'imageId', imageId); + + var selectedTileData = []; + selectedTileData = new jinqJs() + .from(IllustrationData) + .where('_id == ' + imageId) + .select(); + + + var imageName = selectedTileData[0]._contentImage; + + $scope.SetAIwindowStoreData(windowviewid, 'imageName', imageName); - // $rootScope.currentActiveModuleTitle = "A.D.A.M. Images"; + var imagePath = "~/../content/images/ai/images/" + imageName; + + $scope.SetAIwindowStoreData(windowviewid, 'AIImagePath', imagePath); + + var aiTitle = $scope.aiOpenInOtherModules.anatomyTitle; + $scope.SetAIwindowStoreData(windowviewid, 'currentViewTitle', aiTitle); + localStorage.setItem("currentViewTitle", aiTitle); + + // store image for export + $rootScope.StoreTitleName(aiTitle); + $rootScope.StoreOrgImageName(selectedTileData[0]._contentImage); + + $scope.SetAIwindowStoreData(windowviewid, 'parentSlugName', ($location.url()).replace('/', '')); + + $scope.loadAIllustration(windowviewid); + + }, + function (error) { + // handle errors here + console.log(' $scope.AIllustrationData = ' + error.statusText); + } + + ); + } + else { + $scope.SetAIwindowStoreData($rootScope.MULTI_VIEW_ID, 'parentSlugName', 'ADAM-images'); + $scope.loadAIllustration($rootScope.MULTI_VIEW_ID); + } + } + + $scope.loadAIllustration = function (windowviewid) { if ($rootScope.refreshcheck == null) { $location.path('/'); } - $rootScope.isLoading = true; - $('#aiSpinner').css('visibility', 'visible'); - //$scope.DisableUI(); - $scope.voId = $rootScope.getLocalStorageValue("currentAIImageId"); + + $scope.jsPanelID = 'aiImagePanel' + '_' + windowviewid; + var selectedCIImage = $scope.GetAIwindowStoreData(windowviewid, 'AIImagePath'); + + var tittle = $scope.GetAIwindowStoreData(windowviewid, 'currentViewTitle'); + var imageId = $scope.GetAIwindowStoreData(windowviewid, 'imageId'); + + if ($rootScope.isCallFromOtherModule) { + // open JS panel for curriculum with define cornonate in CB jason + $scope.jsPanelWidth = $scope.aiOpenInOtherModules.size.width;//1000; + $scope.jsPanelHeight = $scope.aiOpenInOtherModules.size.height; + if ($scope.aiOpenInOtherModules.size.height > 540) + $scope.jsPanelHeight = 540; + $scope.jsPanelLeft = 320; + $scope.jsPanelTop = $rootScope.cBModulejsPanelTop(); - var counter = 1; - var tittle = $rootScope.getLocalStorageValue("currentImageTitleFromJson"); - localStorage.setItem("currentViewTitle", tittle); + } + else { + $scope.jsPanelWidth = $(window).outerWidth() - 30; + $scope.jsPanelHeight = $(window).outerHeight() - 125; + $scope.jsPanelLeft = 15; + $scope.jsPanelTop = 70; + } - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') - promise.then( - function (result) { - $scope.AIllustrationData = result; - $scope.AIlistViewData = $scope.AIllustrationData.root.AIData; - - var clickedAIImage = []; - clickedAIImage = new jinqJs() - .from($scope.AIlistViewData) - .where('_id == ' + $scope.voId) - .select('_contentImage'); - - $scope.clickedAIImage = "~/../content/images/ai/images/" + clickedAIImage[0]._contentImage; - - // store image for export - var tittle = $rootScope.getLocalStorageValue("currentViewTitle"); - $rootScope.StoreTitleName(tittle); - $rootScope.StoreOrgImageName(clickedAIImage[0]._contentImage); - - if (clickedAIImage.length > 0) { - - $.jsPanel({ - id: 'aiImagePanel', - selector: '.aiView', - theme: 'success', - currentController: 'AIController', - parentSlug: 'ADAM-images', - content: '
' + - '
' + - '' + + if (selectedCIImage.length > 0) { + + $.jsPanel({ + id: $scope.jsPanelID, + selector: '.aiView', + theme: 'success', + currentController: 'AIController', + parentSlug: $scope.GetAIwindowStoreData(windowviewid, 'parentSlugName'), + content: '
' + + '
' + + '' + - '
', - //ajax: { - // url: 'app/views/ci/ci-view-detail.html' - //}, - title: $rootScope.getLocalStorageValue("currentViewTitle"), - position: { - top: 70, - left: 15, - }, - - size: { width: $(window).outerWidth() - 30, height: $(window).outerHeight() - 125 }, - - }); + '
', + + title: tittle, + position: { + top: $scope.jsPanelTop, + left: $scope.jsPanelLeft + }, + + size: { + width: $scope.jsPanelWidth, + height: $scope.jsPanelHeight + }, + + }); - $('#canvasDiv img').load(function () { - $rootScope.isLoading = false; - $('#aiSpinner').css('visibility', 'hidden'); - var canvas = document.getElementById("canvas"); - var canvasPaint = document.getElementById("canvasPaint"); + $('#canvasDivAI_' + windowviewid + ' img').load(function () { - canvas.height = $("#aiImagePanel .jsPanel-content").height(); - canvasPaint.height = $("#aiImagePanel .jsPanel-content").height(); - }); - $rootScope.currentSlug = 'adam-images-detail'; - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentAIImageId, - "slug": $rootScope.currentSlug - }); + $scope.JsPanelclick(windowviewid); - $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height()); - $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') - var jspContentHeight = $('.jsPanel-content').height(); + $rootScope.AIWindowLoadComplete = true; - // console.log($rootScope.OpenAdamImages); - $('#AIView').css("height", $(window).outerHeight() - 65); + var canvas = document.getElementById("canvasAI_" + windowviewid); + var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid); + + canvas.height = $("#" + $scope.jsPanelID + " .jsPanel-content").height(); + canvasPaint.height = $("#" + $scope.jsPanelID + " .jsPanel-content").height(); + }); - $('#AIView').css("width", $(window).outerWidth() - 15); + $scope.SetAIwindowStoreData(windowviewid, 'currentSlug', 'adam-images-detail'); + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": imageId, + "slug": $scope.GetAIwindowStoreData(windowviewid, 'currentSlug') + }); - //var canvasDIvHeight = parseInt($('#aiImagePanel').outerHeight()) - 30; - var canvasDIvHeight = $("#aiImagePanel .jsPanel-content").height(); + $("#" + $scope.jsPanelID + " .img-thumbnail").css("min-height", $("#" + $scope.jsPanelID + " .jsPanel-content").height()); + $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') + var jspContentHeight = $('.jsPanel-content').height(); - $('#canvasDiv').css('height', canvasDIvHeight); - } - }, - function (error) { - // handle errors here - console.log(' $scope.AIllustrationData = ' + error.statusText); - } - ); + // console.log($rootScope.OpenAdamImages); + $('#AIView').css("height", $(window).outerHeight() - 65); + + $('#AIView').css("width", $(window).outerWidth() - 15); + + //var canvasDIvHeight = parseInt($('#aiImagePanel').outerHeight()) - 30; + var canvasDIvHeight = $("#" + $scope.jsPanelID + " .jsPanel-content").height(); + $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); + } + $scope.PanelActivity(); } $scope.$on('annotationToolEvent', function (event, data) { @@ -764,52 +1154,32 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(0,0,0)") $('#outlineColor .minicolors >.minicolors-panel > .minicolors-grid >.minicolors-picker').css({ "top": "145px", "left": "4px" }); - $("#canvas").css("display", "block"); - $("#canvasPaint").css("display", "block"); + $('#canvasAI_' + $rootScope.MULTI_VIEW_ID).css("display", "block"); + $('#canvasPaintAI_' + $rootScope.MULTI_VIEW_ID).css("display", "block"); $rootScope.onDrawingCanvasClick(); - //Commented by Sandeep - //$rootScope.FreeStylePaint(); - }); - - $scope.ReloadListViewImageDiv = function (id, imgCount) { - //console.log(id); - $scope.idSelected = id; - $scope.hiderow = true; - $rootScope.isLoading = true; - $('#aiSpinner').css('visibility', 'visible'); - $('#aiSpinner').css('zIndex', '20000'); - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') - promise.then( - function (result) { - $scope.IllustrationData = result; + }); - var SelectedAIthumbImage = []; - SelectedAIthumbImage = new jinqJs() - .from($scope.IllustrationData.root.AIData) - .where('_id = ' + id) - .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount); + $scope.ReloadListViewImageDiv = function (id, imgCount, windowviewid) { - if (SelectedAIthumbImage.length > 0) { - $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage; - $scope.SelectedAIId = SelectedAIthumbImage[0]._id; - $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title; - } else { $scope.hiderow = false; } + $scope.idSelected = id; - //Set the scroll position of the tablebody to show selected row - - //$scope.setImgPosition(); + var IllustrationData = $scope.GetAIwindowStoreData(windowviewid, 'IllustrationData'); - $rootScope.isLoading = false; - $('#aiSpinner').css('visibility', 'hidden'); + var SelectedAIthumbImage = []; + SelectedAIthumbImage = new jinqJs() + .from(IllustrationData) + .where('_id = ' + id) + .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount); - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - ); + if (SelectedAIthumbImage.length > 0) { + $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage; + $scope.SelectedAIId = SelectedAIthumbImage[0]._id; + $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title; + $scope.hiderow = true; + } else { $scope.hiderow = false; } + }; $scope.hideListViewDiv = function () { @@ -818,7 +1188,23 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } $scope.hiderow = false; } - } + } + + $scope.JsPanelclick = function (windowviewid) { + // call from while open module in CB + $("#aiImagePanel_" + windowviewid).on('click', function (event) { + + var pnlName = event.currentTarget.id; + $scope.$emit("cBEnableDisableMenuOption", pnlName); + + // store image for export while click on panel + + var currentViewTitle = $scope.GetAIwindowStoreData(windowviewid, 'currentViewTitle'); + var imageName = $scope.GetAIwindowStoreData(windowviewid, 'imageName'); + $rootScope.StoreTitleName(currentViewTitle); + $rootScope.StoreOrgImageName(imageName); + }); + } }] ); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 18d1e40..a0305a6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -26,8 +26,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("currentCATabView", $scope.activeTab); }; - $scope.initializeCAWindowData = function (windowviewid, isOpenWithExistsModule, cbwindowid) { - if (isOpenWithExistsModule || cbwindowid == 0) { + $scope.initializeCAWindowData = function (windowviewid, isOpenWithExistsModule, openPanelNo) { + if (isOpenWithExistsModule || openPanelNo == 0) { if ($rootScope.CAWindowData != undefined) { $rootScope.CAWindowData.length = 0; } @@ -168,6 +168,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (index != -1) { // remove module which one is loaded $scope.CAWindowData.splice(index, 1); + if ($('#' + panelid).html() != undefined) { + + $('#' + panelid).remove(); + + } $rootScope.resetjsPanelTop(); } } @@ -181,6 +186,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.isCallFromOtherModule = undefined; $rootScope.MULTI_VIEW_ID += 1 + // store exist module in module service + var ExistData = ModuleService.getModuleData("CLINICAL_ANIMATIONS"); + + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); + } + var newWindowData = { + "mType": 'CLINICAL_ANIMATIONS', + }; + ModuleService.setModuleData(newWindowData, 0); $scope.initializeCAWindowData($rootScope.MULTI_VIEW_ID, true, undefined); @@ -390,44 +406,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SelectedCAId = SelectedCAthumbImage[0]._id; $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; - } - + } } - - $scope.hiderow = true; - if ($scope.filterstring == false) { - - var SelectedCIthumbImage = []; - SelectedCIthumbImage = new jinqJs() - .from($scope.selectedCIListViewData) - .where('_id = ' + id) - .select('_ThumbnailImage', '_Summary', '_id', '_Title'); - - $scope.SelectedCIthumbImage = "~/../content/images/ci/thumbnails/" + SelectedCIthumbImage[0]._ThumbnailImage; - $scope.SelectedCISummary = SelectedCIthumbImage[0]._Summary; - $scope.SelectedCIId = SelectedCIthumbImage[0]._id; - $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; - - } - else { - var searchCIListViewData = $scope.GetCAwindowStoreData(windowviewid, 'searchCIListViewData'); - - if (searchCIListViewData.length > 0) { - - var SelectedCIthumbImage = []; - SelectedCIthumbImage = new jinqJs() - .from(searchCIListViewData) - .where('_id = ' + id) - .select('_ThumbnailImage', '_Summary', '_id', '_Title'); - - $scope.SelectedCIthumbImage = "~/../content/images/ci/thumbnails/" + SelectedCIthumbImage[0]._ThumbnailImage; - $scope.SelectedCISummary = SelectedCIthumbImage[0]._Summary; - $scope.SelectedCIId = SelectedCIthumbImage[0]._id; - $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; - - } - } - }; $scope.Reset = function (query, windowviewid) { @@ -615,6 +595,25 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.openView = function ($event) { + var windowviewid = $rootScope.MULTI_VIEW_ID; + + $rootScope.disableAnnotationTBFn(); + $rootScope.MenuModuleName = "CA"; + //alert($rootScope.MenuModuleName); + $rootScope.currentBodyViewId = $event.currentTarget.id; + if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { + var selectedTileData = []; + selectedTileData = new jinqJs() + .from($scope.selectedCAListViewData) + .where('_id = ' + $event.currentTarget.id) + .select(); + + $rootScope.ViewTitle = selectedTileData[0]._Title; + } + else { + $rootScope.ViewTitle = $event.currentTarget.textContent; + } + var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource'); if (isopenResourceRequest == "true") { @@ -623,37 +622,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "id": $event.currentTarget.id, "mType": 'CLINICAL_ANIMATIONS', "textVisible": true, - "windowTitle": $event.currentTarget.textContent, + "windowTitle": $rootScope.ViewTitle, "size": { height: 600, width: 900 } }; window.parent.AIAModuleOpenResourceInfo(CADopenData); - - window.parent.closeIFrame(); - } else - { - var windowviewid = $rootScope.MULTI_VIEW_ID; - - $rootScope.disableAnnotationTBFn(); - $rootScope.MenuModuleName = "CA"; - //alert($rootScope.MenuModuleName); - $rootScope.currentBodyViewId = $event.currentTarget.id; - if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { - var selectedTileData = []; - selectedTileData = new jinqJs() - .from($scope.selectedCAListViewData) - .where('_id = ' + $event.currentTarget.id) - .select(); - - $rootScope.ViewTitle = selectedTileData[0]._Title; - } - else { - $rootScope.ViewTitle = $event.currentTarget.textContent; - - } - + { localStorage.setItem("currentViewTitle", $rootScope.ViewTitle); localStorage.setItem("currentBodyViewId", $event.currentTarget.id); @@ -706,12 +682,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.wincount = 1; var winlen = $scope.CAModuleData.length; var timeint = null; - var slideId = ""; timeint = $interval(function () { if ($scope.readyToLoad == true) { var windata = $scope.CAModuleData[$scope.wincount - 1]; - slideId = windata.slideId; $scope.openBodyView(windata); } @@ -724,7 +698,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($scope.wincount == winlen && $rootScope.CAWindowLoadComplete == true) { $scope.stopInterval(); - $scope.$emit("LoadModuleComplete", "CLINICAL_ANIMATIONS", slideId); + $scope.$emit("LoadModuleComplete", "CLINICAL_ANIMATIONS"); } @@ -866,7 +840,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { - $scope.jsPanelWidth = $(window).outerWidth() - 10; + $scope.jsPanelWidth = $(window).outerWidth() - 20; $scope.jsPanelHeight = $(window).outerHeight() - 105; $scope.jsPanelLeft = 1; $scope.jsPanelTop = 70; @@ -959,9 +933,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#spinner').css('visibility', 'hidden'); if ($rootScope.isCallFromOtherModule) { - $scope.JsPanelclick(windowviewid); + //$scope.JsPanelclick(windowviewid); $rootScope.CAWindowLoadComplete = true; } + $scope.JsPanelclick(windowviewid); var isTextVisible = $scope.GetCAwindowStoreData(windowviewid, 'isTextVisible'); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index ffcb661..96a7a67 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -36,8 +36,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("currentCITabView", $scope.activeTab); }; - $scope.initializeCIWindowData = function (windowviewid, isOpenWithExistsModule, cbwindowid) { - if (isOpenWithExistsModule || cbwindowid == 0) { + $scope.initializeCIWindowData = function (windowviewid, isOpenWithExistsModule, openPanelNo) { + if (isOpenWithExistsModule || openPanelNo == 0) { if ($rootScope.CIWindowData != undefined) { $rootScope.CIWindowData.length = 0; } @@ -174,6 +174,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (index != -1) { // remove module which one is loaded $scope.CIWindowData.splice(index, 1); + if ($('#' + panelid).html() != undefined) { + + $('#' + panelid).remove(); + + } $rootScope.resetjsPanelTop(); } } @@ -187,6 +192,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.isCallFromOtherModule = undefined; $rootScope.MULTI_VIEW_ID += 1 + + // store exist module in module service + var ExistData = ModuleService.getModuleData("CLINICAL_ILLUSTRATIONS"); + + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); + } + var newWindowData = { + "mType": 'CLINICAL_ILLUSTRATIONS', + }; + ModuleService.setModuleData(newWindowData, 0); $scope.initializeCIWindowData($rootScope.MULTI_VIEW_ID, true, undefined); @@ -295,7 +312,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.loadAllCI(windowviewid); } else { - $scope.ApplySearch($scope.query); + $scope.ApplySearch($scope.query, windowviewid); } } @@ -332,7 +349,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#grid-view').empty(); var $e1 = $('').appendTo('#grid-view'); $compile($e1)($scope); @@ -435,7 +452,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.filterstring = false; $scope.SetCIwindowStoreData(windowviewid, 'searchCIListViewData', []); - + $scope.DisableUI(); $scope.loadAllCI(windowviewid); } @@ -583,7 +600,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; var $el = $('
' - + '').appendTo('#grid-view'); @@ -636,7 +653,24 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - $scope.openView = function ($event) { + $scope.openView = function ($event) { + var windowviewid = $rootScope.MULTI_VIEW_ID; + $rootScope.MenuModuleName = "CI"; + $rootScope.disableAnnotationTB = false; + $rootScope.CIAnotationIdentifyModeOff = true; + if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { + var selectedTileData = []; + selectedTileData = new jinqJs() + .from($scope.selectedCIListViewData) + .where('_id = ' + $event.currentTarget.id) + .select(); + + $rootScope.ViewTitle = selectedTileData[0]._Title; + } + else { + $rootScope.ViewTitle = $event.currentTarget.textContent; + + } // open module bu openresource var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource'); if (isopenResourceRequest == "true") { @@ -646,35 +680,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "id": $event.currentTarget.id, "mType": 'CLINICAL_ILLUSTRATIONS', "textVisible": true, - "windowTitle": $event.currentTarget.textContent, + "windowTitle": $rootScope.ViewTitle, "size": { height: 600, width: 900 } }; window.parent.AIAModuleOpenResourceInfo(CIDopenData); - window.parent.closeIFrame(); - } else - { - var windowviewid = $rootScope.MULTI_VIEW_ID; - $rootScope.MenuModuleName = "CI"; - $rootScope.disableAnnotationTB = false; - $rootScope.CIAnotationIdentifyModeOff = true; - if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { - var selectedTileData = []; - selectedTileData = new jinqJs() - .from($scope.selectedCIListViewData) - .where('_id = ' + $event.currentTarget.id) - .select(); - - $rootScope.ViewTitle = selectedTileData[0]._Title; - } - else { - $rootScope.ViewTitle = $event.currentTarget.textContent; - - } - + { localStorage.setItem("currentViewTitle", $rootScope.ViewTitle); localStorage.setItem("currentImageId", $event.currentTarget.id); @@ -717,12 +731,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.wincount = 1; var winlen = $scope.CIModuleData.length; var timeint = null; - var slideId = ""; timeint = $interval(function () { if ($scope.readyToLoad == true) { var windata = $scope.CIModuleData[$scope.wincount - 1]; - slideId = windata.slideId; $scope.openBodyView(windata); } @@ -735,7 +747,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($scope.wincount == winlen && $rootScope.CIWindowLoadComplete == true) { $scope.stopInterval(); - $scope.$emit("LoadModuleComplete", "CLINICAL_ILLUSTRATIONS", slideId); + $scope.$emit("LoadModuleComplete", "CLINICAL_ILLUSTRATIONS"); } @@ -859,8 +871,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.jsPanelTop = 70; } - - $.jsPanel({ id: $scope.jsPanelID, selector: '.ciView', @@ -873,7 +883,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout '

' + selectedImageCISummary + '

' + '
' + '', - title: $rootScope.getLocalStorageValue("currentViewTitle"), + title: tittle, position: { top: $scope.jsPanelTop, left: $scope.jsPanelLeft @@ -921,9 +931,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); - if ($rootScope.isCallFromOtherModule) { - $scope.JsPanelclick(windowviewid); - } + //if ($rootScope.isCallFromOtherModule) { + // $scope.JsPanelclick(windowviewid); + //} + $scope.JsPanelclick(windowviewid); $rootScope.CIWindowLoadComplete = true; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index eb121bf..f778043 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -38,16 +38,16 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ tinymce.execCommand('mceRemoveEditor', true, 'CBTextArea'); tinymce.execCommand('mceAddEditor', true, 'CBTextArea'); - } - - if ($('#' + id).html() != undefined) { + if ($('#' + id).html() != undefined) { - $('#' + id).remove(); + $('#' + id).remove(); - // remove panel name from dropdown - $('#viwerSelect option[value="' + id + '"]').remove(); - + } } + + // remove panel name from dropdown + $('#viwerSelect option[value="' + id + '"]').remove(); + //Added code by sandeep for fixed Bug-58066 var ddlViewerLen = $("#viwerSelect option").length; if (ddlViewerLen == 0) { @@ -487,18 +487,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.TinyMCEPanelclick(); },1000); - if ($rootScope.isOpenResourceBtnClicked == true) { - switch ($rootScope.MenuModuleName) { - case 'DA': - $e = $('#resourceModuleDiv').append("
"); - $compile($e)($scope); - break; - } - //$compile($e)($scope); - - } - - } @@ -605,8 +593,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $("#viwerSelect").empty(); $("#viwerSelect").hide(); - if ($('#parentcustomDiv').html() != "") { - $('#parentcustomDiv').empty(); + if ($('#cbparentcustomDiv').html() != "") { + $('#cbparentcustomDiv').empty(); } if ($scope.SelectedNotes != "" && $scope.SelectedNotes != undefined) { @@ -1245,7 +1233,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // } if (windowData.mType == "DISSECTIBLE_ANATOMY") { - ModuleService.setModuleData(windowData, DawindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, DawindowId); DawindowId = DawindowId + 1; var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) @@ -1256,7 +1244,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } else if (windowData.mType == "ATLAS_ANATOMY") { - ModuleService.setModuleData(windowData, AtlasWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, AtlasWindowId); AtlasWindowId = AtlasWindowId + 1; var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) if (isFound == -1) { @@ -1264,7 +1252,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } else if (windowData.mType == "CLINICAL_ILLUSTRATIONS") { - ModuleService.setModuleData(windowData, CIWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, CIWindowId); CIWindowId = CIWindowId + 1; var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) if (isFound == -1) { @@ -1272,7 +1260,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } else if (windowData.mType == "CLINICAL_ANIMATIONS") { - ModuleService.setModuleData(windowData, CAWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, CAWindowId); CAWindowId = CAWindowId + 1; var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) if (isFound == -1) { @@ -1280,7 +1268,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } else if (windowData.mType == "THREE_D_ANATOMY") { - ModuleService.setModuleData(windowData, ThreeDWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, ThreeDWindowId); ThreeDWindowId = ThreeDWindowId + 1; var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) if (isFound == -1) { @@ -1307,21 +1295,21 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.LoadModuleName.push(windowData.mType); } - ModuleService.setModuleData(windowData, DawindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, DawindowId); } else if (windowData.mType == "ATLAS_ANATOMY") { var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) if (isFound == -1) { $scope.LoadModuleName.push(windowData.mType); } - ModuleService.setModuleData(windowData, AtlasWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, AtlasWindowId); } else if (windowData.mType == "CLINICAL_ILLUSTRATIONS") { var isFound = jQuery.inArray(windowData.mType, $scope.LoadModuleName) if (isFound == -1) { $scope.LoadModuleName.push(windowData.mType); } - ModuleService.setModuleData(windowData, CIWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, CIWindowId); } else if (windowData.mType == "CLINICAL_ANIMATIONS") { @@ -1329,7 +1317,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (isFound == -1) { $scope.LoadModuleName.push(windowData.mType); } - ModuleService.setModuleData(windowData, CAWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, CAWindowId); } else if (windowData.mType == "THREE_D_ANATOMY") { @@ -1337,22 +1325,21 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (isFound == -1) { $scope.LoadModuleName.push(windowData.mType); } - ModuleService.setModuleData(windowData, ThreeDWindowId, $scope.Slidenumber); + ModuleService.setModuleData(windowData, ThreeDWindowId); } } // intially call module at index 0 - $scope.$emit("LoadModuleComplete", "", $scope.Slidenumber); + $scope.$emit("LoadModuleComplete", ""); } - $scope.$on("LoadModuleComplete", function (evt, name, slideno) { + $scope.$on("LoadModuleComplete", function (evt, name) { if ($scope.LoadModuleName != undefined) { - if (slideno == $scope.Slidenumber) { var index = $scope.LoadModuleName.indexOf(name); if (index != -1) { // remove module which one is loaded @@ -1391,8 +1378,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } - } - } }); @@ -1425,11 +1410,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (ThreeDData != undefined && ThreeDData.length > 0) { $rootScope.isCallFromOtherModule = true; - var threeDSectionExist = document.getElementById('theeDCustomModuleDiv' + $scope.Slidenumber); + var threeDSectionExist = document.getElementById('theeDCustomModuleDiv'); if (threeDSectionExist == null) { - $('#parentcustomDiv').append($('
')); - $e = $('#theeDCustomModuleDiv' + $scope.Slidenumber).append(""); + $('#cbparentcustomDiv').append($('
')); + $e = $('#theeDCustomModuleDiv').append(""); $compile($e)($scope); } else { @@ -1445,11 +1430,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (CAData != undefined && CAData.length > 0) { $rootScope.isCallFromOtherModule = true; - var caSectionExist = document.getElementById('caCustomModuleDiv' + $scope.Slidenumber); + var caSectionExist = document.getElementById('caCustomModuleDiv'); if (caSectionExist == null) { - $('#parentcustomDiv').append($('
')); - $e = $('#caCustomModuleDiv' + $scope.Slidenumber).append(""); + $('#cbparentcustomDiv').append($('
')); + $e = $('#caCustomModuleDiv').append(""); $compile($e)($scope); } else { @@ -1467,11 +1452,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (CIData != undefined && CIData.length > 0) { $rootScope.isCallFromOtherModule = true; - var ciSectionExist = document.getElementById('ciCustomModuleDiv' + $scope.Slidenumber); + var ciSectionExist = document.getElementById('ciCustomModuleDiv'); if (ciSectionExist == null) { - $('#parentcustomDiv').append($('
')); - $e = $('#ciCustomModuleDiv' + $scope.Slidenumber).append(""); + $('#cbparentcustomDiv').append($('
')); + $e = $('#ciCustomModuleDiv').append(""); $compile($e)($scope); } else { @@ -1489,11 +1474,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (AAData != undefined && AAData.length > 0) { $rootScope.isCallFromOtherModule = true; - var aaSectionExist = document.getElementById('aaCustomModuleDiv' + $scope.Slidenumber); + var aaSectionExist = document.getElementById('aaCustomModuleDiv'); if (aaSectionExist == null) { - $('#parentcustomDiv').append($('
')); - $e = $('#aaCustomModuleDiv' + $scope.Slidenumber).append(""); + $('#cbparentcustomDiv').append($('
')); + $e = $('#aaCustomModuleDiv').append(""); $compile($e)($scope); } else { @@ -1510,11 +1495,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (DAData != undefined && DAData.length > 0) { $rootScope.isCallFromOtherModule = true; - var daSectionExist = document.getElementById('daCustomModuleDiv' + $scope.Slidenumber); + var daSectionExist = document.getElementById('daCustomModuleDiv'); if (daSectionExist==null){ - $('#parentcustomDiv').append($('
')); - $e = $('#daCustomModuleDiv' + $scope.Slidenumber).append(""); + $('#cbparentcustomDiv').append($('
')); + $e = $('#daCustomModuleDiv').append(""); $compile($e)($scope); } else @@ -1539,13 +1524,13 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //open resoruce on slide $scope.loadResourceOnCurrentSlide = function (newWindowData) { - var newwindowid = 0; + var newwindowNo = 0; var ExistData = ModuleService.getModuleData(newWindowData.mType); if (ExistData != undefined && ExistData.length > 0) { - newwindowid = newwindowid + ExistData.length; + newwindowNo = newwindowNo + ExistData.length; // clear all module data before open new module in cb ModuleService.ClearWinDataByModule(newWindowData.mType); @@ -1554,23 +1539,22 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (isFound == -1) { $scope.LoadModuleName.push(newWindowData.mType); } - - ModuleService.setModuleData(newWindowData, newwindowid, $scope.Slidenumber); + ModuleService.setModuleData(newWindowData, newwindowNo); // intially call module at index 0 - $scope.$emit("LoadModuleComplete", "", $scope.Slidenumber); + $scope.$emit("LoadModuleComplete", ""); } }] ); -function AIAModuleOpenResourceInfo(windowData) { - sessionStorage.removeItem('isModuleOpenByOpenResource'); - +function AIAModuleOpenResoureInCB(windowData) { + var scope = angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope(); scope.$apply(function () { scope.loadResourceOnCurrentSlide(windowData); }); + } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 34c8250..4b96182 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -50,9 +50,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.initializeDAWindowData = function(windowviewid,isOpenWithExistsModule,cbwindowid){ + $scope.initializeDAWindowData = function(windowviewid,isOpenWithExistsModule,openPanelNo){ - if(isOpenWithExistsModule ||cbwindowid==0) + if (isOpenWithExistsModule || openPanelNo == 0) { if ($rootScope.DaWindowData != undefined) { @@ -525,10 +525,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } ; - window.parent.AIAModuleOpenResourceInfo(DaopenData); - - window.parent.closeIFrame(); - + //window.parent.closeIFrame(); + window.parent.AIAModuleOpenResourceInfo(DaopenData); + } else { @@ -563,7 +562,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $location.path('/'); } $scope.ScopeVariablesDeclare(); - + + // store exist module in module service + var ExistData = ModuleService.getModuleData("DISSECTIBLE_ANATOMY"); + + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); + } + var newWindowData = { + "mType": 'DISSECTIBLE_ANATOMY', + }; + ModuleService.setModuleData(newWindowData, 0); + + $scope.initializeDAWindowData(windowviewid, true, undefined); //get current path @@ -625,13 +637,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.wincount=1; var winlen=$scope.DAModuleData.length; var timeint = null; - var slideId = ""; timeint = $interval(function() { if($scope.readyToLoad==true) { var windata = $scope.DAModuleData[$scope.wincount - 1]; - slideId = windata.slideId; //use to skip last execution slide $scope.openBodyView(windata); } @@ -648,7 +658,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.stopInterval(); // scope variable to use for other module // $rootScope.CBWindowLoadComplete==true - $scope.$emit("LoadModuleComplete", "DISSECTIBLE_ANATOMY", slideId); + $scope.$emit("LoadModuleComplete", "DISSECTIBLE_ANATOMY"); } @@ -814,7 +824,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { - $rootScope.jsPanelWidth = $(window).outerWidth() - 10; + $rootScope.jsPanelWidth = $(window).outerWidth() - 20; $rootScope.jsPanelHeight = $(window).outerHeight() - 110; $rootScope.jsPanelLeft = 1; $rootScope.jsPanelTop = 70; @@ -905,9 +915,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.setControlIDs(); - if ($rootScope.isCallFromOtherModule) { - $scope.JsPanelclick(windowviewid); - } + //if ($rootScope.isCallFromOtherModule) { + // $scope.JsPanelclick(windowviewid); + //} + + $scope.JsPanelclick(windowviewid); + $scope.NavigatorDraggable(windowviewid) $scope.loadbtnNavigator(windowviewid); @@ -1337,6 +1350,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (index != -1) { // remove module which one is loaded $scope.DaWindowData.splice(index, 1); + + if ($('#' + panelid).html() != undefined) { + + $('#' + panelid).remove(); + + } $rootScope.resetjsPanelTop(); } } @@ -10679,4 +10698,4 @@ function viewChange(event) { $("#" + event.currentTarget.id).parent().toggleClass('active'); $("#da-input_" + windowviewid).parent().parent().parent().parent().toggleClass('active'); - } \ No newline at end of file + } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index a91379a..93dc806 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -1,7 +1,7 @@ 'use strict'; -AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "ConfigurationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", "AIAConstants", -function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, AuthenticationService, ConfigurationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants, AIAConstants) { +AIA.controller("HomeController", ["$rootScope", "$scope", "Modules", "$log", "$location", "$compile", "$timeout", "DataService", "AuthenticationService", "ConfigurationService", "LoginConstants", "UserModules", "LoginMessageConstants", "AdminService", "$http", "AdminConstants", "UserTypeConstants", "AIAConstants","ModuleService", +function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, DataService, AuthenticationService, ConfigurationService, LoginConstants, UserModules, LoginMessageConstants, AdminService, $http, AdminConstants, UserTypeConstants, AIAConstants, ModuleService) { //$scope.pageToOpen = { // name: 'MainMenu' @@ -130,19 +130,56 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A // var homepath = $location.protocol() + "//" + $location.host() + ":" + $location.port() + "/"; var homepath = $rootScope.homeURL; - $("#CBDetailPageDiv").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); + $("#HomeContainerDiv").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); $(".navbar-fixed-top").css({"display": "none", "pointer-events": "none", "opacity": ".5" }); + var parentslag = ""; + var openNewlink = ""; + if ($location.url() == "/curriculum-builder") { + parentslag = "curriculum-builder"; + openNewlink = "curriculum-builder"; + } + else if ($location.url() == "/curriculum-builder-detail") { + + parentslag = "curriculum-builder-detail" + openNewlink = "curriculum-builder"; + } + else if (($location.url() == "/da-body-view")) { + parentslag = "da-body-view"; + openNewlink = "da-view-list"; + } + else if ($location.url() == "/clinical-illustrations-detail") { + parentslag = "clinical-illustrations-detail" + openNewlink = "clinical-illustrations"; + } + else if ($location.url() == "/module-item-view") { + parentslag = "module-item-view"; + openNewlink = "tile-view-list"; + } + + else if ($location.url() == "/clinical-animations-detail") { + parentslag = "clinical-animations-detail"; + openNewlink = "clinical-animations"; + } + else if ($location.url() == "/adam-images-detail") { + parentslag = "adam-images-detail"; + openNewlink = "ADAM-images"; + } + else if ($location.url() == "/3d-anatomy-details") { + parentslag = "3d-anatomy-details"; + openNewlink = "3d-anatomy-list"; + } + $.jsPanel({ - id: 'OpenResourcePanel', + id: 'dvOpenResourcePanel', selector: '#dvOpenResoucePanel', theme: 'success', currentController: 'HomeController', - parentSlug: 'curriculum-builder-detail', + parentSlug: parentslag, content: '
' + - '', - title: "Open Module in Curriculum Builder", + '', + title: "", position: { top: 1, left: 1 @@ -159,7 +196,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A } - $scope.loadOpenResource = function (iframe) { + $scope.OpenResourcePanel = function (iframe) { //var iframe = document.getElementById('OpenModuleInCB'); var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document; @@ -187,13 +224,13 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A '#topMenuBar{pointer-events: none; opacity: .3} ' + '#Link\\/encyclopedia{pointer-events: none; opacity: .3} ' + - '#curriculum-builder{pointer-events: none; opacity: .3} ' + + // '#curriculum-builder{pointer-events: none; opacity: .3} ' + '#anatomy-test{pointer-events: none; opacity: .3} ' + '#Link\\/IP-10{pointer-events: none; opacity: .3} ' + '#lab-exercises{pointer-events: none; opacity: .3} ' + '#Link\\/indepth-reports{pointer-events: none; opacity: .3} ' + '#Link\\/complementary-and-alternate-medicine{pointer-events: none; opacity: .3} ' + - '#ADAM-images{pointer-events: none; opacity: .3} ' + + // '#ADAM-images{pointer-events: none; opacity: .3} ' + '#Link\\/bodyguide{pointer-events: none; opacity: .3} ' + '#Link\\/symptom-navigator{pointer-events: none; opacity: .3} ' + '#Link\\/health-navigator{pointer-events: none; opacity: .3} ' + @@ -203,7 +240,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A ''; - var storefunc = ''; + var storefunc = ''; $(header).append(css); $(header).append(storefunc); @@ -218,6 +255,148 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A } + $scope.AIAModuleOpenResourceInfo = function (newWindowData) + { + $timeout(function () { + $rootScope.isCallFromOtherModule = true; + + if ($location.url() != "/curriculum-builder-detail") { + var newwindowNo = 0; + + var ExistData = ModuleService.getModuleData(newWindowData.mType); + + if (ExistData != undefined && ExistData.length > 0) { + + newwindowNo = newwindowNo + ExistData.length; + + // clear module type data before open new module + ModuleService.ClearWinDataByModule(newWindowData.mType); + } + + ModuleService.setModuleData(newWindowData, newwindowNo); + } + + if ($location.url() == "/curriculum-builder") { + + // open exist cb here + } + else if ($location.url() == "/curriculum-builder-detail") { + + window.parent.AIAModuleOpenResoureInCB(newWindowData); + } + else if (($location.url() == "/da-body-view")) { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#daBodyview'); + } + else if ($location.url() == "/clinical-illustrations-detail") { + $scope.loadOpenResourceWindow(newWindowData.mType, '#CIView'); + } + else if ($location.url() == "/module-item-view") { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#aaBodyView'); + } + else if ($location.url() == "/clinical-animations-detail") { + $scope.loadOpenResourceWindow(newWindowData.mType, '#CAView'); + } + else if ($location.url() == "/adam-images-detail") { + $scope.loadOpenResourceWindow(newWindowData.mType, '#AIView'); + } + else if ($location.url() == "/3d-anatomy-details") { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#ThreeDView'); + } + + }, 500); + + + } + + $scope.loadOpenResourceWindow = function (moduleName,BasemoduleDivId) + { + switch (moduleName) { + case "DISSECTIBLE_ANATOMY": + var daSectionExist = document.getElementById('daCustomModuleDiv'); + + if (daSectionExist == null && BasemoduleDivId != "#daBodyview") { + $(BasemoduleDivId).append($('
')); + var html = $('#daCustomModuleDiv').append(""); + $compile(html)($scope); + } + else { + // open another DA module + $rootScope.openDABodyViewMain(); + } + break; + case "ATLAS_ANATOMY": + var aaSectionExist = document.getElementById('aaCustomModuleDiv'); + + if (aaSectionExist == null && BasemoduleDivId != "#aaBodyView") { + $(BasemoduleDivId).append($('
')); + var html = $('#aaCustomModuleDiv').append(""); + $compile(html)($scope); + } + else { + // open another AA module + $rootScope.openAAModuleItemMain(); + } + break; + case "CLINICAL_ILLUSTRATIONS": + var ciSectionExist = document.getElementById('ciCustomModuleDiv'); + + if (ciSectionExist == null && BasemoduleDivId != "#CIView") { + $(BasemoduleDivId).append($('
')); + var html = $('#ciCustomModuleDiv').append(""); + $compile(html)($scope); + } + else { + // open another CI module + $rootScope.openCIBodyViewMain(); + } + break; + case "ADAM_IMAGES": + var aiSectionExist = document.getElementById('aiCustomModuleDiv'); + + if (aiSectionExist == null && BasemoduleDivId != "#AIView") { + $(BasemoduleDivId).append($('
')); + var html = $('#aiCustomModuleDiv').append(""); + $compile(html)($scope); + } + else { + // open another AI module + $rootScope.OpenAdamImageViewMain(); + } + break; + case "CLINICAL_ANIMATIONS": + var caSectionExist = document.getElementById('caCustomModuleDiv'); + + if (caSectionExist == null && BasemoduleDivId != "#CAView") { + $(BasemoduleDivId).append($('
')); + var html = $('#caCustomModuleDiv').append(""); + $compile(html)($scope); + } + else { + // open another CA module + $rootScope.openCABodyViewMain(); + } + break; + case "THREE_D_ANATOMY": + var threeDSectionExist = document.getElementById('theeDCustomModuleDiv'); + + if (threeDSectionExist == null && BasemoduleDivId != "#ThreeDView") { + $(BasemoduleDivId).append($('
')); + var html = $('#theeDCustomModuleDiv').append(""); + $compile(html)($scope); + } + else { + // open another 3d module + $rootScope.Open3DModelBodyMain(); + } + + break; + } + } + + $rootScope.forgotPwdModalShow = function () { document.getElementById("forgetPwdForm").reset() $("#forgotPwdModal").modal("show"); @@ -1419,7 +1598,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $rootScope.disableMenuoption = " "; $rootScope.disableSubMenu = "disableSubMenu"; $rootScope.disableFileMenu = " "; - $rootScope.openResources = "openResources"; + $rootScope.openResources = ""; $rootScope.OpenPitures = "OpenPitures"; $rootScope.newCurriculum = "newCurriculum"; $rootScope.openCurriculum = "openCurriculum"; @@ -1438,7 +1617,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $("#optionsListManagerTab").addClass("disableSubMenu"); $("#optiontSetting").addClass("disableSubMenu"); $rootScope.disableFileMenu = " "; - $rootScope.openResources = "openResources"; + $rootScope.openResources = ""; $rootScope.OpenPitures = "OpenPitures"; $rootScope.newCurriculum = "newCurriculum"; $rootScope.openCurriculum = "openCurriculum"; @@ -1455,7 +1634,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $rootScope.disableSubMenu = "disableSubMenu"; $("#annotationToolBarOptions").removeClass("disableSubMenu"); $rootScope.disableFileMenu = " "; - $rootScope.openResources = "openResources"; + $rootScope.openResources = ""; $rootScope.OpenPitures = "OpenPitures"; $rootScope.newCurriculum = "newCurriculum"; $rootScope.openCurriculum = "openCurriculum"; @@ -1472,11 +1651,19 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $rootScope.disableSubMenu = "disableSubMenu"; $("#annotationToolBarOptions").addClass("disableSubMenu"); $("#optionsListManagerTab").addClass("disableSubMenu"); - $rootScope.disableFileMenu = "disableFileMenu"; + $rootScope.disableFileMenu = " "; + $rootScope.openResources = ""; + $rootScope.OpenPitures = "OpenPitures"; + $rootScope.newCurriculum = "newCurriculum"; + $rootScope.openCurriculum = "openCurriculum"; + $rootScope.saveCurriculam = "saveCurriculam"; + $rootScope.PrintPreview = "PrintPreview"; + $rootScope.PrintViewer = "PrintViewer"; + $rootScope.exportImage = "exportImage"; } else if ($location.url() == "/curriculum-builder") { - $rootScope.openResources = "openResources"; + $rootScope.openResources = ""; $rootScope.disableMenuannotation = "disableMenuannotation"; $rootScope.disableMenuoption = "disableMenuoption"; @@ -1506,14 +1693,14 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $scope.EnableDisableExportImage(); } else if ($location.url() == "/adam-images-detail") { - //Modified code by sandeep for fixed bug-57956 $rootScope.disableMenuannotation = " "; $rootScope.disableMenuoption = " "; - $("#optiontSetting").addClass("disableSubMenu"); $rootScope.disableSubMenu = "disableSubMenu"; $("#annotationToolBarOptions").removeClass("disableSubMenu"); + $("#optionsListManagerTab").addClass("disableSubMenu"); + $("#optiontSetting").addClass("disableSubMenu"); $rootScope.disableFileMenu = " "; - $rootScope.openResources = "openResources"; + $rootScope.openResources = ""; $rootScope.OpenPitures = "OpenPitures"; $rootScope.newCurriculum = "newCurriculum"; $rootScope.openCurriculum = "openCurriculum"; @@ -1523,6 +1710,22 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A //enableDisable export option $scope.EnableDisableExportImage(); } + else if ($location.url() == "/3d-anatomy-details") { + $rootScope.disableMenuannotation = "disableMenuannotation"; + $rootScope.disableMenuoption = "disableMenuoption"; + $rootScope.disableSubMenu = "disableSubMenu"; + $("#annotationToolBarOptions").addClass("disableSubMenu"); + $("#optionsListManagerTab").addClass("disableSubMenu"); + $rootScope.disableFileMenu = " "; + $rootScope.openResources = ""; + $rootScope.OpenPitures = "OpenPitures"; + $rootScope.newCurriculum = "newCurriculum"; + $rootScope.openCurriculum = "openCurriculum"; + $rootScope.saveCurriculam = "saveCurriculam"; + $rootScope.PrintPreview = "PrintPreview"; + $rootScope.PrintViewer = "PrintViewer"; + $rootScope.exportImage = "exportImage"; + } else { $("#annotationToolBarOptions").removeClass("disableSubMenu"); $("#optionsListManagerTab").removeClass("disableSubMenu"); @@ -1595,7 +1798,12 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $rootScope.resetjsPanelTop = function () { $timeout(function () { - var firsttopPosition = 680; + var firsttopPosition = 70; + if ($location.url() == "/curriculum-builder-detail") { + + firsttopPosition = 680; + } + var moduleImagePanel = $("div[id*='ImagePanel']"); if (moduleImagePanel.length > 0) { @@ -2667,7 +2875,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $scope.canvasElement = null; $scope.canvasPaintElement = null; $scope.canvasDivElement = null; - if ($location.url() == "/da-body-view" || $location.url() == "/module-item-view" || $location.url() == "/clinical-illustrations-detail") { + if ($location.url() == "/da-body-view" || $location.url() == "/module-item-view" || $location.url() == "/clinical-illustrations-detail" || $location.url() == "/adam-images-detail") { if ($location.url() == "/da-body-view") { var MultiWinId = $rootScope.GetDaWindowId(); $scope.canvasElement = document.getElementById('canvasDA_' + MultiWinId); @@ -2686,6 +2894,12 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $scope.canvasPaintElement = document.getElementById('canvasPaintCI_' + MultiWinId); $scope.canvasDivElement = document.getElementById('canvasDivCI_' + MultiWinId); } + else if ($location.url() == "/adam-images-detail") { + var MultiWinId = $rootScope.GetAIWindowId(); + $scope.canvasElement = document.getElementById('canvasAI_' + MultiWinId); + $scope.canvasPaintElement = document.getElementById('canvasPaintAI_' + MultiWinId); + $scope.canvasDivElement = document.getElementById('canvasDivAI_' + MultiWinId); + } } else { @@ -2725,9 +2939,9 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A } else if (modulePanelName.match("aiImagePanel")) { - $scope.canvasDivElement = document.getElementById('canvasDiv'); - // to be continue..... - + var len = (modulePanelName).split("_").length; + var MultiWinId = (modulePanelName).split("_")[len - 1]; + $scope.canvasDivElement = document.getElementById('canvasDivAI_' + MultiWinId); } } @@ -2756,7 +2970,9 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $scope.canvasDivElement = document.getElementById('canvasDivCI_' + MultiWinId); } else if ($rootScope.panelNameWithCb.match("aiImagePanel")) { - // to be continue..... + var len = ($rootScope.panelNameWithCb).split("_").length; + var MultiWinId = ($rootScope.panelNameWithCb).split("_")[len - 1]; + $scope.canvasDivElement = document.getElementById('canvasDivAI_' + MultiWinId); } } @@ -6075,6 +6291,11 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A if ($('#printDivContent').html() != "") { $('#printDivContent').empty(); } + + var multiprint = function (canvasId, page, title, delaytime) { + $timeout(function () { CollectPrintData(canvasId, page, title) }, delaytime); + }; + var pageno = 0; // select all open module div. // var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='3DImagePanel']"); @@ -6083,9 +6304,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A for (var i = 0 ; i < modulePanel.length; i++) { var paneld = modulePanel[i].id; - - pageno = pageno + 1; - + var panelTitle = document.getElementById(paneld).childNodes[0].innerText; $scope.GetDocumentPrintElementCB(paneld); @@ -6094,20 +6313,13 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A if (canvasDivElement == null) return; var canvasDivId = canvasDivElement.id; - if (pageno == 1) { - CollectPrintData(canvasDivId, pageno, panelTitle); - } - else { - $timeout(function () { - // update timeout for mutiple image print - CollectPrintData(canvasDivId, pageno, panelTitle); - }, pageno * 200); - - } + + var timeintrval = pageno * 400; + + multiprint(canvasDivId, pageno, panelTitle,timeintrval); - if(pageno==modulePanel.length) + if(pageno==modulePanel.length-1) { - if (pageno == 1) pageno = 0; $timeout(function () { var $ua = navigator.userAgent; @@ -6118,13 +6330,13 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A SetFrameToPrint(); } - }, pageno * 200+500); + }, pageno * 400+500); } - + pageno = pageno + 1; } - + } @@ -6417,14 +6629,18 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $("#" + aaImagePanel).css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); } + else if ($location.url() == "/adam-images-detail") { + var MultiWinId = $rootScope.GetAIWindowId(); + ImagePanelElement = document.getElementById('aiImagePanel_' + MultiWinId); + var aaImagePanel = ImagePanelElement.id; + + $("#" + aaImagePanel).css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); + } else if ($location.url() == "/curriculum-builder-detail") { $("#CBDetailPageDiv").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); } - $("#aiImagePanel").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); - - $.jsPanel({ id: 'jsPanel-1', selector: '#dvPrintPreview', @@ -6603,12 +6819,17 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A $("#" + aaImagePanel).css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); } + else if ($location.url() == "/adam-images-detail") { + var MultiWinId = $rootScope.GetAIWindowId(); + ImagePanelElement = document.getElementById('aiImagePanel_' + MultiWinId); + var aaImagePanel = ImagePanelElement.id; + + $("#" + aaImagePanel).css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); + } else if ($location.url() == "/curriculum-builder-detail") { $("#CBDetailPageDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); } - $("#aiImagePanel").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); - if ($location.url() != "/curriculum-builder-detail") { $("#annotationButton").parent().removeClass("disableMenuannotation"); } @@ -6624,11 +6845,13 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A }); - $(document).on('click', '#OpenResourcePanel .jsglyph-remove', function () { + $(document).on('click', '#dvOpenResourcePanel .jsglyph-remove', function () { - $("#CBDetailPageDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); + $("#HomeContainerDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); $(".navbar-fixed-top").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); $("#topMenuBar").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); + + $('#dvOpenResourcePanel').remove(); sessionStorage.removeItem('isModuleOpenByOpenResource'); }); @@ -6872,23 +7095,33 @@ function printImagePreview(event) { } -function loadOpenResource(iframe) { +function OpenResourcePanel(iframe) { console.log('resource loading') var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); scope.$apply(function () { - scope.loadOpenResource(iframe); + scope.OpenResourcePanel(iframe); }); } function closeIFrame() { - $('#OpenResourcePanel').remove(); - $("#CBDetailPageDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); + $('#dvOpenResourcePanel').remove(); + $("#HomeContainerDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); $(".navbar-fixed-top").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); $("#topMenuBar").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); } +function AIAModuleOpenResourceInfo(windowData) { + sessionStorage.removeItem('isModuleOpenByOpenResource'); + window.parent.closeIFrame(); + var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); + scope.$apply(function () { + scope.AIAModuleOpenResourceInfo(windowData); + }); + +} + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 0aa0761..fafce4e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -49,8 +49,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } }; - $scope.initializeAAWindowData = function(windowviewid,isOpenWithExistsModule,cbwindowid){ - if(isOpenWithExistsModule ||cbwindowid==0) + $scope.initializeAAWindowData = function(windowviewid,isOpenWithExistsModule,openPanelNo){ + if (isOpenWithExistsModule || openPanelNo == 0) { if ($rootScope.AAWindowData != undefined) { $rootScope.AAWindowData.length = 0; @@ -205,16 +205,26 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#CBDetailPageDiv').css('opacity', '1'); } - $scope.loadForModuleById = function (moduleId) { - // clear data set by curriculum builder - $rootScope.isCallFromOtherModule = undefined; + $scope.loadForModuleById = function (moduleId) { + $scope.DisableUI(); + $rootScope.isCallFromOtherModule = undefined; $rootScope.MULTI_VIEW_ID += 1 - // $scope.ScopeVariablesDeclare(); + + // store exist module in module service + var ExistData = ModuleService.getModuleData("ATLAS_ANATOMY"); + + if (ExistData != undefined && ExistData.length > 0) { + // clear all module data before open new module in cb + ModuleService.ClearWinDataByModule(ExistData.mType); + } + var newWindowData = { + "mType": 'ATLAS_ANATOMY', + }; + ModuleService.setModuleData(newWindowData, 0); $scope.initializeAAWindowData($rootScope.MULTI_VIEW_ID,true,undefined); - $scope.DisableUI(); $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); $rootScope.openModules.push({ "ModuleId": 2 }); @@ -281,22 +291,49 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.EnableUI(); $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); - }, 200); + }, 600); $('#list-view').css('display', 'none'); } - $scope.openModuleItemView = function ($event) { + $scope.openModuleItemView = function ($event) { + + var windowviewid = $rootScope.MULTI_VIEW_ID; + $rootScope.MenuModuleName = "AA"; + localStorage.setItem("activeTab", $scope.activeTab); + + //0. Get selected Image Id + if ($scope.isListViewButtonClicked == true) { + if ($scope.isOpenBtnClicked == true) { + + var moduleItemDataToBeSaved = $("#demoText").text().trim(); + var moduleItemDataToBeSavedID = $event.target.id; + $scope.isOpenBtnClicked = false; + } + else { + var moduleItemDataToBeSavedID = $event.currentTarget.id; + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); + var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text().trim(); + } + } + else { + var moduleItemDataToBeSavedID = $event.currentTarget.id; + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); + var moduleItemDataToBeSaved = $event.target.id; + + $scope.isListViewButtonClicked = false; + } + // open module bu openresource var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource'); if (isopenResourceRequest == "true") { //set default module data var AAopenData = { - "id": $event.currentTarget.id, + "id": moduleItemDataToBeSavedID, "mType": 'ATLAS_ANATOMY', "showAllPins":true, - "windowTitle": $event.currentTarget.textContent, + "windowTitle": moduleItemDataToBeSaved, "size": { height: 600, width: 900 } }; @@ -307,29 +344,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } else { - var windowviewid = $rootScope.MULTI_VIEW_ID; - $rootScope.MenuModuleName = "AA"; - localStorage.setItem("activeTab", $scope.activeTab); - - //0. Get selected Image Id - if ($scope.isListViewButtonClicked == true) { - if ($scope.isOpenBtnClicked == true) { - - var moduleItemDataToBeSaved = $("#demoText").text().trim(); - $scope.isOpenBtnClicked = false; - } - else { - var moduleItemDataToBeSavedID = $event.currentTarget.id; - localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); - var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text().trim(); - } - } - else { - var moduleItemDataToBeSaved = $event.target.id; - localStorage.setItem("listViewSelectedID", $event.currentTarget.id); - $scope.isListViewButtonClicked = false; - } - //1.Filter selected module ietem data and get the pushed opened moduile array object var OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); @@ -381,7 +395,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var OpenItemImagePath = "../../../content/images/aa/images/" +OpenedTileData[3]; $scope.SetAAwindowStoreData(windowviewid,'OpenItemImagePath',OpenItemImagePath); $rootScope.listArray.push({ "imageName": OpenItemImagePath, "text": moduleItemDataToBeSaved }); - $("#viewList").append("
" + moduleItemDataToBeSaved + "
Open
"); + $("#viewList").append("
" + moduleItemDataToBeSaved + "
Open
"); } $rootScope.openAAModuleItemMain = function () { @@ -393,13 +407,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.wincount=1; var winlen=$scope.AAModuleData.length; var timeint = null; - var slideId = ""; timeint = $interval(function() { if($scope.readyToLoad==true) { var windata = $scope.AAModuleData[$scope.wincount - 1]; - slideId = windata.slideId; //use to skip last execution slide $scope.openModuleItem(windata); } @@ -414,7 +426,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if($scope.wincount==winlen && $rootScope.AAWindowLoadComplete==true) { $scope.stopInterval(); - $scope.$emit("LoadModuleComplete", "ATLAS_ANATOMY", slideId); + $scope.$emit("LoadModuleComplete", "ATLAS_ANATOMY"); } @@ -555,7 +567,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } else { - $scope.jsPanelWidth = $(window).outerWidth() - 10; + $scope.jsPanelWidth = $(window).outerWidth() - 20; $scope.jsPanelHeight = $(window).outerHeight() - 125; $scope.jsPanelLeft = 1; $scope.jsPanelTop = 70; @@ -600,10 +612,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.setControlsIDs(windowviewid); $scope.loadbtnNavigator(windowviewid); - if ($rootScope.isCallFromOtherModule) { - $scope.JsPanelclick(windowviewid); - } - + //if ($rootScope.isCallFromOtherModule) { + // $scope.JsPanelclick(windowviewid); + // } + $scope.JsPanelclick(windowviewid); //if (document.getElementById('aaDetailPageDiv') != null) { if (document.getElementById('aaBodyView') != null) { @@ -893,6 +905,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (index != -1) { // remove module which one is loaded $scope.AAWindowData.splice(index, 1); + if ($('#' + panelid).html() != undefined) { + + $('#' + panelid).remove(); + + } $rootScope.resetjsPanelTop(); } } @@ -1172,7 +1189,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.FilterByImage = function (moduleId, query,windowviewid) { - + $scope.DisableUI(); if(windowviewid==undefined) { windowviewid= $rootScope.MULTI_VIEW_ID; @@ -1335,9 +1352,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#ListViewDiv').append('No illustration found for the selected search criteria!'); } + $timeout(function () { $scope.EnableUI(); }, 500); }, function (error) { - // handle errors here + $timeout(function () { $scope.EnableUI(); }, 500); console.log(' error: ' + error.statusText); } ) @@ -1369,7 +1387,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#demoView').remove(); $scope.filterstring = false; - + $scope.FilterByImage(1, query,windowviewid); } @@ -3087,4 +3105,5 @@ function systemChange(event) { $("#" + event.currentTarget.id).parent().toggleClass('tools1'); $("#selectedTermName_"+windowviewid).parent().parent().parent().parent().parent().toggleClass('active'); -} \ No newline at end of file + } + \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/directives/AIADirectives.js b/400-SOURCECODE/AIAHTML5.Web/app/directives/AIADirectives.js index 3ae2d73..71a6be4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/directives/AIADirectives.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/directives/AIADirectives.js @@ -32,4 +32,11 @@ AIA.directive('threedAnatomyDirective', function (ModuleService) { templateUrl: 'app/views/3dA/3d-anatomy-details.html', } +}); +AIA.directive('adamImageDirective', function (ModuleService) { + return { + //restrict: 'E', + templateUrl: 'app/views/ai/adam-images-detail.html', + + } }); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index b2010d1..04ae6c8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -1,6 +1,6 @@ 'use strict'; -var AIA = angular.module('AIA', ['ngSanitize', 'ngRoute', 'ngStorage']); +var AIA = angular.module('AIA', ['ngSanitize', 'ngRoute', 'ngStorage', 'ui.bootstrap']); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index 7170d07..88c9c75 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -13,6 +13,7 @@ moduleDataObj.DAData = []; moduleDataObj.CIData = []; moduleDataObj.CAData = []; moduleDataObj.ThreeDData = []; +moduleDataObj.AIData = []; AIA.service('ModuleService', function ($http, DataService) { return { @@ -144,14 +145,15 @@ AIA.service('ModuleService', function ($http, DataService) { return moduleDataObj.CAData; else if (moduleName == "THREE_D_ANATOMY") return moduleDataObj.ThreeDData; + else if (moduleName == "ADAM_IMAGES") + return moduleDataObj.AIData; }, - setModuleData: function (windowData, windowId, SlideNo) { + setModuleData: function (windowData, windowId) { if (windowData.mType == "THREE_D_ANATOMY") { moduleDataObj.ThreeDData.push({ - slideId: SlideNo, currentWindowId: windowId, mType: windowData.mType, threeDData:windowData.threeDData, @@ -168,9 +170,26 @@ AIA.service('ModuleService', function ($http, DataService) { contentPath: windowData.contentPath }); } + else if (windowData.mType == "ADAM_IMAGES") { + moduleDataObj.AIData.push({ + currentWindowId: windowId, + mType: windowData.mType, + containsCapturedContent: windowData.containsCapturedContent, + textVisible: windowData.textVisible, + anatomyTitle: windowData.windowTitle, + scrollPosition: windowData.scrollPosition, + imageId: windowData.imageId, + maximised: windowData.maximised, + minimised: windowData.minimised, + id: windowData.id, + position: windowData.position, + size: windowData.size, + contextMenu: windowData.contextMenu, + annotationData: windowData.annotationData + }); + } else if (windowData.mType == "CLINICAL_ANIMATIONS") { moduleDataObj.CAData.push({ - slideId: SlideNo, currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, @@ -188,7 +207,6 @@ AIA.service('ModuleService', function ($http, DataService) { } else if (windowData.mType == "CLINICAL_ILLUSTRATIONS") { moduleDataObj.CIData.push({ - slideId: SlideNo, currentWindowId: windowId, mType: windowData.mType, containsCapturedContent: windowData.containsCapturedContent, @@ -207,7 +225,6 @@ AIA.service('ModuleService', function ($http, DataService) { } else if (windowData.mType == "ATLAS_ANATOMY") { moduleDataObj.AAData.push({ - slideId:SlideNo, currentWindowId: windowId, mType: windowData.mType, anatomyTitle: windowData.windowTitle, @@ -233,7 +250,6 @@ AIA.service('ModuleService', function ($http, DataService) { } else if (windowData.mType == "DISSECTIBLE_ANATOMY") { moduleDataObj.DAData.push({ - slideId: SlideNo, currentWindowId: windowId, currentBodyViewId: windowData.id, windowTitle: windowData.windowTitle, @@ -287,6 +303,7 @@ AIA.service('ModuleService', function ($http, DataService) { moduleDataObj.CIData = []; moduleDataObj.CAData = []; moduleDataObj.ThreeDData = []; + moduleDataObj.AIData = []; }, ClearWinDataByModule: function (moduleName) { @@ -310,6 +327,9 @@ AIA.service('ModuleService', function ($http, DataService) { { moduleDataObj.ThreeDData = []; } + else if (moduleName == "ADAM_IMAGES") { + moduleDataObj.AIData = []; + } }, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-detail.html index fc675e8..5b47fb3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/CBuild/curriculum-builder-detail.html @@ -131,7 +131,7 @@
-
+
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/tile-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/tile-view.html index d7d07ae..60368b4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/tile-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/tile-view.html @@ -74,7 +74,7 @@ - + {{val._Title}} @@ -93,7 +93,7 @@ - + {{item._Title}} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html index e90af20..e3b98be 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html @@ -1,6 +1,6 @@ 
-
+