diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
index 36f0e11..a249e98 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -458,6 +458,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
else {
$rootScope.isVisibleLogin = false;
+
$rootScope.loadSearchData();
console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId);
@@ -696,6 +697,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
//console.log('callback searchWorker , time: ' + new Date().toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1"));
$rootScope.TermNumberData = e.data.TermNumberData;
+ console.log("$rootScope.TermNumberData = " + $rootScope.TermNumberData.length);
$rootScope.VocabTermData = e.data.VocabTermData,//same
$scope.vocabTermTxt = e.data.vocabTermTxt,
$scope.vocabLanguage = e.data.language,
@@ -1635,7 +1637,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.enableExtract(false);
}
- var annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ var annotationText
+ if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
+
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
+ else {
+ $scope.loadSearchData();
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
if ($('#speechBubbleTrns').length > 0)
$('#speechBubbleTrns').remove();
@@ -1800,7 +1810,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
if ($scope.isEligibleForHighlight == true) {
-
+
if ($scope.isSearchDataLoaded) {
$rootScope.isLoading = false;
$('#spinner').css('visibility', 'hidden');
@@ -1979,14 +1989,22 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
var maskCanvas = document.getElementById(maskCanvasId);
var maskCanvasContext = maskCanvas.getContext("2d");
RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
- annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
}
else {
RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
+ // annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+
+ }
+ if ($rootScope.TermNumberData != null && $rootScope.TermNumberData != undefined) {
annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
}
+ else {
+ $scope.loadSearchData();
+ annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
+ }
$rootScope.previousHighlightList.push(RGBColor);
if ($rootScope.isHighLight == true) {
@@ -3260,6 +3278,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
// send term no to vocab json data to get the text
}
}
+ else {
+ $rootScope.loadSearchData();
+ $scope.GetAnnotationText(termNumber);
+ }
}
}
@@ -3617,9 +3639,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox) {
if (isAnnotationNotForTBox == true) {
-
- $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
+ if ($scope.MultiLanguageAnnationArray > 1) {
+ $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
+ }
+ else {
+ $scope.longestAnnotation = $scope.MultiLanguageAnnationArray[0].length;
+ }
//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
// we decide the size of speech bubble
//2.
@@ -7821,6 +7847,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
//1.
+ localStorage.setItem("currentBodyViewId", $rootScope.voId);
+
+
$scope.loadSelectedBodyView($rootScope.voId);
//2.
@@ -7841,7 +7870,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
$('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title;
localStorage.setItem("currentViewTitle", $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title);
- localStorage.setItem("currentBodyViewId", selectedViewId);
$rootScope.openViews.push(