diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 1d39758..92e6794 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -3808,11 +3808,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }, 1000); } $("#optionsListManagerTab").addClass("active"); - var viewNameAftrSplit = $("#viewName").val().split(" "); - if (viewNameAftrSplit[0] == "null") { - document.location.href = "/"; + var viewNameAftrSplit; + if ($("#viewName").val() !== null) { + viewNameAftrSplit = $("#viewName").val().split(" "); + + if (viewNameAftrSplit[0] == "null") { + document.location.href = "/"; + } } - if ($location.url() == "/module-item-view") { $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onSearchItemSelection(this.options[this.selectedIndex].id)"); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index a834dc1..f28d85a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -10,6 +10,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var CLINICAL_ILLUSTRATION = 'Clinical Illustrations'; var CLINICAL_ANIMATION = 'Clinical Animations'; $rootScope.closeBtnImgPath = "~/../content/images/speeachBubbleClose.png"; + $rootScope.listArray = []; //variables to bind Filter by Controls $scope.searchAAListViewData = []; $scope.SelectedAAthumbImage = []; @@ -48,61 +49,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } else { - $('#grid-view').css("display", "none"); - if ($scope.isListViewDataLoaded == true) { - var promise = ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName) - .then( - function (result) { - // alert(JSON.stringify($scope.moduleLandingData)); - $scope.moduleLandingData = result; - $scope.selectedAAListViewData = new jinqJs() - .from($scope.moduleLandingData.data.root.Item) - .orderBy([{ field: '_Title', sort: 'asc' }]) - .select(); - var htm = ''; - htm += ""; - angular.forEach($scope.selectedAAListViewData, function (value, key) { - htm += "" - htm += ''; - htm += "" - }); - htm += "
Title Region SystemView Type
' + value._Title + '' + value._BodyRegion + '' + value._BodySystem + '' + value._ViewOrientation + '' + value._ImageType + '
"; - $("#list-view").html(htm); - $compile(htm)($scope); - }); - $('#list-view').css("display", "block"); - $scope.isListViewDataLoaded = false; - } - else { - $('#list-view').css("display", "block"); - } - - $timeout(function () { - // if ($rootScope.isListViewRowClicked == true) { - // $rootScope.isListViewRowClicked = false; - $("#demoView").remove(); - $("#viewList").append("
" + $rootScope.listArray[0].text + "
Open
"); - var moduleItemDataToBeSavedID - $("#list-view table tbody tr").removeClass("active"); - var moduleItemDataToBeSavedID = $rootScope.getLocalStorageValue("listViewSelectedID"); - $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active"); - $scope.isListViewButtonClicked = true; - var curAAListViewScroll = $rootScope.getLocalStorageValue("AAListViewScroll"); - - if (typeof (curAAListViewScroll) !== "undefined" && curAAListViewScroll !== null && curAAListViewScroll !== '') { - if (typeof InstallTrigger !== 'undefined') { - - $('#list-view table tbody').animate({ scrollTop: $rootScope.getLocalStorageValue("AAListViewScroll") }); - } - else { - - $('#list-view table tbody').scrollTop($rootScope.getLocalStorageValue("AAListViewScroll")); - } - - } - // } - }, 2000); + $('#list-view').css("display", "block"); } }; @@ -126,7 +74,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.moduleLandingData = result; // setTimeout(function () { $('#' + $rootScope.highlightid).find('.thumbnail').addClass('hightlightstate'); }, 100); - setTimeout(function () { if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); @@ -135,7 +82,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); } }, 100); - //console.log(JSON.stringify(result, null, 4)); }, function (error) { @@ -143,7 +89,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou console.log(' error: ' + error.statusText); } ) - + $('#list-view').css('display', 'none'); } //$scope.$on('$viewContentLoaded', function (event) { @@ -153,20 +99,20 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //}); $scope.isOpenBtnClicked = false; $scope.openModuleItemView = function (event) { - $rootScope.MenuModuleName = "AA"; localStorage.setItem("activeTab", $scope.activeTab); + $scope.isListViewButtonClicked = true; //0. Get selected Image Id if ($scope.isListViewButtonClicked == true) { if ($scope.isOpenBtnClicked == true) { - var moduleItemDataToBeSaved = $("#demoText").html(); + var moduleItemDataToBeSaved = $("#demoText").text().trim(); $scope.isOpenBtnClicked = false; } else { var moduleItemDataToBeSavedID = event.currentTarget.id; localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); - var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); + var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text().trim(); } } else { @@ -184,7 +130,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.bodySystemName = $rootScope.OpenedTileData[2]; $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; $scope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; - $rootScope.listArray = []; + //$rootScope.listArray = []; $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved }); //3. set opened module item ti localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); @@ -194,29 +140,27 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //3. Navigate to the Module-item-view var u = $location.url(); $location.url('/module-item-view'); - } $scope.openListViewModuleItem = function (event) { - + $scope.isListViewButtonClicked = true; $("#demoView").remove(); var moduleItemDataToBeSavedID = event.currentTarget.id; $("#list-view table tbody tr").removeClass("active"); localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID); $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active"); localStorage.setItem("AAListViewScroll", $("#list-view table tbody").scrollTop()); - var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); + var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text().trim(); $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; - $rootScope.listArray = []; + //$rootScope.listArray = []; $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved }); $("#viewList").append("
" + moduleItemDataToBeSaved + "
Open
"); } $scope.openModuleItem = function () { - if ($rootScope.refreshcheck == null) { $location.path('/'); } @@ -276,9 +220,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.imageWidth = this.width; $scope.imageHeight = this.height; - //$('#aaBodyView').css("height", $(window).outerHeight()); - //$('#aaBodyView').css("width", $(window).outerWidth()); $timeout(function () { $compile(aaViewElement.contents())($scope); @@ -315,10 +257,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou canvas.style.position = "absolute"; $("#canvasDiv").append(canvas); $scope.context = canvas.getContext("2d") - //6. Show all pins on AA opened item $scope.showAllPins(); - //7. Highlight all system body list in left side $scope.highlightBodySystemList(); } @@ -336,14 +276,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var bodySystemListObj = document.getElementById("bodySystemList").getElementsByTagName("a"); var bodySystemListlength = bodySystemListObj.length; for (var i = 0; i < bodySystemListlength; i++) { - //var boldTag = lis[i]; for (var j = 0; j < $rootScope.bodySystemNames.length; j++) { if ((bodySystemListObj[i].innerHTML) == ($rootScope.bodySystemNames[j])) { $("#" + i).parent().removeClass("disabledSelectedSystem"); } - } } @@ -373,6 +311,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.allPinDataArray = []; var promise = ModuleService.getPinDataForImage($rootScope.imageName) + .then( function (result) { @@ -395,6 +334,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.allPinDataArray.push(value._PinId); $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) }) + + + //load search/vocab data $rootScope.loadSearchData(); } @@ -415,10 +357,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.FilterByImage = function (moduleId, query) { - $scope.moduleId = moduleId; + $scope.filterstring = true; + + console.log('loadForModuleById is called'); - console.log('loadForModuleById is called') $rootScope.moduleName = Modules[moduleId].Name; while ($scope.searchAAListViewData.length) { $scope.searchAAListViewData.pop(); @@ -527,12 +470,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (selectimg === true && count >= filtercount) { - $scope.imagePath = "../content/images/aa/thumbnails/" + value._TileImageName; - var $el = $('
' - + '
' + var $el = $('').appendTo('#grid-view'); @@ -547,7 +489,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.searchAAListViewData.push( { - "_id": value._id, + "_Id": value._Id, "_ImageId": value._ImageId, "_Title": value._Title, "_ImageName": value._contentImage, @@ -559,29 +501,28 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //"$$hashKey": value._Summary }); - + console.log($scope.searchAAListViewData); + if ($('#searchItem').length > 0) + $('#searchItem').remove(); } - - }); - //Show Error Message in case of gridview if no data is found + //Show Error Message in case of gridview/ ListView [if no data is found] if ($scope.searchAAListViewData.length == 0) { - var $el = $('
No illustration found for the selected search criteria!
').appendTo('#grid-view'); $compile($el)($scope); $('table > #ListViewDiv > #searchItem').remove(); $('#ListViewDiv').append('No illustration found for the selected search criteria!'); } - console.log(JSON.stringify(result, null, 4)); + //console.log(JSON.stringify(result, null, 4)); + console.log('SearchAAListViewData--' + $scope.searchAAListViewData); }, function (error) { // handle errors here console.log(' error: ' + error.statusText); } ) - } $scope.Reset = function (moduleId, query) { @@ -605,6 +546,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#ListViewDiv').scrollTop(0); + if ($('#demoView').length > 0) + $('#demoView').remove(); // $scope.HideListViewDiv(); $scope.filterstring = false; @@ -618,7 +561,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showSelectedSystemPins = function (event) { - var bodySystemListObj = document.getElementById("bodySystemList").getElementsByTagName("a"); var bodySystemListlength = bodySystemListObj.length; for (var i = 0; i < bodySystemListlength; i++) { @@ -1251,7 +1193,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou sortedTermTextArray.sort(); } - for (var i = 0; i <= sortedTermTextArray.length - 1; i++) { for (var j = 0; j <= $scope.matchedLanguageTermData.length - 1; j++) { if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i]) { @@ -1263,7 +1204,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) { + if (($('#termlistfilter').html() != "")) + $('#termlistfilter').empty(); if ($scope.pinTermData.length > 0) { $timeout(function () { @@ -1303,7 +1246,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.$on('listManagerEvent', function (event, data) { $("#viewName").empty(); - $("#viewName").append(""); + + var currentView = $rootScope.getLocalStorageValue("currentViewTitle"); + var viewNmeHtml = '' + $('#viewName').append(viewNmeHtml); + //$("#viewName").append(""); $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); @@ -1324,7 +1271,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) { - $rootScope.bodySystemSeletedId = bodySystemId; $('#termList').empty(); var bodySystemName = $("#AABodySystems #" + bodySystemId).val(); @@ -1333,7 +1279,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var $selectedOptions = $('').appendTo("#termList") $compile($selectedOptions)($scope); - } $("#totalTerms").empty(); $("#totalTerms").html("" + $("#termList option").length + " Structures"); @@ -1430,6 +1375,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showAllPinsAfterHide = function (event) { + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1459,7 +1405,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showSelectedPins = function () { - $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1495,6 +1440,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } + }; @@ -1515,7 +1461,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var pinName = 'Pin_' + value1.id; var pinArcName = 'PinArc_' + value1.id; - $('#aaDetailViewCanvas').setLayer(pinName, { visible: true // set to true instead to show the layer again }).drawLayers(); @@ -1523,8 +1468,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#aaDetailViewCanvas').setLayer(pinArcName, { visible: true // set to true instead to show the layer again }).drawLayers(); - - // } }) @@ -1540,10 +1483,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#aaDetailViewCanvas').setLayer(pinArcName, { visible: false // set to true instead to show the layer again }).drawLayers(); - }) - } else { @@ -1667,7 +1608,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#" + $rootScope.annotationArray[i].speechBuubleId).css("display", "none"); $("#" + $rootScope.annotationArray[i].speechBubbleLineId).css("display", "none"); } - } else { $rootScope.isShowHideButtonClicked = true; @@ -1680,10 +1620,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#comment-box").addClass("btn-black"); } - } $scope.activePinOnLayerChange = function () { - for (var i = 0; i <= $scope.activePinArray.length - 1; i++) { var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ x1: 50, y1: 50, @@ -1700,7 +1638,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } - $scope.activePinOnSliderChange = function () { if ($scope.activePinArray.length == 1) { for (var i = 0; i <= $scope.allPinDataArray.length - 1; i++) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html index 30e034f..3999df1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html @@ -1,4 +1,4 @@ -
+
@@ -55,8 +55,8 @@
Search
- - + @@ -96,31 +96,113 @@
-
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TitleRegionSystemViewType
+ {{val._Title}} + + {{val._BodyRegion}} + + {{val._BodySystem}} + + {{val._ViewOrientation}} + + {{val._ImageType}} +
+ {{item._Title}} + + {{item._BodyRegion}} + + {{item._BodySystem}} + + {{item._ViewOrientation}} + + {{item._ImageType}} +
+ +
+
+
+
+ +
+
+
+

+ +
+
+ +
+
+
+
+ - - + + //alert("side bar DA page"); + }); + })(jQuery); + + \ No newline at end of file