diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 6aaa6df..13f2a97 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -2,7 +2,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location, $document, $sce, $compile) { $rootScope.currentActiveModuleTitle = pages[5].name; - $scope.showme = true; + $scope.showme = false; $scope.threedanatomyData; $scope.Id; $scope.$on('$viewContentLoaded', function (event) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js index 5e643f4..6bf16e9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js @@ -1,17 +1,47 @@ AIA.controller("AODController", ["$scope", "$rootScope", "pages", "$log", function ($scope, $rootScope, pages, log) { - $scope.showme = true; - $scope.IsVisible = function () { - $scope.scroll(); + //$scope.showme = true; + //$scope.IsVisible = function () { + // $scope.scroll(); - } + //} + + $scope.setActiveTab = function (tabToSet) { + $scope.activeTab = tabToSet; + localStorage.setItem("currentAODTabView", $scope.activeTab); + }; $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); //alert("scroll"); } - $rootScope.currentActiveModuleTitle = pages[10].name; + //$rootScope.currentActiveModuleTitle = pages[10].name; + + $scope.$on('$viewContentLoaded', function (event) { + // code that will be executed ... + // every time this view is loaded + + $scope.showme = true; + $scope.IsVisible = function () { + $scope.scroll(); + + } + + $rootScope.currentActiveModuleTitle = pages[10].name; + + //set the local storage + + var curtab = localStorage.getItem("currentAODTabView"); + if (curtab == 2) { + $scope.setActiveTab(2); + } + else { + $scope.setActiveTab(1); + } + + }); + }] diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 6748a3e..6e52182 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -13,62 +13,142 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B $scope.SelectedCASummary = []; $scope.filterstring = false; $scope.query = { - selectedbodyregion: null, - selectedbodysystem: null, - selectedspecialty: null, + 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 + $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); + } + else { + $scope.setActiveTab(1); + } + + 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); + } + + }); - 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.LoadCAJsonData = function () { - $scope.selectedCAListViewData = new jinqJs() - .from($scope.AnimationData.root.CAData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); + 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; - //console.log($scope.selectedCAListViewData); + $scope.selectedCAListViewData = new jinqJs() + .from($scope.AnimationData.root.CAData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); - $('#grid-view').empty(); + //console.log($scope.selectedCAListViewData); - angular.forEach($scope.selectedCAListViewData, function (value, key) { - $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); + }; + $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; - $compile($el)($scope); - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" + 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); + } + ); + - }, - function (error) { - // handle errors here - console.log(' $scope.AnimationData = ' + error.statusText); - } - ); + } $scope.IsVisible = function () { $scope.scroll(); @@ -113,32 +193,21 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B $scope.Reset = function (query) { - query.selectedbodyregion = null; - query.selectedbodysystem = null; - query.selectedspecialty = null; + query.selectedbodyregion = ""; + query.selectedbodysystem = ""; + query.selectedspecialty = ""; + + //set localstorage values + localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); + localStorage.setItem("CACurBodySystem", query.selectedbodysystem); + localStorage.setItem("CACurSpeciality", query.selectedspecialty); + $scope.filterstring = false; while ($scope.searchCAListViewData.length) { $scope.searchCAListViewData.pop(); } - $('#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" - }); - - }); + + $scope.loadAllCA(); } @@ -151,106 +220,143 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B $scope.searchCAListViewData.pop(); } - $('#grid-view').empty(); + //$('#grid-view').empty(); filtercount = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { filtercount = filtercount + 1; + localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); } - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { + else { + localStorage.setItem("CACurBodyRegion", ''); + } + + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { filtercount = filtercount + 1; + localStorage.setItem("CACurBodySystem", query.selectedbodysystem); } - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { + 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", ''); } - angular.forEach($scope.selectedCAListViewData, function (value, key) { + 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 selectimg = true; - var count = 0; + $scope.selectedCAListViewData = new jinqJs() + .from($scope.AnimationData.root.CAData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + //console.log($scope.selectedCAListViewData); - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { - var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); - if (posbodyregion > -1) { - selectimg = true; - count = count + 1; + $('#grid-view').empty(); - } - else { - selectimg = false; - count = count - 1; - } + angular.forEach($scope.selectedCAListViewData, function (value, key) { - } + var selectimg = true; + var count = 0; - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { - 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) { - var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); - if (posspeciality > -1) { - count = count + 1; - selectimg = true; - } else { - selectimg = false; - count = count - 1; - } + 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 (selectimg === true && count >= filtercount) { + } + 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; + } + } - $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; + 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; + } - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); + } + if (selectimg === true && count >= filtercount) { - $compile($el)($scope); - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); + $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); - $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 - }); - } + $compile($el)($scope); + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" + }); - }); - //Show Error Message in case of gridview if no data is found - if ($scope.searchCAListViewData.length == 0) { + $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); + } + ); - var $el = $('
No animation found for the selected search criteria!
').appendTo('#grid-view'); - $compile($el)($scope); - } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index f40c283..14ba580 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -17,17 +17,24 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.selectedCIListViewData = []; $scope.filterstring = false; $scope.query = { - selectedbodyregion: null, - selectedbodysystem: null, - selectedorientation: null, - selectedimagetype: null, - selectedspecialty: null, + selectedbodyregion: '', + selectedbodysystem: '', + selectedorientation: '', + selectedimagetype: '', + selectedspecialty: '', + }; + + $scope.setActiveTab = function (tabToSet) { + $scope.activeTab = tabToSet; + localStorage.setItem("currentCITabView", $scope.activeTab); }; $scope.$on('$viewContentLoaded', function (event) { // code that will be executed ... // every time this view is loaded + $scope.LoadCIJsonData(); + $scope.CIAllBodyRegion = BodyRegions; $scope.CIAllBodySystem = BodySystems; $scope.CIAllOrientation = ViewOrientations; @@ -37,45 +44,130 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //push the details of open module in array $rootScope.openModules $rootScope.openModules.push({ "ModuleId": 4 }); + //set the local storage + + var curtab = localStorage.getItem("currentCITabView"); + if (curtab == 2) { + $scope.setActiveTab(2); + } + else { + $scope.setActiveTab(1); + } + + var curBodyRegion = localStorage.getItem("CICurBodyRegion"); + if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !=='') { + $scope.query.selectedbodyregion = curBodyRegion; + } + else { + $scope.query.selectedbodyregion = ""; + } + + var curBodySystem = localStorage.getItem("CICurBodySystem"); + if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !=='') { + $scope.query.selectedbodysystem = curBodySystem; + } + else { + $scope.query.selectedbodysystem = ""; + } + + var curOrientation = localStorage.getItem("CICurOrientation"); + if (typeof (curOrientation) !== "undefined" && curOrientation !== null && curOrientation !=='') { + $scope.query.selectedorientation = curOrientation; + } + else { + $scope.query.selectedorientation = ""; + } + + var curImageType = localStorage.getItem("CICurImageType"); + if (typeof (curImageType) !== "undefined" && curImageType !== null && curImageType !=='') { + $scope.query.selectedimagetype = curImageType; + } + else { + $scope.query.selectedimagetype = ""; + } + + var curSpeciality = localStorage.getItem("CICurSpeciality"); + if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !=='') { + $scope.query.selectedspecialty = curSpeciality; + } + else { + $scope.query.selectedspecialty = ""; + } + + + if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedorientation == "" && $scope.query.selectedimagetype == "" && $scope.query.selectedspecialty == "") { + $scope.loadAllCI(); + } + else { + $scope.ApplySearch($scope.query); + } + }); - var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') - promise.then( - function (result) { - $scope.IllustrationData = result; - //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; + $scope.LoadCIJsonData = function () { - $scope.selectedCIListViewData = new jinqJs() - .from($scope.IllustrationData.root.CIData) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); + var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') + promise.then( + function (result) { + $scope.IllustrationData = result; + //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; - $('#grid-view').empty(); + $scope.selectedCIListViewData = new jinqJs() + .from($scope.IllustrationData.root.CIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); - angular.forEach($scope.selectedCIListViewData, function (value, key) { - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; + }, + function (error) { + // handle errors here + console.log(' $scope.IllustrationData = ' + error.statusText); + } + ); - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); + }; - $compile($el)($scope); + $scope.loadAllCI = function () { + + var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') + promise.then( + function (result) { + $scope.IllustrationData = result; + //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; + + $scope.selectedCIListViewData = new jinqJs() + .from($scope.IllustrationData.root.CIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + console.log($scope.selectedCIListViewData); + $('#grid-view').empty(); + angular.forEach($scope.selectedCIListViewData, function (value, key) { + $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; + + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); + + + $compile($el)($scope); + + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" + }); - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" }); - }); + }, + function (error) { + // handle errors here + console.log(' $scope.IllustrationData = ' + error.statusText); + } + ); - }, - function (error) { - // handle errors here - console.log(' $scope.IllustrationData = ' + error.statusText); - } - ); + } $scope.IsVisible = function () { $scope.scroll(); @@ -119,40 +211,26 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.Reset = function (query) { - //query.selectedbodyregion = ""; - //query.selectedbodysystem = ""; - //query.selectedorientation = ""; - //query.selectedimagetype = ""; - //query.selectedspecialty = ""; - query.selectedbodyregion = null; - query.selectedbodysystem = null; - query.selectedorientation = null; - query.selectedimagetype = null; - query.selectedspecialty = null; + query.selectedbodyregion = ""; + query.selectedbodysystem = ""; + query.selectedorientation = ""; + query.selectedimagetype = ""; + query.selectedspecialty = ""; + + + //set localstorage values + localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); + localStorage.setItem("CICurBodySystem", query.selectedbodysystem); + localStorage.setItem("CICurOrientation", query.selectedorientation); + localStorage.setItem("CICurImageType", query.selectedimagetype); + localStorage.setItem("CICurSpeciality", query.selectedspecialty); $scope.filterstring = false; while ($scope.searchCIListViewData.length) { $scope.searchCIListViewData.pop(); } - $('#grid-view').empty(); - - angular.forEach($scope.selectedCIListViewData, function (value, key) { - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); - - - $compile($el)($scope); - - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); - - }); + $scope.loadAllCI(); } @@ -164,143 +242,187 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.searchCIListViewData.pop(); } - $('#grid-view').empty(); + //$('#grid-view').empty(); filtercount = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { + if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { filtercount = filtercount + 1; + localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); + } + else { + localStorage.setItem("CICurBodyRegion", ''); } - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { + + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !=="")) { filtercount = filtercount + 1; + localStorage.setItem("CICurBodySystem", query.selectedbodysystem); } - if (typeof (query.selectedorientation) !== "undefined" && query.selectedorientation !== null) { + else { + localStorage.setItem("CICurBodySystem", ''); + } + + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== '')) { filtercount = filtercount + 1; + localStorage.setItem("CICurOrientation", query.selectedorientation); } - if (typeof (query.selectedimagetype) !== "undefined" && query.selectedimagetype !== null) { + else { + localStorage.setItem("CICurOrientation", ''); + } + + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== '')) { filtercount = filtercount + 1; + localStorage.setItem("CICurImageType", query.selectedimagetype); } - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { + else { + localStorage.setItem("CICurImageType", ''); + } + + if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== '')) { filtercount = filtercount + 1; + localStorage.setItem("CICurSpeciality", query.selectedspecialty); + } + else { + localStorage.setItem("CICurSpeciality", ''); } - angular.forEach($scope.selectedCIListViewData, function (value, key) { - var selectimg = true; - var count = 0; + var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') + promise.then( + function (result) { + $scope.IllustrationData = result; + //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; + $scope.selectedCIListViewData = new jinqJs() + .from($scope.IllustrationData.root.CIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + $('#grid-view').empty(); + + angular.forEach($scope.selectedCIListViewData, function (value, key) { + + var selectimg = true; + var count = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { - 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.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) { - var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); - if (posbodysystem > -1) { - count = count + 1; - selectimg = true; - } else { - selectimg = false; - count = count - 1; - } - } + } - if (typeof (query.selectedorientation) !== "undefined" && query.selectedorientation !== null) { - var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); - if (posorientation > -1) { - count = count + 1; - selectimg = true; + 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; + } + } - } else { - selectimg = false; - count = count - 1; - } + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { + var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); + if (posorientation > -1) { + count = count + 1; + selectimg = true; - } + } else { + selectimg = false; + count = count - 1; + } - if (typeof (query.selectedimagetype) !== "undefined" && query.selectedimagetype !== null) { - var posimagetype = value._ImageType.indexOf(query.selectedimagetype); - if (posimagetype > -1) { - count = count + 1; - selectimg = true; + } - } else { - selectimg = false; - count = count - 1; - } + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { + var posimagetype = value._ImageType.indexOf(query.selectedimagetype); + if (posimagetype > -1) { + count = count + 1; + selectimg = true; - } + } else { + selectimg = false; + count = count - 1; + } - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { - var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); - if (posspeciality > -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) { + } + if (selectimg === true && count >= filtercount) { - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); + $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); - $compile($el)($scope); - $(".sidebar").mCustomScrollbar({ - autoHideScrollbar: true, - //theme:"rounded" - }); + $compile($el)($scope); + $(".sidebar").mCustomScrollbar({ + autoHideScrollbar: true, + //theme:"rounded" + }); - $scope.searchCIListViewData.push( - { - "_id": value._id, - "_ImageId": value._ImageId, - "_Title": value._Title, - "_contentImage": value._contentImage, - "_ThumbnailImage": value._ThumbnailImage, - "_BodySystem": value._BodySystem, - "_BodyRegion": value._BodyRegion, - "_ViewOrientation": value._ViewOrientation, - "_MedicalSpecialty": value._MedicalSpecialty, - "_ImageType": value._ImageType, - "_Summary": value._Summary - }); + $scope.searchCIListViewData.push( + { + "_id": value._id, + "_ImageId": value._ImageId, + "_Title": value._Title, + "_contentImage": value._contentImage, + "_ThumbnailImage": value._ThumbnailImage, + "_BodySystem": value._BodySystem, + "_BodyRegion": value._BodyRegion, + "_ViewOrientation": value._ViewOrientation, + "_MedicalSpecialty": value._MedicalSpecialty, + "_ImageType": value._ImageType, + "_Summary": value._Summary - } + }); + } - }); - //Show Error Message in case of gridview if no data is found - if ($scope.searchCIListViewData.length == 0) { + }); - var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); - $compile($el)($scope); - } - } + //Show Error Message in case of gridview if no data is found + if ($scope.searchCIListViewData.length == 0) { + var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); + $compile($el)($scope); + } + }, + function (error) { + // handle errors here + console.log(' $scope.IllustrationData = ' + error.statusText); + } + ); + + } $scope.scroll = function () { @@ -404,23 +526,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); - //$.jsPanel({ - // id: 'ciImagePanel', - // selector: '.ciView', - // theme: 'success', - // currentController: 'CIController', - // parentSlug: 'clinical-illustrations', - // content: '
' + - // '
' + - // '

' + $scope.clickedCISummary + '

'+ - // '
' + - // '
', - // title: localStorage.getItem("currentViewTitle"), - // position: { - // top: 70, - // left: 1, - // }, - $.jsPanel({ id: 'ciImagePanel', selector: '.ciView', @@ -441,8 +546,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout left: 1, }, - //size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, - size: { width: $(window).outerWidth() - 10, height: $(window).outerHeight() - 110 }, }); @@ -455,25 +558,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "slug": $rootScope.currentSlug }); - //var e1 = angular.element(document.getElementById("CIView")); - //$timeout(function () { - - // //$compile(e1.contents())($scope) - - // var $el = $('
' + - // '
' + - // '

' + $scope.clickedCISummary + '

' + - // '
' + - // '
').appendTo('#ciView'); - - // $compile($el)($scope); - - //}, 250); - // $compile(e1.contents())($scope); - - //$('#ciView').css("height", $(window).outerHeight() - 110); - - //$('#ciView').css("width", $(window).outerWidth() - 10); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html index 9124005..e348377 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html @@ -4,7 +4,7 @@
-
+