From 43fbaf7767a7db0e8ec18055b596d1112084dad8 Mon Sep 17 00:00:00 2001 From: Utkarsh Singh Date: Tue, 29 Aug 2017 12:08:23 +0530 Subject: [PATCH] Committing updated code --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 613 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html | 4 ++-- 2 files changed, 256 insertions(+), 361 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 0fd1819..a3fc2ba 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -36,24 +36,22 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.activePinArray = []; $scope.showTabButton = true; $scope.isListViewDataLoaded = true; - $rootScope.myModuleId = 1; + $scope.setActiveTab = function (tabToSet) { - + $scope.activeTab = tabToSet; - $rootScope.myModuleId = $scope.activeTab; localStorage.setItem("activeTab", $scope.activeTab); if ($scope.activeTab == 1) { - $('#grid-view').css("display","block"); + $('#grid-view').css("display", "block"); $('#list-view').css("display", "none"); $("#demoView").remove(); } - else - { - + else { + $('#grid-view').css("display", "none"); if ($scope.isListViewDataLoaded == true) { var htm = ''; - htm += ""; + htm += "
Titlemukul Region SystemView Type
"; $.ajax({ url: '~/../content/data/json/aa/aa_dat_contentlist.json', dataType: "json", @@ -72,11 +70,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#list-view').css("display", "block"); $scope.isListViewDataLoaded = false; } - else - { + else { $('#list-view').css("display", "block"); } - + $timeout(function () { // if ($rootScope.isListViewRowClicked == true) { // $rootScope.isListViewRowClicked = false; @@ -104,9 +101,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }, 2000); } }; - + $scope.loadForModuleById = function (moduleId) { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } $scope.moduleId = moduleId; $scope.activeTab = 1; console.log('loadForModuleById is called') @@ -121,7 +120,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou function (result) { $scope.moduleLandingData = result; - // setTimeout(function () { $('#' + $rootScope.highlightid).find('.thumbnail').addClass('hightlightstate'); }, 100); + // setTimeout(function () { $('#' + $rootScope.highlightid).find('.thumbnail').addClass('hightlightstate'); }, 100); if (localStorage.getItem('AAGridViewHighlightThumbnail') !== null) { setTimeout(function () { $('#' + localStorage.getItem("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); }, 100); } @@ -145,11 +144,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.isOpenBtnClicked = false; $scope.openModuleItemView = function (event) { $rootScope.MenuModuleName = "AA"; - localStorage.setItem("activeTab", $scope.activeTab); + localStorage.setItem("activeTab", $scope.activeTab); //0. Get selected Image Id if ($scope.isListViewButtonClicked == true) { if ($scope.isOpenBtnClicked == true) { - + var moduleItemDataToBeSaved = $("#demoText").html(); $scope.isOpenBtnClicked = false; } @@ -159,13 +158,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); } } - else - { + else { var moduleItemDataToBeSaved = event.target.id; localStorage.setItem("listViewSelectedID", event.currentTarget.id); $scope.isListViewButtonClicked = false; } - + //1.Filter selected module ietem data and get the pushed opened moduile array object $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); @@ -181,7 +179,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); - + //3. Navigate to the Module-item-view var u = $location.url(); $location.url('/module-item-view'); @@ -189,7 +187,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.openListViewModuleItem = function (event) { - + $("#demoView").remove(); var moduleItemDataToBeSavedID = event.currentTarget.id; $("#list-view table tbody tr").removeClass("active"); @@ -206,7 +204,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.openModuleItem = function () { - + if ($rootScope.refreshcheck == null) { + $location.path('/'); + } var jsContentURL; var moduleItemViewDivId; @@ -256,7 +256,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var openedImage = new Image(); openedImage.id = 'modItemImage'; openedImage.name = $rootScope.OpenItemImagePath; - + openedImage.onload = function () { $scope.imageWidth = this.width; $scope.imageHeight = this.height; @@ -268,7 +268,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (document.getElementById('aaDetailPageDiv') != null) { //0.4 added some stylesheets - + $rootScope.canvasDivHeight = $('.jsPanel-content').height() - $('.main2 .stickey-area').height(); $('.canvasDivClass').css("height", $rootScope.canvasDivHeight); @@ -328,7 +328,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou return true; } - + angular.element(document).ready(function (e) { $("#ImagePanel").resize(function () { $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); @@ -340,12 +340,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.selectedBodySystemName = 'All'; $rootScope.selectedBodySystemId = 0; $rootScope.searchSelectedText = ''; - + }); }) $scope.showAllPins = function () { - + var promise = ModuleService.getPinDataForImage($rootScope.imageName) .then( @@ -386,135 +386,18 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $timeout(function () { $scope.activePinOnLayerChange(); }, 1000); - + } } - //$scope.FilterByImage = function (query) { - // alert("$rootScope.moduleId" + $rootScope.myModuleId); - // //alert(JSON.stringify(query)); - // // $scope.moduleId = moduleId; - // if ($rootScope.myModuleId == 2) { - // $('#grid-view').css("display", "none"); - - // if ($scope.isListViewDataLoaded == false) { - // $rootScope.selectedbodyregion = query.selectedbodyregion; - // $rootScope.selectedbodysystem = query.selectedbodysystem; - // alert($rootScope.selectedbodyregion); - // alert($rootScope.selectedbodysystem); - // 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) - // .where('_BodyRegion = ' + $rootScope.selectedbodyregion, '_BodySystem = ' + $rootScope.selectedbodysystem) - // .orderBy([{ field: '_Title', sort: 'asc' }]) - // .select(); - // var htm = ''; - // htm += "
Title Region SystemView Type
"; - // 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); - - - - // // $(result.root.Item).each(function (key, value) { - // // console.log(key + " " + value); - // // htm += "" - // // htm += '' + value._Title + '' + value._BodyRegion + '' + value._BodySystem + '' + value._ViewOrientation + '' + value._ImageType + ''; - // // htm += "" - // // }); - // // htm += ""; - // // $("#list-view").html(htm); - // // $compile(htm)($scope); - // }); - - // $('#list-view').css("display", "block"); - // $scope.isListViewDataLoaded = false; - // } - // } - //} - $scope.FilterByImage = function (query) { - alert("$rootScope.moduleId" + $rootScope.myModuleId); - //alert(JSON.stringify(query)); - // $scope.moduleId = moduleId; - if ($rootScope.myModuleId == 2) { - $('#grid-view').css("display", "none"); - - if ($scope.isListViewDataLoaded == false) { - $rootScope.selectedbodyregion = query.selectedbodyregion; - $rootScope.selectedbodysystem = query.selectedbodysystem; - alert($rootScope.selectedbodyregion); - alert($rootScope.selectedbodysystem); - var promise = ModuleService.loadModuleDataBasedOnModuleName($scope.moduleName) - .then( - function (result) { - // alert(JSON.stringify($scope.moduleLandingData)); - $scope.moduleLandingData = result; - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { - } - else { - - } - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { - } - else { - } if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { - } - else - { - } - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { - } - else - { + $scope.FilterByImage = function (moduleId, query) { + //alert(JSON.stringify(query)); + $scope.moduleId = moduleId; - } - $scope.selectedAAListViewData = new jinqJs() - .from($scope.moduleLandingData.data.root.Item) - .where('_BodyRegion = ' + $rootScope.selectedbodyregion, '_BodySystem = ' + $rootScope.selectedbodysystem) - .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); - - - - // $(result.root.Item).each(function (key, value) { - // console.log(key + " " + value); - // htm += "" - // htm += '' + value._Title + '' + value._BodyRegion + '' + value._BodySystem + '' + value._ViewOrientation + '' + value._ImageType + ''; - // htm += "" - // }); - // htm += ""; - // $("#list-view").html(htm); - // $compile(htm)($scope); - }); - - $('#list-view').css("display", "block"); - $scope.isListViewDataLoaded = false; - } - } console.log('loadForModuleById is called') - $rootScope.moduleName = Modules[$rootScope.myModuleId].Name; + $rootScope.moduleName = Modules[moduleId].Name; while ($scope.searchAAListViewData.length) { $scope.searchAAListViewData.pop(); } @@ -622,17 +505,30 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if (selectimg === true && count >= filtercount) { + if ($scope.activeTab == 1) { + $scope.imagePath = "../content/images/aa/thumbnails/" + value._TileImageName; - $scope.imagePath = "../content/images/aa/thumbnails/" + value._TileImageName; - var $el = $('
' + '
' + '' + '

' + value._Title + '

').appendTo('#grid-view'); - - $compile($el)($scope); + + $compile($el)($scope); + } + else { + 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); + } $(".sidebar").mCustomScrollbar({ autoHideScrollbar: true, @@ -660,11 +556,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }); - //Show Error Message in case of gridview if no data is found - if ($scope.searchCIListViewData.length == 0) { - + //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)); }, @@ -676,7 +574,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } - $scope.Reset = function (query) { + $scope.Reset = function (moduleId, query) { query.selectedbodyregion = ""; query.selectedbodysystem = ""; @@ -704,7 +602,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou // $scope.searchCIListViewData.pop(); //} - $scope.FilterByImage(query); + $scope.FilterByImage(1, query); } @@ -725,7 +623,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou else { $scope.showAllPins(); } - } + } else { $scope.selectedSystemName = event.currentTarget.title; @@ -1044,8 +942,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if ($scope.sliderVal == 25) { document.getElementById('speechBubbleLine' + PinId + '').style.top = ((speechBubbleDims[0].currentY + 5)) + 'px'; } - else - { + else { document.getElementById('speechBubbleLine' + PinId + '').style.top = ((speechBubbleDims[0].currentY)) + 'px'; } document.getElementById('speechBubble' + PinId + '').style.display = 'block'; @@ -1148,7 +1045,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou else { $("#speechBubbleDraggedLine" + id).css({ 'display': 'block', 'width': d + 'px', 'top': (e - 10) + 'px', 'left': (f - 5) + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); } - + } else { $("#bord_annotation").css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); @@ -1161,118 +1058,118 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.drawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) { $scope.clickedPins = []; - // if ($scope.isSliderChange == true) { - console.log('isSliderrChange') - var radial = $('#' + canvasId).createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(216, 216, 216)' - }); - $('#' + canvasId).drawLine({ - layer: true, - name: "Pin_" + PinId, - groups: ["Pin_" + PinId], - strokeStyle: '#565656', - strokeWidth: 2, - visible: true, - x1: offsetX1 * $scope.sliderPercentValue, y1: offsetY1 * $scope.sliderPercentValue, - x2: x * $scope.sliderPercentValue, y2: y * $scope.sliderPercentValue, - - - }).drawArc({ - name: "PinArc_" + PinId, - layer: true, - groups: ["Pin_" + PinId], - strokeStyle: 'grey', - strokeWidth: 2, - visible: true, - fillStyle: radial, - x: x * $scope.sliderPercentValue, y: y * $scope.sliderPercentValue, - radius: 5 * $scope.sliderPercentValue, + // if ($scope.isSliderChange == true) { + console.log('isSliderrChange') + var radial = $('#' + canvasId).createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(216, 216, 216)' + }); + $('#' + canvasId).drawLine({ + layer: true, + name: "Pin_" + PinId, + groups: ["Pin_" + PinId], + strokeStyle: '#565656', + strokeWidth: 2, + visible: true, + x1: offsetX1 * $scope.sliderPercentValue, y1: offsetY1 * $scope.sliderPercentValue, + x2: x * $scope.sliderPercentValue, y2: y * $scope.sliderPercentValue, + + + }).drawArc({ + name: "PinArc_" + PinId, + layer: true, + groups: ["Pin_" + PinId], + strokeStyle: 'grey', + strokeWidth: 2, + visible: true, + fillStyle: radial, + x: x * $scope.sliderPercentValue, y: y * $scope.sliderPercentValue, + radius: 5 * $scope.sliderPercentValue, + + click: function (clickedPin) { + if (clickedPin.event.ctrlKey == false) { + $scope.clickedPins = []; + } + var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); + var pinData = new jinqJs() + .from($scope.aaPinData) + .where("_PinId == " + pinID) + .select(); - click: function (clickedPin) { - if (clickedPin.event.ctrlKey == false) { - $scope.clickedPins = []; - } - var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); - var pinData = new jinqJs() - .from($scope.aaPinData) - .where("_PinId == " + pinID) - .select(); + var pinTermNumber = pinData[0]._TermId; - var pinTermNumber = pinData[0]._TermId; + var pinWithSameTerm = new jinqJs() - var pinWithSameTerm = new jinqJs() + .from($scope.aaPinData) + .where("_TermId == " + pinTermNumber) + .select(); - .from($scope.aaPinData) - .where("_TermId == " + pinTermNumber) - .select(); + if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) { - if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) { + for (var i = 0; i < pinWithSameTerm.length; i++) { - for (var i = 0; i < pinWithSameTerm.length; i++) { + $scope.clickedPins.push({ 'id': pinWithSameTerm[i]._PinId }) + } - $scope.clickedPins.push({ 'id': pinWithSameTerm[i]._PinId }) - } + } - } + var selectedPinData = new jinqJs() + .from($scope.aaPinData) + .where("_PinId == " + pinID) + .select(); + if (clickedPin.event.ctrlKey == true) { + + $scope.activePinArray.push(clickedPin.name); + var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(126, 187, 83)' + }); + clickedPin.fillStyle = radialAfterClick; + $scope.showAnnotation(selectedPinData, true, true, false); + } + else { + $scope.activePinArray = []; + $scope.activePinArray.push(clickedPin.name); + var radial = $('#aaDetailViewCanvas').createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(216, 216, 216)' + }); - var selectedPinData = new jinqJs() - .from($scope.aaPinData) - .where("_PinId == " + pinID) - .select(); - if (clickedPin.event.ctrlKey == true) { - - $scope.activePinArray.push(clickedPin.name); - var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(126, 187, 83)' - }); - clickedPin.fillStyle = radialAfterClick; - $scope.showAnnotation(selectedPinData, true, true, false); - } - else { - $scope.activePinArray = []; - $scope.activePinArray.push(clickedPin.name); - var radial = $('#aaDetailViewCanvas').createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(216, 216, 216)' - }); + $('#aaDetailViewCanvas').setLayers({ + fillStyle: radial, + }).drawLayers(); - $('#aaDetailViewCanvas').setLayers({ - fillStyle: radial, - }).drawLayers(); + //change the head color to green + var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(126, 187, 83)' + }); - //change the head color to green - var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(126, 187, 83)' - }); + clickedPin.fillStyle = radialAfterClick; + $scope.showAnnotation(selectedPinData, false, true, false); - clickedPin.fillStyle = radialAfterClick; - $scope.showAnnotation(selectedPinData, false, true, false); + } - } + } - } + }).drawLayers(); - }).drawLayers(); - } @@ -1287,12 +1184,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.removePin = function (canvasId, pinId) { - var pinName = 'Pin_' + pinId; - var pinArcName = 'PinArc_' + pinId; - $('#' + canvasId).removeLayer(pinName).drawLayers(); - $('#' + canvasId).removeLayer(pinArcName).drawLayers(); + var pinName = 'Pin_' + pinId; + var pinArcName = 'PinArc_' + pinId; + $('#' + canvasId).removeLayer(pinName).drawLayers(); + $('#' + canvasId).removeLayer(pinArcName).drawLayers(); - $scope.removeSpeechBubble(); + $scope.removeSpeechBubble(); //$rootScope.isSliderChanged = true; //$('#aaDetailViewCanvas').removeLayers(); @@ -1309,9 +1206,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.onDrawingCanvasClick(); $rootScope.FreeStylePaint(); }); - + $rootScope.loadSearchData = function () { - + //$("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); var imageId = $rootScope.imageId; var promise = ModuleService.getTermTextDataForAAImage(imageId) @@ -1319,32 +1216,31 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou function (response) { $scope.AAPinTermData = response.data.PinTermData.TermData; - + $rootScope.isLoading = false; $('#setting-spinner').css('visibility', 'hidden'); - + $scope.pinTermData = []; var primaryLexicon = $rootScope.lexiconLanguageArray[0].id; $scope.matchedLanguageTermData = new jinqJs() .from($scope.AAPinTermData) .where('_LanguageId == ' + primaryLexicon) .select(); - var sortedTermTextArray = []; + var sortedTermTextArray = []; for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) { sortedTermTextArray.push($scope.matchedLanguageTermData[i]._TermText); 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]) - { + for (var j = 0; j <= $scope.matchedLanguageTermData.length - 1; j++) { + if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i]) { $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[j]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[j]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[j]._TermText }); break; } } } - + 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]) { @@ -1354,12 +1250,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } - + $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) { - + if (($('#termlistfilter').html() != "")) - - $('#termlistfilter').empty(); + + $('#termlistfilter').empty(); if ($scope.pinTermData.length > 0) { $timeout(function () { console.log('pinTermData= ' + $scope.pinTermData.length); @@ -1368,12 +1264,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var $el = $('
  • ' + $scope.pinTermData[j].TermTxt + '
  • ').appendTo('#termlistfilter') $compile($el)($scope); var $selectedOptions = $('').appendTo("#termList") - + $compile($selectedOptions)($scope); - + $("#AABodySystems").empty(); - $("#bodySystems").css("display","none"); - $("#AABodySystems").css("display","block"); + $("#bodySystems").css("display", "none"); + $("#AABodySystems").css("display", "block"); $("#bodySystemList li a").each(function (key, value) { var $systemOptions = $('').appendTo("#AABodySystems") $compile($systemOptions)($scope); @@ -1394,19 +1290,18 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.$on('listManagerEvent', function (event, data) { - + $("#viewName").empty(); $("#viewName").append(""); $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); - + if ($rootScope.bodySystemSeletedId == null) { - + $rootScope.loadSearchData(); } - else - { - + else { + $rootScope.refreshTermListOnAASystemSelection($rootScope.bodySystemSeletedId); } $timeout(function () { @@ -1418,13 +1313,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) { - $('#termList').empty(); + $('#termList').empty(); $rootScope.bodySystemSeletedId = bodySystemId; $('#termList').empty(); var bodySystemName = $("#AABodySystems #" + bodySystemId).val(); if (bodySystemName == "All") { for (var j = 0; j <= $scope.pinTermData.length - 1; j++) { - + $compile($selectedOptions)($scope); } $("#totalTerms").empty(); @@ -1434,7 +1329,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var imageId = $rootScope.imageId; $scope.pinDataUrl = "aa_dat_pinterm_" + imageId; $rootScope.bodySystemTermArray = []; - + $.ajax({ url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json', type: 'GET', @@ -1464,7 +1359,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { - + var languageArray = $rootScope.lexiconLanguageArray; @@ -1474,11 +1369,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .from($scope.AAPinTermData) .where('_TermNumber == ' + actualTermNo) .select(); - + if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) { - + for (var j = 0; j <= languageArray.length - 1; j++) { - + $scope.matchedLanguageTermNoData = new jinqJs() .from($scope.matchedTermNoData) .where('_LanguageId == ' + languageArray[j].id) @@ -1542,27 +1437,27 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#allPinBtn").addClass("btn-primary"); }; - + $scope.showSelectedPins = function () { - - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); - $scope.isHidePinBtnClicked = false; + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + + $scope.isHidePinBtnClicked = false; - if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { + if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { - $scope.showSystemPins($scope.selectedSystemPinData, true); + $scope.showSystemPins($scope.selectedSystemPinData, true); - } - else { - $scope.showSystemPins($scope.aaPinData, true); + } + else { + $scope.showSystemPins($scope.aaPinData, true); - } - $scope.showSpeechBubble(); - $(".tooltip-custom").removeClass("btn-primary"); - $(".tooltip-custom").addClass("btn-black"); - $("#selectedPin").addClass("btn-primary"); + } + $scope.showSpeechBubble(); + $(".tooltip-custom").removeClass("btn-primary"); + $(".tooltip-custom").addClass("btn-black"); + $("#selectedPin").addClass("btn-primary"); }; @@ -1592,7 +1487,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }).drawLayers(); // } }) - + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { // if (aaPinDataValue._PinId != value.id) { @@ -1610,7 +1505,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }) // }) - // $scope.clickedPins = []; + // $scope.clickedPins = []; } else { @@ -1679,19 +1574,19 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.highlightPinBasedOnSerachItem = function (event) { - - $scope.searchItemId = event.currentTarget.id; - $scope.searchItemText = event.currentTarget.innerHTML; - $rootScope.searchSelectedText = $("#" + event.currentTarget.id).text(); - $('#termList option[selected="selected"]').prop("selected", false); - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); - $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); - $("#termlistfilter li #" + $scope.searchItemId).css({ "background-color": "#3399FF", "color": "#ffffff" }); - $scope.searchFilter = event.currentTarget.innerHTML; - selectedTermName.placeholder = event.currentTarget.innerHTML; + $scope.searchItemId = event.currentTarget.id; + $scope.searchItemText = event.currentTarget.innerHTML; + $rootScope.searchSelectedText = $("#" + event.currentTarget.id).text(); + $('#termList option[selected="selected"]').prop("selected", false); + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); + + $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); + $("#termlistfilter li #" + $scope.searchItemId).css({ "background-color": "#3399FF", "color": "#ffffff" }); + $scope.searchFilter = event.currentTarget.innerHTML; + selectedTermName.placeholder = event.currentTarget.innerHTML; //get data from pindata for this trem @@ -1705,7 +1600,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou // maintaing scroll position on selection of options in list manager. var annotationTopPos = $(".common-drag").css("top").split("p"); $("#canvasDiv").scrollTop(annotationTopPos[0]); - + $scope.IsSearchVisible = false; } @@ -1747,14 +1642,14 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou x1: 50, y1: 50, x2: 50, y2: 50, r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(126, 187, 83)' + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(126, 187, 83)' }); var clickedPin = $scope.activePinArray[i]; $('#aaDetailViewCanvas').setLayer(clickedPin, { fillStyle: radialAfterClick }).drawLayers(); - + } } }]); @@ -1853,7 +1748,7 @@ function openModuleItemView(event) { } function openListViewModuleItem(event) { - + var scope = angular.element(document.getElementById("list-view")).scope(); scope.isListViewButtonClicked = true; scope.$apply(function () { @@ -1872,7 +1767,7 @@ function openCurrentView(event) { } function onZoom(scope) { - + //$(".common-drag").remove(); //$(".commonDot").remove(); //$(".commonDraggedLine").remove(); @@ -1888,14 +1783,14 @@ function onZoom(scope) { //}).drawLayers(); // scope.removePin(); // scope.showAllPins(); - + //6. Show all pins on AA opened item } $(document).ready(function () { - + $(".slider").slider({ min: 25, max: 100, @@ -1910,40 +1805,40 @@ $(document).ready(function () { var relativeWidth = 0; var relativeHeight = 0; if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { - if (ui.value == 100) { - relativeWidth = scope.ViewImageWidth; - relativeHeight = scope.ViewImageHeight - scope.sliderPercentValue = 1.0; - } - else if (ui.value == 85) { - relativeWidth = scope.ViewImageWidth * 0.85; - relativeHeight = scope.ViewImageHeight * 0.85; - scope.sliderPercentValue = 0.85; + if (ui.value == 100) { + relativeWidth = scope.ViewImageWidth; + relativeHeight = scope.ViewImageHeight + scope.sliderPercentValue = 1.0; + } + else if (ui.value == 85) { + relativeWidth = scope.ViewImageWidth * 0.85; + relativeHeight = scope.ViewImageHeight * 0.85; + scope.sliderPercentValue = 0.85; - } else if (ui.value == 70) { - relativeWidth = scope.ViewImageWidth * 0.70; - relativeHeight = scope.ViewImageHeight * 0.70; - scope.sliderPercentValue = 0.70; - } else if (ui.value == 55) { + } else if (ui.value == 70) { + relativeWidth = scope.ViewImageWidth * 0.70; + relativeHeight = scope.ViewImageHeight * 0.70; + scope.sliderPercentValue = 0.70; + } else if (ui.value == 55) { - relativeWidth = scope.ViewImageWidth * 0.55; - relativeHeight = scope.ViewImageHeight * 0.55; - scope.sliderPercentValue = 0.55; + relativeWidth = scope.ViewImageWidth * 0.55; + relativeHeight = scope.ViewImageHeight * 0.55; + scope.sliderPercentValue = 0.55; - } else if (ui.value == 40) { + } else if (ui.value == 40) { - relativeWidth = scope.ViewImageWidth * 0.40; - relativeHeight = scope.ViewImageHeight * 0.40; - scope.sliderPercentValue = 0.40; + relativeWidth = scope.ViewImageWidth * 0.40; + relativeHeight = scope.ViewImageHeight * 0.40; + scope.sliderPercentValue = 0.40; - } else if (ui.value == 25) { + } else if (ui.value == 25) { - relativeWidth = scope.ViewImageWidth * 0.25; - relativeHeight = scope.ViewImageHeight * 0.25; - scope.sliderPercentValue = 0.25; + relativeWidth = scope.ViewImageWidth * 0.25; + relativeHeight = scope.ViewImageHeight * 0.25; + scope.sliderPercentValue = 0.25; + } } - } if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { $("#modItemImage").css("width", relativeWidth + "px"); @@ -1953,7 +1848,7 @@ $(document).ready(function () { $("#modItemImage").attr('src', ''); - + $("#aaDetailViewCanvas").remove(); //0.5 create canvas on the top of image so that I can draw a line over the canvas. var canvas = document.createElement('canvas'); @@ -1964,16 +1859,16 @@ $(document).ready(function () { canvas.style.left = '0px'; canvas.style.top = '0px'; canvas.style.position = "absolute"; - + $("#canvasDiv").append(canvas); scope.context = canvas.getContext("2d") $("#modItemImage").attr('src', scope.OpenItemImagePath); scope.isSliderChange = true; - + scope.showAllPins(); - + } - + }); } }) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/tile-view.html index 63faef3..945ee5c 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
    - - + -- libgit2 0.21.4