Commit 89a3c1555c686fbc00e733c8b6f0d973e9971bb1

Authored by Amrita Vishnoi
2 parents da3025f7 46894182

Merge branch 'Prod_AnnotatyionIssue' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -458,6 +458,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
458 458 }
459 459 else {
460 460 $rootScope.isVisibleLogin = false;
  461 +
461 462 $rootScope.loadSearchData();
462 463  
463 464 console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId);
... ... @@ -696,6 +697,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
696 697  
697 698 //console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
698 699 $rootScope.TermNumberData = e.data.TermNumberData;
  700 + console.log("$rootScope.TermNumberData = " + $rootScope.TermNumberData.length);
699 701 $rootScope.VocabTermData = e.data.VocabTermData,//same
700 702 $scope.vocabTermTxt = e.data.vocabTermTxt,
701 703 $scope.vocabLanguage = e.data.language,
... ... @@ -1635,7 +1637,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1635 1637 $scope.enableExtract(false);
1636 1638 }
1637 1639  
1638   - var annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  1640 + var annotationText
  1641 + if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
  1642 +
  1643 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  1644 + }
  1645 + else {
  1646 + $scope.loadSearchData();
  1647 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  1648 + }
1639 1649  
1640 1650 if ($('#speechBubbleTrns').length > 0)
1641 1651 $('#speechBubbleTrns').remove();
... ... @@ -1800,7 +1810,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1800 1810 }
1801 1811  
1802 1812 if ($scope.isEligibleForHighlight == true) {
1803   -
  1813 +
1804 1814 if ($scope.isSearchDataLoaded) {
1805 1815 $rootScope.isLoading = false;
1806 1816 $('#spinner').css('visibility', 'hidden');
... ... @@ -1979,14 +1989,22 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1979 1989 var maskCanvas = document.getElementById(maskCanvasId);
1980 1990 var maskCanvasContext = maskCanvas.getContext("2d");
1981 1991 RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
1982   - annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  1992 + // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
1983 1993 }
1984 1994 else {
1985 1995 RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
  1996 + // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  1997 +
  1998 + }
  1999 + if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
1986 2000 annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
1987 2001  
1988 2002 }
  2003 + else {
  2004 + $scope.loadSearchData();
  2005 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
1989 2006  
  2007 + }
1990 2008 $rootScope.previousHighlightList.push(RGBColor);
1991 2009  
1992 2010 if ($rootScope.isHighLight == true) {
... ... @@ -3260,6 +3278,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
3260 3278 // send term no to vocab json data to get the text
3261 3279 }
3262 3280 }
  3281 + else {
  3282 + $rootScope.loadSearchData();
  3283 + $scope.GetAnnotationText(termNumber);
  3284 + }
3263 3285 }
3264 3286 }
3265 3287  
... ... @@ -3617,9 +3639,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
3617 3639  
3618 3640 $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox) {
3619 3641 if (isAnnotationNotForTBox == true) {
3620   -
3621   - $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
  3642 + if ($scope.MultiLanguageAnnationArray > 1) {
  3643 + $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
3622 3644  
  3645 + }
  3646 + else {
  3647 + $scope.longestAnnotation = $scope.MultiLanguageAnnationArray[0].length;
  3648 + }
3623 3649 //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that
3624 3650 // we decide the size of speech bubble
3625 3651 //2.
... ... @@ -7821,6 +7847,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
7821 7847 $rootScope.isLoading = true;
7822 7848 $('#spinner').css('visibility', 'visible');
7823 7849 //1.
  7850 + localStorage.setItem("currentBodyViewId", $rootScope.voId);
  7851 +
  7852 +
7824 7853 $scope.loadSelectedBodyView($rootScope.voId);
7825 7854  
7826 7855 //2.
... ... @@ -7841,7 +7870,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
7841 7870 }
7842 7871 $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title;
7843 7872 localStorage.setItem("currentViewTitle", $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title);
7844   - localStorage.setItem("currentBodyViewId", selectedViewId);
7845 7873  
7846 7874  
7847 7875 $rootScope.openViews.push(
... ...