Commit 7699e51718880e29d9999630f71f5d42199e5855

Authored by Nikita Kulshreshtha
2 parents e6065c82 df546f12

Merge branch 'ModestySettIssue' into Develop

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;
... ... @@ -737,7 +739,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
737 739  
738 740 //set max for LayerNumber input
739 741 $rootScope.totalLayers = dataLength - 1;
740   - // debugger
  742 +
741 743 $('#txtLayerNumber').attr('max', $rootScope.totalLayers);
742 744 $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers);
743 745  
... ... @@ -1564,7 +1566,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1564 1566 // $scope.createDynamicSpeechBubble(evt, annotationText, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top);
1565 1567 $scope.MultiLanguageAnnationArray = [];
1566 1568 $scope.MultiLanguageAnnationArray.push(annotationText);
1567   -
  1569 +
1568 1570 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1569 1571 }
1570 1572 else {
... ... @@ -1590,7 +1592,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1590 1592 $scope.MultiLanguageAnnationArray = [];
1591 1593 $scope.MultiLanguageAnnationArray.push(annotationText);
1592 1594  
1593   -
  1595 +
1594 1596 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true);
1595 1597 }
1596 1598  
... ... @@ -2801,7 +2803,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2801 2803 return null;
2802 2804 }
2803 2805 }
2804   -
  2806 +
2805 2807  
2806 2808 //layer change function
2807 2809 $scope.LayerChange = function () {
... ... @@ -2811,7 +2813,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2811 2813 // $rootScope.isListManagerSelected = false;
2812 2814  
2813 2815 $rootScope.CloseListManager();
2814   -
2815 2816 $scope.isLayerChange = true;
2816 2817 $rootScope.isLoading = true;
2817 2818 $('#spinner').css('visibility', 'visible');
... ... @@ -2953,17 +2954,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2953 2954 $('#sppeachBubble').remove();
2954 2955 $(".com").remove();
2955 2956 $("#bord").remove();
2956   -
2957   -
2958   - if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")){
  2957 +
  2958 + if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
2959 2959 if ($rootScope.isAnnotatiomToolBarPopupActive == false) {
2960   -
2961   - if ($("#transparencyScale").css("display") == "block") {
  2960 + if ($("#transparencyScale").css("display") == "block") {
2962 2961 $rootScope.switchToTransparencycanvas();
2963 2962 }
2964 2963 }
2965 2964 else {
2966   -
2967 2965 if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
2968 2966 $rootScope.switchToTransparencycanvas();
2969 2967 }
... ... @@ -2972,14 +2970,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2972 2970 $rootScope.switchCanvas();
2973 2971 }
2974 2972 }
2975   -
2976 2973 }
2977 2974 else
2978 2975 {
2979 2976 if ($rootScope.isAnnotatiomToolBarPopupActive == true) {
2980   -
2981 2977 $rootScope.CloseAnnotationTool();
2982   -
2983 2978 }
2984 2979 }
2985 2980 }
... ... @@ -2989,15 +2984,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2989 2984  
2990 2985 $scope.DisableProgressBar = function () {
2991 2986  
2992   - // alert('Disabled wait cursor is called');
2993   -
2994 2987  
2995 2988 if ($rootScope.isHighLight) {
2996   - //alert('isHighlight: ' + $scope.isHighLight);
2997   -
2998   - //$('#btnHighLight').removeClass('btn btn-black');
2999   - //$('#btnHighLight').addClass('btn-primary');
3000   -
  2989 +
3001 2990 $("#btnHighLight").addClass("btn-primary");
3002 2991 $("#btnHighLight").removeClass("btn-black");
3003 2992  
... ... @@ -3059,7 +3048,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3059 3048  
3060 3049 $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationForTBox) {
3061 3050  
3062   - //debugger;
  3051 +
3063 3052 if (isAnnotationForTBox == true) {
3064 3053 //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
3065 3054 // we decide the size of speech bubble
... ... @@ -3297,7 +3286,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3297 3286 var Exists_annotation = $("#canvasDiv").find("div[id=" + pointClicked_annotation + "]").length;
3298 3287 // alert(Exists_annotation);
3299 3288 // alert(pointClicked_annotation);
3300   - 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>";
  3289 + 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>";
3301 3290 if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) {
3302 3291 if (Exists_annotation == 0) {
3303 3292 $("#canvasDiv").append(sppechBubbleHTML_annotation);
... ... @@ -3522,12 +3511,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3522 3511 $(".com_annotation").css("display", "none");
3523 3512 $("#bord_annotation").css({ "width": "0px", "display": "none" });
3524 3513 $('.dynCross_anno').parent().parent().parent().remove();
3525   - 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>'
  3514 + 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>'
3526 3515 + '<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;">'
3527 3516 + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">'
3528 3517 + '<img class="crossDiv_temp_annotation" style="width:18px" src=' + $rootScope.path + '></span></div>'
3529 3518  
3530   - + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord_annotation">'
  3519 + + '<div style="position:absolute;border:1px solid #000;display:none;z-index:59000;" id="bord_annotation">'
3531 3520 + '</div>';
3532 3521  
3533 3522  
... ... @@ -3978,6 +3967,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3978 3967 }
3979 3968  
3980 3969 function mouseDownListener(e) {
  3970 +
3981 3971 //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
3982 3972 var tCanvas = document.getElementById('transparencyCanvas');
3983 3973 if ($('#transparencyScale').css("visibility") == 'visible') {
... ... @@ -4253,18 +4243,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4253 4243 $("#annotationpainteraser").removeClass("activebtncolor");
4254 4244 if ($("#DrawMode").hasClass("annotationtoolbartab"))
4255 4245 {
4256   - var drawCanvasZindex = $("#canvas").css("z-index");
4257   - var paintCanvasZindex = $("#canvasPaint").css("z-index");
4258   - drawCanvasZindex = parseInt(drawCanvasZindex) - 1;
4259   - paintCanvasZindex = parseInt(paintCanvasZindex) - 1;
4260   - if (drawCanvasZindex > paintCanvasZindex) {
4261   - $(".ui-wrapper").css("z-index", drawCanvasZindex);
4262   - $rootScope.UIWrapperZIndex = drawCanvasZindex;
  4246 + if ($rootScope.isModestyCanvasVisible == true) {
  4247 +
  4248 + $rootScope.switchCanvas();
  4249 +
4263 4250 }
4264 4251 else {
4265   - $(".ui-wrapper").css("z-index", paintCanvasZindex);
4266   - $rootScope.UIWrapperZIndex = paintCanvasZindex;
  4252 + var drawCanvasZindex = $("#canvas").css("z-index");
  4253 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  4254 + drawCanvasZindex = parseInt(drawCanvasZindex) - 1;
  4255 + paintCanvasZindex = parseInt(paintCanvasZindex) - 1;
  4256 + if (drawCanvasZindex > paintCanvasZindex) {
  4257 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  4258 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
  4259 + }
  4260 + else {
  4261 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  4262 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
  4263 + }
4267 4264 }
  4265 +
4268 4266 }
4269 4267 else {
4270 4268 $rootScope.switchToTransparencycanvas();
... ... @@ -4474,6 +4472,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4474 4472 }
4475 4473  
4476 4474 if (document.getElementById(modestyTransCanvasId) == null || document.getElementById(modestyTransCanvasId) == undefined) {
  4475 + $rootScope.isModestyCanvasVisible = true;
4477 4476 var canvasModesty = document.createElement('canvas');
4478 4477 canvasModesty.id = modestyTransCanvasId;
4479 4478 canvasModesty.height = Height;
... ... @@ -4482,7 +4481,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4482 4481 canvasModesty.style.left = X + 'px';
4483 4482 canvasModesty.style.top = Y + 'px';
4484 4483 canvasModesty.style.visibility = 'visible';
4485   - canvasModesty.style.zIndex = '2000';
  4484 + canvasModesty.style.zIndex = $rootScope.modestyCanvasZindex;
4486 4485 canvasModesty.addEventListener('click', OnClickModestyTransCanvas);
4487 4486  
4488 4487 document.getElementById('canvasDiv').appendChild(canvasModesty);
... ... @@ -5405,8 +5404,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5405 5404 $scope.annotationTextArrayT2 = [];
5406 5405 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5407 5406 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5408   -
5409   -
  5407 +
5410 5408 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5411 5409 }
5412 5410 else
... ... @@ -5418,7 +5416,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5418 5416 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5419 5417 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5420 5418  
5421   -
5422 5419 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5423 5420 }
5424 5421  
... ... @@ -5503,8 +5500,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5503 5500 if ($('#speechBubbleTrns').length > 0) {
5504 5501 $('#speechBubbleTrns').remove();
5505 5502 }
  5503 +
  5504 + var tCanvasTopPos = $(".ui-wrapper").css("top");
  5505 + var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p");
  5506 + var tCanvasHeight = $(".ui-wrapper").css("height");
  5507 + var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
  5508 + var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
  5509 +
  5510 + if ((evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) >= parseInt(tCanvasTopPosAftrSplit[0]) && (evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top) <= tCanvasAttr) {
  5511 +
5506 5512 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5507 5513  
  5514 + }
  5515 + else {
  5516 +
  5517 + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(evt);
  5518 +
  5519 + }
  5520 +
5508 5521  
5509 5522 }
5510 5523  
... ... @@ -5549,7 +5562,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5549 5562 $scope.annotationTextArrayT2 = [];
5550 5563 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5551 5564 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5552   -
  5565 +
5553 5566 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5554 5567 }
5555 5568 else
... ... @@ -5558,7 +5571,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5558 5571 $scope.annotationTextArrayT2 = [];
5559 5572 $scope.annotationTextArrayT1.push(annotations.annotationT1);
5560 5573 $scope.annotationTextArrayT2.push(annotations.annotationT2);
5561   -
  5574 +
5562 5575 $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
5563 5576 }
5564 5577 }
... ... @@ -5657,8 +5670,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5657 5670  
5658 5671  
5659 5672 $scope.onTransparencyChange = function (ev, ui) {
5660   - //debugger;
5661   - // alert('t change')
  5673 +
5662 5674 $scope.transNumber = ui.value;
5663 5675  
5664 5676 var tCanvas = document.getElementById('transparencyCanvas');
... ... @@ -5716,7 +5728,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5716 5728 }
5717 5729  
5718 5730 $scope.CloseTransparencyBox = function () {
5719   -
  5731 + $rootScope.isModestyCanvasVisible = false;
5720 5732 //for enabling annoataions.
5721 5733 //Now everything si done on canavases uswed in annotation toolbar.
5722 5734  
... ... @@ -8425,8 +8437,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8425 8437 .from($scope.VocabTermTxt)
8426 8438 .where('_TermText == ' + $scope.searchFilter)
8427 8439 .select('_ActualTermNumber', '_TermText', '_cdId');
8428   -
  8440 +
8429 8441 if (EnteredDASearchTerm.length > 0) {
  8442 +
8430 8443 $scope.HighlightBodyOnListManagerSelection(EnteredDASearchTerm[0]._ActualTermNumber);
8431 8444  
8432 8445 $scope.IsSearchVisible = false;
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -466,7 +466,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
466 466  
467 467  
468 468 $rootScope.openParent = function (slug) {
469   - // debugger;
  469 +
470 470 var openViews = $rootScope.openViews;
471 471 if (openViews.length > 0) {
472 472 $rootScope.openViews.splice(openViews.length - 1);
... ... @@ -641,21 +641,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
641 641 $rootScope.CIAnotationIdentifyModeOff = false;
642 642 $rootScope.OnIdentifyClick = function () {
643 643  
644   -
  644 +
645 645 $("#OnIdentify").addClass("annotationtoolbartab");
646 646 $("#DrawMode").removeClass("annotationtoolbartab");
647   - // $rootScope.isIdetifyClicked = true;
648   - // $rootScope.isDrawingToolSelected = false;
649   - // debugger;
  647 +
650 648 if ($rootScope.CIAnotationIdentifyModeOff == true) {
651 649 $('.btnCursor').removeClass('activebtncolor');
652 650  
653 651 } else {
654   - // $("#canvasPaint").css("display", "none");
655   - // $("#canvas").css("display", "none");
656   -
657   - // $("#canvasPaint").css("z-index", "0");
658   - // $("#canvas").css("z-index", "0");
  652 +
659 653 $('.btnCursor').removeClass('activebtncolor');
660 654  
661 655 }
... ... @@ -674,26 +668,86 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
674 668 }
675 669  
676 670 $rootScope.switchToTransparencycanvas = function () {
  671 +
  672 + if ($rootScope.isModestyCanvasVisible == true) {
  673 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  674 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  675 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  676 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  677 +
  678 + if (ctx.style.visibility == "visible") {
677 679  
678   - var x = $("#canvas").css("z-index");
679   - var y = $("#canvasPaint").css("z-index");
680   - x = parseInt(x) + 1;
681   - y = parseInt(y) + 1;
682   - if (x > y) {
683   - $(".ui-wrapper").css("z-index", x);
684   - $("#canvas").css("z-index", x);
685   - $rootScope.UIWrapperZIndex = x;
  680 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
686 681  
  682 + var drawCanvasZindex = $("#canvas").css("z-index");
  683 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  684 + var TransCanvasZindex = ctx.style.zIndex;
  685 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  686 + MaxZindexVal = MaxZindexVal + 1;
  687 + $("#canvas").css("z-index", MaxZindexVal);
  688 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  689 +
  690 + }
  691 + else {
  692 + var drawCanvasZindex = $("#canvas").css("z-index");
  693 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  694 + var TransCanvasZindex = ctx.style.zIndex;
  695 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  696 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  697 +
  698 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  699 +
  700 + $("#canvasPaint").css("z-index", MaxZindexVal);
  701 + }
  702 + else {
  703 + $("#canvas").css("z-index", MaxZindexVal);
  704 + }
  705 +
  706 + }
  707 + }
  708 + else
  709 + {
  710 + var drawCanvasZindex = $("#canvas").css("z-index");
  711 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  712 + drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
  713 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  714 + if (drawCanvasZindex > paintCanvasZindex) {
  715 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  716 + $("#canvas").css("z-index", drawCanvasZindex);
  717 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
  718 + }
  719 + else {
  720 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  721 + $("#canvas").css("z-index", paintCanvasZindex);
  722 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
  723 + }
  724 +
  725 + }
  726 + }
  727 + }
  728 +
  729 + }
  730 + else
  731 + {
  732 + var drawCanvasZindex = $("#canvas").css("z-index");
  733 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  734 + drawCanvasZindex = parseInt(drawCanvasZindex) + 1;
  735 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  736 + if (drawCanvasZindex > paintCanvasZindex) {
  737 + $(".ui-wrapper").css("z-index", drawCanvasZindex);
  738 + $("#canvas").css("z-index", drawCanvasZindex);
  739 + $rootScope.UIWrapperZIndex = drawCanvasZindex;
687 740 }
688 741 else {
689   - $(".ui-wrapper").css("z-index", y);
690   - $("#canvas").css("z-index", y);
691   - $rootScope.UIWrapperZIndex = y;
  742 + $(".ui-wrapper").css("z-index", paintCanvasZindex);
  743 + $("#canvas").css("z-index", paintCanvasZindex);
  744 + $rootScope.UIWrapperZIndex = paintCanvasZindex;
692 745 }
693   -
  746 + }
694 747 }
695 748  
696 749 $rootScope.DrawingMode = function () {
  750 +
697 751 //Annotation History
698 752 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
699 753 $("#OnIdentify").removeClass("annotationtoolbartab");
... ... @@ -727,14 +781,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
727 781 $("#canvasPaint").css("display", "block");
728 782 $("#canvas").css("display", "block");
729 783  
730   - $rootScope.switchCanvas();
731   - $rootScope.shapeType = "Line";
732   -
733 784 $('.btnCursor').removeClass('activebtncolor');
734 785 $(".btn-annotation").removeClass("activebtncolor");
735 786 $(".btn-annotation-line").addClass("activebtncolor");
736 787 $("#OnIdentify").removeClass('annotationtoolbartab');
737 788 $("#DrawMode").addClass('annotationtoolbartab');
  789 +
  790 +
  791 + $rootScope.switchCanvas();
  792 + $rootScope.shapeType = "Line";
  793 +
  794 +
738 795 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
739 796 }
740 797  
... ... @@ -743,16 +800,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
743 800 $("#canvasPaint").css("display", "block");
744 801 $("#canvas").css("display", "block");
745 802  
746   - $rootScope.switchCanvas();
747   - $rootScope.switchCanvas();
748   - $rootScope.setListManagerZindex = true;
749   - $rootScope.shapeType = "Pin";
750   -
751 803 $('.btnCursor').removeClass('activebtncolor');
752 804 $(".btn-annotation").removeClass("activebtncolor");
753 805 $(".btn-annotation-pin").addClass("activebtncolor");
754 806 $("#OnIdentify").removeClass('annotationtoolbartab');
755 807 $("#DrawMode").addClass('annotationtoolbartab');
  808 +
  809 + $rootScope.switchCanvas();
  810 + $rootScope.setListManagerZindex = true;
  811 + $rootScope.shapeType = "Pin";
  812 +
  813 +
756 814 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
757 815 }
758 816  
... ... @@ -773,17 +831,25 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
773 831 $rootScope.setListManagerZindex = true;
774 832 $("#canvasPaint").css("display", "block");
775 833 $("#canvas").css("display", "block");
776   - $rootScope.switchCanvas();
777   - $rootScope.shapeType = "Rectangle";
  834 +
778 835 $('.btnCursor').removeClass('activebtncolor');
779 836 $(".btn-annotation").removeClass("activebtncolor");
780 837 $(".btn-annotation-rectangle").addClass("activebtncolor");
781 838 $("#OnIdentify").removeClass('annotationtoolbartab');
782 839 $("#DrawMode").addClass('annotationtoolbartab');
  840 +
  841 + $rootScope.switchCanvas();
  842 + $rootScope.shapeType = "Rectangle";
  843 +
783 844 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
784 845 }
785 846  
786 847 $rootScope.paintBrush = function () {
  848 + $('.btnCursor').removeClass('activebtncolor');
  849 + $(".btn-annotation").removeClass("activebtncolor");
  850 + $(".btn-annotation-brush").addClass("activebtncolor");
  851 + $("#OnIdentify").removeClass('annotationtoolbartab');
  852 + $("#DrawMode").addClass('annotationtoolbartab');
787 853 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
788 854 if ($rootScope.disableAnnotationtoolOnListManager == true) {
789 855 $rootScope.switchCanvas();
... ... @@ -802,7 +868,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
802 868  
803 869 } else {
804 870  
805   - // $('.btnCursor').addClass('activebtncolor');
806 871 $rootScope.setListManagerZindex = true;
807 872 $("#canvasPaint").css("display", "block");
808 873 $("#canvas").css("display", "block");
... ... @@ -828,8 +893,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
828 893  
829 894 $("#annotationpaintbrushsize").attr("data-color", $rootScope.shapestyleColorWithOpacity);
830 895  
831   -
832   -
833 896 if ($rootScope.shapeSize == '') {
834 897 $('#canvasPaint').sketch({ defaultSize: 1 });
835 898 }
... ... @@ -837,17 +900,58 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
837 900 $('#canvasPaint').sketch();
838 901  
839 902 }
840   -
841 903 }
842   -
843   - $('.btnCursor').removeClass('activebtncolor');
844   - $(".btn-annotation").removeClass("activebtncolor");
845   - $(".btn-annotation-brush").addClass("activebtncolor");
846   - $("#OnIdentify").removeClass('annotationtoolbartab');
847   - $("#DrawMode").addClass('annotationtoolbartab');
848 904 }
849 905  
850 906 $rootScope.switchCanvasToPaintCanvas = function (e) {
  907 + if ($rootScope.isModestyCanvasVisible == true) {
  908 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  909 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  910 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  911 + var ctx = document.getElementById(modestyTransCanvases[j].id);
  912 + if (ctx.style.visibility == "visible") {
  913 + var drawCanvasZindex = $("#canvas").css("z-index");
  914 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  915 + var TransCanvasZindex = ctx.style.zIndex;
  916 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  917 + MaxZindexVal = MaxZindexVal + 1;
  918 + if (($("#canvasPaint").css("display") == "block") && ($("#canvas").css("display") == "block")) {
  919 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  920 + $("#canvas").css("z-index", MaxZindexVal);
  921 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  922 + }
  923 + else {
  924 +
  925 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  926 + $("#canvasPaint").css("z-index", MaxZindexVal);
  927 + }
  928 + else {
  929 + $("#canvas").css("z-index", MaxZindexVal);
  930 + }
  931 + }
  932 + }
  933 + }
  934 + else {
  935 +
  936 + var drawCanvasZindex = $("#canvas").css("z-index");
  937 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  938 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
  939 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  940 +
  941 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  942 + $("#canvasPaint").css("z-index", MaxZindexVal);
  943 + }
  944 +
  945 + else {
  946 + $("#canvas").css("z-index", MaxZindexVal);
  947 + }
  948 +
  949 + }
  950 + }
  951 + }
  952 +
  953 + }
  954 + else {
851 955 var canvasPaint_zIndex = $('#canvasPaint').css("z-index");
852 956 var canvas_zIndex = $('#canvas').css("z-index");
853 957 if (canvas_zIndex > canvasPaint_zIndex) {
... ... @@ -859,18 +963,22 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
859 963 }
860 964 $('#canvasPaint').css("z-index", canvasPaint_zIndex);
861 965 }
  966 + }
862 967  
863 968 $rootScope.DrawCircle = function (e) {
864 969 $rootScope.setListManagerZindex = true;
865 970 $("#canvasPaint").css("display", "block");
866 971 $("#canvas").css("display", "block");
867   - $rootScope.switchCanvas();
868   - $rootScope.shapeType = "Circle";
  972 +
869 973 $('.btnCursor').removeClass('activebtncolor');
870 974 $(".btn-annotation").removeClass("activebtncolor");
871 975 $(".btn-annotation-circle").addClass("activebtncolor");
872 976 $("#OnIdentify").removeClass('annotationtoolbartab');
873 977 $("#DrawMode").addClass('annotationtoolbartab');
  978 +
  979 + $rootScope.switchCanvas();
  980 + $rootScope.shapeType = "Circle";
  981 +
874 982 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
875 983 }
876 984  
... ... @@ -878,13 +986,16 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
878 986 $rootScope.setListManagerZindex = true;
879 987 $("#canvasPaint").css("display", "block");
880 988 $("#canvas").css("display", "block");
881   - $rootScope.switchCanvas();
882   - $rootScope.shapeType = "Arrow";
  989 +
883 990 $('.btnCursor').removeClass('activebtncolor');
884 991 $(".btn-annotation").removeClass("activebtncolor");
885 992 $(".btn-annotation-arrow").addClass("activebtncolor");
886 993 $("#OnIdentify").removeClass('annotationtoolbartab');
887 994 $("#DrawMode").addClass('annotationtoolbartab');
  995 +
  996 + $rootScope.switchCanvas();
  997 + $rootScope.shapeType = "Arrow";
  998 +
888 999 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
889 1000 }
890 1001 $rootScope.DrawText = function () {
... ... @@ -892,14 +1003,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
892 1003 $rootScope.setListManagerZindex = true;
893 1004 $("#canvasPaint").css("display", "block");
894 1005 $("#canvas").css("display", "block");
895   - $rootScope.switchCanvas();
896 1006  
897   - $rootScope.shapeType = "TextArea";
898 1007 $('.btnCursor').removeClass('activebtncolor');
899 1008 $(".btn-annotation").removeClass("activebtncolor");
900 1009 $(".btn-annotation-Text").addClass("activebtncolor");
901 1010 $("#OnIdentify").removeClass('annotationtoolbartab');
902 1011 $("#DrawMode").addClass('annotationtoolbartab');
  1012 +
  1013 + $rootScope.switchCanvas();
  1014 +
  1015 + $rootScope.shapeType = "TextArea";
  1016 +
903 1017 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
904 1018 }
905 1019  
... ... @@ -915,15 +1029,75 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
915 1029  
916 1030  
917 1031 $rootScope.switchCanvas = function () {
918   - var x = $('#canvasPaint').css("z-index");
  1032 +
  1033 + if ($rootScope.isModestyCanvasVisible == true) {
  1034 + var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']");
  1035 + if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) {
  1036 + for (var j = 0; j < modestyTransCanvases.length; j++) {
  1037 + var ctx = document.getElementById(modestyTransCanvases[j].id);
919 1038  
920   - var y = $('#canvas').css("z-index");
921   - if (x > y) {
922   - y = parseInt(x) + 1;
923   - } else {
924   - y = parseInt(y) + 1;
  1039 + if (ctx.style.visibility == "visible") {
  1040 +
  1041 + var drawCanvasZindex = $("#canvas").css("z-index");
  1042 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1043 + var TransCanvasZindex = ctx.style.zIndex;
  1044 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
  1045 + MaxZindexVal = MaxZindexVal + 1;
  1046 +
  1047 +
  1048 + if ($("#OnIdentify").hasClass("annotationtoolbartab")) {
  1049 +
  1050 + $("#canvas").css("z-index", MaxZindexVal);
  1051 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  1052 +
  1053 + }
  1054 + else {
  1055 +
  1056 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1057 +
  1058 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1059 + }
  1060 + else {
  1061 + $("#canvas").css("z-index", MaxZindexVal);
  1062 + }
  1063 +
  1064 + }
  1065 + }
  1066 + else {
  1067 +
  1068 + var drawCanvasZindex = $("#canvas").css("z-index");
  1069 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1070 +
  1071 + var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex);
  1072 + MaxZindexVal = parseInt(MaxZindexVal + 1);
  1073 +
  1074 + if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
  1075 +
  1076 + $("#canvasPaint").css("z-index", MaxZindexVal);
  1077 + }
  1078 +
  1079 + else {
  1080 + $("#canvas").css("z-index", MaxZindexVal);
  1081 + }
  1082 + }
  1083 + }
  1084 + }
  1085 + }
  1086 + else
  1087 + {
  1088 +
  1089 + var drawCanvasZindex = $("#canvas").css("z-index");
  1090 + var paintCanvasZindex = $("#canvasPaint").css("z-index");
  1091 +
  1092 +
  1093 + if (drawCanvasZindex > paintCanvasZindex) {
  1094 + paintCanvasZindex = parseInt(drawCanvasZindex) + 1;
  1095 + } else {
  1096 + paintCanvasZindex = parseInt(paintCanvasZindex) + 1;
  1097 + }
  1098 + $('#canvas').css("z-index", paintCanvasZindex);
925 1099 }
926   - $('#canvas').css("z-index", y);
  1100 +
927 1101 }
928 1102 $rootScope.EraseDrawing = function () {
929 1103 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
... ... @@ -1085,9 +1259,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1085 1259 $("#edit-slider-4").css({ "pointer-events": "none" });
1086 1260 $("#editstylebackgroundcolor").css({ "pointer-events": "none" });
1087 1261 }
1088   - //$("#borderWidthCanvasElement").change(function () {
1089   - // $(".marginTopBtm10 div.outlinediv").css("border-color", x);
1090   - //});
  1262 +
1091 1263 } else {
1092 1264  
1093 1265 document.getElementById('fill-option').checked = isfilloptionChecked;
... ... @@ -1970,35 +2142,35 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
1970 2142 case "Line":
1971 2143 $(".line").remove();
1972 2144 $rootScope.isLinePreviewCompleted = true;
1973   - $("#canvasDiv").append("<div class='line' style='z-index:610;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
  2145 + $("#canvasDiv").append("<div class='line' style='z-index:12001;border:1px dashed #000000;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
1974 2146 $rootScope.Annotationangle();
1975 2147 break;
1976 2148 case "Arrow":
1977 2149 $(".arrow").remove();
1978 2150 $rootScope.isArrowPreviewCompleted = true;
1979   - $("#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>");
  2151 + $("#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>");
1980 2152 $rootScope.Annotationangle();
1981 2153 break;
1982 2154 case "Pin":
1983 2155 $(".pin").remove();
1984 2156 $rootScope.isPinPreviewCompleted = true;
1985   - $("#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>");
  2157 + $("#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>");
1986 2158 $rootScope.Annotationangle();
1987 2159 break;
1988 2160 case "Circle":
1989 2161 $(".circle").remove();
1990 2162 $rootScope.isCirclePreviewCompleted = true;
1991   - $("#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>");
  2163 + $("#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>");
1992 2164 break;
1993 2165 case "Rectangle":
1994 2166 $(".rectangle").remove();
1995 2167 $rootScope.isRectanglePreviewCompleted = true;
1996   - $("#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>");
  2168 + $("#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>");
1997 2169 break;
1998 2170 case "TextArea":
1999 2171 $(".textarea").remove();
2000 2172 $rootScope.isTextAreaPreviewCompleted = true;
2001   - $("#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>");
  2173 + $("#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>");
2002 2174 break;
2003 2175  
2004 2176 }
... ...