From 5c37396d8d4b3b5eb201ab1a4bda6dc71abb41b3 Mon Sep 17 00:00:00 2001 From: amrita.vishnoi Date: Fri, 6 Jan 2017 15:52:11 +0530 Subject: [PATCH] Renamed the function names --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 164 +++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/index.html | 8 ++++---- 2 files changed, 37 insertions(+), 135 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index af0dc3d..c37c973 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -65,6 +65,13 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.isEraseToolSelected = false; $rootScope.isMousedownOnPaintCanvas = false; + //opacity code + $rootScope.shapestyleOpacity = 1; + $rootScope.shapestyleFillColor = "#fff"; + $rootScope.shapestyleFillBorderColor = "black"; + $rootScope.shapestyleborderWidth = 2; + $rootScope.shapestyleborderStyles = "solid"; + $rootScope.$on("$locationChangeSuccess", function () { if (($location.url() == "/da-body-view") || ($location.url() == "/clinical-illustrations-detail") || ($location.url() == "/clinical-animations-detail")) { @@ -140,16 +147,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } } - // $rootScope.DrawLine = function () { - //$rootScope.isIdetifyClicked = false; - //$rootScope.isDrawingToolSelected = true; - //$rootScope.isLineDrawSelecyed = true; - // $rootScope.shapeType = "Line"; - // alert($rootScope.shapeType); - - - // } - $rootScope.ClearIframe = function () { if ($('#daImagePanel') != null) $('#daImagePanel').remove(); @@ -287,14 +284,12 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('#modal-settings').modal('toggle'); } - } - - //----Annotation Toolbar: Jcanvas----- - $rootScope.DrLine = function (e) { + $rootScope.DrawLine = function (e) + { $rootScope.setListManagerZindex = true; $("#canvasPaint").css("display", "block"); $("#canvas").css("display", "block"); @@ -302,7 +297,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.switchCanvas(); $rootScope.shapeType = "Line"; - $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-line").addClass("activebtncolor"); @@ -311,7 +305,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } - $rootScope.DrPin = function (e) { + $rootScope.DrawPin = function (e) { $("#canvasPaint").css("display", "block"); $("#canvas").css("display", "block"); @@ -386,13 +380,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } - - // $('#canvasPaint').sketch(); - - } - } @@ -441,23 +430,16 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').removeClass('activebtncolor'); $(".btn-annotation").removeClass("activebtncolor"); $(".btn-annotation-Text").addClass("activebtncolor"); - // $("#text_area").val(''); - // $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); - } + } $rootScope.DrawPolygon = function () { $rootScope.setListManagerZindex = true; $("#canvasPaint").css("display", "block"); $("#canvas").css("display", "block"); $rootScope.shapeType = "DrawPolygon"; - } - $rootScope.OpacityModal = function () { - - - } $rootScope.switchCanvas = function () { var x = $('#canvasPaint').css("z-index"); @@ -471,26 +453,12 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } $rootScope.EraseDrawing = function () { $rootScope.switchCanvas(); - $rootScope.isEraseToolSelected = true; - //$rootScope.switchCanvasToPaintCanvas(); - //// $('#canvasPaint').sketch({ defaultColor: "yellow", defaultSize: 1 }); - //var sktch = $('#canvasPaint').sketch(); - //$('#canvasPaint').sketch().actions = []; // this line empties the actions. - //var myCanvas = document.getElementById("canvasPaint"); - //var ctx = myCanvas.getContext('2d'); - //ctx.clearRect(0, 0, myCanvas.width, myCanvas.height); - //$rootScope.switchCanvas(); - + $rootScope.isEraseToolSelected = true; } - //opacity code - $rootScope.shapestyleOpacity = 1; - $rootScope.shapestyleFillColor = "#fff"; - $rootScope.shapestyleFillBorderColor = "black"; - $rootScope.shapestyleborderWidth = 2; - $rootScope.shapestyleborderStyles = "solid"; - $rootScope.shapestyle = function (id) { - // debugger; + + $rootScope.setPropertiesForShapes = function (id) { + document.getElementById('modelbackground').style.display = "none"; document.getElementById('modeleditstyle').style.display = "none"; @@ -510,11 +478,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('#editshapestyle').modal('hide'); - // name: 'Circle_' + $rootScope.resetCircle, - - - // $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); - + //Edit Shape Style popup should open at it's default position $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" }); @@ -523,12 +487,10 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.enableAnnotationToolBar = function () { if ($rootScope.disableAnnotationTB == true) { document.getElementById('modelbackground').style.display = "none"; - //$("#editshapestyle").modal('show'); document.getElementById('modeleditstyle').style.display = "none"; } else { document.getElementById('modelbackground').style.display = "block"; - //$("#editshapestyle").modal('show'); document.getElementById('modeleditstyle').style.display = "block"; if ($('#modeleditstyle').css("display") == "block") { //Check if the modal is already showing var previewOpacity = $('#imgOpacity').css("opacity"); @@ -552,8 +514,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $(".custom-tooltip-annotation").css('display', 'none'); $("#edit-block").removeClass("custom-tooltip-annotation"); - - } @@ -564,16 +524,11 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //Edit Shape Style popup should open at it's default position $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" }); - } - - - - //----End------------- //--Common code of Annotation Toolbar for CI and DA------- - $rootScope.LineFn = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + $rootScope.DrawLineOnModuleItem = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { $(canvasId).addLayer({ name: 'Line_' + LineNumber, layer: true, @@ -636,8 +591,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').addClass('activebtncolor'); } - $rootScope.RectangleFn = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) { - // alert("offsetX:" + offsetX1 + " offsetY:" + offsetY1 + " x:" + x + " y:" + y); + $rootScope.DrawRectangleOnOpenModuleItem = function (canvasId, RectNumber, shapestyleFillColor, shapestyleborderColor, shapestyleOpacity, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + $(canvasId).addLayer({ layer: true, name: 'Rect_' + RectNumber, @@ -653,8 +608,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", resizeFromCenter: true, - dblclick: function () { - // $rootScope.backOpacity(); + dblclick: function () { }, @@ -704,16 +658,13 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } }).drawLayers(); - - - $('.btnCursor').trigger('click'); $(".btn-annotation").removeClass("activebtncolor"); $('.btnCursor').addClass('activebtncolor'); } - $rootScope.CircleFn = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) { + $rootScope.DrawCircleOnModuleItem = function (canvasId, CircleNumber, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, offsetX1, offsetY1, x, y) { $(canvasId).addLayer({ layer: true, @@ -728,9 +679,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", width: (x - offsetX1) * 2, height: (y - offsetY1) * 2, // Place a handle at each side and each corner handlePlacement: 'both', - - - click: function (layer) { $rootScope.canvasLayerNameCollection = []; @@ -783,7 +731,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').addClass('activebtncolor'); } - $rootScope.ArrowFn = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { + $rootScope.DrawArrowOnModuleItem = function (canvasId, ArrowNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { $('#canvas').drawLine({ layer: true, @@ -851,7 +799,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').addClass('activebtncolor'); } - $rootScope.PinFn = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { + $rootScope.DrawPinOnModuleItem = function (canvasId, PinNumber, offsetX1, offsetY1, x, y, PinArcNumber) { var xAxisPinDiff = offsetX1 - x; var yAxisPinDiff = offsetY1 - y; @@ -942,13 +890,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", fillStyle: radial, x: offsetX1, y: offsetY1, radius: 5, - //handle: { - // type: 'arc', - // fillStyle: '#fff', - // strokeStyle: '#c33', - // strokeWidth: 2, - // radius: 3 - //}, + add: function (layer) { @@ -966,7 +908,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $('.btnCursor').addClass('activebtncolor'); } - $rootScope.TextAreaFn = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { + $rootScope.TextAreaOnModuleItem = function (canvasId, TextNumber, offsetX1, offsetY1, resetTextRect, shapestyleOpacity, shapestyleborderColor, shapestyleborderWidth, shapestyleFillColor, x, y) { debugger; @@ -1213,13 +1155,13 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //$rootScope.canvasLayerNameCollection = []; $rootScope.LineNumber = $rootScope.ObjectIndex++; - $rootScope.LineFn('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) + $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y) break; case "Rectangle": $rootScope.rectNumber = $rootScope.ObjectIndex++; - $rootScope.RectangleFn('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + $rootScope.DrawRectangleOnOpenModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); break; @@ -1227,19 +1169,19 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", // alert($rootScope.shapestyleborderWidth); $rootScope.CircleNumber = $rootScope.ObjectIndex++; - $rootScope.CircleFn('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); break; case "Arrow": $rootScope.ArrowNumber = $rootScope.ObjectIndex++; - $rootScope.ArrowFn('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); + $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y); // $scope.resetRect += 1; break; case "Pin": $rootScope.PinNumber = $rootScope.PinObjectIndex++; $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++; - $rootScope.PinFn('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); + $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber); break; case "TextArea": @@ -1249,7 +1191,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", // Draw text $rootScope.resetTextRect = $rootScope.ObjectIndex++; $rootScope.TextNumber = $rootScope.ObjectIndex++; - $rootScope.TextAreaFn('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); + $rootScope.TextAreaOnModuleItem('#canvas', $rootScope.TextNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.resetTextRect, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.x, $rootScope.y); break; case "DrawPolygon": @@ -1412,14 +1354,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", CurrentFontFamily = ''; CurrentFontSize = ''; - // $(".ActiveDefaultColorAnnotation").css({ "background-color": $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor + "!important" }); - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation"); - - - //adding text text decoration active class in text edit pop-up - - - if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") { @@ -1433,14 +1367,10 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } - - //adding text font weight active class in text edit pop-up if (fontWeightProp[0] == 700) { - - $("#text-bold").addClass("ActiveFormattingButtonClass"); } @@ -1485,9 +1415,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $("#text-left").removeClass("ActiveFormattingButtonClass"); $("#text-right").addClass("ActiveFormattingButtonClass"); - - - } else if ($rootScope.TextPropertyArray[i].Align == "center") { @@ -1498,12 +1425,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $("#text-center").addClass("ActiveFormattingButtonClass"); - - } - - } else { // alert("no"); @@ -1827,12 +1750,6 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", document.getElementById('modelbackground').style.display = "none"; - //if ($rootScope.isTextAreaClosedButtonActive == true) { - // $("#canvas").removeLayer('TextArea_' + $rootScope.TextNumber).drawLayers(); - // $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); - - //} - } //-- End ---------------------------- @@ -1869,17 +1786,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $rootScope.PaintCanvasMousedownListener = function (canvasContext, x, y) { if ($rootScope.isLineDrawSelecyed == true) { - canvasContext.lineWidth = 0.1; - //$scope.paintCanvasContext.lineJoin = 'round'; - //$scope.paintCanvasContext.lineCap = 'round'; + canvasContext.lineWidth = 0.1; canvasContext.strokeStyle = 'red'; - - canvasContext.beginPath(); - - //var canvasOffset = $("#myCanvas").offset(); - //var offsetX = canvasOffset.left; - //var offsetY = canvasOffset.top; canvasContext.moveTo(x, y); } @@ -2125,14 +2034,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } //2. - //localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); - - //3. - //localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); - - //4. - //$rootScope.reloadChildController(); - + var len = $rootScope.openModules.length; if (len > 0) { $rootScope.reloadChildController(); diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 5c93380..1b8b567 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -508,12 +508,12 @@
- +
- + @@ -886,7 +886,7 @@