diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 3d56b4f..316ce7a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -6675,9 +6675,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#annotationTextModal").modal("toggle"); $('.btnCursor').trigger('click'); + $("#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; @@ -6736,7 +6752,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo groups: ['TextArea_' + $rootScope.resetText], dragGroups: ['TextArea_' + $rootScope.resetText], fillStyle: $rootScope.fontColor, - fontStyle: $rootScope.fontStyle, + fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle, fontSize: $rootScope.fontSizes, fontFamily: $rootScope.fontFamily, align: $rootScope.textAlignmt, @@ -6747,7 +6763,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo 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 }); + $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 @@ -6793,19 +6809,119 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $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]); + //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", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); - $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); + $("#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.underlineText); + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration); + + + + + //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"); }, @@ -6839,6 +6955,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#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"); + + } // this part will work second time when save button will be clicked @@ -6867,7 +6997,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], fillStyle: _modifiedFontColor, - fontStyle: _modifiedFontStyle, + fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle, fontSize: _modifiedFontSize, fontFamily: _modifiedFontFamily, align: _modifiedTextAlign, @@ -6929,6 +7059,62 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#text_area").css("color", _modifiedFontColor); $("#text_area").css("font-family", _modifiedFontFamily); $("#text_area").css("text-decoration", _modifiedFontDecoration); + + + + //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) {