Commit 4d0f7dfb8cb6362bed29b4b9dbe11e9dd40d8e55

Authored by Nikita Kulshreshtha
2 parents 7d6f8fb7 4de65404

Merge branch '14986_Merge' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -563,7 +563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -563,7 +563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
563 value: 0, 563 value: 0,
564 slide: function (event, ui) { 564 slide: function (event, ui) {
565 // $("#txtlayerNumber").val(100 - ui.value); // basic math operation.. 565 // $("#txtlayerNumber").val(100 - ui.value); // basic math operation..
566 - 566 +
567 // $("#txtlayerNumber").val($("#layerChangeSlider").slider("value")); 567 // $("#txtlayerNumber").val($("#layerChangeSlider").slider("value"));
568 }, 568 },
569 stop: function (event, ui) { 569 stop: function (event, ui) {
@@ -614,11 +614,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -614,11 +614,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
614 } 614 }
615 } 615 }
616 } 616 }
617 - }); 617 + });
  618 +
  619 +
618 }) 620 })
619 621
620 $scope.loadSearchDataForBodyView = function () { 622 $scope.loadSearchDataForBodyView = function () {
621 - 623 +
622 console.log('loadSearchDataForBodyView'); 624 console.log('loadSearchDataForBodyView');
623 625
624 var currentBodyViewId = localStorage.getItem("currentBodyViewId"); 626 var currentBodyViewId = localStorage.getItem("currentBodyViewId");
@@ -684,11 +686,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -684,11 +686,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
684 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + 686 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
685 ' </li></ul>').appendTo('#searchListDiv') 687 ' </li></ul>').appendTo('#searchListDiv')
686 $compile($e2)($scope); 688 $compile($e2)($scope);
687 - 689 +
688 }, 500); 690 }, 500);
689 - 691 +
690 }, true); 692 }, true);
691 693
  694 +
  695 +
692 } 696 }
693 697
694 $scope.loadBodyViewData = function (currentVoid) { 698 $scope.loadBodyViewData = function (currentVoid) {
@@ -2763,9 +2767,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2763,9 +2767,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2763 // $rootScope.isListManagerSelected = false; 2767 // $rootScope.isListManagerSelected = false;
2764 2768
2765 $rootScope.CloseListManager(); 2769 $rootScope.CloseListManager();
2766 -  
2767 -  
2768 - 2770 +
2769 $scope.isLayerChange = true; 2771 $scope.isLayerChange = true;
2770 $rootScope.isLoading = true; 2772 $rootScope.isLoading = true;
2771 $('#spinner').css('visibility', 'visible'); 2773 $('#spinner').css('visibility', 'visible');
@@ -6923,6 +6925,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6923,6 +6925,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6923 $scope.female = "active"; 6925 $scope.female = "active";
6924 } 6926 }
6925 $rootScope.CloseAnnotationTool(); 6927 $rootScope.CloseAnnotationTool();
  6928 + $scope.searchFilter = '';
6926 } 6929 }
6927 6930
6928 //clsoe worker process 6931 //clsoe worker process
@@ -7045,7 +7048,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7045,7 +7048,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7045 7048
7046 //Remove the search list and then Repopulate it on change of View 7049 //Remove the search list and then Repopulate it on change of View
7047 $('#searchListDiv').empty() 7050 $('#searchListDiv').empty()
7048 -  
7049 if ($rootScope.openViews.length > 0) { 7051 if ($rootScope.openViews.length > 0) {
7050 $rootScope.openViews.splice($rootScope.openViews.length - 1); 7052 $rootScope.openViews.splice($rootScope.openViews.length - 1);
7051 } 7053 }
@@ -7131,6 +7133,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7131,6 +7133,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7131 7133
7132 //2. 7134 //2.
7133 $scope.loadNavigatorForSelectedBodyView($rootScope.voId); 7135 $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
  7136 + //3. load corresponding navigator man
  7137 + $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
  7138 +
  7139 + //4. change the search terms as per the selected bodyview
  7140 + $scope.loadSearchDataForBodyView();
  7141 +
  7142 + //5.Change the popup title next to search
  7143 + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
7134 }; 7144 };
7135 7145
7136 7146
@@ -7208,7 +7218,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7208,7 +7218,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7208 } 7218 }
7209 //13573 : DA > Annotations should not be display if we change the body view. 7219 //13573 : DA > Annotations should not be display if we change the body view.
7210 $rootScope.CloseAnnotationTool(); 7220 $rootScope.CloseAnnotationTool();
7211 - 7221 + $scope.searchFilter = '';
7212 } 7222 }
7213 7223
7214 //Reload DA controller event listener after setting change 7224 //Reload DA controller event listener after setting change
@@ -7625,22 +7635,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7625,22 +7635,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7625 if ($("#btnExtract").hasClass("btn-primary")) { 7635 if ($("#btnExtract").hasClass("btn-primary")) {
7626 $("#btnExtract").removeClass("btn-primary"); 7636 $("#btnExtract").removeClass("btn-primary");
7627 } 7637 }
7628 - 7638 +
7629 if ($("#btnNormalMode").hasClass("btn-primary")) { 7639 if ($("#btnNormalMode").hasClass("btn-primary")) {
7630 $("#btnNormalMode").removeClass("btn-primary"); 7640 $("#btnNormalMode").removeClass("btn-primary");
7631 } 7641 }
7632 7642
7633 } 7643 }
7634 - 7644 + $rootScope.isSearchInputClicked = true;
7635 $scope.ShowSearch = function () { 7645 $scope.ShowSearch = function () {
7636 -  
7637 console.log('ShowSearch is called'); 7646 console.log('ShowSearch is called');
7638 //this check is for log only because we are writing length so need to check if its not null or undefined 7647 //this check is for log only because we are writing length so need to check if its not null or undefined
7639 if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) 7648 if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined)
7640 - console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length) 7649 + console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length)
7641 7650
7642 $timeout(function () { 7651 $timeout(function () {
7643 - if (($scope.VocabTermTxt!=null|| $scope.VocabTermTxt!=undefined) && ($scope.VocabTermTxt.length > 0)) { 7652 + if (($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) && ($scope.VocabTermTxt.length > 0)) {
  7653 +
7644 $scope.IsSearchVisible = true; 7654 $scope.IsSearchVisible = true;
7645 document.getElementById("termlistfilter").style.display = "block"; 7655 document.getElementById("termlistfilter").style.display = "block";
7646 } 7656 }
@@ -7650,35 +7660,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7650,35 +7660,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7650 $scope.ShowSearch(); 7660 $scope.ShowSearch();
7651 } 7661 }
7652 } 7662 }
7653 - }, 500); 7663 +
  7664 + if ($rootScope.isSearchInputClicked == true) {
  7665 + $rootScope.isSearchInputClicked = false;
  7666 + $rootScope.searchListArray = [];
  7667 + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
  7668 + $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
  7669 + });
7654 7670
7655 - //$scope.IsSearchVisible = true; 7671 + }
  7672 +
  7673 + }, 500);
7656 7674
7657 - //document.getElementById("termlistfilter").style.display = "block";  
7658 } 7675 }
7659 7676
  7677 +
7660 $scope.HideSearch = function () { 7678 $scope.HideSearch = function () {
7661 - if ($("#backdrop").is(":hover") || $("#termlistfilter").is(":hover") || $("#typedtermname").is(":focus")) {  
7662 - $scope.IsSearchVisible = true;  
7663 - document.getElementById("termlistfilter").style.display = "block";  
7664 - }  
7665 - else {  
7666 - //1. persist term in DAsearch but hide ul/li  
7667 - if ($("#btnDATermSearch").is(":hover")) {  
7668 - $scope.IsSearchVisible = false;  
7669 - }  
7670 - else {  
7671 - //2.hide ul/li and clear DA search  
7672 - $scope.IsSearchVisible = false;  
7673 - document.getElementById("termlistfilter").style.display = "none";  
7674 - $scope.searchFilter = "";  
7675 - }  
7676 - } 7679 +
  7680 + $timeout(function () {
  7681 +
  7682 + $("#termlistfilter").css("display", "none");
  7683 +
  7684 +
  7685 + }, 1000);
7677 7686
7678 } 7687 }
7679 7688
7680 $scope.jumpToTerm = function (event) { 7689 $scope.jumpToTerm = function (event) {
7681 - // alert(event.currentTarget.value); 7690 +
7682 $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text(); 7691 $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text();
7683 $('#termList option[selected="selected"]').prop("selected", false); 7692 $('#termList option[selected="selected"]').prop("selected", false);
7684 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); 7693 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
@@ -8401,7 +8410,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -8401,7 +8410,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8401 $("#btnNormalMode").removeClass("btn-primary"); 8410 $("#btnNormalMode").removeClass("btn-primary");
8402 } 8411 }
8403 8412
8404 - $('#typedtermname').val($scope.searchFilter); 8413 + $('#typedTermName').val($scope.searchFilter);
8405 8414
8406 } 8415 }
8407 else { 8416 else {
@@ -8416,21 +8425,62 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -8416,21 +8425,62 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8416 } 8425 }
8417 8426
8418 $scope.resetSearchListView = function () { 8427 $scope.resetSearchListView = function () {
8419 - 8428 +
  8429 + $("#termlistfilter").css("display", "block");
8420 //Remove the list and then Repopulate it on change of $scope.searchFilter 8430 //Remove the list and then Repopulate it on change of $scope.searchFilter
8421 - $('#searchListDiv').empty() 8431 + $('#searchListDiv').empty();
  8432 + $rootScope.ModifiedsearchListArray = [];
8422 // added the timeout to delay the compile of ul li 8433 // added the timeout to delay the compile of ul li
8423 - $timeout(function () {  
8424 - var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' +  
8425 - '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +  
8426 - ' </li></ul>').appendTo('#searchListDiv')  
8427 - $compile($e2)($scope);  
8428 - }, 500);  
8429 - 8434 + $scope.IsSearchVisible = true;
  8435 + var isValueMatchedWithTerm = false;
  8436 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++)
  8437 + {
  8438 + var searchFieldVal = $("#typedTermName").val();
  8439 + if (searchFieldVal.length > 0) {
  8440 +
  8441 + for (var j = 0; j <= searchFieldVal.length - 1; j++) {
  8442 +
  8443 + if (searchFieldVal[j].toUpperCase() != $rootScope.searchListArray[i].name[j].toUpperCase()) {
  8444 + isValueMatchedWithTerm = false;
  8445 + break;
  8446 + }
  8447 + else {
  8448 + isValueMatchedWithTerm = true
  8449 + }
  8450 + }
  8451 + if (isValueMatchedWithTerm == true) {
  8452 + $rootScope.ModifiedsearchListArray.push({ "name": $rootScope.searchListArray[i].name, "id": $rootScope.searchListArray[i].id});
  8453 + console.log($rootScope.ModifiedsearchListArray);
  8454 + }
  8455 +
  8456 + }
  8457 + }
  8458 +
  8459 + var termListFilterHtml = '';
  8460 + termListFilterHtml += '<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;z-index:60001;">';
  8461 + if ($("#typedTermName").val().length > 0) {
8430 8462
  8463 + for (var i = 0; i <= $rootScope.ModifiedsearchListArray.length - 1; i++) {
  8464 +
  8465 + termListFilterHtml += '<li><a id=' + $rootScope.ModifiedsearchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.ModifiedsearchListArray[i].name + '</a></li>';
  8466 + }
  8467 + termListFilterHtml += '</ul>';
  8468 + $('#searchListDiv').append(termListFilterHtml);
  8469 +
  8470 + }
  8471 + else
  8472 + {
  8473 + console.log($rootScope.searchListArray.length);
  8474 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) {
  8475 +
  8476 + termListFilterHtml += '<li><a id=' + $rootScope.searchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.searchListArray[i].name + '</a></li>';
  8477 + }
  8478 + termListFilterHtml += '</ul>';
  8479 + $('#searchListDiv').append(termListFilterHtml);
  8480 +
  8481 + }
8431 } 8482 }
8432 -  
8433 - 8483 +
8434 }] 8484 }]
8435 8485
8436 ); 8486 );
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
@@ -130,6 +130,7 @@ @@ -130,6 +130,7 @@
130 left: 0; 130 left: 0;
131 right: 0; 131 right: 0;
132 } 132 }
  133 +
133 </style> 134 </style>
134 <div class=" " id="daView" ng-controller="DAController"> 135 <div class=" " id="daView" ng-controller="DAController">
135 <div class="pos-relative leftToolBar tools pull-left"> 136 <div class="pos-relative leftToolBar tools pull-left">
@@ -268,14 +269,14 @@ @@ -268,14 +269,14 @@
268 <div class=""> 269 <div class="">
269 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left"> 270 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left">
270 271
271 - <input type="text" class="form-control input-sm pull-left" id="typedtermname" ng-blur="HideSearch()" onclick="OnSearch()" ondblclick="OnSearch()" ng-model="searchFilter" ng-change="resetSearchListView()" placeholder=" search..."> 272 + <input type="text" class="form-control input-sm pull-left" id="typedTermName" onclick="OnSearch()" ondblclick="OnSearch()" ng-model="searchFilter" ng-change="resetSearchListView()" ng-blur="HideSearch()" placeholder=" search...">
272 273
273 <div id="backdrop" ng-show="IsSearchVisible"> 274 <div id="backdrop" ng-show="IsSearchVisible">
274 <div id="searchListDiv" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left"> 275 <div id="searchListDiv" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
275 276
276 </div> 277 </div>
277 </div> 278 </div>
278 - 279 +
279 </div> 280 </div>
280 <div class="btn-group"> 281 <div class="btn-group">
281 282