diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 878b5d2..f99957f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -196,7 +196,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $rootScope.OpenExistingCurriculum = function (event) { $("#openCBJsonFile").trigger("click"); - var fileupload = document.getElementById("openCBJsonFile"); + var fileupload = document.getElementById("openCBJsonFile"); fileupload.onchange = function () { @@ -2314,7 +2314,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ //hideAllPins: $rootScope.DaWindowData[i].isHidePinBtnClicked, //selectedCallouts: $rootScope.DaWindowData[i].CBselectedpinCordinate, layerNumber: parseInt($rootScope.DaWindowData[i].layerNumber) + 1, - isModestyOn: $rootScope.DaWindowData[i].isModestyOn, + isModestyOn: $rootScope.DaWindowData[i].ModestyValue, isTransparent: $rootScope.DaWindowData[i].isTransparencyActivated, isTopToolBarVisible: false, //$rootScope.DaWindowData[i].isTopToolBarVisible, clickedTermList: $rootScope.DaWindowData[i].fullTermlist, diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 9e35cda..d9b5b0b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1610,7 +1610,7 @@ 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); } @@ -2163,7 +2163,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'); } @@ -2909,6 +2909,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); @@ -2923,14 +2924,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l console.log('CTRL ON') } else - { + { + preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData'); + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false); - $('#typedTermName_' + windowviewid).val(''); - + $('#typedTermName_' + windowviewid).val(''); $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []); $scope.SetwindowStoreData(windowviewid, 'AllTerms', []); $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]); - $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false); + $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false); $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []); console.log('multiAnnotationIsON: ' + false); @@ -3003,12 +3005,18 @@ 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": mousePos.x, - "tips_y": mousePos.y, + "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 }); @@ -3081,7 +3089,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); } } @@ -3093,18 +3101,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++) { @@ -3114,7 +3120,15 @@ 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 + if (preTermData != undefined && preTermData.length > 0) { + for (var i = 0; i < preTermData.length; i++) { + if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) { + $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove(); + } + } } } else { @@ -3127,7 +3141,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); } } @@ -3343,7 +3357,7 @@ 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); } } @@ -3681,10 +3695,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)) { @@ -4762,7 +4776,7 @@ 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) { @@ -4782,8 +4796,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; @@ -4798,8 +4820,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $('.appendDragg').draggable({ 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'); @@ -4816,6 +4842,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) { @@ -4827,6 +4878,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(); }); } @@ -4839,14 +4902,19 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $('.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).draggable( { 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) @@ -4854,21 +4922,22 @@ 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 len = (clickedSpeechBubbleId).split("_").length; - var windowviewid = (clickedSpeechBubbleId).split("_")[len - 1]; + 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 = sppechBubbleId.split("_")[0]; - + 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].lx = BubleObj.offsetLeft; coll[index].ly = BubleObj.offsetTop; }) + .update(function (coll, index) { coll[index].tips_x = BubleObj.offsetLeft; coll[index].tips_y = BubleObj.offsetTop; }) .at("termNumber == " + termNumber); }, 100); @@ -4881,7 +4950,21 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 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(); }); } } @@ -4960,15 +5043,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(); @@ -4976,16 +5060,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_' + windowviewid + '-' + termNumber).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(); + } $scope.hideAnnotation = function (windowviewid) { @@ -5049,12 +5135,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl = function (x, y,windowviewid) { - + $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl = function (x, y, windowviewid, termNumber) { var sppechBubbleDotHTML = '' - + '