'
@@ -3090,7 +3240,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$("#sppeachBubble_annotation").append("
" + MultipleLang_annotation_T1 + "
");
}
- $("#sppeachBubble_annotation").append("
");
+ $("#sppeachBubble_annotation").append("
");
for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) {
var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k];
@@ -3167,7 +3317,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$("#sppeachBubble_annotation").append("
" + MultipleLang_annotation_T1 + "
");
}
- $("#sppeachBubble_annotation").append("
");
+ $("#sppeachBubble_annotation").append("
");
for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) {
var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k];
@@ -3247,7 +3397,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
{
drag: function (evt) {
- $("#dot_annotation").css("display", "none");
+ //$("#dot_annotation").css("display", "none");
+ $("#dot_annotation").remove();
+
var verticalScrollPosition = canvasDiv.scrollTop;
var horizontlScrollPosition = canvasDiv.scrollLeft;
$scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
@@ -3258,12 +3410,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$('.crossDiv_temp_annotation').on('click', function (evt) {
- $('#sppeachBubble_annotation').css('display', 'none');
+ //$('#sppeachBubble_annotation').css('display', 'none');
- $("#bord_annotation").css("display", "none");
- $("#dot_annotation").css("display", "none");
+ //$("#bord_annotation").css("display", "none");
+ //$("#dot_annotation").css("display", "none");
+ $('#sppeachBubble_annotation').remove();
+
+ $("#bord_annotation").remove();
+ $("#dot_annotation").remove();
+
});
}
@@ -3277,7 +3434,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
$scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) {
- var sppechBubbleHTML = "
";
+ var sppechBubbleHTML = "
";
//Issue #7286 :Undefined annotation should not appear
for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
var annotation = $scope.MultiLanguageAnnationArray[i];
@@ -3422,9 +3579,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.createTransparencyBox = function () {
- $scope.isTransparencyActivated = true;
+ $scope.isTransparencyActivated = true;
- //do not create TBOX if in extarct mode otherwise create
+ //do not create TBOX if in extarct mode otherwise create
if ($rootScope.isExtract == false) {
$("#btnExtract").addClass("disabled");
@@ -3434,7 +3591,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.CloseListManager();
-
+
// alert('transparencyClicked' + $scope.isTransparencyActivated)
$('#btnTranparency').addClass('tButtonActive');
$('#btnIdentity').removeClass(' btn-primary');
@@ -3543,6 +3700,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//alert('mouse up');
console.log('MOUSE UP');
+ $(".com").remove();
+ $('#dot').remove();
+ $('#bord').remove();
+ $('#sppeachBubble').remove();
$scope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
$('.rectangle').remove();
@@ -3564,7 +3725,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.TransparencyEndX = TransparencyEndX;
$scope.TransparencyBoxEndY = TransparencyBoxEndY;
-
+ $scope.layerNumberBeforeTrans = parseInt($('#txtlayerNumber').val());
//draw temp box to store the canvas data with original transparecy
if (document.getElementById('tempCanvas') != null) {
@@ -3683,7 +3844,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$('#btnTranparency').addClass('tButtonActive');
//debugger;
- // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1);
+ // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1);
//Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
$('#btnTranparency').removeClass('tButtonActive');
$('#btnTranparency').addClass('btn-black');
@@ -3846,10 +4007,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//do nothing
}
else if (isLayerChanged) {
-
- // alert('isMousUp on isLayerChanged');
- $scope.layerNumber = parseInt($('#txtlayerNumber').val());
+ // alert('isMousUp on isLayerChanged');
+
+ //$scope.layerNumber = parseInt($('#txtlayerNumber').val());
}
else {
@@ -3859,24 +4020,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//$scope.layerNumber = tranparencyLayer;
var tranparencyLayer;
- var currentLayer = parseInt($('#txtlayerNumber').val());
- if (currentLayer == $rootScope.totalLayers) {
-
- tranparencyLayer = currentLayer;
-
- }
- else
- {
-
+ //var currentLayer = parseInt($('#txtlayerNumber').val());
+ var currentLayer = $scope.layerNumberBeforeTrans;
+
+ if (currentLayer == $rootScope.totalLayers) {
+
+ tranparencyLayer = currentLayer;
+
+ }
+
+ else {
+
tranparencyLayer = currentLayer + 1;
-
- }
-
- $scope.layerNumber = tranparencyLayer;
+
+ }
+
+ $scope.layerNumber = tranparencyLayer;
}
-
+
$('#txtlayerNumber').val($scope.layerNumber);
//dedebugger;
@@ -4345,7 +4508,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.annotationTextArrayT2 = [];
$scope.annotationTextArrayT1.push(annotations.annotationT1);
$scope.annotationTextArrayT2.push(annotations.annotationT2);
-
+
$scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
}
tempMaskImg.src = "http://localhost/AIAHtml/" + tranparencyMaskImgSrc;
@@ -4383,6 +4546,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.annotationTextArrayT1.push(annotations.annotationT1);
$scope.annotationTextArrayT2.push(annotations.annotationT2);
+
$scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
}
else
@@ -4394,6 +4558,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.annotationTextArrayT1.push(annotations.annotationT1);
$scope.annotationTextArrayT2.push(annotations.annotationT2);
+
$scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, evt.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, false);
@@ -4552,15 +4717,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.CloseTransparencyBox = function () {
+
//To enable extract button
- $scope.isTransparencyActivated = false;
+ $scope.isTransparencyActivated = false;
$("#btnExtract").removeClass("disabled");
- $('.com_anno').css('display', 'none');
+ //$('.com_anno').css('display', 'none');
+
+ //$('#sppeachBubble_annotation').css('display', 'none');
+ //$('#dot_annotation').css('display', 'none');
+ //$('#bord_annotation').css('display', 'none');
+
- $('#sppeachBubble_annotation').css('display', 'none');
- $('#dot_annotation').css('display', 'none');
- $('#bord_annotation').css('display', 'none');
+ $('.com_anno').remove();
+
+ $('#sppeachBubble_annotation').remove();
+ $('#dot_annotation').remove();
+ $('#bord_annotation').remove();
var tBox = document.getElementById('transparencyCanvas');
@@ -4590,7 +4763,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//var scope = angular.element(document.getElementById("DAView")).scope();
//scope.$apply(function () {
// $scope.layerNumber = 0;
- $scope.isTransparencyActivated = false;
+ // $scope.isTransparencyActivated = false;
//})
@@ -4609,7 +4782,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
$('#transparencyScale').css('visibility', 'hidden');
- $scope.isTransparencyActivated = false;
+ //$scope.isTransparencyActivated = false;
// document.getElementById('btnTranparency').className = 't-transparency'
$('#btnTranparency').removeClass('tButtonActive');
$('#btnTranparency').addClass('btn-black');
@@ -4664,18 +4837,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
};
- $scope.OnIdentityClick = function () {
+ $scope.IdentityClick = function () {
//if listanager is visisble then close it
-
+
$rootScope.isListManagerSelected = false;
$rootScope.CloseListManager();
// $('#btnIdentity').addClass('btn-primary');
- if ($scope.isTransparencyActivated == true) {
+ if ($scope.isTransparencyActivated == true) {
- $scope.isTransparencyActivated = false;
+ $scope.isTransparencyActivated = false;
var canvasDiv = document.getElementById('canvasDiv');
canvasDiv.removeEventListener("mousedown", mouseDownListener);
@@ -4716,7 +4889,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.isZoomed = true;
//1.
-
+
$scope.flushCanvas();
if ($scope.zoomInOut == 25) {
@@ -4731,10 +4904,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.CalculateImageCordinates($rootScope.viewOrientationId);
//3.
- if ($scope.zoomInOut == 25)
- $('#canvasDiv').scrollLeft(0)
- else
- $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
+ if ($scope.zoomInOut == 25) {
+ if ($('#canvasDiv') != null)
+ $('#canvasDiv').scrollLeft(0)
+ }
+ else {
+ if ($('#canvasDiv') != null)
+ $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
+ }
//remove annotation speech bubble
if ($('#dot').length > 0) {
@@ -4755,48 +4932,107 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.flushCanvas = function () {
- if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
- angular.forEach($scope.ColoredImageSRC, function (value, key) {
+ //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
+ // angular.forEach($scope.ColoredImageSRC, function (value, key) {
- var id;
- var maskId;
- if (value.haveMirror == 'true') {
- id = 'imageCanvas' + value.bodyRegionId + '_MR';
- maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
- }
- else {
- id = 'imageCanvas' + value.bodyRegionId;
- maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
- }
+ // var id;
+ // var maskId;
+ // if (value.haveMirror == 'true') {
+ // id = 'imageCanvas' + value.bodyRegionId + '_MR';
+ // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
+ // }
+ // else {
+ // id = 'imageCanvas' + value.bodyRegionId;
+ // maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
+ // }
- var canvas = document.getElementById(id);
- if (canvas != null || canvas != undefined) {
- document.getElementById('canvasDiv').removeChild(canvas);
- }
+ // var canvas = document.getElementById(id);
+ // if (canvas != null || canvas != undefined) {
+ // document.getElementById('canvasDiv').removeChild(canvas);
+ // }
- var maskcanvas = document.getElementById(maskId);
- if (maskcanvas != null || maskcanvas != undefined) {
- document.getElementById('canvasDiv').removeChild(maskcanvas);
+ // var maskcanvas = document.getElementById(maskId);
+ // if (maskcanvas != null || maskcanvas != undefined) {
+ // document.getElementById('canvasDiv').removeChild(maskcanvas);
- }
- if (i == 4 || i == 5 || i == 6) {
- id = 'imageCanvas' + i + '_MR';
- maskId = 'imageCanvas' + i + '_MR_mci';
+ // }
+ // if (i == 4 || i == 5 || i == 6) {
+ // id = 'imageCanvas' + i + '_MR';
+ // maskId = 'imageCanvas' + i + '_MR_mci';
+
+ // var canvas = document.getElementById(id);
+ // if (canvas != null || canvas != undefined)
+ // document.getElementById('canvasDiv').removeChild(canvas);
+
+ // var maskcanvas = document.getElementById(maskId);
+ // if (maskcanvas != null || maskcanvas != undefined)
+ // document.getElementById('canvasDiv').removeChild(maskcanvas);
+ // }
+
+ // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
+ // for (var i = 0; i < modestyCanvases.length; i++) {
+ // modestyCanvases[i].remove();
+ // }
+ // });
+ // //remove modesty canavs
+ // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
+ // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
+ // for (var j = 0; j < modestyCanvases.length; j++) {
+ // modestyCanvases[j].remove();
+ // }
+ // }
+ //}
+ var endIndex = 0;
+ var startIndex = 0;
+ if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
+ endIndex = 6;
+ startIndex = 1;
+ }
+ else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) {
+ endIndex = 5;
+ startIndex = 1;
+ }
+ else if (($rootScope.viewOrientationId == '5')) {
+ endIndex = 6;
+ startIndex = 2;
+ }
+ else if (($rootScope.viewOrientationId == '6')) {
+ endIndex = 6;
+ startIndex = 6;
+ }
- var canvas = document.getElementById(id);
- if (canvas != null || canvas != undefined)
- document.getElementById('canvasDiv').removeChild(canvas);
+ for (var i = startIndex; i <= endIndex; i++) {
- var maskcanvas = document.getElementById(maskId);
- if (maskcanvas != null || maskcanvas != undefined)
- document.getElementById('canvasDiv').removeChild(maskcanvas);
- }
+ var id;
+ var maskId;
+
+ id = 'imageCanvas' + i;
+ maskId = 'imageCanvas' + i + '_mci';
- var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
- for (var i = 0; i < modestyCanvases.length; i++) {
- modestyCanvases[i].remove();
+ var canvas = document.getElementById(id);
+ if (canvas != null || canvas != undefined)
+ document.getElementById('canvasDiv').removeChild(canvas);
+
+ var maskcanvas = document.getElementById(maskId);
+ if (maskcanvas != null || maskcanvas != undefined)
+ document.getElementById('canvasDiv').removeChild(maskcanvas);
+
+ if (endIndex == 6) {
+
+ if (i == 4 || i == 5 || i == 6) {
+ id = 'imageCanvas' + i + '_MR';
+ maskId = 'imageCanvas' + i + '_MR_mci';
+
+ var canvas = document.getElementById(id);
+ if (canvas != null || canvas != undefined)
+ document.getElementById('canvasDiv').removeChild(canvas);
+
+ var maskcanvas = document.getElementById(maskId);
+ if (maskcanvas != null || maskcanvas != undefined)
+ document.getElementById('canvasDiv').removeChild(maskcanvas);
}
- });
+ }
+
//remove modesty canavs
var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
@@ -4806,9 +5042,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
}
-
- }
+ }
$scope.terminateCurrentlyRunningWPs = function () {
if ($scope.runningWorkers != null || $scope.runningWorkers != undefined) {
var workerCount = $scope.runningWorkers.length;
@@ -4826,11 +5061,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.enableHighlight = function () {
-
+
// $("#btnExtract").removeClass("disabled");
- $("#btnTranparency").removeClass("disabled");
- // $rootScope.isTransparencyBoxActivated = false;
- // $rootScope.isNormalMode = false;
+ $("#btnTranparency").removeClass("disabled");
+ // $rootScope.isTransparencyBoxActivated = false;
+ // $rootScope.isNormalMode = false;
//if listanager is visisble then close it
@@ -4840,7 +5075,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.isHighlightBodyByBodySystem = false;
if ($rootScope.isHighLight == true) {
-
+
}
else {
$rootScope.isHighLight = true;
@@ -4891,6 +5126,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$("#btnNormalMode").removeClass("btn-primary");
}
+ //7900
+ $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
+ $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
+
+
}
$scope.enableNormalMode = function () {
@@ -4898,17 +5138,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.isNormalMode = false;
console.log('enableNormalMode is called');
-
+
// $rootScope.isHighLight = false;
//to do should not call every time
$rootScope.CloseListManager();
-
+
$rootScope.isHighlightBodyByBodySystem = false;
if ($rootScope.isNormalMode == true) {
+
+
+
+
}
else {
@@ -4932,11 +5176,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.isListManagerSelected = false;
//7.
- $scope.CalculateImageCordinates($rootScope.viewOrientationId);
+ $scope.layerNumber = $('#txtlayerNumber').val();
+ $scope.CalculateImageCordinates($rootScope.viewOrientationId);
+ // alert($rootScope.viewOrientationId + "gadash")
+
+
$("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
$("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
-
+
}
@@ -4963,7 +5211,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
}
- $scope.enableExtract = function () {
+ // #7972 Mozilla Firefox> Incorrect navigation
+ $("#canvasDiv").scroll(function (event) {
+ $rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
+ $rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft();
+
+ });
+
+
+
+ $scope.enableExtract = function (isCalledFromButton) {
+
+ console.log('isCalledFromButton= ' + isCalledFromButton);
$rootScope.isHighlightBodyByBodySystem = false;
@@ -4971,10 +5230,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
$rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft();
-
- if ($scope.isTransparencyActivated == true) {
+
+ if ($scope.isTransparencyActivated == true) {
$("#btnExtract").addClass("disabled");
@@ -4983,42 +5242,70 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
else {
-
+
$rootScope.CloseListManager();
//1.
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
+ //$rootScope.isLoading = true;
+ //$('#spinner').css('visibility', 'visible');
//2.
$scope.terminateCurrentlyRunningWPs();
- //3.
- if ($rootScope.isExtract == true) {
+ //3.
+ //if extarct is alraedy enabled and user cliked on any body part then extract that.
+ if (isCalledFromButton == false) {
- }
- else {
- $rootScope.isExtract = true;
- //disable transparency button
-
- $("#btnTranparency").addClass("disabled");
+ $rootScope.isExtract = true;
+ //disable transparency button
+
+ $("#btnTranparency").addClass("disabled");
+
+
+ if ($rootScope.isNormalMode == true) {
+ $rootScope.isHighLight = false;
+ $rootScope.isNormalMode = false;
+ }
+ else {
+
+ $rootScope.isHighLight = false;
+ }
- if ($rootScope.isNormalMode == true) {
+ //4.
+ console.log('highLightBody from enableExtract')
+ $scope.highLightBody();
- $rootScope.isHighLight = false;
- $rootScope.isNormalMode = false;
}
else {
- $rootScope.isNormalMode = false;
- $rootScope.isHighLight = false;
- }
- //4.
- console.log('highLightBody from enableExtract')
- $scope.highLightBody();
+ if ($rootScope.isExtract == true) {
+
+ }
+ else {
+ $rootScope.isExtract = true;
+ //disable transparency button
+
+ $("#btnTranparency").addClass("disabled");
- }
+ if ($rootScope.isNormalMode == true) {
+
+ $rootScope.isHighLight = false;
+ $rootScope.isNormalMode = false;
+ }
+ else {
+
+ $rootScope.isHighLight = false;
+ }
+
+ //4.
+ console.log('highLightBody from enableExtract')
+ $scope.highLightBody();
+
+
+ }
+ }
+
//5. unhighlight other
//$scope.Normal = "";
@@ -5056,7 +5343,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$(".com").toggle();
$('#dot').toggle();
+ $('#bord').toggle();
$('#sppeachBubble').toggle();
+ $('#sppeachBubble_annotation').toggle();
+
+ $("#bord_annotation").toggle();
+ $("#dot_annotation").toggle();
+ $(".dynCross_anno").parent().parent().parent().toggle();
}
@@ -5064,9 +5357,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.highLightBody = function () {
- $rootScope.isLoading = true;
- $('#spinner').css('visibility', 'visible');
-
$scope.Normal = "";
$scope.Extract = "";
@@ -5121,15 +5411,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var coloredImageDataVar = coloredImageData;
- if (value.haveMirror == 'true') {
- $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
- }
- else {
+ //if (value.haveMirror == 'true') {
+ // $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
+ //}
+ //else {
- $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
+ // $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
- }
+ //}
var context_gray = imageCanvas.getContext('2d');
@@ -5151,194 +5441,161 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var colorMode;
if ($scope.isExtract == true) {
- colorMode = $scope.applyWhiteMatrix(img, context_gray);
+
+ if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) {
+
+ colorMode = $scope.applyWhiteMatrix(img, context_gray);
+ }
}
else {
colorMode = $scope.applyGrayMatrix(img, context_gray);
}
- var zeroPoint = new Point();
+ console.log('colorMode inside if = ' + colorMode);
- DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
+ if (colorMode != undefined || colorMode != null) {
- context_gray.putImageData(DAData.data, 0, 0)
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- //NIKI- to resolve lateral arm black issue in highlight mode
- if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) {
+ var zeroPoint = new Point();
- var imgData = context_gray.getImageData(0, 0, width, ht);
- var data = imgData.data;
- var c = 0;
- for (var i = 0; i < data.length; i += 4) {
- if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
- data[i + 3] = 0;
- }
+ DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
- }
- context_gray.putImageData(imgData, 0, 0);
- }
- //push BRID into array
- $scope.grayedBR.push({ 'BRID': value.bodyRegionId });
+ context_gray.putImageData(DAData.data, 0, 0)
- var grayImageData = context_gray.getImageData(0, 0, width, ht);
- var grayImageImageDataVar = grayImageData.data;
+ //NIKI- to resolve lateral arm black issue in highlight mode
- if ($scope.isExtract == true) {
- if (value.haveMirror == 'true') {
- $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
- }
- else {
+ if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) {
- $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
- }
- }
- else {
+ var imgData = context_gray.getImageData(0, 0, width, ht);
+ var data = imgData.data;
+ var c = 0;
+ for (var i = 0; i < data.length; i += 4) {
+ if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
+ data[i + 3] = 0;
+ }
- if (value.haveMirror == 'true') {
- $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ }
+ context_gray.putImageData(imgData, 0, 0);
}
- else {
- $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
- }
- }
+ imageCanvas.style.visibility = 'visible';
+ //push BRID into array
+ $scope.grayedBR.push({ 'BRID': value.bodyRegionId });
+ var grayImageData = context_gray.getImageData(0, 0, width, ht);
+ var grayImageImageDataVar = grayImageData.data;
- if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
- $scope.isEligibleForHighlightBodyByTermList = true;
- $scope.doHighlightOrExtract = false;
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
- $scope.isEligibleForHighlightBodyByTermList = true;
- $scope.doHighlightOrExtract = false;
- }
- else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
- $scope.isEligibleForHighlightBodyByTermList = true;
- $scope.doHighlightOrExtract = false;
- }
- else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
- $scope.isEligibleForHighlightBodyByTermList = true;
- $scope.doHighlightOrExtract = false;
+ if ($scope.isExtract == true) {
+ if (value.haveMirror == 'true') {
+ $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ }
+ else {
+
+ $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ }
}
else {
- $scope.isEligibleForHighlightBodyByTermList = false;
+ if (value.haveMirror == 'true') {
+ $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ }
+ else {
+
+ $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ }
}
- if ($scope.isEligibleForHighlightBodyByTermList == true) {
- //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE
- // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) {
- $scope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- //}
+ if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
+ $scope.isEligibleForHighlightBodyByTermList = true;
+ $scope.doHighlightOrExtract = false;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
+ $scope.isEligibleForHighlightBodyByTermList = true;
+ $scope.doHighlightOrExtract = false;
+ }
+ else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
+ $scope.isEligibleForHighlightBodyByTermList = true;
+ $scope.doHighlightOrExtract = false;
+ }
+ else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
+ $scope.isEligibleForHighlightBodyByTermList = true;
+ $scope.doHighlightOrExtract = false;
+ }
+ else {
-
- if (( $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
+ $scope.isEligibleForHighlightBodyByTermList = false;
+ }
+ if ($scope.isEligibleForHighlightBodyByTermList == true) {
+ //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE
+ // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) {
+ $scope.isLoading = false;
- $scope.isLoading = true;
+ $('#spinner').css('visibility', 'hidden');
+ //}
- $('#spinner').css('visibility', 'visible');
- $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
- }
- else if ($rootScope.isListManagerSelected == true) {
+ if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
- // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
- $timeout(function () {
$scope.isLoading = true;
+
$('#spinner').css('visibility', 'visible');
+ $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
+ }
+ else if ($rootScope.isListManagerSelected == true) {
- $scope.HighlightBodyByTermList($scope.AllTerms)
- }, 800);
+ // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
+ $timeout(function () {
+
+ $scope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
+
+ $scope.HighlightBodyByTermList($scope.AllTerms)
+ }, 800);
+
+ }
+ else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
+ $scope.createTermListByPreviousTermsAndHighlight();
+ }
- }
- else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
- $scope.createTermListByPreviousTermsAndHighlight();
}
}
}
- }
-
- $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
+ // $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
+ console.log('highlightboy. $rootScope.isExtract= '+$rootScope.isExtract+', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
+ if ($rootScope.isExtract == true) {
+ if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
+ console.log('1. $rootScope.isExtract=true and $rootScope.previousHighlightList != null')
- if ($rootScope.isExtract == true) {
- if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
- console.log('1. $rootScope.isExtract=true and $rootScope.previousHighlightList != null')
+ $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
+ }
+ else if ($rootScope.isListManagerSelected == true) {
+ console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
- $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
- }
- else if ($rootScope.isListManagerSelected == true) {
- console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
+ $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
- $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
-
+ }
}
}
- //else {
- // // this code is for the case where user first clcik on normal mode then extract then again highlight then we need to call highlight body in gray mode
- // //and then highlight the previously selected body regions at the time of normal mode.
- // if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
- // if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
- // $scope.isEligibleForHighlightBodyByTermList = true;
- // }
- // else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
- // $scope.isEligibleForHighlightBodyByTermList = true;
- // }
- // else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
- // $scope.isEligibleForHighlightBodyByTermList = true;
- // }
- // else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
- // $scope.isEligibleForHighlightBodyByTermList = true;
- // }
-
-
- // }
-
- // //
- //}
})
- //if ($scope.isEligibleForHighlightBodyByTermList == true) {
- // if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) {
-
- // var multiTermList = [];
- // angular.forEach($rootScope.previousHighlightList, function (value, key) {
-
- // //debugger;
-
- // var ActualTermNo = $scope.getActualTermNumber(value);
- // if (ActualTermNo != null) {
- // var TermList = $scope.getTermNumberList(ActualTermNo);
- // if (TermList != null) {
- // for (var i = 0; i < TermList.length; i++) {
-
- // multiTermList.push(TermList[i]);
- // }
- // }
- // }
-
- // });
- // console.log('HighlightBodyByTermList call with multiTermList')
-
- // $timeout(function () { $scope.HighlightBodyByTermList(multiTermList) }, 80);
- // }
- //}
-
}
else {
// This code will execute when user will select normal Mode but this time isHighlight will be false
+ console.log('highlightboy ELSE. $rootScope.isExtract= ' + $rootScope.isExtract + ', $rootScope.previousHighlightList.length= ' + $rootScope.previousHighlightList.length)
angular.forEach($scope.ColoredImageSRC, function (value, key) {
var id;
@@ -5362,14 +5619,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var coloredImageDataVar = coloredImageData;
- if (value.haveMirror == 'true') {
- $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
- }
- else {
+ //if (value.haveMirror == 'true') {
+ // $rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId)] = coloredImageDataVar;
+ //}
+ //else {
- $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
+ // $rootScope.coloredImageCanvasList[parseInt(value.bodyRegionId - 1)] = coloredImageDataVar;
- }
+ //}
var context = imageCanvas.getContext('2d');
@@ -5393,40 +5650,68 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var colorMode;
if ($scope.isExtract == true) {
- colorMode = $scope.applyWhiteMatrix(img, context);
+ if ((($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && $rootScope.previousHighlightList.length > 0) || $rootScope.isListManagerSelected == true) {
+
+ colorMode = $scope.applyWhiteMatrix(img, context);
+ }
}
- var zeroPoint = new Point();
+ console.log('colorMode inside else = ' + colorMode);
+ if (colorMode != undefined || colorMode != null) {
- DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
+ $rootScope.isLoading = true;
+ $('#spinner').css('visibility', 'visible');
- context.putImageData(DAData.data, 0, 0)
+ var zeroPoint = new Point();
- var grayImageData = context.getImageData(0, 0, width, ht);
- var grayImageImageDataVar = grayImageData.data;
+ DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode);
- if ($scope.isExtract == true) {
- if (value.haveMirror == 'true') {
- $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
- }
- else {
+ context.putImageData(DAData.data, 0, 0)
+
+
+ //NIKI- to resolve lateral arm black issue in mode
+
+ if ($rootScope.viewOrientationId == 5 && (value.bodyRegionId == 6 || value.bodyRegionId == 4)) {
- $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ var imgData = context.getImageData(0, 0, width, ht);
+ var data = imgData.data;
+ var c = 0;
+ for (var i = 0; i < data.length; i += 4) {
+ if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) {
+ data[i + 3] = 0;
+ }
+
+ }
+ context.putImageData(imgData, 0, 0);
}
- }
- else {
- if (value.haveMirror == 'true') {
- $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ imageCanvas.style.visibility = 'visible'
+ var grayImageData = context.getImageData(0, 0, width, ht);
+ var grayImageImageDataVar = grayImageData.data;
+
+ if ($scope.isExtract == true) {
+ if (value.haveMirror == 'true') {
+ $rootScope.whiteImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ }
+ else {
+
+ $rootScope.whiteImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ }
}
else {
- $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ if (value.haveMirror == 'true') {
+ $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ }
+ else {
+
+ $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ }
}
}
- }
- $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
+ // $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50);
+ }
})
if ($rootScope.isExtract == true) {
@@ -5442,7 +5727,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
else if ($rootScope.isListManagerSelected == true) {
console.log('2. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
$timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
-
+
}
}
@@ -5530,14 +5815,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.isTransparencyBoxActivated = false;
$rootScope.isNormalMode = false;
- //if listanager is visisble then close it
-
- // $rootScope.isListManagerSelected = false;
- $rootScope.CloseListManager();
+ //close transparecny box
+ $scope.CloseTransparencyBox();
- $rootScope.isHighlightBodyByBodySystem = false;
+ //if listanager is visisble then close it
+ // $rootScope.isListManagerSelected = false;
+ $rootScope.CloseListManager();
+ // $rootScope.isHighlightBodyByBodySystem = false;
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
@@ -5556,6 +5842,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
localStorage.setItem("currentBodyViewId", currentBodyViewId);
//3.
+ $scope.layerNumber = 0;
$scope.loadSelectedBodyView(currentBodyViewId);
//4.
@@ -5583,6 +5870,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
localStorage.setItem("currentBodyViewId", currentBodyViewId);
//3.
+ $scope.layerNumber = 0;
$scope.loadSelectedBodyView(currentBodyViewId);
//4.
@@ -5639,7 +5927,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//To fix issue of gray maintained in after closing jspanel after listmanager selection
$rootScope.isListManagerSelected = false;
$rootScope.isHighLight = false;
- $rootScope.isNormalMode = false;
+ //$rootScope.isNormalMode = false;
+ $rootScope.isHighlightBodyByBodySystem = false;
$rootScope.CloseListManager();
})
@@ -5662,6 +5951,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//debugger;
$rootScope.BodyLayerData = result;
+
+ var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
+
+ //set max for LayerNumber input
+ $rootScope.totalLayers = dataLength - 1;
+
+ $('#txtLayerNumber').attr('max', $rootScope.totalLayers);
+ $('#layerChangeSlider').slider("option", "max", $rootScope.totalLayers);
+
+ //set max for LayerNumber input
+ $rootScope.totalLayers = dataLength - 1;
+
$scope.isBodylayerdataLoaded = true;
//load json for annotations
@@ -5678,18 +5979,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
canDiv.innerHTML = '';
}
//if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender
-
+
if (($rootScope.isListManagerSelected == true) && (($rootScope.isGenderChnage == true) || $rootScope.isViewChange == true)) {
-
- $scope.setLayerNumberAndHighlightByTermList();
-
- }
-
- else {
-
- $scope.CalculateImageCordinates($rootScope.viewOrientationId);
-
- }
+
+ $scope.setLayerNumberAndHighlightByTermList();
+
+ }
+
+ else {
+
+ $scope.CalculateImageCordinates($rootScope.viewOrientationId);
+
+ }
$scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
},
@@ -5709,19 +6010,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.OnViewChange = function (event) {
-
+
$("#btnExtract").removeClass("disabled");
$("#btnTranparency").removeClass("disabled");
$rootScope.isTransparencyBoxActivated = false;
$rootScope.isNormalMode = false;
+ //close transparency box
+ $scope.CloseTransparencyBox();
//if listanager is visisble then close it
//$rootScope.isListManagerSelected = false;
$rootScope.CloseListManager();
- $rootScope.isHighlightBodyByBodySystem = false;
+ // $rootScope.isHighlightBodyByBodySystem = false;
$rootScope.isLoading = true;
@@ -5880,25 +6183,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.layerNumber = parseInt($('#txtlayerNumber').val());
//alert('mouseUp');
-
+
if ($scope.layerNumber == 0) {
$scope.loadSelectedBodyView(data.reloadDABodyViewId);
}
- // $scope.loadSelectedBodyView(data.reloadDABodyViewId);
+ // $scope.loadSelectedBodyView(data.reloadDABodyViewId);
$scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId);
- // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
+ // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
//$rootScope.isSettingEventAlredayDispachted = false;
//}
})
-
- $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) {
+ $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) {
+
//$rootScope.voId = currentBodyViewId;
//$scope.skinTone = $rootScope.globalSetting.ethnicity;
@@ -5956,7 +6259,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$("#canvas").css("display", "block");
$("#canvasPaint").css("display", "block");
- $scope.doClick();
+ $scope.BindCanvasDrawingListners();
$rootScope.FreeStylePaint();
});
$scope.mousePs;
@@ -5972,12 +6275,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.offsetY1 = 0;
$scope.x = 0;
$scope.y = 0;
- $scope.doClick = function (event) {
+ $scope.BindCanvasDrawingListners = function (event) {
$scope.clicked = true;
// OnPaintCanvasMouseDown(event);
- canvas.addEventListener('mousedown', $scope.OnPaintCanvasMouseDown, false);
- canvas.addEventListener('mouseup', $scope.OnPaintCanvasMouseUp, false);
+
+ var annotationCanvas = document.getElementById('canvas');
+ if (annotationCanvas != null || annotationCanvas != undefined) {
+ annotationCanvas.addEventListener('mousedown', $scope.OnPaintCanvasMouseDown, false);
+ annotationCanvas.addEventListener('mouseup', $scope.OnPaintCanvasMouseUp, false);
+ }
// alert("doclick");
};
@@ -6017,6 +6324,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.resetText = 0;
$rootScope.resetTextSave = 0;
$rootScope.ObjectIndexSave = 0;
+
var arrayRect = {};
@@ -6064,7 +6372,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
break;
case "Line":
-
+
$rootScope.resetLine = $rootScope.ObjectIndex++;
$('#canvas').addLayer({
name: 'Line_' + $rootScope.resetLine,
@@ -6076,7 +6384,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
rounded: true,
x1: $scope.offsetX1, y1: $scope.offsetY1,
x2: $scope.x, y2: $scope.y,
-
+
click: function (layer) {
$rootScope.canvasLayerNameCollection = [];
$rootScope.canvasLayerNameCollection.push(layer.name);
@@ -6145,10 +6453,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
resizeFromCenter: false,
- dblclick: function () {
- $rootScope.backOpacity();
-
- },
+ dblclick: function () {
+ $rootScope.backOpacity();
+
+ },
click: function (layer) {
$rootScope.canvasLayerNameCollection = [];
@@ -6225,7 +6533,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
click: function (layer) {
- // alert(layer.name);
+
$rootScope.canvasLayerNameCollection = [];
$rootScope.canvasLayerNameCollection.push(layer.name);
$('#canvas').setLayer(layer.name, {
@@ -6241,7 +6549,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
},
mouseout: function (layer) {
$rootScope.canvasLayerNameCollection = [];
-
+
$('#canvas').setLayer(layer.name, {
handle: {
type: 'arc',
@@ -6368,7 +6676,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
x2: $scope.x, y2: $scope.y,
click: function (layer) {
-
+
$rootScope.shapeTypePin = "Pin";
$rootScope.canvasLayerNameCollection = [];
var pinLine_layer = layer.name;
@@ -6392,7 +6700,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
},
mouseout: function (layer) {
-
+
$rootScope.canvasLayerNameCollection = [];
$('#canvas').setLayer(layer.name, {
handle: {
@@ -6455,8 +6763,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$('.btnCursor').addClass('activebtncolor');
break;
case "TextArea":
- $rootScope.IsTextAlreadySave = false;
- $("#text_area").val('');
+ $rootScope.IsTextAlreadySave = false;
+ $("#text_area").val('');
// Draw text
$rootScope.resetTextRect = $rootScope.ObjectIndex++;
$rootScope.resetText = $rootScope.ObjectIndex++;
@@ -6474,7 +6782,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
align: "left",
fontFamily: 'Verdana, sans-serif',
text: ''
-
+
})
// Draw rect as wide as the text
.drawRect({
@@ -6488,6 +6796,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
x: $scope.offsetX1, y: $scope.offsetY1,
width: $scope.x - $scope.offsetX1,
height: $scope.y - $scope.offsetY1,
+ add: function (layer) {
+
+ $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
+
+ },
click: function (layer) {
$rootScope.canvasLayerNameCollection = [];
@@ -6504,6 +6817,30 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}).drawLayers();
},
+ dblclick: function (layer) {
+
+
+ $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
+ $("#annotationTextModal").modal("toggle");
+
+ $("#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" });
+ $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
+ // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
+
+ $("#text-italic").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-bold").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-underline").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-center").removeClass("ActiveFormattingButtonClass");
+
+ },
mouseout: function (layer) {
$rootScope.canvasLayerNameCollection = [];
$('#canvas').setLayer(layer.name, {
@@ -6538,9 +6875,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$("#annotationTextModal").modal("toggle");
$('.btnCursor').trigger('click');
+ $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
+ // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
$("#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" });
+
+ $("#text-italic").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-bold").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-underline").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-center").removeClass("ActiveFormattingButtonClass");
+
$(".btn-annotation").removeClass("activebtncolor");
+
$('.btnCursor').addClass('activebtncolor');
break;
@@ -6553,6 +6907,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
+
//-- TextArea functionality of Annotation toolbar
$rootScope.fontSizes;
@@ -6567,271 +6922,466 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.modifySavedText = [];
$rootScope.TextRectangleArr = [];
$rootScope.rectDimension = [];
-
+
// will refactor this code later
-
+
$rootScope.saveText = function () {
+
// this part will work first time when save button will be clicked
if ($rootScope.IsTextAlreadySave == false) {
// getting textarea style properties
- $rootScope.fontSizes = $("#text_area").css("font-size");
- $rootScope.fontWeight = $("#text_area").css("font-weight");
- $rootScope.fontStyle = $("#text_area").css("font-style");
- $rootScope.textAlignmt = $("#text_area").css("text-align");
- $rootScope.fontColor = $("#text_area").css("color");
- $rootScope.fontFamily = $("#text_area").css("font-family");
- $rootScope.underlineText = $("#text_area").css("text-decoration");
- $rootScope.textArea = $("#text_area").val();
+ $rootScope.fontSizes = $("#text_area").css("font-size");
+ $rootScope.fontWeight = $("#text_area").css("font-weight");
+ $rootScope.fontStyle = $("#text_area").css("font-style");
+ $rootScope.textAlignmt = $("#text_area").css("text-align");
+ $rootScope.fontColor = $("#text_area").css("color");
+ $rootScope.fontFamily = $("#text_area").css("font-family");
+ $rootScope.underlineText = $("#text_area").css("text-decoration");
+ $rootScope.textArea = $("#text_area").val();
// deleting previous text area
- $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
- $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
-
- // Text After Saving in Rectangle
- $('#canvas').drawText({
- layer: true,
- draggable: true,
- name: 'TextArea_' + $rootScope.resetText,
- groups: ['TextArea_' + $rootScope.resetText],
- dragGroups: ['TextArea_' + $rootScope.resetText],
- fillStyle: $rootScope.fontColor,
- fontStyle: $rootScope.fontStyle,
- fontSize: $rootScope.fontSizes,
- fontFamily: $rootScope.fontFamily,
- align: $rootScope.textAlignmt,
- strokeWidth: 0,
- text: $rootScope.textArea,
- x: $scope.offsetX1, y: $scope.offsetY1,
- maxWidth: $scope.x - $scope.offsetX1,
- maxHeight: $scope.y - $scope.offsetY1,
- add: function (layer) {
- $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
- $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });
+ $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
+ $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
+
+ // Text After Saving in Rectangle
+ $('#canvas').drawText({
+ layer: true,
+ draggable: true,
+ name: 'TextAreaNew_' + $rootScope.resetText,
+ groups: ['TextAreaNew_' + $rootScope.resetText],
+ dragGroups: ['TextAreaNew_' + $rootScope.resetText],
+ fillStyle: $rootScope.fontColor,
+ fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle,
+ fontSize: $rootScope.fontSizes,
+ fontFamily: $rootScope.fontFamily,
+ align: $rootScope.textAlignmt,
+ strokeWidth: 0,
+ text: $rootScope.textArea,
+ x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
+ maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
+ maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
+ add: function (layer) {
+ // alert(layer.maxWidth);
+ $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
+ $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText });
}
- })
- // Draw rectangle
- .drawRect({
- name: 'TextArea1_' + $rootScope.resetText,
- layer: true,
- draggable: true,
- groups: ['TextArea_' + $rootScope.resetText],
- dragGroups: ['TextArea_' + $rootScope.resetText],
- opacity: $rootScope.shapestyleOpacity,
- strokeStyle: $rootScope.shapestyleborderColor,
- strokeWidth: $rootScope.shapestyleborderWidth,
- x: $scope.offsetX1, y: $scope.offsetY1,
- width: $scope.x - $scope.offsetX1,
- height: $scope.y - $scope.offsetY1,
- click: function (layer) {
- $rootScope.shapeTypeText = "textAreaRect";
-
- var layerNameSplit = layer.name;
- var splitedName = layerNameSplit.split("_");
- var textValName = "TextArea_";
- var concatinateResult = textValName.concat(splitedName[1]);
- $rootScope.canvasLayerNameCollection = [];
- $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
- $('#canvas').setLayer(layer.name, {
- handle: {
- type: 'rectangle',
- fillStyle: '#fff',
- strokeStyle: '#c33',
- strokeWidth: 2,
- width: 5, height: 5,
- cornerRadius: 3
- }
- }).drawLayers();
- },
- dblclick: function (layer) {
- $rootScope.IsTextAlreadySave = true;
-
- var _rectLayerOnSave = layer.name;
- var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
- var TextAreaRectName = "TextArea_";
- var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
- $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
- $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
- var _rectLayerOnSaveSplitInt;
- if (_rectLayerOnSaveSplit[1] >= 3)
- _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
- else
- _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
- var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
- $("#text_area").val(b);
- $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
- $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
- $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
- $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);
- $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);
- $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);
- $("#text_area").css("text-decoration", $rootScope.underlineText);
- _rectLayerOnSaveSplitInt = ''; b = '';
- $("#annotationTextModal").modal("toggle");
- },
- mouseout: function (layer) {
- $rootScope.canvasLayerNameCollection = [];
- $('#canvas').setLayer(layer.name, {
- handle: {
- type: 'rectangle',
- fillStyle: 'pink',
- strokeStyle: 'yellow',
- strokeWidth: 0,
- width: 0, height: 0,
- cornerRadius: 0
- }
- }).drawLayers();
- },
- mouseover: function (layer) {
- $('#canvas').setLayer(layer.name, {
- handle: {
- type: 'rectangle',
- fillStyle: '#fff',
- strokeStyle: '#c33',
- strokeWidth: 2,
- width: 5, height: 5,
- cornerRadius: 3
- }
- }).drawLayers();
-
- }
- });
- $("#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" });
-
- }
-
-// this part will work second time when save button will be clicked
- else {
- // getting textarea style properties
- var _modifiedText = $("#text_area").val();
- var _modifiedFontSize = $("#text_area").css("font-size");
- var _modifiedFontWeight = $("#text_area").css("font-weight");
- var _modifiedFontStyle = $("#text_area").css("font-style");
- var _modifiedTextAlign = $("#text_area").css("text-align");
- var _modifiedFontColor = $("#text_area").css("color");
- var _modifiedFontFamily = $("#text_area").css("font-family");
- var _modifiedFontDecoration = $("#text_area").css("text-decoration");
-
- // deleting previous textarea
- $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers();
- $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers();
- $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
- $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
-
- // generating new text area
- $('#canvas').drawText({
- layer: true,
- draggable: true,
- name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
- groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
- dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
- fillStyle: _modifiedFontColor,
- fontStyle: _modifiedFontStyle,
- fontSize: _modifiedFontSize,
- fontFamily: _modifiedFontFamily,
- align: _modifiedTextAlign,
- strokeWidth: 0,
- text: _modifiedText,
- x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
- maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
- maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height
-
- })
- // Draw rect as wide as the text
- .drawRect({
- name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
- layer: true,
- draggable: true,
- groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
- dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
- opacity: $rootScope.shapestyleOpacity,
- strokeStyle: $rootScope.shapestyleborderColor,
- strokeWidth: $rootScope.shapestyleborderWidth,
- x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
- width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
- height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
- click: function (layer) {
- $rootScope.shapeTypeText = "textAreaRect";
- var layerNameSplit = layer.name;
- var splitedName = layerNameSplit.split("_");
- var textValName = "TextAreaAfterEdit_";
+ })
+ // Draw rectangle
+ .drawRect({
+ name: 'TextArea1_' + $rootScope.resetText,
+ layer: true,
+ draggable: true,
+ groups: ['TextAreaNew_' + $rootScope.resetText],
+ dragGroups: ['TextAreaNew_' + $rootScope.resetText],
+ opacity: $rootScope.shapestyleOpacity,
+ strokeStyle: $rootScope.shapestyleborderColor,
+ strokeWidth: $rootScope.shapestyleborderWidth,
+ x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
+ width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
+ height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
+ click: function (layer) {
+ $rootScope.shapeTypeText = "textAreaRect";
+
+ var layerNameSplit = layer.name;
+ var splitedName = layerNameSplit.split("_");
+ var textValName = "TextAreaNew_";
var concatinateResult = textValName.concat(splitedName[1]);
$rootScope.canvasLayerNameCollection = [];
- $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
-
- $('#canvas').setLayer(layer.name, {
- handle: {
- type: 'rectangle',
- fillStyle: '#fff',
- strokeStyle: '#c33',
- strokeWidth: 2,
- width: 5, height: 5,
- cornerRadius: 3
- }
- }).drawLayers();
-
- },
- dblclick: function (layer) {
-
- $rootScope.IsTextAlreadySave = true;
- var _rectLayerOnSave = layer.name;
- var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
- var RectNameAfterEdit = "TextAreaAfterEdit_";
- var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
- $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
- $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
- $("#text_area").val(_modifiedText);
- $("#text_area").css("font-size", _modifiedFontSize);
- $("#text_area").css("font-weight", _modifiedFontWeight);
- $("#text_area").css("font-style", _modifiedFontStyle);
- $("#text_area").css("text-align", _modifiedTextAlign);
- $("#text_area").css("color", _modifiedFontColor);
- $("#text_area").css("font-family", _modifiedFontFamily);
- $("#text_area").css("text-decoration", _modifiedFontDecoration);
- $("#annotationTextModal").modal("toggle");
- },
- mouseout: function (layer) {
- $rootScope.canvasLayerNameCollection = [];
- $('#canvas').setLayer(layer.name, {
- handle: {
- type: 'rectangle',
- fillStyle: 'pink',
- strokeStyle: 'yellow',
- strokeWidth: 0,
- width: 0, height: 0,
- cornerRadius: 0
- }
- }).drawLayers();
- },
- mouseover: function (layer) {
- $('#canvas').setLayer(layer.name, {
- handle: {
- type: 'rectangle',
- fillStyle: '#fff',
- strokeStyle: '#c33',
- strokeWidth: 2,
- width: 5, height: 5,
- cornerRadius: 3
- }
- }).drawLayers();
-
- }
- });
- $rootScope.modifySavedText = [];
-
- }
+ $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
+ $('#canvas').setLayer(layer.name, {
+ handle: {
+ type: 'rectangle',
+ fillStyle: '#fff',
+ strokeStyle: '#c33',
+ strokeWidth: 2,
+ width: 5, height: 5,
+ cornerRadius: 3
+ }
+ }).drawLayers();
+ },
+ dblclick: function (layer) {
+
+ $rootScope.isTextAreaClosedButtonActive = false;
+ $rootScope.IsTextAlreadySave = true;
+
+ var _rectLayerOnSave = layer.name;
+ var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
+ var TextAreaRectName = "TextAreaNew_";
+ var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
+
+ $rootScope.layerNameArr = layer.name;
+ $rootScope.rectTextArr = TextAreaRectNameConcatenated;
+ // $rootScope.modifySavedText.push({ TextName: '', RectText: ''});
+ // $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
+
+ $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
+ var _rectLayerOnSaveSplitInt;
+ //if (_rectLayerOnSaveSplit[1] >= 3)
+ // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
+ //else
+ // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
+
+ _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
+
+ var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
+ $("#text_area").val(b);
+ var fontStyleProp = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle;
+ var fontWeightProp = fontStyleProp.split(" ");
+
+ $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
+ $("#text_area").css("font-weight", fontWeightProp[0]);
+ $("#text_area").css("font-style", fontWeightProp[1]);
+ $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);
+ $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);
+ $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);
+ $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration);
+ $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor });
+ // $(".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[_rectLayerOnSaveSplitInt].TextDecoration == "underline") {
+
+ $("#text-underline").addClass("ActiveFormattingButtonClass");
+
+ }
+
+ else {
+
+ $("#text-underline").removeClass("ActiveFormattingButtonClass");
+
+ }
+
+
+
+ //adding text font weight active class in text edit pop-up
+
+ if (fontWeightProp[0] == 700) {
+
+
+
+ $("#text-bold").addClass("ActiveFormattingButtonClass");
+
+ }
+
+ else {
+
+ $("#text-bold").removeClass("ActiveFormattingButtonClass");
+
+ }
+
+ //adding text font style active class in text edit pop-up
+
+ if (fontWeightProp[1] == "italic") {
+
+
+ $("#text-italic").addClass("ActiveFormattingButtonClass");
+ }
+ else {
+ $("#text-italic").removeClass("ActiveFormattingButtonClass");
+
+
+ }
+
+ //adding text alignment active class in text edit pop-up
+
+ if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") {
+
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-center").removeClass("ActiveFormattingButtonClass")
+
+ $("#text-left").addClass("ActiveFormattingButtonClass");
+
+ }
+
+ else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") {
+
+
+
+ $("#text-center").removeClass("ActiveFormattingButtonClass")
+
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-right").addClass("ActiveFormattingButtonClass");
+
+
+
+ }
+
+ else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") {
+
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-center").addClass("ActiveFormattingButtonClass");
+
+
+
+ }
+
+
+ _rectLayerOnSaveSplitInt = ''; b = '';
+ $("#annotationTextModal").modal("toggle");
+ },
+ mouseout: function (layer) {
+ $rootScope.canvasLayerNameCollection = [];
+ $('#canvas').setLayer(layer.name, {
+ handle: {
+ type: 'rectangle',
+ fillStyle: 'pink',
+ strokeStyle: 'yellow',
+ strokeWidth: 0,
+ width: 0, height: 0,
+ cornerRadius: 0
+ }
+ }).drawLayers();
+ },
+ mouseover: function (layer) {
+ $('#canvas').setLayer(layer.name, {
+ handle: {
+ type: 'rectangle',
+ fillStyle: '#fff',
+ strokeStyle: '#c33',
+ strokeWidth: 2,
+ width: 5, height: 5,
+ cornerRadius: 3
+ }
+ }).drawLayers();
+
+ }
+ });
+ $("#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" });
+
+ $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
+ $("#text-italic").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-bold").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-underline").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+
+ $("#text-center").removeClass("ActiveFormattingButtonClass");
+
+
+ }
+
+ // this part will work second time when save button will be clicked
+ else {
+
+ // getting textarea style properties
+ var _modifiedText = $("#text_area").val();
+ var _modifiedFontSize = $("#text_area").css("font-size");
+ var _modifiedFontWeight = $("#text_area").css("font-weight");
+ var _modifiedFontStyle = $("#text_area").css("font-style");
+ var _modifiedTextAlign = $("#text_area").css("text-align");
+ var _modifiedFontColor = $("#text_area").css("color");
+ var _modifiedFontFamily = $("#text_area").css("font-family");
+ var _modifiedFontDecoration = $("#text_area").css("text-decoration");
+
+ // deleting previous textarea
+
+ // var a = $rootScope.modifySavedTextIndexNumber;
+ // alert(a);
+ // alert($rootScope.modifySavedText.length);
+ // alert($rootScope.modifySavedText[a].RectText);
+
+ $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers();
+ $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers();
+
+ $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
+ $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
+
+ // generating new text area
+ $('#canvas').drawText({
+ layer: true,
+ draggable: true,
+ name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
+ groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
+ dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
+ fillStyle: _modifiedFontColor,
+ fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle,
+ fontSize: _modifiedFontSize,
+ fontFamily: _modifiedFontFamily,
+ align: _modifiedTextAlign,
+ strokeWidth: 0,
+ text: _modifiedText,
+ x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
+ maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
+ maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height
+
+ })
+ // Draw rect as wide as the text
+ .drawRect({
+ name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
+ layer: true,
+ draggable: true,
+ groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
+ dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
+ opacity: $rootScope.shapestyleOpacity,
+ strokeStyle: $rootScope.shapestyleborderColor,
+ strokeWidth: $rootScope.shapestyleborderWidth,
+ x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
+ width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
+ height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
+ click: function (layer) {
+ $rootScope.shapeTypeText = "textAreaRect";
+ var layerNameSplit = layer.name;
+ var splitedName = layerNameSplit.split("_");
+ var textValName = "TextAreaAfterEdit_";
+ var concatinateResult = textValName.concat(splitedName[1]);
+ $rootScope.canvasLayerNameCollection = [];
+ $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
+
+ $('#canvas').setLayer(layer.name, {
+ handle: {
+ type: 'rectangle',
+ fillStyle: '#fff',
+ strokeStyle: '#c33',
+ strokeWidth: 2,
+ width: 5, height: 5,
+ cornerRadius: 3
+ }
+ }).drawLayers();
+
+ },
+ dblclick: function (layer) {
+
+ $rootScope.isTextAreaClosedButtonActive = false;
+ $rootScope.IsTextAlreadySave = true;
+ var _rectLayerOnSave = layer.name;
+ var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
+ var RectNameAfterEdit = "TextAreaAfterEdit_";
+ var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
+ $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
+
+
+
+ // $rootScope.modifySavedText.push({ TextName: '', RectText: '' });
+ // $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
+
+ $rootScope.layerNameArr = layer.name;
+ $rootScope.rectTextArr = RectNameAfterEditResult;
+
+
+ $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
+ $("#text_area").val(_modifiedText);
+ $("#text_area").css("font-size", _modifiedFontSize);
+ $("#text_area").css("font-weight", _modifiedFontWeight);
+ $("#text_area").css("font-style", _modifiedFontStyle);
+ $("#text_area").css("text-align", _modifiedTextAlign);
+ $("#text_area").css("color", _modifiedFontColor);
+ $("#text_area").css("font-family", _modifiedFontFamily);
+ $("#text_area").css("text-decoration", _modifiedFontDecoration);
+ $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
+ // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
+ // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
+
+ //adding text text decoration active class in text edit pop-up
+ if (_modifiedFontDecoration == "underline") {
+ $("#text-underline").addClass("ActiveFormattingButtonClass");
+ }
+ else {
+ $("#text-underline").removeClass("ActiveFormattingButtonClass");
+ }
+
+ //adding text font weight active class in text edit pop-up
+ if (_modifiedFontWeight == 700) {
+
+ $("#text-bold").addClass("ActiveFormattingButtonClass");
+ }
+ else {
+
+ $("#text-bold").removeClass("ActiveFormattingButtonClass");
+
+ }
+
+ //adding text font style active class in text edit pop-up
+ if (_modifiedFontStyle == "italic") {
+
+ $("#text-italic").addClass("ActiveFormattingButtonClass");
+ }
+ else {
+ $("#text-italic").removeClass("ActiveFormattingButtonClass");
+
+ }
+
+ //adding text alignment active class in text edit pop-up
+ if (_modifiedTextAlign == "left") {
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+ $("#text-center").removeClass("ActiveFormattingButtonClass")
+ $("#text-left").addClass("ActiveFormattingButtonClass");
+ }
+ else if (_modifiedTextAlign == "right") {
+
+ $("#text-center").removeClass("ActiveFormattingButtonClass")
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+ $("#text-right").addClass("ActiveFormattingButtonClass");
+
+ }
+ else if (_modifiedTextAlign == "center") {
+ $("#text-left").removeClass("ActiveFormattingButtonClass");
+ $("#text-right").removeClass("ActiveFormattingButtonClass");
+ $("#text-center").addClass("ActiveFormattingButtonClass");
+
+ }
+
+
+ $("#annotationTextModal").modal("toggle");
+ },
+ mouseout: function (layer) {
+ $rootScope.canvasLayerNameCollection = [];
+ $('#canvas').setLayer(layer.name, {
+ handle: {
+ type: 'rectangle',
+ fillStyle: 'pink',
+ strokeStyle: 'yellow',
+ strokeWidth: 0,
+ width: 0, height: 0,
+ cornerRadius: 0
+ }
+ }).drawLayers();
+ },
+ mouseover: function (layer) {
+ $('#canvas').setLayer(layer.name, {
+ handle: {
+ type: 'rectangle',
+ fillStyle: '#fff',
+ strokeStyle: '#c33',
+ strokeWidth: 2,
+ width: 5, height: 5,
+ cornerRadius: 3
+ }
+ }).drawLayers();
+
+ }
+ });
+ // $rootScope.modifySavedText = [];
+
+ }
}
-
+
// deleting text area on close button
$rootScope.closeModal = function () {
+
+ if ($rootScope.isTextAreaClosedButtonActive == true) {
$("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
$("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
-
- }
+
+ }
+
+ }
function OnPaintCanvasMouseMove(event) {
@@ -6840,7 +7390,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
$rootScope.FreeStylePaint = function (e) {
-
+
}
$scope.OnPaintBrushCanvasMouseDown = function (event) {
@@ -6848,22 +7398,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
case "FreeStylePaint":
-
- // $('#canvasPaint').sketch();
- // $('#canvasPaint').sketch({ defaultSize: 1 });
- // if ($("#amount-2").val() == '') {
- // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
- // $('#canvasPaint').sketch();
- // }
- // else {
- // // var a = $("#amount-2").val();
- //// $scope.shapesize = parseInt(a);
- // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });
- // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
+ // $('#canvasPaint').sketch();
+ // $('#canvasPaint').sketch({ defaultSize: 1 });
+ // if ($("#amount-2").val() == '') {
+ // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
+ // $('#canvasPaint').sketch();
+ // }
+ // else {
+
+ // // var a = $("#amount-2").val();
+ //// $scope.shapesize = parseInt(a);
+ // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });
+ // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
- // }
+ // }
break;
@@ -6881,7 +7431,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
// case "FreeStylePaint":
-
+
// if ($("#amount-2").val() == '')
// {
// $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
@@ -6907,9 +7457,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$(document).keydown(function (event) {
-
+ // predefined function for detecting keyboard key
if (event.which == 46) {
-
+
if ($rootScope.shapeTypePin == "Pin") {
@@ -6989,7 +7539,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
console.log('highLightBody from HighlightBodyByBodySystem')
$scope.highLightBody();
}
-
+ else {
+ //This else is when user seraced anything then change the view and clicked on highlight options
+ //in this case body is already highlihted(gray) so no need to
+ if ($scope.grayedBR != null || $scope.grayedBR != undefined) {
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.grayedBR.length == 9)) {
+ $scope.isAlreadyHighlighted = true;
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.grayedBR.length == 5)) {
+ $scope.isAlreadyHighlighted = true;
+ }
+ else if ((($rootScope.viewOrientationId == '5')) && ($scope.grayedBR.length == 4)) {
+ $scope.isAlreadyHighlighted = true;
+ }
+ else if ((($rootScope.viewOrientationId == '6')) && ($scope.grayedBR.length == 1)) {
+ $scope.isAlreadyHighlighted = true;
+ }
+ if (($scope.isAlreadyHighlighted == true && $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined && $scope.systemMatchedTermList.length > 0)) {
+
+ $scope.isLoading = true;
+
+ $('#spinner').css('visibility', 'visible');
+ $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
+ }
+ }
+ }
//$rootScope.isLoading = true;
@@ -7216,12 +7790,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.ShowSearch = function () {
console.log('ShowSearch is called');
+ //this check is for log only because we are writing length so need to check if its not null or undefined
+ if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined)
+ console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length)
$timeout(function () {
- $scope.IsSearchVisible = true;
-
- document.getElementById("termlistfilter").style.display = "block";
- }, 1000);
+ if (($scope.VocabTermTxt!=null|| $scope.VocabTermTxt!=undefined) && ($scope.VocabTermTxt.length > 0)) {
+ $scope.IsSearchVisible = true;
+ document.getElementById("termlistfilter").style.display = "block";
+ }
+ else {
+ $scope.loadSearchDataForBodyView();
+ if ($scope.VocabTermTxt.length > 0) {
+ $scope.ShowSearch();
+ }
+ }
+ }, 500);
//$scope.IsSearchVisible = true;
@@ -7293,7 +7877,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$("#canvasDiv").scrollTop(scrolly);
$("#canvasDiv").scrollLeft(scrollx);
- if (( $rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
+ if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
$timeout(function () { $scope.HighlightBodyByTermList(systemMatchedTermList) }, 100);
}
@@ -7301,7 +7885,33 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
//list manager
$scope.$on('listManagerEvent', function (event, data) {
-
+
+ if ($rootScope.disableAnnotationtoolOnListManager == true)
+ {
+ $('#AnnotaionPopupDiv').find('input, textarea, button, select').attr('disabled', 'disabled');
+ $('#slider-range-min-2').slider('disable');
+ if ($rootScope.setListManagerZindex == true)
+ {
+ var canvasPaintZindex = $('#canvasPaint').css("z-index"); //x
+
+ var canvasZindex = $('#canvas').css("z-index"); //y
+ var listManagerZindex = $('#listManager').css("z-index"); //z
+ if (canvasPaintZindex > canvasZindex) {
+ //y = parseInt(canvasPaintZindex) + 1;
+ //if (listManagerZindex <= canvasPaintZindex) {
+ // listManagerZindex = parseInt(canvasPaintZindex) + 1;
+ // $('#listManager').css("z-index", z);
+ //}
+ //else {
+ $('#listManager').css("z-index", canvasPaintZindex);
+ // }
+ } else {
+ //y = parseInt(y) + 1;
+ $('#listManager').css("z-index", canvasZindex);
+ }
+
+ }
+ }
$('#spinner').css('visibility', 'visible');
console.log('listManagerEvent');
@@ -7396,17 +8006,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
for (var j = 0; j < $scope.VocabTermTxt.length; j++) {
var $el = $('
' + $scope.VocabTermTxt[j]._TermText + ' ').appendTo('#termList')
$compile($el)($scope);
-
+
$rootScope.isLoading = false;
$('#spinner').css('visibility', 'hidden');
}
var termsTotal = '
' + $scope.VocabTermTxt.length + ' Structures ';
$("#totalTerms").empty();
$('#totalTerms').append(termsTotal);
-
+
}
- }
+ }
$scope.HighlightBodyOnListManagerSelection = function (event) {
@@ -7414,6 +8024,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$scope.terminateCurrentlyRunningWPs();
//debugger
$rootScope.isListManagerSelected = true;
+ //---
+ if ($rootScope.isListManagerSelected == true) {
+ $("#btnHighLight").addClass("btn-primary");
+ $("#btnHighLight").removeClass("btn-black");
+ if (!$("#btnNormalMode").hasClass("btn-black")) {
+ $("#btnNormalMode").addClass("btn-black");
+ }
+
+ if ($("#btnNormalMode").hasClass("btn-primary")) {
+ $("#btnNormalMode").removeClass("btn-primary");
+ }
+ }
+ //---
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
@@ -7515,24 +8138,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
}
}
- $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
- $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
+ $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
+ $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
- //8.remove current layer canavses
- $scope.flushCanvas();
+ //8.remove current layer canavses
+ $scope.flushCanvas();
- //9.
- $timeout(function () {
- $rootScope.isHighLight = false;
- $('#sppeachBubble').css('display', 'none');
- $("#dot").css("display", "none");
+ //9.
+ $timeout(function () {
+ $rootScope.isHighLight = false;
+ $('#sppeachBubble').css('display', 'none');
+ $("#dot").css("display", "none");
+
+ //redraw body of respective layer
+ $scope.CalculateImageCordinates($rootScope.viewOrientationId)
+ }, 500);
- //redraw body of respective layer
- $scope.CalculateImageCordinates($rootScope.viewOrientationId)
- }, 500);
-
}
$scope.getChildTermList = function (termNo) {
@@ -7602,7 +8225,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
}
}
-
+
$scope.aligneCanvasWithTerm = function () {
console.log('aligneCanvasWithTerm')
var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA));
@@ -7617,7 +8240,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
var canvasRight = canvasX + canvasWidth
if (newX < canvasX || newX > canvasRight || newY < canvasY || newY > canvasBottom) {
-
+
newX = newX - canvasWidth / 2;
newY = newY - canvasHeight / 2;
@@ -7646,7 +8269,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
$rootScope.CanvasDivTopPosition = $("#canvasDiv").scrollTop();
$rootScope.CanvasDivLeftPosition = $("#canvasDiv").scrollLeft();
-
+
}
@@ -7763,15 +8386,212 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
});
}
-
+
$scope.LayerChangeBasedOnKeyPressed = function (e) {
-
- if(e.keyCode==13)
+ // Dissectible Anatomy > Should not display blank page if no layer is selected.
+
+
+ if (e.keyCode == 13) {
+
+ if ($("#txtlayerNumber").val() == '')
+ {
+
+ $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr);
+ }
+ else
+ {
+ $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val();
+ $scope.LayerChange();
+ }
+
+
+ }
+
+ // 'x' button is displaying inside the input box in IE browser.
+ if (e.keyCode == 38) {
+
+
+ var layerInputVal = $("#txtlayerNumber").val();
+ if (layerInputVal != $rootScope.totalLayers) {
+ var layerInputValInc = parseInt(layerInputVal) + 1;
+ $scope.layerNumber = parseInt(layerInputValInc);
+ $("#txtlayerNumber").val($scope.layerNumber);
+ $rootScope.PreviouslayerNumbr = $scope.layerNumber;
+ }
+
+
+ }
+
+ // 'x' button is displaying inside the input box in IE browser.
+ if (e.keyCode == 40) {
+ var layerInputVal = $("#txtlayerNumber").val();
+ if (layerInputVal > 0) {
+ var layerInputValDec = parseInt(layerInputVal) - 1;
+ $scope.layerNumber = parseInt(layerInputValDec);
+ $("#txtlayerNumber").val($scope.layerNumber);
+ $rootScope.PreviouslayerNumbr = $scope.layerNumber;
+ }
+ }
+
+ }
+
+
+ $scope.LayerValueChangeBasedOnKeyUp = function (e) {
+
+ var keyUplayerNumber = parseInt($("#txtlayerNumber").val());
+
+ if (isNaN(keyUplayerNumber))
{
- $scope.LayerChange();
+
}
-
+ else {
+
+ if (keyUplayerNumber > $rootScope.totalLayers) {
+
+ $("#txtlayerNumber").val($rootScope.totalLayers);
+ $scope.layerNumber = parseInt($rootScope.totalLayers);
+
+ }
+ else {
+
+ $("#txtlayerNumber").val(keyUplayerNumber);
+ $scope.layerNumber = parseInt(keyUplayerNumber);
+
+
+ }
+
+ }
+
+
}
+
+
+
}]
-);
\ No newline at end of file
+);
+
+
+function OnGenderChange(event) {
+
+ console.log('gender chnaged is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.OnGenderChange(event);
+ });
+}
+
+function OnViewChange(event) {
+ console.log('OnViewChange chnaged is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.OnViewChange(event);
+ });
+}
+
+function OnBodySystemSelection(event) {
+ console.log('OnBodySystem chnaged is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.HighlightBodyByBodySystem(event);
+ });
+}
+
+function enableShowHideStructureBox() {
+ console.log('OnBodySystem chnaged is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.enableShowHideStructureBox();
+ });
+}
+
+function OnSearch() {
+ console.log('Show Search is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.ShowSearch();
+ });
+}
+function selectTerm(event) {
+ console.log('selectTerm is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.jumpToTerm(event);
+ });
+}
+function HighlightBodyOnListManager(event) {
+ console.log('HighlightBodyOnListManager is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.HighlightBodyOnListManagerSelection(event);
+ });
+}
+
+function refreshTermListOnSystem(event) {
+ console.log('refreshTermListOnSystem is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.refreshTermListOnSystemSelection(event);
+ });
+}
+
+function OnEnableExtract()
+{
+ console.log('OnEnableExtract is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.enableExtract('true');
+ });
+}
+
+function onTboxCreation()
+{
+ console.log('OnEnableExtract is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.createTransparencyBox('true');
+ });
+}
+
+function onTboxClose()
+{
+ console.log('onTboxClose is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.CloseTransparencyBox();
+ });
+}
+
+function OnEnableNormalMode()
+{
+ console.log('OnEnableNormalMode is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.enableNormalMode();
+ });
+}
+
+function OnEnableHighlight() {
+ console.log('OnEnableHighlight is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.enableHighlight();
+ });
+}
+
+function OnIdentityClick() {
+ console.log('OnIdentityClick is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.IdentityClick();
+ });
+}
+
+function OnZoom()
+{
+ console.log('OnZoom is called outside ');
+ var scope = angular.element(document.getElementById("daView")).scope();
+ scope.$apply(function () {
+ scope.enableZoom();
+ });
+}
\ No newline at end of file
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
index d6de654..d5d027a 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -26,6 +26,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
$rootScope.clickDrag = new Array();
$rootScope.isLineDrawSelecyed = false;
$rootScope.isAnnotationWindowClose = false;
+ $rootScope.setListManagerZindex = false;
$rootScope.lastX;
$rootScope.lastY;
$rootScope.CommonData;
@@ -89,15 +90,15 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
}
- $rootScope.DrawLine = function () {
+ // $rootScope.DrawLine = function () {
//$rootScope.isIdetifyClicked = false;
//$rootScope.isDrawingToolSelected = true;
//$rootScope.isLineDrawSelecyed = true;
- $rootScope.shapeType = "Line";
+ // $rootScope.shapeType = "Line";
// alert($rootScope.shapeType);
- }
+ // }
$rootScope.ClearIframe = function () {
if ($('#daImagePanel') != null)
@@ -117,6 +118,12 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
//annotation tool custom events
$rootScope.ShowAnnotationWindow = function () {
+ //7904
+
+ $("#OnIdentify").addClass("annotationtoolbartab");
+ $("#annotationToolBarOptions").addClass("active");
+ $("#annotationButton").addClass("active");
+
$rootScope.isAnnotationWindowOpen = true;
$(".annotationTollbar").css("display", "block");
$rootScope.$broadcast('annotationToolEvent', true);
@@ -125,7 +132,14 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
$rootScope.CloseAnnotationTool = function () {
- console.log('close')
+ console.log('close');
+ $("#OnIdentify").removeClass("annotationtoolbartab");
+ $("#DrawMode").removeClass("annotationtoolbartab");
+ $('.btnCursor').removeClass('activebtncolor');
+ $("#annotationButton").removeClass("active");
+ $("#annotationToolBarOptions").removeClass("active");
+
+
$(".annotationTollbar").css("display", "none");
$rootScope.isAnnotationWindowClose = true;
$("#canvasPaint").css("display", "none");
@@ -133,6 +147,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
$rootScope.OnIdentifyClick = function () {
+
+ $("#OnIdentify").addClass("annotationtoolbartab");
+ $("#DrawMode").removeClass("annotationtoolbartab");
// $rootScope.isIdetifyClicked = true;
// $rootScope.isDrawingToolSelected = false;
$("#canvasPaint").css("display", "none");
@@ -147,7 +164,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
$rootScope.DrawingMode = function () {
-
+ $("#OnIdentify").removeClass("annotationtoolbartab");
+ $("#DrawMode").addClass("annotationtoolbartab");
$('.btnCursor').addClass('activebtncolor');
$rootScope.switchCanvas();
$("#canvasPaint").css("display", "block");
@@ -155,25 +173,46 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
+ // Dissectible Anatomy > Settings should be disable if Annotation is Open.
+ $rootScope.ShowSettingWindow = function () {
+ if ($(".annotationTollbar").css("display") == "block") {
+ // alert("already open");
+ }
+ else {
+ $('#modal-settings').modal('toggle');
+ }
+
+
+ }
+
//----Annotation Toolbar: Jcanvas-----
-
- $rootScope.DrawLine = function (e) {
+
+ $rootScope.DrLine = function (e) {
+ $rootScope.setListManagerZindex = true;
+ $("#canvasPaint").css("display", "block");
+ $("#canvas").css("display", "block");
+
$rootScope.switchCanvas();
$rootScope.shapeType = "Line";
-
+
$('.btnCursor').removeClass('activebtncolor');
- $(".btn-annotation").removeClass("activebtncolor");
- $(".btn-annotation-line").addClass("activebtncolor");
+ $(".btn-annotation").removeClass("activebtncolor");
+ $(".btn-annotation-line").addClass("activebtncolor");
}
- $rootScope.DrawPin = function (e) {
+ $rootScope.DrPin = function (e) {
+ $("#canvasPaint").css("display", "block");
+ $("#canvas").css("display", "block");
+
$rootScope.switchCanvas();
+ $rootScope.switchCanvas();
+ $rootScope.setListManagerZindex = true;
$rootScope.shapeType = "Pin";
$('.btnCursor').removeClass('activebtncolor');
@@ -190,7 +229,9 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
$('.btnCursor').addClass('activebtncolor');
}
+
$rootScope.DrawRectangle = function (e) {
+ $rootScope.setListManagerZindex = true;
$("#canvasPaint").css("display", "block");
$("#canvas").css("display", "block");
$rootScope.switchCanvas();
@@ -202,6 +243,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
$rootScope.paintBrush = function () {
// debugger;
// $('.btnCursor').addClass('activebtncolor');
+ $rootScope.setListManagerZindex = true;
$("#canvasPaint").css("display", "block");
$("#canvas").css("display", "block");
$rootScope.switchCanvasToPaintCanvas();
@@ -237,6 +279,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
$rootScope.DrawCircle = function (e) {
+ $rootScope.setListManagerZindex = true;
$("#canvasPaint").css("display", "block");
$("#canvas").css("display", "block");
$rootScope.switchCanvas();
@@ -247,6 +290,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
$rootScope.DrawArrow = function (e) {
+ $rootScope.setListManagerZindex = true;
$("#canvasPaint").css("display", "block");
$("#canvas").css("display", "block");
$rootScope.switchCanvas();
@@ -256,6 +300,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
$(".btn-annotation-arrow").addClass("activebtncolor");
}
$rootScope.DrawText = function () {
+ $rootScope.setListManagerZindex = true;
$("#canvasPaint").css("display", "block");
$("#canvas").css("display", "block");
$rootScope.switchCanvas();
@@ -269,6 +314,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
}
$rootScope.DrawPolygon = function () {
+ $rootScope.setListManagerZindex = true;
$("#canvasPaint").css("display", "block");
$("#canvas").css("display", "block");
$rootScope.shapeType = "DrawPolygon";
@@ -331,6 +377,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
// $("#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"});
}
@@ -339,13 +387,38 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
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");
+ $('#slider-range-min-4 div.ui-slider-range-min').css("width", (previewOpacity*100) + "%");
+ $('#slider-range-min-4 span.ui-slider-handle').css("left", (previewOpacity * 100) + "%");
+
+ };
+ }
+
+
+ $rootScope.enableEditShapeTooltip = function () {
+
+ $("#edit-block").addClass("custom-tooltip-annotation");
+ $(".custom-tooltip-annotation").css('display', 'block');
}
+ $rootScope.disableEditShapeTooltip = function () {
+
+ $(".custom-tooltip-annotation").css('display', 'none');
+ $("#edit-block").removeClass("custom-tooltip-annotation");
+
+
+ }
+
+
$rootScope.disableAnnotationToolBar = function () {
document.getElementById('modelbackground').style.display = "none";
document.getElementById('modeleditstyle').style.display = "none";
+ //Edit Shape Style popup should open at it's default position
+ $("#modeleditstyle").css({"left":"40%", "right":"0", "top":"70px"});
+
}
@@ -434,9 +507,11 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
//list manager function
//list manager function
-
+
+ $rootScope.disableAnnotationtoolOnListManager = false;
$rootScope.ShowListManager = function () {
console.log('ShowListManager')
+ $rootScope.disableAnnotationtoolOnListManager = true;
$rootScope.isLoading = true;
$('#spinner').css('visibility', 'visible');
@@ -453,6 +528,12 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
$rootScope.CloseListManager = function () {
console.log('close')
+
+ $rootScope.disableAnnotationtoolOnListManager = false;
+ if ($rootScope.disableAnnotationtoolOnListManager == false) {
+ $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
+ $('#slider-range-min-2').slider('enable');
+ }
//$rootScope.isListManagerSelected = false;
$('#listManager').css('display', 'none');
$("#listManager").css("visibility", "hidden");
@@ -616,7 +697,16 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
//localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty);
//4.
- $rootScope.reloadChildController();
+ //$rootScope.reloadChildController();
+
+ var len = $rootScope.openModules.length;
+ if (len > 0) {
+ $rootScope.reloadChildController();
+ }
+ else
+ {
+ $('#modal-settings').modal('hide');
+ }
};
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html
index 9124005..e348377 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html
+++ b/400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html
@@ -4,7 +4,7 @@
-
+
-
+
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html
index 88551d6..149e0ed 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html
+++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html
@@ -6,7 +6,7 @@
-
Display Image By
+
Display Animation By
-
+
-
+
@@ -88,7 +88,7 @@
- No animation found for the selected search criteria!
+ No animation found for the selected search criteria!
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html
index 14f41b1..e9a0cfb 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html
+++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html
@@ -59,32 +59,33 @@
-->
-
+
+
+
@@ -143,7 +144,7 @@
- No illustration found for the selected search criteria!
+ No illustration found for the selected search criteria!
diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
index 2803e64..4a2c408 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
+++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
@@ -54,6 +54,7 @@
.tooltip-custom + .tooltip > .tooltip-arrow {
display: none;
}
+
.customTooltip {
background: #333 !important;
color: #fff !important;
@@ -142,37 +143,37 @@
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -233,14 +285,15 @@