Commit 020abb714ac8af955178638559c0ccbfc5fd3879

Authored by Mukul Rajput
1 parent 414afdff

this is ci erase tool functionality

400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... ... @@ -619,7 +619,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
619 619 $("#canvasPaint").css("display", "block");
620 620  
621 621 $rootScope.BindCanvasDrawingListners();
622   - // $rootScope.FreeStylePaint();
  622 + $rootScope.FreeStylePaint();
623 623 });
624 624  
625 625 $scope.ReloadListViewImageDiv = function (id) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -6857,114 +6857,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6857 6857  
6858 6858  
6859 6859  
6860   - $rootScope.FreeStylePaint = function (e) {
6861   -
6862   - var annotationCanvas = document.getElementById("canvas");
6863   - // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp);
6864   -
6865   - annotationCanvas.addEventListener('mousedown', $scope.OnPaintCanvasMouseDown, false);
6866   -
6867   - annotationCanvas.addEventListener('mouseup', $scope.OnPaintBrushCanvasMouseUp, false);
6868   - }
6869   - $scope.OnPaintCanvasMouseDown = function (event) {
6870   - $rootScope.isMousedownOnPaintCanvas = true;
6871   - $scope.isStartPointDeleted = false;
6872   - var annotationCanvas = document.getElementById("canvas");
6873   - $scope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left));
6874   - $scope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top));
6875   -
6876   - annotationCanvas.addEventListener('mousemove', $scope.OnPaintCanvasMouseMove, false);
6877   -
6878   -
6879   -
6880   - }
6881   - $scope.OnPaintCanvasMouseMove = function (event) {
6882   -
6883   -
6884   - $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left));
6885   - $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top));
6886   -
6887   - var btneraseBrushSizeValue = $("#btnBrushSize").val();
6888   - $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
6889   -
6890   - if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) {
6891   -
6892   - var sktch = $('#canvasPaint').sketch();
6893   - $('#canvasPaint').sketch().actions = [];
6894   - var paintCanvas = document.getElementById("canvasPaint");
6895   - var paintCanvasContext = paintCanvas.getContext('2d');
6896   - if ($scope.isStartPointDeleted == false) {
6897   -
6898   - paintCanvasContext.clearRect($scope.startPageX, $scope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
6899   -
6900   - $scope.isStartPointDeleted = true;
6901   - }
6902   -
6903   - paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
6904   -
6905   -
6906   - }
6907   - }
6908   - $scope.OnPaintBrushCanvasMouseDown = function (event) {
6909   - switch ($rootScope.shapeType) {
6910   -
6911   - case "FreeStylePaint":
6912   -
6913   -
6914   -
6915   - // $('#canvasPaint').sketch();
6916   - // $('#canvasPaint').sketch({ defaultSize: 1 });
6917   - // if ($("#amount-2").val() == '') {
6918   - // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6919   - // $('#canvasPaint').sketch();
6920   - // }
6921   - // else {
6922   -
6923   - // // var a = $("#amount-2").val();
6924   - //// $scope.shapesize = parseInt(a);
6925   - // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });
6926   - // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6927   -
6928   - // }
6929   -
6930   -
6931   - break;
6932   -
6933   - }
6934   - }
6935   - $scope.OnPaintBrushCanvasMouseUp = function (event) {
6936   - $rootScope.isMousedownOnPaintCanvas = false;
6937   - $rootScope.isEraseToolSelected = false;
6938   -
6939   - // var canvasElement1 = document.getElementById("canvasPaint");
6940   - // var ctx1 = canvasElement1.getContext("2d");
6941   -
6942   - //switch($rootScope.shapeType)
6943   - //{
6944   -
6945   - // case "FreeStylePaint":
6946   -
6947   -
6948   - // if ($("#amount-2").val() == '')
6949   - // {
6950   - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6951   - // }
6952   - // else
6953   - // {
6954   -
6955   - // var a = $("#amount-2").val();
6956   - // $scope.shapesize = parseInt(a);
6957   - // alert(JSON.stringify({ defaultSize: $scope.shapesize }));
6958   - // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6959   -
6960   - // }
6961   -
6962   -
6963   - // break;
6964   -
6965   - //}
6966   -
6967   - }
  6860 +
  6861 +
6968 6862  
6969 6863  
6970 6864  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -2102,6 +2102,65 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
2102 2102  
2103 2103 };
2104 2104  
  2105 +
  2106 +
  2107 + $rootScope.FreeStylePaint = function (e) {
  2108 +
  2109 + var annotationCanvas = document.getElementById("canvas");
  2110 + // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp);
  2111 +
  2112 + annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false);
  2113 +
  2114 + annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false);
  2115 + }
  2116 +
  2117 +
  2118 +
  2119 +
  2120 + $rootScope.OnPaintBrushCanvasMouseDown = function (event) {
  2121 + $rootScope.isMousedownOnPaintCanvas = true;
  2122 + $rootScope.isStartPointDeleted = false;
  2123 + var annotationCanvas = document.getElementById("canvas");
  2124 + $rootScope.startPageX = parseInt(event.clientX - ($("#canvas").offset().left));
  2125 + $rootScope.startPageY = parseInt(event.clientY - ($("#canvas").offset().top));
  2126 +
  2127 + annotationCanvas.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false);
  2128 +
  2129 + }
  2130 + $rootScope.OnPaintCanvasMouseMove = function (event) {
  2131 +
  2132 + $rootScope.xPage = parseInt(event.clientX - ($("#canvas").offset().left));
  2133 + $rootScope.yPage = parseInt(event.clientY - ($("#canvas").offset().top));
  2134 +
  2135 + var btneraseBrushSizeValue = $("#btnBrushSize").val();
  2136 + $rootScope.eraseshapeSize = parseInt(btneraseBrushSizeValue);
  2137 +
  2138 + if ($rootScope.isEraseToolSelected == true && $rootScope.isMousedownOnPaintCanvas == true) {
  2139 +
  2140 + var sktch = $('#canvasPaint').sketch();
  2141 + $('#canvasPaint').sketch().actions = [];
  2142 + var paintCanvas = document.getElementById("canvasPaint");
  2143 + var paintCanvasContext = paintCanvas.getContext('2d');
  2144 + if ($rootScope.isStartPointDeleted == false) {
  2145 +
  2146 + paintCanvasContext.clearRect($rootScope.startPageX, $rootScope.startPageY, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
  2147 +
  2148 + $rootScope.isStartPointDeleted = true;
  2149 + }
  2150 +
  2151 + paintCanvasContext.clearRect($rootScope.xPage, $rootScope.yPage, $rootScope.eraseshapeSize, $rootScope.eraseshapeSize);
  2152 +
  2153 +
  2154 + }
  2155 + }
  2156 + $rootScope.OnPaintBrushCanvasMouseUp = function (event) {
  2157 + $rootScope.isMousedownOnPaintCanvas = false;
  2158 + $rootScope.isEraseToolSelected = false;
  2159 +
  2160 +
  2161 + }
  2162 +
  2163 +
2105 2164 $rootScope.reloadChildController = function () {
2106 2165  
2107 2166 var len = $rootScope.openModules.length;
... ...