Commit e0a24ef5b3ba0391fe3f24a82720cbd14b140462
1 parent
84b28320
annotations are shown on pin head click but need to impement multiannotation and…
… also need to write code for make head green for multiple pins
Showing
2 changed files
with
253 additions
and
233 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -87,16 +87,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
87 | 87 | $rootScope.haveRoleAdmin; |
88 | 88 | var isfilloptionChecked = ""; |
89 | 89 | var isOutlineOptionChecked = ""; |
90 | - $rootScope.forgotPwdModalShow = function () | |
91 | - { | |
90 | + $rootScope.forgotPwdModalShow = function () { | |
92 | 91 | $("#forgotPwdModal").modal("show"); |
93 | - $(".modal-backdrop").css("opacity",".5"); | |
92 | + $(".modal-backdrop").css("opacity", ".5"); | |
94 | 93 | } |
95 | - $rootScope.forgotUserModalShow=function() | |
96 | - { | |
94 | + $rootScope.forgotUserModalShow = function () { | |
97 | 95 | $("#forgotUserModal").modal("show"); |
98 | 96 | $(".modal-backdrop").css("opacity", ".5"); |
99 | - | |
97 | + | |
100 | 98 | } |
101 | 99 | $rootScope.initializeAIA = function () { |
102 | 100 | |
... | ... | @@ -141,10 +139,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
141 | 139 | else { |
142 | 140 | if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { |
143 | 141 | |
144 | - if ($("#messageModal").length > 0){ | |
145 | - | |
142 | + if ($("#messageModal").length > 0) { | |
143 | + | |
146 | 144 | $("#messageModal").modal('hide'); |
147 | - } | |
145 | + } | |
148 | 146 | $rootScope.userData = result; |
149 | 147 | $rootScope.userModules = result.modules; |
150 | 148 | $rootScope.isVisibleLogin = false; |
... | ... | @@ -159,7 +157,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
159 | 157 | else |
160 | 158 | $rootScope.haveRoleAdmin = true; |
161 | 159 | } |
162 | - | |
160 | + | |
163 | 161 | } |
164 | 162 | } |
165 | 163 | }, |
... | ... | @@ -285,7 +283,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
285 | 283 | } |
286 | 284 | }; |
287 | 285 | |
288 | - | |
286 | + | |
289 | 287 | |
290 | 288 | |
291 | 289 | function validateEmail(email) { |
... | ... | @@ -305,42 +303,42 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
305 | 303 | if (userInfo.newPassword === userInfo.confirmPassword) { |
306 | 304 | $rootScope.passwordMismatchMessage = null; |
307 | 305 | |
308 | - AuthenticationService.ResetUserPassword(userInfo) | |
309 | - .then( | |
310 | - function (result) { | |
311 | - if (result == LoginConstants.USER_NOT_FOUND) { | |
312 | - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); | |
313 | - $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; | |
314 | - $("#messageModal").modal('show'); | |
315 | - | |
316 | - } | |
317 | - else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { | |
318 | - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
319 | - $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; | |
320 | - $("#messageModal").modal('show'); | |
306 | + AuthenticationService.ResetUserPassword(userInfo) | |
307 | + .then( | |
308 | + function (result) { | |
309 | + if (result == LoginConstants.USER_NOT_FOUND) { | |
310 | + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); | |
311 | + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; | |
312 | + $("#messageModal").modal('show'); | |
321 | 313 | |
322 | - } | |
323 | - else { | |
324 | - if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { | |
325 | - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); | |
326 | - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; | |
314 | + } | |
315 | + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { | |
316 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
317 | + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; | |
327 | 318 | $("#messageModal").modal('show'); |
328 | - $rootScope.isVisibleLogin = true; | |
329 | - $rootScope.isVisibleResetPass = false; | |
330 | - $location.url("/"); | |
319 | + | |
331 | 320 | } |
332 | - } | |
333 | - }, | |
334 | - function (error) { | |
335 | - console.log(' Error in authentication = ' + error.statusText); | |
336 | - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
337 | - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; | |
338 | - $("#messageModal").modal('show'); | |
321 | + else { | |
322 | + if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { | |
323 | + // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); | |
324 | + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; | |
325 | + $("#messageModal").modal('show'); | |
326 | + $rootScope.isVisibleLogin = true; | |
327 | + $rootScope.isVisibleResetPass = false; | |
328 | + $location.url("/"); | |
329 | + } | |
330 | + } | |
331 | + }, | |
332 | + function (error) { | |
333 | + console.log(' Error in authentication = ' + error.statusText); | |
334 | + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); | |
335 | + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; | |
336 | + $("#messageModal").modal('show'); | |
339 | 337 | |
340 | - }); | |
341 | - } | |
342 | - else { | |
343 | - $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; | |
338 | + }); | |
339 | + } | |
340 | + else { | |
341 | + $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; | |
344 | 342 | //$("#messageModal").modal('show'); |
345 | 343 | } |
346 | 344 | } |
... | ... | @@ -366,9 +364,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
366 | 364 | dataType: "json", |
367 | 365 | success: function (result) { |
368 | 366 | $(result.root.uc.al.lx).each(function (key, value) { |
369 | - | |
367 | + | |
370 | 368 | $('#lexiconLangDropdown').append('<option val="' + this._id + '">' + this._tl + '</option>'); |
371 | - | |
369 | + | |
372 | 370 | }); |
373 | 371 | |
374 | 372 | } |
... | ... | @@ -404,7 +402,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
404 | 402 | $rootScope.isActiveLexiconLanguageClicked = false; |
405 | 403 | $("#secondLax :selected").remove(); |
406 | 404 | $('#lexiconLangDropdown').append('<option val="' + $rootScope.secondlaxdid + '">' + $rootScope.secondlaxtext + '</option>'); |
407 | - // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); | |
405 | + // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); | |
408 | 406 | $rootScope.lexiconLanguageArray = []; |
409 | 407 | $("#secondLax > option").each(function () { |
410 | 408 | $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value }); |
... | ... | @@ -431,7 +429,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
431 | 429 | |
432 | 430 | if ($.browser.msie) { |
433 | 431 | $("#resetBtn").css("display", "inline-block"); |
434 | - // $rootScope.refreshCanvas(); | |
432 | + // $rootScope.refreshCanvas(); | |
435 | 433 | |
436 | 434 | } |
437 | 435 | $(function () { |
... | ... | @@ -559,14 +557,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
559 | 557 | |
560 | 558 | $rootScope.getModuleScrollPosition = function () { |
561 | 559 | $('.mCSB_container ul li').click(function () { |
562 | - | |
560 | + | |
563 | 561 | $rootScope.scrollTopPosition = $(this).position().top; |
564 | - | |
562 | + | |
565 | 563 | }); |
566 | 564 | setTimeout(function () { |
567 | 565 | |
568 | 566 | $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px"); |
569 | - | |
567 | + | |
570 | 568 | |
571 | 569 | |
572 | 570 | }, 300); |
... | ... | @@ -584,7 +582,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
584 | 582 | if (openViews.length > 0) { |
585 | 583 | var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; |
586 | 584 | } |
587 | - // $('#daImagePanel').remove(); | |
585 | + // $('#daImagePanel').remove(); | |
588 | 586 | if ($('#jsPanel-1').length > 0) |
589 | 587 | $('#jsPanel-1').remove(); |
590 | 588 | |
... | ... | @@ -3070,7 +3068,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3070 | 3068 | |
3071 | 3069 | $rootScope.disableAnnotationtoolOnListManager = false; |
3072 | 3070 | $rootScope.ShowListManager = function () { |
3073 | - | |
3071 | + | |
3074 | 3072 | $rootScope.switchCanvas(); |
3075 | 3073 | $("#annotationpaintbrushsize").attr("href", "#"); |
3076 | 3074 | $("#annotationpainteraser").attr("href", "#"); |
... | ... | @@ -3092,7 +3090,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3092 | 3090 | $rootScope.islistManagerEventAlredayDispachted = true; |
3093 | 3091 | |
3094 | 3092 | $rootScope.$broadcast('listManagerEvent', true); |
3095 | - | |
3093 | + | |
3096 | 3094 | if ($rootScope.selectedBodySystemName == undefined && $rootScope.slectedActualTermNumber == undefined) { |
3097 | 3095 | $('#termList option[selected="selected"]').prop("selected", false); |
3098 | 3096 | $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); |
... | ... | @@ -3113,7 +3111,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3113 | 3111 | $('#bodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').prop("selected", true); |
3114 | 3112 | $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); |
3115 | 3113 | $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); |
3116 | - | |
3114 | + | |
3117 | 3115 | } |
3118 | 3116 | $("#optionsListManagerTab").addClass("active"); |
3119 | 3117 | var viewNameAftrSplit = $("#viewName").val().split(" "); |
... | ... | @@ -3276,17 +3274,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3276 | 3274 | } |
3277 | 3275 | |
3278 | 3276 | $rootScope.UpdateAndCloseSetting = function (setting) { |
3279 | - // debugger; | |
3277 | + // debugger; | |
3280 | 3278 | $rootScope.UpdateSetting(setting); |
3281 | 3279 | $rootScope.loadSearchDataForBodyView(); |
3282 | - | |
3280 | + | |
3283 | 3281 | //$timeout(function () { |
3284 | - $('#modal-settings').css("display", "none"); | |
3285 | - $("#modelsettingsbackground").css("display", "none"); | |
3282 | + $('#modal-settings').css("display", "none"); | |
3283 | + $("#modelsettingsbackground").css("display", "none"); | |
3286 | 3284 | // $("#setting-spinner").css("display", "none"); |
3287 | - $("#setting-spinner").css("display", "block"); | |
3285 | + $("#setting-spinner").css("display", "block"); | |
3288 | 3286 | |
3289 | - // }, 6000); | |
3287 | + // }, 6000); | |
3290 | 3288 | }; |
3291 | 3289 | |
3292 | 3290 | |
... | ... | @@ -3408,7 +3406,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3408 | 3406 | $(".modal-backdrop").css("z-index", "1200001"); |
3409 | 3407 | }; |
3410 | 3408 | |
3411 | - | |
3409 | + | |
3412 | 3410 | |
3413 | 3411 | $rootScope.ShowPrintWindow = function () { // Print Active Viewer |
3414 | 3412 | html2canvas($("#canvasDiv"), { |
... | ... | @@ -3451,8 +3449,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3451 | 3449 | var curPosture = localStorage.getItem('currentViewTitle'); |
3452 | 3450 | |
3453 | 3451 | if (document.getElementById('jsPanel-1')) { //document.getElementsByClassName('ppImagePanel')) { |
3454 | - if (dataURL == "" || dataURL == undefined) | |
3455 | - { | |
3452 | + if (dataURL == "" || dataURL == undefined) { | |
3456 | 3453 | |
3457 | 3454 | setTimeout(function () { |
3458 | 3455 | document.getElementById('imgPortrait').setAttribute('src', dataURL); |
... | ... | @@ -3467,8 +3464,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3467 | 3464 | } |
3468 | 3465 | }, 520); |
3469 | 3466 | } |
3470 | - else | |
3471 | - { | |
3467 | + else { | |
3472 | 3468 | setTimeout(function () { |
3473 | 3469 | document.getElementById('imgPortrait').setAttribute('src', dataURL); |
3474 | 3470 | document.getElementById('imgLandscape').setAttribute('src', dataURL); |
... | ... | @@ -3482,14 +3478,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3482 | 3478 | } |
3483 | 3479 | }, 320); |
3484 | 3480 | } |
3485 | - | |
3481 | + | |
3486 | 3482 | } |
3487 | 3483 | |
3488 | 3484 | $('#fileMenuAnchor').addClass('disableMenuannotation'); |
3489 | 3485 | if ($('#daImagePanel').length > 0) { |
3490 | 3486 | console.log('close') |
3491 | 3487 | //$('#daImagePanel').css('display', 'none'); |
3492 | - // $('#daImagePanel').remove(); | |
3488 | + // $('#daImagePanel').remove(); | |
3493 | 3489 | } |
3494 | 3490 | } |
3495 | 3491 | }); |
... | ... | @@ -3607,7 +3603,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3607 | 3603 | } |
3608 | 3604 | |
3609 | 3605 | $(document).on('click', '#jsPanel-1 .jsglyph-remove', function () { |
3610 | - $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); | |
3606 | + $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); | |
3611 | 3607 | $("#ciImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); |
3612 | 3608 | $("#annotationButton").parent().removeClass("disableMenuannotation"); |
3613 | 3609 | $("#annotationToolBarOptions").removeClass("disableMenuoption"); |
... | ... | @@ -3693,62 +3689,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3693 | 3689 | }; |
3694 | 3690 | |
3695 | 3691 | $rootScope.resetDrawing = function (e) { |
3696 | - | |
3697 | - $('#canvas').removeLayers(); | |
3698 | - | |
3699 | - }; | |
3700 | 3692 | |
3693 | + $('#canvas').removeLayers(); | |
3701 | 3694 | |
3702 | - $rootScope.DrawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) { | |
3703 | - | |
3704 | - var radial = $('#' + canvasId).createGradient({ | |
3705 | - x1: 50, y1: 50, | |
3706 | - x2: 50, y2: 50, | |
3707 | - r1: 10, r2: 30, | |
3708 | - c1: 'rgba(100, 50, 0,0)', | |
3709 | - c2: 'rgb(216, 216, 216)' | |
3710 | - }); | |
3711 | - $('#' + canvasId).drawLine({ | |
3712 | - | |
3713 | - layer: true, | |
3714 | - name: "Pin_" + PinId, | |
3715 | - groups: ["Pin_" + PinId], | |
3716 | - strokeStyle: 'black', | |
3717 | - strokeWidth: 2, | |
3718 | - x1: offsetX1, y1: offsetY1, | |
3719 | - x2: x, y2: y, | |
3720 | - | |
3721 | - }).drawArc({ | |
3722 | - name: "ArcPin_" + PinId, | |
3723 | - layer: true, | |
3724 | - groups: ["Pin_" + PinId], | |
3725 | - strokeStyle: 'grey', | |
3726 | - strokeWidth: 2, | |
3727 | - fillStyle: radial, | |
3728 | - x: x, y: y, | |
3729 | - radius: 5, | |
3730 | - | |
3731 | - click: function (clickedPin) { | |
3732 | - | |
3733 | - var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ | |
3734 | - x1: 50, y1: 50, | |
3735 | - x2: 50, y2: 50, | |
3736 | - r1: 10, r2: 30, | |
3737 | - c1: 'rgba(100, 50, 0,0)', | |
3738 | - c2: 'rgb(126, 187, 83)' | |
3739 | - }); | |
3740 | - | |
3741 | - clickedPin.fillStyle = radialAfterClick; | |
3742 | - | |
3743 | - var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); | |
3744 | - // alert('pinId: ' + pinID); | |
3745 | - //showAnnotation(); | |
3746 | - | |
3747 | - } | |
3695 | + }; | |
3748 | 3696 | |
3749 | - }).drawLayers(); | |
3750 | 3697 | |
3751 | - } | |
3698 | + | |
3752 | 3699 | |
3753 | 3700 | }] |
3754 | 3701 | ); |
3755 | 3702 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -194,16 +194,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
194 | 194 | if (actualX >= pinHeadX && actualX <= pinHeadRight && actualY <= pinHeadY && actualY >= pinHeadTop) { |
195 | 195 | alert('clicked pin = ' + value._PinId + ' and _TermId= ' + value._TermId); |
196 | 196 | var termNumber = value._TermId; |
197 | - | |
197 | + | |
198 | 198 | var selectedPinTermData = new jinqJs() |
199 | 199 | .from($scope.TermInfo) |
200 | 200 | .where("__ActualTermNumber == " + termNumber) |
201 | 201 | .select(); |
202 | 202 | var annotationText = selectedPinTermData[0].__TermText; |
203 | - // $scope.MultiLanguageAnnationArray = []; | |
204 | - // $scope.MultiLanguageAnnationArray.push(annotationText); | |
205 | - | |
206 | - // $scope.createSpeechBubble(pinHeadX, pinHeadY, value._PinId); | |
203 | + // $scope.MultiLanguageAnnationArray = []; | |
204 | + // $scope.MultiLanguageAnnationArray.push(annotationText); | |
205 | + | |
206 | + // $scope.createSpeechBubble(pinHeadX, pinHeadY, value._PinId); | |
207 | 207 | } |
208 | 208 | //alert('pinId ='+value._PinId+', pinHeadX =' + pinHeadX + ',pinHeadY= ' + pinHeadY + ',pinHeadRight= ' + pinHeadRight + ',pinHeadTop =' + pinHeadTop); |
209 | 209 | }); |
... | ... | @@ -235,12 +235,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
235 | 235 | $scope.aaPinData = result.data.Root.Item; |
236 | 236 | angular.forEach($scope.aaPinData, function (value, key) { |
237 | 237 | |
238 | - $rootScope.DrawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY, $rootScope.pinID) | |
238 | + $scope.DrawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY, $rootScope.pinID) | |
239 | 239 | }) |
240 | 240 | |
241 | 241 | }, |
242 | 242 | function (error) { |
243 | - | |
243 | + | |
244 | 244 | console.log(' error in showAllPins: ' + error.statusText); |
245 | 245 | } |
246 | 246 | ) |
... | ... | @@ -361,7 +361,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
361 | 361 | |
362 | 362 | if (selectimg === true && count >= filtercount) { |
363 | 363 | |
364 | - | |
364 | + | |
365 | 365 | $scope.imagePath = "../content/images/aa/thumbnails/" + value._TileImageName; |
366 | 366 | |
367 | 367 | var $el = $('<div id="' + value._id + '" class="col-sm-3 col-md-3" title = "' + value._Title + '" data-ng-click="openModuleItemView($event)">' |
... | ... | @@ -450,7 +450,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
450 | 450 | |
451 | 451 | //1.Remove all the pins first |
452 | 452 | $scope.ClearAllPins(); |
453 | - | |
453 | + | |
454 | 454 | var selectedSystemName = event.currentTarget.title; |
455 | 455 | //2. get pinData |
456 | 456 | var promise = ModuleService.getPinDataForImage($rootScope.imageName) |
... | ... | @@ -466,39 +466,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
466 | 466 | |
467 | 467 | $scope.TermInfo = response.data.Terms.Term; |
468 | 468 | |
469 | - //on gettng all required data, draw pins | |
470 | - var selectedSystemPinData = new jinqJs() | |
471 | - .from($scope.aaPinData) | |
472 | - .where("_BodySystemName == " + selectedSystemName) | |
473 | - .select(); | |
474 | - angular.forEach(selectedSystemPinData, function (value, key) { | |
469 | + //on gettng all required data, draw pins | |
470 | + var selectedSystemPinData = new jinqJs() | |
471 | + .from($scope.aaPinData) | |
472 | + .where("_BodySystemName == " + selectedSystemName) | |
473 | + .select(); | |
474 | + angular.forEach(selectedSystemPinData, function (value, key) { | |
475 | + | |
476 | + $scope.context.beginPath(); | |
477 | + $scope.context.moveTo(value._PinX, value._PinY); | |
478 | + $scope.context.lineTo(value._HeadX, value._HeadY); | |
479 | + $scope.context.stroke(); | |
475 | 480 | |
476 | - $scope.context.beginPath(); | |
477 | - $scope.context.moveTo(value._PinX, value._PinY); | |
478 | - $scope.context.lineTo(value._HeadX, value._HeadY); | |
479 | - $scope.context.stroke(); | |
481 | + var headX = (parseInt(value._HeadX)) - 20; | |
482 | + var headY = (parseInt(value._HeadY)) - 15; | |
480 | 483 | |
481 | - var headX = (parseInt(value._HeadX)) - 20; | |
482 | - var headY = (parseInt(value._HeadY)) - 15; | |
484 | + var img = new Image(); | |
485 | + img.src = "~/../../../content/images/noraml-pin.png"; | |
486 | + img.onload = function () { | |
487 | + $scope.context.drawImage(img, headX, headY); | |
483 | 488 | |
484 | - var img = new Image(); | |
485 | - img.src = "~/../../../content/images/noraml-pin.png"; | |
486 | - img.onload = function () { | |
487 | - $scope.context.drawImage(img, headX, headY); | |
488 | 489 | |
489 | - | |
490 | - } | |
491 | - }) | |
490 | + } | |
491 | + }) | |
492 | 492 | //show annotation on first pin of the sysyem |
493 | - $scope.showAnnotation(selectedSystemPinData); | |
494 | - }, | |
493 | + $scope.showAnnotation(selectedSystemPinData); | |
494 | + }, | |
495 | 495 | function (error) { |
496 | 496 | // handle errors here |
497 | 497 | console.log(' error: ' + error.statusText); |
498 | 498 | } |
499 | 499 | ) |
500 | 500 | |
501 | - | |
501 | + | |
502 | 502 | |
503 | 503 | console.log(JSON.stringify(result, null, 4)); |
504 | 504 | }, |
... | ... | @@ -509,8 +509,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
509 | 509 | ) |
510 | 510 | } |
511 | 511 | |
512 | - $scope.showAnnotation = function (selectedSystemPinData) | |
513 | - { | |
512 | + $scope.showAnnotation = function (selectedSystemPinData) { | |
514 | 513 | |
515 | 514 | var firstPinId = selectedSystemPinData[0]._PinId; |
516 | 515 | var pinTermNumber = selectedSystemPinData[0]._TermId; |
... | ... | @@ -520,6 +519,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
520 | 519 | .from($scope.aaPinData) |
521 | 520 | .where("_TermId == " + pinTermNumber) |
522 | 521 | .select(); |
522 | + | |
523 | + | |
524 | + | |
525 | + //3. get termText info | |
526 | + var promise = ModuleService.getTermTextForPin($scope.moduleName) | |
527 | + .then( | |
528 | + function (response) { | |
529 | + | |
530 | + $scope.TermInfo = response.data.Terms.Term; | |
531 | + | |
532 | + | |
523 | 533 | var termTextdata = new jinqJs() |
524 | 534 | .from($scope.TermInfo) |
525 | 535 | .where("__ActualTermNumber == " + pinTermNumber) |
... | ... | @@ -527,13 +537,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
527 | 537 | var termText = termTextdata[0].__TermText; |
528 | 538 | $scope.MultiLanguageAnnationArray = []; |
529 | 539 | $scope.MultiLanguageAnnationArray.push(termText); |
530 | - angular.forEach(pinDataWithFirstTermNumber, function (value, key) { | |
540 | + $scope.selectedPin = []; | |
531 | 541 | |
542 | + angular.forEach(pinDataWithFirstTermNumber, function (value, key) { | |
543 | + $scope.selectedPin.push(value._PinId); | |
532 | 544 | var headX = (parseInt(value._HeadX)); |
533 | 545 | var headY = (parseInt(value._HeadY)); |
534 | - $scope.createSpeechBubble(headX, parseInt(headY),value._PinId); | |
535 | - // alert('headX: ' + headX + ', headY: ' + headY + ',termText: ' + termText); | |
546 | + $scope.createSpeechBubble(parseInt(headX)+10, parseInt(headY)+10, value._PinId); | |
536 | 547 | }) |
548 | + }, | |
549 | + function(error){}) | |
537 | 550 | } |
538 | 551 | |
539 | 552 | $scope.ClearAllPins = function () { |
... | ... | @@ -549,8 +562,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
549 | 562 | //1. In transparency box we shows two annotation at a time, so we need to decide the max length of annotation in btween two annotation because based on that |
550 | 563 | // we decide the size of speech bubble |
551 | 564 | $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; }); |
552 | - $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y,PinId); | |
553 | - | |
565 | + $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y, PinId); | |
566 | + | |
554 | 567 | //2. |
555 | 568 | //if (event.ctrlKey) { |
556 | 569 | // console.log('ctrl pressed'); |
... | ... | @@ -590,32 +603,32 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
590 | 603 | // $(this).parent().parent().parent().remove(); |
591 | 604 | // }); |
592 | 605 | //} |
593 | - // else { | |
594 | - // $scope.multiAnnotationIsON = false; | |
595 | - //history maintained issue | |
596 | - //if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { | |
597 | - // $("#sppeachBubble").remove(); | |
598 | - // $("#dot").remove(); | |
599 | - //} | |
600 | - // $(".com").remove(); | |
601 | - // $("#bord").remove(); | |
602 | - | |
603 | - //history maintained issue | |
604 | - //if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "60000"; } | |
605 | - //$('#sppeachBubble').draggable( | |
606 | - //{ | |
607 | - // drag: function (evt) { | |
608 | - // $("#dot").css("visibility", "hidden"); | |
609 | - // var verticalScrollPosition = canvasDiv.scrollTop; | |
610 | - // var horizontlScrollPosition = canvasDiv.scrollLeft; | |
611 | - // $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | |
612 | - // }, | |
613 | - //}); | |
614 | - //$('.crossDiv_temp').on('click', function (evt) { | |
615 | - // $('#sppeachBubble').remove(); | |
616 | - // $("#bord").remove(); | |
617 | - // $("#dot").remove(); | |
618 | - //}); | |
606 | + // else { | |
607 | + // $scope.multiAnnotationIsON = false; | |
608 | + //history maintained issue | |
609 | + //if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { | |
610 | + // $("#sppeachBubble").remove(); | |
611 | + // $("#dot").remove(); | |
612 | + //} | |
613 | + // $(".com").remove(); | |
614 | + // $("#bord").remove(); | |
615 | + | |
616 | + //history maintained issue | |
617 | + //if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "60000"; } | |
618 | + //$('#sppeachBubble').draggable( | |
619 | + //{ | |
620 | + // drag: function (evt) { | |
621 | + // $("#dot").css("visibility", "hidden"); | |
622 | + // var verticalScrollPosition = canvasDiv.scrollTop; | |
623 | + // var horizontlScrollPosition = canvasDiv.scrollLeft; | |
624 | + // $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | |
625 | + // }, | |
626 | + //}); | |
627 | + //$('.crossDiv_temp').on('click', function (evt) { | |
628 | + // $('#sppeachBubble').remove(); | |
629 | + // $("#bord").remove(); | |
630 | + // $("#dot").remove(); | |
631 | + //}); | |
619 | 632 | //} |
620 | 633 | } |
621 | 634 | |
... | ... | @@ -753,7 +766,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
753 | 766 | var sppechBubbleDotHTML = '<div id="speechBubbleLine' + PinId + '" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>' |
754 | 767 | + '<div id="sppeachBubble' + PinId + '" class="common-drag" style="height:auto!important;z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">' |
755 | 768 | + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">' |
756 | - + '<img id="closeBtn'+PinId+'"class="crossDiv_temp" style="width:18px" src=' + $rootScope.closeBtnImgPath + '></span></div>' | |
769 | + + '<img id="closeBtn' + PinId + '"class="crossDiv_temp" style="width:18px" src=' + $rootScope.closeBtnImgPath + '></span></div>' | |
757 | 770 | |
758 | 771 | + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="speechBubbleDraggedLine' + PinId + '">' |
759 | 772 | + '</div>'; |
... | ... | @@ -771,7 +784,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
771 | 784 | if ($scope.MultiLanguageAnnationArray.length > 0) { |
772 | 785 | for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { |
773 | 786 | var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; |
774 | - $("#sppeachBubble"+PinId).append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>"); | |
787 | + $("#sppeachBubble" + PinId).append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>"); | |
775 | 788 | } |
776 | 789 | } |
777 | 790 | else { |
... | ... | @@ -828,14 +841,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
828 | 841 | var Globe = []; |
829 | 842 | debugger; |
830 | 843 | $rootScope.Globe1.push({ "currentX": x, "currentY": y, "id": PinId }); |
831 | - Globe.push({ currentX: x, currentY: y}); | |
844 | + Globe.push({ currentX: x, currentY: y }); | |
832 | 845 | document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block'; |
833 | 846 | document.getElementById('speechBubbleLine' + PinId + '').style.left = ((Globe[0].currentX - 45)) + 'px'; |
834 | 847 | document.getElementById('speechBubbleLine' + PinId + '').style.top = ((Globe[0].currentY) - 20) + 'px'; |
835 | 848 | document.getElementById('sppeachBubble' + PinId + '').style.display = 'block'; |
836 | 849 | document.getElementById('sppeachBubble' + PinId + '').style.left = (Globe[0].currentX - 70) + 'px'; |
837 | 850 | document.getElementById('sppeachBubble' + PinId + '').style.top = (Globe[0].currentY - 58) + 'px'; |
838 | - | |
851 | + | |
839 | 852 | $('.common-drag').draggable( |
840 | 853 | { |
841 | 854 | drag: function (evt) { |
... | ... | @@ -843,24 +856,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
843 | 856 | var verticalScrollPosition = document.getElementById('imageDiv').scrollTop; |
844 | 857 | var horizontlScrollPosition = document.getElementById('imageDiv').scrollLeft; |
845 | 858 | var a = $(this).attr("id"); |
846 | - | |
859 | + | |
847 | 860 | var res = a.substring(13, a.length); |
848 | 861 | $("#speechBubbleLine" + res).css("visibility", "hidden"); |
849 | - | |
850 | - // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", ""); | |
862 | + | |
863 | + // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", ""); | |
851 | 864 | // alert(c); |
852 | - //var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", ""); | |
865 | + //var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", ""); | |
853 | 866 | // alert(d); |
854 | - console.log("res= " + res + "x= " + x + ",y= " + y + ",evt.pageY= " + evt.page + ",evt.pageX= " + evt.pageX + ",horizontlScrollPosition= " + horizontlScrollPosition + ",verticalScrollPosition= " + verticalScrollPosition); | |
855 | - | |
856 | - // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition); | |
857 | - for (var i = 0; i <= $rootScope.Globe1.length - 1; i++) { | |
858 | - if ($rootScope.Globe1[i].id == res) { | |
859 | - // alert($rootScope.Globe1[i].currentX); | |
860 | - $scope.angle(res, $rootScope.Globe1[i].currentX, $rootScope.Globe1[i].currentY, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | |
861 | - } | |
862 | - } | |
863 | - | |
867 | + console.log("res= " + res + "x= " + x + ",y= " + y + ",evt.pageY= " + evt.page + ",evt.pageX= " + evt.pageX + ",horizontlScrollPosition= " + horizontlScrollPosition + ",verticalScrollPosition= " + verticalScrollPosition); | |
868 | + | |
869 | + // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition); | |
870 | + for (var i = 0; i <= $rootScope.Globe1.length - 1; i++) { | |
871 | + if ($rootScope.Globe1[i].id == res) { | |
872 | + // alert($rootScope.Globe1[i].currentX); | |
873 | + $scope.angle(res, $rootScope.Globe1[i].currentX, $rootScope.Globe1[i].currentY, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | |
874 | + } | |
875 | + } | |
876 | + | |
864 | 877 | }, |
865 | 878 | }); |
866 | 879 | $('.crossDiv_temp').on('click', function (evt) { |
... | ... | @@ -871,44 +884,104 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
871 | 884 | $("#speechBubbleLine" + pinId).remove(); |
872 | 885 | }); |
873 | 886 | } |
874 | - | |
875 | - | |
876 | - $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { | |
877 | - // debugger; | |
878 | - // alert(ex + " " + ey); | |
879 | - var dy = ey - cy; | |
880 | - var dx = ex - cx; | |
881 | - var theta = 0; | |
882 | - if (dx < 0) { | |
883 | - theta = Math.atan(dy / dx) * (180 / Math.PI); | |
884 | - theta = theta + 180; | |
885 | 887 | |
886 | - } | |
887 | - else if (dy < 0) { | |
888 | - theta = Math.atan(dy / dx) * (180 / Math.PI); | |
889 | - theta = theta + 360; | |
890 | 888 | |
891 | - } | |
892 | - else { | |
893 | - theta = Math.atan(dy / dx) * (180 / Math.PI); | |
894 | - } | |
895 | - | |
896 | - var d = Math.sqrt((cx - ex) * (cx - ex) + (cy - ey) * (cy - ey)); | |
897 | - var e = cy; | |
898 | - var f = cx; | |
899 | - // alert(d); | |
900 | - if (BoolValues == true) { | |
901 | - $("#speechBubbleDraggedLine"+id).css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); | |
902 | - } | |
903 | - else { | |
904 | - $("#bord_annotation").css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); | |
905 | - } | |
889 | + $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { | |
890 | + // debugger; | |
891 | + // alert(ex + " " + ey); | |
892 | + var dy = ey - cy; | |
893 | + var dx = ex - cx; | |
894 | + var theta = 0; | |
895 | + if (dx < 0) { | |
896 | + theta = Math.atan(dy / dx) * (180 / Math.PI); | |
897 | + theta = theta + 180; | |
906 | 898 | |
899 | + } | |
900 | + else if (dy < 0) { | |
901 | + theta = Math.atan(dy / dx) * (180 / Math.PI); | |
902 | + theta = theta + 360; | |
907 | 903 | |
904 | + } | |
905 | + else { | |
906 | + theta = Math.atan(dy / dx) * (180 / Math.PI); | |
907 | + } | |
908 | 908 | |
909 | + var d = Math.sqrt((cx - ex) * (cx - ex) + (cy - ey) * (cy - ey)); | |
910 | + var e = cy; | |
911 | + var f = cx; | |
912 | + // alert(d); | |
913 | + if (BoolValues == true) { | |
914 | + $("#speechBubbleDraggedLine" + id).css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); | |
915 | + } | |
916 | + else { | |
917 | + $("#bord_annotation").css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); | |
909 | 918 | } |
910 | 919 | |
911 | - | |
920 | + | |
921 | + | |
922 | + } | |
923 | + | |
924 | + | |
925 | + $scope.DrawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) { | |
926 | + | |
927 | + var radial = $('#' + canvasId).createGradient({ | |
928 | + x1: 50, y1: 50, | |
929 | + x2: 50, y2: 50, | |
930 | + r1: 10, r2: 30, | |
931 | + c1: 'rgba(100, 50, 0,0)', | |
932 | + c2: 'rgb(216, 216, 216)' | |
933 | + }); | |
934 | + $('#' + canvasId).drawLine({ | |
935 | + | |
936 | + layer: true, | |
937 | + name: "Pin_" + PinId, | |
938 | + groups: ["Pin_" + PinId], | |
939 | + strokeStyle: 'black', | |
940 | + strokeWidth: 2, | |
941 | + x1: offsetX1, y1: offsetY1, | |
942 | + x2: x, y2: y, | |
943 | + | |
944 | + }).drawArc({ | |
945 | + name: "ArcPin_" + PinId, | |
946 | + layer: true, | |
947 | + groups: ["Pin_" + PinId], | |
948 | + strokeStyle: 'grey', | |
949 | + strokeWidth: 2, | |
950 | + fillStyle: radial, | |
951 | + x: x, y: y, | |
952 | + radius: 5, | |
953 | + | |
954 | + click: function (clickedPin) { | |
955 | + | |
956 | + //change the head color to green | |
957 | + var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ | |
958 | + x1: 50, y1: 50, | |
959 | + x2: 50, y2: 50, | |
960 | + r1: 10, r2: 30, | |
961 | + c1: 'rgba(100, 50, 0,0)', | |
962 | + c2: 'rgb(126, 187, 83)' | |
963 | + }); | |
964 | + | |
965 | + clickedPin.fillStyle = radialAfterClick; | |
966 | + | |
967 | + var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); | |
968 | + // alert('pinId: ' + pinID); | |
969 | + //showAnnotation(); | |
970 | + var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); | |
971 | + var selectedPinData = new jinqJs() | |
972 | + .from($scope.aaPinData) | |
973 | + .where("_PinId == " + pinID) | |
974 | + .select(); | |
975 | + $scope.showAnnotation(selectedPinData); | |
976 | + | |
977 | + | |
978 | + | |
979 | + } | |
980 | + | |
981 | + }).drawLayers(); | |
982 | + | |
983 | + } | |
984 | + | |
912 | 985 | }]); |
913 | 986 | |
914 | 987 | function showSelectedSystemPins(event) { | ... | ... |