Merged
Merge Request #1024 · created by Birendra Kumar


bug fixes of multiple lexicon

merge bug fixes to Develop branch


From AIABugFixes into AIA_Develop

Merged by Birendra Kumar

1 participants

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -65,7 +65,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
65 65 'fullTermlist':[],
66 66 'isHighlightBodyWithCBTermData':false,
67 67 'CurriculumTermData':[],
68   - 'primaryLexiconInd':0,
  68 + 'primaryLexiconInd':[],
69 69 'TermAnnotationText':[],
70 70 'AllTerms':[],
71 71 'actualTermNumber':0,
... ... @@ -867,7 +867,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
867 867 timeintval = undefined;
868 868 }
869 869 };
870   - },
  870 + }
871 871  
872 872 $scope.loadBodyView = function (windowviewid) {
873 873  
... ... @@ -1590,14 +1590,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1590 1590  
1591 1591 $rootScope.daloadSearchData = function (windowviewid) {
1592 1592  
1593   - $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', 0);
1594   -
  1593 + $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', []);
  1594 + var languageInd = [];
1595 1595 var languageArray = [];
1596 1596 $scope.SetwindowStoreData(windowviewid, 'vocabTermDataArray', null);
1597 1597 var languageArray = $rootScope.lexiconLanguageArray;
1598 1598 console.log('loadSearchDataForBodyView');
1599 1599  
1600 1600 var currentBodyViewId = $scope.GetwindowStoreData(windowviewid, 'voId');
  1601 + $scope.vocabTempTermArray = [];
1601 1602  
1602 1603 for (var i = 0; i <= languageArray.length - 1; i++) {
1603 1604 var searchWorker = new Worker('search-wp.js');
... ... @@ -1621,15 +1622,20 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1621 1622 // store image for export
1622 1623 $scope.LoadImageToExport(windowviewid);
1623 1624  
1624   - console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length);
1625   -
1626   - console.log("$scope.BodyViewIDs" + e.data.bodyViewID);
1627   - $scope.vocabTempTermArray = [];
  1625 + // console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length);
1628 1626  
  1627 + // console.log("$scope.BodyViewIDs" + e.data.bodyViewID);
  1628 +
1629 1629 $scope.vocabTempTermArray.push({ "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt });
1630 1630  
  1631 +
  1632 +
  1633 + if ($scope.vocabTempTermArray.length == $rootScope.lexiconLanguageArray.length) {
  1634 + $("#setting-spinner").css("display", "none");
1631 1635 for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) {
1632 1636  
  1637 + languageInd.push(i);
  1638 +
1633 1639 $scope.vocabTempTermArray[i].vocabTermTxt = new jinqJs()
1634 1640 .from($scope.vocabTempTermArray[i].vocabTermTxt)
1635 1641 .distinct('_TermText', '_ActualTermNumber')
... ... @@ -1637,22 +1643,15 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1637 1643 .select('_ActualTermNumber', '_TermText', '_cdId');
1638 1644 }
1639 1645  
1640   - if ($scope.vocabTempTermArray.length == $rootScope.lexiconLanguageArray.length) {
1641   - $("#setting-spinner").css("display", "none");
  1646 + $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', languageInd);
1642 1647 // add data vocabTermDataArray
1643 1648 $scope.SetwindowStoreData(windowviewid, 'vocabTermDataArray', $scope.vocabTempTermArray);
1644 1649  
1645   - for (var i = 0; i <= $scope.vocabTempTermArray.length - 1; i++) {
1646   - if ($scope.vocabTempTermArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
1647   - // $scope.primaryLexiconInd = i;
1648   - $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', i);
1649   - }
1650   - }
1651 1650 if ($rootScope.isListManagerMenuSelected) {
1652 1651 $scope.loadListManger(windowviewid);
1653 1652 }
1654   - else if ($scope.GetwindowStoreData(windowviewid,'isSearchClicked')) {
1655   - $scope.ShowSearch(windowviewid,false);
  1653 + if ($scope.GetwindowStoreData(windowviewid,'isSearchClicked')) {
  1654 + $scope.FillSearchList(windowviewid);
1656 1655 }
1657 1656  
1658 1657 // terminate search worker instances
... ... @@ -5551,14 +5550,20 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5551 5550  
5552 5551 if (annotation == undefined) {
5553 5552 console.log("No text found");
5554   - } else {
  5553 + }
  5554 + else
  5555 + {
5555 5556  
5556 5557 $("#canvasDivDA_" + windowviewid).append(sppechBubbleHTML);
5557   -
  5558 + var lengLen=$scope.MultiLanguageAnnationArray.length;
5558 5559 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
5559 5560 var annotation = $scope.MultiLanguageAnnationArray[i];
5560   -
5561 5561 $("#" + id).append("<p style='margin-bottom:2px;'>" + annotation + "</p>");
  5562 + if(lengLen>1)
  5563 + {
  5564 + $("#" + id).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5565 + }
  5566 + lengLen--;
5562 5567 }
5563 5568 if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) {
5564 5569 $("#"+id).css("min-width", "auto");
... ... @@ -5569,19 +5574,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5569 5574 if (isHighlightBodyWithCBTermData == true) {
5570 5575  
5571 5576 var bubbleid = document.getElementById(id);
5572   -
5573 5577 var bordid = 'bord' + speechBubbleCounter+'_'+windowviewid;
5574 5578  
5575   - var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid);
5576   - var verticalScrollPosition = canvasDiv.scrollTop;
5577   - var horizontlScrollPosition = canvasDiv.scrollLeft;
5578   -
5579 5579 $scope.angle1(x, y, bubbleid.offsetLeft, bubbleid.offsetTop, bordid);
5580 5580 $('#bubble' + speechBubbleCounter+'_'+windowviewid).css({ 'display': 'none' });
5581 5581 }
5582 5582  
5583   -
5584   -
5585 5583 }
5586 5584 }
5587 5585  
... ... @@ -5603,13 +5601,20 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5603 5601  
5604 5602 if (MultipleLanguage == undefined) {
5605 5603 console.log("No text is found");
5606   - } else {
  5604 + }
  5605 + else
  5606 + {
5607 5607 $('#canvasDivDA_' + windowviewid).append(sppechBubbleDotHTML);
5608   -
  5608 + var lengLen=$scope.MultiLanguageAnnationArray.length;
5609 5609 if ($scope.MultiLanguageAnnationArray.length > 0) {
5610 5610 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
5611 5611 var MultipleLanguage = $scope.MultiLanguageAnnationArray[i];
5612 5612 $('#sppeachBubble_' + windowviewid + '-' + termNumber).append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>");
  5613 + if(lengLen>1)
  5614 + {
  5615 + $('#sppeachBubble_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5616 + }
  5617 + lengLen--;
5613 5618 }
5614 5619 }
5615 5620 else {
... ... @@ -5667,18 +5672,30 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5667 5672 {
5668 5673 var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno_"+windowviewid+"'><div class='multiLineAnnotation' style='z-index:59000;left:" + (x - 4) + "px;top:" + (y + 11.5) + "px;'' id='bubble" + TPspeechBubbleCounter + "'></div><div data=" + TPspeechBubbleCounter + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + (x-4) + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + TPspeechBubbleCounter + " class='dynCross_anno_"+windowviewid+"' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + TPspeechBubbleCounter +"_" + windowviewid+ "'></div></div>";
5669 5674 }
5670   -
  5675 + var annotation1Len=$scope.annotationTextArrayT1.length;
  5676 + var annotation2Len=$scope.annotationTextArrayT2.length;
  5677 +
5671 5678 if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
5672 5679 if (Exists_annotation == 0) {
5673 5680 $('#canvasDivDA_' + windowviewid).append(sppechBubbleHTML_annotation);
5674 5681 for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) {
5675 5682 var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l];
5676 5683 $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>");
  5684 + if(annotation1Len>1)
  5685 + {
  5686 + $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5687 + }
  5688 + annotation1Len--;
5677 5689 }
5678   - $("#" + sub_id_annotation).append("<p style='border-bottom:1px solid black;margin-bottom:0;'></p>");
  5690 + $("#" + sub_id_annotation).append("<p style='border-bottom:2px solid black;margin-bottom:0;'></p>");
5679 5691 for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) {
5680 5692 var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k];
5681 5693 $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>");
  5694 + if(annotation2Len>1)
  5695 + {
  5696 + $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5697 + }
  5698 + annotation2Len--;
5682 5699 }
5683 5700 if ($scope.longest_annotationT1 != null || $scope.longest_annotationT1 != undefined) {
5684 5701 $("#" + sub_id_annotation).css("min-width", "auto");
... ... @@ -5691,18 +5708,29 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5691 5708 $('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked_annotation + "]").css("display", "block");
5692 5709 }
5693 5710 }
5694   - else {
  5711 + else
  5712 + {
5695 5713 if (Exists_annotation == 0) {
5696 5714 $('#canvasDivDA_' + windowviewid).append(sppechBubbleHTML_annotation);
5697 5715 for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) {
5698 5716 var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l];
5699 5717 $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>");
  5718 + if(annotation1Len>1)
  5719 + {
  5720 + $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5721 + }
  5722 + annotation1Len--;
5700 5723 }
5701 5724  
5702   - $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5725 + $("#" + sub_id_annotation).append("<p style='border-bottom:2px solid white;margin-bottom:0;'></p>");
5703 5726 for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) {
5704 5727 var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k];
5705 5728 $("#" + sub_id_annotation).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>");
  5729 + if(annotation2Len>1)
  5730 + {
  5731 + $("#" + sub_id_annotation).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5732 + }
  5733 + annotation2Len--;
5706 5734 }
5707 5735 if ($scope.longest_annotationT2 != null || $scope.longest_annotationT2 != undefined) {
5708 5736 $("#" + sub_id_annotation).css("min-width", "auto");
... ... @@ -5731,17 +5759,31 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5731 5759 + '</div>';
5732 5760 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).css("height", "auto");
5733 5761  
  5762 + var annotation1Len=$scope.annotationTextArrayT1.length;
  5763 + var annotation2Len=$scope.annotationTextArrayT2.length;
  5764 +
5734 5765 if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
5735 5766 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber + " p").remove();
5736 5767 $('#canvasDivDA_' + windowviewid).append(sppechBubbleDotHTML_annotation);
5737 5768 for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) {
5738 5769 var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l];
5739 5770 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>");
  5771 + if(annotation1Len>1)
  5772 + {
  5773 + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5774 + }
  5775 + annotation1Len--;
  5776 +
5740 5777 }
5741   - $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5778 + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:2px solid white;margin-bottom:0;'></p>");
5742 5779 for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) {
5743 5780 var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k];
5744 5781 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>");
  5782 + if(annotation2Len>1)
  5783 + {
  5784 + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5785 + }
  5786 + annotation2Len--;
5745 5787 }
5746 5788 if ($scope.longest_annotationT1 != null || $scope.longest_annotationT1 != undefined) {
5747 5789 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).css("min-width", "auto");
... ... @@ -5749,17 +5791,28 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5749 5791  
5750 5792 }
5751 5793 }
5752   - else {
  5794 + else
  5795 + {
5753 5796 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber + " p").remove();
5754 5797 $('#canvasDivDA_' + windowviewid).append(sppechBubbleDotHTML_annotation);
5755 5798 for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) {
5756 5799 var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l];
5757 5800 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T1 + "</p>");
  5801 + if(annotation1Len>1)
  5802 + {
  5803 + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5804 + }
  5805 + annotation1Len--;
5758 5806 }
5759   - $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5807 + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:2px solid white;margin-bottom:0;'></p>");
5760 5808 for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) {
5761 5809 var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k];
5762 5810 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='margin-bottom:2px;'>" + MultipleLang_annotation_T2 + "</p>");
  5811 + if(annotation2Len>1)
  5812 + {
  5813 + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("<p style='border-bottom:1px dotted white;margin-bottom:0;'></p>");
  5814 + }
  5815 + annotation2Len--;
5763 5816 }
5764 5817 if ($scope.longest_annotationT2 != null || $scope.longest_annotationT2 != undefined) {
5765 5818 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).css("min-width", "auto");
... ... @@ -10005,14 +10058,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10005 10058 // update body system : 5/5/2020;birendra
10006 10059 $scope.highlightBodySystemName(windowviewid);
10007 10060  
10008   - $scope.loadSelectedBodyView(currentBodyViewId, windowviewid);
10009   -
10010   -
10011 10061 //4.
10012 10062 $scope.loadNavigatorForSelectedBodyView(currentBodyViewId, windowviewid);
10013 10063  
10014 10064 //5. change the search terms as per the selected bodyview
10015   - $rootScope.daloadSearchData(windowviewid);
  10065 +
  10066 + $scope.loadSelectedBodyViewChange(currentBodyViewId, windowviewid);
10016 10067  
10017 10068 $scope.GetBodySystemData(currentBodyViewId,windowviewid);
10018 10069 //6.
... ... @@ -10046,13 +10097,10 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10046 10097 // update body system : 5/5/2020;birendra
10047 10098 $scope.highlightBodySystemName(windowviewid);
10048 10099  
10049   - $scope.loadSelectedBodyView(currentBodyViewId, windowviewid);
10050   -
10051   - //4.
10052 10100 $scope.loadNavigatorForSelectedBodyView(currentBodyViewId, windowviewid);
10053 10101  
10054 10102 //5. change the search terms as per the selected bodyview
10055   - $rootScope.daloadSearchData(windowviewid);
  10103 + $scope.loadSelectedBodyViewChange(currentBodyViewId, windowviewid);
10056 10104  
10057 10105 $scope.GetBodySystemData(currentBodyViewId,windowviewid);
10058 10106 //6.
... ... @@ -10084,8 +10132,68 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10084 10132 $('#typedTermName_' + windowviewid).val('');
10085 10133 }
10086 10134  
  10135 + $scope.loadBodyViewChangedBySetting = function (windowviewid, isLexiconChange) {
  10136 + var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  10137 +
  10138 + if(isLexiconChange)
  10139 + {
  10140 + //load term data and also language data
  10141 + $rootScope.daloadSearchData(windowviewid);
  10142 + //call time interval function until load Illustration data
  10143 + var timeintval = null;
  10144 + timeintval = $interval(function () {
  10145 + var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray');
  10146 + if (vocabTermDataArray!=null) {
  10147 + $scope.stopVocab();
  10148 + $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
  10149 + }
  10150 + else
  10151 + {
  10152 + console.log("waiting for search term Data");
  10153 + }
  10154 + }, 100);
  10155 +
  10156 + $scope.stopVocab = function () {
  10157 + if (angular.isDefined(timeintval)) {
  10158 + $interval.cancel(timeintval);
  10159 + timeintval = undefined;
  10160 + }
  10161 + };
  10162 + }
  10163 + else
  10164 + {
  10165 + $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
  10166 + }
  10167 +
  10168 + }
  10169 +
  10170 + $scope.loadSelectedBodyViewChange = function (currentBodyViewId,windowviewid) {
  10171 + $rootScope.daloadSearchData(windowviewid);
  10172 + //call time interval function until load Illustration data
  10173 + var timeintval = null;
  10174 + timeintval = $interval(function () {
  10175 + var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray');
  10176 + if (vocabTermDataArray!=null) {
  10177 + $scope.stopVocab();
  10178 + $scope.loadSelectedBodyView(currentBodyViewId,windowviewid);
  10179 + }
  10180 + else
  10181 + {
  10182 + console.log("waiting for search term Data");
  10183 + }
  10184 + }, 100);
  10185 +
  10186 + $scope.stopVocab = function () {
  10187 + if (angular.isDefined(timeintval)) {
  10188 + $interval.cancel(timeintval);
  10189 + timeintval = undefined;
  10190 + }
  10191 + };
  10192 + }
  10193 +
  10194 +
10087 10195 $scope.loadSelectedBodyView = function (currentBodyViewId, windowviewid) {
10088   - var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList');
  10196 +
10089 10197 //remove transaprency scale
10090 10198 if ($('#transparencyScale_' + windowviewid) != null) {
10091 10199  
... ... @@ -10128,58 +10236,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10128 10236 {
10129 10237 $scope.SetwindowStoreData(windowviewid,'layerNumber',0);
10130 10238 }
  10239 + var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  10240 + $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber'));
10131 10241  
10132   - //load json for annotations
10133   -
10134   - var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
10135   - DataService.getAnotherJson(termJsonPath)
10136   - .then(
10137   - function (result) {
10138   - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
10139   - $scope.SetwindowStoreData(windowviewid,'TermNumberData',result);
10140   - var isViewChange=$scope.GetwindowStoreData(windowviewid,'isViewChange');
10141   - var isGenderChnage=$scope.GetwindowStoreData(windowviewid,'isGenderChnage');
10142   - var isListManagerSelected=$scope.GetwindowStoreData(windowviewid,'isListManagerSelected');
10143   - var isListManagerAlreadySelected=$scope.GetwindowStoreData(windowviewid,'isListManagerAlreadySelected');
10144   - //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender
10145   -
10146   - if (((isListManagerSelected == true) || isListManagerAlreadySelected == true ||
10147   - ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true && previousHighlightList != null
10148   - && previousHighlightList.length > 0))
10149   - && ((isGenderChnage == true) || isViewChange == true)) {
10150   - $scope.setLayerNumberAndHighlightByTermList(windowviewid);
10151   - }
10152   - else if (previousHighlightList != null && previousHighlightList.length > 0 &&
10153   - (isGenderChnage == true || isViewChange == true))
10154   - {
10155   - $scope.SetwindowStoreData(windowviewid,'AllTerms',[]);
10156   - $scope.SetwindowStoreData(windowviewid,'isHighLight',true);
10157   - var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData');
10158   - if (TermNData != undefined) {
10159   - var actualTermNumber=$scope.GetwindowStoreData(windowviewid,'actualTermNumber');
10160   - $scope.TermList = $scope.getTermNumberList(actualTermNumber,windowviewid);
10161   - if ($scope.TermList != null && $scope.TermList.length > 0) {
10162   - $scope.setLayerNumberAndHighlightByTermList(windowviewid);
10163   - }
10164   - else {
10165   - //actual term number is not found in thsi view menas previously selected body part does not exist in this view
10166   - $scope.CalculateImageCordinates(viewOrientationId, windowviewid)
10167   - }
10168   - }
10169   -
10170   - }
10171   - else {
10172   - $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
10173   - $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber'))
10174   -
10175   - }
  10242 + $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
10176 10243  
10177   - },
10178   - function (error) {
10179   - // handle errors here
10180   - console.log(' $rootScope.TermNumberData= ' + error.statusText);
10181   - }
10182   - )
10183 10244 },
10184 10245  
10185 10246 function (error) {
... ... @@ -10189,6 +10250,111 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10189 10250 );
10190 10251 }
10191 10252  
  10253 + // $scope.loadSelectedBodyView = function (currentBodyViewId, windowviewid) {
  10254 + // var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList');
  10255 + // //remove transaprency scale
  10256 + // if ($('#transparencyScale_' + windowviewid) != null) {
  10257 +
  10258 + // $('#transparencyScale_' + windowviewid).css('visibility', 'hidden');
  10259 + // }
  10260 +
  10261 + // $scope.SetwindowStoreData(windowviewid,'voId',currentBodyViewId);
  10262 +
  10263 + // var layerJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_layer_' + currentBodyViewId + '.json';
  10264 +
  10265 + // DataService.getJson(layerJsonPath)
  10266 + // .then(
  10267 + // function (result) {
  10268 +
  10269 + // $scope.SetwindowStoreData(windowviewid,'BodyLayerData',result);
  10270 +
  10271 + // //set max for LayerNumber input
  10272 + // var totalLayer = result.Layers.DataLayer.length-1;
  10273 +
  10274 + // $scope.SetwindowStoreData(windowviewid,'totalLayers',totalLayer);
  10275 +
  10276 + // $('#txtLayerNumberDA_' + windowviewid).attr('max', totalLayer);
  10277 +
  10278 + // console.log('inside DataService.getJson. document.getElementById layerChangeSlider value : ' + document.getElementById('layerChangeSlider') + 'set value: ' + totalLayer);
  10279 +
  10280 + // $("#layerChangeSliderDA_" + windowviewid).slider("option", "max", totalLayer);
  10281 +
  10282 + // // CB part to load same layer while change gender/bodyview
  10283 +
  10284 + // if($rootScope.isCallFromOtherModule)
  10285 + // {
  10286 + // var cLayer= $scope.GetwindowStoreData(windowviewid,'layerNumber');
  10287 +
  10288 + // if(cLayer>totalLayer)
  10289 + // {
  10290 + // $scope.SetwindowStoreData(windowviewid,'layerNumber',totalLayer);
  10291 + // }
  10292 + // }
  10293 + // else
  10294 + // {
  10295 + // $scope.SetwindowStoreData(windowviewid,'layerNumber',0);
  10296 + // }
  10297 +
  10298 + // //load json for annotations
  10299 +
  10300 + // var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
  10301 + // DataService.getAnotherJson(termJsonPath)
  10302 + // .then(
  10303 + // function (result) {
  10304 + // var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId');
  10305 + // $scope.SetwindowStoreData(windowviewid,'TermNumberData',result);
  10306 + // var isViewChange=$scope.GetwindowStoreData(windowviewid,'isViewChange');
  10307 + // var isGenderChnage=$scope.GetwindowStoreData(windowviewid,'isGenderChnage');
  10308 + // var isListManagerSelected=$scope.GetwindowStoreData(windowviewid,'isListManagerSelected');
  10309 + // var isListManagerAlreadySelected=$scope.GetwindowStoreData(windowviewid,'isListManagerAlreadySelected');
  10310 + // //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender
  10311 +
  10312 + // if (((isListManagerSelected == true) || isListManagerAlreadySelected == true ||
  10313 + // ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true && previousHighlightList != null
  10314 + // && previousHighlightList.length > 0))
  10315 + // && ((isGenderChnage == true) || isViewChange == true)) {
  10316 + // $scope.setLayerNumberAndHighlightByTermList(windowviewid);
  10317 + // }
  10318 + // else if (previousHighlightList != null && previousHighlightList.length > 0 &&
  10319 + // (isGenderChnage == true || isViewChange == true))
  10320 + // {
  10321 + // $scope.SetwindowStoreData(windowviewid,'AllTerms',[]);
  10322 + // $scope.SetwindowStoreData(windowviewid,'isHighLight',true);
  10323 + // var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData');
  10324 + // if (TermNData != undefined) {
  10325 + // var actualTermNumber=$scope.GetwindowStoreData(windowviewid,'actualTermNumber');
  10326 + // $scope.TermList = $scope.getTermNumberList(actualTermNumber,windowviewid);
  10327 + // if ($scope.TermList != null && $scope.TermList.length > 0) {
  10328 + // $scope.setLayerNumberAndHighlightByTermList(windowviewid);
  10329 + // }
  10330 + // else {
  10331 + // //actual term number is not found in thsi view menas previously selected body part does not exist in this view
  10332 + // $scope.CalculateImageCordinates(viewOrientationId, windowviewid)
  10333 + // }
  10334 + // }
  10335 +
  10336 + // }
  10337 + // else {
  10338 + // $scope.CalculateImageCordinates(viewOrientationId, windowviewid);
  10339 + // $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber'))
  10340 +
  10341 + // }
  10342 +
  10343 + // },
  10344 + // function (error) {
  10345 + // // handle errors here
  10346 + // console.log(' $rootScope.TermNumberData= ' + error.statusText);
  10347 + // }
  10348 + // )
  10349 + // },
  10350 +
  10351 + // function (error) {
  10352 + // // handle errors here
  10353 + // console.log(' $rootScope.BodyLayerData= ' + error.statusText);
  10354 + // }
  10355 + // );
  10356 + // }
  10357 +
10192 10358 $scope.OnViewChange = function (event) {
10193 10359 var parentid=event.target.parentElement.id;
10194 10360 var len= (parentid).split("_").length;
... ... @@ -10296,14 +10462,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10296 10462 // update body system : 5/5/2020;birendra
10297 10463 $scope.highlightBodySystemName(windowviewid);
10298 10464  
10299   - //2. Load selected body view
10300   - $scope.loadSelectedBodyView(bodyVid,windowviewid);
10301   -
10302 10465 //3. load corresponding navigator man
10303 10466 $scope.loadNavigatorForSelectedBodyView(bodyVid,windowviewid);
10304 10467  
10305 10468 //4. change the search terms as per the selected bodyview
10306   - $rootScope.daloadSearchData(windowviewid);
  10469 + $scope.loadSelectedBodyViewChange(bodyVid, windowviewid);
10307 10470  
10308 10471 $scope.GetBodySystemData(bodyVid,windowviewid);
10309 10472  
... ... @@ -10328,14 +10491,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10328 10491  
10329 10492 // update body system : 5/5/2020;birendra
10330 10493 $scope.highlightBodySystemName(windowviewid);
10331   -
10332   - $scope.loadSelectedBodyView(bodyVid, windowviewid);
10333   -
  10494 +
10334 10495 //3. load corresponding navigator man
10335 10496 $scope.loadNavigatorForSelectedBodyView(bodyVid, windowviewid);
10336 10497  
10337   - //4. change the search terms as per the selected bodyview
10338   - $rootScope.daloadSearchData(windowviewid);
  10498 + $scope.loadSelectedBodyViewChange(bodyVid, windowviewid);
  10499 +
  10500 + $scope.GetBodySystemData(bodyVid,windowviewid);
10339 10501  
10340 10502 };
10341 10503  
... ... @@ -10372,7 +10534,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10372 10534 }
10373 10535  
10374 10536 //Reload DA controller Body View after setting Change
10375   - $rootScope.reloadDABodyViewEvent = function (bodyViewId, windowviewid) {
  10537 + $rootScope.reloadDABodyViewEvent = function (bodyViewId,isLexiconChange, windowviewid) {
10376 10538 //console.log('reloadDABodyViewEvent');
10377 10539 $scope.SetwindowStoreData(windowviewid,'isGlobalSettingChanged',true);
10378 10540 if ($rootScope.isSettingEventAlredayDispachted == true) {
... ... @@ -10380,12 +10542,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10380 10542 $rootScope.isSettingEventAlredayDispachted = false; // define at home controller
10381 10543 $scope.SetwindowStoreData(windowviewid,'layerNumber',parseInt($('#txtLayerNumberDA_' + windowviewid).val()));
10382 10544 var currentLayerNumber=$scope.GetwindowStoreData(windowviewid,'currentLayerNumber');
10383   - if ($scope.GetwindowStoreData(windowviewid,'isTransparencyActivated') && currentLayerNumber == 0) {
  10545 + if ($scope.GetwindowStoreData(windowviewid,'isTransparencyActivated')) {
10384 10546 $scope.SetwindowStoreData(windowviewid,'layerNumber',currentLayerNumber) ;
10385   - $scope.loadSelectedBodyView(bodyViewId, windowviewid);
  10547 + $scope.loadBodyViewChangedBySetting(windowviewid,isLexiconChange);
10386 10548 }
10387   - else if ($scope.GetwindowStoreData(windowviewid,'layerNumber') == 0) {
10388   - $scope.loadSelectedBodyView(bodyViewId, windowviewid);
  10549 + else
  10550 + {
  10551 + $scope.loadBodyViewChangedBySetting(windowviewid,isLexiconChange);
10389 10552 }
10390 10553  
10391 10554 $scope.loadNavigatorForSelectedBodyView(bodyViewId, windowviewid);
... ... @@ -10707,12 +10870,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10707 10870  
10708 10871 $scope.ShowSearch = function (windowviewid, isbuttionclick) {
10709 10872  
10710   - $scope.SetwindowStoreData(windowviewid,'isSearchClicked',true);
10711 10873 console.log('ShowSearch is called');
10712 10874 // clear time stamp on text box click
10713 10875 $scope.SetwindowStoreData(windowviewid, 'SearchTimeStampValue', 0);
10714 10876  
10715   - var primaryLexiconIndx = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd');
  10877 + // get first language term text
  10878 + var primaryLexiconIndx = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0];
10716 10879  
10717 10880 var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray');
10718 10881 //this check is for log only because we are writing length so need to check if its not null or undefined
... ... @@ -10859,18 +11022,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10859 11022 }
10860 11023  
10861 11024 $scope.loadListManger = function (windowviewid) {
10862   - var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd');
  11025 + var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0];
10863 11026  
10864 11027 var vocabTermDataArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray');
10865 11028  
10866 11029 if (vocabTermDataArray != null && vocabTermDataArray != undefined && vocabTermDataArray.length > 0) {
10867   -
10868   - for (var i = 0; i <= vocabTermDataArray.length - 1; i++) {
10869   - if (vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
10870   - primaryLexiconIndex = i;
10871   - }
10872   - }
10873   - console.log(vocabTermDataArray[primaryLexiconIndex].language);
  11030 + $('#termList').empty();
10874 11031 $rootScope.isListManagerMenuSelected = true;
10875 11032  
10876 11033 var vocabTermTxt = [];
... ... @@ -11494,8 +11651,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11494 11651 }
11495 11652  
11496 11653 $scope.showFilteredTerms = function (windowviewid) {
11497   -
11498   - var lexiconInd = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd');
  11654 + // get first language term text
  11655 + var lexiconInd = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0];
11499 11656  
11500 11657 var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray')[lexiconInd].vocabTermTxt;
11501 11658  
... ... @@ -11588,7 +11745,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11588 11745 if ($('#searchTermListUl_' + windowviewid).html() != "") {
11589 11746 $('#searchTermListUl_' + windowviewid).empty();
11590 11747 }
11591   - var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd');
  11748 + $scope.SetwindowStoreData(windowviewid,'isSearchClicked',true);
  11749 +
  11750 + var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0];
11592 11751 var vocabTermDataArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray');
11593 11752  
11594 11753 var searchvalue = $("#typedTermName_" + windowviewid).val();
... ... @@ -11631,6 +11790,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11631 11790 $('#searchTermListUl_' + windowviewid).empty();
11632 11791 }
11633 11792  
  11793 + $scope.SetwindowStoreData(windowviewid,'isSearchClicked',false);
  11794 +
11634 11795 }
11635 11796  
11636 11797 //Created method by Sandeep for Save JSPanel Activity on the CB module
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -30,6 +30,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
30 30 $rootScope.CommonData;
31 31 $rootScope.shapeType;
32 32 $rootScope.canvasLayerNameCollection=[];
  33 + $rootScope.islaxicanlanguageChange=false;
33 34 $rootScope.globalSetting = {
34 35 ethnicity: 'W',
35 36 modesty: 'Y',
... ... @@ -2081,6 +2082,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2081 2082 $("#lexiconLangDropdown :selected").remove();
2082 2083 $('#secondLax').append('<option val="' + $rootScope.selectedId + '">' + $rootScope.selectedText + '</option>');
2083 2084 $rootScope.lexiconLanguageArray.push({ id: $rootScope.selectedId, language: $rootScope.selectedText });
  2085 + $rootScope.islaxicanlanguageChange=true;
2084 2086 }
2085 2087 });
2086 2088  
... ... @@ -2102,6 +2104,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2102 2104 $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value });
2103 2105 });
2104 2106 $rootScope.lexiconLanguageArray.unshift({ id: $("#primarylaxican").attr("name"), language: $("#primarylaxican").val() });
  2107 + $rootScope.islaxicanlanguageChange=true;
2105 2108 }
2106 2109 });
2107 2110  
... ... @@ -2116,6 +2119,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2116 2119 $('#primarylaxican').attr("name", primarylaxiid);
2117 2120 $rootScope.lexiconLanguageArray[0].id = primarylaxiid;
2118 2121 $rootScope.lexiconLanguageArray[0].language = primarylaxicantext;
  2122 +
  2123 + $rootScope.islaxicanlanguageChange=true;
2119 2124 }
2120 2125 });
2121 2126 }
... ... @@ -8062,8 +8067,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
8062 8067 $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity);
8063 8068 $rootScope.setModestySettings($rootScope.globalSetting.modesty);
8064 8069  
8065   -
8066   -
  8070 + $rootScope.islaxicanlanguageChange=false;
8067 8071 if ($rootScope.isApplyBtnClicked == false) {
8068 8072  
8069 8073 $rootScope.deSelectLanguageOptions();
... ... @@ -8324,18 +8328,19 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
8324 8328  
8325 8329 }
8326 8330  
8327   - if (isReloadingViewRequired == true) {
8328   - $rootScope.reloadChildController();
8329   - }
  8331 + if (isReloadingViewRequired == true || $rootScope.islaxicanlanguageChange) {
  8332 + $rootScope.reloadChildController($rootScope.islaxicanlanguageChange);
  8333 + }
8330 8334  
8331 8335 $rootScope.lexiconRemovedLanguage = [];
8332 8336 $("#secondLax option").each(function () {
8333 8337 $rootScope.lexiconRemovedLanguage.push({ "id": $(this).attr("val"), "language": $(this).val() });
8334 8338 });
8335   - };
8336 8339  
  8340 + $rootScope.islaxicanlanguageChange=false;
  8341 + };
8337 8342  
8338   - $rootScope.reloadChildController = function () {
  8343 + $rootScope.reloadChildController = function (isLexiconChange) {
8339 8344 // change DA setting for single/multiple panel
8340 8345 var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']");
8341 8346 if (modulePanel != undefined && modulePanel.length>0) {
... ... @@ -8347,7 +8352,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
8347 8352 var MultiWinId = (paneld).split("_")[len - 1];
8348 8353 $rootScope.isSettingEventAlredayDispachted = true;
8349 8354 var currentOpenViewId=$rootScope.GetDAwindowData(MultiWinId,"voId");
8350   - $rootScope.reloadDABodyViewEvent(currentOpenViewId,MultiWinId);
  8355 + $rootScope.reloadDABodyViewEvent(currentOpenViewId,isLexiconChange,MultiWinId);
8351 8356 }
8352 8357 }
8353 8358 }
... ...