From 58b7fc8aff20cf50e5010591f757948273f0fab3 Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 12 Jun 2017 15:47:12 +0530 Subject: [PATCH] added code for aa multilang --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 16 ++++++++-------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 2 +- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js | 15 ++++++++++++++- 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 483b3f3..5be3726 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -454,7 +454,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } else { $rootScope.isVisibleLogin = false; - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); @@ -541,7 +541,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('before LoadBodyViewNavigatorImage call') $scope.LoadBodyViewNavigatorImage(); - //$rootScope.loadSearchDataForBodyView(); + //$rootScope.loadSearchData(); $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); @@ -651,7 +651,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) // $rootScope.languageArray = []; - $rootScope.loadSearchDataForBodyView = function () { + $rootScope.loadSearchData = function () { var languageArray = []; $rootScope.vocabTermDataArray = []; @@ -7091,7 +7091,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadNavigatorForSelectedBodyView(currentBodyViewId); //5. change the search terms as per the selected bodyview - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); //6. $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Female', 'Male'); @@ -7123,7 +7123,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadNavigatorForSelectedBodyView(currentBodyViewId); //5. change the search terms as per the selected bodyview - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); //6. $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female'); @@ -7336,7 +7336,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadNavigatorForSelectedBodyView($rootScope.voId); //4. change the search terms as per the selected bodyview - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); //5.Change the popup title next to search $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); @@ -7372,7 +7372,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.loadNavigatorForSelectedBodyView($rootScope.voId); //4. change the search terms as per the selected bodyview - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); //5.Change the popup title next to search $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); @@ -7891,7 +7891,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo document.getElementById("termlistfilter").style.display = "block"; } else { - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); if ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0) { $scope.ShowSearch(); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 81730bc..cc2f687 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -3378,7 +3378,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.UpdateAndCloseSetting = function (setting) { // debugger; $rootScope.UpdateSetting(setting); - $rootScope.loadSearchDataForBodyView(); + $rootScope.loadSearchData(); //$timeout(function () { $('#modal-settings').css("display", "none"); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 6af8722..20a7b48 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -5,6 +5,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.OpenedTileData = []; + var DISSECTIBLE_ANATOMY = 'Dissectible Anatomy'; var ATLAS_ANATOMY = 'Atlas Anatomy'; var CLINICAL_ILLUSTRATION = 'Clinical Illustrations'; var CLINICAL_ANIMATION = 'Clinical Animations'; @@ -23,6 +24,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.AllOrientation = []; $scope.AllImageType = []; $rootScope.speechBubbleDimaensions = []; + $scope.runningSearchWorkers = []; $scope.query = { selectedbodyregion: '', @@ -482,12 +484,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $scope.showAnnotation = function (selectedSystemPinData, isCtrlPressed, isPinClicked) { + $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked) { $scope.selectedPin = []; var isSameTermWithMultiPin = false; - var firstPinId = selectedSystemPinData[0]._PinId; - var pinTermNumber = selectedSystemPinData[0]._TermId; + var firstPinId = selectedPinData[0]._PinId; + var pinTermNumber = selectedPinData[0]._TermId; //check if other pin have same termNumber if ($scope.aaPinData != null && $scope.aaPinData.length > 0) { @@ -566,6 +568,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo function (error) { }) } + + // $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i]) } $scope.removeSpeechBubble = function () { @@ -891,6 +895,57 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.onDrawingCanvasClick(); $rootScope.FreeStylePaint(); }); + + $rootScope.loadSearchData = function () { + + var promise = ModuleService.getTermTextDataForPin($scope.moduleName) + .then( + function (response) { + + $scope.TermInfo = response.data.Terms.Term; + + }, + function (error) { + // handle errors here + console.log(' error: ' + error.statusText); + } + ) + } + + + $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) { + + var Annotation; + $scope.ActualTermNo = actualTermNo; + for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) { + + if ($rootScope.vocabTermDataArray[j].language == language) { + + if ($rootScope.vocabTermDataArray[j].VocabTermData != null || $rootScope.vocabTermDataArray[j].VocabTermData != undefined) { + $scope.matchedActualTermData = new jinqJs() + .from($rootScope.vocabTermDataArray[j].VocabTermData.VocabTerms.Term) + .where('_ActualTermNumber == ' + actualTermNo) + .select(); + + if ($scope.matchedActualTermData != null || $scope.matchedActualTermData != undefined) { + for (var z = 0; z <= $scope.matchedActualTermData.length; z++) { + //send actual term no to get the term text. + Annotation = $scope.matchedActualTermData[0]._TermText; + // alert("Annotation : " + Annotation); + break; + }; + } + return Annotation; + } + + else { + return null; + } + + } + } + + } }]); function showSelectedSystemPins(event) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index 2a486d1..609a2ae 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -101,7 +101,6 @@ AIA.service('ModuleService', function($http, DataService) { } return $http.get(jsonPath, function (response) { - alert(response); var termdata = new jinqJs() .from(response.data.Terms.Term) .select(); @@ -111,7 +110,21 @@ AIA.service('ModuleService', function($http, DataService) { }, + getTermTextDataForAAImage: function (imageId) { + + var jsonPath = '~/../content/data/json/aa/aa_pinterm/aa_dat_pinterm_' + imageId + '.json'; + + + return $http.get(jsonPath, function (response) { + + var termdata = new jinqJs() + .from(response.data.Terms.Term) + .select(); + return termdata; + }); + + }, }; }); -- libgit2 0.21.4