diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 9d6b462..431e6e3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -1798,9 +1798,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.CBEnableUI(); // scroll down to first panel - var lastpanel = modulePanel[0].id; - $('body,html').animate({ scrollTop: $('#' + lastpanel).position().top }, 1000); - + if (modulePanel.length > 0) { + if (modulePanel[0].id != undefined) { + var lastpanel = modulePanel[0].id; + //$('body,html').animate({ scrollTop: $('#' + lastpanel).position().top }, 1000); + } + } + + } } @@ -2333,11 +2338,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ highlightOptionsSelectedId: 0, selectedStructureID: 0,//N contentDescriptorId: 0, - callOuts: $rootScope.DaWindowData[i].CurriculumTermData, - hideAllPins: $rootScope.DaWindowData[i].isHidePinBtnClicked, - selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate, - layerNumber: $rootScope.DaWindowData[i].currentLayerNumber, - isModestyOn: $rootScope.DaWindowData[i].isModestyOn, + callOuts: $rootScope.DaWindowData[i].CurriculumTermData, + //hideAllPins: $rootScope.DaWindowData[i].isHidePinBtnClicked, + //selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate, + layerNumber: parseInt($rootScope.DaWindowData[i].layerNumber) + 1, + isModestyOn: $rootScope.DaWindowData[i].ModestyValue, isTransparent: $rootScope.DaWindowData[i].isTransparencyActivated, isTopToolBarVisible: false, //$rootScope.DaWindowData[i].isTopToolBarVisible, clickedTermList: $rootScope.DaWindowData[i].fullTermlist, @@ -2369,15 +2374,15 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ containsCapturedContent: true, //contextMenu: { hideLeftBar: false, hideTitleBar: false, hideTopToolBar: false, lockResize: false }, //activePinArray: $rootScope.DaWindowData[i].activePinArray, // Selected PINID on Body - //sliderVal: $rootScope.DaWindowData[i].sliderVal, - zoom: $rootScope.DaWindowData[i].zoomInOut, - skinId: $rootScope.DaWindowData[i].genderId, + //sliderVal: $rootScope.DaWindowData[i].sliderVal, + zoom: $rootScope.DaWindowData[i].zoomInOut, + skinId: $rootScope.DaWindowData[i].curentEthnicity, isResizeLock: false , //.isResizeLock,//N - mode: $rootScope.DaWindowData[i].isNormalMode, + mode: $rootScope.DaWindowData[i].mode, windowListId: 0,//windowData.windowListId,//25 - canvasVScrollX: 0,//canvasVScrollX,//N - canvasHScrollX: 0,//canvasHScrollX,//N - isCallOutVisible: false, + canvasVScrollX: $rootScope.DaWindowData[i].CanvasDivTopPosition, + canvasHScrollX: $rootScope.DaWindowData[i].CanvasDivLeftPosition, + isCallOutVisible: false, annotationData: "", // .annotationData,//24 transparencyBounds: 0,//windowData.transparencyBounds, isLeftToolBarVisible: false, //windowData.isLeftToolBarVisible,//N @@ -2393,13 +2398,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } - $scope.updateWindowsContentForSaveCB = function (currentId) { - - //$scope.saveDAWindowActivity(currentId); + $scope.updateWindowsContentForSaveCB = function (currentId) { + + $scope.saveDAWindowActivity(currentId); $scope.saveAAWindowActivity(currentId); $scope.saveCIWindowActivity(currentId); $scope.saveCAWindowActivity(currentId); - $scope.save3DWindowActivity(currentId); + $scope.save3DWindowActivity(currentId); + //$scope.savePicWindowActivity($scope.windowDataforCB); //if ($scope.updatedWindowListForSaveCB.length > 0) { findKeyForChange($rootScope.contentNotesForSaveCB, currentId); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index cffb46b..1e8275e 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -146,7 +146,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'height': 0, 'minimised': false, 'maximised': false, - 'id': 0 + 'id': 0, + 'moduleName': '', + 'mode': '' }); @@ -246,10 +248,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'height': 0, 'minimised': false, 'maximised': false, - 'id': 0 - }); - - } + 'id': 0, + 'moduleName': '', + 'mode': '' + }); + + } } @@ -752,7 +756,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var isMinimize = $scope.daOpenInOtherModules.minimised; $scope.SetwindowStoreData(windowviewid, 'maximised', isMaximize); $scope.SetwindowStoreData(windowviewid, 'minimised', isMinimize); - + $scope.SetwindowStoreData(windowviewid, 'moduleName', "DISSECTIBLE_ANATOMY"); + $scope.SetwindowStoreData(windowviewid, 'mode', $scope.daOpenInOtherModules.mode); + $scope.SetwindowStoreData(windowviewid,'parentSlugName',($location.url()).replace('/', '')); if ( $rootScope.BodyViewData == null || $rootScope.BodyViewData == undefined) { @@ -1594,9 +1600,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } var ModestyValue=$scope.GetwindowStoreData(windowviewid,'ModestyValue'); - - if(ModestyValue=="Y") - { + + if (ModestyValue == "Y") + { $scope.SetwindowStoreData(windowviewid, 'isModestyOn', true); } else @@ -1785,7 +1791,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else if($scope.daOpenInOtherModules.mode=='EXTRACT') - { + { + $scope.SetwindowStoreData(windowviewid,'isExtract',true); //Normal only @@ -2148,7 +2155,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ((parseInt(dtlOfSktn[0]._lns) <= parseInt(nlayer)) && (parseInt(dtlOfSktn[0]._lne) > parseInt(nlayer)) && (dtlOfSktn[0]._isfr == 'Y')) { $rootScope.isLayerLessSeven = true; // using at home var ModestyValue=$scope.GetwindowStoreData(windowviewid,'ModestyValue'); - if ((ModestyValue == 'Y')) { + if (ModestyValue == 'Y') { $('.modestyImg_'+windowviewid).css('visibility', 'visible'); } @@ -2773,8 +2780,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // Scroll canvas based on CB data var isHighlightBodyWithCBTermData = $scope.GetwindowStoreData(windowviewid, 'isHighlightBodyWithCBTermData'); if (isHighlightBodyWithCBTermData == true) { - $('#canvasDivDA_' + windowviewid).scrollLeft($scope.daOpenInOtherModules.canvasHScrollX); - $('#canvasDivDA_' + windowviewid).scrollTop($scope.daOpenInOtherModules.canvasVScrollX); + var canvasHScrollX = $scope.daOpenInOtherModules.canvasHScrollX; + var canvasVScrollX = $scope.daOpenInOtherModules.canvasVScrollX; + $('#canvasDivDA_' + windowviewid).scrollLeft(canvasHScrollX); + $('#canvasDivDA_' + windowviewid).scrollTop(canvasVScrollX); $scope.SetwindowStoreData(windowviewid, 'CanvasDivTopPosition', $("#canvasDivDA_" + windowviewid).scrollTop()); $scope.SetwindowStoreData(windowviewid, 'CanvasDivLeftPosition', $("#canvasDivDA_" + windowviewid).scrollLeft()); @@ -2894,6 +2903,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l imgCanvas.addEventListener('click', function (evt) { + var preTermData; //Use for Remove SpeechBUbble With TermNumber var len= (evt.currentTarget.id).split("_").length; var windowviewid = (evt.currentTarget.id).split("_")[len-1]; var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid); @@ -2909,13 +2919,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } else { - $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); - $('#typedTermName_' + windowviewid).val(''); + preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); + $('#typedTermName_' + windowviewid).val(''); $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []); $scope.SetwindowStoreData(windowviewid, 'AllTerms', []); - $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]); - $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',false); + $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]); + $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false); + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []); console.log('multiAnnotationIsON: ' + false); @@ -2987,6 +2999,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList'); previousHighlightList.push(RGBColor); + + //Save Term Number to Showing Annotaion for CB Module + var AllTerms = $scope.GetwindowStoreData(windowviewid, 'AllTerms'); + AllTerms.push({ '_TermNumber': RGBColor }); + var fullTermlist = $scope.GetwindowStoreData(windowviewid, 'fullTermlist'); + fullTermlist.push(parseInt(RGBColor)); + + var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + CurriculumTermData.push({ + "termNumber": parseInt(RGBColor), + "tips_x": parseInt( evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30, + "tips_y": parseInt( evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10, + "x": evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, + "y": evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top + }); + + if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true) { if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) { @@ -3054,7 +3083,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]); } - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor); } } @@ -3066,18 +3095,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($('#dot_'+windowviewid).length > 0) { $('#dot_'+windowviewid).remove(); - + if ($('#sppeachBubble_'+windowviewid).length > 0) { - $('#sppeachBubble_'+windowviewid).remove(); + $('#sppeachBubble_' + windowviewid).remove(); } if ($('.com_'+windowviewid).length > 0) { $('.com_'+windowviewid).remove(); } if ($('#bord_'+windowviewid).length > 0) { $('#bord_'+windowviewid).remove(); - } - - + } if (TermAnnotationText.length > 0) { for (var i = 0; i <= TermAnnotationText.length - 1; i++) { @@ -3087,8 +3114,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor); } + //Remove previous SpeechBubble with termnumber + var TermAnnotationText = $scope.GetwindowStoreData(windowviewid, 'TermAnnotationText'); + //if (TermAnnotationText[0] != "Skin") { + if (preTermData != undefined && preTermData.length > 0) { + for (var i = 0; i < preTermData.length; i++) { + if (preTermData[i].termNumber != parseInt(RGBColor)) { + if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) { + $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove(); + } + } + + } + } + //} + } else { $scope.MultiLanguageAnnationArray = []; @@ -3100,7 +3142,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length); - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid); + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor); } } @@ -3212,8 +3254,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // Scroll canvas based on CB data var isHighlightBodyWithCBTermData = $scope.GetwindowStoreData(windowviewid, 'isHighlightBodyWithCBTermData'); if (isHighlightBodyWithCBTermData == true) { - $('#canvasDivDA_' + windowviewid).scrollLeft($scope.daOpenInOtherModules.canvasHScrollX); - $('#canvasDivDA_' + windowviewid).scrollTop($scope.daOpenInOtherModules.canvasVScrollX); + var canvasHScrollX = $scope.daOpenInOtherModules.canvasHScrollX; + var canvasVScrollX = $scope.daOpenInOtherModules.canvasVScrollX; + $('#canvasDivDA_' + windowviewid).scrollLeft(canvasHScrollX); + $('#canvasDivDA_' + windowviewid).scrollTop(canvasVScrollX); $scope.SetwindowStoreData(windowviewid, 'CanvasDivTopPosition', $("#canvasDivDA_" + windowviewid).scrollTop()); $scope.SetwindowStoreData(windowviewid, 'CanvasDivLeftPosition', $("#canvasDivDA_" + windowviewid).scrollLeft()); @@ -3235,6 +3279,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'visible'); $scope.DisableUI(); $scope.highLightBody(windowviewid); + + //Add code for Showing Annotation in Extract mode + var isHighlightBodyWithCBTermData = $scope.GetwindowStoreData(windowviewid, 'isHighlightBodyWithCBTermData'); + if (isHighlightBodyWithCBTermData == true) { + $scope.ShowCBDataBodyView(windowviewid); + } + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + $scope.EnableUI(); + } else if (isHighLight == true || (isListManagerSelected == true) || ((isGenderChnage == true) && (isHighLight == true)) || ((isViewChange == true) && (isHighLight == true)) || isExtract == true || isHighlightBodyByBodySystem == true) { @@ -3316,13 +3370,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.MultiLanguageAnnationArray.push(TermAnnotationText[j]); } - $scope.createDynamicSpeechBubble('CBAnnotation', CurriculumTermData[i].x, CurriculumTermData[i].y, true, CurriculumTermData[i].tips_x, CurriculumTermData[i].tips_y,windowviewid); + $scope.createDynamicSpeechBubble('CBAnnotation', CurriculumTermData[i].x, CurriculumTermData[i].y, true, CurriculumTermData[i].tips_x, CurriculumTermData[i].tips_y, windowviewid, CurriculumTermData[i].termNumber); } } $scope.SetwindowStoreData(windowviewid, 'isHighlightBodyWithCBTermData', false); - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []); + //$scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []); // finish CB window load $rootScope.DAWindowLoadComplete = true; @@ -3595,8 +3649,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // { // var updatedWhiteImageDataList=$scope.GetwindowStoreData(windowviewid,'updatedWhiteImageDataList'); // updatedWhiteImageDataList[bodyRegionId - 1] = updatedData; - // } - + // } + } else { if (canvasId.match('_MR')) @@ -3628,7 +3682,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } } + //Set Canvas Position which saved from CB module + //var isExtract = $scope.GetwindowStoreData(windowviewid, 'isExtract') + if ($rootScope.isCallFromOtherModule) { + var canvasHScrollX = $scope.daOpenInOtherModules.canvasHScrollX; + var canvasVScrollX = $scope.daOpenInOtherModules.canvasVScrollX; + $('#canvasDivDA_' + windowviewid).scrollLeft(canvasHScrollX); + $('#canvasDivDA_' + windowviewid).scrollTop(canvasVScrollX); + $scope.SetwindowStoreData(windowviewid, 'CanvasDivTopPosition', $("#canvasDivDA_" + windowviewid).scrollTop()); + $scope.SetwindowStoreData(windowviewid, 'CanvasDivLeftPosition', $("#canvasDivDA_" + windowviewid).scrollLeft()); + } + }; worker.onerror = function (e) { alert('Error: Line ' + e.lineno + ' in ' + e.filename + ': ' + e.message); @@ -3654,10 +3719,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.highlightedBR = []; $scope.runningWorkers = []; - + ; $timeout(function () { var MaskCanvasData=$scope.GetwindowStoreData(windowviewid,'MaskCanvasData'); - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); + var viewOrientationId = $scope.GetwindowStoreData(windowviewid, 'viewOrientationId'); var ColoredImageSRC=$scope.GetwindowStoreData(windowviewid,'ColoredImageSRC'); var loopLength = 0; if (((viewOrientationId == '1') || (viewOrientationId == '4')) && (ColoredImageSRC.length == 9)) { @@ -4655,7 +4720,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#dot_'+windowviewid).remove(); $('#sppeachBubble_'+windowviewid).remove(); $('.com_'+windowviewid).remove(); - $('#bord_'+windowviewid).remove(); + $('#bord_' + windowviewid).remove(); + + //Remove Annotaion for Slide Changes to Save CB + $scope.SetwindowStoreData(windowviewid, 'previousHighlightList', []); + $scope.SetwindowStoreData(windowviewid, 'AllTerms', []); + $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []); + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []); + //$scope.SetwindowStoreData(windowviewid, 'isListManagerSelected', false); + //$scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false); + //$('#typedTermName_' + windowviewid).val(''); + + $('#typedTermName_' + windowviewid).val(''); if (($("#canvasPaintDA_"+windowviewid).css("display") == "block") && ($("#canvasDA_"+windowviewid).css("display") == "block")) { if ($rootScope.isAnnotatiomToolBarPopupActive == false) { @@ -4735,8 +4811,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox, tipx, tipy,windowviewid) { - + $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox, tipx, tipy,windowviewid, termNumber) { + if (isAnnotationNotForTBox == true) { if ($scope.MultiLanguageAnnationArray.length > 1) { $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; }); @@ -4755,8 +4831,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //2.1 create unique speech bubbles var speechBubbleCounter=$scope.GetwindowStoreData(windowviewid,'speechBubbleCounter'); speechBubbleCounter = speechBubbleCounter + 1; - $scope.SetwindowStoreData(windowviewid,'speechBubbleCounter',speechBubbleCounter); - var id = "speechBubble" + speechBubbleCounter+'_'+windowviewid; + $scope.SetwindowStoreData(windowviewid, 'speechBubbleCounter', speechBubbleCounter); + //if (termNumber == undefined ||) { + // var id = "speechBubble" + speechBubbleCounter + '_' + windowviewid; + //} else { + //var id = "speechBubble" + speechBubbleCounter + '_' + windowviewid + '-' + termNumber;//Add by Sandy for Save Annotation + //} + if (termNumber != undefined && termNumber != 0) { + var id = "speechBubble" + speechBubbleCounter + '_' + windowviewid + '-' + termNumber;//Add by Sandy for Save Annotation + } + //2.2 Get clicked locationa and find if it is already clicked earlier too on same location var pointClicked = parseInt(x) + parseInt(y); var isClickedOnSamePoint = $('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked + "]").length; @@ -4770,9 +4854,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // $scope.SetwindowStoreData(windowviewid,'speechbubbleList',$scope.speechList); } $('.appendDragg').draggable({ + containment: '#canvasDivDA_' + windowviewid, drag: function (evt) { - var len= (evt.target.id).split("_").length; - var windid = (evt.target.id).split("_")[len-1]; + var bubbleId = (evt.target.id).split("-")[0]; + //var len = (evt.target.id).split("_").length; + //var windid = (evt.target.id).split("_")[len - 1]; + var len = (bubbleId).split("_").length; + var windid = (bubbleId).split("_")[len - 1]; + $(this).prev('div').css("display", "none"); var bor_id = $(this).next('div').attr('id'); var sub_id1 = $(this).attr('id'); @@ -4789,6 +4878,31 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } }, + + //Update Annotation Cordianate in case of show multiple Annotation + stop: function (evt) { + var clickedSpeechBubbleId = $(this).attr("id"); + var bubbleId = (clickedSpeechBubbleId).split("-")[0]; + var len = (bubbleId).split("_").length; + var windowviewid = (bubbleId).split("_")[len - 1]; + var sppechBubbleId = $(this).attr("id").substring(12); + var termNumber = (clickedSpeechBubbleId).split("-")[1]; + + if ($rootScope.isCallFromOtherModule) { + $timeout(function () { + var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + var BubleObj = document.getElementById(clickedSpeechBubbleId); + var CurriculumTermData = new jinqJs() + .from(CurriculumTermData) + .update(function (coll, index) { coll[index].tips_x = BubleObj.offsetLeft; coll[index].tips_y = BubleObj.offsetTop; }) + .at("termNumber == " + termNumber); + + }, 100); + + } + } + + }); $('.dynCross_'+windowviewid).on('click', function (evt) { if ( $scope.speechbubbleList != null || $scope.speechbubbleList != undefined) { @@ -4800,6 +4914,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } } + + //Delete Annotation in case of show multipule annotation + var termNumber = removeid.split("-")[1]; + if ($rootScope.isCallFromOtherModule) { + var CurriculumTermData = []; + CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + CurriculumTermData = new jinqJs() + .from(CurriculumTermData) + .delete().at("termNumber == " + termNumber).select(); + + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', CurriculumTermData); + } $(this).parent().parent().parent().remove(); }); } @@ -4807,19 +4933,33 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',false); //history maintained issue if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { - $('#sppeachBubble_'+windowviewid).remove(); - $('#dot_'+windowviewid).remove(); + //$('#sppeachBubble_'+windowviewid).remove(); + $('#dot_' + windowviewid).remove(); + $('#sppeachBubble_' + windowviewid + '-' + termNumber).remove(); } $('.com_'+windowviewid).remove(); $('#bord_'+windowviewid).remove(); - $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y,windowviewid); - //history maintained issue - if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble_'+windowviewid).style.zIndex = "60000"; } - $('#sppeachBubble_'+windowviewid).draggable( + $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl(x, y, windowviewid, termNumber); + //history maintained issue + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { + //document.getElementById('sppeachBubble_' + windowviewid + '-' + termNumber).style.zIndex = "60000"; + $('#sppeachBubble_' + windowviewid + '-' + termNumber).css("zIndex", "60000"); + } + + $("#bord_" + windowviewid).draggable({ + containment: '#canvasDivDA_' + windowviewid + }); + + $('#sppeachBubble_' + windowviewid + '-' + termNumber).draggable( { + containment: '#canvasDivDA_' + windowviewid, drag: function (evt) { - var len= (evt.target.id).split("_").length; - var windid = (evt.target.id).split("_")[len-1]; + + var bubbleId = (evt.target.id).split("-")[0]; + //var len= (evt.target.id).split("_").length; + //var windid = (evt.target.id).split("_")[len-1]; + var len = (bubbleId).split("_").length; + var windid = (bubbleId).split("_")[len - 1]; $('#dot_'+windid).css("visibility", "hidden"); var canvasDiv = document.getElementById('canvasDivDA_' + windid) @@ -4827,13 +4967,49 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var horizontlScrollPosition = canvasDiv.scrollLeft; $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windid).offset().top, true,windid); }, + //Update Annotation Cordianate in case of show single Annotation + stop: function (evt) { + var clickedSpeechBubbleId = $(this).attr("id"); + var bubbleId = (clickedSpeechBubbleId).split("-")[0]; + var len = (bubbleId).split("_").length; + var windowviewid = (bubbleId).split("_")[len - 1]; + var sppechBubbleId = $(this).attr("id").substring(12); + var termNumber = (clickedSpeechBubbleId).split("-")[1]; + + if ($rootScope.isCallFromOtherModule) { + $timeout(function () { + var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + var BubleObj = document.getElementById(clickedSpeechBubbleId); + var CurriculumTermData = new jinqJs() + .from(CurriculumTermData) + .update(function (coll, index) { coll[index].tips_x = BubleObj.offsetLeft; coll[index].tips_y = BubleObj.offsetTop; }) + .at("termNumber == " + termNumber); + + }, 100); + + } + } }); $('#crossDiv_'+windowviewid).on('click', function (evt) { var len= (evt.target.id).split("_").length; var windid = (evt.target.id).split("_")[len-1]; $('#sppeachBubble_'+windid).remove(); $('#bord_'+windowviewid).remove(); - $('#dot_'+windid).remove(); + $('#dot_' + windid).remove(); + + //Delete Annotation in case of show multipule annotation + var removeid = $(this).parent().parent().attr('id'); + var termNumber = removeid.split("-")[1]; + if ($rootScope.isCallFromOtherModule) { + var CurriculumTermData = []; + CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + CurriculumTermData = new jinqJs() + .from(CurriculumTermData) + .delete().at("termNumber == " + termNumber).select(); + + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', CurriculumTermData); + } + $('#' + removeid).remove(); }); } } @@ -4852,6 +5028,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.speechbubbleList.push({ xaxis: x, yaxis: y, ids: sub_id_annotation }); $scope.SetwindowStoreData(windowviewid,'speachBubbleArrayAnnotation',$scope.speechList1); $('.appendDragg_annotation').draggable({ + + containment: '#canvasDivDA_' + windowviewid, + drag: function (evt) { var len= (evt.target.id).split("_").length; var windid = (evt.target.id).split("_")[len-1]; @@ -4890,7 +5069,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('.dynCross_anno_'+windowviewid).parent().parent().parent().remove(); $scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl(x, y,windowviewid); $('#sppeachBubble_annotation_'+windowviewid).draggable( - { + { + containment: '#canvasDivDA_' + windowviewid, drag: function (evt) { var len= (evt.target.id).split("_").length; var windid = (evt.target.id).split("_")[len-1]; @@ -4912,15 +5092,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } - if (document.getElementById('btnStrutureBox_'+windowviewid).name == "showAnnotationStructure") { - $scope.showAnnotation(windowviewid) + if (document.getElementById('btnStrutureBox_' + windowviewid).name == "showAnnotationStructure") { + //$scope.showAnnotation(windowviewid); + $scope.showAnnotation(windowviewid, termNumber); } else { $scope.hideAnnotation(windowviewid) } if ($rootScope.isTBCompleted == true) { - $('#sppeachBubble_'+windowviewid).remove(); + $('#sppeachBubble_' + windowviewid + '-' + termNumber).remove(); $('#dot_'+windowviewid).remove(); $('#bord_'+windowviewid).remove(); $('.com_'+windowviewid).remove(); @@ -4928,16 +5109,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.showAnnotation = function (windowviewid) { + $scope.showAnnotation = function (windowviewid, termNumber) { $('.com_'+windowviewid).show(); $('#dot_'+windowviewid).show(); $('#bord_'+windowviewid).show(); - $('#sppeachBubble_'+windowviewid).show(); + //$('#sppeachBubble_' + windowviewid).show(); + $('#sppeachBubble_annotation_'+windowviewid).show(); $('#bord_annotation_'+windowviewid).show(); $('#dot_annotation_'+windowviewid).show(); - $('.dynCross_anno_'+windowviewid).parent().parent().parent().show(); + $('.dynCross_anno_' + windowviewid).parent().parent().parent().show(); + $('#sppeachBubble_' + windowviewid + '-' + termNumber).show(); } $scope.hideAnnotation = function (windowviewid) { @@ -5001,12 +5184,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl = function (x, y,windowviewid) { - + $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl = function (x, y, windowviewid, termNumber) { var sppechBubbleDotHTML = '
' - + '