Commit 58b7fc8aff20cf50e5010591f757948273f0fab3

Authored by Nikita Kulshreshtha
1 parent 80b1a2bd

added code for aa multilang

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -454,7 +454,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
454 454 }
455 455 else {
456 456 $rootScope.isVisibleLogin = false;
457   - $rootScope.loadSearchDataForBodyView();
  457 + $rootScope.loadSearchData();
458 458  
459 459 console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId);
460 460  
... ... @@ -541,7 +541,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
541 541 console.log('before LoadBodyViewNavigatorImage call')
542 542 $scope.LoadBodyViewNavigatorImage();
543 543  
544   - //$rootScope.loadSearchDataForBodyView();
  544 + //$rootScope.loadSearchData();
545 545  
546 546 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
547 547  
... ... @@ -651,7 +651,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
651 651  
652 652 })
653 653 // $rootScope.languageArray = [];
654   - $rootScope.loadSearchDataForBodyView = function () {
  654 + $rootScope.loadSearchData = function () {
655 655  
656 656 var languageArray = [];
657 657 $rootScope.vocabTermDataArray = [];
... ... @@ -7091,7 +7091,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7091 7091 $scope.loadNavigatorForSelectedBodyView(currentBodyViewId);
7092 7092  
7093 7093 //5. change the search terms as per the selected bodyview
7094   - $rootScope.loadSearchDataForBodyView();
  7094 + $rootScope.loadSearchData();
7095 7095  
7096 7096 //6.
7097 7097 $('#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
7123 7123 $scope.loadNavigatorForSelectedBodyView(currentBodyViewId);
7124 7124  
7125 7125 //5. change the search terms as per the selected bodyview
7126   - $rootScope.loadSearchDataForBodyView();
  7126 + $rootScope.loadSearchData();
7127 7127  
7128 7128 //6.
7129 7129 $('#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
7336 7336 $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
7337 7337  
7338 7338 //4. change the search terms as per the selected bodyview
7339   - $rootScope.loadSearchDataForBodyView();
  7339 + $rootScope.loadSearchData();
7340 7340  
7341 7341 //5.Change the popup title next to search
7342 7342 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
... ... @@ -7372,7 +7372,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7372 7372 $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
7373 7373  
7374 7374 //4. change the search terms as per the selected bodyview
7375   - $rootScope.loadSearchDataForBodyView();
  7375 + $rootScope.loadSearchData();
7376 7376  
7377 7377 //5.Change the popup title next to search
7378 7378 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
... ... @@ -7891,7 +7891,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7891 7891 document.getElementById("termlistfilter").style.display = "block";
7892 7892 }
7893 7893 else {
7894   - $rootScope.loadSearchDataForBodyView();
  7894 + $rootScope.loadSearchData();
7895 7895 if ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0) {
7896 7896 $scope.ShowSearch();
7897 7897 }
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -3378,7 +3378,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
3378 3378 $rootScope.UpdateAndCloseSetting = function (setting) {
3379 3379 // debugger;
3380 3380 $rootScope.UpdateSetting(setting);
3381   - $rootScope.loadSearchDataForBodyView();
  3381 + $rootScope.loadSearchData();
3382 3382  
3383 3383 //$timeout(function () {
3384 3384 $('#modal-settings').css("display", "none");
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -5,6 +5,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5 5  
6 6  
7 7 $rootScope.OpenedTileData = [];
  8 + var DISSECTIBLE_ANATOMY = 'Dissectible Anatomy';
8 9 var ATLAS_ANATOMY = 'Atlas Anatomy';
9 10 var CLINICAL_ILLUSTRATION = 'Clinical Illustrations';
10 11 var CLINICAL_ANIMATION = 'Clinical Animations';
... ... @@ -23,6 +24,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
23 24 $scope.AllOrientation = [];
24 25 $scope.AllImageType = [];
25 26 $rootScope.speechBubbleDimaensions = [];
  27 + $scope.runningSearchWorkers = [];
26 28  
27 29 $scope.query = {
28 30 selectedbodyregion: '',
... ... @@ -482,12 +484,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
482 484 }
483 485 }
484 486  
485   - $scope.showAnnotation = function (selectedSystemPinData, isCtrlPressed, isPinClicked) {
  487 + $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked) {
486 488  
487 489 $scope.selectedPin = [];
488 490 var isSameTermWithMultiPin = false;
489   - var firstPinId = selectedSystemPinData[0]._PinId;
490   - var pinTermNumber = selectedSystemPinData[0]._TermId;
  491 + var firstPinId = selectedPinData[0]._PinId;
  492 + var pinTermNumber = selectedPinData[0]._TermId;
491 493  
492 494 //check if other pin have same termNumber
493 495 if ($scope.aaPinData != null && $scope.aaPinData.length > 0) {
... ... @@ -566,6 +568,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
566 568  
567 569 function (error) { })
568 570 }
  571 +
  572 + // $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i])
569 573 }
570 574  
571 575 $scope.removeSpeechBubble = function () {
... ... @@ -891,6 +895,57 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
891 895 $rootScope.onDrawingCanvasClick();
892 896 $rootScope.FreeStylePaint();
893 897 });
  898 +
  899 + $rootScope.loadSearchData = function () {
  900 +
  901 + var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
  902 + .then(
  903 + function (response) {
  904 +
  905 + $scope.TermInfo = response.data.Terms.Term;
  906 +
  907 + },
  908 + function (error) {
  909 + // handle errors here
  910 + console.log(' error: ' + error.statusText);
  911 + }
  912 + )
  913 + }
  914 +
  915 +
  916 + $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) {
  917 +
  918 + var Annotation;
  919 + $scope.ActualTermNo = actualTermNo;
  920 + for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) {
  921 +
  922 + if ($rootScope.vocabTermDataArray[j].language == language) {
  923 +
  924 + if ($rootScope.vocabTermDataArray[j].VocabTermData != null || $rootScope.vocabTermDataArray[j].VocabTermData != undefined) {
  925 + $scope.matchedActualTermData = new jinqJs()
  926 + .from($rootScope.vocabTermDataArray[j].VocabTermData.VocabTerms.Term)
  927 + .where('_ActualTermNumber == ' + actualTermNo)
  928 + .select();
  929 +
  930 + if ($scope.matchedActualTermData != null || $scope.matchedActualTermData != undefined) {
  931 + for (var z = 0; z <= $scope.matchedActualTermData.length; z++) {
  932 + //send actual term no to get the term text.
  933 + Annotation = $scope.matchedActualTermData[0]._TermText;
  934 + // alert("Annotation : " + Annotation);
  935 + break;
  936 + };
  937 + }
  938 + return Annotation;
  939 + }
  940 +
  941 + else {
  942 + return null;
  943 + }
  944 +
  945 + }
  946 + }
  947 +
  948 + }
894 949 }]);
895 950  
896 951 function showSelectedSystemPins(event) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
... ... @@ -101,7 +101,6 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
101 101 }
102 102  
103 103 return $http.get(jsonPath, function (response) {
104   - alert(response);
105 104 var termdata = new jinqJs()
106 105 .from(response.data.Terms.Term)
107 106 .select();
... ... @@ -111,7 +110,21 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
111 110  
112 111 },
113 112  
  113 + getTermTextDataForAAImage: function (imageId) {
114 114  
  115 +
  116 + var jsonPath = '~/../content/data/json/aa/aa_pinterm/aa_dat_pinterm_' + imageId + '.json';
  117 +
  118 +
  119 + return $http.get(jsonPath, function (response) {
  120 +
  121 + var termdata = new jinqJs()
  122 + .from(response.data.Terms.Term)
  123 + .select();
  124 + return termdata;
  125 + });
  126 +
  127 + },
115 128  
116 129 };
117 130 });
... ...