Commit 9e88cfba40019a92f5d4d94bb9264931a3acd88d
1 parent
4d3879ab
added code for removing speech bubble of previously selected system.
Showing
2 changed files
with
22 additions
and
123 deletions
400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj.user
1 | -<?xml version="1.0" encoding="utf-8"?> | 1 | +<?xml version="1.0" encoding="utf-8"?> |
2 | <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 2 | <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
3 | <PropertyGroup> | 3 | <PropertyGroup> |
4 | - <ProjectView>ShowAllFiles</ProjectView> | 4 | + <ProjectView>ProjectFiles</ProjectView> |
5 | </PropertyGroup> | 5 | </PropertyGroup> |
6 | <ProjectExtensions> | 6 | <ProjectExtensions> |
7 | <VisualStudio> | 7 | <VisualStudio> |
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -185,60 +185,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -185,60 +185,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
185 | function (result) { | 185 | function (result) { |
186 | $scope.aaPinData = result.data.Root.Item; | 186 | $scope.aaPinData = result.data.Root.Item; |
187 | angular.forEach($scope.aaPinData, function (value, key) { | 187 | angular.forEach($scope.aaPinData, function (value, key) { |
188 | - //CREATING PIN WITHOUT CANAVS | ||
189 | - //var ax = value._PinX; | ||
190 | - //var ay = value._PinY; | ||
191 | - //var bx = value._HeadX; | ||
192 | - //var by = value._HeadY; | ||
193 | - | ||
194 | - //if (ax > bx) { | ||
195 | - // bx = ax + bx; | ||
196 | - // ax = bx - ax; | ||
197 | - // bx = bx - ax; | ||
198 | - // by = ay + by; | ||
199 | - // ay = by - ay; | ||
200 | - // by = by - ay; | ||
201 | - //} | ||
202 | - | ||
203 | - | ||
204 | - //console.log('ax: ' + ax); | ||
205 | - //console.log('ay: ' + ay); | ||
206 | - //console.log('bx: ' + bx); | ||
207 | - //console.log('by: ' + by); | ||
208 | - | ||
209 | - //var angle = Math.atan((ay - by) / (bx - ax)); | ||
210 | - //console.log('angle: ' + angle); | ||
211 | - | ||
212 | - //angle = (angle * 180 / Math.PI); | ||
213 | - //console.log('angle: ' + angle); | ||
214 | - //angle = -angle; | ||
215 | - //console.log('angle: ' + angle); | ||
216 | - | ||
217 | - //var length = Math.sqrt((ax - bx) * (ax - bx) + (ay - by) * (ay - by)); | ||
218 | - //console.log('length: ' + length); | ||
219 | - | ||
220 | - //var style = "" | ||
221 | - //style += "left:" + (ax) + "px;" | ||
222 | - //style += "top:" + (ay) + "px;" | ||
223 | - //style += "width:" + length + "px;" | ||
224 | - //style += "height:1px;" | ||
225 | - //style += "background-color:black;" | ||
226 | - //style += "position:absolute;" | ||
227 | - //style += "transform:rotate(" + angle + "deg);" | ||
228 | - //style += "-ms-transform:rotate(" + angle + "deg);" | ||
229 | - //style += "transform-origin:0% 0%;" | ||
230 | - //style += "-moz-transform:rotate(" + angle + "deg);" | ||
231 | - //style += "-moz-transform-origin:0% 0%;" | ||
232 | - //style += "-webkit-transform:rotate(" + angle + "deg);" | ||
233 | - //style += "-webkit-transform-origin:0% 0%;" | ||
234 | - //style += "-o-transform:rotate(" + angle + "deg);" | ||
235 | - //style += "-o-transform-origin:0% 0%;" | ||
236 | - //style += "-webkit-box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, .1);" | ||
237 | - //style += "box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, .1);" | ||
238 | - //style += "z-index:99;" | ||
239 | - //$("<div id= '"+value._PinId+"' style='" + style + "'></div>").appendTo('#imageDiv'); | ||
240 | - //END | ||
241 | - | 188 | + |
242 | $scope.context.beginPath(); | 189 | $scope.context.beginPath(); |
243 | $scope.context.moveTo(value._PinX, value._PinY); | 190 | $scope.context.moveTo(value._PinX, value._PinY); |
244 | $scope.context.lineTo(value._HeadX, value._HeadY); | 191 | $scope.context.lineTo(value._HeadX, value._HeadY); |
@@ -469,6 +416,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -469,6 +416,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
469 | //1.Remove all the pins first | 416 | //1.Remove all the pins first |
470 | $scope.ClearAllPins(); | 417 | $scope.ClearAllPins(); |
471 | 418 | ||
419 | + //clear speech bubble | ||
420 | + var speechBubbles = $("div[id*='sppeachBubble']"); | ||
421 | + if (speechBubbles != null || speechBubbles != undefined && speechBubbles.length > 0) { | ||
422 | + for (var j = 0; j < speechBubbles.length; j++) { | ||
423 | + | ||
424 | + speechBubbles[j].parentNode.removeChild(speechBubbles[j]); | ||
425 | + } | ||
426 | + } | ||
427 | + var speechBubbleLines = $("div[id*='sppeachBubbleLine']"); | ||
428 | + if (speechBubbleLines != null || speechBubbleLines != undefined && speechBubbleLines.length > 0) { | ||
429 | + for (var j = 0; j < speechBubbleLines.length; j++) { | ||
430 | + | ||
431 | + speechBubbleLines[j].parentNode.removeChild(speechBubbleLines[j]); | ||
432 | + } | ||
433 | + } | ||
434 | + | ||
435 | + | ||
472 | var selectedSystemName = event.currentTarget.title; | 436 | var selectedSystemName = event.currentTarget.title; |
473 | //2. get pinData | 437 | //2. get pinData |
474 | var promise = ModuleService.getPinDataForImage($rootScope.imageName) | 438 | var promise = ModuleService.getPinDataForImage($rootScope.imageName) |
@@ -569,72 +533,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -569,72 +533,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
569 | $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; }); | 533 | $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; }); |
570 | $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y,PinId); | 534 | $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y,PinId); |
571 | 535 | ||
572 | - //2. | ||
573 | - //if (event.ctrlKey) { | ||
574 | - // console.log('ctrl pressed'); | ||
575 | - // $scope.multiAnnotationIsON = true; | ||
576 | - // //2.1 create unique speech bubbles | ||
577 | - // $scope.speechBubbleCounter = $scope.speechBubbleCounter + 1; | ||
578 | - // var id = "speechBubble" + $scope.speechBubbleCounter; | ||
579 | - // //2.2 Get clicked locationa and find if it is already clicked earlier too on same location | ||
580 | - // var pointClicked = parseInt(x) + parseInt(y); | ||
581 | - // var isClickedOnSamePoint = $("#canvasDiv").find("div[id=" + pointClicked + "]").length; | ||
582 | - // console.log('isClickedOnSamePoint: ' + isClickedOnSamePoint); | ||
583 | - // // if user has not clciked on smae point then create speech bubble otherwise not | ||
584 | - // if (isClickedOnSamePoint == 0) { | ||
585 | - // console.log('not clicked on same point') | ||
586 | - // $scope.createSpeechBubbleBasedOnAnnotationLength(pointClicked, x, y, id); | ||
587 | - // $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: id }); | ||
588 | - // } | ||
589 | - // $('.appendDragg').draggable({ | ||
590 | - // drag: function (evt) { | ||
591 | - // $(this).prev('div').css("display", "none"); | ||
592 | - // var bor_id = $(this).next('div').attr('id'); | ||
593 | - // var sub_id1 = $(this).attr('id'); | ||
594 | - // var verticalScrollPosition = canvasDiv.scrollTop; | ||
595 | - // var horizontlScrollPosition = canvasDiv.scrollLeft; | ||
596 | - // if ($scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { | ||
597 | - // for (var m = 0; m <= $scope.speechbubbleList.length - 1; m++) { | ||
598 | - // if ($scope.speechbubbleList[m].ids == sub_id1) { | ||
599 | - // $scope.angle1($scope.speechbubbleList[m].xaxis, $scope.speechbubbleList[m].yaxis, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, bor_id); | ||
600 | - // break; | ||
601 | - // } | ||
602 | - // } | ||
603 | - // } | ||
604 | - // }, | ||
605 | - // }); | ||
606 | - // $('.dynCross').on('click', function (evt) { | ||
607 | - // //$(this).parent().parent().parent().css('display', 'none'); | ||
608 | - // $(this).parent().parent().parent().remove(); | ||
609 | - // }); | ||
610 | - //} | ||
611 | - // else { | ||
612 | - // $scope.multiAnnotationIsON = false; | ||
613 | - //history maintained issue | ||
614 | - //if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { | ||
615 | - // $("#sppeachBubble").remove(); | ||
616 | - // $("#dot").remove(); | ||
617 | - //} | ||
618 | - // $(".com").remove(); | ||
619 | - // $("#bord").remove(); | ||
620 | - | ||
621 | - //history maintained issue | ||
622 | - //if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "60000"; } | ||
623 | - //$('#sppeachBubble').draggable( | ||
624 | - //{ | ||
625 | - // drag: function (evt) { | ||
626 | - // $("#dot").css("visibility", "hidden"); | ||
627 | - // var verticalScrollPosition = canvasDiv.scrollTop; | ||
628 | - // var horizontlScrollPosition = canvasDiv.scrollLeft; | ||
629 | - // $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | ||
630 | - // }, | ||
631 | - //}); | ||
632 | - //$('.crossDiv_temp').on('click', function (evt) { | ||
633 | - // $('#sppeachBubble').remove(); | ||
634 | - // $("#bord").remove(); | ||
635 | - // $("#dot").remove(); | ||
636 | - //}); | ||
637 | - //} | 536 | + |
638 | } | 537 | } |
639 | 538 | ||
640 | $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) { | 539 | $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) { |
@@ -844,7 +743,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | @@ -844,7 +743,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo | ||
844 | } | 743 | } |
845 | } | 744 | } |
846 | var Globe = []; | 745 | var Globe = []; |
847 | - debugger; | 746 | + |
848 | $rootScope.Globe1.push({ "currentX": x, "currentY": y, "id": PinId }); | 747 | $rootScope.Globe1.push({ "currentX": x, "currentY": y, "id": PinId }); |
849 | Globe.push({ currentX: x, currentY: y}); | 748 | Globe.push({ currentX: x, currentY: y}); |
850 | document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block'; | 749 | document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block'; |