Commit d6baa2a6ecfaf3cfcc534b123434735f30f07422
1 parent
c3f1b1f4
Refs: #7808
Showing
1 changed file
with
196 additions
and
10 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -6675,9 +6675,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6675 | 6675 | |
6676 | 6676 | $("#annotationTextModal").modal("toggle"); |
6677 | 6677 | $('.btnCursor').trigger('click'); |
6678 | + | |
6678 | 6679 | $("#text_area").val(''); |
6680 | + | |
6679 | 6681 | $("#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" }); |
6682 | + | |
6683 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
6684 | + | |
6685 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
6686 | + | |
6687 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
6688 | + | |
6689 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
6690 | + | |
6691 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
6692 | + | |
6693 | + $("#text-center").removeClass("ActiveFormattingButtonClass"); | |
6694 | + | |
6680 | 6695 | $(".btn-annotation").removeClass("activebtncolor"); |
6696 | + | |
6681 | 6697 | $('.btnCursor').addClass('activebtncolor'); |
6682 | 6698 | break; |
6683 | 6699 | |
... | ... | @@ -6736,7 +6752,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6736 | 6752 | groups: ['TextArea_' + $rootScope.resetText], |
6737 | 6753 | dragGroups: ['TextArea_' + $rootScope.resetText], |
6738 | 6754 | fillStyle: $rootScope.fontColor, |
6739 | - fontStyle: $rootScope.fontStyle, | |
6755 | + fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle, | |
6740 | 6756 | fontSize: $rootScope.fontSizes, |
6741 | 6757 | fontFamily: $rootScope.fontFamily, |
6742 | 6758 | align: $rootScope.textAlignmt, |
... | ... | @@ -6747,7 +6763,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6747 | 6763 | maxHeight: $scope.y - $scope.offsetY1, |
6748 | 6764 | add: function (layer) { |
6749 | 6765 | $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); |
6750 | - $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily }); | |
6766 | + $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText }); | |
6751 | 6767 | } |
6752 | 6768 | }) |
6753 | 6769 | // Draw rectangle |
... | ... | @@ -6793,19 +6809,119 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6793 | 6809 | $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated }); |
6794 | 6810 | $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); |
6795 | 6811 | var _rectLayerOnSaveSplitInt; |
6796 | - if (_rectLayerOnSaveSplit[1] >= 3) | |
6797 | - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); | |
6798 | - else | |
6799 | - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); | |
6812 | + //if (_rectLayerOnSaveSplit[1] >= 3) | |
6813 | + // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); | |
6814 | + //else | |
6815 | + // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); | |
6816 | + | |
6817 | + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); | |
6800 | 6818 | var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1; |
6801 | 6819 | $("#text_area").val(b); |
6820 | + var fontStyleProp = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle; | |
6821 | + var fontWeightProp = fontStyleProp.split(" "); | |
6822 | + | |
6802 | 6823 | $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize); |
6803 | - $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); | |
6804 | - $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle); | |
6824 | + $("#text_area").css("font-weight", fontWeightProp[0]); | |
6825 | + $("#text_area").css("font-style", fontWeightProp[1]); | |
6805 | 6826 | $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align); |
6806 | 6827 | $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor); |
6807 | 6828 | $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily); |
6808 | - $("#text_area").css("text-decoration", $rootScope.underlineText); | |
6829 | + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration); | |
6830 | + | |
6831 | + | |
6832 | + | |
6833 | + | |
6834 | + //adding text text decoration active class in text edit pop-up | |
6835 | + | |
6836 | + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration == "underline") { | |
6837 | + | |
6838 | + $("#text-underline").addClass("ActiveFormattingButtonClass"); | |
6839 | + | |
6840 | + } | |
6841 | + | |
6842 | + else { | |
6843 | + | |
6844 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
6845 | + | |
6846 | + } | |
6847 | + | |
6848 | + | |
6849 | + | |
6850 | + //adding text font weight active class in text edit pop-up | |
6851 | + | |
6852 | + if (fontWeightProp[0] == 700) { | |
6853 | + | |
6854 | + | |
6855 | + | |
6856 | + $("#text-bold").addClass("ActiveFormattingButtonClass"); | |
6857 | + | |
6858 | + } | |
6859 | + | |
6860 | + else | |
6861 | + | |
6862 | + { | |
6863 | + | |
6864 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
6865 | + | |
6866 | + } | |
6867 | + | |
6868 | + //adding text font style active class in text edit pop-up | |
6869 | + | |
6870 | + if (fontWeightProp[1] == "italic") { | |
6871 | + | |
6872 | + | |
6873 | + $("#text-italic").addClass("ActiveFormattingButtonClass"); | |
6874 | + } | |
6875 | + else | |
6876 | + | |
6877 | + { | |
6878 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
6879 | + | |
6880 | + | |
6881 | + | |
6882 | + } | |
6883 | + | |
6884 | + | |
6885 | + | |
6886 | + //adding text alignment active class in text edit pop-up | |
6887 | + | |
6888 | + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") { | |
6889 | + | |
6890 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
6891 | + | |
6892 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
6893 | + | |
6894 | + $("#text-left").addClass("ActiveFormattingButtonClass"); | |
6895 | + | |
6896 | + } | |
6897 | + | |
6898 | + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") { | |
6899 | + | |
6900 | + | |
6901 | + | |
6902 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
6903 | + | |
6904 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
6905 | + | |
6906 | + $("#text-right").addClass("ActiveFormattingButtonClass"); | |
6907 | + | |
6908 | + | |
6909 | + | |
6910 | + } | |
6911 | + | |
6912 | + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") { | |
6913 | + | |
6914 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
6915 | + | |
6916 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
6917 | + | |
6918 | + $("#text-center").addClass("ActiveFormattingButtonClass"); | |
6919 | + | |
6920 | + | |
6921 | + | |
6922 | + } | |
6923 | + | |
6924 | + | |
6809 | 6925 | _rectLayerOnSaveSplitInt = ''; b = ''; |
6810 | 6926 | $("#annotationTextModal").modal("toggle"); |
6811 | 6927 | }, |
... | ... | @@ -6839,6 +6955,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6839 | 6955 | $("#text_area").val(''); |
6840 | 6956 | $("#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" }); |
6841 | 6957 | |
6958 | + | |
6959 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
6960 | + | |
6961 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
6962 | + | |
6963 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
6964 | + | |
6965 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
6966 | + | |
6967 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
6968 | + | |
6969 | + $("#text-center").removeClass("ActiveFormattingButtonClass"); | |
6970 | + | |
6971 | + | |
6842 | 6972 | } |
6843 | 6973 | |
6844 | 6974 | // 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 |
6867 | 6997 | groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], |
6868 | 6998 | dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave], |
6869 | 6999 | fillStyle: _modifiedFontColor, |
6870 | - fontStyle: _modifiedFontStyle, | |
7000 | + fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle, | |
6871 | 7001 | fontSize: _modifiedFontSize, |
6872 | 7002 | fontFamily: _modifiedFontFamily, |
6873 | 7003 | align: _modifiedTextAlign, |
... | ... | @@ -6929,6 +7059,62 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
6929 | 7059 | $("#text_area").css("color", _modifiedFontColor); |
6930 | 7060 | $("#text_area").css("font-family", _modifiedFontFamily); |
6931 | 7061 | $("#text_area").css("text-decoration", _modifiedFontDecoration); |
7062 | + | |
7063 | + | |
7064 | + | |
7065 | + //adding text text decoration active class in text edit pop-up | |
7066 | + if (_modifiedFontDecoration == "underline") { | |
7067 | + $("#text-underline").addClass("ActiveFormattingButtonClass"); | |
7068 | + } | |
7069 | + else { | |
7070 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
7071 | + } | |
7072 | + | |
7073 | + //adding text font weight active class in text edit pop-up | |
7074 | + if (_modifiedFontWeight == 700) { | |
7075 | + | |
7076 | + $("#text-bold").addClass("ActiveFormattingButtonClass"); | |
7077 | + } | |
7078 | + else { | |
7079 | + | |
7080 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
7081 | + | |
7082 | + } | |
7083 | + | |
7084 | + //adding text font style active class in text edit pop-up | |
7085 | + if (_modifiedFontStyle == "italic") { | |
7086 | + | |
7087 | + $("#text-italic").addClass("ActiveFormattingButtonClass"); | |
7088 | + } | |
7089 | + else { | |
7090 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
7091 | + | |
7092 | + } | |
7093 | + | |
7094 | + //adding text alignment active class in text edit pop-up | |
7095 | + if (_modifiedTextAlign == "left") { | |
7096 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
7097 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
7098 | + $("#text-left").addClass("ActiveFormattingButtonClass"); | |
7099 | + } | |
7100 | + else if (_modifiedTextAlign == "right") { | |
7101 | + | |
7102 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
7103 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
7104 | + $("#text-right").addClass("ActiveFormattingButtonClass"); | |
7105 | + | |
7106 | + } | |
7107 | + else if (_modifiedTextAlign == "center") { | |
7108 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
7109 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
7110 | + $("#text-center").addClass("ActiveFormattingButtonClass"); | |
7111 | + | |
7112 | + } | |
7113 | + | |
7114 | + | |
7115 | + | |
7116 | + | |
7117 | + | |
6932 | 7118 | $("#annotationTextModal").modal("toggle"); |
6933 | 7119 | }, |
6934 | 7120 | mouseout: function (layer) { | ... | ... |