From 7b36999561b38547ae1e3917dab07e1fd0c67fc2 Mon Sep 17 00:00:00 2001 From: Birendra Date: Wed, 15 Sep 2021 08:45:26 +0530 Subject: [PATCH] making module responsive and redrawing annotations on resize panels --- 400-SOURCECODE/AIAHTML5.API/Models/Users.cs | 3 +++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js | 7 +++++-- 400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js | 13 ++++++++----- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js | 154 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js | 4 +++- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 254 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------ 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 895 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js | 101 +++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js | 7 +++++-- 400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js | 15 ++++++++------- 400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html | 167 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------- 400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html | 6 +++--- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html | 2 +- 400-SOURCECODE/AIAHTML5.Web/content/images/mult-annotation.png | Bin 0 -> 566 bytes 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js | 3 ++- 18 files changed, 1331 insertions(+), 721 deletions(-) create mode 100644 400-SOURCECODE/AIAHTML5.Web/content/images/mult-annotation.png diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 5ac9e20..244f28b 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -677,6 +677,9 @@ namespace AIAHTML5.API.Models } + // add editon number for provide CA link + userInfo.StudentEdition = GetStudentEdition(userInfo.LicenseId); + // get edition features details userInfo.objEditionFeatures = objDBModel.GetEditionFeatures((Byte)intEditionId); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 49e1557..05ccf81 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -504,16 +504,19 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.Set3DwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.Set3DwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.Set3DwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.Set3DwindowStoreData(windowviewid, 'y', ui.position.top); $scope.Set3DwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#ThreeDImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#thContentDiv_'+ windowviewid ).css("height",canvasDIvHeight); $rootScope.resetMenuOptionOnClick(pnlName); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index 1baeabb..7a3b2ae 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -80,6 +80,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'maximised': true, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'imgLeft': 0, }; return windata; } @@ -1082,6 +1083,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imageId = $scope.aiOpenInOtherModules.id; $scope.SetAIwindowStoreData(windowviewid, 'imageId', imageId); + var imgLeft = $scope.aiOpenInOtherModules.imgLeft!=undefined?$scope.aiOpenInOtherModules.imgLeft:0; + $scope.SetAIwindowStoreData(windowviewid, 'imgLeft', imgLeft); var selectedTileData = []; selectedTileData = new jinqJs() @@ -1184,7 +1187,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout content: '
'+ '
'+ '
'+ - '
' + + '
' + '' + '
'+ '
', @@ -1215,46 +1218,77 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetAIwindowStoreData(windowviewid, 'maximised',true); + $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { $rootScope.UnsaveCurriculum = true; - } - $scope.SetAIwindowStoreData(windowviewid, 'maximised',true); - $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); + $scope.SetAIwindowStoreData(windowviewid, 'maximised',false); + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; var isAutoCalled = $scope.GetAIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { $rootScope.UnsaveCurriculum = true; - } - $scope.SetAIwindowStoreData(windowviewid, 'minimised',false); - $scope.SetAIwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + $rootScope.UnsaveCurriculum = true; + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); $scope.SetAIwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetAIwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetAIwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetAIwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetAIwindowStoreData(windowviewid, 'x', ui.position.left); - $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(windowviewid,'annotationData'); + + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight-5,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, @@ -1297,36 +1331,26 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $timeout(function () { $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') - var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height(); - - $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight-5); - - - var canvas = document.getElementById("canvasAI_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid); - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-20; - canvasPaint.width = screen.width-20; - canvas.height = screen.height-130; - canvasPaint.height = screen.height-130; - } - else - { - canvas.height = screen.height-280; - canvasPaint.height = screen.height-280; - canvas.width = screen.width-40; - canvasPaint.width = screen.width-40; - } - + var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").width(); + $scope.SetAIwindowStoreData(windowviewid, 'currentSlug', 'adam-images-detail'); + var openedImage = document.getElementById('aimage_' + windowviewid ); openedImage.src = selectedAIImage; openedImage.onload = function () { - if (!$rootScope.isCallFromOtherModule) { - $("#aimage_"+windowviewid).css("left", (screen.width-this.width-70)/2 + "px"); - } + var pnlName='aiImagePanel_' + windowviewid; + var canvasDiv='canvasDivAI_' + windowviewid; + var canvasDraw='canvasAI_' + windowviewid; + var canvasPaint='canvasPaintAI_' + windowviewid; + var imgName='aimage_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + var oldleft= $rootScope.GetAIwindowData(windowviewid, 'imgLeft'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,demoData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + $("#aimage_"+windowviewid).css("visibility","visible"); $scope.JsPanelclick(windowviewid); @@ -1338,8 +1362,16 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + } + } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasAI_"+windowviewid,"canvasPaintAI_"+windowviewid,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); } } @@ -1356,6 +1388,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } + $rootScope.aiAnnotationToolEvent = function (windowviewid) { $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)") diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 6b212bc..53db88d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -390,7 +390,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout promise.then( function (result) { - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) + if($rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) { $scope.islinkActive = true; var AnimationData = new jinqJs() @@ -435,7 +435,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout angular.forEach($scope.selectedCAListViewData, function (value, key) { var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) + if($rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) { var $el = $('
' +'
' @@ -676,7 +676,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (selectimg === true && count >= filtercount) { var imagePath = "~/../content/images/ca/thumbnails/" + value._ThumbnailImage; - if($rootScope.userData.Id>1 && $rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) + if($rootScope.userData.LicenseInfo!= null && $rootScope.userData.EditionId<=2 && $rootScope.userData.StudentEdition!= null && $rootScope.userData.StudentEdition.length>0) { var $el = $('
' +'
' @@ -1217,16 +1217,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.SetCAwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetCAwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetCAwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetCAwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetCAwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); $rootScope.resetMenuOptionOnClick(pnlName); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index 89cf809..6985308 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -76,6 +76,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'maximised': true, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'imgLeft': 0, }; return windata; @@ -859,6 +860,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imageId = $scope.ciOpenInOtherModules.id; $scope.SetCIwindowStoreData(windowviewid, 'imageId', imageId); + var imgLeft = $scope.ciOpenInOtherModules.imgLeft!=undefined?$scope.ciOpenInOtherModules.imgLeft:0; + $scope.SetCIwindowStoreData(windowviewid, 'imgLeft', imgLeft); var selectedTileData = []; selectedTileData = new jinqJs() @@ -971,7 +974,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout '
' + //'
' + '' + - '
' + + '
' + '

' + selectedImageCISummary + '

' + '
' + '
'+ @@ -1001,58 +1004,80 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout onmaximized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; - var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + var windowviewid = (pnlName).split("_")[len - 1]; $scope.SetCIwindowStoreData(windowviewid, 'maximised',true); $scope.SetCIwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } + }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + $scope.SetCIwindowStoreData(windowviewid, 'minimised',false); + $scope.SetCIwindowStoreData(windowviewid, 'maximised',false); + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { - $rootScope.UnsaveCurriculum = true; + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); } - $scope.SetCIwindowStoreData(windowviewid, 'minimised',false); - $scope.SetCIwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); $scope.SetCIwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetCIwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetCIwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetCIwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetCIwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); - //annotation lost after resize paint canvas - // var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width()-50; - // var canvas = document.getElementById("canvasCI_" + windowviewid); - // var canvasPaint = document.getElementById("canvasPaintCI_" + windowviewid); - //canvas.height = canvasDIvHeight-200; - // canvasPaint.height = canvasDIvHeight-200; - // canvas.width = canvasDIvWidth; - // canvasPaint.width = canvasDIvWidth; - - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); - + + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(windowviewid,'annotationData'); + + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight-5,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, @@ -1094,52 +1119,26 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCIwindowStoreData(windowviewid, 'currentSlug', 'clinical-illustrations-detail'); - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - $('#summary_' + windowviewid).css("top", screen.height-270); - } - else - { - $('#summary_' + windowviewid).css("top", screen.height-420); - } + $timeout(function () { - var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width(); - $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight); - - if (!$rootScope.isCallFromOtherModule) { - $('#CIView').css("height", $(window).innerHeight()-100); - $('#CIView').css("width",$(window).innerWidth()-100); - } - - var canvas = document.getElementById("canvasCI_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintCI_" + windowviewid); - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-20; - canvasPaint.width = screen.width-20; - canvas.height = screen.height-270; - canvasPaint.height = screen.height-270; - } - else - { - canvas.width = screen.width-40; - canvasPaint.width = screen.width-40; - canvas.height = screen.height-400; - canvasPaint.height = screen.height-400; - } - if(screen.height<400) - { - $('#summary_' + windowviewid).css("bottom", "-220px"); - } - var openedImage = document.getElementById('ciimage_' + windowviewid ); openedImage.src = selectedCIImage; openedImage.onload = function () { - if (!$rootScope.isCallFromOtherModule) { - $("#ciimage_"+windowviewid).css("left", (screen.width-this.width-70)/2 + "px"); - } + var pnlName='ciImagePanel_' + windowviewid; + var canvasDiv='canvasDivCI_' + windowviewid; + var canvasDraw='canvasCI_' + windowviewid; + var canvasPaint='canvasPaintCI_' + windowviewid; + var imgName='ciimage_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + var oldleft= $rootScope.GetCIwindowData(windowviewid, 'imgLeft'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,demoData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(windowviewid, 'imgLeft',img.offsetLeft); + $("#ciimage_"+windowviewid).css("visibility","visible"); var canvasZIndex = $("#canvasCI_" + windowviewid).css("z-index"); var canvasPaintZIndex = $("#canvasPaintCI_" + windowviewid).css("z-index"); @@ -1169,9 +1168,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if(annotationData!="" && annotationData!=undefined) { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { + { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + } + } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasCI_"+windowviewid,"canvasPaintCI_"+windowviewid,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 5fd8a8d..dbb851f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -2992,6 +2992,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ }, textVisible: $rootScope.CIWindowData[i].isTextVisible, imageId: $rootScope.CIWindowData[i].imageId, + imgLeft:$rootScope.CIWindowData[i].imgLeft, minimised: $rootScope.CIWindowData[i].minimised, windowTitle: $rootScope.CIWindowData[i].currentViewTitle, maximised: $rootScope.CIWindowData[i].maximised, @@ -3096,6 +3097,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ width: $rootScope.PICWindowData[i].width }, imageId: $rootScope.PICWindowData[i].imageId, + imgLeft:$rootScope.PICWindowData[i].imgLeft, minimised: $rootScope.PICWindowData[i].minimised, windowTitle: $rootScope.PICWindowData[i].currentViewTitle, maximised: $rootScope.PICWindowData[i].maximised, @@ -3188,6 +3190,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ height: $rootScope.AAWindowData[i].height }, id: $rootScope.AAWindowData[i].id, + imgLeft:$rootScope.AAWindowData[i].imgLeft, showSelectedPins: $rootScope.AAWindowData[i].isShowSelectedPins, hideCallOuts: false,//N showAllPins: $rootScope.AAWindowData[i].isShowAllPins, @@ -3243,7 +3246,6 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ height: $rootScope.DaWindowData[i].height }, id: $rootScope.DaWindowData[i].voId, - imageId: $rootScope.DaWindowData[i].imageId, position: { y: $rootScope.DaWindowData[i].y, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index d16df54..50aebab 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -150,7 +150,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'totalstructure': 0, 'totalstructureLm': 0, 'intervalObject': null, - 'isannotationReload': false + 'isannotationReload': false, + 'isCanvasReset': false }; return windata; @@ -992,17 +993,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetwindowStoreData(windowviewid, 'maximised',true); $scope.SetwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - - $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + var extraheight=$('#dastickeyarea').height()+10; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + $('#da-input_'+windowviewid).removeClass(); var dawidth=$(window).outerWidth() - 20; if(dawidth<800) @@ -1010,44 +1008,80 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else{ $('#da-input_'+windowviewid).addClass('input-group col-sm-6 col-xs-7 col-md-7 pull-left'); } + + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + + var isAutoCalled = $scope.GetwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var annotationData=$rootScope.GetDAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); + } + }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetwindowStoreData(windowviewid, 'minimised',false); + $scope.SetwindowStoreData(windowviewid, 'maximised',false); + var extraheight=$('#dastickeyarea').height()+10; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + var isAutoCalled = $scope.GetwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { - $rootScope.UnsaveCurriculum = true; + $rootScope.UnsaveCurriculum = true; + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var annotationData=$rootScope.GetDAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); } - $scope.SetwindowStoreData(windowviewid, 'minimised',false); - $scope.SetwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - - $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var extraheight=$('#dastickeyarea').height()+10; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + $scope.SetwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - - $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); + $('#da-input_'+windowviewid).removeClass(); if(ui.size.width<700) $('#da-input_'+windowviewid).addClass('input-group col-sm-6 col-xs-7 col-md-5 pull-left'); else{ $('#da-input_'+windowviewid).addClass('input-group col-sm-6 col-xs-7 col-md-7 pull-left'); } - $rootScope.resetMenuOptionOnClick(pnlName); + + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var annotationData=$rootScope.GetDAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight-extraheight,canvasDIvWidth,annotationData); + } }, @@ -1222,12 +1256,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.loadDAView = function (currentBodyViewId, windowviewid) { - //0.4 added some stylesheets - if (!$rootScope.isCallFromOtherModule) { - $('#daBodyview').css("height", (parseInt($(window).outerHeight()) - 82)); - $('#daBodyview').css("width", $(window).outerWidth()); - } - $scope.SetwindowStoreData(windowviewid,'voId',currentBodyViewId); //1. load navigator man first console.log('before LoadBodyViewNavigatorImage call') @@ -1960,7 +1988,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'viewOrientationId',$scope.GetwindowStoreData(windowviewid,'voId')); $scope.setViewOrientationId(windowviewid); - + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); + //Birendra Load term data For curriculum builder //*********************************************************************// if ($rootScope.isCallFromOtherModule) { @@ -2209,13 +2238,24 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //set height of canvas div and left tool bar as per window size $scope.BodyRegionCordinatesData = []; // create an empty array $scope.SetwindowStoreData(windowviewid,'BodyRegionCordinatesData',[]); - $('#daBodyview').css('width', '100%'); - - var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - + + var extraheight=$('#dastickeyarea').height()+10; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#daImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; $('#canvasDivDA_' + windowviewid).css('height', canvasDIvHeight); - $('#leftToolBarDA_' + windowviewid).css('height', $('#daImagePanel_' + windowviewid).outerHeight()) + $('#leftToolBarDA_' + windowviewid).css('height', $('#daImagePanel_' + windowviewid).outerHeight()); + + if ($("#canvasDivDA_" + windowviewid).find("canvas[id*='canvasPaintDA']").length == 0) { + var canvasPaintID = "canvasPaintDA_" + windowviewid; + var canvasID = "canvasDA_" + windowviewid; + + //register touch end and touchmove event for touch devices + var ATBarHtml = $("#canvasDivDA_" + windowviewid).append(''); + $compile(ATBarHtml)($scope); + } + //calculate image coordinates and draw image var BodyRegionData=$scope.GetwindowStoreData(windowviewid,'BodyRegionData'); var bodyRegionCoordinates = new jinqJs() @@ -2223,7 +2263,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .where('_ViewOrientationId == ' + viewOrientationId) .select(); - console.log('viewOrientationId= ' + viewOrientationId + ', $scope.bodyRegionCoordinates length= ' + bodyRegionCoordinates.length) + //console.log('viewOrientationId= ' + viewOrientationId + ', $scope.bodyRegionCoordinates length= ' + bodyRegionCoordinates.length) var bgartData=$scope.GetwindowStoreData(windowviewid,'bgartData'); var bagartDetail = new jinqJs() @@ -2249,55 +2289,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.ColoredImageSRC = []; - $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); - + $scope.ColoredImageSRC = []; + $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); $scope.SetwindowStoreData(windowviewid,'updatedGrayDataList',[]); $scope.SetwindowStoreData(windowviewid,'updatedGrayMRDataList',[]); - - //history code - - if ($("#canvasDivDA_" + windowviewid).find("canvas[id*='canvasPaintDA']").length == 0) { - var canvasPaintID = "canvasPaintDA_" + windowviewid; - var canvasID = "canvasDA_" + windowviewid; - - //register touch end and touchmove event for touch devices - var ATBarHtml = $("#canvasDivDA_" + windowviewid).append(''); - $compile(ATBarHtml)($scope); - - } - var isCBAnnotationActive= $scope.GetwindowStoreData(windowviewid, 'isCBAnnotationActive'); - - // isCBAnnotationActive activate one time when annotation come from Saved CB - if ($rootScope.isCallFromOtherModule && isCBAnnotationActive) { - var annotationData= $scope.GetwindowStoreData(windowviewid, 'annotationData'); - //clean object .it will assign again from home controller - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - // load annotation - if(annotationData!="" && annotationData!=undefined) - { - if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { - //first draw shape and then store in object - //delay 3 second if annotation draw with TBox - if ($scope.GetwindowStoreData(windowviewid, 'isTransparent') == true) { - setTimeout(function(){ - $rootScope.LoadCBSavedAnnotation("canvasDA_"+windowviewid,"canvasPaintDA_"+windowviewid,annotationData); - },3000) - } - else - { - setTimeout(function(){ - $rootScope.LoadCBSavedAnnotation("canvasDA_"+windowviewid,"canvasPaintDA_"+windowviewid,annotationData); - },1000) - - } - - - } - } - $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); - } $('#zoomValueDA_' + windowviewid).attr('value', $scope.GetwindowStoreData(windowviewid,'zoomInOut')); @@ -2538,39 +2533,64 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#draggable_' + windowviewid).css('width', dragdivw); $('#draggable_' + windowviewid).css('height', dragdivh); $('#draggable_' + windowviewid).css("left", dragdivleft); - $('#draggable_' + windowviewid).css("top", dragdivtop); - - var canvas = document.getElementById("canvasDA_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintDA_" + windowviewid); - if(viewOrientationId!=1 && viewOrientationId!=4) - { - if(viewOrientationId==5) - { - //lateral arm - canvas.height = 1500; - canvasPaint.height =1500; - - } - else if(viewOrientationId==6) - { - //medial arm - canvas.height = 1400; - canvasPaint.height = 1400; - - } - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-145; - canvasPaint.width = screen.width-145; + $scope.SetwindowStoreData(windowviewid,'ColoredImageSRC',[]); + + var timeintval = null; + timeintval = $interval(function () { + var imageSrc = $scope.GetwindowStoreData(windowviewid, 'ColoredImageSRC'); + if (imageSrc.length>0) { + $scope.stopIntervalDA(); + var pnlName='daImagePanel_' + windowviewid; + var canvasDiv='canvasDivDA_' + windowviewid; + var canvasDraw='canvasDA_' + windowviewid; + var canvasPaint='canvasPaintDA_' + windowviewid; + var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); + var demoData= {shapeStates:[],paintCanvasState:""}; + var isCanvasReset = $scope.GetwindowStoreData(windowviewid, 'isCanvasReset'); + + if(isCanvasReset) + { + //call also while paint and draw canvas removed + //reset width height of canvas + $rootScope.setAADAPanelCordinate(windowviewid,bodyVid,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',false); + } + + var isCBAnnotationActive= $scope.GetwindowStoreData(windowviewid, 'isCBAnnotationActive'); + + // isCBAnnotationActive activate one time when annotation come from Saved CB + if ($rootScope.isCallFromOtherModule && isCBAnnotationActive) { + var annotationData= $scope.GetwindowStoreData(windowviewid, 'annotationData'); + //clean object .it will assign again from home controller + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + // load annotation + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + //first draw shape and then store in object + setTimeout(function(){ + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + },100) + } + } + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + } + } else { - canvas.width = screen.width-165; - canvasPaint.width = screen.width-165; + console.log("loading canvas...."); } + }, 100); - } + $scope.stopIntervalDA = function () { + if (angular.isDefined(timeintval)) { + $interval.cancel(timeintval); + timeintval = undefined; + } + }; } @@ -5014,10 +5034,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (canDivChildCount > 0) { canDiv.innerHTML = ''; } - - //canvas is clear in search term,layer change,viewchange here. so annotationdata should also clear - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); + //canvas is clear in search term,layer change,viewchange here. so annotationdata should also clear + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + } else { @@ -9271,8 +9291,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (canDivChildCount > 0) { canDiv.innerHTML = ''; } + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId'); - $scope.CalculateImageCordinates(viewOrientationId,windowviewid); + $scope.CalculateImageCordinates(viewOrientationId,windowviewid); if ($scope.GetwindowStoreData(windowviewid,'zoomInOut') == 25) { @@ -10261,6 +10284,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (canDivChildCount > 0) { canDiv.innerHTML = ''; } + + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); //canvas is clear in search term,layer change,viewchange here. so annotationData should also clear $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); @@ -10625,6 +10650,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (canDivChildCount > 0) { canDiv.innerHTML = ''; } + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',true); //canvas is clear in search term,layer change,viewchange here. so annotationData should also clear $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index ac82c70..77a7920 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -386,7 +386,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { $timeout(function () { sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); - sessionStorage.removeItem('ExitsCBFileDetail'); + sessionStorage.removeItem('ExitsCBFileDetail'); // OpenDefaultModule(iframe); }, 500); @@ -690,7 +690,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.isLoading = false; $rootScope.isLoginLoading = false; - + //unblock user if (url.indexOf('?unb:') != -1) { @@ -709,86 +709,104 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //get user is already loggedin or not $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); - if ($scope.currentUserDetails != undefined) { + var siteUserParamDetail = JSON.parse($rootScope.getLocalStorageValue('siteUserParamDetail')); + if(siteUserParamDetail!=undefined && siteUserParamDetail!=null && $scope.currentUserDetails != undefined) + { $rootScope.isVisibleLogin = false; $location.url('/'); - var loggedInUser = JSON.parse($scope.currentUserDetails); - if(loggedInUser.mType!=undefined) - { - $rootScope.isCAlink=true; - $('.navbar-fixed-top').css('display','none'); - } - - ConfigurationService.getCofigValue() - .then( - function (configresult) { - $rootScope.current_year = configresult.current_year; - $rootScope.aiaIdleTime = configresult.idleTime; - $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; - $rootScope.aiaPingInterval = configresult.pingInterval; - $rootScope.aiaAnimationPath = configresult.serverPath; - $rootScope.MaxOneFileSize = configresult.fileSize; - $rootScope.aodDomainName = configresult.aodSiteUrl; - - //incase site user login userid is 0 so then using license id - //logout site user while reload url without parameter - var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id; - - //licenseId would be zero for admin/gernal admin - var isadminType=loggedInUser.LicenseId==0?true:false; - if(loggedInUser.mType!=undefined) - { - $scope.checkuserstatus = { - userId: userId, - tagName: loggedInUser.mType.toLowerCase()=='ca'?'logout':'update', - SessionId:loggedInUser.SessionId, - isSiteUser:loggedInUser.isSiteUser, - isAdmin:isadminType - } - } - else - { - $scope.checkuserstatus = { - userId: userId, - tagName: loggedInUser.Id==0?'logout':'update', - SessionId:loggedInUser.SessionId, - isSiteUser:loggedInUser.isSiteUser, - isAdmin:isadminType - } - - } - - - // this case found when browser closed by user after login. after long time (after 20 min) open site again - // loggedInUserDetails contain user detail so user auto login but it is logout by - // 1.by agent job 2. or by admin section from db - // so check user session again before auto login - AuthenticationService.ManageUserLoginStatus($scope.checkuserstatus) - .then( - function (loginStatus) { - if(loginStatus!=null) + $rootScope.isCallFromSite = true; + $rootScope.isCAlink=true; + $rootScope.LoginDisableUI(); + $rootScope.siteUrlInfo.siteIP = siteUserParamDetail.siteIP; + $rootScope.siteUrlInfo.accountNumber = siteUserParamDetail.accountNumber; + $rootScope.siteUrlInfo.edition = siteUserParamDetail.edition; + $rootScope.siteUrlInfo.urlReferer = siteUserParamDetail.urlReferer; + $rootScope.siteUrlInfo.remoteIPAddress = siteUserParamDetail.remoteIPAddress; + var sitedetail=$rootScope.siteUrlInfo; + $rootScope.ReloadClientSiteUser(sitedetail); + } + else + { + if ($scope.currentUserDetails != undefined) { + $rootScope.isVisibleLogin = false; + $location.url('/'); + var loggedInUser = JSON.parse($scope.currentUserDetails); + if(loggedInUser.mType!=undefined) + { + $rootScope.isCAlink=true; + $('.navbar-fixed-top').css('display','none'); + } + + ConfigurationService.getCofigValue() + .then( + function (configresult) { + $rootScope.current_year = configresult.current_year; + $rootScope.aiaIdleTime = configresult.idleTime; + $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; + $rootScope.aiaPingInterval = configresult.pingInterval; + $rootScope.aiaAnimationPath = configresult.serverPath; + $rootScope.MaxOneFileSize = configresult.fileSize; + $rootScope.aodDomainName = configresult.aodSiteUrl; + + //incase site user login userid is 0 so then using license id + //logout site user while reload url without parameter + var userId=loggedInUser.Id==0?loggedInUser.LicenseId:loggedInUser.Id; + + //licenseId would be zero for admin/gernal admin + var isadminType=loggedInUser.LicenseId==0?true:false; + if(loggedInUser.mType!=undefined) { - if(loginStatus=='False') - { - $rootScope.LogoutUserSession(); + $scope.checkuserstatus = { + userId: userId, + tagName: loggedInUser.mType.toLowerCase()=='ca'?'logout':'update', + SessionId:loggedInUser.SessionId, + isSiteUser:loggedInUser.isSiteUser, + isAdmin:isadminType } - else - { - AuthenticateAlreadyLoggedInUser(); + } + else + { + $scope.checkuserstatus = { + userId: userId, + tagName: loggedInUser.Id==0?'logout':'update', + SessionId:loggedInUser.SessionId, + isSiteUser:loggedInUser.isSiteUser, + isAdmin:isadminType } + } - - }), - function (error) { - console.log(' Error in user login status = ' + error.statusText); - $('#errorMessage').text(error); - $("#messageModal").modal('show'); - } - - }); - + + + // this case found when browser closed by user after login. after long time (after 20 min) open site again + // loggedInUserDetails contain user detail so user auto login but it is logout by + // 1.by agent job 2. or by admin section from db + // so check user session again before auto login + AuthenticationService.ManageUserLoginStatus($scope.checkuserstatus) + .then( + function (loginStatus) { + if(loginStatus!=null) + { + if(loginStatus=='False') + { + $rootScope.LogoutUserSession(); + } + else + { + AuthenticateAlreadyLoggedInUser(); + } + } + + }), + function (error) { + console.log(' Error in user login status = ' + error.statusText); + $('#errorMessage').text(error); + $("#messageModal").modal('show'); + } + + }); + } } - + var isRememberChecked = $rootScope.getLocalStorageValue('isRememberMeChecked'); if ($rootScope.getLocalStorageValue('isRememberMeChecked') != "" && sessionStorage.getItem("loginSession") == null) { @@ -802,7 +820,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } } - else { + else + { $rootScope.isVisibleLogin = true; @@ -813,6 +832,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if ($scope.currentUserDetails == undefined) { $rootScope.getConfigurationValues(); } + } $timeout(function () { @@ -1580,37 +1600,41 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } else { - $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); var sitedetail=$rootScope.siteUrlInfo; - ConfigurationService.getCofigValue() - .then( - function (configresult) { - $rootScope.current_year = configresult.current_year; - $rootScope.aiaIdleTime = configresult.idleTime; - $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; - $rootScope.aiaPingInterval = configresult.pingInterval; - $rootScope.aiaAnimationPath = configresult.serverPath; - $rootScope.MaxOneFileSize = configresult.fileSize; - $rootScope.aodDomainName = configresult.aodSiteUrl; - - var loggedInUser = JSON.parse($scope.currentUserDetails); - //check already login by account number bcz no login id for site login - //maintain user session by licenseid of site login - if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) - { - //using old session id - sitedetail.SessionId = loggedInUser.SessionId; - $rootScope.AuthenticateClientSiteUser(sitedetail); - } - else - { - //using new sessionid - $rootScope.AuthenticateClientSiteUser(sitedetail); - } - }); + $rootScope.ReloadClientSiteUser(sitedetail); } } + $rootScope.ReloadClientSiteUser = function (sitedetail) { + $scope.currentUserDetails = $rootScope.getLocalStorageValue('loggedInUserDetails'); + ConfigurationService.getCofigValue() + .then( + function (configresult) { + $rootScope.current_year = configresult.current_year; + $rootScope.aiaIdleTime = configresult.idleTime; + $rootScope.aiaIdleTimeOut = configresult.idelTimeOut; + $rootScope.aiaPingInterval = configresult.pingInterval; + $rootScope.aiaAnimationPath = configresult.serverPath; + $rootScope.MaxOneFileSize = configresult.fileSize; + $rootScope.aodDomainName = configresult.aodSiteUrl; + + var loggedInUser = JSON.parse($scope.currentUserDetails); + //check already login by account number bcz no login id for site login + //maintain user session by licenseid of site login + if(loggedInUser!==null && loggedInUser.AccountNumber==sitedetail.accountNumber) + { + //using old session id + sitedetail.SessionId = loggedInUser.SessionId; + $rootScope.AuthenticateClientSiteUser(sitedetail); + } + else + { + //using new sessionid + $rootScope.AuthenticateClientSiteUser(sitedetail); + } + }); + } + $rootScope.AuthenticateClientSiteUser = function (siteInfo) { $rootScope.LoginDisableUI(); $rootScope.isCAlink=false; @@ -1815,6 +1839,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.userModules = result.Modules; localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + //using for open resource and reloading app + localStorage.setItem('siteUserParamDetail', JSON.stringify(siteInfo)); if (isCommingSoonModel == true) { @@ -1869,7 +1895,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.haveRoleAdmin = false; //2. - localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); + + //using for open resource and reloading app + localStorage.setItem('siteUserParamDetail', JSON.stringify(siteInfo)); //5. sessionStorage.setItem("loginSession", "true"); @@ -2239,6 +2268,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.LogoutUser = function () { $rootScope.isSessionTimeout=true; localStorage.removeItem('loggedInUserDetails'); + localStorage.removeItem('siteUserParamDetail'); + localStorage.clear(); $rootScope.CheckUserSession('logout'); @@ -2247,7 +2278,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.isSessionTimeout=true; localStorage.removeItem('loggedInUserDetails'); sessionStorage.removeItem('isModuleOpenByOpenResource'); - sessionStorage.removeItem('ExitsCBFileDetail'); + sessionStorage.removeItem('ExitsCBFileDetail'); + localStorage.removeItem('siteUserParamDetail'); localStorage.clear(); document.location = '/'; } @@ -2517,7 +2549,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { for (var x = 0 ; x < $rootScope.AllPanelStoreObject.length; x++) { - if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { + if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { var obj=$rootScope.AllPanelStoreObject[x]['panelObject']; obj.maximize(); break; @@ -2528,7 +2560,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { for (var x = 0 ; x < $rootScope.AllPanelStoreObject.length; x++) { - if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { + if ($rootScope.AllPanelStoreObject[x].winid == windowviewid) { var obj=$rootScope.AllPanelStoreObject[x]['panelObject']; obj.normalize(); break; @@ -2542,36 +2574,42 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('#arragePannel .dropdown-content').css("display","block"); } - + $(window).unbind('resize'); window.addEventListener("resize", orientationchange); - function orientationchange() { - if($location.url()!= "/curriculum-builder-detail") { - var moduleImagePanel = $("div[id*='ImagePanel']"); + function orientationchange() { + clearTimeout(window.resizedFinished); + window.resizedFinished = setTimeout(function(){ + console.log('Resized finished.'); + if($location.url()!= "/curriculum-builder-detail") { + var moduleImagePanel = $("div[id*='ImagePanel']"); - if (moduleImagePanel.length > 0) { - - for (var j = 0; j < moduleImagePanel.length; j++) { - var paneld=moduleImagePanel[j].id; - var len = (paneld).split("_").length; - var MultiWinId = (paneld).split("_")[len - 1]; + if (moduleImagePanel.length > 0) { + + for (var j = 0; j < moduleImagePanel.length; j++) { + var paneld=moduleImagePanel[j].id; + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; - //first set to normal and then to set max mode while browser resize or iPad orientation change - $rootScope.orientationchangeToNormal(MultiWinId); - $rootScope.orientationchangeToMax(MultiWinId); - + //first set to normal and then to set max mode while browser resize or iPad orientation change + + $rootScope.minmaxPanelAutoEventTrue(MultiWinId,paneld); + $rootScope.orientationchangeToNormal(MultiWinId); + $rootScope.minmaxPanelAutoEventFalse(MultiWinId,paneld); + + $rootScope.orientationchangeToMax(MultiWinId); + + } } + + } + if(($location.url()== "/tile-view-list") ||($location.url()== "/clinical-illustrations")||($location.url()== "/clinical-animations")||($location.url()== "/ADAM-images")||($location.url()== "/ADAM-on-demand")) { + $rootScope.ResetGridListLength(); } - - } - if(($location.url()== "/tile-view-list") ||($location.url()== "/clinical-illustrations")||($location.url()== "/clinical-animations")||($location.url()== "/ADAM-images")||($location.url()== "/ADAM-on-demand")) { - $rootScope.ResetGridListLength(); - } - }; - - - + }, 300); + } + $(function () { var colpick = $('.demo').each(function () { @@ -2853,16 +2891,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.getModuleScrollPosition = function () { $rootScope.refreshcheck = "check"; $('.mCSB_container ul li').click(function () { - $rootScope.scrollTopPosition = $(this).position().top; - }); setTimeout(function () { $(".sidebar").mCustomScrollbar("scrollTo", $rootScope.scrollTopPosition + "px"); - - - }, 300); } @@ -2883,8 +2916,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data for (var j = 0; j < moduleImagePanel.length; j++) { var paneld=moduleImagePanel[j].id; var len = (paneld).split("_").length; - var MultiWinId = (paneld).split("_")[len - 1]; + var MultiWinId = (paneld).split("_")[len - 1]; + + $rootScope.minmaxPanelAutoEventTrue(MultiWinId,paneld); $rootScope.orientationchangeToNormal(MultiWinId); + $rootScope.minmaxPanelAutoEventFalse(MultiWinId,paneld); if(j>0) { @@ -2943,7 +2979,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var len = (paneld).split("_").length; var MultiWinId = (paneld).split("_")[len - 1]; + $rootScope.minmaxPanelAutoEventTrue(MultiWinId,paneld); $rootScope.orientationchangeToNormal(MultiWinId); + $rootScope.minmaxPanelAutoEventFalse(MultiWinId,paneld); //set max tiles 3 on screen width if(countnumber>1 && countnumber<4) @@ -2975,8 +3013,57 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } + } + + $rootScope.minmaxPanelAutoEventTrue = function (MultiWinId,paneld) + { + if(paneld.match("daImagePanel")) + { + $rootScope.SetDAwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("AAImagePanel")) + { + $rootScope.SetAAwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("ciImagePanel")) + { + $rootScope.SetCIwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("aiImagePanel")) + { + $rootScope.SetAIwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + else if(paneld.match("picImagePanel")) + { + $rootScope.SetPICwindowData(MultiWinId, 'minmaxAutoEvent', true); + } + + } + $rootScope.minmaxPanelAutoEventFalse = function (MultiWinId,paneld) + { + if(paneld.match("daImagePanel")) + { + $rootScope.SetDAwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("AAImagePanel")) + { + $rootScope.SetAAwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("ciImagePanel")) + { + $rootScope.SetCIwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("aiImagePanel")) + { + $rootScope.SetAIwindowData(MultiWinId, 'minmaxAutoEvent', false); + } + else if(paneld.match("picImagePanel")) + { + $rootScope.SetPICwindowData(MultiWinId, 'minmaxAutoEvent', false); } + } + $scope.resetPanelPosition=function(MultiWinId,paneld,resetWidth,pTop,pLeft) { $rootScope.UnsaveCurriculum = true; @@ -2985,12 +3072,18 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - - $('#canvasDivDA_' + MultiWinId).css('height', '440'); + $rootScope.SetDAwindowData(MultiWinId,'width',resetWidth); $rootScope.SetDAwindowData(MultiWinId,'height',520); $rootScope.SetDAwindowData(MultiWinId,'y',pTop); $rootScope.SetDAwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivDA_' + MultiWinId; + var canvasDraw='canvasDA_' + MultiWinId; + var canvasPaint='canvasPaintDA_' + MultiWinId; + var bodyVid=$rootScope.GetDAwindowData(MultiWinId,'voId'); + var annotationData=$rootScope.GetDAwindowData(MultiWinId,'annotationData'); + $rootScope.setAADAPanelCordinate(MultiWinId,bodyVid,paneld,canvasDiv,canvasDraw,canvasPaint,440,resetWidth,annotationData); } else if(paneld.match("AAImagePanel")) @@ -2998,44 +3091,82 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#canvasAADiv_' + MultiWinId).css('height', '440'); $rootScope.SetAAwindowData(MultiWinId,'width',resetWidth); $rootScope.SetAAwindowData(MultiWinId,'height',520); $rootScope.SetAAwindowData(MultiWinId,'y',pTop); $rootScope.SetAAwindowData(MultiWinId,'x',pLeft); + var canvasDiv='canvasAADiv_' + MultiWinId; + var canvasDraw='canvasAA_' + MultiWinId; + var canvasPaint='canvasPaintAA_' + MultiWinId; + var annotationData=$rootScope.GetAAwindowData(MultiWinId,'annotationData'); + + $rootScope.setAADAPanelCordinate(MultiWinId,0,paneld,canvasDiv,canvasDraw,canvasPaint,440,resetWidth,annotationData); } else if(paneld.match("ciImagePanel")) { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - - $('#canvasDivCI_' + MultiWinId).css('height', '490'); + $rootScope.SetCIwindowData(MultiWinId,'width',resetWidth); $rootScope.SetCIwindowData(MultiWinId,'height',520); $rootScope.SetCIwindowData(MultiWinId,'y',pTop); $rootScope.SetCIwindowData(MultiWinId,'x',pLeft); + var canvasDiv='canvasDivCI_' + MultiWinId; + var canvasDraw='canvasCI_' + MultiWinId; + var canvasPaint='canvasPaintCI_' + MultiWinId; + var imgName='ciimage_' + MultiWinId; + var oldleft= $rootScope.GetCIwindowData(MultiWinId, 'imgLeft'); + var annotationData=$rootScope.GetCIwindowData(MultiWinId,'annotationData'); + + $rootScope.setIMGPanelCordinate(MultiWinId,paneld,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,485,resetWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetCIwindowData(MultiWinId, 'imgLeft',img.offsetLeft); + } else if(paneld.match("aiImagePanel")) { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - - $('#canvasDivAI_' + MultiWinId).css('height', '485'); + $rootScope.SetAIwindowData(MultiWinId,'width',resetWidth); $rootScope.SetAIwindowData(MultiWinId,'height',520); $rootScope.SetAIwindowData(MultiWinId,'y',pTop); $rootScope.SetAIwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivAI_' + MultiWinId; + var canvasDraw='canvasAI_' + MultiWinId; + var canvasPaint='canvasPaintAI_' + MultiWinId; + var imgName='aimage_' + MultiWinId; + var oldleft= $rootScope.GetAIwindowData(MultiWinId, 'imgLeft'); + var annotationData=$rootScope.GetAIwindowData(MultiWinId,'annotationData'); + + $rootScope.setIMGPanelCordinate(MultiWinId,paneld,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,485,resetWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetAIwindowData(MultiWinId, 'imgLeft',img.offsetLeft); + } else if(paneld.match("picImagePanel")) { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#canvasDivPIC_' + MultiWinId).css('height', '485'); + //$('#canvasDivPIC_' + MultiWinId).css('height', '485'); $rootScope.SetPICwindowData(MultiWinId,'width',resetWidth); $rootScope.SetPICwindowData(MultiWinId,'height',520); $rootScope.SetPICwindowData(MultiWinId,'y',pTop); $rootScope.SetPICwindowData(MultiWinId,'x',pLeft); + + var canvasDiv='canvasDivPIC_' + MultiWinId; + var canvasDraw='canvasPIC_' + MultiWinId; + var canvasPaint='canvasPaintPIC_' + MultiWinId; + var imgName='mypic_' + MultiWinId; + var oldleft= $rootScope.GetPICwindowData(MultiWinId, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(MultiWinId,'annotationData'); + + $rootScope.setIMGPanelCordinate(MultiWinId,paneld,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,485,resetWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(MultiWinId, 'imgLeft',img.offsetLeft); + } else if(paneld.match("ThreeDImagePanel")) { @@ -3077,8 +3208,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { $("#"+paneld).css('height','520'); $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#LabView_' + MultiWinId).css('height', 505); - $('#panelbodyDiv_' + MultiWinId).css("height",380); + $('#panelbodyDiv_' + MultiWinId).css("height",390); + $('#resultbodyDiv_' + MultiWinId).css("height",400); $rootScope.SetLabwindowData(MultiWinId,'width',resetWidth); $rootScope.SetLabwindowData(MultiWinId,'height',520); $rootScope.SetLabwindowData(MultiWinId,'y',pTop); @@ -3086,7 +3217,195 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } - } + } + + $rootScope.setAADAPanelCordinate = function (MultiWinId,viewid,pnlName,canvasDiv,CanvasDrawId,canvasPaintId,canvasDIvHeight,canvasDIvWidth,annotationData) + { + $('#' + canvasDiv).css('height', canvasDIvHeight); + $rootScope.resetMenuOptionOnClick(pnlName); + + var canvas = document.getElementById(CanvasDrawId); + var canvasPaint = document.getElementById(canvasPaintId); + canvas.height = canvasDIvHeight-30; + canvasPaint.height = canvasDIvHeight-30; + canvas.width = canvasDIvWidth-20; + canvasPaint.width = canvasDIvWidth-20; + + if(pnlName.match("AAImagePanel")) + { + //keep image position always as it is! + var aaDetailCanvas = document.getElementById("aaDetailViewCanvas_"+MultiWinId); + if(aaDetailCanvas.height>canvasDIvHeight) + { + canvas.height = aaDetailCanvas.height; + canvasPaint.height = aaDetailCanvas.height; + } + if(aaDetailCanvas.width>canvasDIvWidth) + { + canvas.width = aaDetailCanvas.width; + canvasPaint.width = aaDetailCanvas.width; + } + } + else if(pnlName.match("daImagePanel")) + { + if(viewid=="1" ||viewid=="5") + { + var imageCanvas6MR = document.getElementById("imageCanvas6_MR_"+MultiWinId);//get width + var imageCanvas5MR = document.getElementById("imageCanvas5_MR_"+MultiWinId);//get height + var totalwidth=imageCanvas6MR.offsetLeft+imageCanvas6MR.width; + var totalHeight=imageCanvas5MR.offsetTop+imageCanvas5MR.height; + } + else if(viewid=="4" ||viewid=="8") + { + var imageCanvas6 = document.getElementById("imageCanvas6_"+MultiWinId);//get width + var imageCanvas5 = document.getElementById("imageCanvas5_"+MultiWinId);//get height + var totalwidth=imageCanvas6.offsetLeft+imageCanvas6.width; + var totalHeight=imageCanvas5.offsetTop+imageCanvas5.height; + } + else if(viewid=="2" ||viewid=="6"||viewid=="3" ||viewid=="7") + { + var imageCanvas2 = document.getElementById("imageCanvas2_"+MultiWinId);//get width + var imageCanvas5 = document.getElementById("imageCanvas5_"+MultiWinId);//get height + var totalwidth=imageCanvas2.offsetLeft+imageCanvas2.width+50; + var totalHeight=imageCanvas5.offsetTop+imageCanvas5.height; + } + else if(viewid=="9" ||viewid=="11") + { + var imageCanvas2 = document.getElementById("imageCanvas2_"+MultiWinId);//get width + var imageCanvas4 = document.getElementById("imageCanvas4_"+MultiWinId);//get height + var totalwidth=imageCanvas2.offsetLeft+imageCanvas2.width+50; + var totalHeight=imageCanvas4.offsetTop+imageCanvas4.height; + } + else if(viewid=="10" ||viewid=="12") + { + var imageCanvas6 = document.getElementById("imageCanvas6_"+MultiWinId);//get height and width + + var totalwidth=imageCanvas6.offsetLeft+imageCanvas6.width+50; + var totalHeight=imageCanvas6.offsetTop+imageCanvas6.height; + } + + + if(totalHeight>canvasDIvHeight) + { + canvas.height = totalHeight; + canvasPaint.height = totalHeight; + } + if(totalwidth>canvasDIvWidth) + { + canvas.width = totalwidth; + canvasPaint.width = totalwidth; + } + + } + + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + // image fixed no position changed + //first draw shape and then store in object + $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,annotationData); + } + } + + } + + $rootScope.setIMGPanelCordinate = function (MultiWinId,pnlName,canvasDiv,CanvasDrawId,canvasPaintId,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData) + { + $('#' + canvasDiv).css('height', canvasDIvHeight); + $rootScope.resetMenuOptionOnClick(pnlName); + var img = document.getElementById(imgName); + + var canvas = document.getElementById(CanvasDrawId); + var canvasPaint = document.getElementById(canvasPaintId); + canvas.height = canvasDIvHeight-30; + canvasPaint.height = canvasDIvHeight-30; + canvas.width = canvasDIvWidth-20; + canvasPaint.width = canvasDIvWidth-20; + + if((canvasDIvWidth-img.width)>0) + { + $("#"+imgName).css("left", (canvasDIvWidth-img.width)/2 + "px"); + } + else + { + //image in big size than screen + $("#"+imgName).css("left", 0 + "px"); + } + + if(img.height>canvasDIvHeight) + { + canvas.height = img.height; + canvasPaint.height = img.height; + } + if(img.width>canvasDIvWidth) + { + canvas.width = img.width; + canvasPaint.width = img.width; + } + + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + //first draw shape and then store in object + $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,annotationData); + } + } + + } + } + } + + $rootScope.resetAnnotationData = function (imgName,oldleft,annotationData) + { + // load annotation + var modifiiedannotationData= {shapeStates:[],paintCanvasState:""}; + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) + { + var img = document.getElementById(imgName); + var newLeft=img.offsetLeft-oldleft; + if(img.offsetLeft>=0) + { + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + for(var shapeindx=0;shapeindx0) { - //if only one module left - if(slug=='clinical-animations' && $rootScope.userData.mType!=undefined) - { - if($rootScope.userData.mType.toLowerCase()=='ca') - { - $rootScope.siteUrlInfo.mType=null; - $rootScope.siteUrlInfo.id=null; - $rootScope.LogoutUser(); - } - - } - else - { - if(modulePanel.length==1) $location.url('/' + slug); - } + if (modulePanel != undefined && modulePanel.length>0) { + //if only one module left + if(modulePanel.length==1) $location.url('/' + slug); + + // if(slug=='clinical-animations' && $rootScope.userData.mType!=undefined) + // { + // if($rootScope.userData.mType.toLowerCase()=='ca') + // { + // $rootScope.siteUrlInfo.mType=null; + // $rootScope.siteUrlInfo.id=null; + // $rootScope.LogoutUser(); + // } + + // } + } } @@ -3605,6 +3923,30 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // keep on top paint Canvas zindex on top $rootScope.SetPaintZindexforCI = function (MultiWinId) { + //scroll issue in iPad + var $ua = navigator.userAgent; + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { + + var drawCanvasZindex = parseInt($("#canvasCI_" + MultiWinId).css("z-index")); + var paintCanvasZindex = parseInt($("#canvasPaintCI_" + MultiWinId).css("z-index")); + + if (drawCanvasZindex > paintCanvasZindex) { + paintCanvasZindex = drawCanvasZindex + 1; + } + else + { + paintCanvasZindex = paintCanvasZindex + 1; + } + + $("#canvasPaintCI_" + MultiWinId).css("z-index", paintCanvasZindex); + } + + $('#summary_' + MultiWinId).css("z-index", paintCanvasZindex+1); + + } + + $rootScope.SetPaintZindexforCISummary = function (MultiWinId) + { var drawCanvasZindex = parseInt($("#canvasCI_" + MultiWinId).css("z-index")); var paintCanvasZindex = parseInt($("#canvasPaintCI_" + MultiWinId).css("z-index")); @@ -3615,13 +3957,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { paintCanvasZindex = paintCanvasZindex + 1; } - - //scroll issue in iPad - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - $("#canvasPaintCI_" + MultiWinId).css("z-index", paintCanvasZindex); - } - $('#summary_' + MultiWinId).css("z-index", paintCanvasZindex+1); } @@ -3928,7 +4263,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } // remove event listener @@ -4003,7 +4338,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4076,7 +4411,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } @@ -4118,7 +4453,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } // remove event listener @@ -4171,7 +4506,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4257,7 +4592,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } // remove event listener $scope.removeOnDrawingCanvas(canvasElement); @@ -4294,7 +4629,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.switchCanvasToPaintCanvas(paneld); if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $('#' + canvasPaintId).sketch(); @@ -4461,7 +4796,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4511,7 +4846,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4560,7 +4895,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4608,7 +4943,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } $scope.onDrawingCanvasOnModule(canvasElement); @@ -4709,7 +5044,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } if(paneld.match("ciImagePanel")) { - $rootScope.SetPaintZindexforCI(MultiWinId); + $rootScope.SetPaintZindexforCISummary(MultiWinId); } } } @@ -4911,6 +5246,122 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //Edit Shape Style popup should open at it's default position $("#modeleditstyle").css({ "left": "40%", "right": "0", "top": "70px" }); } + + $rootScope.ResizeUpdateShapeData=function(shapetype,layerName,drawingPoints,annotationData) + { + var shapeStates = new jinqJs() + .from(annotationData.shapeStates) + .where('layerName == ' + layerName) + .select(); + if(shapeStates.length>0) + { + if(shapetype=="line"||shapetype=="Arrow"||shapetype=="Pin") + { + annotationData.shapeStates = new jinqJs() + .from(annotationData.shapeStates) + .update(function (coll, index) + { + coll[index].x1= drawingPoints.x1; + coll[index].x2 = drawingPoints.x2; + }) + .at('layerName == ' + layerName) + .select(); + } + else if(shapetype=="rectangle"||shapetype=="ellipse" ||shapetype=="textArea") + { + annotationData.shapeStates = new jinqJs() + .from(annotationData.shapeStates) + .update(function (coll, index) + { + coll[index].x= drawingPoints.x; + // coll[index].y = drawingPoints.y; + }) + .at('layerName == ' + layerName) + .select(); + + } + + } + + return annotationData; + } + + $rootScope.ResizeCBSavedAnnotation = function (paneld,canvasId,canvasPaintId,annotationData) { + var len = (paneld).split("_").length; + var MultiWinId = (paneld).split("_")[len - 1]; + + if(paneld.match("aiImagePanel")) + { + $rootScope.aiAnnotationToolEvent(MultiWinId); + } + else if(paneld.match("ciImagePanel")) + { + $rootScope.ciAnnotationToolEvent(MultiWinId); + } + else if(paneld.match("picImagePanel")) + { + $rootScope.picAnnotationToolEvent(MultiWinId); + } + + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + var paintCanvasState=annotationData.paintCanvasState; + + $timeout(function () { + + for(var shapeindx=0;shapeindx0) + { + //for paint brush + $rootScope.switchCanvasToPaintCanvas(paneld); + var drawingPoints=paintCanvasState + //auto save last cb paint + $scope.PaintEraseEvent(); + $scope.savePaintAnnotation(canvasPaintId,drawingPoints); + $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; + } + + $rootScope.CloseAnnotationTool(); + + }, 50); + + } $rootScope.LoadCBSavedAnnotation = function (canvasId,canvasPaintId,annotationData) { var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); @@ -4945,43 +5396,44 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } - } - $timeout(function () { - var shapeStates=annotationData.shapeStates; - var paintCanvasState=annotationData.paintCanvasState; + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + var paintCanvasState=annotationData.paintCanvasState; + + $timeout(function () { + + for(var shapeindx=0;shapeindx0) + { + if (modulePanel != undefined && modulePanel.length>0) { + for (var index = 0 ; index < modulePanel.length; index++) { + var paneld = modulePanel[index].id; + if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel")) + { + //for paint brush + $rootScope.switchCanvasToPaintCanvas(paneld); - for(var shapeindx=0;shapeindx0) - { - if (modulePanel != undefined && modulePanel.length>0) { - for (var index = 0 ; index < modulePanel.length; index++) { - var paneld = modulePanel[index].id; - if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel")) - { - //for paint brush - $rootScope.switchCanvasToPaintCanvas(paneld); - + } } } + var drawingPoints=paintCanvasState + //auto save last cb paint + $scope.PaintEraseEvent(); + $scope.savePaintAnnotation(canvasPaintId,drawingPoints); + $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); + //clear sketch js event for paint and erase + $.sketch = { tools: {}}; } - var drawingPoints=paintCanvasState - //auto save last cb paint - $scope.PaintEraseEvent(); - $scope.savePaintAnnotation(canvasPaintId,drawingPoints); - $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); - //clear sketch js event for paint and erase - $.sketch = { tools: {}}; - } - - $rootScope.CloseAnnotationTool(); - - }, 500); - + + $rootScope.CloseAnnotationTool(); + + }, 500); + } } $scope.savePaintAnnotation=function(canvasPaintId,drawingPoints) { @@ -8880,7 +9332,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data isReloadingViewRequired = true; } - else if (setting.modesty != null && setting.modesty != $rootScope.globalSetting.modesty) { + else + { $rootScope.globalSetting.modesty = setting.modesty; localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); @@ -8895,6 +9348,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { var len = (paneld).split("_").length; var MultiWinId = (paneld).split("_")[len - 1]; + var ModestyValue= $rootScope.GetDAwindowData(MultiWinId, 'ModestyValue'); + if (setting.modesty != null && setting.modesty != ModestyValue) { if ($('.modestyImg_' + MultiWinId) != null) { if (($rootScope.globalSetting.modesty == 'Y')) { @@ -8937,8 +9392,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else { $('.transModestyImg_' + MultiWinId).css('visibility', 'hidden'); } - $rootScope.changeNavigatorModesty(MultiWinId); - + $rootScope.changeNavigatorModesty(MultiWinId); + } } } } @@ -9562,7 +10017,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#HomeContainerDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); $('#dvOpenResourcePanel').remove(); - sessionStorage.removeItem('isModuleOpenByOpenResource'); + sessionStorage.removeItem('isModuleOpenByOpenResource'); $("#jsPanel-min-container").removeAttr("style"); if (document.location.pathname == "/curriculum-builder-detail") { if($('div.CBLeft-Sidebar').hasClass('active')) @@ -9999,7 +10454,7 @@ function closeIFrame() { } function AIAModuleOpenResourceInfo(windowData) { - sessionStorage.removeItem('isModuleOpenByOpenResource'); + sessionStorage.removeItem('isModuleOpenByOpenResource'); window.parent.closeIFrame(); $("#jsPanel-min-container").removeAttr("style"); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 88aee81..233d8ac 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -428,9 +428,10 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } $scope.SetLEwindowStoreData(windowviewid, 'maximised',true); $scope.SetLEwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 15; - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); + $rootScope.resetMenuOptionOnClick(pnlName); }, onnormalized:function (panel) { @@ -444,24 +445,27 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } $scope.SetLEwindowStoreData(windowviewid, 'minimised',false); $scope.SetLEwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 15; - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.SetLEwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetLEwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetLEwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetLEwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetLEwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 15; - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); + + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); $rootScope.resetMenuOptionOnClick(pnlName); } @@ -503,9 +507,18 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, // set false after initial call of min,max or normal $scope.SetLEwindowStoreData(windowviewid, 'minmaxAutoEvent', false); $scope.SetLEwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); - $scope.SetLEwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); + $scope.SetLEwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft) $scope.SetLEwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); $scope.SetLEwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); + + $scope.setControlsIDs(windowviewid); + $scope.createScopeVariable(windowviewid); + + $scope.labViewID = "LabView_" + windowviewid; + var labViewElement = angular.element(document.getElementById($scope.labViewID)); + + $compile(labViewElement.contents())($scope); + var labExerciseInfo = { userId: userloginid, @@ -514,52 +527,34 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, LabExerciseService.GetLabExercise(labExerciseInfo) .then( function (labResult) { - $scope.setControlsIDs(windowviewid); - $scope.createScopeVariable(windowviewid); - - $scope.labViewID = "LabView_" + windowviewid; - var labViewElement = angular.element(document.getElementById($scope.labViewID)); - - $compile(labViewElement.contents())($scope); - - if ($rootScope.isCallFromOtherModule) { - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight()) - 30; - } - else - { - var canvasDIvHeight = parseInt($('#labImagePanel_' + windowviewid).outerHeight())-15; - - $('#labBodyview').css("height", $(window).outerHeight() - 65); - - $('#labBodyview').css("width", $(window).outerWidth() - 15); - - } - - $('#LabView_' + windowviewid).css('height', canvasDIvHeight); - - $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-125); - - - $scope.JsPanelclick(windowviewid); + + $timeout(function () { + var canvasDIvHeight = $('#labImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#panelbodyDiv_' + windowviewid).css("height",canvasDIvHeight-100); + $('#resultbodyDiv_' + windowviewid).css("height",canvasDIvHeight-90); + $scope.JsPanelclick(windowviewid); - if (labResult != undefined && labResult.lastQuestion > 0 && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { - - $scope.SetLEwindowStoreData(windowviewid, 'SavedLabExercise', labResult); - - $('#quizNo_' + windowviewid).text(labResult.lastQuestion); - $scope.SetLEwindowStoreData(windowviewid, 'quiznumber', labResult.lastQuestion); - // $scope.initialQuestioNo = labResult.lastQuestion; - $scope.SetLEwindowStoreData(windowviewid, 'initialQuestioNo', labResult.lastQuestion); - $scope.GetQuizByTopic(windowviewid); - } - else { - $scope.GetQuizByTopic(windowviewid); - } - $scope.DisableUI(); + if (labResult != undefined && labResult.lastQuestion > 0 && labResult != AIAConstants.SAVED_LAB_EXERCISE_NOT_FOUND) { + + $scope.SetLEwindowStoreData(windowviewid, 'SavedLabExercise', labResult); + + $('#quizNo_' + windowviewid).text(labResult.lastQuestion); + $scope.SetLEwindowStoreData(windowviewid, 'quiznumber', labResult.lastQuestion); + // $scope.initialQuestioNo = labResult.lastQuestion; + $scope.SetLEwindowStoreData(windowviewid, 'initialQuestioNo', labResult.lastQuestion); + $scope.GetQuizByTopic(windowviewid); + } + else { + $scope.GetQuizByTopic(windowviewid); + } + $scope.DisableUI(); + + },300) }, function (error) { console.log('error in getting save ddata'); + $scope.DisableUI(); } ) @@ -636,6 +631,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, $("#btnReportClose").attr("id", "btnReportClose_" + windowviewid); $("#panelbodyDiv").attr("id", "panelbodyDiv_" + windowviewid); + $("#resultbodyDiv").attr("id", "resultbodyDiv_" + windowviewid); + $("#LabExPageHeading").attr("id", "LabExPageHeading_" + windowviewid); $("#minlab").attr("id", "minlab_" + windowviewid); $("#minlabicon").attr("id", "minlabicon_" + windowviewid); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js index d781155..77a3e26 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js @@ -372,16 +372,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + var canvasDIvHeight = $('#vidImagePanel_' + windowviewid+ " .jsPanel-content").height(); $scope.SetVideowindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetVideowindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetVideowindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetVideowindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetVideowindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#vidImagePanel_' + windowviewid+ " .jsPanel-content").height(); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight); $rootScope.resetMenuOptionOnClick(pnlName); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js index 1c8b547..2c81dcd 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js @@ -21,6 +21,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout 'maximised': false, 'minmaxAutoEvent':true, 'annotationData':{shapeStates:[],paintCanvasState:[]}, + 'imgLeft': 0, }; return windata; @@ -217,6 +218,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var imageId = $scope.picOpenInOtherModules.id; $scope.SetPICwindowStoreData(windowviewid, 'imageId', imageId); + var imgLeft = $scope.picOpenInOtherModules.imgLeft!=undefined?$scope.picOpenInOtherModules.imgLeft:0; + $scope.SetPICwindowStoreData(windowviewid, 'imgLeft', imgLeft); var imageSource=$scope.picOpenInOtherModules.imageSource; @@ -315,45 +318,81 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetPICwindowStoreData(windowviewid, 'maximised',true); $scope.SetPICwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } + }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetPICwindowStoreData(windowviewid, 'minimised',false); $scope.SetPICwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + + var isAutoCalled = $scope.GetPICwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + $rootScope.UnsaveCurriculum = true; + + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); + $scope.SetPICwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetPICwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetPICwindowStoreData(windowviewid, 'height',canvasDIvHeight); $scope.SetPICwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetPICwindowStoreData(windowviewid, 'x', ui.position.left); - $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - $rootScope.resetMenuOptionOnClick(pnlName); + + + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + var annotationData=$rootScope.GetPICwindowData(windowviewid,'annotationData'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight-5,canvasDIvWidth,annotationData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + } }, @@ -397,47 +436,42 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') - var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height()-5; + var canvasDIvWidth = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").width(); - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight-5); - var canvas = document.getElementById("canvasPIC_" + windowviewid); - var canvasPaint = document.getElementById("canvasPaintPIC_" + windowviewid); - - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { - canvas.width = screen.width-20; - canvasPaint.width = screen.width-20; - canvas.height = screen.height-130; - canvasPaint.height = screen.height-130; - } - else - { - canvas.height = screen.height-280; - canvasPaint.height = screen.height-280; - canvas.width = screen.width-40; - canvasPaint.width = screen.width-40; - - } - var openedImage = document.getElementById('mypic_' + windowviewid ); openedImage.src = selectedpicture; openedImage.onload = function () { + var pnlName='picImagePanel_' + windowviewid; + var canvasDiv='canvasDivPIC_' + windowviewid; + var canvasDraw='canvasPIC_' + windowviewid; + var canvasPaint='canvasPaintPIC_' + windowviewid; + var imgName='mypic_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + var oldleft= $rootScope.GetPICwindowData(windowviewid, 'imgLeft'); + $rootScope.setIMGPanelCordinate(windowviewid,pnlName,canvasDiv,canvasDraw,canvasPaint,imgName,oldleft,canvasDIvHeight,canvasDIvWidth,demoData); + var img = document.getElementById(imgName); + $rootScope.SetPICwindowData(windowviewid, 'imgLeft',img.offsetLeft); + $scope.JsPanelclick(windowviewid); - //some time get big size image - if(this.height>780) - { - canvas.height = this.height; - canvasPaint.height = this.height; - } - + var annotationData= $scope.picOpenInOtherModules.annotationData; // load annotation if(annotationData!="" && annotationData!=undefined) { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { + var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); + if(modifiedData!="" && modifiedData!=undefined) + { + if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) + { + annotationData=modifiedData; + } + } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasPIC_"+windowviewid,"canvasPaintPIC_"+windowviewid,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); } } $scope.EnableUI(); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index b03a88e..2a2bf66 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -517,7 +517,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.SetAAwindowStoreData(windowviewid, 'maximised', isMaximize); $scope.SetAAwindowStoreData(windowviewid, 'minimised', isMinimize); - + // note:: in few json like "articulation" imageId as same id // get wrong detail by imageId //solution: use id to get imageid from js list @@ -666,47 +666,77 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; - var isAutoCalled = $scope.GetAAwindowStoreData(windowviewid, 'minmaxAutoEvent'); - if(!isAutoCalled) - { - $rootScope.UnsaveCurriculum = true; - } + $scope.SetAAwindowStoreData(windowviewid, 'maximised',true); $scope.SetAAwindowStoreData(windowviewid, 'minimised',false); - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); + + var extraheight=$('#aastickeyarea').height()+15; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + + var isAutoCalled = $scope.GetAAwindowStoreData(windowviewid, 'minmaxAutoEvent'); + if(!isAutoCalled) + { + $rootScope.UnsaveCurriculum = true; + var annotationData=$rootScope.GetAAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); + } }, onnormalized:function (panel) { var pnlName=panel[0].id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + $scope.SetAAwindowStoreData(windowviewid, 'minimised',false); + $scope.SetAAwindowStoreData(windowviewid, 'maximised',false); + + var extraheight=$('#aastickeyarea').height()+15; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + var isAutoCalled = $scope.GetAAwindowStoreData(windowviewid, 'minmaxAutoEvent'); if(!isAutoCalled) { - $rootScope.UnsaveCurriculum = true; + $rootScope.UnsaveCurriculum = true; + var annotationData=$rootScope.GetAAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,annotationData); } - $scope.SetAAwindowStoreData(windowviewid, 'minimised',false); - $scope.SetAAwindowStoreData(windowviewid, 'maximised',false); - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { + minWidth: 600, + minHeight: 500, stop: function (event, ui) { var pnlName=event.currentTarget.id; var len = (pnlName).split("_").length; var windowviewid = (pnlName).split("_")[len - 1]; + + var extraheight=$('#aastickeyarea').height()+15; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height(); + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + $scope.SetAAwindowStoreData(windowviewid, 'width', ui.size.width); - $scope.SetAAwindowStoreData(windowviewid, 'height', ui.size.height); + $scope.SetAAwindowStoreData(windowviewid, 'height', canvasDIvHeight); $scope.SetAAwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetAAwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - $rootScope.resetMenuOptionOnClick(pnlName); - } - + + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + + var annotationData=$rootScope.GetAAwindowData(windowviewid,'annotationData'); + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight-extraheight,canvasDIvWidth,annotationData); + } }, draggable: { stop: function( event, ui ) { @@ -786,16 +816,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.loadAAModule = function (windowviewid) { - if (!$rootScope.isCallFromOtherModule) { - // $('#aaBodyView').css("height", $(window).outerHeight() - 65); - // $('#aaBodyView').css("width", $(window).outerWidth() - 15); - $('#aaBodyView').css("height", $(window).innerHeight()-100); - $('#aaBodyView').css("width",$(window).innerWidth()-100); - } - - var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-50; - $('#canvasAADiv_' + windowviewid).css('height', canvasDIvHeight); - // $('.canvasDivClass').css("height", canvasDIvHeight); + var extraheight=$('#aastickeyarea').height()+15; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; $scope.convertToZoomValue(windowviewid); @@ -818,15 +842,23 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //0.5 create canvas on the top of image. var canvas = document.createElement('canvas'); canvas.id = 'aaDetailViewCanvas_'+windowviewid; - canvas.className = '.aaCanvas' - canvas.height = screen.height<=768?screen.height: screen.height-300// parseInt(relativeHeight + 10); - canvas.width = screen.width<=1024?screen.width: screen.width-200//parseInt(relativeWidth + 10); + canvas.className = '.aaCanvas'; + canvas.height =parseInt(relativeHeight)+20; + canvas.width =parseInt(relativeWidth)+50; canvas.style.left = '0px'; canvas.style.top = '0px'; canvas.style.position = "absolute"; canvas.style.zIndex = 12002; $("#canvasAADiv_" + windowviewid).append(canvas); - + + var pnlName='AAImagePanel_' + windowviewid; + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + + var demoData= {shapeStates:[],paintCanvasState:""}; + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); + $timeout(function () { $scope.loadAllPinFirstTime(windowviewid); //call time interval function until load pin data @@ -841,27 +873,26 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.stopIntervalAA(); $scope.showAllPins(windowviewid); $scope.Setslider(windowviewid); - //7. Highlight all system body list in left side - $scope.highlightBodySystemList(windowviewid); - $scope.loadbtnNavigator(windowviewid); - $scope.JsPanelclick(windowviewid); - - if ($rootScope.isCallFromOtherModule) { - $scope.loadAAonCBData(windowviewid); - - //$rootScope.ShowAnnotationWindow(); //show tool if need - var annotationData= $scope.aaOpenInOtherModules.annotationData; - // load annotation - if(annotationData!="" && annotationData!=undefined) + //7. Highlight all system body list in left side + $scope.highlightBodySystemList(windowviewid); + $scope.loadbtnNavigator(windowviewid); + $scope.JsPanelclick(windowviewid); + + if ($rootScope.isCallFromOtherModule) { + $scope.loadAAonCBData(windowviewid); + + //$rootScope.ShowAnnotationWindow(); //show tool if need + var annotationData= $scope.aaOpenInOtherModules.annotationData; + // load annotation + if(annotationData!="" && annotationData!=undefined) + { + if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { - if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { - //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation("canvasAA_"+windowviewid,"canvasPaintAA_"+windowviewid,annotationData); - } - } + //first draw shape and then store in object + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + } } - + } } else { @@ -1064,19 +1095,38 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //get last zindex var zindex= $("#aaDetailViewCanvas_"+windowviewid).css("z-index"); - $("#aaDetailViewCanvas_"+windowviewid).remove(); + //remove all canvas + $('#'+'canvasAADiv_' + windowviewid+' canvas').remove(); + //0.5 create canvas on the top of image so that I can draw a line over the canvas. var canvas = document.createElement('canvas'); canvas.id = "aaDetailViewCanvas_"+windowviewid; canvas.className = 'aaCanvas'; - canvas.height = screen.height<=768?screen.height: screen.height-300// parseInt(relativeHeight + 10); - canvas.width = screen.width<=1024?screen.width: screen.width-200//parseInt(relativeWidth + 10); + canvas.height =parseInt(relativeHeight)+20; + canvas.width =parseInt(relativeWidth)+50; canvas.style.left = '0px'; canvas.style.top = '0px'; canvas.style.position = "absolute"; canvas.style.zIndex = zindex; $("#canvasAADiv_" + windowviewid).append(canvas); + + var pnlName='AAImagePanel_' + windowviewid; + var canvasDiv='canvasAADiv_' + windowviewid; + var canvasDraw='canvasAA_' + windowviewid; + var canvasPaint='canvasPaintAA_' + windowviewid; + $scope.SetAAwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + + var ATBarHtml = $("#" + canvasDiv).append(''); + $compile(ATBarHtml)($scope); + + var extraheight=$('#aastickeyarea').height()+15; + var extrawidth=$('.tools').width()+15; + var canvasDIvHeight = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").height()-extraheight; + var canvasDIvWidth = $('#AAImagePanel_' + windowviewid+ " .jsPanel-content").width()-extrawidth; + + var demoData= {shapeStates:[],paintCanvasState:""}; + $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); $scope.SetAAwindowStoreData(windowviewid,'isSliderChange',true); var toolbtnID = ''; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js index a28d357..2aeb186 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/ModuleService.js @@ -176,7 +176,8 @@ AIA.service('ModuleService', function ($http, DataService) { position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, - annotationData: windowData.annotationData + annotationData: windowData.annotationData, + imgLeft:windowData.imgLeft }); } else if (windowData.mType == "MY_ANIMATIONS") { @@ -193,7 +194,7 @@ AIA.service('ModuleService', function ($http, DataService) { id: windowData.id, position: windowData.position, size: windowData.size, - contextMenu: windowData.contextMenu + contextMenu: windowData.contextMenu }); } else if (windowData.mType == "LAB_EXERCISE") { @@ -243,7 +244,8 @@ AIA.service('ModuleService', function ($http, DataService) { position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, - annotationData: windowData.annotationData + annotationData: windowData.annotationData, + imgLeft:windowData.imgLeft }); } else if (windowData.mType == "CLINICAL_ANIMATIONS") { @@ -278,7 +280,8 @@ AIA.service('ModuleService', function ($http, DataService) { position: windowData.position, size: windowData.size, contextMenu: windowData.contextMenu, - annotationData: windowData.annotationData + annotationData: windowData.annotationData, + imgLeft:windowData.imgLeft }); } else if (windowData.mType == "ATLAS_ANATOMY") { @@ -305,8 +308,7 @@ AIA.service('ModuleService', function ($http, DataService) { size: windowData.size, contextMenu: windowData.contextMenu, showHideAnnotations: windowData.showHideAnnotations - // selectedSearchId: windowData.selectedSearchId - + }); } else if (windowData.mType == "DISSECTIBLE_ANATOMY") { @@ -354,7 +356,6 @@ AIA.service('ModuleService', function ($http, DataService) { transparencyY: windowData.transparencyY, layerNumberBeforeTBDraw: windowData.layerNumberBeforeTBDraw, showHideAnnotations: windowData.showHideAnnotations - }); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html index 258bcef..7c33025 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html @@ -1,4 +1,4 @@ -
+
@@ -119,109 +119,100 @@
-
- -
-
-
-
-
-
-
-
- Question of -
+
+
+
+
+
-
-
- - -
- - -
-
+