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/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index f47496c..42221f1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1470,14 +1470,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR'); - var width = imageCanvas.width; - var ht = imageCanvas.height; + if (imageCanvas != null || imageCanvas != undefined) { + var width = imageCanvas.width; + var ht = imageCanvas.height; + + var coloredCanvasContext = imageCanvas.getContext("2d"); + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); + var coloredImageDataVar = coloredImageData; - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; - $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)] = coloredImageDataVar; + } @@ -1831,15 +1833,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId); - var width = imageCanvas.width; - var ht = imageCanvas.height; + if (imageCanvas != null || imageCanvas != undefined) { + var width = imageCanvas.width; + var ht = imageCanvas.height; + + var coloredCanvasContext = imageCanvas.getContext("2d"); + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); + var coloredImageDataVar = coloredImageData; - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; - - $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; + $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; + } // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { @@ -4896,10 +4900,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.CalculateImageCordinates($rootScope.viewOrientationId); //3. - if ($scope.zoomInOut == 25) - $('#canvasDiv').scrollLeft(0) - else - $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) + if ($scope.zoomInOut == 25) { + if ($('#canvasDiv') != null) + $('#canvasDiv').scrollLeft(0) + } + else { + if ($('#canvasDiv') != null) + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) + } //remove annotation speech bubble if ($('#dot').length > 0) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index e311faf..8eca49f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -119,6 +119,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //annotation tool custom events $rootScope.ShowAnnotationWindow = function () { //7904 + + $("#OnIdentify").addClass("annotationtoolbartab"); $("#annotationToolBarOptions").addClass("active"); $("#annotationButton").addClass("active"); @@ -131,6 +133,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.CloseAnnotationTool = function () { console.log('close'); + $("#OnIdentify").removeClass("annotationtoolbartab"); + $("#DrawMode").removeClass("annotationtoolbartab"); $('.btnCursor').removeClass('activebtncolor'); $("#annotationButton").removeClass("active"); $("#annotationToolBarOptions").removeClass("active"); @@ -143,6 +147,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } $rootScope.OnIdentifyClick = function () { + + $("#OnIdentify").addClass("annotationtoolbartab"); + $("#DrawMode").removeClass("annotationtoolbartab"); // $rootScope.isIdetifyClicked = true; // $rootScope.isDrawingToolSelected = false; $("#canvasPaint").css("display", "none"); @@ -157,7 +164,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.DrawingMode = function () { - + $("#OnIdentify").removeClass("annotationtoolbartab"); + $("#DrawMode").addClass("annotationtoolbartab"); $('.btnCursor').addClass('activebtncolor'); $rootScope.switchCanvas(); $("#canvasPaint").css("display", "block"); 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 @@
-
+
-
+
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html index 299a0a2..149e0ed 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html @@ -6,7 +6,7 @@
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html index ef8dd15..e9a0cfb 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html @@ -59,32 +59,33 @@
-
- +
+ - -
+
+
--> -
+
+ +
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html index 217a61b..5619133 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html @@ -9,8 +9,14 @@
    - -
  • + + + + +
  • +
  • +
diff --git a/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css b/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css index dccdc59..4fe581a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css +++ b/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css @@ -857,4 +857,10 @@ cursor:pointer; display:none; } /*#7904*/ -.dropdown-menu > li > a.active{background-color:#0095da;color:#fff;text-decoration:none;} \ No newline at end of file +.dropdown-menu > li > a.active{background-color:#0095da;color:#fff;text-decoration:none;} + + +.annotationtoolbartab + { + background:#626c34 !important; +} \ No newline at end of file