diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 53db88d..78b0d13 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -1062,7 +1062,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout theme: 'success', currentController: 'CAController', parentSlug: $scope.GetCAwindowStoreData(windowviewid, 'parentSlugName'), - content: '' + + content: '' + '

' + clickedCASummary + '

', + ' Here we are

' + clickedCASummary + '

', + title: tittle, position: { @@ -1132,7 +1133,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout theme: 'success', currentController: 'CAController', parentSlug: $scope.GetCAwindowStoreData(windowviewid, 'parentSlugName'), - content: '' + + content: '' + '

' + clickedCASummary + '

', + ' Here we are

' + clickedCASummary + '

', title: tittle, position: { @@ -1184,7 +1185,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCAwindowStoreData(windowviewid, 'maximised',true); $scope.SetCAwindowStoreData(windowviewid, 'minimised',false); var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + var summaryHeight = $('#summary_'+ windowviewid).height()+10; + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); $rootScope.resetMenuOptionOnClick(pnlName); var $ua = navigator.userAgent; if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { @@ -1193,11 +1195,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout { $("#caImagePanel_"+windowviewid).css('height',canvasDIvHeight+30-150); $('#caImagePanel_' + windowviewid+ " .jsPanel-content").css('height',canvasDIvHeight-150); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-150-120 ); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-150-summaryHeight ); } else if(aodheight<1024) { - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); } } }, @@ -1213,7 +1215,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCAwindowStoreData(windowviewid, 'minimised',false); $scope.SetCAwindowStoreData(windowviewid, 'maximised',false); var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + var summaryHeight = $('#summary_'+ windowviewid).height()+10; + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); $rootScope.resetMenuOptionOnClick(pnlName); }, resizable: { @@ -1229,8 +1232,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SetCAwindowStoreData(windowviewid, 'y', ui.position.top); $scope.SetCAwindowStoreData(windowviewid, 'x', ui.position.left); $rootScope.UnsaveCurriculum = true; - - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); + var summaryHeight = $('#summary_'+ windowviewid).height()+10; + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight ); $rootScope.resetMenuOptionOnClick(pnlName); } @@ -1248,28 +1251,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } }); } - - var isMaximize = $scope.GetCAwindowStoreData(windowviewid, 'maximised'); - var isMinimize = $scope.GetCAwindowStoreData(windowviewid, 'minimised'); - if (isMaximize) { - $scope.jsPanelCA.maximize(); - } - else if (isMinimize) { - $scope.jsPanelCA.minimize(); - } - else { - $scope.jsPanelCA.normalize(); - } - $rootScope.AllPanelObject(windowviewid,$scope.jsPanelCA); - - $("#caImagePanel_"+windowviewid).css('overflow','hidden'); - // set false after initial call of min,max or normal - $scope.SetCAwindowStoreData(windowviewid, 'minmaxAutoEvent', false); - $scope.SetCAwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); - $scope.SetCAwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); - $scope.SetCAwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); - $scope.SetCAwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); + var isMaximize = $scope.GetCAwindowStoreData(windowviewid, 'maximised'); + var isMinimize = $scope.GetCAwindowStoreData(windowviewid, 'minimised'); + if (isMaximize) { + $scope.jsPanelCA.maximize(); + } + else if (isMinimize) { + $scope.jsPanelCA.minimize(); + } + else { + $scope.jsPanelCA.normalize(); + } + $rootScope.AllPanelObject(windowviewid,$scope.jsPanelCA); + + $("#caImagePanel_"+windowviewid).css('overflow','hidden'); + // set false after initial call of min,max or normal + $scope.SetCAwindowStoreData(windowviewid, 'minmaxAutoEvent', false); + $scope.SetCAwindowStoreData(windowviewid, 'y', $scope.jsPanelTop); + $scope.SetCAwindowStoreData(windowviewid, 'x', $scope.jsPanelLeft); + $scope.SetCAwindowStoreData(windowviewid, 'width', $scope.jsPanelWidth); + $scope.SetCAwindowStoreData(windowviewid, 'height', $scope.jsPanelHeight); $scope.SetCAwindowStoreData(windowviewid, 'currentSlug', 'clinical-animations-detail'); $('html, body').animate({ scrollTop: 0 }); @@ -1281,28 +1283,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 ); - - var videoHeight = $('#playerinlineVideo_'+ windowviewid ).height(); - - var textH = $('.video-subtitle').height(); - textH = textH + 40; - var blackBorderHeight = canvasDIvHeight - (videoHeight + textH); - - if ($('.jsPanel-content').length > 0) { - $('.video-subtitle').css('margin-bottom', blackBorderHeight); - $('#divplayerinlineVideo_'+ windowviewid ).css('background', '#fff'); - //Android > Clinical Animations > The animation does not fit to the screen in the Landscape mode. - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('.jsPanel-content').css("width", "100%"); } - } - - if(screen.height<=640) - { - $('#btnTxtOnOff_' + windowviewid).css("top", "-15px"); - } - + var summaryHeight = $('#summary_'+ windowviewid).height(); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-summaryHeight); } //Calling methode for save Js Panel Activity for SaveCB @@ -1321,16 +1304,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.JsPanelclick(windowviewid); var isTextVisible = $scope.GetCAwindowStoreData(windowviewid, 'isTextVisible'); + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); + if(isTextVisible) { - $("#btnTxtOnOff_" + windowviewid).text("Text Off"); - $("#sid_" + windowviewid).css("visibility", "visible"); + $("#sid_" + windowviewid).css("display", "block"); + $("#btnTxtOnOff_" + windowviewid).text("Text Off"); + $('#summary_'+ windowviewid ).css("height","125px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-125 ); } else { + $("#sid_" + windowviewid).css("display", "none"); $("#btnTxtOnOff_" + windowviewid).text("Text On"); - $("#sid_" + windowviewid).css("visibility", "hidden"); - + $('#summary_'+ windowviewid ).css("height","40px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-40 ); + } } @@ -1402,11 +1391,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.GetTextVisiblity = function (windowviewid, btnTextValue) { var isVisible; + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height(); if (btnTextValue == "Text On") { isVisible = false; + $("#sid_" + windowviewid).css("display", "none"); + $('#summary_'+ windowviewid ).css("height","40px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-40 ); $scope.SetCAwindowStoreData(windowviewid, 'isTextVisible', isVisible); - } else { + } else + { isVisible = true; + $("#sid_" + windowviewid).css("display", "block"); + $('#summary_'+ windowviewid ).css("height","125px"); + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-125 ); $scope.SetCAwindowStoreData(windowviewid, 'isTextVisible', isVisible); } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index 6985308..99f1015 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -974,9 +974,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout '
' + //'
' + '' + - '
' + + '
' + '

' + selectedImageCISummary + '

' + - '
' + + '
' + '
'+ '
', title: tittle, @@ -1140,27 +1146,23 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $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"); - - if (parseInt(canvasZIndex) < parseInt(canvasPaintZIndex)) { - canvasPaintZIndex = parseInt(canvasPaintZIndex) + 1; - $('#summary_' + windowviewid).css("z-index", canvasPaintZIndex); - } - else { - canvasZIndex = parseInt(canvasZIndex) + 1; - $('#summary_' + windowviewid).css("z-index", canvasZIndex); - } - + + $rootScope.SetPaintZindexforCISummary(windowviewid); $scope.JsPanelclick(windowviewid); var isTextVisible = $scope.GetCIwindowStoreData(windowviewid, 'isTextVisible'); if (isTextVisible) { - $("#btnTxtOnOff_" + windowviewid).text("Text Off"); $("#sid_" + windowviewid).css("visibility", "visible"); + $("#btnTxtOnOff_" + windowviewid).text("Text Off"); + $("#sid_" + windowviewid).css("display", "block"); + // $('#summary_' + windowviewid).css({"width": "100%","left":"0px"}); } - else { - $("#btnTxtOnOff_" + windowviewid).text("Text On"); $("#sid_" + windowviewid).css("visibility", "hidden"); + else + { + $("#btnTxtOnOff_" + windowviewid).text("Text On"); + $("#sid_" + windowviewid).css("display", "none"); + // var canvasWidth = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").width()-107; + // $('#summary_' + windowviewid).css({"width": "87px","left":canvasWidth+'px'}); } if ($rootScope.isCallFromOtherModule) { var annotationData= $scope.ciOpenInOtherModules.annotationData; @@ -1178,7 +1180,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } //first draw shape and then store in object - $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); + $rootScope.LoadCBSavedAnnotation(canvasDraw,canvasPaint,annotationData); } } @@ -1276,11 +1278,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var isVisible; if (btnTextValue == "Text On") { isVisible = false; + $('#sid_' + windowviewid).css("display","none"); + // var canvasWidth =$('#ciImagePanel_' + windowviewid + ' .jsPanel-content').width()-107; + // $('#summary_' + windowviewid).css({"width": "87px","left":canvasWidth+"px"}); $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible); - } else { + } + else + { isVisible = true; + $('#sid_' + windowviewid).css("display","block"); + // $('#summary_' + windowviewid).css({"width": "100%","left":"0px"}); $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible); } + + $rootScope.SetPaintZindexforCISummary(windowviewid); } $scope.RemoveJSPanel = function (panelid) { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 50aebab..75f1cb5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -2546,7 +2546,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canvasDraw='canvasDA_' + windowviewid; var canvasPaint='canvasPaintDA_' + windowviewid; var bodyVid=$rootScope.GetDAwindowData(windowviewid,'voId'); - var demoData= {shapeStates:[],paintCanvasState:""}; + var demoData= {shapeStates:[],paintCanvasState:[]}; var isCanvasReset = $scope.GetwindowStoreData(windowviewid, 'isCanvasReset'); if(isCanvasReset) @@ -2581,7 +2581,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { - console.log("loading canvas...."); + console.log("loading images on canvas...."); } }, 100); @@ -5030,6 +5030,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var canDiv = document.getElementById('canvasDivDA_' + windowviewid); if($rootScope.globalSetting.onLayerChange) { + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + var canDivChildCount = canDiv.childElementCount; if (canDivChildCount > 0) { canDiv.innerHTML = ''; @@ -5041,6 +5045,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { + $scope.SetwindowStoreData(windowviewid, 'isCanvasReset',false); //remove all canvas except pait and drawing $('#'+'canvasDivDA_' + windowviewid+' canvas').not('#canvasDA_'+windowviewid).not('#canvasPaintDA_'+windowviewid).remove(); } @@ -6473,23 +6478,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#btnIdentify_' + windowviewid).addClass('btn-primary'); // clear canvas before drawing transparency box - if ($rootScope.isAnnotationWindowOpen == true) { - // $('#canvasDA_' + windowviewid).removeLayers(); - var paintCanvasObj = document.getElementById("canvasPaintDA_" + windowviewid); - if (paintCanvasObj != null) { - var ctx = paintCanvasObj.getContext("2d"); - ctx.clearRect(0, 0, paintCanvasObj.width, paintCanvasObj.height); - } - var CanvasObj = document.getElementById("canvasDA_" + windowviewid); - if (CanvasObj != null) { - var ctx1 = CanvasObj.getContext("2d"); - ctx1.clearRect(0, 0,CanvasObj.width, CanvasObj.height); - } - $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + //var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); - $("#canvasPaintDA_" + windowviewid).sketch().actions = []; + if ($rootScope.isAnnotationWindowOpen == true) { + $("#annotationpaintbrushsize").removeClass("activebtncolor"); $("#annotationpainteraser").removeClass("activebtncolor"); if ($("#DrawMode").hasClass("annotationtoolbartab")) { @@ -6549,13 +6546,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (drawCanvasZindex > paintCanvasZindex) { $(".ui-wrapper").css("z-index", drawCanvasZindex); $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', drawCanvasZindex); - $('#canvasPaintDA_' + windowviewid).css("z-index", drawCanvasZindex+2); } else { $(".ui-wrapper").css("z-index", paintCanvasZindex); - $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex); - $('#canvasPaintDA_' + windowviewid).css("z-index", paintCanvasZindex+2); - + $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex); } } @@ -6841,6 +6835,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } + //curriculum on slide load $scope.CalculateDimensionsAndDrawTBox = function (windowviewid) { $scope.SetwindowStoreData(windowviewid, 'isTransparent', true); $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false); @@ -7085,17 +7080,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // clear canvas before drawing transparency box if ($rootScope.isAnnotationWindowOpen == true) { - //$('#canvasDA_' + windowviewid).removeLayers(); - var paintCanvasObj = document.getElementById("canvasPaintDA_" + windowviewid); - if (paintCanvasObj != null) { - var ctx = paintCanvasObj.getContext("2d"); - ctx.clearRect(0, 0, paintCanvasObj.width, paintCanvasObj.height); - } - var CanvasObj = document.getElementById("canvasDA_" + windowviewid); - if (CanvasObj != null) { - var ctx1 = CanvasObj.getContext("2d"); - ctx1.clearRect(0, 0, CanvasObj.width, CanvasObj.height); - } $("#annotationpaintbrushsize").removeClass("activebtncolor"); $("#annotationpainteraser").removeClass("activebtncolor"); if ($("#DrawMode").hasClass("annotationtoolbartab")) { @@ -7139,7 +7123,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid, 'UIWrapperZIndex', paintCanvasZindex); $('#canvasPaintDA_' + windowviewid).css("z-index", paintCanvasZindex+2); } - //$rootScope.switchToTransparencycanvas("daImagePanel_"+windowviewid); } } else @@ -9064,25 +9047,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.removeAllTermTpClose(windowviewid); // clear canvas on closing of transparency box - if ($rootScope.isAnnotationWindowOpen == true) { - $('#canvasDA_'+windowviewid).removeLayers(); - var paintCanvasObj = document.getElementById('canvasPaintDA_'+windowviewid); - if (paintCanvasObj != null) { - var ctx = paintCanvasObj.getContext("2d"); - ctx.clearRect(0, 0, paintCanvasObj.width, paintCanvasObj.height); - - var CanvasObj = document.getElementById("canvasDA_" + windowviewid); - if (CanvasObj != null) { - var ctx1 = CanvasObj.getContext("2d"); - ctx1.clearRect(0, 0, CanvasObj.width, CanvasObj.height); - } - $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); - $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - - var sktch = $('#canvasPaintDA_'+windowviewid).sketch(); - $('#canvasPaintDA_'+windowviewid).sketch().actions = []; - } - } + + $('#canvasDA_' + windowviewid).removeLayers();//remove all old shape + // var sktch = $("#canvasPaintDA_" + windowviewid).sketch(); + $("#canvasPaintDA_" + windowviewid).sketch().actions = [];//remove old paint data + $scope.SetwindowStoreData(windowviewid, 'isCBAnnotationActive',false); + $scope.SetwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); var tBox = document.getElementById('transparencyCanvas_' + windowviewid); if (tBox != null) { @@ -9163,6 +9133,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } + $scope.removeannotationShape = function (ClickByButton,windowviewid){ + + } + function positionTooltip(event, x, y) { x = 100, y = 200, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 77a7920..2625421 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -3111,6 +3111,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $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; @@ -3183,9 +3184,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data else if(paneld.match("caImagePanel")) { $("#"+paneld).css('height','520'); - $("#"+paneld+' .jsPanel-content').css('height','490'); - $('#playerinlineVideo_'+ MultiWinId ).css("height",370 ); - + $("#"+paneld+' .jsPanel-content').css('height','490'); + + var summaryHeight = $('#summary_'+ MultiWinId).height()+10; + $('#playerinlineVideo_'+ MultiWinId ).css("height",490-summaryHeight ); + $rootScope.SetCAwindowData(MultiWinId,'width',resetWidth); $rootScope.SetCAwindowData(MultiWinId,'height',520); $rootScope.SetCAwindowData(MultiWinId,'y',pTop); @@ -3302,7 +3305,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) { - // image fixed no position changed + $('#' + CanvasDrawId).removeLayers();//remove all old shape + $("#" + canvasPaintId).sketch().actions = [];//remove old paint data first //first draw shape and then store in object $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,annotationData); } @@ -3343,19 +3347,27 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data canvas.width = img.width; canvasPaint.width = img.width; } + if(pnlName.match("ciImagePanel")) + { + canvas.height = canvas.height-40; + canvasPaint.height = canvasPaint.height-40; + } if(annotationData!="" && annotationData!=undefined) - { + { if(annotationData.shapeStates.length>0||annotationData.paintCanvasState.length>0) - { + { + var modifiedData= {shapeStates:[],paintCanvasState:[]}; var modifiedData=$rootScope.resetAnnotationData(imgName,oldleft,annotationData); if(modifiedData!="" && modifiedData!=undefined) { if(modifiedData.shapeStates.length>0||modifiedData.paintCanvasState.length>0) { - annotationData=modifiedData; + $('#' + CanvasDrawId).removeLayers();//remove all old shape + $("#" + canvasPaintId).sketch().actions = [];//remove old paint data first + //first draw shape and then store in object - $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,annotationData); + $rootScope.ResizeCBSavedAnnotation(pnlName,CanvasDrawId,canvasPaintId,modifiedData); } } @@ -3365,45 +3377,44 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $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;shapeindx=0) + { + var shapeStates=annotationData.shapeStates; + var shapecount=shapeStates.length; + for(var shapeindx=0;shapeindx0) - { - 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]; @@ -5313,31 +5287,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data { var shapeData=shapeStates[shapeindx]; var shapeName = shapeStates[shapeindx].layerName; - var shapetype = shapeStates[shapeindx].shapeType; $rootScope.AutoDrawShapeByData(canvasId,shapeData); - - if(shapetype=="Pin") - { - var spliLayer = shapeName.split("_"); - var pinArcName = "ArcPin_"+spliLayer[1];; - - $("#" + canvasId).removeLayer(shapeName).drawLayers(); - $("#" + canvasId).removeLayer(pinArcName).drawLayers(); - } - else if(shapetype=="textArea") - { - var spliLayer = shapeName.split("_"); - var textareaName="TextArea_" +spliLayer[1]; - - $("#" + canvasId).removeLayer(shapeName).drawLayers(); - $("#" + canvasId).removeLayer(textareaName).drawLayers(); - - } - else - { - $("#" + canvasId).removeLayer(shapeName).drawLayers(); - } - + annotationData.shapeStates = new jinqJs() .from(annotationData.shapeStates) .delete().at("layerName == " + shapeName).select(); @@ -5350,11 +5301,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.switchCanvasToPaintCanvas(paneld); var drawingPoints=paintCanvasState //auto save last cb paint - $scope.PaintEraseEvent(); - $scope.savePaintAnnotation(canvasPaintId,drawingPoints); - $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); + + $scope.PaintEraseEvent(); + $scope.savePaintAnnotation(canvasPaintId,drawingPoints); + $("#" + canvasPaintId).sketch({drawAction:drawingPoints}); //clear sketch js event for paint and erase - $.sketch = { tools: {}}; + $.sketch = { tools: {}}; } $rootScope.CloseAnnotationTool(); @@ -5421,7 +5373,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } } } - var drawingPoints=paintCanvasState + var drawingPoints=paintCanvasState ; + //auto save last cb paint $scope.PaintEraseEvent(); $scope.savePaintAnnotation(canvasPaintId,drawingPoints); @@ -5733,7 +5686,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data name: 'Line_' + LineNumber, layer: true, type: 'line', - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, rounded: true, @@ -5925,7 +5878,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data name: 'Rect_' + RectNumber, fillStyle: shapestyleFillColor, type: 'rectangle', - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, opacity: shapestyleOpacity, strokeWidth: shapestyleborderWidth, @@ -6140,7 +6093,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data name: 'Circle_' + CircleNumber, type: 'ellipse', opacity: shapestyleOpacity, - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, fillStyle: shapestyleFillColor, @@ -6347,7 +6300,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data layer: true, type:'Arrow', name: 'Arrow_' + ArrowNumber, - draggable: true, + draggable: false, strokeStyle: shapestyleborderColor, strokeWidth: shapestyleborderWidth, rounded: true, @@ -6543,8 +6496,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }); $("#"+canvasId).drawLine({ panelCanvasId:canvasId, - draggable: true, layer: true, + draggable: false, type:'Pin', name: "Pin_" + PinNumber, groups: ["Pin_" + PinNumber], @@ -6563,6 +6516,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data mouseup: 'pointer' }, add: function (layer) { + layer.draggable = false; var drawingPoints={ "layerName": layer.name,//for internal use "shapeType":layer.type, @@ -6742,7 +6696,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#" + layer.panelCanvasId).drawArc({ panelCanvasId:layer.panelCanvasId, layer: true, - draggable: true, + draggable: false, name: pinArcName, groups: [layer.groups], dragGroups: [layer.dragGroups], @@ -6865,10 +6819,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } }, }).drawArc({ - draggable: true, panelCanvasId:canvasId, name: "ArcPin_" + PinNumber, layer: true, + draggable: false, groups: ["Pin_" + PinNumber], dragGroups: ["Pin_" + PinNumber], strokeStyle: 'grey', @@ -7281,7 +7235,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data groups: [rectDimension[0].groupName], dragGroups: [rectDimension[0].groupName], layer: true, - draggable: true, + draggable: false, type:'textArea', opacity: rectDimension[0].shapestyle.opacity, strokeStyle: rectDimension[0].shapestyle.color, @@ -7304,7 +7258,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // Revert cursor on mouseup mouseup: 'pointer' }, - add: function (layer) { + add: function (layer) { + layer.draggable = false; var drawingPoints={ "layerName": layer.name,//for internal use "shapeType":layer.type, @@ -7789,7 +7744,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data }).drawText({ panelCanvasId:canvasId, layer: true, - draggable: true, + draggable: false, name: textDimension[0].name, groups: [rectDimension[0].groupName], dragGroups: [rectDimension[0].groupName], @@ -7813,7 +7768,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data mouseup: 'pointer' }, add: function (layer) { - layer.draggable = true; + layer.draggable = false; //remove temptext $("#" + canvasId).removeLayer('temptext').drawLayers(); }, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js index 77a3e26..787c4d5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js @@ -437,23 +437,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }); var canvasDIvHeight = $('#vidImagePanel_' + windowviewid+ " .jsPanel-content").height(); - $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight); - - var videoHeight = $('#divplayerinlineVideo_'+ windowviewid +' div').height(); - if (videoHeight <= 0) - videoHeight = 360; - var textH = $('.video-subtitle').height(); - textH = textH + 40; - var blackBorderHeight = canvasDIvHeight - (videoHeight + textH); - - if ($('.jsPanel-content').length > 0) { - $('.video-subtitle').css('margin-bottom', blackBorderHeight); - $('#divplayerinlineVideo_'+ windowviewid ).css('background', '#fff'); - //Android > Clinical Animations > The animation does not fit to the screen in the Landscape mode. - var $ua = navigator.userAgent; - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('.jsPanel-content').css("width", "100%"); } - } - + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight); } //Calling methode for save Js Panel Activity for SaveCB diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 2a2bf66..86ba36c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -856,7 +856,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var canvasDraw='canvasAA_' + windowviewid; var canvasPaint='canvasPaintAA_' + windowviewid; - var demoData= {shapeStates:[],paintCanvasState:""}; + var demoData= {shapeStates:[],paintCanvasState:[]}; $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); $timeout(function () { @@ -881,7 +881,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if ($rootScope.isCallFromOtherModule) { $scope.loadAAonCBData(windowviewid); - //$rootScope.ShowAnnotationWindow(); //show tool if need var annotationData= $scope.aaOpenInOtherModules.annotationData; // load annotation if(annotationData!="" && annotationData!=undefined) @@ -1095,8 +1094,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou //get last zindex var zindex= $("#aaDetailViewCanvas_"+windowviewid).css("z-index"); - //remove all canvas - $('#'+'canvasAADiv_' + windowviewid+' canvas').remove(); + $("#aaDetailViewCanvas_"+windowviewid).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'); @@ -1116,16 +1114,16 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou var canvasDraw='canvasAA_' + windowviewid; var canvasPaint='canvasPaintAA_' + windowviewid; $scope.SetAAwindowStoreData(windowviewid, 'annotationData', {shapeStates:[],paintCanvasState:[]}); - - var ATBarHtml = $("#" + canvasDiv).append(''); - $compile(ATBarHtml)($scope); + + $('#' + canvasDraw).removeLayers();//remove all old shape + $("#" + canvasPaint).sketch().actions = [];//remove old paint data 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:""}; + var demoData= {shapeStates:[],paintCanvasState:[]}; $rootScope.setAADAPanelCordinate(windowviewid,0,pnlName,canvasDiv,canvasDraw,canvasPaint,canvasDIvHeight,canvasDIvWidth,demoData); $scope.SetAAwindowStoreData(windowviewid,'isSliderChange',true); diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/sketch.js b/400-SOURCECODE/AIAHTML5.Web/libs/sketch.js index 9a5b25c..fdad313 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/sketch.js +++ b/400-SOURCECODE/AIAHTML5.Web/libs/sketch.js @@ -20,10 +20,23 @@ var __slice = Array.prototype.slice; } else { return $.error('Sketch.js did not recognize the given command.'); } - } else if (sketch) { + } + else if (sketch) + { + if(key!=undefined) + { + // redraw action while resize panel + this.data('sketch', new Sketch(this.get(0), key)); + return this; + } + return sketch; - } else { + } + else + { + this.data('sketch', new Sketch(this.get(0), key)); + return this; } }; @@ -46,8 +59,12 @@ var __slice = Array.prototype.slice; if(opts!=undefined) { this.actions= opts.drawAction; - // Redraw image by using the data - this.redraw(); + if(this.actions!=undefined) + { + // Redraw image by using the data + this.redraw(); + } + } this.action = []; this.canvas.bind('click mousedown mouseup mousemove mouseleave mouseout touchstart touchmove touchend touchcancel', this.onEvent);