From 74b4c993a1dcff1610c8e25db8e0b1a25a932de4 Mon Sep 17 00:00:00 2001 From: Mukul Date: Mon, 9 Oct 2017 15:57:17 +0530 Subject: [PATCH] this is revert back of Tileviewcontroller and Tileviewhml with version 77 --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------ 400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html | 136 +++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------- 2 files changed, 124 insertions(+), 139 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index d174efb..a834dc1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -10,7 +10,6 @@ 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 = []; @@ -49,8 +48,61 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } else { + $('#grid-view').css("display", "none"); - $('#list-view').css("display", "block"); + 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); } }; @@ -74,6 +126,7 @@ 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'); @@ -82,6 +135,7 @@ 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) { @@ -89,7 +143,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) { @@ -99,19 +153,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); //0. Get selected Image Id if ($scope.isListViewButtonClicked == true) { if ($scope.isOpenBtnClicked == true) { - var moduleItemDataToBeSaved = $("#demoText").text().trim(); + var moduleItemDataToBeSaved = $("#demoText").html(); $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().trim(); + var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); } } else { @@ -129,7 +184,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]); @@ -139,6 +194,7 @@ 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'); + } @@ -150,7 +206,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou 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().trim(); + var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; $rootScope.listArray = []; @@ -160,6 +216,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.openModuleItem = function () { + if ($rootScope.refreshcheck == null) { $location.path('/'); } @@ -219,7 +276,9 @@ 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); @@ -256,8 +315,10 @@ 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(); } @@ -275,12 +336,14 @@ 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"); } + } } @@ -310,7 +373,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.allPinDataArray = []; var promise = ModuleService.getPinDataForImage($rootScope.imageName) - .then( function (result) { @@ -333,9 +395,6 @@ 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(); } @@ -356,11 +415,10 @@ 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'); + $scope.moduleId = moduleId; + console.log('loadForModuleById is called') $rootScope.moduleName = Modules[moduleId].Name; while ($scope.searchAAListViewData.length) { $scope.searchAAListViewData.pop(); @@ -469,11 +527,12 @@ 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'); @@ -488,7 +547,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, @@ -500,28 +559,29 @@ 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/ ListView [if no data is found] + //Show Error Message in case of gridview 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('SearchAAListViewData--' + $scope.searchAAListViewData); + console.log(JSON.stringify(result, null, 4)); }, function (error) { // handle errors here console.log(' error: ' + error.statusText); } ) + } $scope.Reset = function (moduleId, query) { @@ -545,8 +605,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#ListViewDiv').scrollTop(0); - if ($('#demoView').length > 0) - $('#demoView').remove(); // $scope.HideListViewDiv(); $scope.filterstring = false; @@ -560,6 +618,7 @@ 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++) { @@ -1192,6 +1251,7 @@ 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]) { @@ -1203,9 +1263,7 @@ 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 () { @@ -1266,6 +1324,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) { + $rootScope.bodySystemSeletedId = bodySystemId; $('#termList').empty(); var bodySystemName = $("#AABodySystems #" + bodySystemId).val(); @@ -1274,6 +1333,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var $selectedOptions = $('').appendTo("#termList") $compile($selectedOptions)($scope); + } $("#totalTerms").empty(); $("#totalTerms").html("" + $("#termList option").length + " Structures"); @@ -1370,7 +1430,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showAllPinsAfterHide = function (event) { - $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1400,6 +1459,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showSelectedPins = function () { + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1435,7 +1495,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } - }; @@ -1456,6 +1515,7 @@ 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(); @@ -1463,6 +1523,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#aaDetailViewCanvas').setLayer(pinArcName, { visible: true // set to true instead to show the layer again }).drawLayers(); + + // } }) @@ -1478,8 +1540,10 @@ 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 { @@ -1603,6 +1667,7 @@ 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; @@ -1615,8 +1680,10 @@ 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, @@ -1633,6 +1700,7 @@ 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++) { @@ -1804,7 +1872,6 @@ function openListViewModuleItem(event) { function openCurrentView(event) { var scope = angular.element(document.getElementById("list-view")).scope(); - scope.isListViewButtonClicked = true; scope.isOpenBtnClicked = true; scope.$apply(function () { scope.openModuleItemView(event); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html index 6b8159c..30e034f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html @@ -55,8 +55,8 @@
Search
-
- - + + - \ No newline at end of file + -- libgit2 0.21.4