Commit 38fa0efbc97e7b48a5cc643c4ac2b829db07f755

Authored by unknown
1 parent 582dbc1f

Commit Changes

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -613,9 +613,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -613,9 +613,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
613 strokeStyle: shapestyleborderColor, 613 strokeStyle: shapestyleborderColor,
614 opacity: shapestyleOpacity, 614 opacity: shapestyleOpacity,
615 strokeWidth: shapestyleborderWidth, 615 strokeWidth: shapestyleborderWidth,
616 - x: offsetX1 + 40, y: offsetY1 + 40,  
617 - width: (x - offsetX1),  
618 - height:(y - offsetY1), 616 + x: offsetX1, y: offsetY1,
  617 + width: (x - offsetX1) * 2,
  618 + height: (y - offsetY1) * 2,
619 619
620 resizeFromCenter: false, 620 resizeFromCenter: false,
621 621
@@ -680,7 +680,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -680,7 +680,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
680 } 680 }
681 681
682 $rootScope.CircleFn = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) { 682 $rootScope.CircleFn = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) {
683 - // console.log("up"+ offsetX1 + " " + offsetY1 + " " + (x - offsetX1) + " " + (y - offsetY1)); 683 + // console.log("up"+ offsetX1 + " " + offsetY1 + " " + (x - offsetX1) + " " + (y - offsetY1));
684 $(canvasId).addLayer({ 684 $(canvasId).addLayer({
685 layer: true, 685 layer: true,
686 name: 'Circle_' + CircleNumber, 686 name: 'Circle_' + CircleNumber,
@@ -690,8 +690,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -690,8 +690,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
690 strokeStyle: shapestyleborderColor, 690 strokeStyle: shapestyleborderColor,
691 strokeWidth: shapestyleborderWidth, 691 strokeWidth: shapestyleborderWidth,
692 fillStyle: shapestyleFillColor, 692 fillStyle: shapestyleFillColor,
693 - x: (offsetX1 + 40), y: (offsetY1 + 40),  
694 - width: (x - offsetX1), height: (y - offsetY1), 693 + x: (offsetX1), y: (offsetY1),
  694 + width: (x - offsetX1) * 2, height: (y - offsetY1) * 2,
695 // Place a handle at each side and each corner 695 // Place a handle at each side and each corner
696 handlePlacement: 'both', 696 handlePlacement: 'both',
697 click: function (layer) { 697 click: function (layer) {
@@ -814,11 +814,10 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -814,11 +814,10 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
814 } 814 }
815 815
816 $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { 816 $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) {
817 - 817 +
818 var xAxisPinDiff = offsetX1 - x; 818 var xAxisPinDiff = offsetX1 - x;
819 var yAxisPinDiff = offsetY1 - y; 819 var yAxisPinDiff = offsetY1 - y;
820 - if (xAxisPinDiff != 0 && yAxisPinDiff != 0)  
821 - { 820 + if (xAxisPinDiff != 0 && yAxisPinDiff != 0) {
822 821
823 var radial = $('#canvas').createGradient({ 822 var radial = $('#canvas').createGradient({
824 x1: 50, y1: 50, 823 x1: 50, y1: 50,
@@ -923,8 +922,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -923,8 +922,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
923 922
924 }).drawLayers(); 923 }).drawLayers();
925 } 924 }
926 -  
927 - 925 +
  926 +
928 $('.btnCursor').trigger('click'); 927 $('.btnCursor').trigger('click');
929 $(".btn-annotation").removeClass("activebtncolor"); 928 $(".btn-annotation").removeClass("activebtncolor");
930 $('.btnCursor').addClass('activebtncolor'); 929 $('.btnCursor').addClass('activebtncolor');
@@ -933,7 +932,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -933,7 +932,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
933 $rootScope.TextAreaFn = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { 932 $rootScope.TextAreaFn = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) {
934 933
935 934
936 - // debugger; 935 + // debugger;
937 936
938 $('#canvas').drawText({ 937 $('#canvas').drawText({
939 layer: true, 938 layer: true,
@@ -965,9 +964,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -965,9 +964,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
965 strokeStyle: $rootScope.shapestyleborderColor, 964 strokeStyle: $rootScope.shapestyleborderColor,
966 strokeWidth: $rootScope.shapestyleborderWidth, 965 strokeWidth: $rootScope.shapestyleborderWidth,
967 fillStyle: $rootScope.shapestyleFillColor, 966 fillStyle: $rootScope.shapestyleFillColor,
968 - x: $rootScope.offsetX1 + 40, y: $rootScope.offsetY1 + 40,  
969 - width: ($rootScope.x - $rootScope.offsetX1),  
970 - height:($rootScope.y - $rootScope.offsetY1), 967 + x: $rootScope.offsetX1, y: $rootScope.offsetY1,
  968 + width: ($rootScope.x - $rootScope.offsetX1) * 2,
  969 + height: ($rootScope.y - $rootScope.offsetY1) * 2,
971 add: function (layer) { 970 add: function (layer) {
972 971
973 $rootScope.TextAreaRectID = layer.name; 972 $rootScope.TextAreaRectID = layer.name;
@@ -1143,9 +1142,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -1143,9 +1142,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
1143 var arrayRect = {}; 1142 var arrayRect = {};
1144 1143
1145 var storeLine = ''; 1144 var storeLine = '';
1146 - 1145 +
1147 $rootScope.OnPaintCanvasMouseUp = function (event) { 1146 $rootScope.OnPaintCanvasMouseUp = function (event) {
1148 - 1147 +
1149 if (!$rootScope.clicked) { 1148 if (!$rootScope.clicked) {
1150 return; 1149 return;
1151 } 1150 }
@@ -1221,7 +1220,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -1221,7 +1220,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
1221 switch ($rootScope.shapeType) { 1220 switch ($rootScope.shapeType) {
1222 case "Line": 1221 case "Line":
1223 $(".line").remove(); 1222 $(".line").remove();
1224 - // console.log($rootScope.MouseMoveXAxis - $rootScope.offsetX1); 1223 + // console.log($rootScope.MouseMoveXAxis - $rootScope.offsetX1);
1225 $("#canvasDiv").append("<div class='line' style='border:1px dashed #AEAEAE;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>"); 1224 $("#canvasDiv").append("<div class='line' style='border:1px dashed #AEAEAE;position:absolute;left:" + $rootScope.offsetX1 + "px;top:" + $rootScope.offsetY1 + "px;'></div>");
1226 $rootScope.Annotationangle(); 1225 $rootScope.Annotationangle();
1227 break; 1226 break;
@@ -1237,17 +1236,17 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1237,17 +1236,17 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1237 break; 1236 break;
1238 case "Circle": 1237 case "Circle":
1239 $(".circle").remove(); 1238 $(".circle").remove();
1240 - // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)); 1239 + // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1));
1241 $("#canvasDiv").append("<div class='circle' style='border-radius:50%;border:1px dashed #AEAEAE;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>"); 1240 $("#canvasDiv").append("<div class='circle' style='border-radius:50%;border:1px dashed #AEAEAE;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>");
1242 break; 1241 break;
1243 case "Rectangle": 1242 case "Rectangle":
1244 $(".rectangle").remove(); 1243 $(".rectangle").remove();
1245 - // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)); 1244 + // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1));
1246 $("#canvasDiv").append("<div class='rectangle' style='border:1px dashed #AEAEAE;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>"); 1245 $("#canvasDiv").append("<div class='rectangle' style='border:1px dashed #AEAEAE;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>");
1247 break; 1246 break;
1248 case "TextArea": 1247 case "TextArea":
1249 $(".textarea").remove(); 1248 $(".textarea").remove();
1250 - // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1)); 1249 + // console.log($rootScope.offsetX1 + " " + $rootScope.offsetY1 + " " + Math.abs($rootScope.MouseMoveXAxis - $rootScope.offsetX1) + " " + Math.abs($rootScope.MouseMoveYAxis - $rootScope.offsetY1));
1251 $("#canvasDiv").append("<div class='textarea' style='border:1px dashed #AEAEAE;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>"); 1250 $("#canvasDiv").append("<div class='textarea' style='border:1px dashed #AEAEAE;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>");
1252 break; 1251 break;
1253 } 1252 }
@@ -1271,22 +1270,22 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1271,22 +1270,22 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1271 theta = Math.atan(dy / dx) * (180 / Math.PI); 1270 theta = Math.atan(dy / dx) * (180 / Math.PI);
1272 } 1271 }
1273 var dottedLineWidth = Math.sqrt(($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) * ($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) + ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis) * ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis)); 1272 var dottedLineWidth = Math.sqrt(($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) * ($rootScope.offsetX1 - $rootScope.MouseMoveXAxis) + ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis) * ($rootScope.offsetY1 - $rootScope.MouseMoveYAxis));
1274 - switch ($rootScope.shapeType) { 1273 + switch ($rootScope.shapeType) {
1275 case "Line": 1274 case "Line":
1276 $('.line').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' }); 1275 $('.line').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
1277 break; 1276 break;
1278 - case "Arrow":  
1279 - $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });  
1280 - break;  
1281 - case "Pin":  
1282 - $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });  
1283 - break; 1277 + case "Arrow":
  1278 + $('.arrow').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  1279 + break;
  1280 + case "Pin":
  1281 + $('.pin').css({ 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%', 'width': dottedLineWidth + 'px' });
  1282 + break;
1284 } 1283 }
1285 } 1284 }
1286 1285
1287 ///----- 1286 ///-----
1288 $rootScope.saveText = function () { 1287 $rootScope.saveText = function () {
1289 - 1288 +
1290 document.getElementById('modelbackground').style.display = "none"; 1289 document.getElementById('modelbackground').style.display = "none";
1291 // this part will work first time when save button will be clicked 1290 // this part will work first time when save button will be clicked
1292 if ($rootScope.IsTextAlreadySave == false) { 1291 if ($rootScope.IsTextAlreadySave == false) {
@@ -1920,18 +1919,18 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -1920,18 +1919,18 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1920 1919
1921 $('#listManager').css('display', 'block'); 1920 $('#listManager').css('display', 'block');
1922 $("#listManager").css("visibility", "visible"); 1921 $("#listManager").css("visibility", "visible");
1923 -  
1924 - // $('#termList option[selected="selected"]').prop("selected", false);  
1925 - // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").prop("selected", true);  
1926 - // $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });  
1927 - // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); 1922 +
  1923 + // $('#termList option[selected="selected"]').prop("selected", false);
  1924 + // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").prop("selected", true);
  1925 + // $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
  1926 + // $("#termList").find("option[value=" + $rootScope.searchSelectedText + "]").css({ "background-color": "#3399FF", "color": "#ffffff" });
1928 $('#listManager').draggable(); 1927 $('#listManager').draggable();
1929 1928
1930 1929
1931 $rootScope.islistManagerEventAlredayDispachted = true; 1930 $rootScope.islistManagerEventAlredayDispachted = true;
1932 1931
1933 $rootScope.$broadcast('listManagerEvent', true); 1932 $rootScope.$broadcast('listManagerEvent', true);
1934 - 1933 +
1935 $('#termList option[selected="selected"]').prop("selected", false); 1934 $('#termList option[selected="selected"]').prop("selected", false);
1936 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); 1935 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
1937 $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); 1936 $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });