diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index b6c6639..6914291 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -6,6 +6,8 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $scope.threeDAnatomyData; $scope.Id; $scope.$on('$viewContentLoaded', function (event) { + $('#grid-view').empty(); + $("
Loading
").appendTo('#grid-view'); $scope.scroll(); var promise = DataService.getJson('~/../content/data/json/3da/3da_dat_contentlist.json') promise.then( @@ -20,7 +22,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location .select(); // console.log($scope.selectedCIListViewData); - $('#grid-view').empty(); + angular.forEach($scope.selectedThreeDAdata, function (value, key) { $scope.imagePath = "~/../content/images/3da/thumbnails/" + value._ThumbnailImage; @@ -31,14 +33,14 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $compile($el)($scope); - + $(".sidebar").mCustomScrollbar({ autoHideScrollbar: true, //theme:"rounded" }); }); - + $('#3dASpinner').remove(); }, function (error) { // handle errors here diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js index 534d59f..004c20b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/ADAMImgController.js @@ -12,6 +12,7 @@ function ($scope, $rootScope, pages, log, $location) { //alert("scroll"); } $scope.$on('$viewContentLoaded', function (event) { + $("#ADAMIMGSpinner").fadeOut('slow'); // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js index 720cff7..5ecf9c9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js @@ -19,6 +19,7 @@ function ($scope, $rootScope, pages, log, $location) { //$rootScope.currentActiveModuleTitle = pages[10].name; $scope.$on('$viewContentLoaded', function (event) { + $('#AODSpinner').fadeOut('slow'); // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js index f1fde94..852336e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AnatTestController.js @@ -13,6 +13,7 @@ function ($scope, $rootScope, pages, log, $location) { } $scope.$on('$viewContentLoaded', function (event) { + $("#AnatTestSpinner").fadeOut('slow'); // code that will be executed ... // every time this view is loaded diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 15e560b..1bbe961 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -1,582 +1,583 @@ -AIA.controller("CAController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "BodyRegions", "BodySystems", "MedicalSpecialties", "DataService", -function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, BodyRegions, BodySystems, MedicalSpecialties, DataService) { - // $rootScope.currentActiveModuleTitle = pages[4].name; - $scope.showTabButton = true; - $scope.AnimationData; - $scope.CAAllBodyRegion = []; - $scope.CAAllBodySystem = []; - $scope.CAAllSpeciality = []; - $scope.selectedCAListViewData = []; - $scope.searchCAListViewData = []; - $scope.SelectedCAthumbImage = []; - $scope.SelectedCAImage = []; - $scope.SelectedCASummary = []; - $scope.filterstring = false; - $scope.hostedServer = "http://aia5.adam.com/graphics/Multimedia/en/"; - $scope.hostedFolderId; - $scope.idSelected; - $scope.query = { - selectedbodyregion: '', - selectedbodysystem: '', - selectedspecialty: '', - }; - - $scope.setActiveTab = function (tabToSet) { - $scope.activeTab = tabToSet; - localStorage.setItem("currentCATabView", $scope.activeTab); - }; - - $scope.$on('$viewContentLoaded', function (event) { - // code that will be executed ... - // every time this view is loaded - - //get current path - var currentURL = $location.path(); - var selectedModuleName = ''; - //set module title - angular.forEach($rootScope.userModules, function (value, key) { - if (value.slug === currentURL.replace('/', '')) { - selectedModuleName = value.name; - } - $rootScope.currentActiveModuleTitle = selectedModuleName; - }) - - - $scope.LoadCAJsonData(); - - $scope.CAAllBodyRegion = BodyRegions; - $scope.CAAllBodySystem = BodySystems; - $scope.CAAllSpeciality = MedicalSpecialties; - $scope.scroll(); - - //set the local storage - - var curtab = localStorage.getItem("currentCATabView"); - //if (curtab == 2) { - // $scope.setActiveTab(2); - //} - if (curtab == 2) { - $scope.setActiveTab(2); - var curSelectedRowId = localStorage.getItem("CASelectedRowId"); - if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { - $scope.reRunSearchOnLoad(); - $scope.idSelected = curSelectedRowId; - $scope.ReloadListViewImageDiv($scope.idSelected); - } - else { - $scope.reRunSearchOnLoad() - $scope.idSelected = ''; - } - } - else { - $scope.setActiveTab(1); - $scope.reRunSearchOnLoad(); - } - - - - }); - - $scope.reRunSearchOnLoad = function () { - var curBodyRegion = localStorage.getItem("CACurBodyRegion"); - if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { - $scope.query.selectedbodyregion = curBodyRegion; - } - else { - $scope.query.selectedbodyregion = ""; - } - - var curBodySystem = localStorage.getItem("CACurBodySystem"); - if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !== '') { - $scope.query.selectedbodysystem = curBodySystem; - } - else { - $scope.query.selectedbodysystem = ""; - } - - var curSpeciality = localStorage.getItem("CACurSpeciality"); - if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !== '') { - $scope.query.selectedspecialty = curSpeciality; - } - else { - $scope.query.selectedspecialty = ""; - } - - - if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedspecialty == "") { - $scope.loadAllCA(); - } - else { - $scope.ApplySearch($scope.query); - - } - } - - $scope.LoadCAJsonData = function () { - - var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') - promise.then( - function (result) { - $scope.AnimationData = result; - //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; - - $scope.selectedCAListViewData = new jinqJs() - .from($scope.AnimationData.root.CAData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); - - //console.log($scope.selectedCAListViewData); - - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - ); - - - }; - - $scope.loadAllCA = function () { - - var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') - promise.then( - function (result) { - $scope.AnimationData = result; - //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; - - $scope.selectedCAListViewData = new jinqJs() - .from($scope.AnimationData.root.CAData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); - - //console.log($scope.selectedCAListViewData); - - $('#grid-view').empty(); - - angular.forEach($scope.selectedCAListViewData, function (value, key) { - $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - - - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); - - - $compile($el)($scope); - - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); - - }); - - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - ); - - - } - - $scope.IsVisible = function () { - $scope.scroll(); - - } - - $scope.showItem = function (id) { - //console.log(id); - $scope.idSelected = id; - localStorage.setItem("CASelectedRowId", id); - - //Set the vertical scroll value of the table. - var y = $('#ListViewDiv').scrollTop(); - localStorage.setItem("CAListViewScroll", y); - - $scope.hiderow = true; - if ($scope.filterstring == false) { - - var SelectedCAthumbImage = []; - SelectedCAthumbImage = new jinqJs() - .from($scope.selectedCAListViewData) - .where('_id = ' + id) - .select('_ThumbnailImage', '_Summary', '_id', '_Title'); - - $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; - - $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; - $scope.SelectedCAId = SelectedCAthumbImage[0]._id; - $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; - - } - else { - if ($scope.searchCAListViewData.length > 0) { - - var SelectedCAthumbImage = []; - SelectedCAthumbImage = new jinqJs() - .from($scope.searchCAListViewData) - .where('_id = ' + id) - .select('_ThumbnailImage', '_Summary', '_id', '_Title'); - - $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; - - $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; - $scope.SelectedCAId = SelectedCAthumbImage[0]._id; - $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; - } - } - }; - - $scope.Reset = function (query) { - - query.selectedbodyregion = ""; - query.selectedbodysystem = ""; - query.selectedspecialty = ""; - - //set localstorage values - localStorage.setItem("CACurBodyRegion", ''); - localStorage.setItem("CACurBodySystem", ''); - localStorage.setItem("CACurSpeciality", ''); - localStorage.setItem("CAListViewScroll", ''); - localStorage.setItem("CASelectedRowId", ""); - - $scope.filterstring = false; - - if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } - - $('#ListViewDiv').scrollTop(0); - - $scope.hideListViewDiv(); - - - while ($scope.searchCAListViewData.length) { - $scope.searchCAListViewData.pop(); - } - - if (localStorage.getItem("currentCATabView") == 2) { - localStorage.setItem("CASelectedRowId", ""); - $scope.hiderow = false; - } - - $scope.loadAllCA(); - - } - - // for "Intracytoplasmic sperm injection (ICSI)" case, the Body region is not required so we have added "_BodyRegion": "None" which was actually not available in origincal flex file. - $scope.ApplySearch = function (query) { - - $scope.filterstring = true; - - while ($scope.searchCAListViewData.length) { - $scope.searchCAListViewData.pop(); - } - - //$('#grid-view').empty(); - - filtercount = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { - filtercount = filtercount + 1; - localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); - } - else { - localStorage.setItem("CACurBodyRegion", ''); - } - - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { - filtercount = filtercount + 1; - localStorage.setItem("CACurBodySystem", query.selectedbodysystem); - } - else { - localStorage.setItem("CACurBodySystem", ''); - } - - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !== "") { - filtercount = filtercount + 1; - localStorage.setItem("CACurSpeciality", query.selectedspecialty); - } - else { - localStorage.setItem("CACurSpeciality", ''); - } - - var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') - promise.then( - function (result) { - $scope.AnimationData = result; - //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; - - $scope.selectedCAListViewData = new jinqJs() - .from($scope.AnimationData.root.CAData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); - - //console.log($scope.selectedCAListViewData); - - $('#grid-view').empty(); - - angular.forEach($scope.selectedCAListViewData, function (value, key) { - - var selectimg = true; - var count = 0; - - - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { - var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); - if (posbodyregion > -1) { - selectimg = true; - count = count + 1; - - } - else { - selectimg = false; - count = count - 1; - } - - } - - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { - var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); - if (posbodysystem > -1) { - count = count + 1; - selectimg = true; - } else { - selectimg = false; - count = count - 1; - } - } - - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !== "") { - var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); - if (posspeciality > -1) { - count = count + 1; - selectimg = true; - } else { - selectimg = false; - count = count - 1; - } - - } - - if (selectimg === true && count >= filtercount) { - - - $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); - - - $compile($el)($scope); - - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); - - - $scope.searchCAListViewData.push( - { - "_id": value._id, - "_ImageId": value._ImageId, - "_Title": value._Title, - "_Video": value._Video, - "_ThumbnailImage": value._ThumbnailImage, - "_BodySystem": value._BodySystem, - "_BodyRegion": value._BodyRegion, - "_MedicalSpecialty": value._MedicalSpecialty, - "_Summary": value._Summary, - "_LowerSummary": value._LowerSummary - }); - - } - - - }); - - //Show Error Message in case of gridview if no data is found - if ($scope.searchCAListViewData.length == 0) { - - var $el = $('
No animation found for the selected search criteria!
').appendTo('#grid-view'); - $compile($el)($scope); - } - - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - ); - - } - - - - - $scope.scroll = function () { - $("html,body").scrollTop(0); - } - - - - $scope.openView = function ($event) { - $rootScope.disableAnnotationTBFn(); - $rootScope.MenuModuleName = "CA"; - //alert($rootScope.MenuModuleName); - $rootScope.currentBodyViewId = $event.currentTarget.id; - if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { - var CITitle = []; - CITitle = new jinqJs() - .from($scope.selectedCAListViewData) - .where('_id = ' + $event.currentTarget.id) - .select('_Title'); - - //console.log(CITitle); - //console.log($scope.selectedCAListViewData); - - $rootScope.ViewTitle = CITitle[0]._Title; - } - else { - $rootScope.ViewTitle = $event.currentTarget.textContent; - - } - - - localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle); - localStorage.setItem("currentBodyViewId", $event.currentTarget.id); - - var u = $location.url(); - $location.url('/clinical-animations-detail'); - - //console.log($location.url('/clinical-animations-detail')); - - } - - $scope.openBodyView = function () { - - if ($rootScope.disableAnnotationTB == true) - { - $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').attr('disabled', 'disabled'); - $('#slider-range-min-2').slider('disable'); - $("#annotationpaintbrushsize").attr('disabled', 'disabled'); - //$("#annotationpaintbrushsize").attr("href", "#"); - } - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); - $scope.voId = localStorage.getItem("currentBodyViewId"); - - // alert($scope.voId); - - - //once you get id in scope push detail in jspanel content - - var openViews; - if ($rootScope.openViews.length > 0) { - openViews = new jinqJs() - .from($rootScope.openViews) - .where("BodyViewId==" + $scope.voId) - .select(); - } - var counter = 1; - var tittle = localStorage.getItem("currentViewTitleFromJson"); - - if (openViews != null && openViews.length > 0) { - angular.forEach(openViews, function (value, key) { - - if (value.body - views == tittle) { - tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; - $rootScope.currentActiveViewTitle = tittle; - localStorage.setItem("currentViewTitle", tittle); - } - - }); - } - else { - localStorage.setItem("currentViewTitle", tittle); - - } - - //alert(localStorage.getItem("currentViewTitle")); - - var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist_mp4link.json') - promise.then( - function (result) { - $scope.AnimationData = result; - $scope.CAlistViewData = $scope.AnimationData.root.CAData; - - var clickedCAVideo = []; - clickedCAVideo = new jinqJs() - .from($scope.CAlistViewData) - .where('_id == ' + $scope.voId) - .select('_Video', '_LowerSummary', '_HostedFolderId'); - - $scope.clickedCAVideo = clickedCAVideo[0]._Video; - $scope.clickedCASummary = clickedCAVideo[0]._LowerSummary; - $scope.hostedFolderId = clickedCAVideo[0]._HostedFolderId; - $scope.poster = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".jpg"; - $scope.ad = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + "_ad.mp4"; - $scope.HDVid = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + "_HD.mp4"; - $scope.webm = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".webm"; - $scope.ogv = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".ogv"; - $scope.playerScript = "~/../libs/video_4_12_11/video_4_12_11.js"; - //$scope.vtt = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".vtt" - $scope.vtt = "~/../content/data/vtt/" + $scope.hostedFolderId + ".vtt"; - console.log($scope.vtt); - if ($scope.clickedCAVideo.length > 0 && $scope.clickedCASummary.length > 0) { - - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); - - $.jsPanel({ - id: 'caVideoPanel', - selector: '.caView', - theme: 'success', - currentController: 'CAController', - parentSlug: 'clinical-animations', - content: '

' + $scope.clickedCASummary + '

', - - //ajax: { - // url: 'app/views/ca/ca-view-detail.html' - //}, - title: localStorage.getItem("currentViewTitle"), - position: { - top: 70, - left: 1, - }, - - size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, - - }); - - - $rootScope.currentSlug = 'clinical-animations-detail'; - - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, - "slug": $rootScope.currentSlug - }); - - +AIA.controller("CAController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "BodyRegions", "BodySystems", "MedicalSpecialties", "DataService", +function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, BodyRegions, BodySystems, MedicalSpecialties, DataService) { + // $rootScope.currentActiveModuleTitle = pages[4].name; + $scope.showTabButton = true; + $scope.AnimationData; + $scope.CAAllBodyRegion = []; + $scope.CAAllBodySystem = []; + $scope.CAAllSpeciality = []; + $scope.selectedCAListViewData = []; + $scope.searchCAListViewData = []; + $scope.SelectedCAthumbImage = []; + $scope.SelectedCAImage = []; + $scope.SelectedCASummary = []; + $scope.filterstring = false; + $scope.hostedServer = "http://aia5.adam.com/graphics/Multimedia/en/"; + $scope.hostedFolderId; + $scope.idSelected; + $scope.query = { + selectedbodyregion: '', + selectedbodysystem: '', + selectedspecialty: '', + }; + + $scope.setActiveTab = function (tabToSet) { + $scope.activeTab = tabToSet; + localStorage.setItem("currentCATabView", $scope.activeTab); + }; + + $scope.$on('$viewContentLoaded', function (event) { + // code that will be executed ... + // every time this view is loaded + + //get current path + var currentURL = $location.path(); + var selectedModuleName = ''; + //set module title + angular.forEach($rootScope.userModules, function (value, key) { + if (value.slug === currentURL.replace('/', '')) { + selectedModuleName = value.name; + } + $rootScope.currentActiveModuleTitle = selectedModuleName; + }) + + + $scope.LoadCAJsonData(); + + $scope.CAAllBodyRegion = BodyRegions; + $scope.CAAllBodySystem = BodySystems; + $scope.CAAllSpeciality = MedicalSpecialties; + $scope.scroll(); + + //set the local storage + + var curtab = localStorage.getItem("currentCATabView"); + //if (curtab == 2) { + // $scope.setActiveTab(2); + //} + if (curtab == 2) { + $scope.setActiveTab(2); + var curSelectedRowId = localStorage.getItem("CASelectedRowId"); + if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { + $scope.reRunSearchOnLoad(); + $scope.idSelected = curSelectedRowId; + $scope.ReloadListViewImageDiv($scope.idSelected); + } + else { + $scope.reRunSearchOnLoad() + $scope.idSelected = ''; + } + } + else { + $scope.setActiveTab(1); + $scope.reRunSearchOnLoad(); + } + + + + }); + + $scope.reRunSearchOnLoad = function () { + var curBodyRegion = localStorage.getItem("CACurBodyRegion"); + if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { + $scope.query.selectedbodyregion = curBodyRegion; + } + else { + $scope.query.selectedbodyregion = ""; + } + + var curBodySystem = localStorage.getItem("CACurBodySystem"); + if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !== '') { + $scope.query.selectedbodysystem = curBodySystem; + } + else { + $scope.query.selectedbodysystem = ""; + } + + var curSpeciality = localStorage.getItem("CACurSpeciality"); + if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !== '') { + $scope.query.selectedspecialty = curSpeciality; + } + else { + $scope.query.selectedspecialty = ""; + } + + + if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedspecialty == "") { + $scope.loadAllCA(); + } + else { + $scope.ApplySearch($scope.query); + + } + } + + $scope.LoadCAJsonData = function () { + + var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') + promise.then( + function (result) { + $scope.AnimationData = result; + //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; + + $scope.selectedCAListViewData = new jinqJs() + .from($scope.AnimationData.root.CAData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + //console.log($scope.selectedCAListViewData); + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); + + + }; + + $scope.loadAllCA = function () { + $('#grid-view').empty(); + $("
Loading
").appendTo('#grid-view'); + var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') + promise.then( + function (result) { + $scope.AnimationData = result; + //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; + + $scope.selectedCAListViewData = new jinqJs() + .from($scope.AnimationData.root.CAData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + //console.log($scope.selectedCAListViewData); + + + + angular.forEach($scope.selectedCAListViewData, function (value, key) { + $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; + + + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); + + + $compile($el)($scope); + $('#CASpinner').remove(); + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" + }); + + }); + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); + + + } + + $scope.IsVisible = function () { + $scope.scroll(); + + } + + $scope.showItem = function (id) { + //console.log(id); + $scope.idSelected = id; + localStorage.setItem("CASelectedRowId", id); + + //Set the vertical scroll value of the table. + var y = $('#ListViewDiv').scrollTop(); + localStorage.setItem("CAListViewScroll", y); + + $scope.hiderow = true; + if ($scope.filterstring == false) { + + var SelectedCAthumbImage = []; + SelectedCAthumbImage = new jinqJs() + .from($scope.selectedCAListViewData) + .where('_id = ' + id) + .select('_ThumbnailImage', '_Summary', '_id', '_Title'); + + $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; + + $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; + $scope.SelectedCAId = SelectedCAthumbImage[0]._id; + $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; + + } + else { + if ($scope.searchCAListViewData.length > 0) { + + var SelectedCAthumbImage = []; + SelectedCAthumbImage = new jinqJs() + .from($scope.searchCAListViewData) + .where('_id = ' + id) + .select('_ThumbnailImage', '_Summary', '_id', '_Title'); + + $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; + + $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; + $scope.SelectedCAId = SelectedCAthumbImage[0]._id; + $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; + } + } + }; + + $scope.Reset = function (query) { + + query.selectedbodyregion = ""; + query.selectedbodysystem = ""; + query.selectedspecialty = ""; + + //set localstorage values + localStorage.setItem("CACurBodyRegion", ''); + localStorage.setItem("CACurBodySystem", ''); + localStorage.setItem("CACurSpeciality", ''); + localStorage.setItem("CAListViewScroll", ''); + localStorage.setItem("CASelectedRowId", ""); + + $scope.filterstring = false; + + if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + + $('#ListViewDiv').scrollTop(0); + + $scope.hideListViewDiv(); + + + while ($scope.searchCAListViewData.length) { + $scope.searchCAListViewData.pop(); + } + + if (localStorage.getItem("currentCATabView") == 2) { + localStorage.setItem("CASelectedRowId", ""); + $scope.hiderow = false; + } + + $scope.loadAllCA(); + + } + + // for "Intracytoplasmic sperm injection (ICSI)" case, the Body region is not required so we have added "_BodyRegion": "None" which was actually not available in origincal flex file. + $scope.ApplySearch = function (query) { + + $scope.filterstring = true; + + while ($scope.searchCAListViewData.length) { + $scope.searchCAListViewData.pop(); + } + + //$('#grid-view').empty(); + + filtercount = 0; + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { + filtercount = filtercount + 1; + localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); + } + else { + localStorage.setItem("CACurBodyRegion", ''); + } + + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { + filtercount = filtercount + 1; + localStorage.setItem("CACurBodySystem", query.selectedbodysystem); + } + else { + localStorage.setItem("CACurBodySystem", ''); + } + + if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !== "") { + filtercount = filtercount + 1; + localStorage.setItem("CACurSpeciality", query.selectedspecialty); + } + else { + localStorage.setItem("CACurSpeciality", ''); + } + + var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') + promise.then( + function (result) { + $scope.AnimationData = result; + //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; + + $scope.selectedCAListViewData = new jinqJs() + .from($scope.AnimationData.root.CAData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + //console.log($scope.selectedCAListViewData); + + $('#grid-view').empty(); + + angular.forEach($scope.selectedCAListViewData, function (value, key) { + + var selectimg = true; + var count = 0; + + + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { + var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); + if (posbodyregion > -1) { + selectimg = true; + count = count + 1; + + } + else { + selectimg = false; + count = count - 1; + } + + } + + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { + var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); + if (posbodysystem > -1) { + count = count + 1; + selectimg = true; + } else { + selectimg = false; + count = count - 1; + } + } + + if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !== "") { + var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); + if (posspeciality > -1) { + count = count + 1; + selectimg = true; + } else { + selectimg = false; + count = count - 1; + } + + } + + if (selectimg === true && count >= filtercount) { + + + $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; + + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); + + + $compile($el)($scope); + + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" + }); + + + $scope.searchCAListViewData.push( + { + "_id": value._id, + "_ImageId": value._ImageId, + "_Title": value._Title, + "_Video": value._Video, + "_ThumbnailImage": value._ThumbnailImage, + "_BodySystem": value._BodySystem, + "_BodyRegion": value._BodyRegion, + "_MedicalSpecialty": value._MedicalSpecialty, + "_Summary": value._Summary, + "_LowerSummary": value._LowerSummary + }); + + } + + + }); + + //Show Error Message in case of gridview if no data is found + if ($scope.searchCAListViewData.length == 0) { + + var $el = $('
No animation found for the selected search criteria!
').appendTo('#grid-view'); + $compile($el)($scope); + } + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); + + } + + + + + $scope.scroll = function () { + $("html,body").scrollTop(0); + } + + + + $scope.openView = function ($event) { + $rootScope.disableAnnotationTBFn(); + $rootScope.MenuModuleName = "CA"; + //alert($rootScope.MenuModuleName); + $rootScope.currentBodyViewId = $event.currentTarget.id; + if ($event.currentTarget.textContent !== null && typeof ($event.currentTarget.textContent) !== "undefined") { + var CITitle = []; + CITitle = new jinqJs() + .from($scope.selectedCAListViewData) + .where('_id = ' + $event.currentTarget.id) + .select('_Title'); + + //console.log(CITitle); + //console.log($scope.selectedCAListViewData); + + $rootScope.ViewTitle = CITitle[0]._Title; + } + else { + $rootScope.ViewTitle = $event.currentTarget.textContent; + + } + + + localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle); + localStorage.setItem("currentBodyViewId", $event.currentTarget.id); + + var u = $location.url(); + $location.url('/clinical-animations-detail'); + + //console.log($location.url('/clinical-animations-detail')); + + } + + $scope.openBodyView = function () { + + if ($rootScope.disableAnnotationTB == true) + { + $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').attr('disabled', 'disabled'); + $('#slider-range-min-2').slider('disable'); + $("#annotationpaintbrushsize").attr('disabled', 'disabled'); + //$("#annotationpaintbrushsize").attr("href", "#"); + } + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $scope.voId = localStorage.getItem("currentBodyViewId"); + + // alert($scope.voId); + + + //once you get id in scope push detail in jspanel content + + var openViews; + if ($rootScope.openViews.length > 0) { + openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId==" + $scope.voId) + .select(); + } + var counter = 1; + var tittle = localStorage.getItem("currentViewTitleFromJson"); + + if (openViews != null && openViews.length > 0) { + angular.forEach(openViews, function (value, key) { + + if (value.body - views == tittle) { + tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; + $rootScope.currentActiveViewTitle = tittle; + localStorage.setItem("currentViewTitle", tittle); + } + + }); + } + else { + localStorage.setItem("currentViewTitle", tittle); + + } + + //alert(localStorage.getItem("currentViewTitle")); + + var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist_mp4link.json') + promise.then( + function (result) { + $scope.AnimationData = result; + $scope.CAlistViewData = $scope.AnimationData.root.CAData; + + var clickedCAVideo = []; + clickedCAVideo = new jinqJs() + .from($scope.CAlistViewData) + .where('_id == ' + $scope.voId) + .select('_Video', '_LowerSummary', '_HostedFolderId'); + + $scope.clickedCAVideo = clickedCAVideo[0]._Video; + $scope.clickedCASummary = clickedCAVideo[0]._LowerSummary; + $scope.hostedFolderId = clickedCAVideo[0]._HostedFolderId; + $scope.poster = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".jpg"; + $scope.ad = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + "_ad.mp4"; + $scope.HDVid = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + "_HD.mp4"; + $scope.webm = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".webm"; + $scope.ogv = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".ogv"; + $scope.playerScript = "~/../libs/video_4_12_11/video_4_12_11.js"; + //$scope.vtt = $scope.hostedServer + $scope.hostedFolderId + "/" + $scope.hostedFolderId + ".vtt" + $scope.vtt = "~/../content/data/vtt/" + $scope.hostedFolderId + ".vtt"; + console.log($scope.vtt); + if ($scope.clickedCAVideo.length > 0 && $scope.clickedCASummary.length > 0) { + + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + + $.jsPanel({ + id: 'caVideoPanel', + selector: '.caView', + theme: 'success', + currentController: 'CAController', + parentSlug: 'clinical-animations', + content: '

' + $scope.clickedCASummary + '

', + + //ajax: { + // url: 'app/views/ca/ca-view-detail.html' + //}, + title: localStorage.getItem("currentViewTitle"), + position: { + top: 70, + left: 1, + }, + + size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, + + }); + + + $rootScope.currentSlug = 'clinical-animations-detail'; + + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + }); + + var jspContentHeight = $('.jsPanel-content').height(); var videoHeight = $('#divplayerinlineVideo div').height(); if (videoHeight <= 0) @@ -584,94 +585,94 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var textH = $('.video-subtitle').height(); textH = textH + 40; var blackBorderHeight = jspContentHeight - (videoHeight + textH); - + if ($('.jsPanel-content').length > 0) { - $('.video-subtitle').css('margin-bottom', blackBorderHeight); + $('.video-subtitle').css('margin-bottom', blackBorderHeight); $('#divplayerinlineVideo').css('background', '#fff'); - } - - } - - - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - - ); - - //console.log($rootScope.openViews); - $('#CAView').css("height", $(window).outerHeight()); - - $('#CAView').css("width", $(window).outerWidth()); - - } - - $scope.loadCAPlayer = function (summary, link, vidNumber) { - $scope.clickedCASummary = summary; - $scope.clickedCAVideo = link; - $scope.videoNumber = vidNumber; - }; - - $scope.ReloadListViewImageDiv = function (id) { - //console.log(id); - $scope.idSelected = id; - $scope.hiderow = true; - - var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') - promise.then( - function (result) { - $scope.AnimationData = result; - //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; - - var SelectedCAthumbImage = []; - SelectedCAthumbImage = new jinqJs() - .from($scope.AnimationData.root.CAData) - .where('_id = ' + id) - .select('_ThumbnailImage', '_Summary', '_id', '_Title'); - - //console.log($scope.selectedCAListViewData); - - $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; - - $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; - $scope.SelectedCAId = SelectedCAthumbImage[0]._id; - $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; - - //Set the scroll position of the tablebody to show selected row. - - var curCAListViewScroll = localStorage.getItem("CAListViewScroll"); - if (typeof (curCAListViewScroll) !== "undefined" && curCAListViewScroll !== null && curCAListViewScroll !== '') { - - $('#ListViewDiv').scrollTop(localStorage.getItem("CAListViewScroll")); - } - //else { - // $('#ListViewDiv').scrollTop(0); - //} - - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - ); - }; - - $scope.hideListViewDiv = function () { - if (localStorage.getItem("currentCATabView") == 2) { - localStorage.setItem("CASelectedRowId", ""); - if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } - $scope.hiderow = false; - } - } - - -}] - - -); - - - - + } + + } + + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + + ); + + //console.log($rootScope.openViews); + $('#CAView').css("height", $(window).outerHeight()); + + $('#CAView').css("width", $(window).outerWidth()); + + } + + $scope.loadCAPlayer = function (summary, link, vidNumber) { + $scope.clickedCASummary = summary; + $scope.clickedCAVideo = link; + $scope.videoNumber = vidNumber; + }; + + $scope.ReloadListViewImageDiv = function (id) { + //console.log(id); + $scope.idSelected = id; + $scope.hiderow = true; + + var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') + promise.then( + function (result) { + $scope.AnimationData = result; + //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; + + var SelectedCAthumbImage = []; + SelectedCAthumbImage = new jinqJs() + .from($scope.AnimationData.root.CAData) + .where('_id = ' + id) + .select('_ThumbnailImage', '_Summary', '_id', '_Title'); + + //console.log($scope.selectedCAListViewData); + + $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; + + $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; + $scope.SelectedCAId = SelectedCAthumbImage[0]._id; + $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; + + //Set the scroll position of the tablebody to show selected row. + + var curCAListViewScroll = localStorage.getItem("CAListViewScroll"); + if (typeof (curCAListViewScroll) !== "undefined" && curCAListViewScroll !== null && curCAListViewScroll !== '') { + + $('#ListViewDiv').scrollTop(localStorage.getItem("CAListViewScroll")); + } + //else { + // $('#ListViewDiv').scrollTop(0); + //} + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); + }; + + $scope.hideListViewDiv = function () { + if (localStorage.getItem("currentCATabView") == 2) { + localStorage.setItem("CASelectedRowId", ""); + if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + $scope.hiderow = false; + } + } + + +}] + + +); + + + + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index b8d6bff..d0b1cc0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -158,6 +158,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }; $scope.loadAllCI = function () { + $('#grid-view').empty(); + $("
Loading
").appendTo('#grid-view'); $('#ciSpinner').css('visibility', 'visible'); $('#ciSpinner').css('zIndex', '20000'); var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') @@ -174,7 +176,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout - $('#grid-view').empty(); + + var $e1 = $('