Commit 86d38287462ee402a376b74f4baae70f0b0e3edb

Authored by Nikita Kulshreshtha
1 parent 6b5549ac

changes in select system code

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -191,7 +191,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
191 191 $scope.aaPinData = result.data.Root.Item;
192 192 angular.forEach($scope.aaPinData, function (value, key) {
193 193  
194   - $scope.DrawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY)
  194 + $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY)
195 195 })
196 196  
197 197 },
... ... @@ -404,53 +404,53 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
404 404  
405 405 $scope.showSelectedSystemPins = function (event) {
406 406  
407   - //1.Remove all the pins first
408   - $scope.ClearAllPins();
409   -
410   - var selectedSystemName = event.currentTarget.title;
411   - //2. get pinData
412   - var promise = ModuleService.getPinDataForImage($rootScope.imageName)
413   -
414   - .then(
415   - function (result) {
416   - $scope.aaPinData = result.data.Root.Item;
417   -
418   - //3. get termText info
419   - var promise = ModuleService.getTermTextForPin($scope.moduleName)
420   - .then(
421   - function (response) {
422   -
423   - $scope.TermInfo = response.data.Terms.Term;
424   -
425   - //on gettng all required data, draw pins
426   - var selectedSystemPinData = new jinqJs()
427   - .from($scope.aaPinData)
428   - .where("_BodySystemName == " + selectedSystemName)
429   - .select();
430   - angular.forEach(selectedSystemPinData, function (value, key) {
  407 +
  408 + if (event.currentTarget.id == "0") {
431 409  
432   -
433   - $scope.DrawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY)
434   -
435   - })
436   - //show annotation on first pin of the sysyem
437   - $scope.showAnnotation(selectedSystemPinData, false, false);
438   - },
439   - function (error) {
440   - // handle errors here
441   - console.log(' error: ' + error.statusText);
442   - }
443   - )
  410 + $scope.removeSpeechBubble();
  411 + $scope.showAllPins();
444 412  
  413 + }
  414 + else {
445 415  
  416 + var selectedSystemName = event.currentTarget.title;
446 417  
447   - console.log(JSON.stringify(result, null, 4));
448   - },
449   - function (error) {
450   - // handle errors here
451   - console.log(' error: ' + error.statusText);
452   - }
453   - )
  418 +
  419 + // get termText info
  420 + var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
  421 + .then(
  422 + function (response) {
  423 +
  424 + $scope.TermInfo = response.data.Terms.Term;
  425 +
  426 + //on gettng all required data, draw pins
  427 + var selectedSystemPinData = new jinqJs()
  428 + .from($scope.aaPinData)
  429 + .where("_BodySystemName == " + selectedSystemName)
  430 + .select();
  431 + //remove other system pins
  432 + angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) {
  433 + // angular.forEach(selectedSystemPinData, function (selectedSystemPinDataValue, selectedSystemPinDataKey) {
  434 + if (aaPinDataValue._BodySystemName != selectedSystemName)
  435 + $scope.removePin('aaDetailViewCanvas', aaPinDataValue._PinId);
  436 + })
  437 +
  438 + angular.forEach(selectedSystemPinData, function (value, key) {
  439 +
  440 +
  441 + $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY)
  442 +
  443 + })
  444 + //show annotation on first pin of the sysyem
  445 + $scope.showAnnotation(selectedSystemPinData, false, false);
  446 + },
  447 + function (error) {
  448 + // handle errors here
  449 + console.log(' error: ' + error.statusText);
  450 + }
  451 + )
  452 +
  453 + }
454 454 }
455 455  
456 456 $scope.showAnnotation = function (selectedSystemPinData, isCtrlPressed, isPinClicked) {
... ... @@ -468,8 +468,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
468 468  
469 469  
470 470  
471   - //3. get termText info
472   - var promise = ModuleService.getTermTextForPin($scope.moduleName)
  471 + // get termText info
  472 + var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
473 473 .then(
474 474 function (response) {
475 475  
... ... @@ -490,7 +490,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
490 490 }
491 491 else {
492 492 if (isPinClicked) {
493   - var existingSpeechBubble = $("div[id*='sppeachBubble']");
  493 + var existingSpeechBubble = $("div[id*='speechBubble']");
494 494 for (var i = 0; i < existingSpeechBubble.length; i++) {
495 495 existingSpeechBubble[i].parentNode.removeChild(existingSpeechBubble[i]);
496 496  
... ... @@ -534,30 +534,32 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
534 534 function (error) { })
535 535 }
536 536  
537   - $scope.ClearAllPins = function () {
538   -
539   - //var canvasHeight = document.getElementById('aaDetailViewCanvas').height;
540   - //var canvasWidth = document.getElementById('aaDetailViewCanvas').width;
541   -
542   - //$scope.context.clearRect(0, 0, canvasWidth, canvasHeight);
543   -
544   - $('#aaDetailViewCanvas').clearCanvas();
  537 + $scope.removeSpeechBubble = function () {
545 538  
  539 +
546 540 //clear speech bubbles
547   - var speechBubbles = $("div[id*='sppeachBubble']");
  541 + var speechBubbles = $("div[id*='speechBubble']");
548 542 if (speechBubbles != null || speechBubbles != undefined && speechBubbles.length > 0) {
549 543 for (var j = 0; j < speechBubbles.length; j++) {
550 544  
551 545 speechBubbles[j].parentNode.removeChild(speechBubbles[j]);
552 546 }
553 547 }
554   - var speechBubbleLines = $("div[id*='sppeachBubbleLine']");
  548 + var speechBubbleLines = $("div[id*='speechBubbleLine']");
555 549 if (speechBubbleLines != null || speechBubbleLines != undefined && speechBubbleLines.length > 0) {
556 550 for (var j = 0; j < speechBubbleLines.length; j++) {
557 551  
558 552 speechBubbleLines[j].parentNode.removeChild(speechBubbleLines[j]);
559 553 }
560 554 }
  555 +
  556 + var speechBubbleDraggedLines = $("div[id*='speechBubbleDraggedLine']");
  557 + if (speechBubbleDraggedLines != null || speechBubbleDraggedLines != undefined && speechBubbleDraggedLines.length > 0) {
  558 + for (var j = 0; j < speechBubbleDraggedLines.length; j++) {
  559 +
  560 + speechBubbleDraggedLines[j].parentNode.removeChild(speechBubbleDraggedLines[j]);
  561 + }
  562 + }
561 563 };
562 564  
563 565  
... ... @@ -568,7 +570,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
568 570  
569 571 $scope.createSpeechBubbleBasedOnAnnotationLength(x, y, PinId);
570 572  
571   - $('#sppeachBubble').draggable(
  573 + $('#speechBubble').draggable(
572 574 {
573 575 drag: function (evt) {
574 576 $("#dot").css("visibility", "hidden");
... ... @@ -580,7 +582,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
580 582  
581 583 }
582 584  
583   - $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo, language) {
  585 + $scope.getAnnotationBasedOnActualTermNo = function (actualTermNo, language) {
584 586  
585 587 var Annotation;
586 588 $scope.ActualTermNo = actualTermNo;
... ... @@ -614,54 +616,54 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
614 616  
615 617 }
616 618  
617   - $scope.GetAnnotationText = function (termNumber) {
618   - $rootScope.annotationText = [];
619   - var annotationText;
620   - var annotation = [];
621   - //0
622   - var figLeafTermNo = 5868; // to do declare constant for this
623   -
624   - if (parseInt(termNumber) != parseInt(figLeafTermNo)) {
625   - $scope.TermNumber = termNumber;
626   - for (var j = 0; j <= $rootScope.lexiconLanguageArray.length - 1; j++) {
627   - if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined) {
628   - $scope.matchedTermNoData = new jinqJs()
629   - .from($rootScope.TermNumberData.TermData.Term)
630   - .where('_TermNumber == ' + termNumber)
631   - .select();
632   -
633   - if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) {
634   - //1.
635   - var actualTermNo = 0;
636   - for (var z = 0; z < $scope.matchedTermNoData.length; z++) {
637   - //send actual term no to get the term text.
638   - actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber;
639   - annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo, $rootScope.lexiconLanguageArray[j].language);
640   - annotation.push(annotationText);
641   - $rootScope.annotationText.push(annotationText);
642   - $rootScope.actualTermNumber = actualTermNo;
643   - break;
644   - };
645   -
646   - //2.
647   -
648   - }
649   - else {
650   - // send term no to vocab json data to get the text
651   - }
652   - }
653   - }
654   - }
655   -
656   - return annotation;
657   - }
  619 + //$scope.getAnnotationText = function (termNumber) {
  620 + // $rootScope.annotationText = [];
  621 + // var annotationText;
  622 + // var annotation = [];
  623 + // //0
  624 + // var figLeafTermNo = 5868; // to do declare constant for this
  625 +
  626 + // if (parseInt(termNumber) != parseInt(figLeafTermNo)) {
  627 + // $scope.TermNumber = termNumber;
  628 + // for (var j = 0; j <= $rootScope.lexiconLanguageArray.length - 1; j++) {
  629 + // if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined) {
  630 + // $scope.matchedTermNoData = new jinqJs()
  631 + // .from($rootScope.TermNumberData.TermData.Term)
  632 + // .where('_TermNumber == ' + termNumber)
  633 + // .select();
  634 +
  635 + // if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) {
  636 + // //1.
  637 + // var actualTermNo = 0;
  638 + // for (var z = 0; z < $scope.matchedTermNoData.length; z++) {
  639 + // //send actual term no to get the term text.
  640 + // actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber;
  641 + // annotationText = $scope.getAnnotationBasedOnActualTermNo(actualTermNo, $rootScope.lexiconLanguageArray[j].language);
  642 + // annotation.push(annotationText);
  643 + // $rootScope.annotationText.push(annotationText);
  644 + // $rootScope.actualTermNumber = actualTermNo;
  645 + // break;
  646 + // };
  647 +
  648 + // //2.
  649 +
  650 + // }
  651 + // else {
  652 + // // send term no to vocab json data to get the text
  653 + // }
  654 + // }
  655 + // }
  656 + // }
  657 +
  658 + // return annotation;
  659 + //}
658 660  
659 661  
660 662  
661 663 $scope.createSpeechBubbleBasedOnAnnotationLength = function (x, y, PinId) {
662 664  
663 665 var speechBubbleHTML = '<div id="speechBubbleLine' + PinId + '" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
664   - + '<div id="sppeachBubble' + PinId + '" class="common-drag" style="height:auto!important;z-index:10000;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;">'
  666 + + '<div id="speechBubble' + PinId + '" class="common-drag" style="height:auto!important;z-index:10000;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;">'
665 667 + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">'
666 668 + '<img id="closeBtn' + PinId + ' " class="crossDiv_temp" style="width:18px" src=' + $rootScope.closeBtnImgPath + '></span></div>'
667 669  
... ... @@ -681,7 +683,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
681 683 if ($scope.MultiLanguageAnnationArray.length > 0) {
682 684 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
683 685 var MultipleLanguage = $scope.MultiLanguageAnnationArray[i];
684   - $("#sppeachBubble" + PinId).append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>");
  686 + $("#speechBubble" + PinId).append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>");
685 687 }
686 688 }
687 689 else {
... ... @@ -691,7 +693,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
691 693 if ($scope.longestAnnotation.length <= 10) {
692 694  
693 695  
694   - $("#sppeachBubble").css("width", "100px");
  696 + $("#speechBubble").css("width", "100px");
695 697  
696 698 }
697 699  
... ... @@ -699,39 +701,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
699 701  
700 702  
701 703  
702   - $("#sppeachBubble").css("width", "140px");
  704 + $("#speechBubble").css("width", "140px");
703 705  
704 706 }
705 707 else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) {
706 708  
707 709  
708   - $("#sppeachBubble").css("width", "195px");
  710 + $("#speechBubble").css("width", "195px");
709 711  
710 712 }
711 713 else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) {
712 714  
713   - $("#sppeachBubble").css("width", "248px");
  715 + $("#speechBubble").css("width", "248px");
714 716  
715 717 }
716 718 else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) {
717 719  
718 720  
719   - $("#sppeachBubble").css("width", "300px");
  721 + $("#speechBubble").css("width", "300px");
720 722 }
721 723  
722 724 else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) {
723 725  
724   - $("#sppeachBubble").css("width", "370px");
  726 + $("#speechBubble").css("width", "370px");
725 727 }
726 728  
727 729 else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) {
728   - $("#sppeachBubble").css("width", "450px");
  730 + $("#speechBubble").css("width", "450px");
729 731 }
730 732 else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) {
731   - $("#sppeachBubble").css("width", "510px");
  733 + $("#speechBubble").css("width", "510px");
732 734 }
733 735 else {
734   - $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%");
  736 + $("#speechBubble").css("width", ($scope.longestAnnotation.length) + "%");
735 737 }
736 738 }
737 739 }
... ... @@ -742,9 +744,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
742 744 document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block';
743 745 document.getElementById('speechBubbleLine' + PinId + '').style.left = ((Globe[0].currentX - 45)) + 'px';
744 746 document.getElementById('speechBubbleLine' + PinId + '').style.top = ((Globe[0].currentY) - 20) + 'px';
745   - document.getElementById('sppeachBubble' + PinId + '').style.display = 'block';
746   - document.getElementById('sppeachBubble' + PinId + '').style.left = (Globe[0].currentX - 70) + 'px';
747   - document.getElementById('sppeachBubble' + PinId + '').style.top = (Globe[0].currentY - 58) + 'px';
  747 + document.getElementById('speechBubble' + PinId + '').style.display = 'block';
  748 + document.getElementById('speechBubble' + PinId + '').style.left = (Globe[0].currentX - 70) + 'px';
  749 + document.getElementById('speechBubble' + PinId + '').style.top = (Globe[0].currentY - 58) + 'px';
748 750  
749 751 $('.common-drag').draggable(
750 752 {
... ... @@ -774,7 +776,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
774 776  
775 777 var imgId = $(this).attr("id");
776 778 var pinId = imgId.substring(8, imgId.length);
777   - $('#sppeachBubble' + pinId).remove();
  779 + $('#speechBubble' + pinId).remove();
778 780 $("#speechBubbleDraggedLine" + pinId).remove();
779 781 $("#speechBubbleLine" + pinId).remove();
780 782  
... ... @@ -847,7 +849,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
847 849 }
848 850  
849 851  
850   - $scope.DrawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) {
  852 + $scope.drawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) {
851 853  
852 854 var radial = $('#' + canvasId).createGradient({
853 855 x1: 50, y1: 50,
... ... @@ -914,13 +916,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
914 916 }
915 917  
916 918  
917   - $scope.onCloseBtnClick = function (event) {
918   - alert('closed')
919   - }
  919 + $scope.removePin = function (canvasId,pinId) {
920 920  
921   - $("#closeBtn").click(function () {
922   - alert('closed')
923   - });
  921 + var pinName = 'Pin_' + pinId;
  922 + var pinArcName = 'PinArc_' + pinId;
  923 + $('#' + canvasId).removeLayer(pinName).drawLayers();
  924 + $('#' + canvasId).removeLayer(pinArcName).drawLayers();
  925 +
  926 + $scope.removeSpeechBubble();
  927 + }
924 928 }]);
925 929  
926 930 function showSelectedSystemPins(event) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js
... ... @@ -92,7 +92,7 @@ AIA.service(&#39;ModuleService&#39;, function($http, DataService) {
92 92  
93 93 },
94 94  
95   - getTermTextForPin: function (moduleName) {
  95 + getTermTextDataForPin: function (moduleName) {
96 96  
97 97 var jsonPath;
98 98 if (moduleName == ATLAS_ANATOMY) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
... ... @@ -17,7 +17,7 @@
17 17 <div class="col-sm-6" title="Select System">
18 18 <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu221" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><img src="../../../content/images/aa/LeftMenu/icon-highlight.png" alt="" title=""></button>
19 19 <ul class="dropdown-menu" aria-labelledby="dropdownMenu221">
20   - <li><a href="#" title="Current Structure">All</a></li>
  20 + <li><a id="0" href="#" title="Current Structure" onclick="showSelectedSystemPins(event)">All</a></li>
21 21 <li role="separator" class="divider"></li>
22 22 <li><a id="1" href="#" title="Cardiovascular" onclick="showSelectedSystemPins(event)">Cardiovascular</a></li>
23 23 <li><a id="2" href="#" title="Digestive" onclick="showSelectedSystemPins(event)">Digestive</a></li>
... ...