Commit 582dbc1f64283fb0611f3c0b39d45bcf394f3508
Merge branch 'Develop' of http://52.6.196.163/ADAM/AIAHTML5 into AnnotationDawingDetectMode
Conflicts: 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js 400-SOURCECODE/AIAHTML5.Web/index.html
Showing
3 changed files
with
927 additions
and
422 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -472,7 +472,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
472 | 472 | url: 'app/views/da/da-view.html' |
473 | 473 | }, |
474 | 474 | title: localStorage.getItem("currentViewTitle"), |
475 | - | |
475 | + | |
476 | 476 | position: { |
477 | 477 | top: 70, |
478 | 478 | left: 1, |
... | ... | @@ -482,6 +482,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
482 | 482 | |
483 | 483 | }); |
484 | 484 | |
485 | + console.log('jsPanel loaded daImagePanel exist= ' + document.getElementById('daImagePanel')) | |
485 | 486 | //0.1 |
486 | 487 | $rootScope.currentSlug = 'da-body-view'; |
487 | 488 | |
... | ... | @@ -496,41 +497,69 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
496 | 497 | //0.3 |
497 | 498 | var daBodyviewElement = angular.element(document.getElementById("daBodyview")); |
498 | 499 | |
499 | - $timeout(function () { $compile(daBodyviewElement.contents())($scope) }, 250); | |
500 | + $timeout(function () { | |
501 | + $compile(daBodyviewElement.contents())($scope); | |
500 | 502 | |
503 | + console.log('html is compiled' + document.getElementById('daView')) | |
504 | + if (document.getElementById('daView') != null) { | |
501 | 505 | |
502 | - //0.4 added some stylesheets | |
503 | - $('#daBodyview').css("height", $(window).outerHeight()); | |
506 | + //0.4 added some stylesheets | |
507 | + $('#daBodyview').css("height", $(window).outerHeight()); | |
504 | 508 | |
505 | - $('#daBodyview').css("width", $(window).outerWidth()); | |
509 | + $('#daBodyview').css("width", $(window).outerWidth()); | |
506 | 510 | |
507 | - //1. load navigator man first | |
508 | - $scope.LoadBodyViewNavigatorImage(); | |
511 | + //1. load navigator man first | |
512 | + console.log('before LoadBodyViewNavigatorImage call') | |
513 | + $scope.LoadBodyViewNavigatorImage(); | |
509 | 514 | |
510 | - //$scope.loadSearchDataForBodyView(); | |
515 | + //$scope.loadSearchDataForBodyView(); | |
511 | 516 | |
512 | - $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); | |
517 | + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); | |
513 | 518 | |
514 | - $scope.layerNumber = 0; | |
519 | + $scope.layerNumber = 0; | |
515 | 520 | |
516 | - //2. | |
521 | + //2. | |
517 | 522 | |
518 | - console.log('currentBodyViewId just before sending: ' + currentBodyViewId); | |
519 | - $scope.loadBodyViewData(currentBodyViewId); | |
523 | + console.log('currentBodyViewId just before sending: ' + currentBodyViewId); | |
524 | + $scope.loadBodyViewData(currentBodyViewId); | |
520 | 525 | |
521 | - //2. load bodyRegion data | |
522 | - $rootScope.isLoading = true; | |
523 | - $rootScope.voId = localStorage.getItem("currentBodyViewId"); | |
526 | + //2. load bodyRegion data | |
527 | + $rootScope.isLoading = true; | |
528 | + $rootScope.voId = localStorage.getItem("currentBodyViewId"); | |
524 | 529 | |
525 | - $('#daBodyview').css("height", $(window).outerHeight()); | |
530 | + $('#daBodyview').css("height", $(window).outerHeight()); | |
526 | 531 | |
527 | - $('#daBodyview').css("width", $(window).outerWidth()); | |
532 | + $('#daBodyview').css("width", $(window).outerWidth()); | |
533 | + } | |
534 | + }, 250); | |
528 | 535 | } |
529 | 536 | |
530 | - angular.element(document).ready(function () { | |
531 | - | |
532 | - }) | |
537 | + angular.element(document).ready(function (e) { | |
538 | + $("#daImagePanel").resize(function () { | |
539 | + $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); | |
540 | + $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition); | |
541 | + }); | |
533 | 542 | |
543 | + $(document).on("mouseover", "#termList option", function (e) { | |
544 | + $('#termList option[selected="selected"]').attr("selected", false); | |
545 | + $(this).attr("selected", true); | |
546 | + }); | |
547 | + | |
548 | + $(document).keypress(function (e) { | |
549 | + if ($('#termList option[selected="selected"]').attr("id") == "undefined") { | |
550 | + return false; | |
551 | + } | |
552 | + else { | |
553 | + var originator = e.keyCode || e.which; | |
554 | + // alert($('#termList option[selected="selected"]').attr("id")); | |
555 | + if ($('#termList option[selected="selected"]').attr("id")) { | |
556 | + if (e.keyCode == 13) { | |
557 | + onListManagerTermSelection($('#termList option[selected="selected"]').attr("id")); | |
558 | + } | |
559 | + } | |
560 | + } | |
561 | + }); | |
562 | + }) | |
534 | 563 | |
535 | 564 | $scope.loadSearchDataForBodyView = function () { |
536 | 565 | |
... | ... | @@ -632,6 +661,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
632 | 661 | |
633 | 662 | //Code for displaying NavigatorImage for BodyView |
634 | 663 | $scope.LoadBodyViewNavigatorImage = function () { |
664 | + console.log('insideLoadBodyViewNavigatorImage') | |
635 | 665 | var NavigatorManJsonPath = '~/../content/data/json/da/da_dat_orient_image.json'; |
636 | 666 | |
637 | 667 | $http({ method: 'GET', url: NavigatorManJsonPath }) |
... | ... | @@ -698,7 +728,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
698 | 728 | |
699 | 729 | |
700 | 730 | $scope.LoadDefaultLayerImage = function () { |
701 | - | |
731 | + console.log('inside LoadDefaultLayerImage') | |
702 | 732 | $rootScope.isNormalMode = true; |
703 | 733 | |
704 | 734 | $scope.layerNumber = 0; |
... | ... | @@ -742,13 +772,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
742 | 772 | |
743 | 773 | $rootScope.isLoading = true; |
744 | 774 | $('#spinner').css('visibility', 'visible'); |
745 | - | |
775 | + $scope.modestyImageInfo = []; | |
746 | 776 | // annotation toolbar canvas |
747 | 777 | if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { |
748 | 778 | |
749 | 779 | $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="canvas" width="2277" height="3248" class="canvas-annotationStyle"></canvas>'); |
750 | - $scope.BindCanvasDrawingListners(); | |
751 | - // $rootScope.FreeStylePaint(); | |
780 | + $scope.BindCanvasDrawingListners(); | |
781 | + // $rootScope.FreeStylePaint(); | |
752 | 782 | |
753 | 783 | } |
754 | 784 | |
... | ... | @@ -777,8 +807,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
777 | 807 | $rootScope.BodyRegionCordinatesData = []; // create an empty array |
778 | 808 | |
779 | 809 | $('#daBodyview').css('width', '100%'); |
780 | - $('#canvasDiv').css('height', $('#daImagePanel').outerHeight() - 104) | |
781 | - //$('#canvasDiv').css('width', $('#daImagePanel').outerWidth() - 100) | |
810 | + var canvasDIvHeight = parseInt($('#daImagePanel').outerHeight()) - 104; | |
811 | + $('#canvasDiv').css('height', canvasDIvHeight); | |
782 | 812 | $('#leftToolBar').css('height', $('#daImagePanel').outerHeight()) |
783 | 813 | |
784 | 814 | |
... | ... | @@ -1370,7 +1400,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1370 | 1400 | } |
1371 | 1401 | } |
1372 | 1402 | |
1373 | - // $rootScope.previousHighlightList.push(RGBColor); | |
1403 | + // $rootScope.previousHighlightList.push(RGBColor); | |
1374 | 1404 | |
1375 | 1405 | $scope.highLightBodyBasedOnIcolor(RGBColor); |
1376 | 1406 | } |
... | ... | @@ -1382,7 +1412,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1382 | 1412 | //} |
1383 | 1413 | |
1384 | 1414 | //extarct clicked body part is extarct button is already enabled. |
1385 | - // debugger; | |
1415 | + // debugger; | |
1386 | 1416 | if ($rootScope.isExtract == true) { |
1387 | 1417 | $scope.enableExtract(false); |
1388 | 1418 | } |
... | ... | @@ -1505,7 +1535,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1505 | 1535 | |
1506 | 1536 | // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) |
1507 | 1537 | |
1508 | - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
1538 | + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
1509 | 1539 | |
1510 | 1540 | if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { |
1511 | 1541 | $scope.isEligibleForHighlight = true; |
... | ... | @@ -1743,7 +1773,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1743 | 1773 | } |
1744 | 1774 | } |
1745 | 1775 | |
1746 | - // $rootScope.previousHighlightList.push(RGBColor); | |
1776 | + // $rootScope.previousHighlightList.push(RGBColor); | |
1747 | 1777 | |
1748 | 1778 | |
1749 | 1779 | if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { } |
... | ... | @@ -1758,7 +1788,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1758 | 1788 | // $rootScope.previousHighlightList.push(RGBColor); |
1759 | 1789 | //} |
1760 | 1790 | |
1761 | - // debugger; | |
1791 | + // debugger; | |
1762 | 1792 | //extarct clisked body part is extarct button is already enabled. |
1763 | 1793 | if ($rootScope.isExtract == true) { |
1764 | 1794 | $scope.enableExtract(false); |
... | ... | @@ -1835,7 +1865,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1835 | 1865 | |
1836 | 1866 | if (isMaskImage == 'N') { |
1837 | 1867 | if (bodyRegionId == 'modestyImg3' || bodyRegionId == 'modestyImg2') { |
1838 | - //do nothing | |
1868 | + $scope.modestyImageInfo.push( | |
1869 | + | |
1870 | + { | |
1871 | + "bodyRegionId": bodyRegionId, "SRC": src, | |
1872 | + "Height": h, | |
1873 | + "Width": w, | |
1874 | + "x": x, | |
1875 | + "y": y, | |
1876 | + "haveMirror": 'false' | |
1877 | + } | |
1878 | + | |
1879 | + ); | |
1839 | 1880 | } |
1840 | 1881 | else { |
1841 | 1882 | |
... | ... | @@ -1914,6 +1955,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1914 | 1955 | console.log('just after highLightBody call'); |
1915 | 1956 | |
1916 | 1957 | } |
1958 | + else { | |
1959 | + $rootScope.isLoading = false; | |
1960 | + $('#spinner').css('visibility', 'hidden'); | |
1961 | + } | |
1917 | 1962 | } |
1918 | 1963 | else { |
1919 | 1964 | $rootScope.isLoading = false; |
... | ... | @@ -2209,7 +2254,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2209 | 2254 | $scope.aligneCanvasWithTerm() |
2210 | 2255 | } |
2211 | 2256 | |
2212 | - // $timeout(function () { $scope.DisableProgressBar() }, 1000); | |
2257 | + // $timeout(function () { $scope.DisableProgressBar() }, 1000); | |
2213 | 2258 | |
2214 | 2259 | |
2215 | 2260 | |
... | ... | @@ -2444,17 +2489,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2444 | 2489 | } |
2445 | 2490 | else { |
2446 | 2491 | var canvasDiv = document.getElementById('canvasDiv'); |
2447 | - $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition); | |
2448 | - $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition); | |
2492 | + $('#canvasDiv').scrollTop($scope.imageVerticalScrollPosition); | |
2493 | + $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition); | |
2449 | 2494 | |
2450 | - $rootScope.isLoading = false; | |
2495 | + $rootScope.isLoading = false; | |
2451 | 2496 | |
2452 | - $('#spinner').css('visibility', 'hidden'); | |
2497 | + $('#spinner').css('visibility', 'hidden'); | |
2453 | 2498 | //$('#canvasDiv').scrollLeft(newX); |
2454 | - //$('#canvasDiv').scrollTop(newY); | |
2499 | + //$('#canvasDiv').scrollTop(newY); | |
2455 | 2500 | } |
2456 | 2501 | |
2457 | - // $rootScope.isHighlightBodyByBodySystem = false; | |
2502 | + // $rootScope.isHighlightBodyByBodySystem = false; | |
2458 | 2503 | |
2459 | 2504 | |
2460 | 2505 | } |
... | ... | @@ -2650,46 +2695,46 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2650 | 2695 | |
2651 | 2696 | var tCanvas = document.getElementById('transparencyCanvas'); |
2652 | 2697 | |
2653 | - var tCanvasContext = tCanvas.getContext('2d'); | |
2698 | + var tCanvasContext = tCanvas.getContext('2d'); | |
2654 | 2699 | |
2655 | - var tCanvasHeight = parseInt((tCanvas.style.height).replace('px', '')); | |
2700 | + var tCanvasHeight = parseInt((tCanvas.style.height).replace('px', '')); | |
2656 | 2701 | |
2657 | - var tCanvasWidth = parseInt((tCanvas.style.width).replace('px', '')); | |
2702 | + var tCanvasWidth = parseInt((tCanvas.style.width).replace('px', '')); | |
2658 | 2703 | |
2659 | 2704 | |
2660 | - // var tCanvas = document.getElementById('transparencyCanvas'); | |
2661 | - if (tCanvas != null) { | |
2662 | - clearTransCanvas(); | |
2663 | - } | |
2664 | - var TransparencyBoxStartX = parseInt((tCanvas.style.left).replace('px', '')); | |
2665 | - var TransparencyEndX = parseInt((tCanvas.style.left).replace('px', '')) + parseInt((tCanvas.style.width.replace('px', ''))); | |
2666 | - var TransparencyBoxStartY = parseInt((tCanvas.style.top).replace('px', '')); | |
2667 | - var TransparencyBoxEndY = parseInt((tCanvas.style.top).replace('px', '')) + parseInt((tCanvas.style.height).replace('px', '')); | |
2668 | - var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight); | |
2669 | - var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth); | |
2705 | + // var tCanvas = document.getElementById('transparencyCanvas'); | |
2706 | + if (tCanvas != null) { | |
2707 | + clearTransCanvas(); | |
2708 | + } | |
2709 | + var TransparencyBoxStartX = parseInt((tCanvas.style.left).replace('px', '')); | |
2710 | + var TransparencyEndX = parseInt((tCanvas.style.left).replace('px', '')) + parseInt((tCanvas.style.width.replace('px', ''))); | |
2711 | + var TransparencyBoxStartY = parseInt((tCanvas.style.top).replace('px', '')); | |
2712 | + var TransparencyBoxEndY = parseInt((tCanvas.style.top).replace('px', '')) + parseInt((tCanvas.style.height).replace('px', '')); | |
2713 | + var transparencyBoxBottom = parseInt(TransparencyBoxStartY) + parseInt(tCanvasHeight); | |
2714 | + var transparencyBoxRight = parseInt(TransparencyBoxStartX) + parseInt(tCanvasWidth); | |
2670 | 2715 | |
2671 | - var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
2716 | + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
2672 | 2717 | |
2673 | - $.each(BodyRegionDictionary, function (index, value) { | |
2674 | - //debugger; | |
2675 | - // alert(' $.each(BodyRegionDictionary1') | |
2718 | + $.each(BodyRegionDictionary, function (index, value) { | |
2719 | + //debugger; | |
2720 | + // alert(' $.each(BodyRegionDictionary1') | |
2676 | 2721 | |
2677 | - var bodyRegionRight = parseInt(value.X) + parseInt(value.Width); | |
2678 | - var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height); | |
2722 | + var bodyRegionRight = parseInt(value.X) + parseInt(value.Width); | |
2723 | + var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height); | |
2679 | 2724 | |
2680 | 2725 | |
2681 | - // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom) | |
2682 | - if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { | |
2683 | - //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value); | |
2684 | - // debugger; | |
2685 | - $scope.layerNumber = parseInt(txtlayerNumber.value); | |
2726 | + // alert(' $.each(BodyRegionDictionary3. bodyRegionRight: ' + bodyRegionRight + ', bodyRegionBottom: ' + bodyRegionBottom) | |
2727 | + if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { | |
2728 | + //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value); | |
2729 | + // debugger; | |
2730 | + $scope.layerNumber = parseInt(txtlayerNumber.value); | |
2686 | 2731 | |
2687 | 2732 | |
2688 | - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false); | |
2689 | - } | |
2733 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false); | |
2734 | + } | |
2690 | 2735 | |
2691 | 2736 | |
2692 | - }) | |
2737 | + }) | |
2693 | 2738 | |
2694 | 2739 | } |
2695 | 2740 | |
... | ... | @@ -2747,10 +2792,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2747 | 2792 | if ($("#txtlayerNumber").val() == '') { |
2748 | 2793 | var layerInputVal = 0; |
2749 | 2794 | |
2750 | - var layerInputValInc = parseInt(layerInputVal); | |
2751 | - $scope.layerNumber = parseInt(layerInputValInc); | |
2752 | - $("#txtlayerNumber").val($scope.layerNumber); | |
2753 | - // $rootScope.PreviouslayerNumbr = $scope.layerNumber; | |
2795 | + var layerInputValInc = parseInt(layerInputVal); | |
2796 | + $scope.layerNumber = parseInt(layerInputValInc); | |
2797 | + $("#txtlayerNumber").val($scope.layerNumber); | |
2798 | + // $rootScope.PreviouslayerNumbr = $scope.layerNumber; | |
2754 | 2799 | |
2755 | 2800 | } |
2756 | 2801 | else { |
... | ... | @@ -2773,7 +2818,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
2773 | 2818 | var layerInputValDec = parseInt(layerInputVal); |
2774 | 2819 | $scope.layerNumber = parseInt(layerInputValDec); |
2775 | 2820 | $("#txtlayerNumber").val($scope.layerNumber); |
2776 | - // $rootScope.PreviouslayerNumbr = $scope.layerNumber; | |
2821 | + // $rootScope.PreviouslayerNumbr = $scope.layerNumber; | |
2777 | 2822 | |
2778 | 2823 | } |
2779 | 2824 | else |
... | ... | @@ -3060,10 +3105,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3060 | 3105 | |
3061 | 3106 | //$("#bord").css("display", "none"); |
3062 | 3107 | //$("#dot").css("display", "none"); |
3063 | - $('#sppeachBubble').remove(); | |
3108 | + $('#sppeachBubble').remove(); | |
3064 | 3109 | |
3065 | - $("#bord").remove(); | |
3066 | - $("#dot").remove(); | |
3110 | + $("#bord").remove(); | |
3111 | + $("#dot").remove(); | |
3067 | 3112 | |
3068 | 3113 | }); |
3069 | 3114 | |
... | ... | @@ -3490,7 +3535,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3490 | 3535 | drag: function (evt) { |
3491 | 3536 | |
3492 | 3537 | //$("#dot_annotation").css("display", "none"); |
3493 | - $("#dot_annotation").remove(); | |
3538 | + $("#dot_annotation").remove(); | |
3494 | 3539 | |
3495 | 3540 | var verticalScrollPosition = canvasDiv.scrollTop; |
3496 | 3541 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
... | ... | @@ -3824,7 +3869,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3824 | 3869 | if (document.getElementById('tempCanvas') != null) { |
3825 | 3870 | $('#tempCanvas').remove(); |
3826 | 3871 | } |
3827 | - if (document.getElementById('tempCanvas') == null) { | |
3872 | + if (document.getElementById('tempCanvas') == null || document.getElementById('tempCanvas') == undefined) { | |
3828 | 3873 | var tempCanvas = document.createElement('canvas'); |
3829 | 3874 | tempCanvas.id = 'tempCanvas'; |
3830 | 3875 | // $scope.tempCanvas = transparencyCanvas.id; |
... | ... | @@ -3839,6 +3884,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3839 | 3884 | document.getElementById('canvasDiv').appendChild(tempCanvas); |
3840 | 3885 | } |
3841 | 3886 | |
3887 | + | |
3842 | 3888 | $scope.isTransparencyActivated = true; |
3843 | 3889 | |
3844 | 3890 | var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; |
... | ... | @@ -3870,6 +3916,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3870 | 3916 | transparencyCanvas.style.top = $scope.startY + "px"//y + "px"; |
3871 | 3917 | transparencyCanvas.style.border = "black 1px solid"; |
3872 | 3918 | transparencyCanvas.style.backgroundColor = "transparent"; |
3919 | + transparencyCanvas.style.zIndex = 200; | |
3873 | 3920 | // transparencyCanvas.style.visibility = 'hidden'; |
3874 | 3921 | document.getElementById('canvasDiv').appendChild(transparencyCanvas); |
3875 | 3922 | $scope.transparencyChangeCounter = 0; |
... | ... | @@ -3884,27 +3931,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3884 | 3931 | |
3885 | 3932 | $(".ui-wrapper").css("z-index", "600"); |
3886 | 3933 | |
3887 | - // $('#transparencyScale').modal('show'); | |
3888 | - | |
3889 | - //canvasDiv.removeEventListener('mouseup', arguments.callee); | |
3890 | - //canvasDiv.removeEventListener('mousedown', arguments.callee); | |
3891 | - //canvasDiv.removeEventListener('mousemove', arguments.callee); | |
3892 | 3934 | } |
3893 | 3935 | if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { |
3894 | 3936 | |
3895 | - //if ($rootScope.voId != "9") { | |
3896 | - // if ($rootScope.voId != "11") { | |
3897 | - // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
3898 | - | |
3899 | - // } | |
3900 | - | |
3901 | - //} | |
3902 | 3937 | |
3903 | - //else { | |
3904 | - // if (value.bodyRegionId == "6") { | |
3905 | - // $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
3906 | - // } | |
3907 | - //} | |
3908 | 3938 | if (($rootScope.voId == "9" || $rootScope.voId == "11")) { |
3909 | 3939 | if (value.bodyRegionId == "6") { |
3910 | 3940 | $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); |
... | ... | @@ -3920,6 +3950,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3920 | 3950 | } |
3921 | 3951 | }) |
3922 | 3952 | |
3953 | + //for modesty | |
3954 | + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
3955 | + $.each($scope.modestyImageInfo, function (index, value) { | |
3956 | + // alert(' $.each(BodyRegionDictionary1') | |
3957 | + var transparencyBoxHeight = parseInt(TransparencyBoxEndY) - parseInt($scope.TransparencyBoxStartY); | |
3958 | + var transparencyBoxWidth = parseInt(TransparencyEndX) - parseInt($scope.TransparencyBoxStartX); | |
3959 | + var transparencyBoxBottom = parseInt($scope.TransparencyBoxStartY) + parseInt(transparencyBoxHeight); | |
3960 | + var transparencyBoxRight = parseInt($scope.TransparencyBoxStartX) + parseInt(transparencyBoxWidth); | |
3961 | + // alert(' $.each(BodyRegionDictionary2. transparencyBoxHeight: ' + transparencyBoxHeight + ',transparencyBoxBottom: ' + transparencyBoxBottom+', transparencyBoxRight: '+transparencyBoxRight) | |
3962 | + var bodyRegionRight = parseInt(value.x) + parseInt(value.Width); | |
3963 | + var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height); | |
3964 | + | |
3965 | + if ($scope.TransparencyBoxStartX <= bodyRegionRight && value.x <= transparencyBoxRight && $scope.TransparencyBoxStartY <= bodyRegionBottom && value.y <= transparencyBoxBottom) { | |
3966 | + | |
3967 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false); | |
3968 | + | |
3969 | + } | |
3970 | + }) | |
3971 | + } | |
3972 | + | |
3973 | + | |
3974 | + // | |
3975 | + | |
3923 | 3976 | // $('#transparencyScale').modal('show'); |
3924 | 3977 | $('#transparencyScale').css('position', 'fixed') |
3925 | 3978 | $('#transparencyScale').css('top', $scope.TBDrawStartY - 10) |
... | ... | @@ -3929,8 +3982,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3929 | 3982 | |
3930 | 3983 | |
3931 | 3984 | |
3932 | - document.getElementById('canvasDiv').removeEventListener("mousedown", mouseUpListener); | |
3933 | - document.getElementById('canvasDiv').removeEventListener("mousemove", mouseUpListener); | |
3985 | + document.getElementById('canvasDiv').removeEventListener("mousedown", mouseDownListener); | |
3986 | + document.getElementById('canvasDiv').removeEventListener("mousemove", mouseMoveListener); | |
3934 | 3987 | |
3935 | 3988 | document.getElementById('canvasDiv').removeEventListener("mouseup", mouseUpListener); |
3936 | 3989 | // document.getElementById('canvasDiv').removeEventListener("mousemove", mouseMoveListener); |
... | ... | @@ -3948,6 +4001,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3948 | 4001 | |
3949 | 4002 | $scope.loadTransparencyImage = function (bodyRegionId, Height, Width, X, Y, IsMirror, TransparencyBoxStartX, TransparencyEndX, TransparencyBoxStartY, TransparencyBoxEndY, scope, isLayerChanged, isTransparencyChanged) { |
3950 | 4003 | // debugger; |
4004 | + | |
4005 | + // else { | |
4006 | + | |
3951 | 4007 | var scope1 = angular.element(document.getElementById("DAView")).scope(); |
3952 | 4008 | var transparencyCanvas = document.getElementById('transparencyCanvas'); |
3953 | 4009 | |
... | ... | @@ -3973,12 +4029,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3973 | 4029 | var transparencyTempCanvas; |
3974 | 4030 | |
3975 | 4031 | |
4032 | + | |
3976 | 4033 | //X ends outside and start outside of bodyregion |
3977 | 4034 | if (TransparencyBoxStartX < X && TransparencyEndX > parseInt(X) + parseInt(Width)) { |
3978 | 4035 | XforCopyImage = 0; |
3979 | 4036 | WidthforCopyImage = Width; |
3980 | 4037 | WidthforTransImage = Width; |
3981 | - XforTransImage = parseInt(X) - (parseInt(TransparencyBoxStartX)); | |
4038 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4039 | + XforTransImage = 0; | |
4040 | + } | |
4041 | + else | |
4042 | + XforTransImage = parseInt(X) - (parseInt(TransparencyBoxStartX)); | |
3982 | 4043 | // alert('1') |
3983 | 4044 | } |
3984 | 4045 | else if (TransparencyBoxStartX < X && TransparencyEndX < parseInt(X) + parseInt(Width)) { |
... | ... | @@ -3990,7 +4051,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3990 | 4051 | WidthforTransImage = parseInt(TransparencyEndX) - parseInt(X); |
3991 | 4052 | |
3992 | 4053 | // alert(' scope.WidthforCopyImage: ' + scope.WidthforCopyImage) |
3993 | - XforTransImage = parseInt(X) - (parseInt(TransparencyBoxStartX)); | |
4054 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4055 | + XforTransImage = 0; | |
4056 | + } | |
4057 | + else | |
4058 | + XforTransImage = parseInt(X) - (parseInt(TransparencyBoxStartX)); | |
3994 | 4059 | |
3995 | 4060 | // alert('2') |
3996 | 4061 | } |
... | ... | @@ -4000,7 +4065,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4000 | 4065 | XforCopyImage = parseInt(TransparencyBoxStartX) - parseInt(X); |
4001 | 4066 | WidthforCopyImage = parseInt(X) + parseInt(Width) - parseInt(TransparencyBoxStartX); |
4002 | 4067 | WidthforTransImage = parseInt(X) + parseInt(Width) - parseInt(TransparencyBoxStartX); |
4003 | - XforTransImage = 0; | |
4068 | + | |
4069 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4070 | + | |
4071 | + XforTransImage = parseInt(TransparencyBoxStartX) - parseInt(X); | |
4072 | + } | |
4073 | + else | |
4074 | + XforTransImage = 0; | |
4004 | 4075 | // alert('3') |
4005 | 4076 | } |
4006 | 4077 | else if (TransparencyBoxStartX > X && TransparencyEndX < parseInt(X) + parseInt(Width)) { |
... | ... | @@ -4008,7 +4079,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4008 | 4079 | XforCopyImage = parseInt(TransparencyBoxStartX) - parseInt(X);//parseInt(X) + parseInt(Width) - parseInt(scope.TransparencyBoxStartX)// scope.TransparencyBoxStartX ; |
4009 | 4080 | WidthforCopyImage = parseInt(TransparencyEndX) - parseInt(TransparencyBoxStartX); |
4010 | 4081 | WidthforTransImage = parseInt(TransparencyEndX) - parseInt(TransparencyBoxStartX); |
4011 | - XforTransImage = 0 | |
4082 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4083 | + | |
4084 | + XforTransImage = parseInt(TransparencyBoxStartX) - parseInt(X); | |
4085 | + } | |
4086 | + else | |
4087 | + XforTransImage = 0; | |
4012 | 4088 | // alert('4. TransparencyBoxStartX: ' + TransparencyBoxStartX + ',X: ' + parseInt(X) + ',TransparencyEndX: ' + TransparencyEndX + ',XforCopyImage: ' + XforCopyImage) |
4013 | 4089 | } |
4014 | 4090 | |
... | ... | @@ -4024,7 +4100,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4024 | 4100 | |
4025 | 4101 | HeightforTransImage = Height; |
4026 | 4102 | //alert('Y ' + Y) |
4027 | - YforTransImage = parseFloat(Y) - parseInt(TransparencyBoxStartY)//parseFloat(Y) - (24.4); | |
4103 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4104 | + YforTransImage = 0; | |
4105 | + } | |
4106 | + else | |
4107 | + YforTransImage = parseFloat(Y) - parseInt(TransparencyBoxStartY)//parseFloat(Y) - (24.4); | |
4028 | 4108 | // alert('5') |
4029 | 4109 | } |
4030 | 4110 | else if (TransparencyBoxStartY < Y && TransparencyBoxEndY < (parseInt(Y) + parseInt(Height))) { |
... | ... | @@ -4034,7 +4114,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4034 | 4114 | |
4035 | 4115 | HeightforTransImage = (parseInt(TransparencyBoxEndY)) - parseInt(Y)// - parseInt(scope.TransparencyBoxStartY)); |
4036 | 4116 | |
4037 | - YforTransImage = parseFloat(Y) - parseInt(TransparencyBoxStartY);// - (24.4); | |
4117 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4118 | + YforTransImage = 0; | |
4119 | + } | |
4120 | + else | |
4121 | + YforTransImage = parseFloat(Y) - parseInt(TransparencyBoxStartY);// - (24.4); | |
4038 | 4122 | |
4039 | 4123 | } |
4040 | 4124 | else if (TransparencyBoxStartY > Y && TransparencyBoxEndY > parseInt(Y) + parseInt(Height)) { |
... | ... | @@ -4042,7 +4126,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4042 | 4126 | YforCopyImage = parseInt(TransparencyBoxStartY) - parseInt(Y); |
4043 | 4127 | HeightforCopyImage = parseInt(Y) + parseInt(Height) - parseInt(TransparencyBoxStartY); |
4044 | 4128 | HeightforTransImage = parseInt(Y) + parseInt(Height) - parseInt(TransparencyBoxStartY); |
4045 | - YforTransImage = 0; | |
4129 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4130 | + YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y); | |
4131 | + | |
4132 | + } | |
4133 | + else | |
4134 | + YforTransImage = 0; | |
4046 | 4135 | |
4047 | 4136 | } |
4048 | 4137 | else if (TransparencyBoxStartY > Y && TransparencyBoxEndY < parseInt(Y) + parseInt(Height)) { |
... | ... | @@ -4050,149 +4139,142 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4050 | 4139 | YforCopyImage = parseInt(TransparencyBoxStartY) - parseInt(Y); |
4051 | 4140 | HeightforCopyImage = parseInt(TransparencyBoxEndY) - parseInt(TransparencyBoxStartY); |
4052 | 4141 | HeightforTransImage = parseInt(TransparencyBoxEndY) - parseInt(TransparencyBoxStartY); |
4053 | - YforTransImage = 0; | |
4054 | - } | |
4142 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4143 | + YforTransImage = parseInt(TransparencyBoxStartY) - parseInt(Y); | |
4055 | 4144 | |
4056 | - | |
4057 | - //this changes the transparency when user click on transparency scale(we have already set the original | |
4058 | - //data on tras canvas irrespective of the trans number, so we can chnage the transparnecy of original data not the manipulated) | |
4059 | - if (isTransparencyChanged == true) { | |
4060 | - | |
4061 | - // var txtTransparencyChange = document.getElementById("txtTransparencyChange"); | |
4062 | - | |
4063 | - var transNumber = $scope.transNumber; | |
4064 | - | |
4065 | - var ctx = document.getElementById('transparencyCanvas').getContext('2d'); | |
4066 | - | |
4067 | - var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4068 | - | |
4069 | - // get the image data values | |
4070 | - var imageData = imageDa.data; | |
4071 | - var length = imageData.length; | |
4072 | - // set every fourth value to 50 | |
4073 | - for (var i = 3; i < length; i += 4) { | |
4074 | - //NIKITA | |
4075 | - if ($scope.voId == "9" || $scope.voId == "11") { | |
4076 | - | |
4077 | - if (imageData[i] == 0) { | |
4078 | - | |
4079 | - } | |
4080 | - else { | |
4081 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4082 | - } | |
4083 | - } | |
4084 | - else { | |
4085 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4086 | - } | |
4087 | - | |
4088 | - // imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4089 | 4145 | } |
4090 | - // after the manipulation, reset the data | |
4091 | - // imageDa.data = imageData; | |
4092 | - // and put the imagedata back to the canvas | |
4093 | - ctx.putImageData(imageDa, XforTransImage, YforTransImage); | |
4146 | + else | |
4147 | + YforTransImage = 0; | |
4148 | + } | |
4094 | 4149 | |
4095 | 4150 | |
4151 | + //0. get current layer number | |
4152 | + if ($scope.isResized) { | |
4153 | + //do nothing | |
4096 | 4154 | } |
4097 | - else { | |
4155 | + else if (isLayerChanged) { | |
4098 | 4156 | |
4099 | - //0. get current layer number | |
4100 | - if ($scope.isResized) { | |
4101 | - //do nothing | |
4102 | - } | |
4103 | - else if (isLayerChanged) { | |
4104 | 4157 | |
4105 | - // alert('isMousUp on isLayerChanged'); | |
4158 | + } | |
4159 | + else { | |
4106 | 4160 | |
4107 | - //$scope.layerNumber = parseInt($('#txtlayerNumber').val()); | |
4108 | 4161 | |
4109 | - } | |
4110 | - else { | |
4111 | - //var currentLayer = parseInt($('#txtlayerNumber').val()); | |
4162 | + var tranparencyLayer; | |
4112 | 4163 | |
4113 | - //var tranparencyLayer = currentLayer + 1; | |
4114 | - //$scope.layerNumber = tranparencyLayer; | |
4164 | + var currentLayer = $scope.layerNumberBeforeTrans; | |
4115 | 4165 | |
4116 | - var tranparencyLayer; | |
4166 | + if (currentLayer == $rootScope.totalLayers) { | |
4117 | 4167 | |
4118 | - //var currentLayer = parseInt($('#txtlayerNumber').val()); | |
4119 | - var currentLayer = $scope.layerNumberBeforeTrans; | |
4168 | + tranparencyLayer = currentLayer; | |
4120 | 4169 | |
4121 | - if (currentLayer == $rootScope.totalLayers) { | |
4170 | + } | |
4122 | 4171 | |
4123 | - tranparencyLayer = currentLayer; | |
4172 | + else { | |
4124 | 4173 | |
4125 | - } | |
4174 | + tranparencyLayer = currentLayer + 1; | |
4126 | 4175 | |
4127 | - else { | |
4176 | + } | |
4128 | 4177 | |
4129 | - tranparencyLayer = currentLayer + 1; | |
4178 | + $scope.layerNumber = tranparencyLayer; | |
4130 | 4179 | |
4131 | - } | |
4180 | + } | |
4132 | 4181 | |
4133 | - $scope.layerNumber = tranparencyLayer; | |
4182 | + $('#txtlayerNumber').val($scope.layerNumber); | |
4134 | 4183 | |
4135 | - } | |
4184 | + //dedebugger; | |
4185 | + var tranparencyImgSrc; | |
4186 | + var tranparencyMaskImgSrc; | |
4187 | + //for modesty image | |
4188 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg')))// == "2" || bodyRegionId == "3")) { | |
4189 | + { | |
4190 | + var modestyBodyRegionData = new jinqJs() | |
4191 | + .from($scope.modestyImageInfo) | |
4192 | + .where('bodyRegionId == ' + bodyRegionId) | |
4193 | + .select(); | |
4194 | + tranparencyImgSrc = modestyBodyRegionData[0].SRC; | |
4195 | + } | |
4136 | 4196 | |
4137 | - $('#txtlayerNumber').val($scope.layerNumber); | |
4197 | + //modesty end | |
4138 | 4198 | |
4139 | - //dedebugger; | |
4140 | 4199 | //1. get the image source |
4141 | - var tranparencyImgSrc; | |
4142 | 4200 | |
4201 | + else { | |
4143 | 4202 | tranparencyImgSrc = $scope.GetImageSource(bodyRegionId); |
4144 | - var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4145 | - // debugger; | |
4146 | - var oldCanvas; | |
4203 | + tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4204 | + } | |
4205 | + // var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4206 | + // debugger; | |
4207 | + var oldCanvas; | |
4147 | 4208 | |
4148 | - if (IsMirror == 'Yes') { | |
4149 | - oldCanvas = document.getElementById('transparencyTempCanvas_MR_' + bodyRegionId) | |
4150 | - } | |
4151 | - else { | |
4152 | - oldCanvas = document.getElementById('transparencyTempCanvas_' + bodyRegionId) | |
4209 | + if (IsMirror == 'Yes') { | |
4210 | + oldCanvas = document.getElementById('transparencyTempCanvas_MR_' + bodyRegionId) | |
4211 | + } | |
4212 | + else { | |
4213 | + | |
4214 | + oldCanvas = document.getElementById('transparencyTempCanvas_' + bodyRegionId) | |
4215 | + | |
4216 | + } | |
4153 | 4217 | |
4154 | - } | |
4218 | + if (oldCanvas != null) { | |
4219 | + document.getElementById('canvasDiv').removeChild(oldCanvas); | |
4220 | + } | |
4155 | 4221 | |
4156 | - if (oldCanvas != null) { | |
4157 | - document.getElementById('canvasDiv').removeChild(oldCanvas); | |
4158 | - } | |
4222 | + //remove tempmask canvas | |
4223 | + var oldtempTransCanvasMask; | |
4224 | + var oldtempTransCanvasMaskMR; | |
4225 | + if (IsMirror == 'Yes') { | |
4226 | + oldtempTransCanvasMaskMR = document.getElementById('transparencyTempCanvasMask_MR' + bodyRegionId + '_mci'); | |
4227 | + oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_' + bodyRegionId + '_mci'); | |
4159 | 4228 | |
4160 | - //remove tempmask canvas | |
4161 | - var oldtempTransCanvasMask; | |
4162 | - if (IsMirror == 'Yes') { | |
4163 | - oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_MR_' + bodyRegionId + '_mci'); | |
4229 | + if (oldtempTransCanvasMaskMR != null) { | |
4230 | + document.getElementById('canvasDiv').removeChild(oldtempTransCanvasMaskMR); | |
4164 | 4231 | } |
4165 | - else { | |
4166 | - oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_' + bodyRegionId + '_mci'); | |
4232 | + } | |
4233 | + else { | |
4234 | + oldtempTransCanvasMask = document.getElementById('transparencyTempCanvasMask_' + bodyRegionId + '_mci'); | |
4167 | 4235 | |
4168 | - } | |
4169 | - if (oldtempTransCanvasMask != null) { | |
4170 | - document.getElementById('canvasDiv').removeChild(oldtempTransCanvasMask); | |
4171 | - } | |
4236 | + } | |
4237 | + if (oldtempTransCanvasMask != null) { | |
4238 | + document.getElementById('canvasDiv').removeChild(oldtempTransCanvasMask); | |
4239 | + } | |
4172 | 4240 | |
4173 | - transparencyTempCanvas = document.createElement('canvas'); | |
4174 | - var transparencyTempcanavsMask = document.createElement('canvas'); | |
4175 | - //if mirror then draw mask image for non mirrored body region for annotation | |
4176 | - if (IsMirror == 'Yes') { | |
4177 | - transparencyTempCanvas.id = 'transparencyTempCanvas_MR_' + bodyRegionId; | |
4178 | - transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_MR' + bodyRegionId + '_mci'; | |
4241 | + transparencyTempCanvas = document.createElement('canvas'); | |
4242 | + var transparencyTempcanavsMask = document.createElement('canvas'); | |
4243 | + //if mirror then draw mask image for non mirrored body region for annotation | |
4244 | + if (IsMirror == 'Yes') { | |
4245 | + transparencyTempCanvas.id = 'transparencyTempCanvas_MR_' + bodyRegionId; | |
4246 | + transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_MR' + bodyRegionId + '_mci'; | |
4247 | + } | |
4248 | + else { | |
4249 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4250 | + transparencyTempCanvas.id = 'transparencyTempCanvas_' + bodyRegionId; | |
4251 | + // transparencyTempCanvas.style.visibility = 'visible'; | |
4252 | + //transparencyTempCanvas.style.zIndex = '1000' | |
4179 | 4253 | } |
4180 | 4254 | else { |
4181 | 4255 | transparencyTempCanvas.id = 'transparencyTempCanvas_' + bodyRegionId; |
4182 | 4256 | transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci'; |
4183 | - | |
4184 | 4257 | } |
4185 | - transparencyTempCanvas.height = Height; | |
4186 | - transparencyTempCanvas.width = Width; | |
4187 | - transparencyTempCanvas.style.position = "absolute"; | |
4188 | - transparencyTempCanvas.style.left = X + 'px' // x + "px"; | |
4189 | - transparencyTempCanvas.style.top = Y + "px"//y + "px"; | |
4190 | - transparencyTempCanvas.style.visibility = 'hidden'; | |
4191 | - //transparencyTempCanvas.style.visibility = 'visible'; | |
4192 | - // transparencyCanvas.style.zIndex = 4000; | |
4193 | - document.getElementById('canvasDiv').appendChild(transparencyTempCanvas); | |
4194 | 4258 | |
4195 | - //create temp mask canvas | |
4259 | + } | |
4260 | + transparencyTempCanvas.height = Height; | |
4261 | + transparencyTempCanvas.width = Width; | |
4262 | + transparencyTempCanvas.style.position = "absolute"; | |
4263 | + transparencyTempCanvas.style.left = X + 'px' // x + "px"; | |
4264 | + transparencyTempCanvas.style.top = Y + "px"//y + "px"; | |
4265 | + //if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4266 | + // transparencyTempCanvas.style.visibility = 'visible'; | |
4267 | + //} | |
4268 | + //else { | |
4269 | + transparencyTempCanvas.style.visibility = 'hidden'; | |
4270 | + // } | |
4271 | + //transparencyTempCanvas.style.visibility = 'visible'; | |
4272 | + // transparencyCanvas.style.zIndex = 4000; | |
4273 | + document.getElementById('canvasDiv').appendChild(transparencyTempCanvas); | |
4274 | + | |
4275 | + //create temp mask canvas | |
4276 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { } | |
4277 | + else { | |
4196 | 4278 | transparencyTempcanavsMask.height = Height; |
4197 | 4279 | transparencyTempcanavsMask.width = Width; |
4198 | 4280 | transparencyTempcanavsMask.style.position = "absolute"; |
... | ... | @@ -4202,14 +4284,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4202 | 4284 | //transparencyTempCanvas.style.visibility = 'visible'; |
4203 | 4285 | // transparencyCanvas.style.border = "black 1px solid"; |
4204 | 4286 | document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask); |
4287 | + } | |
4288 | + | |
4289 | + //for modesty canvas | |
4290 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4205 | 4291 | |
4292 | + var modestyTransTempCanvasId = 'tempCanvasModesty_' + bodyRegionId; | |
4293 | + var modestyTransCanvasId = 'modestyTransCanavs_' + bodyRegionId; | |
4294 | + if (document.getElementById(modestyTransTempCanvasId) != null) { | |
4295 | + document.getElementById(modestyTransTempCanvasId).parentNode.removeChild(document.getElementById(modestyTransTempCanvasId)); | |
4296 | + } | |
4297 | + | |
4298 | + if (document.getElementById(modestyTransTempCanvasId) == null || document.getElementById(modestyTransTempCanvasId) == undefined) { | |
4299 | + var tempCanvasModesty = document.createElement('canvas'); | |
4300 | + tempCanvasModesty.id = modestyTransTempCanvasId; | |
4301 | + // $scope.tempCanvas = transparencyCanvas.id; | |
4302 | + tempCanvasModesty.height = Height; | |
4303 | + tempCanvasModesty.width = Width; | |
4304 | + tempCanvasModesty.style.position = "absolute"; | |
4305 | + tempCanvasModesty.style.left = 10 + 'px'; | |
4306 | + tempCanvasModesty.style.top = 10 + 'px'; | |
4307 | + tempCanvasModesty.style.backgroundColor = "transparent"; | |
4308 | + tempCanvasModesty.style.visibility = 'hidden'; | |
4309 | + tempCanvasModesty.style.border = "black 1px solid"; | |
4310 | + document.getElementById('canvasDiv').appendChild(tempCanvasModesty); | |
4311 | + } | |
4312 | + if (document.getElementById(modestyTransCanvasId) != null) { | |
4313 | + document.getElementById(modestyTransCanvasId).parentNode.removeChild(document.getElementById(modestyTransCanvasId)); | |
4314 | + } | |
4315 | + | |
4316 | + if (document.getElementById(modestyTransCanvasId) == null || document.getElementById(modestyTransCanvasId) == undefined) { | |
4317 | + var canvasModesty = document.createElement('canvas'); | |
4318 | + canvasModesty.id = modestyTransCanvasId; | |
4319 | + // $scope.tempCanvas = transparencyCanvas.id; | |
4320 | + canvasModesty.height = Height; | |
4321 | + canvasModesty.width = Width; | |
4322 | + canvasModesty.style.position = "absolute"; | |
4323 | + canvasModesty.style.left = X + 'px'; | |
4324 | + canvasModesty.style.top = Y + 'px'; | |
4325 | + //canvasModesty.style.backgroundColor = "transparent"; | |
4326 | + canvasModesty.style.visibility = 'visible'; | |
4327 | + canvasModesty.style.zIndex = '2000'; | |
4328 | + canvasModesty.addEventListener('click', OnClickModestyTransCanvas); | |
4329 | + | |
4330 | + // tempcanvasModestyCanvasModesty.style.border = "black 1px solid"; | |
4331 | + document.getElementById('canvasDiv').appendChild(canvasModesty); | |
4332 | + } | |
4333 | + } | |
4206 | 4334 | |
4335 | + if (tranparencyImgSrc != undefined) { | |
4207 | 4336 | var tempImg = new Image(); |
4208 | - tempImg.src = tranparencyImgSrc;//"http://localhost/AIA/" + tranparencyImgSrc; | |
4209 | 4337 | |
4210 | 4338 | |
4211 | 4339 | tempImg.onload = function () { |
4212 | - // debugger; | |
4213 | 4340 | var tempCtx = transparencyTempCanvas.getContext('2d'); |
4214 | 4341 | |
4215 | 4342 | if (IsMirror == 'Yes') { |
... | ... | @@ -4230,7 +4357,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4230 | 4357 | tempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId; |
4231 | 4358 | } |
4232 | 4359 | else { |
4233 | - tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId; | |
4360 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4361 | + tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId;//bodyRegionId; | |
4362 | + } | |
4363 | + else | |
4364 | + tempCanvasID = 'transparencyTempCanvas_' + bodyRegionId; | |
4234 | 4365 | } |
4235 | 4366 | |
4236 | 4367 | |
... | ... | @@ -4248,11 +4379,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4248 | 4379 | |
4249 | 4380 | //keep the original image on temp canavs to use it in changing transparency |
4250 | 4381 | |
4251 | - if (document.getElementById('tempCanvas') != null) { | |
4252 | - var contx = document.getElementById('tempCanvas').getContext('2d'); | |
4253 | - var tbTempCanvas = document.getElementById(tempCanvasID) | |
4254 | - contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4255 | 4382 | |
4383 | + | |
4384 | + //if (document.getElementById(modestyTransTempCanvasId) != undefined || document.getElementById(modestyTransTempCanvasId) != null) { | |
4385 | + // var contxModesty = document.getElementById(modestyTransTempCanvasId).getContext('2d'); | |
4386 | + // var tbTempCanvas = document.getElementById(tempCanvasID) | |
4387 | + // contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4388 | + | |
4389 | + //} | |
4390 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4391 | + var modestyTempCanvasId = 'tempCanvasModesty_' + bodyRegionId; | |
4392 | + if (document.getElementById(modestyTempCanvasId) != undefined || document.getElementById(modestyTempCanvasId) != null) { | |
4393 | + var contxModesty = document.getElementById(modestyTempCanvasId).getContext('2d'); | |
4394 | + var tbTempCanvas = document.getElementById(tempCanvasID) | |
4395 | + contxModesty.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4396 | + | |
4397 | + } | |
4398 | + } | |
4399 | + else { | |
4400 | + | |
4401 | + if (document.getElementById('tempCanvas') != null && document.getElementById('tempCanvas') != undefined) { | |
4402 | + var contx = document.getElementById('tempCanvas').getContext('2d'); | |
4403 | + var tbTempCanvas = document.getElementById(tempCanvasID) | |
4404 | + contx.drawImage(tbTempCanvas, XforCopyImage, YforCopyImage, WidthforCopyImage, HeightforCopyImage, XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4405 | + | |
4406 | + } | |
4256 | 4407 | } |
4257 | 4408 | |
4258 | 4409 | // get the image data values |
... | ... | @@ -4275,15 +4426,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4275 | 4426 | } |
4276 | 4427 | } |
4277 | 4428 | else { |
4278 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4429 | + if (imageData[i] == 0) { | |
4430 | + | |
4431 | + } | |
4432 | + else { | |
4433 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4434 | + } | |
4279 | 4435 | } |
4280 | 4436 | } |
4281 | 4437 | |
4282 | 4438 | |
4283 | 4439 | tempCtx.putImageData(imageD, 0, 0); |
4284 | 4440 | |
4285 | - | |
4286 | - var ctx = transparencyCanvas.getContext('2d'); | |
4441 | + var ctx; | |
4442 | + if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4443 | + ctx = document.getElementById(modestyTransCanvasId).getContext('2d'); | |
4444 | + } | |
4445 | + else | |
4446 | + ctx = transparencyCanvas.getContext('2d'); | |
4287 | 4447 | |
4288 | 4448 | |
4289 | 4449 | var TrtempCanvasID |
... | ... | @@ -4291,6 +4451,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4291 | 4451 | TrtempCanvasID = 'transparencyTempCanvas_MR_' + bodyRegionId; |
4292 | 4452 | } |
4293 | 4453 | else { |
4454 | + //if ($rootScope.isModestyOn == true && (bodyRegionId.match('modestyImg'))) { | |
4455 | + // TrtempCanvasID = 'modestyTransparencyTempCanvas_' + bodyRegionId; | |
4456 | + //} | |
4457 | + //else | |
4294 | 4458 | TrtempCanvasID = 'transparencyTempCanvas_' + bodyRegionId; |
4295 | 4459 | } |
4296 | 4460 | |
... | ... | @@ -4310,47 +4474,138 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4310 | 4474 | PreviousBodyRegionHeight = 0; |
4311 | 4475 | |
4312 | 4476 | } |
4477 | + tempImg.src = tranparencyImgSrc;//"http://localhost/AIA/" + tranparencyImgSrc; | |
4313 | 4478 | |
4479 | + } | |
4314 | 4480 | |
4315 | - //mask image code | |
4316 | - //draw mask for annotation | |
4317 | - var tempMaskImg = new Image(); | |
4318 | - var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4319 | - tempMaskImg.src = tranparencyMaskImgSrc;//"http://localhost/AIA/" + tranparencyMaskImgSrc; | |
4320 | - tempMaskImg.onload = function () { | |
4321 | - // debugger; | |
4322 | - var tempmaskCtx = transparencyTempcanavsMask.getContext('2d'); | |
4323 | - | |
4324 | - if (IsMirror == 'Yes') { | |
4325 | - //debugger; | |
4326 | - tempmaskCtx.save(); | |
4327 | - tempmaskCtx.translate(Width, 0); | |
4328 | - tempmaskCtx.scale(-1, 1); | |
4329 | - tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4330 | - } | |
4331 | - else { | |
4332 | - tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4333 | 4481 | |
4334 | - } | |
4482 | + //mask image code | |
4483 | + //draw mask for annotation | |
4484 | + var tempMaskImg = new Image(); | |
4485 | + var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4486 | + tempMaskImg.src = tranparencyMaskImgSrc;//"http://localhost/AIA/" + tranparencyMaskImgSrc; | |
4487 | + tempMaskImg.onload = function () { | |
4488 | + // debugger; | |
4489 | + var tempmaskCtx = transparencyTempcanavsMask.getContext('2d'); | |
4335 | 4490 | |
4491 | + if (IsMirror == 'Yes') { | |
4492 | + //debugger; | |
4493 | + tempmaskCtx.save(); | |
4494 | + tempmaskCtx.translate(Width, 0); | |
4495 | + tempmaskCtx.scale(-1, 1); | |
4496 | + tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4497 | + } | |
4498 | + else { | |
4499 | + tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4336 | 4500 | |
4337 | 4501 | } |
4338 | 4502 | |
4339 | 4503 | |
4340 | - PreviousBodyRegionHeight = HeightforTransImage; | |
4341 | - PreviousBodyRegionY = YforTransImage; | |
4342 | - PreviousBodyRegionWidth = WidthforTransImage; | |
4343 | - PreviousBodyRegionX = XforTransImage; | |
4344 | - previousBodyRegionId = bodyRegionId; | |
4504 | + } | |
4345 | 4505 | |
4346 | - // $scope.layerNumber = parseInt($scope.layerNumber - 1); | |
4347 | 4506 | |
4348 | - } | |
4507 | + PreviousBodyRegionHeight = HeightforTransImage; | |
4508 | + PreviousBodyRegionY = YforTransImage; | |
4509 | + PreviousBodyRegionWidth = WidthforTransImage; | |
4510 | + PreviousBodyRegionX = XforTransImage; | |
4511 | + previousBodyRegionId = bodyRegionId; | |
4512 | + | |
4513 | + // $scope.layerNumber = parseInt($scope.layerNumber - 1); | |
4514 | + | |
4515 | + //} | |
4349 | 4516 | |
4350 | 4517 | } |
4351 | 4518 | |
4519 | + $scope.changeTransparency = function () { | |
4520 | + //this changes the transparency when user click on transparency scale(we have already set the original | |
4521 | + //data on tras canvas irrespective of the trans number, so we can chnage the transparnecy of original data not the manipulated) | |
4522 | + // if (isTransparencyChanged == true) { | |
4523 | + | |
4524 | + // var txtTransparencyChange = document.getElementById("txtTransparencyChange"); | |
4525 | + | |
4526 | + var transNumber = $scope.transNumber; | |
4527 | + | |
4528 | + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); | |
4529 | + var modestyTemCanvas = $("canvas[id*='tempCanvasModesty_']"); | |
4530 | + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
4531 | + | |
4532 | + for (var j = 0; j < modestyTransCanvases.length; j++) { | |
4533 | + var ctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); | |
4534 | + var imageDa = ctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); | |
4535 | + //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
4536 | + | |
4537 | + var imageData = imageDa.data; | |
4538 | + var length = imageData.length; | |
4539 | + // set every fourth value to 50 | |
4540 | + for (var i = 3; i < length; i += 4) { | |
4541 | + //NIKITA | |
4542 | + if ($scope.voId == "9" || $scope.voId == "11") { | |
4543 | + | |
4544 | + if (imageData[i] == 0) { | |
4545 | + | |
4546 | + } | |
4547 | + else { | |
4548 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4549 | + } | |
4550 | + } | |
4551 | + else { | |
4552 | + if (imageData[i] == 0) { | |
4553 | + | |
4554 | + } | |
4555 | + else | |
4556 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4557 | + } | |
4558 | + | |
4559 | + // imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4560 | + } | |
4561 | + // after the manipulation, reset the data | |
4562 | + // imageDa.data = imageData; | |
4563 | + // and put the imagedata back to the canvas | |
4564 | + //ctx.putImageData(imageDa, XforTransImage, YforTransImage); | |
4565 | + ctx.putImageData(imageDa, 0, 0); | |
4566 | + } | |
4567 | + } | |
4568 | + | |
4569 | + | |
4570 | + var ctx = document.getElementById('transparencyCanvas').getContext('2d'); | |
4571 | + | |
4572 | + // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); | |
4573 | + var imageDa = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); | |
4574 | + | |
4575 | + // get the image data values | |
4576 | + var imageData = imageDa.data; | |
4577 | + var length = imageData.length; | |
4578 | + // set every fourth value to 50 | |
4579 | + for (var i = 3; i < length; i += 4) { | |
4580 | + //NIKITA | |
4581 | + if ($scope.voId == "9" || $scope.voId == "11") { | |
4352 | 4582 | |
4583 | + if (imageData[i] == 0) { | |
4353 | 4584 | |
4585 | + } | |
4586 | + else { | |
4587 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4588 | + } | |
4589 | + } | |
4590 | + else { | |
4591 | + if (imageData[i] == 0) { | |
4592 | + | |
4593 | + } | |
4594 | + else | |
4595 | + imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4596 | + } | |
4597 | + | |
4598 | + // imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
4599 | + } | |
4600 | + // after the manipulation, reset the data | |
4601 | + // imageDa.data = imageData; | |
4602 | + // and put the imagedata back to the canvas | |
4603 | + //ctx.putImageData(imageDa, XforTransImage, YforTransImage); | |
4604 | + ctx.putImageData(imageDa, 0, 0); | |
4605 | + | |
4606 | + | |
4607 | + //} | |
4608 | + } | |
4354 | 4609 | |
4355 | 4610 | |
4356 | 4611 | |
... | ... | @@ -4380,6 +4635,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4380 | 4635 | } |
4381 | 4636 | |
4382 | 4637 | |
4638 | + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); | |
4639 | + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
4640 | + for (var j = 0; j < modestyTransCanvases.length; j++) { | |
4641 | + | |
4642 | + modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
4643 | + } | |
4644 | + } | |
4645 | + | |
4646 | + var modestyTempCanvases = $("canvas[id*='tempCanvasModesty_']"); | |
4647 | + if (modestyTempCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
4648 | + for (var j = 0; j < modestyTempCanvases.length; j++) { | |
4649 | + | |
4650 | + modestyTempCanvases[j].parentNode.removeChild(modestyTempCanvases[j]); | |
4651 | + } | |
4652 | + } | |
4653 | + | |
4383 | 4654 | $scope.isResized = true; |
4384 | 4655 | |
4385 | 4656 | |
... | ... | @@ -4395,10 +4666,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4395 | 4666 | transparencyCanvas.style.left = tCanvas.style.left; // x + "px"; |
4396 | 4667 | transparencyCanvas.style.top = tCanvas.style.top//y + "px"; |
4397 | 4668 | transparencyCanvas.style.border = "black 1px solid"; |
4669 | + transparencyCanvas.style.zIndex = 200; | |
4670 | + | |
4671 | + | |
4398 | 4672 | document.getElementById('canvasDiv').appendChild(transparencyCanvas); |
4399 | 4673 | |
4400 | 4674 | $('#transparencyCanvas').resizable({ handles: "e,s,se,w,n,ne,nw,sw", stop: function (event, ui) { resizeCanvas(); }, start: function (event, ui) { clearTransCanvas(); } }); |
4675 | + $(".ui-wrapper").css("z-index", "600"); | |
4401 | 4676 | |
4677 | + //bind click listener | |
4678 | + transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); | |
4402 | 4679 | } |
4403 | 4680 | $scope.transparencyCanvasHeight = tCanvasHeight; |
4404 | 4681 | $scope.transparencyCanvasWidth = tCanvasWidth; |
... | ... | @@ -4449,17 +4726,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4449 | 4726 | |
4450 | 4727 | |
4451 | 4728 | }) |
4452 | - //bind click listener | |
4453 | - //bind click listener | |
4454 | - transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener); | |
4729 | + | |
4730 | + | |
4731 | + //for modesty | |
4732 | + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
4733 | + $.each($scope.modestyImageInfo, function (index, value) { | |
4734 | + // alert(' $.each(BodyRegionDictionary1') | |
4735 | + | |
4736 | + | |
4737 | + var bodyRegionRight = parseInt(value.x) + parseInt(value.Width); | |
4738 | + var bodyRegionBottom = parseInt(value.y) + parseInt(value.Height); | |
4739 | + var TBRight = parseInt((document.getElementById('transparencyCanvas').style.left).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas').style.width).replace('px', '')); | |
4740 | + var TBBottom = parseInt((document.getElementById('transparencyCanvas').style.top).replace('px', '')) + parseInt((document.getElementById('transparencyCanvas').style.height).replace('px', '')); | |
4741 | + var TBStartX = parseInt((document.getElementById('transparencyCanvas').style.left).replace('px', '')); | |
4742 | + var TBStartY = parseInt((document.getElementById('transparencyCanvas').style.top).replace('px', '')); | |
4743 | + | |
4455 | 4744 | |
4456 | 4745 | |
4457 | 4746 | |
4747 | + if (TBStartX <= bodyRegionRight && value.x <= TBRight && TBStartY <= bodyRegionBottom && value.y <= TBBottom) { | |
4748 | + | |
4749 | + | |
4750 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.x, value.y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false); | |
4751 | + | |
4752 | + } | |
4753 | + }) | |
4754 | + } | |
4755 | + | |
4458 | 4756 | // }); |
4459 | - $(".ui-wrapper").css("z-index", "600"); | |
4757 | + //$(".ui-wrapper").css("z-index", "600"); | |
4460 | 4758 | $scope.isResized = false; |
4461 | 4759 | } |
4462 | 4760 | |
4761 | + | |
4463 | 4762 | function TransparencyCanvasClickListener(evt) { |
4464 | 4763 | //alert('tb clicked') |
4465 | 4764 | // debugger; |
... | ... | @@ -4482,49 +4781,49 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4482 | 4781 | var isMirror; |
4483 | 4782 | var width; |
4484 | 4783 | var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; |
4485 | - if ($rootScope.viewOrientationId == 5) { | |
4784 | + if ($rootScope.viewOrientationId == 5) { | |
4486 | 4785 | |
4487 | - var clickedBodyRegionData = new jinqJs() | |
4488 | - .from(BodyRegionDictionary) | |
4489 | - .where('bodyRegionId == 6') | |
4490 | - .select(); | |
4786 | + var clickedBodyRegionData = new jinqJs() | |
4787 | + .from(BodyRegionDictionary) | |
4788 | + .where('bodyRegionId == 6') | |
4789 | + .select(); | |
4491 | 4790 | |
4492 | 4791 | |
4493 | - // clickedBodyRegion = clickedBodyRegionData[0].bodyRegionId; | |
4494 | - x = clickedBodyRegionData[0].X; | |
4495 | - y = clickedBodyRegionData[0].Y; | |
4496 | - width = clickedBodyRegionData[0].Width; | |
4497 | - var height = clickedBodyRegionData[0].Height; | |
4498 | - isMirror = clickedBodyRegionData[0].IsMirror; | |
4499 | - var bodyRegionRight = parseInt(x) + parseInt(width); | |
4500 | - var bodyRegionBottom = parseInt(y) + parseInt(height); | |
4501 | - if (actulalX <= bodyRegionRight && x <= actulalX && actualY <= bodyRegionBottom && y <= actualY) { | |
4792 | + // clickedBodyRegion = clickedBodyRegionData[0].bodyRegionId; | |
4793 | + x = clickedBodyRegionData[0].X; | |
4794 | + y = clickedBodyRegionData[0].Y; | |
4795 | + width = clickedBodyRegionData[0].Width; | |
4796 | + var height = clickedBodyRegionData[0].Height; | |
4797 | + isMirror = clickedBodyRegionData[0].IsMirror; | |
4798 | + var bodyRegionRight = parseInt(x) + parseInt(width); | |
4799 | + var bodyRegionBottom = parseInt(y) + parseInt(height); | |
4800 | + if (actulalX <= bodyRegionRight && x <= actulalX && actualY <= bodyRegionBottom && y <= actualY) { | |
4502 | 4801 | |
4503 | - clickedBodyRegion = clickedBodyRegionData[0].bodyRegionId; | |
4504 | - x = clickedBodyRegionData[0].X; | |
4505 | - y = clickedBodyRegionData[0].Y; | |
4506 | - width = clickedBodyRegionData[0].Width; | |
4507 | - var height = clickedBodyRegionData[0].Height; | |
4508 | - isMirror = clickedBodyRegionData[0].IsMirror; | |
4509 | - } | |
4802 | + clickedBodyRegion = clickedBodyRegionData[0].bodyRegionId; | |
4803 | + x = clickedBodyRegionData[0].X; | |
4804 | + y = clickedBodyRegionData[0].Y; | |
4805 | + width = clickedBodyRegionData[0].Width; | |
4806 | + var height = clickedBodyRegionData[0].Height; | |
4807 | + isMirror = clickedBodyRegionData[0].IsMirror; | |
4808 | + } | |
4510 | 4809 | |
4511 | - } | |
4512 | - else { | |
4513 | - $.each(BodyRegionDictionary, function (index, value) { | |
4810 | + } | |
4811 | + else { | |
4812 | + $.each(BodyRegionDictionary, function (index, value) { | |
4514 | 4813 | |
4515 | - var bodyRegionRight = parseInt(value.X) + parseInt(value.Width); | |
4516 | - var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height); | |
4517 | - if (actulalX <= bodyRegionRight && value.X <= actulalX && actualY <= bodyRegionBottom && value.Y <= actualY) { | |
4814 | + var bodyRegionRight = parseInt(value.X) + parseInt(value.Width); | |
4815 | + var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height); | |
4816 | + if (actulalX <= bodyRegionRight && value.X <= actulalX && actualY <= bodyRegionBottom && value.Y <= actualY) { | |
4518 | 4817 | |
4519 | - clickedBodyRegion = value.bodyRegionId; | |
4520 | - x = value.X; | |
4521 | - y = value.Y; | |
4522 | - width = value.Width; | |
4523 | - isMirror = value.IsMirror; | |
4524 | - return false; | |
4525 | - } | |
4526 | - }) | |
4527 | - } | |
4818 | + clickedBodyRegion = value.bodyRegionId; | |
4819 | + x = value.X; | |
4820 | + y = value.Y; | |
4821 | + width = value.Width; | |
4822 | + isMirror = value.IsMirror; | |
4823 | + return false; | |
4824 | + } | |
4825 | + }) | |
4826 | + } | |
4528 | 4827 | |
4529 | 4828 | |
4530 | 4829 | if (isMirror == "Yes") { |
... | ... | @@ -4535,110 +4834,69 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4535 | 4834 | var clickedCanvasMaskId = 'imageCanvas' + clickedBodyRegion + '_mci'; |
4536 | 4835 | var clickedCanavs = document.getElementById(clickedCanvasMaskId); |
4537 | 4836 | |
4538 | - //if non mirrored canvas does not exist for this irror Body region then draw non mirrored image to get annotation | |
4539 | - var clickedBodyRegionData = new jinqJs() | |
4540 | - .from(BodyRegionDictionary) | |
4541 | - .where('bodyRegionId == ' + clickedBodyRegion) | |
4542 | - .select(); | |
4543 | - if (clickedBodyRegionData != null || clickedBodyRegionData != undefined) { | |
4544 | - | |
4545 | - var nomMirroredBodyRegion = new jinqJs() | |
4546 | - .from(clickedBodyRegionData) | |
4547 | - .where('IsMirror == No') | |
4548 | - .select(); | |
4549 | - | |
4550 | - | |
4551 | - //debugger; | |
4552 | - var oldMirrorMaskId = 'transparencyTempCanvasMask_' + clickedBodyRegion + '_mci'; | |
4553 | - var oldMirrorMask = document.getElementById(oldMirrorMaskId); | |
4554 | - if (oldMirrorMask != null) { | |
4555 | - document.getElementById('canvasDiv').removeChild(oldMirrorMask); | |
4556 | - } | |
4557 | - var transparencyTempcanavsMask = document.createElement('canvas'); | |
4558 | - transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_' + clickedBodyRegion + '_mci'; | |
4559 | - transparencyTempcanavsMask.height = nomMirroredBodyRegion[0].Height; | |
4560 | - transparencyTempcanavsMask.width = nomMirroredBodyRegion[0].Width; | |
4561 | - transparencyTempcanavsMask.style.position = "absolute"; | |
4562 | - transparencyTempcanavsMask.style.left = nomMirroredBodyRegion[0].X + 'px' // x + "px"; | |
4563 | - transparencyTempcanavsMask.style.top = nomMirroredBodyRegion[0].Y + "px"//y + "px"; | |
4564 | - transparencyTempcanavsMask.style.visibility = 'hidden'; | |
4565 | - | |
4566 | - document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask); | |
4567 | - | |
4568 | - var tranparencyImgSrc = $scope.GetImageSource(clickedBodyRegion); | |
4569 | - var tempMaskImg = new Image(); | |
4570 | - var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4571 | - tempMaskImg.onload = function () { | |
4572 | - var tempmaskCtx = transparencyTempcanavsMask.getContext('2d'); | |
4573 | - tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4574 | - | |
4575 | - //get x,y of non mirrored canvas for this body region | |
4576 | - x = transparencyTempcanavsMask.style.left; | |
4577 | - y = transparencyTempcanavsMask.style.top; | |
4578 | - | |
4579 | - var maskCanvasTransId = 'transparencyTempCanvasMask_' + clickedBodyRegion + '_mci'; | |
4580 | - var maskCanvastrans = document.getElementById(maskCanvasTransId); | |
4581 | - var maskCanvasContexttrans = maskCanvastrans.getContext("2d"); | |
4582 | - | |
4837 | + var maskCanvasId = 'transparencyTempCanvasMask_' + clickedBodyRegion + '_mci'; | |
4838 | + var maskCanvas = document.getElementById(maskCanvasId); | |
4839 | + | |
4840 | + if (maskCanvas != null) { | |
4841 | + x = maskCanvas.style.left; | |
4842 | + y = maskCanvas.style.top; | |
4583 | 4843 | |
4844 | + var maskCanvasTransId = 'transparencyTempCanvasMask_' + clickedBodyRegion + '_mci'; | |
4845 | + var maskCanvastrans = document.getElementById(maskCanvasTransId); | |
4846 | + var maskCanvasContexttrans = maskCanvastrans.getContext("2d"); | |
4584 | 4847 | |
4585 | 4848 | |
4586 | - var canvasDiv = document.getElementById('canvasDiv'); | |
4587 | - var verticalScrollPosition = canvasDiv.scrollTop; | |
4588 | - var horizontlScrollPosition = canvasDiv.scrollLeft; | |
4849 | + getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt) | |
4589 | 4850 | |
4590 | - var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135); | |
4591 | 4851 | |
4592 | - var mirrorXOnNormalImage = parseInt(maskCanvasContexttrans.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage); | |
4852 | + } | |
4593 | 4853 | |
4594 | - var actulalX = mirrorXOnNormalImage | |
4595 | - var actualY = mousePos.y + verticalScrollPosition | |
4854 | + //if non mirrored canvas does not exist for this irror Body region then draw non mirrored image to get annotation | |
4596 | 4855 | |
4856 | + else if (maskCanvas == null) { | |
4857 | + var clickedBodyRegionData = new jinqJs() | |
4858 | + .from(BodyRegionDictionary) | |
4859 | + .where('bodyRegionId == ' + clickedBodyRegion) | |
4860 | + .select(); | |
4861 | + if (clickedBodyRegionData != null || clickedBodyRegionData != undefined) { | |
4597 | 4862 | |
4863 | + var nomMirroredBodyRegion = new jinqJs() | |
4864 | + .from(clickedBodyRegionData) | |
4865 | + .where('IsMirror == No') | |
4866 | + .select(); | |
4598 | 4867 | |
4599 | - var clickedCanvasMaskId = 'imageCanvas' + clickedBodyRegion + '_mci'; | |
4600 | - var maskCanvas = document.getElementById(clickedCanvasMaskId); | |
4601 | - var maskCanvasContext = maskCanvas.getContext("2d"); | |
4602 | - var imgX = Math.round(actulalX - parseInt(x.replace('px', ''))); | |
4603 | - var imgY = Math.round(actualY - parseInt(y.replace('px', ''))); | |
4604 | - pixelData = maskCanvasContext.getImageData(imgX, imgY, 1, 1); | |
4868 | + var transparencyTempcanavsMask = document.createElement('canvas'); | |
4869 | + transparencyTempcanavsMask.id = 'transparencyTempCanvasMask_' + clickedBodyRegion + '_mci'; | |
4870 | + transparencyTempcanavsMask.height = nomMirroredBodyRegion[0].Height; | |
4871 | + transparencyTempcanavsMask.width = nomMirroredBodyRegion[0].Width; | |
4872 | + transparencyTempcanavsMask.style.position = "absolute"; | |
4873 | + transparencyTempcanavsMask.style.left = nomMirroredBodyRegion[0].X + 'px' // x + "px"; | |
4874 | + transparencyTempcanavsMask.style.top = nomMirroredBodyRegion[0].Y + "px"//y + "px"; | |
4875 | + transparencyTempcanavsMask.style.visibility = 'hidden'; | |
4605 | 4876 | |
4877 | + document.getElementById('canvasDiv').appendChild(transparencyTempcanavsMask); | |
4606 | 4878 | |
4607 | - //trans layer image data | |
4608 | - pixelDataTrans = maskCanvasContexttrans.getImageData(imgX, imgY, 1, 1); | |
4609 | - // console.log('at the time' + pixelData.data[0]) | |
4610 | - // debugger; | |
4611 | - var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope); | |
4612 | - if ($('#speechBubble').length > 0) | |
4613 | - $('#speechBubble').remove(); | |
4879 | + var tranparencyImgSrc = $scope.GetImageSource(clickedBodyRegion); | |
4880 | + var tranparencyMaskImgSrc = $scope.GetMaskImageSource(tranparencyImgSrc); | |
4614 | 4881 | |
4882 | + var tempMaskImg = new Image(); | |
4883 | + tempMaskImg.src = tranparencyMaskImgSrc; | |
4615 | 4884 | |
4616 | - if ($('#speechBubbleTrns').length > 0) { | |
4617 | - $('#speechBubbleTrns').remove(); | |
4885 | + tempMaskImg.onload = function () { | |
4886 | + var transparencyTempcanavsMask = document.getElementById(maskCanvasId); | |
4887 | + var tempmaskCtx = transparencyTempcanavsMask.getContext('2d'); | |
4888 | + tempmaskCtx.drawImage(tempMaskImg, 0, 0); | |
4618 | 4889 | |
4619 | - // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) | |
4890 | + //get x,y of non mirrored canvas for this body region | |
4891 | + x = transparencyTempcanavsMask.style.left; | |
4892 | + y = transparencyTempcanavsMask.style.top; | |
4620 | 4893 | |
4621 | - $scope.annotationTextArrayT1 = []; | |
4622 | - $scope.annotationTextArrayT2 = []; | |
4623 | - $scope.annotationTextArrayT1.push(annotations.annotationT1); | |
4624 | - $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
4894 | + getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, tempmaskCtx, clickedBodyRegion, x, y, evt) | |
4625 | 4895 | |
4626 | - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
4627 | 4896 | } |
4628 | - else | |
4629 | - // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) | |
4630 | - | |
4631 | - $scope.annotationTextArrayT1 = []; | |
4632 | - $scope.annotationTextArrayT2 = []; | |
4633 | - $scope.annotationTextArrayT1.push(annotations.annotationT1); | |
4634 | - $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
4635 | - | |
4636 | - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
4637 | 4897 | } |
4638 | - tempMaskImg.src = "http://localhost/AIAHtml/" + tranparencyMaskImgSrc; | |
4639 | - | |
4640 | - | |
4641 | 4898 | } |
4899 | + | |
4642 | 4900 | |
4643 | 4901 | } |
4644 | 4902 | else { |
... | ... | @@ -4675,21 +4933,160 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4675 | 4933 | } |
4676 | 4934 | else |
4677 | 4935 | // $scope.createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) |
4936 | + { | |
4937 | + | |
4938 | + $scope.annotationTextArrayT1 = []; | |
4939 | + $scope.annotationTextArrayT2 = []; | |
4940 | + $scope.annotationTextArrayT1.push(annotations.annotationT1); | |
4941 | + $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
4942 | + | |
4943 | + | |
4944 | + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
4945 | + } | |
4946 | + | |
4947 | + } | |
4948 | + | |
4949 | + | |
4950 | + } | |
4951 | + | |
4952 | + function OnClickModestyTransCanvas(evt) { | |
4953 | + | |
4954 | + var mousePos = $scope.getMousePos(evt); | |
4955 | + var canvasDiv = document.getElementById('canvasDiv'); | |
4956 | + var verticalScrollPosition = canvasDiv.scrollTop; | |
4957 | + var horizontlScrollPosition = canvasDiv.scrollLeft; | |
4958 | + | |
4959 | + var actulalX = mousePos.x + horizontlScrollPosition; | |
4960 | + var actualY = mousePos.y + verticalScrollPosition; | |
4961 | + | |
4962 | + var canavsX = evt.currentTarget.offsetLeft; | |
4963 | + var canvasY = evt.currentTarget.offsetTop; | |
4678 | 4964 | |
4965 | + var canvasId = evt.currentTarget.id; | |
4966 | + var canavsContext = document.getElementById(canvasId).getContext('2d'); | |
4967 | + var RGBColor = $scope.GetRGBColor(canavsContext, actulalX, actualY, canavsX, canvasY); | |
4968 | + | |
4969 | + var annotationText; | |
4970 | + | |
4971 | + //Modesty ON | |
4972 | + if (canvasId.match('modestyImg') && RGBColor != '000000') { | |
4973 | + RGBColor = DA[0].figLeafTermId; | |
4974 | + annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor); | |
4975 | + $scope.annotationTextArrayT1 = []; | |
4976 | + $scope.annotationTextArrayT2 = []; | |
4977 | + $scope.annotationTextArrayT1.push(annotationText); | |
4978 | + $scope.annotationTextArrayT2.push(annotationText); | |
4979 | + } | |
4980 | + //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to | |
4981 | + //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er | |
4982 | + // | |
4983 | + else if (canvasId.match('modestyImg') && RGBColor == '000000') { | |
4984 | + | |
4985 | + var bodyRegionId = canvasId.slice(-1); | |
4986 | + | |
4987 | + var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci'; | |
4988 | + var maskCanvas = document.getElementById(maskCanvasId); | |
4989 | + var maskCanvasContext = maskCanvas.getContext("2d"); | |
4990 | + //RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY); | |
4991 | + //annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); | |
4992 | + | |
4993 | + //transparecncy canvas | |
4994 | + var maskCanvasTransId = 'transparencyTempCanvasMask_' + bodyRegionId + '_mci'; | |
4995 | + var maskCanvastrans = document.getElementById(maskCanvasTransId); | |
4996 | + var maskCanvasContexttrans = maskCanvastrans.getContext("2d"); | |
4997 | + | |
4998 | + var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1); | |
4999 | + | |
5000 | + var pixelDataTrans = maskCanvasContexttrans.getImageData(Math.round(actulalX - canavsX), Math.round(actualY - canvasY), 1, 1); | |
5001 | + | |
5002 | + var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope); | |
5003 | + | |
5004 | + | |
5005 | + // var maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci'; | |
5006 | + // var maskCanvas = document.getElementById(maskCanvasId); | |
5007 | + // var maskCanvasContext = maskCanvas.getContext("2d"); | |
5008 | + // RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, xcanavsX, canvasY); | |
5009 | + // annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); | |
5010 | + | |
5011 | + | |
5012 | + // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) | |
4679 | 5013 | |
4680 | 5014 | $scope.annotationTextArrayT1 = []; |
5015 | + $scope.annotationTextArrayT2 = []; | |
5016 | + $scope.annotationTextArrayT1.push(annotations.annotationT1); | |
5017 | + $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
5018 | + | |
5019 | + } | |
5020 | + | |
5021 | + if ($('#speechBubble').length > 0) | |
5022 | + $('#speechBubble').remove(); | |
5023 | + | |
5024 | + | |
5025 | + if ($('#speechBubbleTrns').length > 0) { | |
5026 | + $('#speechBubbleTrns').remove(); | |
5027 | + } | |
5028 | + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
5029 | + | |
5030 | + | |
5031 | + } | |
5032 | + | |
5033 | + function getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt) | |
5034 | + { | |
5035 | + var canvasDiv = document.getElementById('canvasDiv'); | |
5036 | + var verticalScrollPosition = canvasDiv.scrollTop; | |
5037 | + var horizontlScrollPosition = canvasDiv.scrollLeft; | |
5038 | + | |
5039 | + var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135); | |
5040 | + | |
5041 | + var mirrorXOnNormalImage = parseInt(maskCanvasContexttrans.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage); | |
5042 | + | |
5043 | + var actulalX = mirrorXOnNormalImage | |
5044 | + var actualY = mousePos.y + verticalScrollPosition | |
5045 | + | |
5046 | + | |
5047 | + | |
5048 | + var clickedCanvasMaskId = 'imageCanvas' + clickedBodyRegion + '_mci'; | |
5049 | + var maskCanvas = document.getElementById(clickedCanvasMaskId); | |
5050 | + var maskCanvasContext = maskCanvas.getContext("2d"); | |
5051 | + var imgX = Math.round(actulalX - parseInt((x).replace('px', ''))); | |
5052 | + var imgY = Math.round(actualY - parseInt((y).replace('px', ''))); | |
5053 | + var pixelData = maskCanvasContext.getImageData(imgX, imgY, 1, 1); | |
5054 | + | |
5055 | + | |
5056 | + //trans layer image data | |
5057 | + var pixelDataTrans = maskCanvasContexttrans.getImageData(imgX, imgY, 1, 1); | |
5058 | + // console.log('at the time' + pixelData.data[0]) | |
5059 | + // debugger; | |
5060 | + var annotations = $scope.getAnnotationForTransparencyBox(pixelData, pixelDataTrans, $scope); | |
5061 | + if ($('#speechBubble').length > 0) | |
5062 | + $('#speechBubble').remove(); | |
5063 | + | |
5064 | + | |
5065 | + if ($('#speechBubbleTrns').length > 0) { | |
5066 | + $('#speechBubbleTrns').remove(); | |
5067 | + | |
5068 | + // createSpeechBubbleOnTransparencyBox(evt, annotations.annotationT1, annotations.annotationT2, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left + 5, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top - 50) | |
5069 | + | |
5070 | + $scope.annotationTextArrayT1 = []; | |
4681 | 5071 | $scope.annotationTextArrayT2 = []; |
4682 | 5072 | $scope.annotationTextArrayT1.push(annotations.annotationT1); |
4683 | 5073 | $scope.annotationTextArrayT2.push(annotations.annotationT2); |
4684 | 5074 | |
4685 | - | |
4686 | 5075 | $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); |
5076 | + } | |
5077 | + else | |
5078 | + { | |
5079 | + $scope.annotationTextArrayT1 = []; | |
5080 | + $scope.annotationTextArrayT2 = []; | |
5081 | + $scope.annotationTextArrayT1.push(annotations.annotationT1); | |
5082 | + $scope.annotationTextArrayT2.push(annotations.annotationT2); | |
4687 | 5083 | |
4688 | - | |
5084 | + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false); | |
4689 | 5085 | } |
4690 | - //debugger; | |
4691 | - } | |
4692 | - function clearTransCanvas() { | |
5086 | + } | |
5087 | + | |
5088 | + | |
5089 | + function clearTransCanvas() { | |
4693 | 5090 | |
4694 | 5091 | var tCanvas = document.getElementById('transparencyCanvas'); |
4695 | 5092 | if (tCanvas != null) { |
... | ... | @@ -4815,25 +5212,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4815 | 5212 | ctx.putImageData(originalTransparencyData, 0, 0); |
4816 | 5213 | |
4817 | 5214 | |
4818 | - var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData; | |
4819 | - | |
4820 | - $scope.IncludedBodyRegions = []; | |
4821 | - var counter = 0; | |
4822 | - $.each(BodyRegionDictionary, function (index, value) { | |
4823 | - | |
4824 | - var bodyRegionRight = parseInt(value.X) + parseInt(value.Width); | |
4825 | - var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height); | |
4826 | - | |
4827 | - | |
5215 | + //for modesty | |
4828 | 5216 | |
4829 | - if (tBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && tBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { | |
5217 | + //for modesty | |
5218 | + if ($rootScope.isModestyOn == true && $scope.modestyImageInfo.length > 0) { | |
5219 | + $.each($scope.modestyImageInfo, function (index, value) { | |
4830 | 5220 | |
4831 | - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, true); | |
4832 | - | |
4833 | - } | |
5221 | + var brId = value.bodyRegionId; | |
4834 | 5222 | |
4835 | - }); | |
5223 | + var modestyTransTempCanvasId = 'tempCanvasModesty_' + brId; | |
5224 | + var modestyTransCanvasId = 'modestyTransCanavs_' + brId; | |
5225 | + var tempCanvasContext = document.getElementById(modestyTransTempCanvasId).getContext('2d'); | |
5226 | + var originalTransparencyData = tempCanvasContext.getImageData(0, 0, value.Width, value.Height); | |
5227 | + var ctx = document.getElementById(modestyTransCanvasId).getContext('2d'); | |
5228 | + ctx.putImageData(originalTransparencyData, 0, 0); | |
5229 | + }) | |
5230 | + } | |
4836 | 5231 | |
5232 | + $scope.changeTransparency(); | |
4837 | 5233 | |
4838 | 5234 | |
4839 | 5235 | // }); |
... | ... | @@ -4841,9 +5237,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4841 | 5237 | |
4842 | 5238 | $scope.CloseTransparencyBox = function () { |
4843 | 5239 | |
4844 | - | |
5240 | + | |
4845 | 5241 | //To enable extract button |
4846 | - $scope.isTransparencyActivated = false; | |
5242 | + $scope.isTransparencyActivated = false; | |
4847 | 5243 | $("#btnExtract").removeClass("disabled"); |
4848 | 5244 | |
4849 | 5245 | //$('.com_anno').css('display', 'none'); |
... | ... | @@ -4887,7 +5283,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4887 | 5283 | //var scope = angular.element(document.getElementById("DAView")).scope(); |
4888 | 5284 | //scope.$apply(function () { |
4889 | 5285 | // $scope.layerNumber = 0; |
4890 | - // $scope.isTransparencyActivated = false; | |
5286 | + // $scope.isTransparencyActivated = false; | |
4891 | 5287 | //}) |
4892 | 5288 | |
4893 | 5289 | |
... | ... | @@ -4904,6 +5300,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4904 | 5300 | $scope.transNumber = 50; |
4905 | 5301 | $(".slider").slider({ value: 50 }) |
4906 | 5302 | } |
5303 | + | |
5304 | + | |
5305 | + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); | |
5306 | + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { | |
5307 | + for (var j = 0; j < modestyTransCanvases.length; j++) { | |
5308 | + | |
5309 | + modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
5310 | + } | |
5311 | + } | |
5312 | + | |
4907 | 5313 | $('#transparencyScale').css('visibility', 'hidden'); |
4908 | 5314 | |
4909 | 5315 | //$scope.isTransparencyActivated = false; |
... | ... | @@ -4960,6 +5366,48 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4960 | 5366 | }) |
4961 | 5367 | }; |
4962 | 5368 | |
5369 | + $scope.createSpeechBubbleOnTransparencyBox = function (event, text1, text2, x, y) { | |
5370 | + | |
5371 | + $('#canvasDiv').css('cursor', 'pointer'); | |
5372 | + $('<div id="speechBubbleTrns" class="BubbleDiv" style="display:visible; top:' + y + 'px; left:' + x + 'px;z-index:700"> <div class="">' | |
5373 | + + '<div class="Bubble">' | |
5374 | + + '<div class="BubbleCloseBtn"></div><div class="BubbleContent">' + text1 + '</div><div class="BubbleContent">' + text2 + '</div><div class="bottomLeftArrow"></div>' | |
5375 | + //+'<div class="bottomRightArrow"></div><div class="topLeftArrow"></div><div class="topRightArrow"></div> | |
5376 | + + '</div></div></div>').appendTo('#canvasDiv'); | |
5377 | + | |
5378 | + $('#speechBubbleTrns').on('click', '.BubbleCloseBtn', function (e) { | |
5379 | + $('#speechBubbleTrns').css('display', 'none'); | |
5380 | + }); | |
5381 | + | |
5382 | + $('#canvasDiv').attr("data-bubbleid", "speechBubble") | |
5383 | + | |
5384 | + | |
5385 | + }; | |
5386 | + | |
5387 | + | |
5388 | + function positionTooltip(event, x, y) { | |
5389 | + // alert('positionTooltip') | |
5390 | + x = 100, | |
5391 | + y = 200, | |
5392 | + | |
5393 | + $('div.speech-bubble').css({ | |
5394 | + 'position': 'absolute', 'top': x, 'left': y, 'background-color': '#f8f8f8', | |
5395 | + 'border': '2px solid #c8c8c8', 'width': '150px', 'height': '50px' | |
5396 | + }); | |
5397 | + | |
5398 | + | |
5399 | + $('.arrow').css({ | |
5400 | + 'border-style': 'solid', | |
5401 | + 'position': 'absolute' | |
5402 | + }); | |
5403 | + | |
5404 | + $('.bottom').css({ | |
5405 | + 'border-color': '#c8c8c8 transparent transparent transparent', | |
5406 | + 'border-width': ' 8px 8px 0px 8px', | |
5407 | + 'bottom': -'8px' | |
5408 | + }) | |
5409 | + }; | |
5410 | + | |
4963 | 5411 | |
4964 | 5412 | $scope.IdentityClick = function () { |
4965 | 5413 | |
... | ... | @@ -6408,15 +6856,55 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6408 | 6856 | |
6409 | 6857 | |
6410 | 6858 | |
6411 | - function OnPaintCanvasMouseMove(event) { | |
6412 | 6859 | |
6860 | + $rootScope.FreeStylePaint = function (e) { | |
6861 | + | |
6862 | + var annotationCanvas = document.getElementById("canvas"); | |
6863 | + // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp); | |
6864 | + | |
6865 | + annotationCanvas.addEventListener('mousedown', $scope.OnPaintCanvasMouseDown, false); | |
6413 | 6866 | |
6867 | + annotationCanvas.addEventListener('mouseup', $scope.OnPaintBrushCanvasMouseUp, false); | |
6414 | 6868 | } |
6869 | + $scope.OnPaintCanvasMouseDown = function (event) { | |
6870 | + $rootScope.isMousedownOnPaintCanvas = true; | |
6871 | + $scope.isStartPointDeleted = false; | |
6872 | + var annotationCanvas = document.getElementById("canvas"); | |
6873 | + $scope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left)); | |
6874 | + $scope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top)); | |
6875 | + | |
6876 | + annotationCanvas.addEventListener('mousemove', $scope.OnPaintCanvasMouseMove, false); | |
6415 | 6877 | |
6416 | - $rootScope.FreeStylePaint = function (e) { | |
6417 | 6878 | |
6418 | 6879 | |
6419 | 6880 | } |
6881 | + $scope.OnPaintCanvasMouseMove = function (event) { | |
6882 | + | |
6883 | + | |
6884 | + $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left)); | |
6885 | + $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top)); | |
6886 | + | |
6887 | + var btneraseBrushSizeValue = $("#btnBrushSize").val(); | |
6888 | + $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue); | |
6889 | + | |
6890 | + if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) { | |
6891 | + | |
6892 | + var sktch = $('#canvasPaint').sketch(); | |
6893 | + $('#canvasPaint').sketch().actions = []; | |
6894 | + var paintCanvas = document.getElementById("canvasPaint"); | |
6895 | + var paintCanvasContext = paintCanvas.getContext('2d'); | |
6896 | + if ($scope.isStartPointDeleted == false) { | |
6897 | + | |
6898 | + paintCanvasContext.clearRect($scope.startPageX, $scope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize); | |
6899 | + | |
6900 | + $scope.isStartPointDeleted = true; | |
6901 | + } | |
6902 | + | |
6903 | + paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize); | |
6904 | + | |
6905 | + | |
6906 | + } | |
6907 | + } | |
6420 | 6908 | $scope.OnPaintBrushCanvasMouseDown = function (event) { |
6421 | 6909 | switch ($rootScope.shapeType) { |
6422 | 6910 | |
... | ... | @@ -6445,7 +6933,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6445 | 6933 | } |
6446 | 6934 | } |
6447 | 6935 | $scope.OnPaintBrushCanvasMouseUp = function (event) { |
6448 | - | |
6936 | + $rootScope.isMousedownOnPaintCanvas = false; | |
6937 | + $rootScope.isEraseToolSelected = false; | |
6449 | 6938 | |
6450 | 6939 | // var canvasElement1 = document.getElementById("canvasPaint"); |
6451 | 6940 | // var ctx1 = canvasElement1.getContext("2d"); |
... | ... | @@ -6819,12 +7308,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6819 | 7308 | } |
6820 | 7309 | |
6821 | 7310 | $scope.jumpToTerm = function (event) { |
6822 | - | |
6823 | - $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text(); | |
6824 | - $('#termList option[selected="selected"]').prop("selected", false); | |
6825 | - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); | |
6826 | - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); | |
6827 | - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); | |
7311 | + // alert(event.currentTarget.value); | |
7312 | + $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text(); | |
7313 | + $('#termList option[selected="selected"]').prop("selected", false); | |
7314 | + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); | |
7315 | + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); | |
7316 | + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); | |
6828 | 7317 | |
6829 | 7318 | |
6830 | 7319 | $rootScope.isLoading = true; |
... | ... | @@ -6886,6 +7375,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6886 | 7375 | //list manager |
6887 | 7376 | $scope.$on('listManagerEvent', function (event, data) { |
6888 | 7377 | |
7378 | + | |
6889 | 7379 | //if ($rootScope.MenuModuleName == "DA") { |
6890 | 7380 | // if ($rootScope.disableAnnotationtoolOnListManager == true) { |
6891 | 7381 | // $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').attr('disabled', 'disabled'); |
... | ... | @@ -7041,11 +7531,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
7041 | 7531 | |
7042 | 7532 | |
7043 | 7533 | $rootScope.prevId = actualTermNumber; |
7044 | - $("#termList").find("option").attr('selected', false); | |
7534 | + // $("#termList").find("option").attr('selected', false); | |
7045 | 7535 | $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); |
7046 | 7536 | $("#termList").find("option[id=" + actualTermNumber + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); |
7047 | 7537 | $("div#backdrop #termlistfilter li").find("a").css({ "background-color": "#ffffff", "color": "#000000" }); |
7048 | 7538 | $("div#backdrop #termlistfilter li").find("a[id=" + actualTermNumber + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); |
7539 | + | |
7049 | 7540 | $scope.terminateCurrentlyRunningWPs(); |
7050 | 7541 | //debugger |
7051 | 7542 | $rootScope.isListManagerSelected = true; |
... | ... | @@ -7402,7 +7893,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
7402 | 7893 | |
7403 | 7894 | |
7404 | 7895 | for (var j = 0; j < $scope.VocabTermTxt.length; j++) { |
7405 | - var $el = $('<option id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
7896 | + var $el = $('<option id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
7406 | 7897 | $compile($el)($scope); |
7407 | 7898 | } |
7408 | 7899 | |
... | ... | @@ -7658,4 +8149,6 @@ function onListManagerTermSelection(id) { |
7658 | 8149 | scope.HighlightBodyOnListManagerSelection(id); |
7659 | 8150 | }); |
7660 | 8151 | |
7661 | -} | |
7662 | 8152 | \ No newline at end of file |
8153 | +} | |
8154 | + | |
8155 | + | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -62,7 +62,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
62 | 62 | $rootScope.TextRectangleArr = []; |
63 | 63 | $rootScope.rectDimension = []; |
64 | 64 | |
65 | - | |
65 | + $rootScope.isEraseToolSelected = false; | |
66 | + $rootScope.isMousedownOnPaintCanvas = false; | |
66 | 67 | $rootScope.$on("$locationChangeSuccess", function () { |
67 | 68 | |
68 | 69 | if (($location.url() == "/da-body-view") || ($location.url() == "/clinical-illustrations-detail") || ($location.url() == "/clinical-animations-detail")) { |
... | ... | @@ -439,14 +440,16 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
439 | 440 | $('#canvas').css("z-index", y); |
440 | 441 | } |
441 | 442 | $rootScope.EraseDrawing = function () { |
442 | - $rootScope.switchCanvasToPaintCanvas(); | |
443 | - // $('#canvasPaint').sketch({ defaultColor: "yellow", defaultSize: 1 }); | |
444 | - var sktch = $('#canvasPaint').sketch(); | |
445 | - $('#canvasPaint').sketch().actions = []; // this line empties the actions. | |
446 | - var myCanvas = document.getElementById("canvasPaint"); | |
447 | - var ctx = myCanvas.getContext('2d'); | |
448 | - ctx.clearRect(0, 0, myCanvas.width, myCanvas.height); | |
449 | 443 | $rootScope.switchCanvas(); |
444 | + $rootScope.isEraseToolSelected = true; | |
445 | + //$rootScope.switchCanvasToPaintCanvas(); | |
446 | + //// $('#canvasPaint').sketch({ defaultColor: "yellow", defaultSize: 1 }); | |
447 | + //var sktch = $('#canvasPaint').sketch(); | |
448 | + //$('#canvasPaint').sketch().actions = []; // this line empties the actions. | |
449 | + //var myCanvas = document.getElementById("canvasPaint"); | |
450 | + //var ctx = myCanvas.getContext('2d'); | |
451 | + //ctx.clearRect(0, 0, myCanvas.width, myCanvas.height); | |
452 | + //$rootScope.switchCanvas(); | |
450 | 453 | |
451 | 454 | } |
452 | 455 | |
... | ... | @@ -811,11 +814,11 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
811 | 814 | } |
812 | 815 | |
813 | 816 | $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { |
814 | - | |
817 | + | |
815 | 818 | var xAxisPinDiff = offsetX1 - x; |
816 | 819 | var yAxisPinDiff = offsetY1 - y; |
817 | - if (xAxisPinDiff != 0 && yAxisPinDiff != 0) { | |
818 | - | |
820 | + if (xAxisPinDiff != 0 && yAxisPinDiff != 0) | |
821 | + { | |
819 | 822 | |
820 | 823 | var radial = $('#canvas').createGradient({ |
821 | 824 | x1: 50, y1: 50, |
... | ... | @@ -919,8 +922,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
919 | 922 | }, |
920 | 923 | |
921 | 924 | }).drawLayers(); |
922 | - | |
923 | 925 | } |
926 | + | |
924 | 927 | |
925 | 928 | $('.btnCursor').trigger('click'); |
926 | 929 | $(".btn-annotation").removeClass("activebtncolor"); |
... | ... | @@ -1909,7 +1912,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
1909 | 1912 | $rootScope.disableAnnotationtoolOnListManager = false; |
1910 | 1913 | $rootScope.ShowListManager = function () { |
1911 | 1914 | console.log('ShowListManager') |
1912 | - | |
1913 | 1915 | $rootScope.disableAnnotationtoolOnListManager = true; |
1914 | 1916 | $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').attr('disabled', 'disabled'); |
1915 | 1917 | $('#slider-range-min-2').slider('disable'); |
... | ... | @@ -1918,13 +1920,18 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", |
1918 | 1920 | |
1919 | 1921 | $('#listManager').css('display', 'block'); |
1920 | 1922 | $("#listManager").css("visibility", "visible"); |
1923 | + | |
1924 | + // $('#termList option[selected="selected"]').prop("selected", false); | |
1925 | + // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").prop("selected", true); | |
1926 | + // $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); | |
1927 | + // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); | |
1921 | 1928 | $('#listManager').draggable(); |
1922 | 1929 | |
1923 | 1930 | |
1924 | 1931 | $rootScope.islistManagerEventAlredayDispachted = true; |
1925 | 1932 | |
1926 | 1933 | $rootScope.$broadcast('listManagerEvent', true); |
1927 | - | |
1934 | + | |
1928 | 1935 | $('#termList option[selected="selected"]').prop("selected", false); |
1929 | 1936 | $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); |
1930 | 1937 | $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.html
... | ... | @@ -49,8 +49,9 @@ |
49 | 49 | |
50 | 50 | |
51 | 51 | #termList option:hover { |
52 | - background-color: #3399FF !important; | |
53 | - color: #fff !important; | |
52 | + background-color: #3399FF !important; | |
53 | + color: #fff !important; | |
54 | + | |
54 | 55 | } |
55 | 56 | |
56 | 57 | |
... | ... | @@ -743,10 +744,9 @@ |
743 | 744 | |
744 | 745 | </div> |
745 | 746 | |
746 | - | |
747 | 747 | <!--DA > List Manager > Multiple structure selection should not be available.--> |
748 | 748 | <div class="form-group"> |
749 | - <select id="termList" class="form-control" size="10" onclick="if (typeof (this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id)"></select> | |
749 | + <select id="termList" class="form-control" size="10" onclick="if (typeof (this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id)"></select> | |
750 | 750 | </div> |
751 | 751 | |
752 | 752 | </div> |
... | ... | @@ -1214,6 +1214,11 @@ |
1214 | 1214 | if (brushIncrementVar >= 60) { |
1215 | 1215 | $("#slider-range-min-2").slider("value", 60); |
1216 | 1216 | } |
1217 | + else if (brushIncrementVar == "") { | |
1218 | + var brushIncrementedValue = 1; | |
1219 | + $("#btnBrushSize").val(brushIncrementedValue); | |
1220 | + $("#slider-range-min-2").slider("value", parseInt(brushIncrementedValue)); | |
1221 | + } | |
1217 | 1222 | else { |
1218 | 1223 | var brushIncrementedValue = parseInt(brushIncrementVar) + 1; |
1219 | 1224 | $("#btnBrushSize").val(brushIncrementedValue); | ... | ... |