diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index a95c66d..63207b6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -87,16 +87,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.haveRoleAdmin; var isfilloptionChecked = ""; var isOutlineOptionChecked = ""; - $rootScope.forgotPwdModalShow = function () - { + $rootScope.forgotPwdModalShow = function () { $("#forgotPwdModal").modal("show"); - $(".modal-backdrop").css("opacity",".5"); + $(".modal-backdrop").css("opacity", ".5"); } - $rootScope.forgotUserModalShow=function() - { + $rootScope.forgotUserModalShow = function () { $("#forgotUserModal").modal("show"); $(".modal-backdrop").css("opacity", ".5"); - + } $rootScope.initializeAIA = function () { @@ -141,10 +139,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic else { if (result.loginId != undefined || result.loginId != "" || result.loginId != null) { - if ($("#messageModal").length > 0){ - + if ($("#messageModal").length > 0) { + $("#messageModal").modal('hide'); - } + } $rootScope.userData = result; $rootScope.userModules = result.modules; $rootScope.isVisibleLogin = false; @@ -159,7 +157,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic else $rootScope.haveRoleAdmin = true; } - + } } }, @@ -285,7 +283,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } }; - + function validateEmail(email) { @@ -305,42 +303,42 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if (userInfo.newPassword === userInfo.confirmPassword) { $rootScope.passwordMismatchMessage = null; - AuthenticationService.ResetUserPassword(userInfo) - .then( - function (result) { - if (result == LoginConstants.USER_NOT_FOUND) { - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); - $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; - $("#messageModal").modal('show'); - - } - else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; - $("#messageModal").modal('show'); + AuthenticationService.ResetUserPassword(userInfo) + .then( + function (result) { + if (result == LoginConstants.USER_NOT_FOUND) { + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; + $("#messageModal").modal('show'); - } - else { - if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; + } + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); - $rootScope.isVisibleLogin = true; - $rootScope.isVisibleResetPass = false; - $location.url("/"); + } - } - }, - function (error) { - console.log(' Error in authentication = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; - $("#messageModal").modal('show'); + else { + if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { + // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; + $("#messageModal").modal('show'); + $rootScope.isVisibleLogin = true; + $rootScope.isVisibleResetPass = false; + $location.url("/"); + } + } + }, + function (error) { + console.log(' Error in authentication = ' + error.statusText); + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $("#messageModal").modal('show'); - }); - } - else { - $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; + }); + } + else { + $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; //$("#messageModal").modal('show'); } } @@ -366,9 +364,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic dataType: "json", success: function (result) { $(result.root.uc.al.lx).each(function (key, value) { - + $('#lexiconLangDropdown').append(''); - + }); } @@ -404,7 +402,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.isActiveLexiconLanguageClicked = false; $("#secondLax :selected").remove(); $('#lexiconLangDropdown').append(''); - // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); + // $rootScope.lexiconLanguageArray.splice($rootScope.secondlaxtext, 1); $rootScope.lexiconLanguageArray = []; $("#secondLax > option").each(function () { $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value }); @@ -431,7 +429,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if ($.browser.msie) { $("#resetBtn").css("display", "inline-block"); - // $rootScope.refreshCanvas(); + // $rootScope.refreshCanvas(); } $(function () { @@ -559,14 +557,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.getModuleScrollPosition = function () { $('.mCSB_container ul li').click(function () { - + $rootScope.scrollTopPosition = $(this).position().top; - + }); setTimeout(function () { $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px"); - + }, 300); @@ -584,7 +582,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if (openViews.length > 0) { var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; } - // $('#daImagePanel').remove(); + // $('#daImagePanel').remove(); if ($('#jsPanel-1').length > 0) $('#jsPanel-1').remove(); @@ -3070,7 +3068,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.disableAnnotationtoolOnListManager = false; $rootScope.ShowListManager = function () { - + $rootScope.switchCanvas(); $("#annotationpaintbrushsize").attr("href", "#"); $("#annotationpainteraser").attr("href", "#"); @@ -3092,7 +3090,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $rootScope.islistManagerEventAlredayDispachted = true; $rootScope.$broadcast('listManagerEvent', true); - + if ($rootScope.selectedBodySystemName == undefined && $rootScope.slectedActualTermNumber == undefined) { $('#termList option[selected="selected"]').prop("selected", false); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); @@ -3113,7 +3111,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $('#bodySystems option[value="' + $rootScope.selectedBodySystemName + '"]').prop("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); - + } $("#optionsListManagerTab").addClass("active"); var viewNameAftrSplit = $("#viewName").val().split(" "); @@ -3276,17 +3274,17 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } $rootScope.UpdateAndCloseSetting = function (setting) { - // debugger; + // debugger; $rootScope.UpdateSetting(setting); $rootScope.loadSearchDataForBodyView(); - + //$timeout(function () { - $('#modal-settings').css("display", "none"); - $("#modelsettingsbackground").css("display", "none"); + $('#modal-settings').css("display", "none"); + $("#modelsettingsbackground").css("display", "none"); // $("#setting-spinner").css("display", "none"); - $("#setting-spinner").css("display", "block"); + $("#setting-spinner").css("display", "block"); - // }, 6000); + // }, 6000); }; @@ -3408,7 +3406,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic $(".modal-backdrop").css("z-index", "1200001"); }; - + $rootScope.ShowPrintWindow = function () { // Print Active Viewer html2canvas($("#canvasDiv"), { @@ -3451,8 +3449,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var curPosture = localStorage.getItem('currentViewTitle'); if (document.getElementById('jsPanel-1')) { //document.getElementsByClassName('ppImagePanel')) { - if (dataURL == "" || dataURL == undefined) - { + if (dataURL == "" || dataURL == undefined) { setTimeout(function () { document.getElementById('imgPortrait').setAttribute('src', dataURL); @@ -3467,8 +3464,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } }, 520); } - else - { + else { setTimeout(function () { document.getElementById('imgPortrait').setAttribute('src', dataURL); document.getElementById('imgLandscape').setAttribute('src', dataURL); @@ -3482,14 +3478,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } }, 320); } - + } $('#fileMenuAnchor').addClass('disableMenuannotation'); if ($('#daImagePanel').length > 0) { console.log('close') //$('#daImagePanel').css('display', 'none'); - // $('#daImagePanel').remove(); + // $('#daImagePanel').remove(); } } }); @@ -3607,7 +3603,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic } $(document).on('click', '#jsPanel-1 .jsglyph-remove', function () { - $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); + $("#daImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); $("#ciImagePanel").css({ "pointer-events": "auto", "opacity": "1" }); $("#annotationButton").parent().removeClass("disableMenuannotation"); $("#annotationToolBarOptions").removeClass("disableMenuoption"); @@ -3693,62 +3689,13 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic }; $rootScope.resetDrawing = function (e) { - - $('#canvas').removeLayers(); - - }; + $('#canvas').removeLayers(); - $rootScope.DrawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) { - - var radial = $('#' + canvasId).createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(216, 216, 216)' - }); - $('#' + canvasId).drawLine({ - - layer: true, - name: "Pin_" + PinId, - groups: ["Pin_" + PinId], - strokeStyle: 'black', - strokeWidth: 2, - x1: offsetX1, y1: offsetY1, - x2: x, y2: y, - - }).drawArc({ - name: "ArcPin_" + PinId, - layer: true, - groups: ["Pin_" + PinId], - strokeStyle: 'grey', - strokeWidth: 2, - fillStyle: radial, - x: x, y: y, - radius: 5, - - click: function (clickedPin) { - - var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ - x1: 50, y1: 50, - x2: 50, y2: 50, - r1: 10, r2: 30, - c1: 'rgba(100, 50, 0,0)', - c2: 'rgb(126, 187, 83)' - }); - - clickedPin.fillStyle = radialAfterClick; - - var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); - // alert('pinId: ' + pinID); - //showAnnotation(); - - } + }; - }).drawLayers(); - } + }] ); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index eb069f8..a1c59e0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -194,16 +194,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (actualX >= pinHeadX && actualX <= pinHeadRight && actualY <= pinHeadY && actualY >= pinHeadTop) { alert('clicked pin = ' + value._PinId + ' and _TermId= ' + value._TermId); var termNumber = value._TermId; - + var selectedPinTermData = new jinqJs() .from($scope.TermInfo) .where("__ActualTermNumber == " + termNumber) .select(); var annotationText = selectedPinTermData[0].__TermText; - // $scope.MultiLanguageAnnationArray = []; - // $scope.MultiLanguageAnnationArray.push(annotationText); - - // $scope.createSpeechBubble(pinHeadX, pinHeadY, value._PinId); + // $scope.MultiLanguageAnnationArray = []; + // $scope.MultiLanguageAnnationArray.push(annotationText); + + // $scope.createSpeechBubble(pinHeadX, pinHeadY, value._PinId); } //alert('pinId ='+value._PinId+', pinHeadX =' + pinHeadX + ',pinHeadY= ' + pinHeadY + ',pinHeadRight= ' + pinHeadRight + ',pinHeadTop =' + pinHeadTop); }); @@ -235,12 +235,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.aaPinData = result.data.Root.Item; angular.forEach($scope.aaPinData, function (value, key) { - $rootScope.DrawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY, $rootScope.pinID) + $scope.DrawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY, $rootScope.pinID) }) }, function (error) { - + console.log(' error in showAllPins: ' + error.statusText); } ) @@ -361,7 +361,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (selectimg === true && count >= filtercount) { - + $scope.imagePath = "../content/images/aa/thumbnails/" + value._TileImageName; var $el = $('
" + MultipleLanguage + "
"); + $("#sppeachBubble" + PinId).append("" + MultipleLanguage + "
"); } } else { @@ -828,14 +841,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var Globe = []; debugger; $rootScope.Globe1.push({ "currentX": x, "currentY": y, "id": PinId }); - Globe.push({ currentX: x, currentY: y}); + Globe.push({ currentX: x, currentY: y }); document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block'; document.getElementById('speechBubbleLine' + PinId + '').style.left = ((Globe[0].currentX - 45)) + 'px'; document.getElementById('speechBubbleLine' + PinId + '').style.top = ((Globe[0].currentY) - 20) + 'px'; document.getElementById('sppeachBubble' + PinId + '').style.display = 'block'; document.getElementById('sppeachBubble' + PinId + '').style.left = (Globe[0].currentX - 70) + 'px'; document.getElementById('sppeachBubble' + PinId + '').style.top = (Globe[0].currentY - 58) + 'px'; - + $('.common-drag').draggable( { drag: function (evt) { @@ -843,24 +856,24 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var verticalScrollPosition = document.getElementById('imageDiv').scrollTop; var horizontlScrollPosition = document.getElementById('imageDiv').scrollLeft; var a = $(this).attr("id"); - + var res = a.substring(13, a.length); $("#speechBubbleLine" + res).css("visibility", "hidden"); - - // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", ""); + + // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", ""); // alert(c); - //var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", ""); + //var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", ""); // alert(d); - console.log("res= " + res + "x= " + x + ",y= " + y + ",evt.pageY= " + evt.page + ",evt.pageX= " + evt.pageX + ",horizontlScrollPosition= " + horizontlScrollPosition + ",verticalScrollPosition= " + verticalScrollPosition); - - // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition); - for (var i = 0; i <= $rootScope.Globe1.length - 1; i++) { - if ($rootScope.Globe1[i].id == res) { - // alert($rootScope.Globe1[i].currentX); - $scope.angle(res, $rootScope.Globe1[i].currentX, $rootScope.Globe1[i].currentY, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); - } - } - + console.log("res= " + res + "x= " + x + ",y= " + y + ",evt.pageY= " + evt.page + ",evt.pageX= " + evt.pageX + ",horizontlScrollPosition= " + horizontlScrollPosition + ",verticalScrollPosition= " + verticalScrollPosition); + + // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition); + for (var i = 0; i <= $rootScope.Globe1.length - 1; i++) { + if ($rootScope.Globe1[i].id == res) { + // alert($rootScope.Globe1[i].currentX); + $scope.angle(res, $rootScope.Globe1[i].currentX, $rootScope.Globe1[i].currentY, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); + } + } + }, }); $('.crossDiv_temp').on('click', function (evt) { @@ -871,44 +884,104 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $("#speechBubbleLine" + pinId).remove(); }); } - - - $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { - // debugger; - // alert(ex + " " + ey); - var dy = ey - cy; - var dx = ex - cx; - var theta = 0; - if (dx < 0) { - theta = Math.atan(dy / dx) * (180 / Math.PI); - theta = theta + 180; - } - else if (dy < 0) { - theta = Math.atan(dy / dx) * (180 / Math.PI); - theta = theta + 360; - } - else { - theta = Math.atan(dy / dx) * (180 / Math.PI); - } - - var d = Math.sqrt((cx - ex) * (cx - ex) + (cy - ey) * (cy - ey)); - var e = cy; - var f = cx; - // alert(d); - if (BoolValues == true) { - $("#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%' }); - } - else { - $("#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%' }); - } + $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { + // debugger; + // alert(ex + " " + ey); + var dy = ey - cy; + var dx = ex - cx; + var theta = 0; + if (dx < 0) { + theta = Math.atan(dy / dx) * (180 / Math.PI); + theta = theta + 180; + } + else if (dy < 0) { + theta = Math.atan(dy / dx) * (180 / Math.PI); + theta = theta + 360; + } + else { + theta = Math.atan(dy / dx) * (180 / Math.PI); + } + var d = Math.sqrt((cx - ex) * (cx - ex) + (cy - ey) * (cy - ey)); + var e = cy; + var f = cx; + // alert(d); + if (BoolValues == true) { + $("#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%' }); + } + else { + $("#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%' }); } - + + + } + + + $scope.DrawStaticPinsOnImage = function (canvasId, PinId, offsetX1, offsetY1, x, y) { + + var radial = $('#' + canvasId).createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(216, 216, 216)' + }); + $('#' + canvasId).drawLine({ + + layer: true, + name: "Pin_" + PinId, + groups: ["Pin_" + PinId], + strokeStyle: 'black', + strokeWidth: 2, + x1: offsetX1, y1: offsetY1, + x2: x, y2: y, + + }).drawArc({ + name: "ArcPin_" + PinId, + layer: true, + groups: ["Pin_" + PinId], + strokeStyle: 'grey', + strokeWidth: 2, + fillStyle: radial, + x: x, y: y, + radius: 5, + + click: function (clickedPin) { + + //change the head color to green + var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ + x1: 50, y1: 50, + x2: 50, y2: 50, + r1: 10, r2: 30, + c1: 'rgba(100, 50, 0,0)', + c2: 'rgb(126, 187, 83)' + }); + + clickedPin.fillStyle = radialAfterClick; + + var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); + // alert('pinId: ' + pinID); + //showAnnotation(); + var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); + var selectedPinData = new jinqJs() + .from($scope.aaPinData) + .where("_PinId == " + pinID) + .select(); + $scope.showAnnotation(selectedPinData); + + + + } + + }).drawLayers(); + + } + }]); function showSelectedSystemPins(event) {