Commit 78a9f92628d415c3cded697024228fd4320f5db1

Authored by Mukul Rajput
1 parent 337e0b66

this is overwirte sketch.js

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -5679,6 +5679,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5679 5679 $("#DrawMode").addClass('annotationtoolbartab');
5680 5680 //$('.btnCursor').trigger('click');
5681 5681 $("#annotationpaintbrushsize").removeClass("activebtncolor");
  5682 + $("#annotationpainteraser").removeClass("activebtncolor");
5682 5683 $('.btnCursor').addClass('activebtncolor');
5683 5684  
5684 5685 }
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -511,6 +511,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
511 511 //annotation tool custom events
512 512 $rootScope.ShowAnnotationWindow = function () {
513 513 //7904
  514 +
514 515 $rootScope.isAnnotatiomToolBarPopupActive = true;
515 516 $rootScope.isAnnotatiomToolBarPopupClosed = false;
516 517 $rootScope.isAnnotaionToolBarDrawingModeActive = false;
... ... @@ -519,13 +520,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
519 520 $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
520 521 $('#slider-range-min-2').slider('disable');
521 522 $("#annotationpaintbrushsize").attr('disabled', 'disabled');
522   -
  523 + $("#annotationpainteraser").attr('disabled', 'disabled');
523 524  
524 525 // $rootScope.disableAnnotationTB = false;
525 526 } else {
526 527 $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
527 528 $('#slider-range-min-2').slider('enable');
528 529 $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
  530 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
529 531 }
530 532 // document.getElementById('modelbackground').style.display = "block";
531 533 // document.getElementById('modeleditstyle').style.display = "block";
... ... @@ -534,9 +536,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
534 536 if ($rootScope.MenuModuleName == "CA")
535 537 {
536 538 $("#annotationpaintbrushsize").attr("href", "#");
  539 + $("#annotationpainteraser").attr("href", "#");
  540 + $("#annotationpainteraser").attr('disabled', 'disabled');
  541 + $("#annotationpainteraser").css('pointer-events', 'none');
537 542 }
538 543 else {
539 544 $("#annotationpaintbrushsize").attr("href", "#canvasPaint");
  545 + $("#annotationpainteraser").attr("href", "#canvasPaint");
  546 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  547 + $("#annotationpainteraser").css('pointer-events', 'auto');
540 548 }
541 549 $("#OnIdentify").addClass("annotationtoolbartab");
542 550 $("#annotationToolBarOptions").addClass("active");
... ... @@ -892,14 +900,30 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
892 900 }
893 901 $rootScope.EraseDrawing = function () {
894 902 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
895   - $rootScope.switchCanvas();
896   - $rootScope.isEraseToolSelected = true;
897   - //$rootScope.switchCanvasToPaintCanvas();
898 903 $('.btnCursor').removeClass('activebtncolor');
899 904 $(".btn-annotation").removeClass("activebtncolor");
900 905 $(".btn-annotation-erase").addClass("activebtncolor");
901 906 $("#OnIdentify").removeClass('annotationtoolbartab');
902 907 $("#DrawMode").addClass('annotationtoolbartab');
  908 + $rootScope.switchCanvasToPaintCanvas();
  909 + var btneraseBrushSizeValue = $("#btnBrushSize").val();
  910 + $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
  911 + $("#annotationpainteraser").attr("data-size", $rootScope.eraseshapeSize);
  912 + return $.sketch.tools.eraser = {
  913 + onEvent: function (e) {
  914 + return $.sketch.tools.marker.onEvent.call(this, e);
  915 + },
  916 + draw: function (action) {
  917 + var oldcomposite;
  918 + oldcomposite = this.context.globalCompositeOperation;
  919 + this.context.globalCompositeOperation = "destination-out";
  920 + action.color = "#000000";
  921 + $.sketch.tools.marker.draw.call(this, action);
  922 + return this.context.globalCompositeOperation = oldcomposite;
  923 + }
  924 + }
  925 +
  926 +
903 927  
904 928 }
905 929  
... ... @@ -2721,12 +2745,16 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2721 2745 $rootScope.disableAnnotationtoolOnListManager = false;
2722 2746 $rootScope.ShowListManager = function () {
2723 2747 $rootScope.switchCanvas();
2724   - $("#annotationpaintbrushsize").attr("href", "#");
  2748 + $("#annotationpaintbrushsize").attr("href", "#");
  2749 + $("#annotationpainteraser").attr("href", "#");
2725 2750 console.log('ShowListManager')
2726 2751 $rootScope.disableAnnotationtoolOnListManager = true;
2727 2752 $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
2728 2753 $('#slider-range-min-2').slider('disable');
2729 2754 $("#annotationpaintbrushsize").attr('disabled', 'disabled');
  2755 + $("#annotationpainteraser").attr('disabled', 'disabled');
  2756 + $("#annotationpaintbrushsize").css('pointer-events', 'none');
  2757 + $("#annotationpainteraser").css('pointer-events', 'none');
2730 2758 $rootScope.isLoading = true;
2731 2759 $('#spinner').css('visibility', 'visible');
2732 2760  
... ... @@ -2776,10 +2804,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2776 2804 $rootScope.disableAnnotationtoolOnListManager = false;
2777 2805 if ($rootScope.MenuModuleName == "DA") {
2778 2806 $("#annotationpaintbrushsize").attr("href", "#canvasPaint");
  2807 + $("#annotationpainteraser").attr("href", "#canvasPaint");
2779 2808 if ($rootScope.disableAnnotationtoolOnListManager == false) {
2780 2809 $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
2781 2810 $('#slider-range-min-2').slider('enable');
2782 2811 $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
  2812 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  2813 + $("#annotationpaintbrushsize").css('pointer-events', 'auto');
  2814 + $("#annotationpainteraser").css('pointer-events', 'auto');
2783 2815 $rootScope.switchCanvasToPaintCanvas();
2784 2816 }
2785 2817 }
... ... @@ -2998,76 +3030,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic
2998 3030  
2999 3031  
3000 3032  
3001   - $rootScope.FreeStylePaint = function (e) {
3002   -
3003   - var annotationCanvas = document.getElementById("canvas");
3004   - annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false);
3005   - annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false);
3006   - // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp);
3007   -
3008   - //if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
3009   -
3010   -
3011   - // $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(e);
3012   -
3013   - //}
3014   - //else {
3015   -
3016   -
3017   -
3018   - //}
3019   - }
3020   -
3021   -
3022   -
3023   -
3024   -
3025   -
3026   -
3027   - $rootScope.OnPaintBrushCanvasMouseDown = function (event) {
3028   - if ($rootScope.isAnnotatiomToolBarPopupClosed == false) {
3029   - $rootScope.isMousedownOnPaintCanvas = true;
3030   - $rootScope.isStartPointDeleted = false;
3031   - var annotationCanvas = document.getElementById("canvas");
3032   - $rootScope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left));
3033   - $rootScope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top));
3034   -
3035   - annotationCanvas.addEventListener('mousemove', $rootScope.OnPaintBrushCanvasMouseMove, false);
3036   - }
3037   - }
3038   - $rootScope.OnPaintBrushCanvasMouseMove = function (event) {
3039   -
3040   - $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left));
3041   - $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top));
3042   -
3043   - var btneraseBrushSizeValue = $("#btnBrushSize").val();
3044   - $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
3045 3033  
3046   - if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) {
3047 3034  
3048   - var sktch = $('#canvasPaint').sketch();
3049   - $('#canvasPaint').sketch().actions = [];
3050   - var paintCanvas = document.getElementById("canvasPaint");
3051   - var paintCanvasContext = paintCanvas.getContext('2d');
3052   - if ($rootScope.isStartPointDeleted == false) {
3053 3035  
3054   - paintCanvasContext.clearRect($rootScope.startPageX, $rootScope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
3055 3036  
3056   - $rootScope.isStartPointDeleted = true;
3057   - }
3058 3037  
3059   - paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
3060 3038  
3061 3039  
3062   - }
3063   - }
3064   - $rootScope.OnPaintBrushCanvasMouseUp = function (event) {
3065   - if ($rootScope.isAnnotatiomToolBarPopupClosed == false) {
3066   - $rootScope.isMousedownOnPaintCanvas = false;
3067   - $rootScope.isEraseToolSelected = false;
3068   - $(".btn-annotation-erase").removeClass("activebtncolor");
3069   - }
3070   - }
3071 3040  
3072 3041  
3073 3042 $rootScope.reloadChildController = function () {
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -656,8 +656,10 @@
656 656 <div class="well well-popup">
657 657 <div class="" role="group" aria-label="...">
658 658 <div>
659   - <a href="#canvasPaint" data-size="1" data-color="#fff" id="annotationpaintbrushsize" ng-mouseover="mouseMoveToolTip(270, 50, 120, 'Paint')" ng-mouseleave="mouseOutToolTip()" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-brush" role="button" data-placement="top" style="margin-right:1%;" ng-click="paintBrush()"><i class="fa fa-paint-brush"></i></a>
660   - <button type="button" id="annotationpainteraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" ng-click="EraseDrawing()" ng-mouseover="mouseMoveToolTip(270, 70, 120, 'Erase')" ng-mouseleave="mouseOutToolTip()"><i class="fa fa-eraser"></i></button>&nbsp;
  659 + <a href="#canvasPaint" data-tool="marker" data-size="1" data-color="#fff" id="annotationpaintbrushsize" ng-mouseover="mouseMoveToolTip(270, 50, 120, 'Paint')" ng-mouseleave="mouseOutToolTip()" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-brush" role="button" data-placement="top" style="margin-right:1%;" ng-click="paintBrush()"><i class="fa fa-paint-brush"></i></a>
  660 + <a href="#canvasPaint" data-tool="eraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" data-size=" 1" id="annotationpainteraser" ng-click="EraseDrawing()" ng-mouseover="mouseMoveToolTip(270, 70, 120, 'Erase')" ng-mouseleave="mouseOutToolTip()" role="button"><i class=" fa fa-eraser"></i></a>
  661 +
  662 + <!--<button type="button" id="annotationpainteraser" class="btn btn-black-annotation btn-xs pull-left btn-annotation btn-annotation-erase" data-placement="top" ng-click="EraseDrawing()" ng-mouseover="mouseMoveToolTip(270, 70, 120, 'Erase')" ng-mouseleave="mouseOutToolTip()"><i class="fa fa-eraser"></i></button>-->&nbsp;
661 663 <div style="width: 80px; margin: 0px 0px 0px 4px; display: inline-block;float:left;">
662 664 <div style="width: 58px; float: left;" ng-mouseover="mouseMoveToolTip(270, 100, 120, 'Brush Size')" ng-mouseleave="mouseOutToolTip()">
663 665 <input type="text" id="btnBrushSize" class="form-control" value="1" style="height:32px;border-radius:0;" oninput="Brushsize(this)">
... ... @@ -1309,6 +1311,7 @@
1309 1311 $('#canvas').sketch();
1310 1312 });
1311 1313 </script>-->
  1314 +
1312 1315 <script>
1313 1316 $(function () {
1314 1317 $("#slider-range-min-2").slider({
... ... @@ -1317,7 +1320,7 @@
1317 1320 max: 60,
1318 1321 value: 1,
1319 1322 slide: function (event, ui) {
1320   -
  1323 +
1321 1324 $("#btnBrushSize").val(ui.value);
1322 1325  
1323 1326 },
... ... @@ -1331,14 +1334,17 @@
1331 1334  
1332 1335  
1333 1336 $("#btnBrushSize").keydown(function () {
  1337 +
1334 1338 var brushSizevalue = this.value;
1335 1339 $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
1336 1340 });
1337 1341 $("#btnBrushSize").keyup(function () {
  1342 +
1338 1343 var brushSizevalue = this.value;
1339 1344 $("#slider-range-min-2").slider("value", parseInt(brushSizevalue));
1340 1345 });
1341 1346 $("#btnBrushSizeIncrement").click(function () {
  1347 +
1342 1348 var brushIncrementVar = $("#btnBrushSize").val();
1343 1349 if (brushIncrementVar >= 60) {
1344 1350 $("#slider-range-min-2").slider("value", 60);
... ... @@ -1355,6 +1361,7 @@
1355 1361 }
1356 1362 });
1357 1363 $("#btnBrushSizeDecrease").click(function () {
  1364 +
1358 1365 var brushDecreaseVar = $("#btnBrushSize").val();
1359 1366 if (brushDecreaseVar == "") {
1360 1367 var brushDecrementedValue = 1;
... ... @@ -1370,6 +1377,7 @@
1370 1377 $("#slider-range-min-2").slider("value", parseInt(brushDecrementedValue));
1371 1378 }
1372 1379 });
  1380 +
1373 1381 $("#btnBrushSize").val($("#slider-range-min-2").slider("value"));
1374 1382  
1375 1383  
... ...