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 df21034..6e52182 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -13,55 +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 () { - $('#grid-view').empty(); + 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; - angular.forEach($scope.selectedCAListViewData, function (value, key) { - $scope.imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; + $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); + } + ); - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); + }; + + $scope.loadAllCA = function () { - $compile($el)($scope); + 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" + }); - $(".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(); @@ -106,35 +193,25 @@ 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(); } + // 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; @@ -143,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); + } + else { + localStorage.setItem("CACurBodyRegion", ''); } - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { + + 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) { + + 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 c89ef1b..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,40 +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 () { - $('#grid-view').empty(); + 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; - angular.forEach($scope.selectedCIListViewData, function (value, key) { - $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; + $scope.selectedCIListViewData = new jinqJs() + .from($scope.IllustrationData.root.CIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); - var $el = $('
' - + '
' - + '' - + '

' + value._Title + '

').appendTo('#grid-view'); + }, + function (error) { + // handle errors here + console.log(' $scope.IllustrationData = ' + error.statusText); + } + ); - $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(); @@ -114,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(); } @@ -159,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); + } + else { + localStorage.setItem("CICurBodySystem", ''); } - if (typeof (query.selectedorientation) !== "undefined" && query.selectedorientation !== null) { + + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== '')) { filtercount = filtercount + 1; + localStorage.setItem("CICurOrientation", query.selectedorientation); + } + else { + localStorage.setItem("CICurOrientation", ''); } - if (typeof (query.selectedimagetype) !== "undefined" && query.selectedimagetype !== null) { + + 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 () { @@ -399,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', @@ -436,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 }, }); @@ -450,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 5588b3f..77892b4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -11,7 +11,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.imagePath = ""; $rootScope.BodyRegionData; $rootScope.BodyRegionCordinatesData; - $scope.isTransparencyActivated = false; + $scope.isTransparencyActivated = false; $rootScope.BodyLayerData; $rootScope.VocabTermData; @@ -84,7 +84,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.updatedWhiteImageMRDataList = []; //normal mode - $rootScope.isNormalMode = false; + $rootScope.isNormalMode = true; $rootScope.isZoomed = false; //navigator man functionality @@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //get the DA body view list based on selected gender $scope.getDAViewList = function ($event) { - + if ($('#MainImage') != null) { $('#MainImage').remove(); } @@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; - + var $el = $('
' + '' @@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.openView = function ($event) { - + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -422,6 +422,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //0.1 var currentBodyViewId = localStorage.getItem("currentBodyViewId"); + $scope.loadSearchDataForBodyView(); + + console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); var openViews; @@ -499,7 +502,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //1. load navigator man first $scope.LoadBodyViewNavigatorImage(); - $scope.loadSearchDataForBodyView(); + //$scope.loadSearchDataForBodyView(); $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); @@ -525,7 +528,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadSearchDataForBodyView = function () { - + console.log('loadSearchDataForBodyView'); var currentBodyViewId = localStorage.getItem("currentBodyViewId"); @@ -601,6 +604,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.bgartData = e.data.bodyArtData; $rootScope.BodyLayerData = e.data.bodyLayerData; + var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; + + //set max for LayerNumber input + $rootScope.totalLayers = dataLength - 1; + // debugger + $('#txtLayerNumber').attr('max', $rootScope.totalLayers); + $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers); + $scope.isBodylayerdataLoaded = true; $scope.LoadDefaultLayerImage(); @@ -682,7 +693,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.LoadDefaultLayerImage = function () { - + $rootScope.isNormalMode = true; $scope.layerNumber = 0; @@ -724,6 +735,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //calculate coordinates for body region images $scope.CalculateImageCordinates = function (viewOrientationId) { + // annotation toolbar canvas + if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { + + $("#canvasDiv").append(''); + $scope.BindCanvasDrawingListners(); + // $rootScope.FreeStylePaint(); + + } + $scope.terminateCurrentlyRunningWPs(); var drawnBodyRegionCount = []; @@ -945,7 +965,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //set scrollbars on canvas and hide loading label $('#daLoaderLabel').css('visibility', 'hidden') - + $('#canvasDiv').css('overflow', 'scroll') if (isiOSSafari) { $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150) @@ -954,7 +974,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) } - + // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) $('#canvasDiv').scrollTop(50) @@ -966,40 +986,44 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top. // #4976 :While changing gender male to female scroll bar is going on top. var canvasDiv = document.getElementById('canvasDiv'); - canvasDiv.scrollTop = 0; + if (canvasDiv != null || canvasDiv != undefined) { + canvasDiv.scrollTop = 0; - //Navigator Code for dynamically calculating the height and width of Dragable Div on Navigator Image - var dragdivh = Math.floor(($('#canvasDiv').height() / $('#canvasDiv')[0].scrollHeight) * 119) //119px is the height of the image + //Navigator Code for dynamically calculating the height and width of Dragable Div on Navigator Image - if ($('#canvasDiv')[0].scrollWidth > $('#canvasDiv')[0].clientWidth) { + var dragdivh = Math.floor(($('#canvasDiv').height() / $('#canvasDiv')[0].scrollHeight) * 119) //119px is the height of the image - var dragdivw = 42 - $scope.dragdivleft = 21; - $scope.dragdivtop = 0; + if ($('#canvasDiv')[0].scrollWidth > $('#canvasDiv')[0].clientWidth) { - $scope.dragdivposition = { - "left": 21, - "top": 0 - }; - } - else { - var dragdivw = 83; + var dragdivw = 42 + $scope.dragdivleft = 21; + $scope.dragdivtop = 0; - $scope.dragdivleft = 0; - $scope.dragdivtop = 0; + $scope.dragdivposition = { + "left": 21, + "top": 0 + }; + } + else { + var dragdivw = 83; - $scope.dragdivposition = { - "left": 0, - "top": 0 + $scope.dragdivleft = 0; + $scope.dragdivtop = 0; - }; + $scope.dragdivposition = { + "left": 0, + "top": 0 + + }; + } } - + $('#draggable').css('width', dragdivw); $('#draggable').css('height', dragdivh) + } function scaleRectangle(x, y, height, width, mirrorValue) { @@ -1059,14 +1083,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.GetImageSource = function (bodyRegionId) { - + var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; - //set max for LayerNumber input - $rootScope.totalLayers = dataLength - 1; - // debugger - $('#txtLayerNumber').attr('max', $rootScope.totalLayers); - $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers); + // $('#layerChangeSlider').slider("option", "value",parseInt($rootScope.totalLayers)-parseInt($scope.layerNumber)); $scope.one = 1; @@ -1077,7 +1097,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.userInput = parseInt($scope.layerNumber); - + $scope.skinTone = $rootScope.globalSetting.ethnicity; var SelectedLayerData = []; @@ -1139,7 +1159,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.GetBackgroundImgSource = function (bodyRegionId) { - + var selectedGender; if (localStorage.getItem("genderId") == "Male") { @@ -1157,7 +1177,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) { //filter bodyRegion data basd on skintone - $scope.skinTone = $rootScope.globalSetting.ethnicity + $scope.skinTone = $rootScope.globalSetting.ethnicity $scope.bagartDetailsOnSktn = new jinqJs() .from($scope.bagartBodyRegionDetails) .where('_Skintone == ' + $scope.skinTone) @@ -1193,11 +1213,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo FlipedImgCanvas.style.left = x + "px"; FlipedImgCanvas.style.top = y + "px"; - + if (isMaskImage == 'Y') { + FlipedImgCanvas.id = 'imageCanvas' + bodyRegionId + '_MR_mci'; - FlipedImgCanvas.style.visibility = 'hidden' + FlipedImgCanvas.style.visibility = 'hidden'; + } else { @@ -1218,6 +1240,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo FlipedImgCanvas.addEventListener('click', function (evt) { + //to get correct data on multihighlight highlight if ($scope.isLayerChange == true) { $scope.isLayerChange = false; @@ -1294,6 +1317,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } var RGBColor = (Red + Green + Blue); + $rootScope.previousHighlightList.push(RGBColor); + + if ($rootScope.isHighLight) { if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) { @@ -1331,15 +1357,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $rootScope.previousHighlightList.push(RGBColor); + // $rootScope.previousHighlightList.push(RGBColor); $scope.highLightBodyBasedOnIcolor(RGBColor); } - if ($rootScope.isNormalMode == true) { + //if ($rootScope.isNormalMode == true) { - $rootScope.previousHighlightList.push(RGBColor); + // $rootScope.previousHighlightList.push(RGBColor); + //} + + //extarct clicked body part is extarct button is already enabled. + // debugger; + if ($rootScope.isExtract == true) { + $scope.enableExtract(false); } var annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); @@ -1352,6 +1384,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); $scope.MultiLanguageAnnationArray = []; $scope.MultiLanguageAnnationArray.push(annotationText); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } else { @@ -1367,6 +1400,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); $scope.MultiLanguageAnnationArray = []; $scope.MultiLanguageAnnationArray.push(annotationText); + + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } else { @@ -1374,6 +1409,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); $scope.MultiLanguageAnnationArray = []; $scope.MultiLanguageAnnationArray.push(annotationText); + + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } @@ -1412,33 +1449,52 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo function start() { + context.save(); context.translate(w, 0); context.scale(-1, 1); context.drawImage(img, 0, 0); context.restore(); + + + if (isMaskImage == 'N') { - if (isMaskImage == 'N') { + $scope.ColoredImageSRC.push( + { + "bodyRegionId": bodyRegionId, "SRC": src, + "Height": h, + "Width": w, + "x": x, + "y": y, + "haveMirror": 'true' + } + ); - - $scope.ColoredImageSRC.push( - { - "bodyRegionId": bodyRegionId, "SRC": src, - "Height": h, - "Width": w, - "x": x, - "y": y, - "haveMirror": 'true' - } - ); + //-NIKI-for solving extarct issue 8286 + + var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR'); + + 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; + + $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)] = coloredImageDataVar; + } + - // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) + // + // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { $scope.isEligibleForHighlight = true; } @@ -1455,9 +1511,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isEligibleForHighlight = false; } - if ($scope.isEligibleForHighlight == true) - { - if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { + if ($scope.isEligibleForHighlight == true) { + if ($scope.isExtract == true) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $scope.highLightBody(); + } + else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $rootScope.isHighlightBodyByBodySystem == true) { + + console.log('1. $rootScope.isHighLight= ' + $rootScope.isHighLight) $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1489,9 +1551,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo ); } }; - + + if (document.getElementById('canvasDiv') != null) document.getElementById('canvasDiv').appendChild(FlipedImgCanvas); + + @@ -1619,6 +1684,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + $rootScope.previousHighlightList.push(RGBColor); if ($rootScope.isHighLight == true) { if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) { @@ -1657,7 +1723,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $rootScope.previousHighlightList.push(RGBColor); + // $rootScope.previousHighlightList.push(RGBColor); if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { } @@ -1668,8 +1734,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - if ($rootScope.isNormalMode == true) { - $rootScope.previousHighlightList.push(RGBColor); + //if ($rootScope.isNormalMode == true) { + // $rootScope.previousHighlightList.push(RGBColor); + //} + + // debugger; + //extarct clisked body part is extarct button is already enabled. + if ($rootScope.isExtract == true) { + $scope.enableExtract(false); } if ($('#speechBubbleTrns').length > 0) @@ -1680,6 +1752,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top); $scope.MultiLanguageAnnationArray = []; $scope.MultiLanguageAnnationArray.push(annotationText); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } else { @@ -1715,6 +1788,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.MultiLanguageAnnationArray.push(annotationText); console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true); } @@ -1733,10 +1807,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo img.src = src; - + function start() { - //debugger; + context.drawImage(img, 0, 0); if (isMaskImage == 'N') { @@ -1744,19 +1818,36 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //do nothing } else { - - $scope.ColoredImageSRC.push( - { - "bodyRegionId": bodyRegionId, "SRC": src, - "Height": h, - "Width": w, - "x": x, - "y": y, - "haveMirror": 'false' - } - - ); - + + $scope.ColoredImageSRC.push( + { + "bodyRegionId": bodyRegionId, "SRC": src, + "Height": h, + "Width": w, + "x": x, + "y": y, + "haveMirror": 'false' + } + + ); + + + //-NIKI-for solving extarct issue 8286 + + var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId); + + 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; + + + $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; + } + // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { @@ -1776,15 +1867,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.isEligibleForHighlight = false; } - if ($scope.isEligibleForHighlight == true) - { - - if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { + if ($scope.isEligibleForHighlight == true) { + + if ($scope.isExtract == true) { + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + $scope.highLightBody(); + } + else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == true) { + + console.log('2. $rootScope.isHighLight= ' + $rootScope.isHighLight) $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - + console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) $rootScope.isHighLight = true; @@ -1793,7 +1890,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.highLightBody(); console.log('just after highLightBody call'); - + } } } @@ -1844,16 +1941,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.HighlightBodyOnExtract = function () { + console.log(' insode HighlightBodyOnExtract. $rootScope.MaskCanvasData length= ' + $rootScope.MaskCanvasData.length + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length) - var multiTermList = []; var CallBackBodyRegion = []; if ($rootScope.isListManagerSelected) { - + multiTermList = $scope.AllTerms; - - } + + } else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { angular.forEach($rootScope.previousHighlightList, function (value, key) { @@ -1879,7 +1976,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //terminate previous running workers to create space for new workers - + $scope.layerNumber = $('#txtlayerNumber').val(); $scope.terminateCurrentlyRunningWPs(); $timeout(function () { @@ -1967,7 +2064,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var canvasId = (e.data.canvasId).replace('_mci', ''); - //debugger; + //for (var i = 1; i <= updatedData.length; i++) { var grayCanvasID = canvasId; @@ -1978,8 +2075,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo grayCanvasContext.putImageData(updatedData, 0, 0); - - + + //to resolve lateral arm black issue in highlight mode if ($rootScope.viewOrientationId == 5 && (bodyRegionId == 6 || bodyRegionId == 4)) { @@ -2003,7 +2100,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.multiAnnotationIsON == true) { - //debugger; + if (canvasId.match('_MR')) $rootScope.updatedWhiteImageMRDataList[bodyRegionId] = updatedData; else @@ -2052,6 +2149,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $rootScope.updatedGrayDataList = null; // $rootScope.updatedGrayDataList = []; //} + + $scope.layerNumber = $('#txtlayerNumber').val(); + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -2205,7 +2305,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var bodyRegionId = e.data.bodyRegionId; var canvasId = (e.data.canvasId).replace('_mci', ''); - //debugger; + //for (var i = 1; i <= updatedData.length; i++) { var grayCanvasID = canvasId; @@ -2225,7 +2325,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - //debugger; + if (canvasId.match('_MR')) { $rootScope.updatedGrayMRDataList[bodyRegionId] = updatedData; @@ -2257,14 +2357,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } if ($scope.doAligneCanvasWithTerm == true) { - //debugger; - if ( $rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) + + if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + $('#spinner').css('visibility', 'hidden'); - //$rootScope.isHighlightBodyByBodySystem = false; + // $rootScope.isHighlightBodyByBodySystem = false; if ($rootScope.isListManagerSelected == true) $scope.aligneCanvasWithTerm(); @@ -2288,9 +2388,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var multiTermList = []; angular.forEach($rootScope.previousHighlightList, function (value, key) { - - //debugger; - var ActualTermNo = $scope.getActualTermNumber(value); if (ActualTermNo != null) { var TermList = $scope.getTermNumberList(ActualTermNo); @@ -2351,8 +2448,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //get annotation from term number $scope.GetAnnotationText = function (termNumber) { - //debugger; - + var annotationText; //0 var figLeafTermNo = 5868; // to do declare constant for this @@ -2387,8 +2483,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { - // debugger; - + var Annotation; $scope.ActualTermNo = actualTermNo; if ($rootScope.VocabTermData != null || $rootScope.VocabTermData != undefined) { @@ -2416,10 +2511,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //layer change function $scope.LayerChange = function () { - + //if listanager is visisble then close it - // $rootScope.isListManagerSelected = false; - + // $rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); @@ -2435,13 +2530,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; - // debugger; // $('#daLoaderLabel').css('visibility', 'visible'); - if ($scope.isTransparencyActivated) { - + //crete temp canavs to store the original data which will be used to chnange the transparency if (document.getElementById('tempCanvas') != null) { $('#tempCanvas').remove(); @@ -2463,7 +2556,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (document.getElementById('canvasDiv') != null) document.getElementById('canvasDiv').appendChild(tempCanvas); - // //debugger; + var tCanvas = document.getElementById('transparencyCanvas'); var tCanvasContext = tCanvas.getContext('2d'); @@ -2510,7 +2603,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { - + //1. Dated:13-07-2016 Issue #4965 : The layer number should not extend beyond its level through layer text box. var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) { @@ -2542,23 +2635,70 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition) - if ( $rootScope.isHighlightBodyByBodySystem) { + + if ($rootScope.isHighlightBodyByBodySystem) { $timeout(function () { $scope.DisableProgressBar() }, 20000); } - else - { + else { $timeout(function () { $scope.DisableProgressBar() }, 2000); } } $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber)); } + $rootScope.PreviouslayerNumbr = 0; + $scope.LayerChangeOnMouseUpDown = function (e) { + //'x' button is displaying inside the input box in IE browser. + + if (e.currentTarget.id == "incrmntVal") { + //Dissectible Anatomy > Inappropriate Text in Layer Input box. + if ($("#txtlayerNumber").val() == '') { + var layerInputVal = 0; + + var layerInputValInc = parseInt(layerInputVal); + $scope.layerNumber = parseInt(layerInputValInc); + $("#txtlayerNumber").val($scope.layerNumber); + // $rootScope.PreviouslayerNumbr = $scope.layerNumber; + + } + else { + var layerInputVal = $("#txtlayerNumber").val(); + if (layerInputVal != $rootScope.totalLayers) { + var layerInputValInc = parseInt(layerInputVal) + 1; + $scope.layerNumber = parseInt(layerInputValInc); + $("#txtlayerNumber").val($scope.layerNumber); + $rootScope.PreviouslayerNumbr = $scope.layerNumber; + } - $scope.LayerChangeOnMouseUpDown = function (e) - { - - $scope.LayerChange(); + } + + } + else { + //Dissectible Anatomy > Inappropriate Text in Layer Input box. + if ($("#txtlayerNumber").val() == '') { + var layerInputVal = 0; + var layerInputValDec = parseInt(layerInputVal); + $scope.layerNumber = parseInt(layerInputValDec); + $("#txtlayerNumber").val($scope.layerNumber); + // $rootScope.PreviouslayerNumbr = $scope.layerNumber; + + } + else + { + var layerInputVal = $("#txtlayerNumber").val(); + if (layerInputVal > 0) { + var layerInputValDec = parseInt(layerInputVal) - 1; + $scope.layerNumber = parseInt(layerInputValDec); + $("#txtlayerNumber").val($scope.layerNumber); + $rootScope.PreviouslayerNumbr = $scope.layerNumber; + } + } + + } + $scope.LayerChange(); + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); } @@ -2594,6 +2734,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } console.log('highLightBody call from DisableProgressBar') + // $scope.highLightBody(); @@ -2633,6 +2774,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationForTBox) { + //debugger; if (isAnnotationForTBox == true) { //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that // we decide the size of speech bubble @@ -2691,7 +2833,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('.dynCross').on('click', function (evt) { - $(this).parent().parent().parent().css('display', 'none'); + //$(this).parent().parent().parent().css('display', 'none'); + $(this).parent().parent().parent().remove(); }); @@ -2700,12 +2843,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo else { $scope.multiAnnotationIsON = false; + + //$(".com").css("display", "none"); + //$("#bord").css({ "width": "0px", "display": "none" }); + $(".com").remove(); + $("#bord").remove(); - $(".com").css("display", "none"); - $("#bord").css({ "width": "0px", "display": "none" }); var sppechBubbleDotHTML = '' - + '