Commit 7603f8a30619c2f0860c7650a64f529e3f2454f6
1 parent
facaa561
commit changes for the CI Annotation toolbar
-- issue in saving data textarea
Showing
1 changed file
with
129 additions
and
18 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... | ... | @@ -1114,7 +1114,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1114 | 1114 | groups: ['TextArea_' + $rootScope.resetTextCI], |
1115 | 1115 | dragGroups: ['TextArea_' + $rootScope.resetTextCI], |
1116 | 1116 | fillStyle: $rootScope.fontColorCI, |
1117 | - fontStyle: $rootScope.fontStyleCI, | |
1117 | + fontStyle: $rootScope.fontWeightCI + " " + $rootScope.fontStyleCI, | |
1118 | 1118 | fontSize: $rootScope.fontSizesCI, |
1119 | 1119 | fontFamily: $rootScope.fontFamilyCI, |
1120 | 1120 | align: $rootScope.textAlignmtCI, |
... | ... | @@ -1125,7 +1125,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1125 | 1125 | maxHeight: $scope.y - $scope.offsetY1, |
1126 | 1126 | add: function (layer) { |
1127 | 1127 | $rootScope.TextPropertyArrayCI.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' }); |
1128 | - $rootScope.TextPropertyArrayCI.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily }); | |
1128 | + $rootScope.TextPropertyArrayCI.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily, TextDecoration: $rootScope.underlineTextCI }); | |
1129 | 1129 | } |
1130 | 1130 | }) |
1131 | 1131 | // Draw rectangle |
... | ... | @@ -1163,7 +1163,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1163 | 1163 | }, |
1164 | 1164 | dblclick: function (layer) { |
1165 | 1165 | $rootScope.IsTextAlreadySaveCI = true; |
1166 | - | |
1166 | + $rootScope.isTextAreaClosedButtonActiveCI = false; | |
1167 | 1167 | var _rectLayerOnSave = layer.name; |
1168 | 1168 | var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); |
1169 | 1169 | var TextAreaRectName = "TextArea_"; |
... | ... | @@ -1171,19 +1171,74 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1171 | 1171 | $rootScope.modifySavedTextCI.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated }); |
1172 | 1172 | $rootScope.rectDimensionCI.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y }); |
1173 | 1173 | var _rectLayerOnSaveSplitInt; |
1174 | - if (_rectLayerOnSaveSplit[1] >= 3) | |
1175 | - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); | |
1176 | - else | |
1177 | - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); | |
1174 | + //if (_rectLayerOnSaveSplit[1] >= 3) | |
1175 | + // _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2); | |
1176 | + //else | |
1177 | + _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]); | |
1178 | 1178 | var b = $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].Text1; |
1179 | 1179 | $("#text_area").val(b); |
1180 | + var fontStyleProp = $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].FontStyle; | |
1181 | + var fontWeightProp = fontStyleProp.split(" "); | |
1182 | + | |
1180 | 1183 | $("#text_area").css("font-size", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].FontSize); |
1181 | - $("#text_area").css("font-weight", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].FontStyle); | |
1182 | - $("#text_area").css("font-style", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].FontStyle); | |
1184 | + $("#text_area").css("font-weight", fontWeightProp[0]); | |
1185 | + $("#text_area").css("font-style", fontWeightProp[1]); | |
1183 | 1186 | $("#text_area").css("text-align", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].Align); |
1184 | 1187 | $("#text_area").css("color", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].FontColor); |
1185 | 1188 | $("#text_area").css("font-family", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].FontFamily); |
1186 | - $("#text_area").css("text-decoration", $rootScope.underlineTextCI); | |
1189 | + $("#text_area").css("text-decoration", $rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].TextDecoration); | |
1190 | + | |
1191 | + | |
1192 | + //adding text text decoration active class in text edit pop-up | |
1193 | + | |
1194 | + if ($rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].TextDecoration == "underline") { | |
1195 | + $("#text-underline").addClass("ActiveFormattingButtonClass"); | |
1196 | + } | |
1197 | + else { | |
1198 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
1199 | + } | |
1200 | + | |
1201 | + //adding text font weight active class in text edit pop-up | |
1202 | + | |
1203 | + if (fontWeightProp[0] == 700) { | |
1204 | + $("#text-bold").addClass("ActiveFormattingButtonClass"); | |
1205 | + } | |
1206 | + else { | |
1207 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
1208 | + } | |
1209 | + | |
1210 | + //adding text font style active class in text edit pop-up | |
1211 | + | |
1212 | + if (fontWeightProp[1] == "italic") { | |
1213 | + $("#text-italic").addClass("ActiveFormattingButtonClass"); | |
1214 | + } | |
1215 | + else { | |
1216 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
1217 | + } | |
1218 | + | |
1219 | + | |
1220 | + | |
1221 | + //adding text alignment active class in text edit pop-up | |
1222 | + | |
1223 | + if ($rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].Align == "left") { | |
1224 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
1225 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
1226 | + $("#text-left").addClass("ActiveFormattingButtonClass"); | |
1227 | + } | |
1228 | + | |
1229 | + else if ($rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].Align == "right") { | |
1230 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
1231 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
1232 | + $("#text-right").addClass("ActiveFormattingButtonClass"); | |
1233 | + } | |
1234 | + | |
1235 | + else if ($rootScope.TextPropertyArrayCI[_rectLayerOnSaveSplitInt].Align == "center") { | |
1236 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
1237 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
1238 | + $("#text-center").addClass("ActiveFormattingButtonClass"); | |
1239 | + } | |
1240 | + | |
1241 | + | |
1187 | 1242 | _rectLayerOnSaveSplitInt = ''; b = ''; |
1188 | 1243 | $("#annotationTextModal").modal("toggle"); |
1189 | 1244 | }, |
... | ... | @@ -1216,7 +1271,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1216 | 1271 | }); |
1217 | 1272 | $("#text_area").val(''); |
1218 | 1273 | $("#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" }); |
1219 | - | |
1274 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
1275 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
1276 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
1277 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
1278 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
1279 | + $("#text-center").removeClass("ActiveFormattingButtonClass"); | |
1220 | 1280 | } |
1221 | 1281 | |
1222 | 1282 | // this part will work second time when save button will be clicked |
... | ... | @@ -1245,7 +1305,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1245 | 1305 | groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSaveCI], |
1246 | 1306 | dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSaveCI], |
1247 | 1307 | fillStyle: _modifiedFontColor, |
1248 | - fontStyle: _modifiedFontStyle, | |
1308 | + fontStyle: _modifiedFontWeight + " " + _modifiedFontStyle, | |
1249 | 1309 | fontSize: _modifiedFontSize, |
1250 | 1310 | fontFamily: _modifiedFontFamily, |
1251 | 1311 | align: _modifiedTextAlign, |
... | ... | @@ -1291,7 +1351,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1291 | 1351 | |
1292 | 1352 | }, |
1293 | 1353 | dblclick: function (layer) { |
1294 | - | |
1354 | + //debugger; | |
1355 | + $rootScope.isTextAreaClosedButtonActiveCI = false; | |
1295 | 1356 | $rootScope.IsTextAlreadySaveCI = true; |
1296 | 1357 | var _rectLayerOnSave = layer.name; |
1297 | 1358 | var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_"); |
... | ... | @@ -1307,6 +1368,56 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1307 | 1368 | $("#text_area").css("color", _modifiedFontColor); |
1308 | 1369 | $("#text_area").css("font-family", _modifiedFontFamily); |
1309 | 1370 | $("#text_area").css("text-decoration", _modifiedFontDecoration); |
1371 | + | |
1372 | + //adding text text decoration active class in text edit pop-up | |
1373 | + if (_modifiedFontDecoration == "underline") { | |
1374 | + $("#text-underline").addClass("ActiveFormattingButtonClass"); | |
1375 | + } | |
1376 | + else { | |
1377 | + $("#text-underline").removeClass("ActiveFormattingButtonClass"); | |
1378 | + } | |
1379 | + | |
1380 | + //adding text font weight active class in text edit pop-up | |
1381 | + if (_modifiedFontWeight == 700) { | |
1382 | + | |
1383 | + $("#text-bold").addClass("ActiveFormattingButtonClass"); | |
1384 | + } | |
1385 | + else { | |
1386 | + | |
1387 | + $("#text-bold").removeClass("ActiveFormattingButtonClass"); | |
1388 | + | |
1389 | + } | |
1390 | + | |
1391 | + //adding text font style active class in text edit pop-up | |
1392 | + if (_modifiedFontStyle == "italic") { | |
1393 | + | |
1394 | + $("#text-italic").addClass("ActiveFormattingButtonClass"); | |
1395 | + } | |
1396 | + else { | |
1397 | + $("#text-italic").removeClass("ActiveFormattingButtonClass"); | |
1398 | + | |
1399 | + } | |
1400 | + | |
1401 | + //adding text alignment active class in text edit pop-up | |
1402 | + if (_modifiedTextAlign == "left") { | |
1403 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
1404 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
1405 | + $("#text-left").addClass("ActiveFormattingButtonClass"); | |
1406 | + } | |
1407 | + else if (_modifiedTextAlign == "right") { | |
1408 | + | |
1409 | + $("#text-center").removeClass("ActiveFormattingButtonClass") | |
1410 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
1411 | + $("#text-right").addClass("ActiveFormattingButtonClass"); | |
1412 | + | |
1413 | + } | |
1414 | + else if (_modifiedTextAlign == "center") { | |
1415 | + $("#text-left").removeClass("ActiveFormattingButtonClass"); | |
1416 | + $("#text-right").removeClass("ActiveFormattingButtonClass"); | |
1417 | + $("#text-center").addClass("ActiveFormattingButtonClass"); | |
1418 | + | |
1419 | + } | |
1420 | + | |
1310 | 1421 | $("#annotationTextModal").modal("toggle"); |
1311 | 1422 | }, |
1312 | 1423 | mouseout: function (layer) { |
... | ... | @@ -1336,17 +1447,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
1336 | 1447 | |
1337 | 1448 | } |
1338 | 1449 | }); |
1339 | - $rootScope.modifySavedText = []; | |
1450 | + $rootScope.modifySavedTextCI = []; | |
1340 | 1451 | |
1341 | 1452 | } |
1342 | 1453 | } |
1343 | 1454 | |
1344 | 1455 | // deleting text area on close button |
1345 | 1456 | $rootScope.closeModal = function () { |
1346 | - | |
1347 | - $("#canvas").removeLayer('TextArea_' + $rootScope.resetTextCI).drawLayers(); | |
1348 | - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRectCI).drawLayers(); | |
1349 | - | |
1457 | + if ($rootScope.isTextAreaClosedButtonActiveCI == true) { | |
1458 | + $("#canvas").removeLayer('TextArea_' + $rootScope.resetTextCI).drawLayers(); | |
1459 | + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRectCI).drawLayers(); | |
1460 | + } | |
1350 | 1461 | } |
1351 | 1462 | |
1352 | 1463 | ... | ... |