Commit 08852b21f2e716348a1e3d592b02f97d15b8a2ef

Authored by unknown
1 parent a6aad71e

AnnotationEditTextAreaFunctionalityIssue

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -6705,6 +6705,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6705 6705 x: $scope.offsetX1, y: $scope.offsetY1,
6706 6706 width: $scope.x - $scope.offsetX1,
6707 6707 height: $scope.y - $scope.offsetY1,
  6708 + add: function (layer) {
  6709 +
  6710 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  6711 +
  6712 + },
6708 6713 click: function (layer) {
6709 6714  
6710 6715 $rootScope.canvasLayerNameCollection = [];
... ... @@ -6721,6 +6726,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6721 6726 }).drawLayers();
6722 6727  
6723 6728 },
  6729 + dblclick: function (layer) {
  6730 +
  6731 +
  6732 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  6733 + $("#annotationTextModal").modal("toggle");
  6734 +
  6735 + $("#text_area").val('');
  6736 + $("#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" });
  6737 +
  6738 +
  6739 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  6740 +
  6741 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  6742 +
  6743 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  6744 +
  6745 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  6746 +
  6747 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  6748 +
  6749 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  6750 +
  6751 + },
6724 6752 mouseout: function (layer) {
6725 6753 $rootScope.canvasLayerNameCollection = [];
6726 6754 $('#canvas').setLayer(layer.name, {
... ... @@ -6755,25 +6783,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6755 6783  
6756 6784 $("#annotationTextModal").modal("toggle");
6757 6785 $('.btnCursor').trigger('click');
6758   -
  6786 +
6759 6787 $("#text_area").val('');
6760   -
  6788 +
6761 6789 $("#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" });
6762   -
6763   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
6764   -
6765   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
6766   -
6767   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
6768   -
6769   - $("#text-left").removeClass("ActiveFormattingButtonClass");
6770   -
6771   - $("#text-right").removeClass("ActiveFormattingButtonClass");
6772   -
6773   - $("#text-center").removeClass("ActiveFormattingButtonClass");
6774   -
  6790 +
  6791 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  6792 +
  6793 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  6794 +
  6795 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  6796 +
  6797 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  6798 +
  6799 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  6800 +
  6801 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  6802 +
6775 6803 $(".btn-annotation").removeClass("activebtncolor");
6776   -
  6804 +
6777 6805 $('.btnCursor').addClass('activebtncolor');
6778 6806 break;
6779 6807  
... ... @@ -6807,6 +6835,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6807 6835  
6808 6836  
6809 6837 $rootScope.saveText = function () {
  6838 +
6810 6839 // this part will work first time when save button will be clicked
6811 6840 if ($rootScope.IsTextAlreadySave == false) {
6812 6841 // getting textarea style properties
... ... @@ -6828,9 +6857,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6828 6857 $('#canvas').drawText({
6829 6858 layer: true,
6830 6859 draggable: true,
6831   - name: 'TextArea_' + $rootScope.resetText,
6832   - groups: ['TextArea_' + $rootScope.resetText],
6833   - dragGroups: ['TextArea_' + $rootScope.resetText],
  6860 + name: 'TextAreaNew_' + $rootScope.resetText,
  6861 + groups: ['TextAreaNew_' + $rootScope.resetText],
  6862 + dragGroups: ['TextAreaNew_' + $rootScope.resetText],
6834 6863 fillStyle: $rootScope.fontColor,
6835 6864 fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle,
6836 6865 fontSize: $rootScope.fontSizes,
... ... @@ -6838,10 +6867,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6838 6867 align: $rootScope.textAlignmt,
6839 6868 strokeWidth: 0,
6840 6869 text: $rootScope.textArea,
6841   - x: $scope.offsetX1, y: $scope.offsetY1,
6842   - maxWidth: $scope.x - $scope.offsetX1,
6843   - maxHeight: $scope.y - $scope.offsetY1,
  6870 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  6871 + maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
  6872 + maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
6844 6873 add: function (layer) {
  6874 + // alert(layer.maxWidth);
6845 6875 $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
6846 6876 $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText });
6847 6877 }
... ... @@ -6851,20 +6881,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6851 6881 name: 'TextArea1_' + $rootScope.resetText,
6852 6882 layer: true,
6853 6883 draggable: true,
6854   - groups: ['TextArea_' + $rootScope.resetText],
6855   - dragGroups: ['TextArea_' + $rootScope.resetText],
  6884 + groups: ['TextAreaNew_' + $rootScope.resetText],
  6885 + dragGroups: ['TextAreaNew_' + $rootScope.resetText],
6856 6886 opacity: $rootScope.shapestyleOpacity,
6857 6887 strokeStyle: $rootScope.shapestyleborderColor,
6858 6888 strokeWidth: $rootScope.shapestyleborderWidth,
6859   - x: $scope.offsetX1, y: $scope.offsetY1,
6860   - width: $scope.x - $scope.offsetX1,
6861   - height: $scope.y - $scope.offsetY1,
  6889 + x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,
  6890 + width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,
  6891 + height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
6862 6892 click: function (layer) {
6863 6893 $rootScope.shapeTypeText = "textAreaRect";
6864 6894  
6865 6895 var layerNameSplit = layer.name;
6866 6896 var splitedName = layerNameSplit.split("_");
6867   - var textValName = "TextArea_";
  6897 + var textValName = "TextAreaNew_";
6868 6898 var concatinateResult = textValName.concat(splitedName[1]);
6869 6899 $rootScope.canvasLayerNameCollection = [];
6870 6900 $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
... ... @@ -6880,13 +6910,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6880 6910 }).drawLayers();
6881 6911 },
6882 6912 dblclick: function (layer) {
  6913 +
  6914 + $rootScope.isTextAreaClosedButtonActive = false;
6883 6915 $rootScope.IsTextAlreadySave = true;
6884 6916  
6885 6917 var _rectLayerOnSave = layer.name;
6886 6918 var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
6887   - var TextAreaRectName = "TextArea_";
  6919 + var TextAreaRectName = "TextAreaNew_";
6888 6920 var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
6889   - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
  6921 +
  6922 + $rootScope.layerNameArr = layer.name;
  6923 + $rootScope.rectTextArr = TextAreaRectNameConcatenated;
  6924 + // $rootScope.modifySavedText.push({ TextName: '', RectText: ''});
  6925 + // $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
  6926 +
6890 6927 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
6891 6928 var _rectLayerOnSaveSplitInt;
6892 6929 //if (_rectLayerOnSaveSplit[1] >= 3)
... ... @@ -6895,11 +6932,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6895 6932 // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
6896 6933  
6897 6934 _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
  6935 +
6898 6936 var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
6899 6937 $("#text_area").val(b);
6900 6938 var fontStyleProp = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle;
6901   - var fontWeightProp = fontStyleProp.split(" ");
6902   -
  6939 + var fontWeightProp = fontStyleProp.split(" ");
  6940 +
6903 6941 $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
6904 6942 $("#text_area").css("font-weight", fontWeightProp[0]);
6905 6943 $("#text_area").css("font-style", fontWeightProp[1]);
... ... @@ -6912,96 +6950,89 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6912 6950  
6913 6951  
6914 6952 //adding text text decoration active class in text edit pop-up
6915   -
6916   - if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration == "underline") {
6917   -
6918   - $("#text-underline").addClass("ActiveFormattingButtonClass");
6919   -
6920   - }
6921   -
6922   - else {
6923   -
6924   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
6925   -
6926   - }
6927   -
6928 6953  
6929   -
6930   - //adding text font weight active class in text edit pop-up
6931   -
6932   - if (fontWeightProp[0] == 700) {
6933   -
6934   -
6935   -
6936   - $("#text-bold").addClass("ActiveFormattingButtonClass");
6937   -
6938   - }
6939   -
6940   - else
6941   -
6942   - {
6943   -
6944   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
6945   -
  6954 + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration == "underline") {
  6955 +
  6956 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  6957 +
6946 6958 }
6947   -
6948   - //adding text font style active class in text edit pop-up
6949   -
6950   - if (fontWeightProp[1] == "italic") {
6951   -
6952   -
6953   - $("#text-italic").addClass("ActiveFormattingButtonClass");
6954   - }
6955   - else
6956   -
6957   - {
6958   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
6959   -
6960 6959  
6961   -
6962   - }
6963   -
  6960 + else {
6964 6961  
6965   -
6966   - //adding text alignment active class in text edit pop-up
6967   -
6968   - if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") {
6969   -
6970   - $("#text-right").removeClass("ActiveFormattingButtonClass");
6971   -
6972   - $("#text-center").removeClass("ActiveFormattingButtonClass")
6973   -
6974   - $("#text-left").addClass("ActiveFormattingButtonClass");
6975   -
6976   - }
6977   -
6978   - else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") {
  6962 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  6963 +
  6964 + }
6979 6965  
6980 6966  
6981 6967  
6982   - $("#text-center").removeClass("ActiveFormattingButtonClass")
  6968 + //adding text font weight active class in text edit pop-up
6983 6969  
6984   - $("#text-left").removeClass("ActiveFormattingButtonClass");
  6970 + if (fontWeightProp[0] == 700) {
6985 6971  
6986   - $("#text-right").addClass("ActiveFormattingButtonClass");
6987 6972  
6988 6973  
  6974 + $("#text-bold").addClass("ActiveFormattingButtonClass");
6989 6975  
6990   - }
  6976 + }
6991 6977  
6992   - else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") {
  6978 + else {
6993 6979  
6994   - $("#text-left").removeClass("ActiveFormattingButtonClass");
  6980 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
6995 6981  
6996   - $("#text-right").removeClass("ActiveFormattingButtonClass");
  6982 + }
6997 6983  
6998   - $("#text-center").addClass("ActiveFormattingButtonClass");
  6984 + //adding text font style active class in text edit pop-up
6999 6985  
  6986 + if (fontWeightProp[1] == "italic") {
7000 6987  
7001 6988  
7002   - }
  6989 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  6990 + }
  6991 + else {
  6992 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  6993 +
  6994 +
  6995 + }
  6996 +
  6997 + //adding text alignment active class in text edit pop-up
  6998 +
  6999 + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") {
  7000 +
  7001 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  7002 +
  7003 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  7004 +
  7005 + $("#text-left").addClass("ActiveFormattingButtonClass");
  7006 +
  7007 + }
  7008 +
  7009 + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") {
  7010 +
  7011 +
  7012 +
  7013 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  7014 +
  7015 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  7016 +
  7017 + $("#text-right").addClass("ActiveFormattingButtonClass");
  7018 +
  7019 +
  7020 +
  7021 + }
  7022 +
  7023 + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") {
  7024 +
  7025 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  7026 +
  7027 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  7028 +
  7029 + $("#text-center").addClass("ActiveFormattingButtonClass");
  7030 +
  7031 +
  7032 +
  7033 + }
  7034 +
7003 7035  
7004   -
7005 7036 _rectLayerOnSaveSplitInt = ''; b = '';
7006 7037 $("#annotationTextModal").modal("toggle");
7007 7038 },
... ... @@ -7037,22 +7068,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7037 7068  
7038 7069  
7039 7070 $("#text-italic").removeClass("ActiveFormattingButtonClass");
7040   -
7041   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
7042   -
7043   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
7044   -
7045   - $("#text-left").removeClass("ActiveFormattingButtonClass");
7046   -
7047   - $("#text-right").removeClass("ActiveFormattingButtonClass");
7048   -
7049   - $("#text-center").removeClass("ActiveFormattingButtonClass");
  7071 +
  7072 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  7073 +
  7074 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  7075 +
  7076 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  7077 +
  7078 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  7079 +
  7080 + $("#text-center").removeClass("ActiveFormattingButtonClass");
7050 7081  
7051 7082  
7052 7083 }
7053 7084  
7054 7085 // this part will work second time when save button will be clicked
7055 7086 else {
  7087 +
7056 7088 // getting textarea style properties
7057 7089 var _modifiedText = $("#text_area").val();
7058 7090 var _modifiedFontSize = $("#text_area").css("font-size");
... ... @@ -7064,8 +7096,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7064 7096 var _modifiedFontDecoration = $("#text_area").css("text-decoration");
7065 7097  
7066 7098 // deleting previous textarea
7067   - $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers();
7068   - $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers();
  7099 +
  7100 + // var a = $rootScope.modifySavedTextIndexNumber;
  7101 + // alert(a);
  7102 + // alert($rootScope.modifySavedText.length);
  7103 + // alert($rootScope.modifySavedText[a].RectText);
  7104 +
  7105 + $("#canvas").removeLayer($rootScope.layerNameArr).drawLayers();
  7106 + $("#canvas").removeLayer($rootScope.rectTextArr).drawLayers();
  7107 +
7069 7108 $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;
7070 7109 $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;
7071 7110  
... ... @@ -7124,12 +7163,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7124 7163 },
7125 7164 dblclick: function (layer) {
7126 7165  
  7166 + $rootScope.isTextAreaClosedButtonActive = false;
7127 7167 $rootScope.IsTextAlreadySave = true;
7128 7168 var _rectLayerOnSave = layer.name;
7129 7169 var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
7130 7170 var RectNameAfterEdit = "TextAreaAfterEdit_";
7131 7171 var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
7132   - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
  7172 + $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
  7173 +
  7174 +
  7175 +
  7176 + // $rootScope.modifySavedText.push({ TextName: '', RectText: '' });
  7177 + // $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });
  7178 +
  7179 + $rootScope.layerNameArr = layer.name;
  7180 + $rootScope.rectTextArr = RectNameAfterEditResult;
  7181 +
  7182 +
7133 7183 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
7134 7184 $("#text_area").val(_modifiedText);
7135 7185 $("#text_area").css("font-size", _modifiedFontSize);
... ... @@ -7192,9 +7242,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7192 7242 }
7193 7243  
7194 7244  
7195   -
7196   -
7197   -
7198 7245 $("#annotationTextModal").modal("toggle");
7199 7246 },
7200 7247 mouseout: function (layer) {
... ... @@ -7224,7 +7271,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7224 7271  
7225 7272 }
7226 7273 });
7227   - $rootScope.modifySavedText = [];
  7274 + // $rootScope.modifySavedText = [];
7228 7275  
7229 7276 }
7230 7277 }
... ... @@ -7232,8 +7279,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7232 7279 // deleting text area on close button
7233 7280 $rootScope.closeModal = function () {
7234 7281  
7235   - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
7236   - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
  7282 +
  7283 + if ($rootScope.isTextAreaClosedButtonActive == true) {
  7284 + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
  7285 + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
  7286 +
  7287 + }
7237 7288  
7238 7289 }
7239 7290  
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -605,8 +605,9 @@
605 605 <textarea class="form-control" id="text_area" rows="3" style="font-family: 'Verdana, sans-serif';font-size:14px; font-weight: normal; font-style: normal; color: #000; text-align: left; text-decoration: none;"></textarea>
606 606 </div>
607 607 <div class="modal-footer">
608   - <button type="button" class="btn btn-default" ng-click="closeModal()" data-dismiss="modal">Close</button>
609   - <button type="button" id="saveBtn" class="btn btn-primary" data-dismiss="modal" ng-click="saveText()">Save</button>
  608 + <!--<button type="button" class="btn btn-default" ng-click="closeModal()" data-dismiss="modal">Close</button>-->
  609 + <button type="button" class="btn btn-default" id="closeEditText" data-dismiss="modal">Close</button>
  610 + <button type="button" id="saveBtn" class="btn btn-primary" data-dismiss="modal" ng-click="saveText()">Save</button>
610 611 </div>
611 612 </div>
612 613 </div>
... ...