From c8e711ce6bd4342e36ed05d25ce7883cf92b4f96 Mon Sep 17 00:00:00 2001 From: Sandeep Kumar Date: Fri, 7 Feb 2020 18:15:01 +0530 Subject: [PATCH] Code changes for CI Window data to Save CB --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js | 426 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 10 +++++----- 2 files changed, 167 insertions(+), 269 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 0b0ab44..50b9cd2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -709,7 +709,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } } - + var isActive = false; //Start Code by Sandeep for TicketNo: 49226(3) $scope.DropDownSelectNodeClick = function (nodeid) { if ($rootScope.contentNotesForSaveCB.length == 0) { @@ -717,9 +717,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } var currentCb_id = document.getElementById('cbSelect').value; $rootScope.updatedContentFromEditor(currentCb_id);//Calling for Update Note for Save CB - - $scope.windowsContentForSelectedSlide(nodeid);// Calling for Update Window content for Save Cb + if (isActive) { + $scope.updateWindowsContentForSaveCBTest(currentCb_id);// Calling for Update Window content for Save Cb + } + isActive = true; traverseTreeSelectedSingleObj($rootScope.stru, nodeid); traverse($rootScope.stru, nodeid); @@ -2197,50 +2199,61 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ for (var i = 0 ; i < selectedSlideContent[0].windows.window.length; i++) { $scope.windowDataforCB = JSON.parse(selectedSlideContent[0].windows.window[i]) $scope.setWinDataToArray.push($scope.windowDataforCB); - } - //for (var j = 0; j < $scope.setWinDataToArray.length; j++) { - // //$scope.updateWindowsContentForSaveCB($scope.setWinDataToArray[j]); - //} + } } else { $scope.windowDataforCB = JSON.parse(selectedSlideContent[0].windows.window) $scope.setWinDataToArray.push($scope.windowDataforCB); } + $rootScope.updateWindowsContentForSaveCB(currentId); } } + + $scope.updatedWindowListForSaveCB = []; - $rootScope.updateWindowsContentForSaveCB = function (mType) { - //for (var j = 0; j < $scope.setWinDataToArray.length; j++) { - switch (mType) { + $rootScope.updateWindowsContentForSaveCB = function (currentId) { + var isAA = true; var isCI = true; var isDA = true; + for (var j = 0; j < $scope.setWinDataToArray.length; j++) { + + switch ($scope.setWinDataToArray[j].mType) { case "MY_PICTURES": $scope.savePicWindowActivity($scope.windowDataforCB); break; case "DISSECTIBLE_ANATOMY": - $scope.saveDAWindowActivity($scope.windowDataforCB); + $scope.saveDAWindowActivity(); break; - case "ATLAS_ANATOMY": - //$scope.saveAAWindowActivity(singleWindowObj); - for (var i = 0; i < $rootScope.AAWindowData.length;) { - $scope.setWinDataToArray[j].windowTitle = $rootScope.AAWindowData[i].currentViewTitle; - $scope.setWinDataToArray[j].hideAllPins = $rootScope.AAWindowData[i].isHidePinBtnClicked; - - } - + case "ATLAS_ANATOMY": + if (isAA) { + $scope.saveAAWindowActivity(); + isAA = false; + } break; case "CLINICAL_ILLUSTRATIONS": - $scope.saveCIWindowActivity(keyName, val); + if (isCI) { + $scope.saveCIWindowActivity(); + isCI = false; + } break; case "CLINICAL_ANIMATIONS": - $scope.saveCAWindowActivity($scope.windowDataforCB); + $scope.saveCAWindowActivity(); break; case "THREE_D_ANATOMY": - $scope.save3DWindowActivity($scope.windowDataforCB); + $scope.save3DWindowActivity(); break; default: - text = "I have never heard of that fruit..."; + } - } + } + findKeyForChange($rootScope.contentNotesForSaveCB, currentId); + $scope.selectedKey.windows.window = []; + for (var s = 0; s < $scope.updatedWindowListForSaveCB.length; s++) + { + var arrToStrWinObj = JSON.stringify($scope.updatedWindowListForSaveCB[s]); + $scope.selectedKey.windows.window.push(arrToStrWinObj); + } + $scope.updatedWindowListForSaveCB = []; + console.log($scope.selectedKey.windows.window); } function findKeyForChange(o, keyname) { @@ -2261,9 +2274,84 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } - $rootScope.saveCIWindowActivity = function (keyName, value) { + $scope.saveCIWindowActivity = function (currentId) { + if ($rootScope.CIWindowData != undefined && $rootScope.CIWindowData.length > 0 ) { + for (var i = 0; i < $rootScope.CIWindowData.length; i++) { + $scope.updatedWindowListForSaveCB.push({ + + containsCapturedContent: true,//$rootScope.CIWindowData[i] + annotationData: "",//$rootScope.CIWindowData[i] + contextMenu: { lockResize: false, hideTitleBar: false }, + position: { + top: $rootScope.jsPanelTop, + left: $rootScope.jsPanelLeft, + }, + size: { + width: $rootScope.jsPanelWidth, + height: $rootScope.jsPanelHeight + }, + textVisible: $rootScope.CIWindowData[i].isTextVisible, + imageId: $rootScope.CIWindowData[i].imageId, + minimised: false,//$rootScope.CIWindowData[i] + windowTitle: $rootScope.CIWindowData[i].currentViewTitle, + maximised: false,//$rootScope.CIWindowData[i] + mType: $rootScope.CIWindowData[i].moduleName, + id: 0,//$rootScope.CIWindowData[i].id, + scrollPosition: { + vertical: 0, + horizontal: 0 + }, + windowListId: 0 //$rootScope.CIWindowData[i] + }); + + } + $rootScope.CIWindowData = []; + } + + } + + $scope.saveAAWindowActivity = function () { + + if ($rootScope.AAWindowData != undefined && $rootScope.AAWindowData.length > 0) { + for (var i = 0; i < $rootScope.AAWindowData.length; i++) { + $scope.updatedWindowListForSaveCB.push({ + + windowTitle: $rootScope.AAWindowData[i].currentViewTitle, + hideAllPins: $rootScope.AAWindowData[i].isHidePinBtnClicked, + selectedCallouts: $rootScope.AAWindowData[i].CBselectedpinCordinate, + annotationData: "",//No find in AA.js + minimised: false,//N + scrollPosition: { vertical: 279, horizontal: 313 },//N + selectedStructureID: 0,//N + selectedPins: $rootScope.AAWindowData[i].clickedPins, + maximised: false,//N + size: { width: 800, height: 297 },//N + id: "492",//N + showSelectedPins: $rootScope.AAWindowData[i].isShowSelectedSystemPinsClicked, + hideCallOuts: false,//N + showAllPins: $rootScope.AAWindowData[i].isShowBodyWithCBPinData,//N + scaleIndex: 0,//N + bodySystemId: $rootScope.AAWindowData[i].SelectedSystemID, + windowListId: "0",//N + imageId: $rootScope.AAWindowData[i].imageId, + position: { x: 840, y: 263 },//N + mType: $rootScope.AAWindowData[i].moduleName, + containsCapturedContent: true, + contextMenu: { hideLeftBar: false, hideTitleBar: false, hideTopToolBar: false, lockResize: false }, + + //position: { top: $rootScope.jsPanelTop, left: $rootScope.jsPanelLeft }, + //size: { width: $rootScope.jsPanelWidth, height: $rootScope.jsPanelHeight } + + + }); + } + $rootScope.AAWindowData = []; + } + } + + $scope.saveCIWindowActivityTest = function (keyName, value) { for (var i = 0; i < $scope.setWinDataToArray.length; i++) { - $scope.setWinDataToArray[i][keyName] = value; + $scope.setWinDataToArray[i][keyName] = value; var current_id; if (($rootScope.getLocalStorageValue("cbSelectId")) != '') { current_id = $rootScope.getLocalStorageValue("cbSelectId"); @@ -2278,97 +2366,62 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.selectedKey.windows.window = ""; if (keyName != "") { $scope.selectedKey.windows.window = JSON.stringify($scope.setWinDataToArray[i]); - } + } } console.log($rootScope.contentNotesForSaveCB); //$scope.windowDataforCB = { - //slideId: currentId,//SlideNo, - //currentWindowId: windowId, - //mType: windowData.mType, - //containsCapturedContent: windowData.containsCapturedContent, - - //textVisible: checkVisiblity//windowData.textVisible, - //anatomyTitle: windowData.currentViewTitle, - //horizontalScroll: windowData.scrollPosition.horizontal + 'px', - //verticalScroll: windowData.scrollPosition.vertical + 'px', - //imageId: windowData.imageId,//N - //maximised: windowData.maximised,//Not Found - //minimised: windowData.minimised,//Not Found - //id: windowData.id, - //size: windowData.size, - //position: windowData.position, - //position: { - // top: $rootScope.jsPanelTop, - // left: $rootScope.jsPanelLeft, - //}, - - //size: { - // width: $rootScope.jsPanelWidth, - // height: $rootScope.jsPanelHeight - //}, - //contextMenu: windowData.contextMenu, - //annotationData: windowData.annotationData - + //slideId: currentId,//SlideNo, + //currentWindowId: windowId, + //mType: windowData.mType, + //containsCapturedContent: windowData.containsCapturedContent, + + //textVisible: checkVisiblity//windowData.textVisible, + //anatomyTitle: windowData.currentViewTitle, + //horizontalScroll: windowData.scrollPosition.horizontal + 'px', + //verticalScroll: windowData.scrollPosition.vertical + 'px', + //imageId: windowData.imageId,//N + //maximised: windowData.maximised,//Not Found + //minimised: windowData.minimised,//Not Found + //id: windowData.id, + //size: windowData.size, + //position: windowData.position, + //position: { + // top: $rootScope.jsPanelTop, + // left: $rootScope.jsPanelLeft, + //}, + + //size: { + // width: $rootScope.jsPanelWidth, + // height: $rootScope.jsPanelHeight + //}, + //contextMenu: windowData.contextMenu, + //annotationData: windowData.annotationData + //}; } - $scope.saveAAWindowActivity = function (singleWindowObj) { - findKeyForChange($rootScope.contentNotesForSaveCB, current_id); - if ($rootScope.AAWindowData.length > 0) { - for (var j = 0; j < $scope.setWinDataToArray.length;) { - for (var i = 0; i < $rootScope.AAWindowData.length; i++) { - j++; - if ($scope.setWinDataToArray[j].mType == $rootScope.AAWindowData[i].currentViewTitle) { - - $scope.setWinDataToArray[j].windowTitle = $rootScope.AAWindowData[i].currentViewTitle; - $scope.setWinDataToArray[j].hideAllPins = $rootScope.AAWindowData[i].isHidePinBtnClicked; - //$scope.setWinDataToArray[j].selectedCallouts = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].annotationData = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].minimised = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].scrollPosition = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].selectedStructureID = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].maximised = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].size = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].id = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].hideCallOuts = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].scaleIndex = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].bodySystemId = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].windowListId = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].imageId = $rootScope.AAWindowData[i].imageId; - //$scope.setWinDataToArray[j].position = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].mType = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].containsCapturedContent = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].selectedPins = $rootScope.AAWindowData[i].currentViewTitle; - //$scope.setWinDataToArray[j].contextMenu = $rootScope.AAWindowData[i].currentViewTitle; - } - - } - - } + $scope.updateWindowsContentForSaveCBTest = function (currentId) { + + //$scope.saveDAWindowActivity(); + //$scope.saveAAWindowActivity(currentId); + $scope.saveCIWindowActivity(currentId); + //$scope.saveCAWindowActivity(); + //$scope.save3DWindowActivity(); + //$scope.savePicWindowActivity($scope.windowDataforCB); + if ($scope.updatedWindowListForSaveCB.length > 0) { + findKeyForChange($rootScope.contentNotesForSaveCB, currentId); + $scope.selectedKey.windows.window = []; + for (var s = 0; s < $scope.updatedWindowListForSaveCB.length; s++) { + var arrToStrWinObj = JSON.stringify($scope.updatedWindowListForSaveCB[s]); + $scope.selectedKey.windows.window.push(arrToStrWinObj); + } } - - } - - //$scope.saveAAWindowActivity = function (windowObjForSelectedSlide) { - // findKeyForChange($rootScope.contentNotesForSaveCB, current_id); - // if (windowObjForSelectedSlide.length > 0) { - // for (var i = 0; i < windowObjForSelectedSlide.length; i++) { - // if ($scope.selectedKey.length > 0) { - // for (var j = 0; j < $scope.selectedKey.windows.window.length; j++) { - // if (windowObjForSelectedSlide[i].mType == "ATLAS_ANATOMY") {//$scope.selectedKey[j].mType - // $scope.selectedKey.windows.window[j] = ""; - // $scope.selectedKey.windows.window[j] = windowObjForSelectedSlide[i]; - // } - // break; - // } - // } - - // } - // } - // $scope.selectedKey.windows.window = ""; - //} + $scope.updatedWindowListForSaveCB = []; + console.log($rootScope.contentNotesForSaveCB); + } + //$rootScope.updateWindowsContentForSaveCB = function (windowData) { @@ -2445,162 +2498,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // }); - //} - - - - - $scope.addSectionForSaveDraft = function (currentid, AddSecionId, parentid) { - - if ($rootScope.structureObjForSaveCB.length == 0) { - //$rootScope.structureObjForSaveCB = $rootScope.structure;// only Tree Array - //$rootScope.structureObjForSaveCB = $rootScope.stru.slideshow.presentation.structure.structure; - $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure; - } - //$rootScope.structureObjForSaveCB = $rootScope.stru;//All json Structure with tree array - //$rootScope.structureObjForSaveCB = $rootScope.structure;// only Tree Array - //$rootScope.updateSaveDraftDynamicTest = []; - - traverseTreeSelectedSingleObj($rootScope.stru, currentid); - traverse($rootScope.stru, currentid); - if (currentid == $rootScope.cbTreeFirstID) { - $rootScope.selectedNodeSingle.push( - { - //"structure": { - "structure": [ - //{ - // "_label": "NEW ", - // "_id": AddSlideId, - // "_isRoot": "false", - // "_isBranch": "false", - // "_isLocked": "false" - //} - ], - "_label": "New Section", - "_id": AddSecionId, - "_isRoot": "false", - "_isBranch": "true", - "_isLocked": "false" - //} - - }); - - $rootScope.structureObjForSaveCB.push( - { - - "structure": [ - ], - "_label": "New Section", - "_id": AddSecionId, - "_isRoot": "false", - "_isBranch": "true", - "_isLocked": "false" - - }); - } - //else if (currentid == parentid && $rootScope.cbTreeFirstID != parentid) { - // $rootScope.selectedNodeSingle.push( - // { - - // "structure": [ - // ], - // "_label": "New Section", - // "_id": AddSecionId, - // "_isRoot": "false", - // "_isBranch": "true", - // "_isLocked": "false" - // }); - - // $rootScope.structureObjForSaveCB.push( - // { - // "structure": { - // "structure": [ - // ], - // "_label": "New Section", - // "_id": AddSecionId, - // "_isRoot": "false", - // "_isBranch": "true", - // "_isLocked": "false" - // } - // }); - // } - else { - $scope.selectedNodeSingleObj['structure'].push( - { - "structure": [ - ], - "_label": "New Section", - "_id": AddSecionId, - "_isRoot": "false", - "_isBranch": "true", - "_isLocked": "false" - }); - - for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { - if ($rootScope.structureObjForSaveCB[i]._id == currentid) { - $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; - } - } - } - // setTimeout(function () { traverseTreeForSetIcons($rootScope.stru, currentid); }, 1500); - - } - - $scope.addSlideForSaveDraft = function (currentid, AddSlideId, parentid) { - - if ($rootScope.structureObjForSaveCB.length == 0) { - //$rootScope.structureObjForSaveCB = $rootScope.structure;// only Tree Array - //$rootScope.structureObjForSaveCB = $rootScope.stru.slideshow.presentation.structure.structure; - $rootScope.structureObjForSaveCB = $rootScope.stru.structure.structure; - } - traverseTreeSelectedSingleObj($rootScope.stru, currentid); - //traverse($rootScope.stru, currentid); - //Assign object by traverse method $scope.selectedNodeSiblingObjs - - //console.log(JSON.stringify($scope.upDateJsonObj)) - //if (currentid == "-225638207") { - if (currentid == $rootScope.cbTreeFirstID) { - $rootScope.selectedNodeSingle.push( - { - "_label": "NEW Slide1", - "_id": AddSlideId, - "_isRoot": "false", - "_isBranch": "false", - "_isLocked": "false" - }); - - $rootScope.structureObjForSaveCB.push({ - "_label": "NEW Slide1", - "_id": AddSlideId, - "_isRoot": "false", - "_isBranch": "false", - "_isLocked": "false" - }); - //for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { - // if ($rootScope.structureObjForSaveCB[i]._id == currentid) { - // $rootScope.structureObjForSaveCB[i] = $rootScope.selectedNodeSingle; - // } - //} - } - else { - $scope.selectedNodeSingleObj['structure'].push({ - "_label": "New Slide", - "_id": AddSlideId, - "_isRoot": "false", - "_isBranch": "false", - "_isLocked": "false" - }); - for (var i = 0; i < $rootScope.structureObjForSaveCB.length; i++) { - if ($rootScope.structureObjForSaveCB[i]._id == currentid) { - $rootScope.structureObjForSaveCB[i]['structure'] = $scope.selectedNodeSingleObj['structure']; - } - } - } - // setTimeout(function () { traverseTreeForSetIcons($rootScope.stru, currentid); }, 3000); - setTimeout(function () { $("#jstree").jstree(true).set_icon(AddSlideId, "../../../content/images/CB/file.png"); }, 100); - - } - + //} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index fe5e59d..7b29b2c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -2473,7 +2473,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); $scope.hideSpeechBubble(windowviewid); - + $scope.SetAAwindowStoreData(windowviewid, 'isShowBodyWithCBPinData', false); $scope.SetAAwindowStoreData(windowviewid, 'isHidePinBtnClicked', true); var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); @@ -2504,7 +2504,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); $scope.SetAAwindowStoreData(windowviewid,'isHidePinBtnClicked',false); - //$scope.updateWindowsContentForSaveCB(); + var selectedSystemName=$scope.GetAAwindowStoreData(windowviewid,'selectedSystemName'); if (selectedSystemName != null && selectedSystemName != undefined) { var selectedSystemPinData=$scope.GetAAwindowStoreData(windowviewid,'selectedSystemPinData'); @@ -2526,7 +2526,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } - + $scope.SetAAwindowStoreData(windowviewid, 'isShowBodyWithCBPinData', true); }; $scope.showSelectedPins = function (windowviewid) { @@ -2538,7 +2538,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.DisableUI(); $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - + $scope.SetAAwindowStoreData(windowviewid, 'isShowBodyWithCBPinData', false); $scope.SetAAwindowStoreData(windowviewid,'isHidePinBtnClicked',false); var selectedSystemName=$scope.GetAAwindowStoreData(windowviewid,'selectedSystemName'); if (selectedSystemName != null && selectedSystemName != undefined) { @@ -2975,7 +2975,7 @@ function hidePins(event) { rootScope.$apply(function () { rootScope.hidePins(windowviewid); //Calling for Save CB Window data - rootScope.updateWindowsContentForSaveCB(); + //rootScope.updateWindowsContentForSaveCB(); }); -- libgit2 0.21.4