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 4f69431..4436eba 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; + + $scope.selectedCIListViewData = new jinqJs() + .from($scope.IllustrationData.root.CIData) + .orderBy([{ field: '_Title', sort: 'asc' }]) + .select(); + + }, + function (error) { + // handle errors here + console.log(' $scope.IllustrationData = ' + error.statusText); + } + ); + + + }; + + $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; - $('#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; + 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'); + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); - $compile($el)($scope); + $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); + } + 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); + } + else { + localStorage.setItem("CICurImageType", ''); } - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { + + 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(); - 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.selectedCIListViewData, 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.selectedorientation) !== "undefined" && query.selectedorientation !== null) { - var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); - if (posorientation > -1) { - count = count + 1; - selectimg = true; + 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; - } + } + 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; + 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.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.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { + var posimagetype = value._ImageType.indexOf(query.selectedimagetype); + if (posimagetype > -1) { + count = count + 1; + selectimg = true; - if (selectimg === true && count >= filtercount) { + } else { + selectimg = false; + count = count - 1; + } + } - $scope.imagePath = "~/../content/images/ci/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/ci/thumbnails/" + value._ThumbnailImage; + var $el = $('
' + + '
' + + '' + + '

' + value._Title + '

').appendTo('#grid-view'); - $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 - }); + $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 - //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 () { @@ -406,23 +528,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', @@ -444,8 +549,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 }, }); @@ -458,25 +561,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 9600b9d..06f82f9 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; + } @@ -1505,7 +1507,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } if ($scope.isEligibleForHighlight == true) { - 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) { + 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'); @@ -1824,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)) { @@ -1853,10 +1864,17 @@ 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)) || $scope.isExtract == true || $rootScope.isHighlightBodyByBodySystem == 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'); @@ -2625,30 +2643,55 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#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; + } - var layerInputVal = $("#txtlayerNumber").val(); - if (layerInputVal != $rootScope.totalLayers) { - var layerInputValInc = parseInt(layerInputVal) + 1; - $scope.layerNumber = parseInt(layerInputValInc); - $("#txtlayerNumber").val($scope.layerNumber); } } else { - var layerInputVal = $("#txtlayerNumber").val(); - if (layerInputVal > 0) { - var layerInputValDec = parseInt(layerInputVal) - 1; + //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(); @@ -4857,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) { @@ -5160,6 +5207,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } + // #7972 Mozilla Firefox> Incorrect navigation + $("#canvasDiv").scroll(function (event) { + $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop(); + $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft(); + + }); + + + $scope.enableExtract = function (isCalledFromButton) { console.log('isCalledFromButton= ' + isCalledFromButton); @@ -5607,6 +5663,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo context.putImageData(DAData.data, 0, 0) + + //NIKI- to resolve lateral arm black issue in mode + + if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) { + + var imgData = context.getImageData(0, 0, width, ht); + var data = imgData.data; + var c = 0; + for (var i = 0; i < data.length; i += 4) { + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { + data[i + 3] = 0; + } + + } + context.putImageData(imgData, 0, 0); + } + + var grayImageData = context.getImageData(0, 0, width, ht); var grayImageImageDataVar = grayImageData.data; @@ -6709,6 +6783,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo x: $scope.offsetX1, y: $scope.offsetY1, width: $scope.x - $scope.offsetX1, height: $scope.y - $scope.offsetY1, + add: function (layer) { + + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + + }, click: function (layer) { $rootScope.canvasLayerNameCollection = []; @@ -6725,6 +6804,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }).drawLayers(); }, + dblclick: function (layer) { + + + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); + $("#annotationTextModal").modal("toggle"); + + $("#text_area").val(''); + $("#text_area").css({ " font-family": "'Verdana, sans-serif'", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); + + + $("#text-italic").removeClass("ActiveFormattingButtonClass"); + + $("#text-bold").removeClass("ActiveFormattingButtonClass"); + + $("#text-underline").removeClass("ActiveFormattingButtonClass"); + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").removeClass("ActiveFormattingButtonClass"); + + }, mouseout: function (layer) { $rootScope.canvasLayerNameCollection = []; $('#canvas').setLayer(layer.name, { @@ -6759,25 +6861,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#annotationTextModal").modal("toggle"); $('.btnCursor').trigger('click'); - + $("#text_area").val(''); - + $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); - - $("#text-italic").removeClass("ActiveFormattingButtonClass"); - - $("#text-bold").removeClass("ActiveFormattingButtonClass"); - - $("#text-underline").removeClass("ActiveFormattingButtonClass"); - - $("#text-left").removeClass("ActiveFormattingButtonClass"); - - $("#text-right").removeClass("ActiveFormattingButtonClass"); - - $("#text-center").removeClass("ActiveFormattingButtonClass"); - + + $("#text-italic").removeClass("ActiveFormattingButtonClass"); + + $("#text-bold").removeClass("ActiveFormattingButtonClass"); + + $("#text-underline").removeClass("ActiveFormattingButtonClass"); + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").removeClass("ActiveFormattingButtonClass"); + $(".btn-annotation").removeClass("activebtncolor"); - + $('.btnCursor').addClass('activebtncolor'); break; @@ -6811,6 +6913,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.saveText = function () { + // this part will work first time when save button will be clicked if ($rootScope.IsTextAlreadySave == false) { // getting textarea style properties @@ -6832,9 +6935,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#canvas').drawText({ layer: true, draggable: true, - name: 'TextArea_' + $rootScope.resetText, - groups: ['TextArea_' + $rootScope.resetText], - dragGroups: ['TextArea_' + $rootScope.resetText], + name: 'TextAreaNew_' + $rootScope.resetText, + groups: ['TextAreaNew_' + $rootScope.resetText], + dragGroups: ['TextAreaNew_' + $rootScope.resetText], fillStyle: $rootScope.fontColor, fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle, fontSize: $rootScope.fontSizes, @@ -6842,10 +6945,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo align: $rootScope.textAlignmt, strokeWidth: 0, text: $rootScope.textArea, - x: $scope.offsetX1, y: $scope.offsetY1, - maxWidth: $scope.x - $scope.offsetX1, - maxHeight: $scope.y - $scope.offsetY1, + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, + maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, + maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, add: function (layer) { + // alert(layer.maxWidth); $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText }); } @@ -6855,20 +6959,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo name: 'TextArea1_' + $rootScope.resetText, layer: true, draggable: true, - groups: ['TextArea_' + $rootScope.resetText], - dragGroups: ['TextArea_' + $rootScope.resetText], + groups: ['TextAreaNew_' + $rootScope.resetText], + dragGroups: ['TextAreaNew_' + $rootScope.resetText], opacity: $rootScope.shapestyleOpacity, strokeStyle: $rootScope.shapestyleborderColor, strokeWidth: $rootScope.shapestyleborderWidth, - x: $scope.offsetX1, y: $scope.offsetY1, - width: $scope.x - $scope.offsetX1, - height: $scope.y - $scope.offsetY1, + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, + width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, + height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, click: function (layer) { $rootScope.shapeTypeText = "textAreaRect"; var layerNameSplit = layer.name; var splitedName = layerNameSplit.split("_"); - var textValName = "TextArea_"; + var textValName = "TextAreaNew_"; var concatinateResult = textValName.concat(splitedName[1]); $rootScope.canvasLayerNameCollection = []; $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); @@ -6884,13 +6988,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }).drawLayers(); }, dblclick: function (layer) { + + $rootScope.isTextAreaClosedButtonActive = false; $rootScope.IsTextAlreadySave = true; var _rectLayerOnSave = layer.name; var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); - var TextAreaRectName = "TextArea_"; + var TextAreaRectName = "TextAreaNew_"; var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]); - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated }); + + $rootScope.layerNameArr = layer.name; + $rootScope.rectTextArr = TextAreaRectNameConcatenated; + // $rootScope.modifySavedText.push({ TextName: '', RectText: ''}); + // $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated }); + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); var _rectLayerOnSaveSplitInt; //if (_rectLayerOnSaveSplit[1] >= 3) @@ -6899,11 +7010,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); + var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1; $("#text_area").val(b); var fontStyleProp = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle; - var fontWeightProp = fontStyleProp.split(" "); - + var fontWeightProp = fontStyleProp.split(" "); + $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize); $("#text_area").css("font-weight", fontWeightProp[0]); $("#text_area").css("font-style", fontWeightProp[1]); @@ -6916,96 +7028,89 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //adding text text decoration active class in text edit pop-up - - if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration == "underline") { - - $("#text-underline").addClass("ActiveFormattingButtonClass"); - - } - - else { - - $("#text-underline").removeClass("ActiveFormattingButtonClass"); - - } - - - //adding text font weight active class in text edit pop-up - - if (fontWeightProp[0] == 700) { - - - - $("#text-bold").addClass("ActiveFormattingButtonClass"); - - } - - else - - { - - $("#text-bold").removeClass("ActiveFormattingButtonClass"); - + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration == "underline") { + + $("#text-underline").addClass("ActiveFormattingButtonClass"); + } - - //adding text font style active class in text edit pop-up - - if (fontWeightProp[1] == "italic") { - - - $("#text-italic").addClass("ActiveFormattingButtonClass"); - } - else - - { - $("#text-italic").removeClass("ActiveFormattingButtonClass"); - - - } - + else { - - //adding text alignment active class in text edit pop-up - - if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") { - - $("#text-right").removeClass("ActiveFormattingButtonClass"); - - $("#text-center").removeClass("ActiveFormattingButtonClass") - - $("#text-left").addClass("ActiveFormattingButtonClass"); - - } - - else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") { + $("#text-underline").removeClass("ActiveFormattingButtonClass"); + } - $("#text-center").removeClass("ActiveFormattingButtonClass") - $("#text-left").removeClass("ActiveFormattingButtonClass"); + //adding text font weight active class in text edit pop-up - $("#text-right").addClass("ActiveFormattingButtonClass"); + if (fontWeightProp[0] == 700) { - } + $("#text-bold").addClass("ActiveFormattingButtonClass"); - else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") { + } - $("#text-left").removeClass("ActiveFormattingButtonClass"); + else { - $("#text-right").removeClass("ActiveFormattingButtonClass"); + $("#text-bold").removeClass("ActiveFormattingButtonClass"); - $("#text-center").addClass("ActiveFormattingButtonClass"); + } + //adding text font style active class in text edit pop-up + if (fontWeightProp[1] == "italic") { + + + $("#text-italic").addClass("ActiveFormattingButtonClass"); + } + else { + $("#text-italic").removeClass("ActiveFormattingButtonClass"); + + + } + + //adding text alignment active class in text edit pop-up + + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") { + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").removeClass("ActiveFormattingButtonClass") + + $("#text-left").addClass("ActiveFormattingButtonClass"); + + } + + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") { + + + + $("#text-center").removeClass("ActiveFormattingButtonClass") + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").addClass("ActiveFormattingButtonClass"); + + + + } + + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") { + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").addClass("ActiveFormattingButtonClass"); + + + + } - } - _rectLayerOnSaveSplitInt = ''; b = ''; $("#annotationTextModal").modal("toggle"); }, @@ -7041,22 +7146,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#text-italic").removeClass("ActiveFormattingButtonClass"); - - $("#text-bold").removeClass("ActiveFormattingButtonClass"); - - $("#text-underline").removeClass("ActiveFormattingButtonClass"); - - $("#text-left").removeClass("ActiveFormattingButtonClass"); - - $("#text-right").removeClass("ActiveFormattingButtonClass"); - - $("#text-center").removeClass("ActiveFormattingButtonClass"); + + $("#text-bold").removeClass("ActiveFormattingButtonClass"); + + $("#text-underline").removeClass("ActiveFormattingButtonClass"); + + $("#text-left").removeClass("ActiveFormattingButtonClass"); + + $("#text-right").removeClass("ActiveFormattingButtonClass"); + + $("#text-center").removeClass("ActiveFormattingButtonClass"); } // this part will work second time when save button will be clicked else { + // getting textarea style properties var _modifiedText = $("#text_area").val(); var _modifiedFontSize = $("#text_area").css("font-size"); @@ -7068,8 +7174,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var _modifiedFontDecoration = $("#text_area").css("text-decoration"); // deleting previous textarea - $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers(); - $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers(); + + // var a = $rootScope.modifySavedTextIndexNumber; + // alert(a); + // alert($rootScope.modifySavedText.length); + // alert($rootScope.modifySavedText[a].RectText); + + $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers(); + $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers(); + $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++; $rootScope.resetTextSave = $rootScope.ObjectIndexSave++; @@ -7128,12 +7241,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }, dblclick: function (layer) { + $rootScope.isTextAreaClosedButtonActive = false; $rootScope.IsTextAlreadySave = true; var _rectLayerOnSave = layer.name; var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); var RectNameAfterEdit = "TextAreaAfterEdit_"; var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]); - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult }); + $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1]; + + + + // $rootScope.modifySavedText.push({ TextName: '', RectText: '' }); + // $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult }); + + $rootScope.layerNameArr = layer.name; + $rootScope.rectTextArr = RectNameAfterEditResult; + + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); $("#text_area").val(_modifiedText); $("#text_area").css("font-size", _modifiedFontSize); @@ -7196,9 +7320,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - - - $("#annotationTextModal").modal("toggle"); }, mouseout: function (layer) { @@ -7228,7 +7349,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } }); - $rootScope.modifySavedText = []; + // $rootScope.modifySavedText = []; } } @@ -7236,8 +7357,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // deleting text area on close button $rootScope.closeModal = function () { - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); + + if ($rootScope.isTextAreaClosedButtonActive == true) { + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); + + } } @@ -8244,15 +8369,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }); } - + $scope.LayerChangeBasedOnKeyPressed = function (e) { - + // Dissectible Anatomy > Should not display blank page if no layer is selected. + + if (e.keyCode == 13) { - $scope.LayerChange(); + + if ($("#txtlayerNumber").val() == '') + { + + $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr); + } + else + { + $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val(); + $scope.LayerChange(); + } + + } // 'x' button is displaying inside the input box in IE browser. - if (e.which == 38) { + if (e.keyCode == 38) { var layerInputVal = $("#txtlayerNumber").val(); @@ -8260,26 +8399,55 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var layerInputValInc = parseInt(layerInputVal) + 1; $scope.layerNumber = parseInt(layerInputValInc); $("#txtlayerNumber").val($scope.layerNumber); + $rootScope.PreviouslayerNumbr = $scope.layerNumber; } } // 'x' button is displaying inside the input box in IE browser. - if (e.which == 40) { + if (e.keyCode == 40) { 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.LayerValueChangeBasedOnKeyUp = function (e) { + + var keyUplayerNumber = parseInt($("#txtlayerNumber").val()); + + if (isNaN(keyUplayerNumber)) + { + + } + else { + + if (keyUplayerNumber > $rootScope.totalLayers) { + + $("#txtlayerNumber").val($rootScope.totalLayers); + $scope.layerNumber = parseInt($rootScope.totalLayers); + + } + else { + + $("#txtlayerNumber").val(keyUplayerNumber); + $scope.layerNumber = parseInt(keyUplayerNumber); + + + } + + } + + + } + }] diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 01931ea..78016f3 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.CIAnotationIdentifyModeOff = false; $rootScope.OnIdentifyClick = function () { + + $("#OnIdentify").addClass("annotationtoolbartab"); + $("#DrawMode").removeClass("annotationtoolbartab"); // $rootScope.isIdetifyClicked = true; // $rootScope.isDrawingToolSelected = false; // debugger; @@ -163,7 +170,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"); @@ -376,7 +384,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", // $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); //Edit Shape Style popup should open at it's default position - $("#modeleditstyle").css({ "left": "0", "right": "0", "margin": "0 auto", "top":"70px"}); + $("#modeleditstyle").css({ "left": "40%", "right": "0", "top":"70px"}); } @@ -415,7 +423,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", document.getElementById('modelbackground').style.display = "none"; document.getElementById('modeleditstyle').style.display = "none"; //Edit Shape Style popup should open at it's default position - $("#modeleditstyle").css({"left":"0", "right":"0", "margin":"0 auto", "top":"70px"}); + $("#modeleditstyle").css({"left":"40%", "right":"0", "top":"70px"}); } 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/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index e309d6a..4a2c408 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -253,7 +253,7 @@
- +
@@ -427,7 +427,11 @@ && e.which != 8 // backspace && e.which != 46 // delete && (e.which < 37 // arrow keys - || e.which > 40)) { + || e.which > 40) + && (e.keyCode < 96 // Dissectible Anatomy > Num Lock is not working for enter the layer. + || e.keyCode > 105)) + + { e.preventDefault(); return false; } 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/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 5902108..a274489 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1,7 +1,7 @@  - + @@ -605,8 +605,9 @@
@@ -734,7 +735,7 @@ -
+