Commit b7d68d868551e29f722a38ecc2b88835d0213785

Authored by unknown
1 parent 8f865224

Modesty Setting

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -34,6 +34,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
34 34 $scope.bagartDetails;
35 35 $scope.transNumber = 50;
36 36  
  37 + $rootScope.modestyCanvasZindex = 12100;
  38 + $rootScope.isModestyCanvasVisible = false;
37 39 //for transarency scale
38 40 $scope.TBDrawStartX;
39 41 $scope.TBDrawStartY;
... ... @@ -731,7 +733,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
731 733  
732 734 //set max for LayerNumber input
733 735 $rootScope.totalLayers = dataLength - 1;
734   - // debugger
  736 +
735 737 $('#txtLayerNumber').attr('max', $rootScope.totalLayers);
736 738 $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers);
737 739  
... ... @@ -1548,7 +1550,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1548 1550 // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1549 1551 $scope.MultiLanguageAnnationArray = [];
1550 1552 $scope.MultiLanguageAnnationArray.push(annotationText);
1551   -
  1553 +
1552 1554 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1553 1555 }
1554 1556 else {
... ... @@ -1574,7 +1576,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1574 1576 $scope.MultiLanguageAnnationArray = [];
1575 1577 $scope.MultiLanguageAnnationArray.push(annotationText);
1576 1578  
1577   -
  1579 +
1578 1580 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1579 1581 }
1580 1582  
... ... @@ -2785,7 +2787,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2785 2787 return null;
2786 2788 }
2787 2789 }
2788   -
  2790 +
2789 2791  
2790 2792 //layer change function
2791 2793 $scope.LayerChange = function () {
... ... @@ -2795,7 +2797,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2795 2797 // $rootScope.isListManagerSelected = false;
2796 2798  
2797 2799 $rootScope.CloseListManager();
2798   -
2799 2800 $scope.isLayerChange = true;
2800 2801 $rootScope.isLoading = true;
2801 2802 $('#spinner').css('visibility', 'visible');
... ... @@ -2937,17 +2938,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2937 2938 $('#sppeachBubble').remove();
2938 2939 $(".com").remove();
2939 2940 $("#bord").remove();
2940   -
2941   -
2942   - if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")){
  2941 +
  2942 + if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
2943 2943 if ($rootScope.isAnnotatiomToolBarPopupActive == false) {
2944   -
2945   - if ($("#transparencyScale").css("display") == "block") {
  2944 + if ($("#transparencyScale").css("display") == "block") {
2946 2945 $rootScope.switchToTransparencycanvas();
2947 2946 }
2948 2947 }
2949 2948 else {
2950   -
2951 2949 if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
2952 2950 $rootScope.switchToTransparencycanvas();
2953 2951 }
... ... @@ -2956,14 +2954,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2956 2954 $rootScope.switchCanvas();
2957 2955 }
2958 2956 }
2959   -
2960 2957 }
2961 2958 else
2962 2959 {
2963 2960 if ($rootScope.isAnnotatiomToolBarPopupActive == true) {
2964   -
2965 2961 $rootScope.CloseAnnotationTool();
2966   -
2967 2962 }
2968 2963 }
2969 2964 }
... ... @@ -2973,15 +2968,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2973 2968  
2974 2969 $scope.DisableProgressBar = function () {
2975 2970  
2976   - // alert('Disabled wait cursor is called');
2977   -
2978 2971  
2979 2972 if ($rootScope.isHighLight) {
2980   - //alert('isHighlight: ' + $scope.isHighLight);
2981   -
2982   - //$('#btnHighLight').removeClass('btn btn-black');
2983   - //$('#btnHighLight').addClass('btn-primary');
2984   -
  2973 +
2985 2974 $("#btnHighLight").addClass("btn-primary");
2986 2975 $("#btnHighLight").removeClass("btn-black");
2987 2976  
... ... @@ -3043,7 +3032,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3043 3032  
3044 3033 $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationForTBox) {
3045 3034  
3046   - //debugger;
  3035 +
3047 3036 if (isAnnotationForTBox == true) {
3048 3037 //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that
3049 3038 // we decide the size of speech bubble
... ... @@ -3281,7 +3270,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3281 3270 var Exists_annotation = $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").length;
3282 3271 // alert(Exists_annotation);
3283 3272 // alert(pointClicked_annotation);
3284   - var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno'><div style='z-index:10000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.j + "'></div><div data=" + $scope.j + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.j + " class='dynCross_anno' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord_annotation" + $scope.j + "'></div></div>";
  3273 + var sppechBubbleHTML_annotation = "<div id ='" + pointClicked_annotation + "' class='com_anno'><div style='z-index:59000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.j + "'></div><div data=" + $scope.j + " id=" + sub_id_annotation + " class='appendDragg_annotation' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.j + " class='dynCross_anno' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:59000;' id='bord_annotation" + $scope.j + "'></div></div>";
3285 3274 if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
3286 3275 if (Exists_annotation == 0) {
3287 3276 $("#canvasDiv").append(sppechBubbleHTML_annotation);
... ... @@ -3506,12 +3495,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3506 3495 $(".com_annotation").css("display", "none");
3507 3496 $("#bord_annotation").css({ "width": "0px", "display": "none" });
3508 3497 $('.dynCross_anno').parent().parent().parent().remove();
3509   - var sppechBubbleDotHTML_annotation = '<div id="dot_annotation" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
  3498 + var sppechBubbleDotHTML_annotation = '<div id="dot_annotation" style="position:absolute;height:15px;width:35px;display:none;z-index:59000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
3510 3499 + '<div id="sppeachBubble_annotation" style="height:auto!important;z-index:60000;margin-left:25px;border:1px solid #000;display:none;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;font-weight:bold;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">'
3511 3500 + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">'
3512 3501 + '<img class="crossDiv_temp_annotation" style="width:18px" src=' + $rootScope.path + '></span></div>'
3513 3502  
3514   - + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord_annotation">'
  3503 + + '<div style="position:absolute;border:1px solid #000;display:none;z-index:59000;" id="bord_annotation">'
3515 3504 + '</div>';
3516 3505  
3517 3506  
... ... @@ -3962,6 +3951,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3962 3951 }
3963 3952  
3964 3953 function mouseDownListener(e) {
  3954 +
3965 3955 //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
3966 3956 var tCanvas = document.getElementById('transparencyCanvas');
3967 3957 if ($('#transparencyScale').css("visibility") == 'visible') {
... ... @@ -4237,18 +4227,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4237 4227 $("#annotationpainteraser").removeClass("activebtncolor");
4238 4228 if ($("#DrawMode").hasClass("annotationtoolbartab"))
4239 4229 {
4240   - var drawCanvasZindex = $("#canvas").css("z-index");
4241   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
4242   - drawCanvasZindex = parseInt(drawCanvasZindex) - 1;
4243   - paintCanvasZindex = parseInt(paintCanvasZindex) - 1;
4244   - if (drawCanvasZindex > paintCanvasZindex) {
4245   - $(".ui-wrapper").css("z-index", drawCanvasZindex);
4246   - $rootScope.UIWrapperZIndex = drawCanvasZindex;
  4230 + if ($rootScope.isModestyCanvasVisible == true) {
  4231 +
  4232 + $rootScope.switchCanvas();
  4233 +
4247 4234 }
4248 4235 else {
4249   - $(".ui-wrapper").css("z-index", paintCanvasZindex);
4250   - $rootScope.UIWrapperZIndex = paintCanvasZindex;
  4236 + var drawCanvasZindex = $("#canvas").css("z-index");
  4237 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  4238 + drawCanvasZindex = parseInt(drawCanvasZindex) - 1;
  4239 + paintCanvasZindex = parseInt(paintCanvasZindex) - 1;
  4240 + if (drawCanvasZindex > paintCanvasZindex) {
  4241 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  4242 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
  4243 + }
  4244 + else {
  4245 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  4246 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
  4247 + }
4251 4248 }
  4249 +
4252 4250 }
4253 4251 else {
4254 4252 $rootScope.switchToTransparencycanvas();
... ... @@ -4458,6 +4456,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4458 4456 }
4459 4457  
4460 4458 if (document.getElementById(modestyTransCanvasId) == null || document.getElementById(modestyTransCanvasId) == undefined) {
  4459 + $rootScope.isModestyCanvasVisible = true;
4461 4460 var canvasModesty = document.createElement('canvas');
4462 4461 canvasModesty.id = modestyTransCanvasId;
4463 4462 canvasModesty.height = Height;
... ... @@ -4466,7 +4465,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4466 4465 canvasModesty.style.left = X + 'px';
4467 4466 canvasModesty.style.top = Y + 'px';
4468 4467 canvasModesty.style.visibility = 'visible';
4469   - canvasModesty.style.zIndex = '2000';
  4468 + canvasModesty.style.zIndex = $rootScope.modestyCanvasZindex;
4470 4469 canvasModesty.addEventListener('click', OnClickModestyTransCanvas);
4471 4470  
4472 4471 document.getElementById('canvasDiv').appendChild(canvasModesty);
... ... @@ -5389,8 +5388,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5389 5388 $scope.annotationTextArrayT2 = [];
5390 5389 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5391 5390 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5392   -
5393   -
  5391 +
5394 5392 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5395 5393 }
5396 5394 else
... ... @@ -5402,7 +5400,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5402 5400 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5403 5401 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5404 5402  
5405   -
5406 5403 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5407 5404 }
5408 5405  
... ... @@ -5487,8 +5484,32 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5487 5484 if ($('#speechBubbleTrns').length > 0) {
5488 5485 $('#speechBubbleTrns').remove();
5489 5486 }
  5487 +
  5488 + var t = $(".ui-wrapper").css("top");
  5489 + var e = t.split("p");
  5490 + var a = $(".ui-wrapper").css("height");
  5491 + var b = a.split("p");
  5492 + var c = parseInt(e[0]) + parseInt(b[0]);
  5493 +
  5494 +
  5495 + var tCanvasTopPos = $(".ui-wrapper").css("top");
  5496 + var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p");
  5497 + var tCanvasHeight = $(".ui-wrapper").css("height");
  5498 + var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
  5499 + var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
  5500 +
  5501 +
  5502 + if ((evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) >= parseInt(tCanvasTopPosAftrSplit[0]) && (evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) < tCanvasAttr) {
  5503 +
5490 5504 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5491 5505  
  5506 + }
  5507 + else {
  5508 +
  5509 + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event);
  5510 +
  5511 + }
  5512 +
5492 5513  
5493 5514 }
5494 5515  
... ... @@ -5533,7 +5554,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5533 5554 $scope.annotationTextArrayT2 = [];
5534 5555 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5535 5556 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5536   -
  5557 +
5537 5558 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5538 5559 }
5539 5560 else
... ... @@ -5542,7 +5563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5542 5563 $scope.annotationTextArrayT2 = [];
5543 5564 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5544 5565 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5545   -
  5566 +
5546 5567 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5547 5568 }
5548 5569 }
... ... @@ -5641,8 +5662,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5641 5662  
5642 5663  
5643 5664 $scope.onTransparencyChange = function (ev, ui) {
5644   - //debugger;
5645   - // alert('t change')
  5665 +
5646 5666 $scope.transNumber = ui.value;
5647 5667  
5648 5668 var tCanvas = document.getElementById('transparencyCanvas');
... ... @@ -5700,7 +5720,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5700 5720 }
5701 5721  
5702 5722 $scope.CloseTransparencyBox = function () {
5703   -
  5723 + $rootScope.isModestyCanvasVisible = false;
5704 5724 //for enabling annoataions.
5705 5725 //Now everything si done on canavases uswed in annotation toolbar.
5706 5726  
... ... @@ -8418,8 +8438,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8418 8438 .from($scope.VocabTermTxt)
8419 8439 .where('_TermText == ' + $scope.searchFilter)
8420 8440 .select('_ActualTermNumber', '_TermText', '_cdId');
8421   -
  8441 +
8422 8442 if (EnteredDASearchTerm.length > 0) {
  8443 +
8423 8444 $scope.HighlightBodyOnListManagerSelection(EnteredDASearchTerm[0]._ActualTermNumber);
8424 8445  
8425 8446 $scope.IsSearchVisible = false;
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -465,7 +465,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
465 465  
466 466  
467 467 $rootScope.openParent = function (slug) {
468   - // debugger;
  468 +
469 469 var openViews = $rootScope.openViews;
470 470 if (openViews.length > 0) {
471 471 $rootScope.openViews.splice(openViews.length - 1);
... ... @@ -640,21 +640,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
640 640 $rootScope.CIAnotationIdentifyModeOff = false;
641 641 $rootScope.OnIdentifyClick = function () {
642 642  
643   -
  643 +
644 644 $("#OnIdentify").addClass("annotationtoolbartab");
645 645 $("#DrawMode").removeClass("annotationtoolbartab");
646   - // $rootScope.isIdetifyClicked = true;
647   - // $rootScope.isDrawingToolSelected = false;
648   - // debugger;
  646 +
649 647 if ($rootScope.CIAnotationIdentifyModeOff == true) {
650 648 $('.btnCursor').removeClass('activebtncolor');
651 649  
652 650 } else {
653   - // $("#canvasPaint").css("display", "none");
654   - // $("#canvas").css("display", "none");
655   -
656   - // $("#canvasPaint").css("z-index", "0");
657   - // $("#canvas").css("z-index", "0");
  651 +
658 652 $('.btnCursor').removeClass('activebtncolor');
659 653  
660 654 }
... ... @@ -673,26 +667,86 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
673 667 }
674 668  
675 669 $rootScope.switchToTransparencycanvas = function () {
  670 +
  671 + if ($rootScope.isModestyCanvasVisible == true) {
  672 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  673 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  674 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  675 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  676 +
  677 + if (ctx.style.visibility == "visible") {
676 678  
677   - var x = $("#canvas").css("z-index");
678   - var y = $("#canvasPaint").css("z-index");
679   - x = parseInt(x) + 1;
680   - y = parseInt(y) + 1;
681   - if (x > y) {
682   - $(".ui-wrapper").css("z-index", x);
683   - $("#canvas").css("z-index", x);
684   - $rootScope.UIWrapperZIndex = x;
  679 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
685 680  
  681 + var drawCanvasZindex = $("#canvas").css("z-index");
  682 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  683 + var TransCanvasZindex = ctx.style.zIndex;
  684 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  685 + MaxZindexVal = MaxZindexVal + 1;
  686 + $("#canvas").css("z-index", MaxZindexVal);
  687 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  688 +
  689 + }
  690 + else {
  691 + var drawCanvasZindex = $("#canvas").css("z-index");
  692 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  693 + var TransCanvasZindex = ctx.style.zIndex;
  694 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  695 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  696 +
  697 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  698 +
  699 + $("#canvasPaint").css("z-index", MaxZindexVal);
  700 + }
  701 + else {
  702 + $("#canvas").css("z-index", MaxZindexVal);
  703 + }
  704 +
  705 + }
  706 + }
  707 + else
  708 + {
  709 + var drawCanvasZindex = $("#canvas").css("z-index");
  710 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  711 + drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
  712 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  713 + if (drawCanvasZindex > paintCanvasZindex) {
  714 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  715 + $("#canvas").css("z-index", drawCanvasZindex);
  716 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
  717 + }
  718 + else {
  719 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  720 + $("#canvas").css("z-index", paintCanvasZindex);
  721 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
  722 + }
  723 +
  724 + }
  725 + }
  726 + }
  727 +
  728 + }
  729 + else
  730 + {
  731 + var drawCanvasZindex = $("#canvas").css("z-index");
  732 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  733 + drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
  734 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  735 + if (drawCanvasZindex > paintCanvasZindex) {
  736 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  737 + $("#canvas").css("z-index", drawCanvasZindex);
  738 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
686 739 }
687 740 else {
688   - $(".ui-wrapper").css("z-index", y);
689   - $("#canvas").css("z-index", y);
690   - $rootScope.UIWrapperZIndex = y;
  741 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  742 + $("#canvas").css("z-index", paintCanvasZindex);
  743 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
691 744 }
692   -
  745 + }
693 746 }
694 747  
695 748 $rootScope.DrawingMode = function () {
  749 +
696 750 //Annotation History
697 751 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
698 752 $("#OnIdentify").removeClass("annotationtoolbartab");
... ... @@ -726,14 +780,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
726 780 $("#canvasPaint").css("display", "block");
727 781 $("#canvas").css("display", "block");
728 782  
729   - $rootScope.switchCanvas();
730   - $rootScope.shapeType = "Line";
731   -
732 783 $('.btnCursor').removeClass('activebtncolor');
733 784 $(".btn-annotation").removeClass("activebtncolor");
734 785 $(".btn-annotation-line").addClass("activebtncolor");
735 786 $("#OnIdentify").removeClass('annotationtoolbartab');
736 787 $("#DrawMode").addClass('annotationtoolbartab');
  788 +
  789 +
  790 + $rootScope.switchCanvas();
  791 + $rootScope.shapeType = "Line";
  792 +
  793 +
737 794 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
738 795 }
739 796  
... ... @@ -742,16 +799,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
742 799 $("#canvasPaint").css("display", "block");
743 800 $("#canvas").css("display", "block");
744 801  
745   - $rootScope.switchCanvas();
746   - $rootScope.switchCanvas();
747   - $rootScope.setListManagerZindex = true;
748   - $rootScope.shapeType = "Pin";
749   -
750 802 $('.btnCursor').removeClass('activebtncolor');
751 803 $(".btn-annotation").removeClass("activebtncolor");
752 804 $(".btn-annotation-pin").addClass("activebtncolor");
753 805 $("#OnIdentify").removeClass('annotationtoolbartab');
754 806 $("#DrawMode").addClass('annotationtoolbartab');
  807 +
  808 + $rootScope.switchCanvas();
  809 + $rootScope.setListManagerZindex = true;
  810 + $rootScope.shapeType = "Pin";
  811 +
  812 +
755 813 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
756 814 }
757 815  
... ... @@ -772,17 +830,25 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
772 830 $rootScope.setListManagerZindex = true;
773 831 $("#canvasPaint").css("display", "block");
774 832 $("#canvas").css("display", "block");
775   - $rootScope.switchCanvas();
776   - $rootScope.shapeType = "Rectangle";
  833 +
777 834 $('.btnCursor').removeClass('activebtncolor');
778 835 $(".btn-annotation").removeClass("activebtncolor");
779 836 $(".btn-annotation-rectangle").addClass("activebtncolor");
780 837 $("#OnIdentify").removeClass('annotationtoolbartab');
781 838 $("#DrawMode").addClass('annotationtoolbartab');
  839 +
  840 + $rootScope.switchCanvas();
  841 + $rootScope.shapeType = "Rectangle";
  842 +
782 843 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
783 844 }
784 845  
785 846 $rootScope.paintBrush = function () {
  847 + $('.btnCursor').removeClass('activebtncolor');
  848 + $(".btn-annotation").removeClass("activebtncolor");
  849 + $(".btn-annotation-brush").addClass("activebtncolor");
  850 + $("#OnIdentify").removeClass('annotationtoolbartab');
  851 + $("#DrawMode").addClass('annotationtoolbartab');
786 852 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
787 853 if ($rootScope.disableAnnotationtoolOnListManager == true) {
788 854 $rootScope.switchCanvas();
... ... @@ -801,7 +867,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
801 867  
802 868 } else {
803 869  
804   - // $('.btnCursor').addClass('activebtncolor');
805 870 $rootScope.setListManagerZindex = true;
806 871 $("#canvasPaint").css("display", "block");
807 872 $("#canvas").css("display", "block");
... ... @@ -821,8 +886,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
821 886  
822 887 $("#annotationpaintbrushsize").attr("data-color", $rootScope.shapestyleColorWithOpacity);
823 888  
824   -
825   -
826 889 if ($rootScope.shapeSize == '') {
827 890 $('#canvasPaint').sketch({ defaultSize: 1 });
828 891 }
... ... @@ -830,17 +893,58 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
830 893 $('#canvasPaint').sketch();
831 894  
832 895 }
833   -
834 896 }
835   -
836   - $('.btnCursor').removeClass('activebtncolor');
837   - $(".btn-annotation").removeClass("activebtncolor");
838   - $(".btn-annotation-brush").addClass("activebtncolor");
839   - $("#OnIdentify").removeClass('annotationtoolbartab');
840   - $("#DrawMode").addClass('annotationtoolbartab');
841 897 }
842 898  
843 899 $rootScope.switchCanvasToPaintCanvas = function (e) {
  900 + if ($rootScope.isModestyCanvasVisible == true) {
  901 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  902 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  903 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  904 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  905 + if (ctx.style.visibility == "visible") {
  906 + var drawCanvasZindex = $("#canvas").css("z-index");
  907 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  908 + var TransCanvasZindex = ctx.style.zIndex;
  909 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  910 + MaxZindexVal = MaxZindexVal + 1;
  911 + if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
  912 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  913 + $("#canvas").css("z-index", MaxZindexVal);
  914 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  915 + }
  916 + else {
  917 +
  918 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  919 + $("#canvasPaint").css("z-index", MaxZindexVal);
  920 + }
  921 + else {
  922 + $("#canvas").css("z-index", MaxZindexVal);
  923 + }
  924 + }
  925 + }
  926 + }
  927 + else {
  928 +
  929 + var drawCanvasZindex = $("#canvas").css("z-index");
  930 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  931 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
  932 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  933 +
  934 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  935 + $("#canvasPaint").css("z-index", MaxZindexVal);
  936 + }
  937 +
  938 + else {
  939 + $("#canvas").css("z-index", MaxZindexVal);
  940 + }
  941 +
  942 + }
  943 + }
  944 + }
  945 +
  946 + }
  947 + else {
844 948 var canvasPaint_zIndex = $('#canvasPaint').css("z-index");
845 949 var canvas_zIndex = $('#canvas').css("z-index");
846 950 if (canvas_zIndex > canvasPaint_zIndex) {
... ... @@ -852,18 +956,22 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
852 956 }
853 957 $('#canvasPaint').css("z-index", canvasPaint_zIndex);
854 958 }
  959 + }
855 960  
856 961 $rootScope.DrawCircle = function (e) {
857 962 $rootScope.setListManagerZindex = true;
858 963 $("#canvasPaint").css("display", "block");
859 964 $("#canvas").css("display", "block");
860   - $rootScope.switchCanvas();
861   - $rootScope.shapeType = "Circle";
  965 +
862 966 $('.btnCursor').removeClass('activebtncolor');
863 967 $(".btn-annotation").removeClass("activebtncolor");
864 968 $(".btn-annotation-circle").addClass("activebtncolor");
865 969 $("#OnIdentify").removeClass('annotationtoolbartab');
866 970 $("#DrawMode").addClass('annotationtoolbartab');
  971 +
  972 + $rootScope.switchCanvas();
  973 + $rootScope.shapeType = "Circle";
  974 +
867 975 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
868 976 }
869 977  
... ... @@ -871,13 +979,16 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
871 979 $rootScope.setListManagerZindex = true;
872 980 $("#canvasPaint").css("display", "block");
873 981 $("#canvas").css("display", "block");
874   - $rootScope.switchCanvas();
875   - $rootScope.shapeType = "Arrow";
  982 +
876 983 $('.btnCursor').removeClass('activebtncolor');
877 984 $(".btn-annotation").removeClass("activebtncolor");
878 985 $(".btn-annotation-arrow").addClass("activebtncolor");
879 986 $("#OnIdentify").removeClass('annotationtoolbartab');
880 987 $("#DrawMode").addClass('annotationtoolbartab');
  988 +
  989 + $rootScope.switchCanvas();
  990 + $rootScope.shapeType = "Arrow";
  991 +
881 992 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
882 993 }
883 994 $rootScope.DrawText = function () {
... ... @@ -885,14 +996,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
885 996 $rootScope.setListManagerZindex = true;
886 997 $("#canvasPaint").css("display", "block");
887 998 $("#canvas").css("display", "block");
888   - $rootScope.switchCanvas();
889 999  
890   - $rootScope.shapeType = "TextArea";
891 1000 $('.btnCursor').removeClass('activebtncolor');
892 1001 $(".btn-annotation").removeClass("activebtncolor");
893 1002 $(".btn-annotation-Text").addClass("activebtncolor");
894 1003 $("#OnIdentify").removeClass('annotationtoolbartab');
895 1004 $("#DrawMode").addClass('annotationtoolbartab');
  1005 +
  1006 + $rootScope.switchCanvas();
  1007 +
  1008 + $rootScope.shapeType = "TextArea";
  1009 +
896 1010 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
897 1011 }
898 1012  
... ... @@ -908,15 +1022,75 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
908 1022  
909 1023  
910 1024 $rootScope.switchCanvas = function () {
911   - var x = $('#canvasPaint').css("z-index");
  1025 +
  1026 + if ($rootScope.isModestyCanvasVisible == true) {
  1027 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  1028 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  1029 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  1030 + var ctx = document.getElementById(modestyTransCanvases[j].id);
912 1031  
913   - var y = $('#canvas').css("z-index");
914   - if (x > y) {
915   - y = parseInt(x) + 1;
916   - } else {
917   - y = parseInt(y) + 1;
  1032 + if (ctx.style.visibility == "visible") {
  1033 +
  1034 + var drawCanvasZindex = $("#canvas").css("z-index");
  1035 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1036 + var TransCanvasZindex = ctx.style.zIndex;
  1037 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  1038 + MaxZindexVal = MaxZindexVal + 1;
  1039 +
  1040 +
  1041 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  1042 +
  1043 + $("#canvas").css("z-index", MaxZindexVal);
  1044 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1045 +
  1046 + }
  1047 + else {
  1048 +
  1049 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1050 +
  1051 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1052 + }
  1053 + else {
  1054 + $("#canvas").css("z-index", MaxZindexVal);
  1055 + }
  1056 +
  1057 + }
  1058 + }
  1059 + else {
  1060 +
  1061 + var drawCanvasZindex = $("#canvas").css("z-index");
  1062 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1063 +
  1064 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
  1065 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  1066 +
  1067 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1068 +
  1069 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1070 + }
  1071 +
  1072 + else {
  1073 + $("#canvas").css("z-index", MaxZindexVal);
  1074 + }
  1075 + }
  1076 + }
  1077 + }
  1078 + }
  1079 + else
  1080 + {
  1081 +
  1082 + var drawCanvasZindex = $("#canvas").css("z-index");
  1083 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1084 +
  1085 +
  1086 + if (drawCanvasZindex > paintCanvasZindex) {
  1087 + paintCanvasZindex = parseInt(drawCanvasZindex) + 1;
  1088 + } else {
  1089 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  1090 + }
  1091 + $('#canvas').css("z-index", paintCanvasZindex);
918 1092 }
919   - $('#canvas').css("z-index", y);
  1093 +
920 1094 }
921 1095 $rootScope.EraseDrawing = function () {
922 1096 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
... ... @@ -1078,9 +1252,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1078 1252 $("#edit-slider-4").css({ "pointer-events": "none" });
1079 1253 $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
1080 1254 }
1081   - //$("#borderWidthCanvasElement").change(function () {
1082   - // $(".marginTopBtm10 div.outlinediv").css("border-color", x);
1083   - //});
  1255 +
1084 1256 } else {
1085 1257  
1086 1258 document.getElementById('fill-option').checked = isfilloptionChecked;
... ... @@ -1963,35 +2135,35 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1963 2135 case "Line":
1964 2136 $(".line").remove();
1965 2137 $rootScope.isLinePreviewCompleted = true;
1966   - $("#canvasDiv").append("<div class='line' style='z-index:610;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
  2138 + $("#canvasDiv").append("<div class='line' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
1967 2139 $rootScope.Annotationangle();
1968 2140 break;
1969 2141 case "Arrow":
1970 2142 $(".arrow").remove();
1971 2143 $rootScope.isArrowPreviewCompleted = true;
1972   - $("#canvasDiv").append("<div class='arrow' style='z-index:610;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='border-bottom: 9px solid transparent;border-right: 12px dashed #ccc;border-top: 7px solid transparent;height: 0;left: -6px;position: absolute;top: -8px;width: 0;'></div></div>");
  2144 + $("#canvasDiv").append("<div class='arrow' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='border-bottom: 9px solid transparent;border-right: 12px dashed #ccc;border-top: 7px solid transparent;height: 0;left: -6px;position: absolute;top: -8px;width: 0;'></div></div>");
1973 2145 $rootScope.Annotationangle();
1974 2146 break;
1975 2147 case "Pin":
1976 2148 $(".pin").remove();
1977 2149 $rootScope.isPinPreviewCompleted = true;
1978   - $("#canvasDiv").append("<div class='pin' style='z-index:610;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='background-color:#fff;left: -8px;position: absolute;top: -6px;width: 10;height:12px;width:12px;border:2px dashed #808080;border-radius:50%;'></div></div>");
  2150 + $("#canvasDiv").append("<div class='pin' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + "px;'><div style='background-color:#fff;left: -8px;position: absolute;top: -6px;width: 10;height:12px;width:12px;border:2px dashed #808080;border-radius:50%;'></div></div>");
1979 2151 $rootScope.Annotationangle();
1980 2152 break;
1981 2153 case "Circle":
1982 2154 $(".circle").remove();
1983 2155 $rootScope.isCirclePreviewCompleted = true;
1984   - $("#canvasDiv").append("<div class='circle' style='z-index:610;border-radius:50%;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
  2156 + $("#canvasDiv").append("<div class='circle' style='z-index:12001;border-radius:50%;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
1985 2157 break;
1986 2158 case "Rectangle":
1987 2159 $(".rectangle").remove();
1988 2160 $rootScope.isRectanglePreviewCompleted = true;
1989   - $("#canvasDiv").append("<div class='rectangle' style='z-index:610;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
  2161 + $("#canvasDiv").append("<div class='rectangle' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
1990 2162 break;
1991 2163 case "TextArea":
1992 2164 $(".textarea").remove();
1993 2165 $rootScope.isTextAreaPreviewCompleted = true;
1994   - $("#canvasDiv").append("<div class='textarea' style='z-index:610;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
  2166 + $("#canvasDiv").append("<div class='textarea' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;width:" + (Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1)) + "px;height:" + (Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)) + "px;'></div>");
1995 2167 break;
1996 2168  
1997 2169 }
... ...