Commit aa477e2adcee041cdf22865681917541c07ee7df

Authored by unknown
1 parent 7be22d6b

Refactor Code

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
165 //get the DA body view list based on selected gender 165 //get the DA body view list based on selected gender
166 $scope.getDAViewList = function ($event) { 166 $scope.getDAViewList = function ($event) {
167 167
168 - // debugger; 168 +
169 if ($('#MainImage') != null) { 169 if ($('#MainImage') != null) {
170 $('#MainImage').remove(); 170 $('#MainImage').remove();
171 } 171 }
@@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
244 } 244 }
245 245
246 $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; 246 $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
247 - // debugger; 247 +
248 248
249 var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >' 249 var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >'
250 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >' 250 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >'
@@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
265 265
266 266
267 $scope.openView = function ($event) { 267 $scope.openView = function ($event) {
268 - // debugger; 268 +
269 $rootScope.isLoading = true; 269 $rootScope.isLoading = true;
270 $('#spinner').css('visibility', 'visible'); 270 $('#spinner').css('visibility', 'visible');
271 271
@@ -623,8 +623,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -623,8 +623,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
623 623
624 624
625 $scope.LoadDefaultLayerImage = function () { 625 $scope.LoadDefaultLayerImage = function () {
626 - // debugger;  
627 - 626 +
628 $rootScope.isNormalMode = true; 627 $rootScope.isNormalMode = true;
629 628
630 $scope.layerNumber = 0; 629 $scope.layerNumber = 0;
@@ -6171,7 +6170,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6171,7 +6170,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6171 x2: $scope.x, y2: $scope.y, 6170 x2: $scope.x, y2: $scope.y,
6172 6171
6173 click: function (layer) { 6172 click: function (layer) {
6174 - // debugger; 6173 +
6175 $rootScope.shapeTypePin = "Pin"; 6174 $rootScope.shapeTypePin = "Pin";
6176 $rootScope.canvasLayerNameCollection = []; 6175 $rootScope.canvasLayerNameCollection = [];
6177 var pinLine_layer = layer.name; 6176 var pinLine_layer = layer.name;
@@ -6195,9 +6194,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6195,9 +6194,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6195 6194
6196 }, 6195 },
6197 mouseout: function (layer) { 6196 mouseout: function (layer) {
6198 - // $rootScope.resetPinArc = "";  
6199 - // ax = "";  
6200 - 6197 +
6201 $rootScope.canvasLayerNameCollection = []; 6198 $rootScope.canvasLayerNameCollection = [];
6202 $('#canvas').setLayer(layer.name, { 6199 $('#canvas').setLayer(layer.name, {
6203 handle: { 6200 handle: {
@@ -6260,7 +6257,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6260,7 +6257,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6260 $('.btnCursor').addClass('activebtncolor'); 6257 $('.btnCursor').addClass('activebtncolor');
6261 break; 6258 break;
6262 case "TextArea": 6259 case "TextArea":
6263 - $rootScope.isTrue = false; 6260 + $rootScope.IsTextAlreadySave = false;
6264 $("#text_area").val(''); 6261 $("#text_area").val('');
6265 // Draw text 6262 // Draw text
6266 $rootScope.resetTextRect = $rootScope.ObjectIndex++; 6263 $rootScope.resetTextRect = $rootScope.ObjectIndex++;
@@ -6368,14 +6365,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6368,14 +6365,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6368 $rootScope.underlineText; 6365 $rootScope.underlineText;
6369 $rootScope.textArea; 6366 $rootScope.textArea;
6370 $rootScope.fontFamily; 6367 $rootScope.fontFamily;
6371 - $rootScope.TextAreaStyleProp = []; 6368 + $rootScope.TextPropertyArray = [];
6372 $rootScope.modifySavedText = []; 6369 $rootScope.modifySavedText = [];
6373 $rootScope.TextRectangleArr = []; 6370 $rootScope.TextRectangleArr = [];
6374 $rootScope.rectDimension = []; 6371 $rootScope.rectDimension = [];
6375 6372
  6373 +
  6374 + // will refactor this code later
  6375 +
  6376 +
6376 $rootScope.saveText = function () { 6377 $rootScope.saveText = function () {
6377 - debugger;  
6378 - if ($rootScope.isTrue == false) { 6378 + // this part will work first time when save button will be clicked
  6379 + if ($rootScope.IsTextAlreadySave == false) {
  6380 + // getting textarea style properties
6379 $rootScope.fontSizes = $("#text_area").css("font-size"); 6381 $rootScope.fontSizes = $("#text_area").css("font-size");
6380 $rootScope.fontWeight = $("#text_area").css("font-weight"); 6382 $rootScope.fontWeight = $("#text_area").css("font-weight");
6381 $rootScope.fontStyle = $("#text_area").css("font-style"); 6383 $rootScope.fontStyle = $("#text_area").css("font-style");
@@ -6384,10 +6386,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6384,10 +6386,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6384 $rootScope.fontFamily = $("#text_area").css("font-family"); 6386 $rootScope.fontFamily = $("#text_area").css("font-family");
6385 $rootScope.underlineText = $("#text_area").css("text-decoration"); 6387 $rootScope.underlineText = $("#text_area").css("text-decoration");
6386 $rootScope.textArea = $("#text_area").val(); 6388 $rootScope.textArea = $("#text_area").val();
6387 - 6389 +
  6390 + // deleting previous text area
  6391 +
6388 $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); 6392 $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
6389 $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); 6393 $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
6390 - 6394 +
  6395 + // Text After Saving in Rectangle
6391 $('#canvas').drawText({ 6396 $('#canvas').drawText({
6392 layer: true, 6397 layer: true,
6393 draggable: true, 6398 draggable: true,
@@ -6404,24 +6409,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6404,24 +6409,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6404 x: $scope.offsetX1, y: $scope.offsetY1, 6409 x: $scope.offsetX1, y: $scope.offsetY1,
6405 maxWidth: $scope.x - $scope.offsetX1, 6410 maxWidth: $scope.x - $scope.offsetX1,
6406 maxHeight: $scope.y - $scope.offsetY1, 6411 maxHeight: $scope.y - $scope.offsetY1,
6407 -  
6408 add: function (layer) { 6412 add: function (layer) {
6409 -  
6410 - $rootScope.TextAreaStyleProp.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });  
6411 - $rootScope.TextAreaStyleProp.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });  
6412 -  
6413 - // $rootScope.TextAreaStyleProp.push({ Text: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });  
6414 - // $rootScope.TextAreaStyleProp.push({ Text: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });  
6415 -  
6416 -  
6417 - },  
6418 -  
6419 - change: function (layer, props) {  
6420 -  
6421 - }  
6422 -  
6423 - })  
6424 - // Draw rect as wide as the text 6413 + $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
  6414 + $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });
  6415 + }
  6416 + })
  6417 + // Draw rectangle
6425 .drawRect({ 6418 .drawRect({
6426 name: 'TextArea1_' + $rootScope.resetText, 6419 name: 'TextArea1_' + $rootScope.resetText,
6427 layer: true, 6420 layer: true,
@@ -6431,30 +6424,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6431,30 +6424,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6431 opacity: $rootScope.shapestyleOpacity, 6424 opacity: $rootScope.shapestyleOpacity,
6432 strokeStyle: $rootScope.shapestyleborderColor, 6425 strokeStyle: $rootScope.shapestyleborderColor,
6433 strokeWidth: $rootScope.shapestyleborderWidth, 6426 strokeWidth: $rootScope.shapestyleborderWidth,
6434 -  
6435 x: $scope.offsetX1, y: $scope.offsetY1, 6427 x: $scope.offsetX1, y: $scope.offsetY1,
6436 width: $scope.x - $scope.offsetX1, 6428 width: $scope.x - $scope.offsetX1,
6437 height: $scope.y - $scope.offsetY1, 6429 height: $scope.y - $scope.offsetY1,
6438 - add: function (layer) {  
6439 -  
6440 - },  
6441 click: function (layer) { 6430 click: function (layer) {
6442 $rootScope.shapeTypeText = "textAreaRect"; 6431 $rootScope.shapeTypeText = "textAreaRect";
6443 - 6432 +
6444 var layerNameSplit = layer.name; 6433 var layerNameSplit = layer.name;
6445 -  
6446 var splitedName = layerNameSplit.split("_"); 6434 var splitedName = layerNameSplit.split("_");
6447 -  
6448 var textValName = "TextArea_"; 6435 var textValName = "TextArea_";
6449 -  
6450 var concatinateResult = textValName.concat(splitedName[1]); 6436 var concatinateResult = textValName.concat(splitedName[1]);
6451 -  
6452 $rootScope.canvasLayerNameCollection = []; 6437 $rootScope.canvasLayerNameCollection = [];
6453 $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); 6438 $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
6454 -  
6455 -  
6456 -  
6457 - $('#canvas').setLayer(layer.name, { 6439 + $('#canvas').setLayer(layer.name, {
6458 handle: { 6440 handle: {
6459 type: 'rectangle', 6441 type: 'rectangle',
6460 fillStyle: '#fff', 6442 fillStyle: '#fff',
@@ -6464,45 +6446,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6464,45 +6446,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6464 cornerRadius: 3 6446 cornerRadius: 3
6465 } 6447 }
6466 }).drawLayers(); 6448 }).drawLayers();
6467 -  
6468 }, 6449 },
6469 dblclick: function (layer) { 6450 dblclick: function (layer) {
6470 - // debugger;  
6471 - $rootScope.isTrue = true;  
6472 - 6451 + $rootScope.IsTextAlreadySave = true;
  6452 +
6473 var _rectLayerOnSave = layer.name; 6453 var _rectLayerOnSave = layer.name;
6474 var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); 6454 var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
6475 - var str1 = "TextArea_";  
6476 - var res = str1.concat(_rectLayerOnSaveSplit[1]);  
6477 -  
6478 - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: res}); 6455 + var TextAreaRectName = "TextArea_";
  6456 + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
  6457 + $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
6479 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); 6458 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
6480 -  
6481 var _rectLayerOnSaveSplitInt; 6459 var _rectLayerOnSaveSplitInt;
6482 if (_rectLayerOnSaveSplit[1] >= 3) 6460 if (_rectLayerOnSaveSplit[1] >= 3)
6483 _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); 6461 _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
6484 else 6462 else
6485 _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); 6463 _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
6486 -  
6487 - var b = $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].Text1; 6464 + var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
6488 $("#text_area").val(b); 6465 $("#text_area").val(b);
6489 - // alert($rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].FontSize);  
6490 -  
6491 - $("#text_area").css("font-size", $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].FontSize);  
6492 - $("#text_area").css("font-weight", $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].FontStyle);  
6493 - $("#text_area").css("font-style", $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].FontStyle);  
6494 - $("#text_area").css("text-align", $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].Align);  
6495 - $("#text_area").css("color", $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].FontColor);  
6496 - $("#text_area").css("font-family", $rootScope.TextAreaStyleProp[_rectLayerOnSaveSplitInt].FontFamily); 6466 + $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
  6467 + $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
  6468 + $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
  6469 + $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);
  6470 + $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);
  6471 + $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);
6497 $("#text_area").css("text-decoration", $rootScope.underlineText); 6472 $("#text_area").css("text-decoration", $rootScope.underlineText);
6498 -  
6499 -  
6500 _rectLayerOnSaveSplitInt = ''; b = ''; 6473 _rectLayerOnSaveSplitInt = ''; b = '';
6501 $("#annotationTextModal").modal("toggle"); 6474 $("#annotationTextModal").modal("toggle");
6502 -  
6503 }, 6475 },
6504 mouseout: function (layer) { 6476 mouseout: function (layer) {
6505 -  
6506 $rootScope.canvasLayerNameCollection = []; 6477 $rootScope.canvasLayerNameCollection = [];
6507 $('#canvas').setLayer(layer.name, { 6478 $('#canvas').setLayer(layer.name, {
6508 handle: { 6479 handle: {
@@ -6513,13 +6484,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6513,13 +6484,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6513 width: 0, height: 0, 6484 width: 0, height: 0,
6514 cornerRadius: 0 6485 cornerRadius: 0
6515 } 6486 }
6516 -  
6517 }).drawLayers(); 6487 }).drawLayers();
6518 - // $rootScope.textss = '';  
6519 -  
6520 }, 6488 },
6521 mouseover: function (layer) { 6489 mouseover: function (layer) {
6522 -  
6523 $('#canvas').setLayer(layer.name, { 6490 $('#canvas').setLayer(layer.name, {
6524 handle: { 6491 handle: {
6525 type: 'rectangle', 6492 type: 'rectangle',
@@ -6537,10 +6504,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6537,10 +6504,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6537 $("#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" }); 6504 $("#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" });
6538 6505
6539 } 6506 }
6540 - else {  
6541 - // debugger;  
6542 -  
6543 6507
  6508 +// this part will work second time when save button will be clicked
  6509 + else {
  6510 + // getting textarea style properties
6544 var _modifiedText = $("#text_area").val(); 6511 var _modifiedText = $("#text_area").val();
6545 var _modifiedFontSize = $("#text_area").css("font-size"); 6512 var _modifiedFontSize = $("#text_area").css("font-size");
6546 var _modifiedFontWeight = $("#text_area").css("font-weight"); 6513 var _modifiedFontWeight = $("#text_area").css("font-weight");
@@ -6550,19 +6517,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6550,19 +6517,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6550 var _modifiedFontFamily = $("#text_area").css("font-family"); 6517 var _modifiedFontFamily = $("#text_area").css("font-family");
6551 var _modifiedFontDecoration = $("#text_area").css("text-decoration"); 6518 var _modifiedFontDecoration = $("#text_area").css("text-decoration");
6552 6519
  6520 + // deleting previous textarea
6553 $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers(); 6521 $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers();
6554 $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers(); 6522 $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers();
6555 -  
6556 $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++; 6523 $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
6557 $rootScope.resetTextSave = $rootScope.ObjectIndexSave++; 6524 $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
6558 - // alert($rootScope.resetText);  
6559 - // alert('TextArea12_' + $rootScope.resetTextSave); 6525 +
  6526 + // generating new text area
6560 $('#canvas').drawText({ 6527 $('#canvas').drawText({
6561 layer: true, 6528 layer: true,
6562 draggable: true, 6529 draggable: true,
6563 - name: 'TextArea12_' + $rootScope.resetTextSave,  
6564 - groups: ['TextArea12_' + $rootScope.resetTextSave],  
6565 - dragGroups: ['TextArea12_' + $rootScope.resetTextSave], 6530 + name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,
  6531 + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  6532 + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6566 fillStyle: _modifiedFontColor, 6533 fillStyle: _modifiedFontColor,
6567 fontStyle: _modifiedFontStyle, 6534 fontStyle: _modifiedFontStyle,
6568 fontSize: _modifiedFontSize, 6535 fontSize: _modifiedFontSize,
@@ -6572,49 +6539,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6572,49 +6539,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6572 text: _modifiedText, 6539 text: _modifiedText,
6573 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, 6540 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
6574 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, 6541 maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
6575 - maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,  
6576 -  
6577 - add: function (layer) {  
6578 -  
6579 -  
6580 -  
6581 - },  
6582 -  
6583 - change: function (layer, props) {  
6584 -  
6585 - } 6542 + maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height
6586 6543
6587 }) 6544 })
6588 // Draw rect as wide as the text 6545 // Draw rect as wide as the text
6589 .drawRect({ 6546 .drawRect({
6590 - name: 'TextArea13_' + $rootScope.resetTextSave, 6547 + name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,
6591 layer: true, 6548 layer: true,
6592 draggable: true, 6549 draggable: true,
6593 - groups: ['TextArea12_' + $rootScope.resetTextSave],  
6594 - dragGroups: ['TextArea12_' + $rootScope.resetTextSave], 6550 + groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
  6551 + dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6595 opacity: $rootScope.shapestyleOpacity, 6552 opacity: $rootScope.shapestyleOpacity,
6596 strokeStyle: $rootScope.shapestyleborderColor, 6553 strokeStyle: $rootScope.shapestyleborderColor,
6597 strokeWidth: $rootScope.shapestyleborderWidth, 6554 strokeWidth: $rootScope.shapestyleborderWidth,
6598 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y, 6555 x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
6599 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width, 6556 width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
6600 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height, 6557 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
6601 -  
6602 click: function (layer) { 6558 click: function (layer) {
6603 $rootScope.shapeTypeText = "textAreaRect"; 6559 $rootScope.shapeTypeText = "textAreaRect";
6604 -  
6605 var layerNameSplit = layer.name; 6560 var layerNameSplit = layer.name;
6606 -  
6607 var splitedName = layerNameSplit.split("_"); 6561 var splitedName = layerNameSplit.split("_");
6608 -  
6609 - var textValName = "TextArea12_";  
6610 -  
6611 - var concatinateResult = textValName.concat(splitedName[1]);  
6612 -  
6613 - $rootScope.canvasLayerNameCollection = []; 6562 + var textValName = "TextAreaAfterEdit_";
  6563 + var concatinateResult = textValName.concat(splitedName[1]);
  6564 + $rootScope.canvasLayerNameCollection = [];
6614 $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult }); 6565 $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
6615 6566
6616 -  
6617 -  
6618 $('#canvas').setLayer(layer.name, { 6567 $('#canvas').setLayer(layer.name, {
6619 handle: { 6568 handle: {
6620 type: 'rectangle', 6569 type: 'rectangle',
@@ -6629,31 +6578,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6629,31 +6578,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6629 }, 6578 },
6630 dblclick: function (layer) { 6579 dblclick: function (layer) {
6631 6580
6632 - $rootScope.isTrue = true;  
6633 - 6581 + $rootScope.IsTextAlreadySave = true;
6634 var _rectLayerOnSave = layer.name; 6582 var _rectLayerOnSave = layer.name;
6635 var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); 6583 var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
6636 - var str1 = "TextArea12_";  
6637 - var res = str1.concat(_rectLayerOnSaveSplit[1]);  
6638 -  
6639 - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: res }); 6584 + var RectNameAfterEdit = "TextAreaAfterEdit_";
  6585 + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
  6586 + $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
6640 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); 6587 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
6641 -  
6642 - $("#text_area").val(_modifiedText);  
6643 - $("#text_area").css("font-size", _modifiedFontSize);  
6644 - $("#text_area").css("font-weight", _modifiedFontWeight); 6588 + $("#text_area").val(_modifiedText);
  6589 + $("#text_area").css("font-size", _modifiedFontSize);
  6590 + $("#text_area").css("font-weight", _modifiedFontWeight);
6645 $("#text_area").css("font-style", _modifiedFontStyle); 6591 $("#text_area").css("font-style", _modifiedFontStyle);
6646 $("#text_area").css("text-align", _modifiedTextAlign); 6592 $("#text_area").css("text-align", _modifiedTextAlign);
6647 $("#text_area").css("color", _modifiedFontColor); 6593 $("#text_area").css("color", _modifiedFontColor);
6648 $("#text_area").css("font-family", _modifiedFontFamily); 6594 $("#text_area").css("font-family", _modifiedFontFamily);
6649 $("#text_area").css("text-decoration", _modifiedFontDecoration); 6595 $("#text_area").css("text-decoration", _modifiedFontDecoration);
6650 -  
6651 -  
6652 $("#annotationTextModal").modal("toggle"); 6596 $("#annotationTextModal").modal("toggle");
6653 -  
6654 }, 6597 },
6655 mouseout: function (layer) { 6598 mouseout: function (layer) {
6656 -  
6657 $rootScope.canvasLayerNameCollection = []; 6599 $rootScope.canvasLayerNameCollection = [];
6658 $('#canvas').setLayer(layer.name, { 6600 $('#canvas').setLayer(layer.name, {
6659 handle: { 6601 handle: {
@@ -6664,13 +6606,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6664,13 +6606,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6664 width: 0, height: 0, 6606 width: 0, height: 0,
6665 cornerRadius: 0 6607 cornerRadius: 0
6666 } 6608 }
6667 -  
6668 }).drawLayers(); 6609 }).drawLayers();
6669 -  
6670 }, 6610 },
6671 mouseover: function (layer) { 6611 mouseover: function (layer) {
6672 -  
6673 - $('#canvas').setLayer(layer.name, { 6612 + $('#canvas').setLayer(layer.name, {
6674 handle: { 6613 handle: {
6675 type: 'rectangle', 6614 type: 'rectangle',
6676 fillStyle: '#fff', 6615 fillStyle: '#fff',
@@ -6686,18 +6625,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6686,18 +6625,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6686 $rootScope.modifySavedText = []; 6625 $rootScope.modifySavedText = [];
6687 6626
6688 } 6627 }
6689 - }  
6690 - 6628 + }
  6629 +
  6630 + // deleting text area on close button
6691 $rootScope.closeModal = function () { 6631 $rootScope.closeModal = function () {
6692 - debugger;  
6693 -  
6694 -  
6695 6632
6696 $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers(); 6633 $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
6697 $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers(); 6634 $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
6698 6635
6699 -  
6700 - } 6636 + }
6701 6637
6702 6638
6703 function OnPaintCanvasMouseMove(event) { 6639 function OnPaintCanvasMouseMove(event) {
@@ -6706,13 +6642,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6706,13 +6642,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6706 } 6642 }
6707 6643
6708 $rootScope.FreeStylePaint = function (e) { 6644 $rootScope.FreeStylePaint = function (e) {
6709 - // debugger;  
6710 -  
6711 -  
6712 - // $rootScope.shapeType = "FreeStylePaint";  
6713 - // canvasPaint.addEventListener('mouseup', $scope.OnPaintBrushCanvasMouseUp, false);  
6714 - // canvasPaint.addEventListener('mousedown', $scope.OnPaintBrushCanvasMouseDown, false);  
6715 - 6645 +
6716 6646
6717 } 6647 }
6718 $scope.OnPaintBrushCanvasMouseDown = function (event) { 6648 $scope.OnPaintBrushCanvasMouseDown = function (event) {
@@ -6720,7 +6650,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6720,7 +6650,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6720 6650
6721 case "FreeStylePaint": 6651 case "FreeStylePaint":
6722 6652
6723 - debugger; 6653 +
6724 6654
6725 // $('#canvasPaint').sketch(); 6655 // $('#canvasPaint').sketch();
6726 // $('#canvasPaint').sketch({ defaultSize: 1 }); 6656 // $('#canvasPaint').sketch({ defaultSize: 1 });
@@ -6753,8 +6683,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6753,8 +6683,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6753 6683
6754 // case "FreeStylePaint": 6684 // case "FreeStylePaint":
6755 6685
6756 - // debugger;  
6757 - 6686 +
6758 // if ($("#amount-2").val() == '') 6687 // if ($("#amount-2").val() == '')
6759 // { 6688 // {
6760 // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); 6689 // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
@@ -6782,7 +6711,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6782,7 +6711,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6782 6711
6783 6712
6784 if (event.which == 46) { 6713 if (event.which == 46) {
6785 - //debugger; 6714 +
6786 if ($rootScope.shapeTypePin == "Pin") { 6715 if ($rootScope.shapeTypePin == "Pin") {
6787 6716
6788 6717
@@ -7166,7 +7095,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7166,7 +7095,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7166 7095
7167 //list manager 7096 //list manager
7168 $scope.$on('listManagerEvent', function (event, data) { 7097 $scope.$on('listManagerEvent', function (event, data) {
7169 - // debugger; 7098 +
7170 $('#spinner').css('visibility', 'visible'); 7099 $('#spinner').css('visibility', 'visible');
7171 console.log('listManagerEvent') 7100 console.log('listManagerEvent')
7172 if ($rootScope.islistManagerEventAlredayDispachted == true) { 7101 if ($rootScope.islistManagerEventAlredayDispachted == true) {
@@ -7301,7 +7230,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7301,7 +7230,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7301 $scope.HighlightBodyOnListManagerSelection = function (event) { 7230 $scope.HighlightBodyOnListManagerSelection = function (event) {
7302 7231
7303 $scope.terminateCurrentlyRunningWPs(); 7232 $scope.terminateCurrentlyRunningWPs();
7304 - //debugger 7233 +
7305 $rootScope.isListManagerSelected = true; 7234 $rootScope.isListManagerSelected = true;
7306 $rootScope.isLoading = true; 7235 $rootScope.isLoading = true;
7307 7236