Commit 73199bbeb4517081890417567ca8d222ce3ae7f7

Authored by Nikita Kulshreshtha
2 parents b00f230d 6f5db128

Merge branch 'AnnoTextAeraActiveButtons' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -6679,9 +6679,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6679 6679  
6680 6680 $("#annotationTextModal").modal("toggle");
6681 6681 $('.btnCursor').trigger('click');
  6682 +
6682 6683 $("#text_area").val('');
  6684 +
6683 6685 $("#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" });
  6686 +
  6687 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  6688 +
  6689 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  6690 +
  6691 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  6692 +
  6693 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  6694 +
  6695 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  6696 +
  6697 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  6698 +
6684 6699 $(".btn-annotation").removeClass("activebtncolor");
  6700 +
6685 6701 $('.btnCursor').addClass('activebtncolor');
6686 6702 break;
6687 6703  
... ... @@ -6740,7 +6756,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6740 6756 groups: ['TextArea_' + $rootScope.resetText],
6741 6757 dragGroups: ['TextArea_' + $rootScope.resetText],
6742 6758 fillStyle: $rootScope.fontColor,
6743   - fontStyle: $rootScope.fontStyle,
  6759 + fontStyle: $rootScope.fontWeight + " " + $rootScope.fontStyle,
6744 6760 fontSize: $rootScope.fontSizes,
6745 6761 fontFamily: $rootScope.fontFamily,
6746 6762 align: $rootScope.textAlignmt,
... ... @@ -6751,7 +6767,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6751 6767 maxHeight: $scope.y - $scope.offsetY1,
6752 6768 add: function (layer) {
6753 6769 $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });
6754   - $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });
  6770 + $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineText });
6755 6771 }
6756 6772 })
6757 6773 // Draw rectangle
... ... @@ -6797,19 +6813,119 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6797 6813 $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });
6798 6814 $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
6799 6815 var _rectLayerOnSaveSplitInt;
6800   - if (_rectLayerOnSaveSplit[1] >= 3)
6801   - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
6802   - else
6803   - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
  6816 + //if (_rectLayerOnSaveSplit[1] >= 3)
  6817 + // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);
  6818 + //else
  6819 + // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
  6820 +
  6821 + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);
6804 6822 var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;
6805 6823 $("#text_area").val(b);
  6824 + var fontStyleProp = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle;
  6825 + var fontWeightProp = fontStyleProp.split(" ");
  6826 +
6806 6827 $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);
6807   - $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
6808   - $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);
  6828 + $("#text_area").css("font-weight", fontWeightProp[0]);
  6829 + $("#text_area").css("font-style", fontWeightProp[1]);
6809 6830 $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);
6810 6831 $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);
6811 6832 $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);
6812   - $("#text_area").css("text-decoration", $rootScope.underlineText);
  6833 + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration);
  6834 +
  6835 +
  6836 +
  6837 +
  6838 + //adding text text decoration active class in text edit pop-up
  6839 +
  6840 + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].TextDecoration == "underline") {
  6841 +
  6842 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  6843 +
  6844 + }
  6845 +
  6846 + else {
  6847 +
  6848 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  6849 +
  6850 + }
  6851 +
  6852 +
  6853 +
  6854 + //adding text font weight active class in text edit pop-up
  6855 +
  6856 + if (fontWeightProp[0] == 700) {
  6857 +
  6858 +
  6859 +
  6860 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  6861 +
  6862 + }
  6863 +
  6864 + else
  6865 +
  6866 + {
  6867 +
  6868 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  6869 +
  6870 + }
  6871 +
  6872 + //adding text font style active class in text edit pop-up
  6873 +
  6874 + if (fontWeightProp[1] == "italic") {
  6875 +
  6876 +
  6877 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  6878 + }
  6879 + else
  6880 +
  6881 + {
  6882 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  6883 +
  6884 +
  6885 +
  6886 + }
  6887 +
  6888 +
  6889 +
  6890 + //adding text alignment active class in text edit pop-up
  6891 +
  6892 + if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "left") {
  6893 +
  6894 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  6895 +
  6896 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  6897 +
  6898 + $("#text-left").addClass("ActiveFormattingButtonClass");
  6899 +
  6900 + }
  6901 +
  6902 + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "right") {
  6903 +
  6904 +
  6905 +
  6906 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  6907 +
  6908 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  6909 +
  6910 + $("#text-right").addClass("ActiveFormattingButtonClass");
  6911 +
  6912 +
  6913 +
  6914 + }
  6915 +
  6916 + else if ($rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align == "center") {
  6917 +
  6918 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  6919 +
  6920 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  6921 +
  6922 + $("#text-center").addClass("ActiveFormattingButtonClass");
  6923 +
  6924 +
  6925 +
  6926 + }
  6927 +
  6928 +
6813 6929 _rectLayerOnSaveSplitInt = ''; b = '';
6814 6930 $("#annotationTextModal").modal("toggle");
6815 6931 },
... ... @@ -6843,6 +6959,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6843 6959 $("#text_area").val('');
6844 6960 $("#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" });
6845 6961  
  6962 +
  6963 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  6964 +
  6965 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  6966 +
  6967 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  6968 +
  6969 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  6970 +
  6971 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  6972 +
  6973 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  6974 +
  6975 +
6846 6976 }
6847 6977  
6848 6978 // this part will work second time when save button will be clicked
... ... @@ -6871,7 +7001,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6871 7001 groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6872 7002 dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],
6873 7003 fillStyle: _modifiedFontColor,
6874   - fontStyle: _modifiedFontStyle,
  7004 + fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle,
6875 7005 fontSize: _modifiedFontSize,
6876 7006 fontFamily: _modifiedFontFamily,
6877 7007 align: _modifiedTextAlign,
... ... @@ -6933,6 +7063,62 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6933 7063 $("#text_area").css("color", _modifiedFontColor);
6934 7064 $("#text_area").css("font-family", _modifiedFontFamily);
6935 7065 $("#text_area").css("text-decoration", _modifiedFontDecoration);
  7066 +
  7067 +
  7068 +
  7069 + //adding text text decoration active class in text edit pop-up
  7070 + if (_modifiedFontDecoration == "underline") {
  7071 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  7072 + }
  7073 + else {
  7074 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  7075 + }
  7076 +
  7077 + //adding text font weight active class in text edit pop-up
  7078 + if (_modifiedFontWeight == 700) {
  7079 +
  7080 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  7081 + }
  7082 + else {
  7083 +
  7084 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
  7085 +
  7086 + }
  7087 +
  7088 + //adding text font style active class in text edit pop-up
  7089 + if (_modifiedFontStyle == "italic") {
  7090 +
  7091 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  7092 + }
  7093 + else {
  7094 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
  7095 +
  7096 + }
  7097 +
  7098 + //adding text alignment active class in text edit pop-up
  7099 + if (_modifiedTextAlign == "left") {
  7100 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  7101 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  7102 + $("#text-left").addClass("ActiveFormattingButtonClass");
  7103 + }
  7104 + else if (_modifiedTextAlign == "right") {
  7105 +
  7106 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  7107 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  7108 + $("#text-right").addClass("ActiveFormattingButtonClass");
  7109 +
  7110 + }
  7111 + else if (_modifiedTextAlign == "center") {
  7112 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  7113 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  7114 + $("#text-center").addClass("ActiveFormattingButtonClass");
  7115 +
  7116 + }
  7117 +
  7118 +
  7119 +
  7120 +
  7121 +
6936 7122 $("#annotationTextModal").modal("toggle");
6937 7123 },
6938 7124 mouseout: function (layer) {
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -41,6 +41,35 @@
41 41  
42 42 <!--Annotation Toolbar: Jcanvas-->
43 43 <style>
  44 +
  45 +
  46 + .ActiveFormattingButtonClass {
  47 + background-color: #1B92D0 !important;
  48 + }
  49 +
  50 + .Edittext-btn-css {
  51 + background: #4B4B4B;
  52 + padding: 4px;
  53 + cursor: pointer;
  54 + margin-right: 2px;
  55 + }
  56 +
  57 + /*.italic-btn-css {
  58 + background: #4B4B4B;
  59 + padding: 4px;
  60 + cursor: pointer;
  61 + margin-right: 2px;
  62 + }*/
  63 +
  64 + .underline-btn-css {
  65 + background: #4B4B4B;
  66 + padding: 4px;
  67 + cursor: pointer;
  68 + margin-right: 5px;
  69 + }
  70 +
  71 +
  72 +
44 73 .activebtncolor {
45 74 background-color: #1B92D0 !important;
46 75 border-color: #1B92D0 !important;
... ... @@ -537,14 +566,14 @@
537 566 <option>72</option>
538 567 </select>
539 568 <span style="vertical-align:middle;">
540   - <span id="text-bold" style="background: #4B4B4B;padding:4px;cursor:pointer;margin-right:2px;">
  569 + <span id="text-bold" class="Edittext-btn-css">
541 570 <i aria-hidden="true" class="fa fa-bold" style="color: #fff"></i>
542 571 </span>
543   - <span id="text-italic" style="background: #4B4B4B; padding: 4px; cursor: pointer; margin-right: 2px;">
  572 + <span id="text-italic" class="Edittext-btn-css">
544 573 <i class="fa fa-italic" aria-hidden="true" style="color: #fff"></i>
545 574  
546 575 </span>
547   - <span id="text-underline" style="background: #4B4B4B; padding: 4px; cursor: pointer; margin-right: 5px;">
  576 + <span id="text-underline" class="underline-btn-css">
548 577 <i class="fa fa-underline" aria-hidden="true" style="color: #fff"></i>
549 578 </span>
550 579 </span>
... ... @@ -555,15 +584,15 @@
555 584 </div>
556 585  
557 586 <span style="vertical-align:middle;">
558   - <span id="text-left" style="background: #4B4B4B;padding:4px;cursor:pointer;margin-right:2px;">
  587 + <span id="text-left" class="Edittext-btn-css">
559 588 <i aria-hidden="true" class="fa fa-align-left" style="color: #fff"></i>
560 589 </span>
561   - <span id="text-center" style="background: #4B4B4B; padding: 4px; cursor: pointer; margin-right: 2px;">
  590 + <span id="text-center" class="Edittext-btn-css">
562 591 <i class="fa fa-align-center" aria-hidden="true" style="color: #fff"></i>
563 592  
564 593  
565 594 </span>
566   - <span id="text-right" style="background: #4B4B4B; padding: 4px; cursor: pointer; margin-right: 5px;">
  595 + <span id="text-right" class="underline-btn-css">
567 596 <i class="fa fa-align-right" aria-hidden="true" style="color: #fff"></i>
568 597  
569 598  
... ... @@ -1207,41 +1236,83 @@
1207 1236  
1208 1237 $("#text-left").on('click', function () {
1209 1238  
  1239 + //Annotation: Formatting buttons color is not change when select.
  1240 +
  1241 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  1242 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1243 + $("#text-left").addClass("ActiveFormattingButtonClass");
1210 1244 $("#text_area").css("text-align", "left");
1211 1245  
  1246 +
1212 1247 });
1213 1248  
1214 1249  
1215 1250 $("#text-center").on('click', function () {
1216 1251  
  1252 + //Annotation: Formatting buttons color is not change when select.
  1253 +
  1254 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1255 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1256 + $("#text-center").addClass("ActiveFormattingButtonClass");
1217 1257 $("#text_area").css("text-align", "center");
1218 1258  
  1259 +
1219 1260 });
1220 1261  
1221 1262  
1222 1263 $("#text-right").on('click', function () {
1223 1264  
1224   - $("#text_area").css("text-align", "right");
  1265 + //Annotation: Formatting buttons color is not change when select.
1225 1266  
  1267 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1268 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  1269 + $("#text-right").addClass("ActiveFormattingButtonClass");
  1270 + $("#text_area").css("text-align", "right");
1226 1271 });
1227 1272  
1228 1273  
1229 1274 $("#text-bold").on('click', function () {
1230 1275  
1231   - $("#text_area").css("font-weight", "bold");
  1276 + //Annotation: Formatting buttons color is not change when select.
  1277 + $("#text-bold").toggleClass("ActiveFormattingButtonClass");
  1278 +
  1279 + if ($("#text-bold").hasClass("ActiveFormattingButtonClass")) {
  1280 + $("#text_area").css("font-weight", "bold");
  1281 + }
  1282 + else {
  1283 + $("#text_area").css("font-weight", "normal");
  1284 + }
  1285 +
1232 1286  
1233 1287 });
1234 1288  
1235 1289 $("#text-italic").on('click', function () {
1236 1290  
1237   - $("#text_area").css("font-style", "italic");
  1291 + //Annotation: Formatting buttons color is not change when select.
  1292 + $("#text-italic").toggleClass("ActiveFormattingButtonClass");
  1293 + if ($("#text-italic").hasClass("ActiveFormattingButtonClass")) {
  1294 + $("#text_area").css("font-style", "italic");
  1295 + }
  1296 + else {
  1297 + $("#text_area").css("font-style", "normal");
  1298 + }
  1299 +
1238 1300  
1239 1301 });
1240 1302  
1241 1303 $("#text-underline").on('click', function () {
1242 1304  
1243   - $("#text_area").css("text-decoration", "underline");
  1305 + //Annotation: Formatting buttons color is not change when select.
  1306 + $("#text-underline").toggleClass("ActiveFormattingButtonClass");
  1307 +
  1308 + if ($("#text-underline").hasClass("ActiveFormattingButtonClass")) {
  1309 + $("#text_area").css("text-decoration", "underline");
  1310 + }
  1311 + else {
  1312 + $("#text_area").css("text-decoration", "none");
  1313 + }
1244 1314  
  1315 +
1245 1316 });
1246 1317  
1247 1318  
... ...