Commit 365dba0b191bb4af3515820bccdae9b20d7d3e90

Authored by Amrita Vishnoi
2 parents 5a0caa54 7923eb03

Merge Request #602 request

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -33,7 +33,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -33,7 +33,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
33 selectedorientation: '', 33 selectedorientation: '',
34 selectedimagetype: '', 34 selectedimagetype: '',
35 }; 35 };
36 - 36 + $scope.activePinArray = [];
37 $scope.showTabButton = true; 37 $scope.showTabButton = true;
38 $scope.isListViewDataLoaded = true; 38 $scope.isListViewDataLoaded = true;
39 39
@@ -362,6 +362,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -362,6 +362,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
362 console.log(' error in showAllPins: ' + error.statusText); 362 console.log(' error in showAllPins: ' + error.statusText);
363 } 363 }
364 ) 364 )
  365 + if ($scope.isSliderChange == true) {
  366 + $timeout(function () {
  367 + $scope.activePinOnLayerChange();
  368 + }, 1000);
  369 +
  370 + }
  371 +
365 } 372 }
366 373
367 374
@@ -1049,16 +1056,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1049,16 +1056,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1049 radius: 5 * $scope.sliderPercentValue, 1056 radius: 5 * $scope.sliderPercentValue,
1050 1057
1051 click: function (clickedPin) { 1058 click: function (clickedPin) {
1052 - // alert('pin clciked = ' + clickedPin.name)  
1053 -  
1054 if (clickedPin.event.ctrlKey == false) { 1059 if (clickedPin.event.ctrlKey == false) {
1055 $scope.clickedPins = []; 1060 $scope.clickedPins = [];
1056 } 1061 }
1057 -  
1058 var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); 1062 var pinID = (clickedPin.name).substring(7, (clickedPin.name).length);
1059 - // alert('pinId: ' + pinID);  
1060 - //showAnnotation();  
1061 -  
1062 var pinData = new jinqJs() 1063 var pinData = new jinqJs()
1063 .from($scope.aaPinData) 1064 .from($scope.aaPinData)
1064 .where("_PinId == " + pinID) 1065 .where("_PinId == " + pinID)
@@ -1088,7 +1089,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1088,7 +1089,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1088 .where("_PinId == " + pinID) 1089 .where("_PinId == " + pinID)
1089 .select(); 1090 .select();
1090 if (clickedPin.event.ctrlKey == true) { 1091 if (clickedPin.event.ctrlKey == true) {
1091 - 1092 +
  1093 + $scope.activePinArray.push(clickedPin.name);
1092 var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ 1094 var radialAfterClick = $('#aaDetailViewCanvas').createGradient({
1093 x1: 50, y1: 50, 1095 x1: 50, y1: 50,
1094 x2: 50, y2: 50, 1096 x2: 50, y2: 50,
@@ -1096,12 +1098,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1096,12 +1098,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1096 c1: 'rgba(100, 50, 0,0)', 1098 c1: 'rgba(100, 50, 0,0)',
1097 c2: 'rgb(126, 187, 83)' 1099 c2: 'rgb(126, 187, 83)'
1098 }); 1100 });
1099 -  
1100 clickedPin.fillStyle = radialAfterClick; 1101 clickedPin.fillStyle = radialAfterClick;
1101 $scope.showAnnotation(selectedPinData, true, true, false); 1102 $scope.showAnnotation(selectedPinData, true, true, false);
1102 -  
1103 } 1103 }
1104 else { 1104 else {
  1105 + $scope.activePinArray = [];
  1106 + $scope.activePinArray.push(clickedPin.name);
1105 var radial = $('#aaDetailViewCanvas').createGradient({ 1107 var radial = $('#aaDetailViewCanvas').createGradient({
1106 x1: 50, y1: 50, 1108 x1: 50, y1: 50,
1107 x2: 50, y2: 50, 1109 x2: 50, y2: 50,
@@ -1190,12 +1192,22 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1190,12 +1192,22 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1190 .from($scope.AAPinTermData) 1192 .from($scope.AAPinTermData)
1191 .where('_LanguageId == ' + primaryLexicon) 1193 .where('_LanguageId == ' + primaryLexicon)
1192 .select(); 1194 .select();
1193 - var sortedTermTextArray = []; 1195 + var sortedTermTextArray = [];
1194 for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) { 1196 for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) {
1195 sortedTermTextArray.push($scope.matchedLanguageTermData[i]._TermText); 1197 sortedTermTextArray.push($scope.matchedLanguageTermData[i]._TermText);
1196 sortedTermTextArray.sort(); 1198 sortedTermTextArray.sort();
1197 } 1199 }
1198 - 1200 +
  1201 + for (var i = 0; i <= sortedTermTextArray.length - 1; i++) {
  1202 + for(var j = 0;j<= $scope.matchedLanguageTermData.length-1;j++){
  1203 + if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i])
  1204 + {
  1205 + $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[j]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[j]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[j]._TermText });
  1206 + break;
  1207 + }
  1208 + }
  1209 + }
  1210 +
1199 for (var i = 0; i <= sortedTermTextArray.length - 1; i++) { 1211 for (var i = 0; i <= sortedTermTextArray.length - 1; i++) {
1200 for (var j = 0; j <= $scope.matchedLanguageTermData.length - 1; j++) { 1212 for (var j = 0; j <= $scope.matchedLanguageTermData.length - 1; j++) {
1201 if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i]) { 1213 if ($scope.matchedLanguageTermData[j]._TermText == sortedTermTextArray[i]) {
@@ -1269,13 +1281,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1269,13 +1281,13 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1269 1281
1270 1282
1271 $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) { 1283 $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) {
1272 - 1284 + $('#termList').empty();
1273 $rootScope.bodySystemSeletedId = bodySystemId; 1285 $rootScope.bodySystemSeletedId = bodySystemId;
1274 $('#termList').empty(); 1286 $('#termList').empty();
1275 var bodySystemName = $("#AABodySystems #" + bodySystemId).val(); 1287 var bodySystemName = $("#AABodySystems #" + bodySystemId).val();
1276 if (bodySystemName == "All") { 1288 if (bodySystemName == "All") {
1277 for (var j = 0; j <= $scope.pinTermData.length - 1; j++) { 1289 for (var j = 0; j <= $scope.pinTermData.length - 1; j++) {
1278 - var $selectedOptions = $('<option title= "' + $scope.pinTermData[j].TermTxt + '" id= "' + $scope.pinTermData[j].TermNumber + '" onclick="onSearchItemSelection(event)">' + $scope.pinTermData[j].TermTxt + '</option>').appendTo("#termList") 1290 +
1279 $compile($selectedOptions)($scope); 1291 $compile($selectedOptions)($scope);
1280 } 1292 }
1281 $("#totalTerms").empty(); 1293 $("#totalTerms").empty();
@@ -1285,7 +1297,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1285,7 +1297,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1285 var imageId = $rootScope.imageId; 1297 var imageId = $rootScope.imageId;
1286 $scope.pinDataUrl = "aa_dat_pinterm_" + imageId; 1298 $scope.pinDataUrl = "aa_dat_pinterm_" + imageId;
1287 $rootScope.bodySystemTermArray = []; 1299 $rootScope.bodySystemTermArray = [];
1288 - 1300 +
1289 $.ajax({ 1301 $.ajax({
1290 url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json', 1302 url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json',
1291 type: 'GET', 1303 type: 'GET',
@@ -1589,12 +1601,26 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou @@ -1589,12 +1601,26 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1589 } 1601 }
1590 } 1602 }
1591 } 1603 }
1592 - 1604 + $scope.activePinOnLayerChange = function () {
  1605 + for (var i = 0; i <= $scope.activePinArray.length - 1; i++) {
  1606 + var radialAfterClick = $('#aaDetailViewCanvas').createGradient({
  1607 + x1: 50, y1: 50,
  1608 + x2: 50, y2: 50,
  1609 + r1: 10, r2: 30,
  1610 + c1: 'rgba(100, 50, 0,0)',
  1611 + c2: 'rgb(126, 187, 83)'
  1612 + });
  1613 + var clickedPin = $scope.activePinArray[i];
  1614 + $('#aaDetailViewCanvas').setLayer(clickedPin, {
  1615 + fillStyle: radialAfterClick
  1616 + }).drawLayers();
  1617 +
  1618 + }
  1619 + }
1593 }]); 1620 }]);
1594 1621
1595 1622
1596 function refreshTermListOnSystemSel(bodySystemId) { 1623 function refreshTermListOnSystemSel(bodySystemId) {
1597 -  
1598 var rootScope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); 1624 var rootScope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
1599 rootScope.$apply(function () { 1625 rootScope.$apply(function () {
1600 rootScope.refreshTermListOnAASystemSelection(bodySystemId); 1626 rootScope.refreshTermListOnAASystemSelection(bodySystemId);
@@ -1729,6 +1755,7 @@ function onZoom(scope) { @@ -1729,6 +1755,7 @@ function onZoom(scope) {
1729 1755
1730 1756
1731 $(document).ready(function () { 1757 $(document).ready(function () {
  1758 +
1732 $(".slider").slider({ 1759 $(".slider").slider({
1733 min: 25, 1760 min: 25,
1734 max: 100, 1761 max: 100,
@@ -1736,9 +1763,6 @@ $(document).ready(function () { @@ -1736,9 +1763,6 @@ $(document).ready(function () {
1736 range: "min", 1763 range: "min",
1737 orientation: "vertical", 1764 orientation: "vertical",
1738 slide: function (event, ui) { 1765 slide: function (event, ui) {
1739 -  
1740 -  
1741 -  
1742 var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); 1766 var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
1743 scope.$apply(function () { 1767 scope.$apply(function () {
1744 scope.sliderVal = ui.value; 1768 scope.sliderVal = ui.value;
@@ -1805,12 +1829,11 @@ $(document).ready(function () { @@ -1805,12 +1829,11 @@ $(document).ready(function () {
1805 scope.context = canvas.getContext("2d") 1829 scope.context = canvas.getContext("2d")
1806 $("#modItemImage").attr('src', scope.OpenItemImagePath); 1830 $("#modItemImage").attr('src', scope.OpenItemImagePath);
1807 scope.isSliderChange = true; 1831 scope.isSliderChange = true;
  1832 +
1808 scope.showAllPins(); 1833 scope.showAllPins();
  1834 +
1809 } 1835 }
1810 -  
1811 -  
1812 1836
1813 -  
1814 }); 1837 });
1815 } 1838 }
1816 }) 1839 })