diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index d3d5a65..9569438 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -113,7 +113,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if ($rootScope.CIWindowData[x].multiwinid == windowviewid) { $rootScope.CIWindowData[x][keyname] = value; - } + } } } @@ -833,7 +833,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout '
' + '
' + '

' + selectedImageCISummary + '

' + - '
' + + '
' + '', title: $rootScope.getLocalStorageValue("currentViewTitle"), position: { @@ -979,10 +979,35 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.StoreTitleName(currentViewTitle); $rootScope.StoreOrgImageName(imageName); }); - } + } + + $scope.GetTextVisiblity = function (windowviewid, btnTextValue) { + var isVisible; + if (btnTextValue == "Text On") { + isVisible = false; + $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible); + } else { + isVisible = true; + $scope.SetCIwindowStoreData(windowviewid, 'isTextVisible', isVisible); + } + $rootScope.saveCIWindowActivity("textVisible", isVisible); + } + + }] ); + function GetTextVisibity(event) { + + var scope = angular.element(document.getElementById("CIView")).scope(); + // var len = (event.target.id).split("_").length; + var windowviewid = (event.target.id).split("_")[1]; + var btnTextValue = event.target.innerText; + scope.$apply(function () { + scope.GetTextVisiblity(windowviewid,btnTextValue); + }); + } + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 16592d2..0b0ab44 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -35,7 +35,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ // close in case of Curriculum Builder var id = $(event.target).parent().parent().parent().parent().attr('id'); - + //$rootScope.saveCIWindowActivity("", "");//Calling for Save widodow data for Save Cb if (id == "CBTinyMCEPanel") { tinymce.execCommand('mceRemoveControl', true, 'CBTextArea'); tinymce.execCommand('mceFocus', true, 'CBTextArea'); @@ -59,6 +59,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (ddlViewerLen == 0) { $('#viwerSelect').hide(); } + }); @@ -643,19 +644,18 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if ($scope.SelectedNotes != "" && $scope.SelectedNotes != undefined) { tinymce.get("CBTextArea").setContent($scope.SelectedNotes); - //setTimeout(function () { - // if ($scope.selectedNodeSingleObj.windows != "") { - // //$scope.loadContentOfSelectedSlide($scope.selectedNodeSingleObj._id) - - // } - // else - // { - // $scope.CBEnableUI(); + setTimeout(function () { + if ($scope.selectedNodeSingleObj.windows != "") { + $scope.loadContentOfSelectedSlide($scope.selectedNodeSingleObj._id) - // } - //},200); - $scope.CBEnableUI(); + } + else + { + $scope.CBEnableUI(); + } + },200); + //$scope.CBEnableUI(); } else { @@ -716,8 +716,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents;//Assign Dnamic Contents } var currentCb_id = document.getElementById('cbSelect').value; - $rootScope.updatedContentFromEditor(currentCb_id); + $rootScope.updatedContentFromEditor(currentCb_id);//Calling for Update Note for Save CB + $scope.windowsContentForSelectedSlide(nodeid);// Calling for Update Window content for Save Cb traverseTreeSelectedSingleObj($rootScope.stru, nodeid); traverse($rootScope.stru, nodeid); @@ -748,8 +749,14 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ document.getElementById("slideNumber").innerHTML = "Slide " + 1 + " of " + 1; } else if ($scope.selectedNodeSingleObj._isBranch == "true") { - $scope.currentSlideNumber += 1; - document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSingleObj).length; + for (var i = 0; i < $scope.selectedNodeSiblingObjs.length; i++) { + if ($scope.selectedNodeSiblingObjs[i]._id == nodeid) { + $scope.currentSlideNumber = i + 1; + } + } + //$scope.currentSlideNumber += 1; + //document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSingleObj).length; + document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSiblingObjs).length; } else{ document.getElementById("slideNumber").innerHTML = "Slide " + $scope.currentSlideNumber + " of " + Object.keys($scope.selectedNodeSingleObj).length; @@ -1499,11 +1506,13 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ .where("_id == " + cbCurrentId) .select(); if (selectedSlideContent.length > 0) { - windowsInSelectedSlide = selectedSlideContent[0].windows; + windowsInSelectedSlide = selectedSlideContent[0].windows; notesForSelectedSlide = tinyMCE.activeEditor.getContent(); if (notesForSelectedSlide == "" || notesForSelectedSlide == undefined) { notesForSelectedSlide = selectedSlideContent[0].notes; - } + } + //Calling method for update Windows Data for selected slide + //$scope.windowsContentForSelectedSlide(windowsInSelectedSlide); } else { windowsInSelectedSlide = ""; @@ -1625,7 +1634,9 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ if (window.navigator && window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(blob, filename); } - else { + else { + //document.execCommand("SaveAs", true, filename); + //angular.element(document.execCommand("SaveAs", false, filename)).scope(); var e = document.createEvent('MouseEvents'), a = document.createElement('a'); a.download = filename; @@ -1633,7 +1644,7 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ a.dataset.downloadurl = ['text/json', a.download, a.href].join(':'); e.initEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); a.dispatchEvent(e); - // window.URL.revokeObjectURL(url); // clean the url.createObjectURL resource + window.URL.revokeObjectURL(url); // clean the url.createObjectURL resource } $rootScope.dynamicUpdatedJsonForSaveCB = ""; //$rootScope.contentNotesForSaveCB = []; @@ -1742,10 +1753,11 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $scope.addSlide = function (currentid, AddSlideId) { 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; } + //if ($rootScope.contentNotesForSaveCB.length == 0) { + // $rootScope.contentNotesForSaveCB = $rootScope.cbDynamicContents; + //} traverseTreeSelectedSingleObj($rootScope.stru, currentid); // traverse($rootScope.stru, currentid); //console.log(JSON.stringify($scope.upDateJsonObj)) @@ -1774,6 +1786,13 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ "_isBranch": "false", "_isLocked": "false" }); + + //$rootScope.contentNotesForSaveCB.push({ + // "notes": tinyMCE.activeEditor.getContent(), + // "windows": "", + // "_id": AddSlideId + //}); + //if (currentid == $rootScope.cbTreeFirstID) { // $rootScope.structureObjForSaveCB.push({ // "_label": "New Slide", @@ -2165,6 +2184,270 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } } + //Start Code for Update Windows Content for DA, CA, CI, AA, 3D Module to Save CB + $scope.windowsContentForSelectedSlide = function (currentId) { + var contentWindowsdata = $rootScope.contentNotesForSaveCB; + $scope.setWinDataToArray = []; + var selectedSlideContent = new jinqJs() + .from(contentWindowsdata) + .where("_id == " + currentId) + .select(); + if (selectedSlideContent[0].windows != "") { + if (selectedSlideContent != undefined && Array.isArray(selectedSlideContent[0].windows.window)) { + 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 = function (mType) { + //for (var j = 0; j < $scope.setWinDataToArray.length; j++) { + switch (mType) { + case "MY_PICTURES": + $scope.savePicWindowActivity($scope.windowDataforCB); + break; + case "DISSECTIBLE_ANATOMY": + $scope.saveDAWindowActivity($scope.windowDataforCB); + 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; + + } + + break; + case "CLINICAL_ILLUSTRATIONS": + $scope.saveCIWindowActivity(keyName, val); + break; + case "CLINICAL_ANIMATIONS": + $scope.saveCAWindowActivity($scope.windowDataforCB); + break; + case "THREE_D_ANATOMY": + $scope.save3DWindowActivity($scope.windowDataforCB); + break; + default: + text = "I have never heard of that fruit..."; + } + } + + } + + function findKeyForChange(o, keyname) { + var i; + for (i in o) { + + if (o[i] !== null && typeof (o[i]) == "object") { + if (o[i]._id == keyname) { + $scope.selectedKey = o[i]; + } + findKeyForChange(o[i], keyname); + } + //else { + // if (i == keyname) { + // $scope.selectedKey = i; + // } + //} + } + } + + $rootScope.saveCIWindowActivity = function (keyName, value) { + for (var i = 0; i < $scope.setWinDataToArray.length; i++) { + $scope.setWinDataToArray[i][keyName] = value; + var current_id; + if (($rootScope.getLocalStorageValue("cbSelectId")) != '') { + current_id = $rootScope.getLocalStorageValue("cbSelectId"); + } + else { + current_id = document.getElementById('cbSelect').value; + } + findKeyForChange($rootScope.contentNotesForSaveCB, current_id); + //var modifiedWindowObj = JSON.parse($scope.selectedKey.windows.window); + //modifiedWindowObj.textVisible = value; + //$scope.selectedKey.windows.window = modifiedWindowObj; + $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 + + //}; + + } + + $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.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 = ""; + //} + + //$rootScope.updateWindowsContentForSaveCB = function (windowData) { + + // //findKeyForChange($scope.windowDataforCB, keyname) + // //if ($scope.selectedKey.length > 0) { + // // for (var x = 0 ; x < $scope.selectedKey.length; x++) { + // // if ($scope.selectedKey[x].keyname == keyname) { + // // $scope.selectedKey[x][keyname] = value; + // // } + // // } + // //} + // //else if ($scope.selectedKey != undefined && $scope.selectedKey != "") { + // // $scope.selectedKey = value; + // //} + + // //var windowContent = $scope.windowDataforCB; + // //$scope.windowDataforCB = new jinqJs() + // // .from(windowContent) + // // .update(function (column, index) { + // // column[index].keyname = value; + // // }) + // // .at(column[index].keyname = keyname); + + // $scope.windowDataforCB.push({ + // //slideId: currentId,//SlideNo, + // //currentWindowId: windowId, + // mType: windowData.mType, + // layerNumber: windowData.layerNumber, + // currentBodyViewId: windowData.voId, + // windowTitle: windowData.currentViewTitle, + // skinId: windowData.genderId, + // isModestyOn: windowData.isModestyOn, + // //size: windowData.size, + // //position: windowData.position, + // position: { + // top: $rootScope.jsPanelTop, + // left: $rootScope.jsPanelLeft, + // }, + + // size: { + // width: $rootScope.jsPanelWidth, + // height: $rootScope.jsPanelHeight + // }, + // zoom: windowData.zoomInOut, + + // maximised:windowData.maximised,//Not Found + // minimised:windowData.minimised,//Not Found + // highlightOptionsSelectedId: windowData.highlightOptionsSelectedId,//Not Found + // selectedStructureId: windowData.selectedStructureId,//Not Found + // isModuleLoaded: windowData.isModuleLoaded,//N + // isTopToolBarVisible: windowData.isTopToolBarVisible,//N + // transparencyValue: windowData.transparencyValue,//N + // imageId: windowData.imageId,//N + // containsCapturedContent: windowData.containsCapturedContent,//N + // layerNumberTransparency: windowData.layerNumberTransparency,//N + + // isTitleBarVisible: windowData.isTitleBarVisible,//N + // clickedTermList: windowData.fullTermlist, + // isResizeLock: windowData.isResizeLock,//N + // mode: windowData.isNormalMode, + // isLeftToolBarVisible: windowData.isLeftToolBarVisible,//N + // contentDescriptorId: windowData.contentDescriptorId,//6 + // bodySystemTermList: windowData.BodySystemData, + // isTransparent: windowData.isTransparencyActivated, + // windowListId: windowData.windowListId,//25 + // canvasVScrollX: windowData.canvasVScrollX,//N + // canvasHScrollX: windowData.canvasHScrollX,//N + // callOuts: windowData.CurriculumTermData, + + // isCallOutVisible: windowData.isCallOutVisible,//22 + + // annotationData: windowData.annotationData,//24 + // transparencyBounds: windowData.transparencyBounds + + // }); + + //} + + $scope.addSectionForSaveDraft = function (currentid, AddSecionId, parentid) { @@ -2318,6 +2601,8 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ } + + }] ); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 0b3856f..fe5e59d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -2474,7 +2474,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#spinner').css('visibility', 'visible'); $scope.hideSpeechBubble(windowviewid); - $scope.SetAAwindowStoreData(windowviewid,'isHidePinBtnClicked',true); + $scope.SetAAwindowStoreData(windowviewid, 'isHidePinBtnClicked', true); + var aaPinData = $scope.GetAAwindowStoreData(windowviewid,'aaPinData'); angular.forEach(aaPinData, function (aaPinDataValue, aaPinDataKey) { @@ -2503,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'); @@ -2973,7 +2974,11 @@ function hidePins(event) { var rootScope = angular.element(document.getElementById("aaBodyView")).scope(); rootScope.$apply(function () { rootScope.hidePins(windowviewid); + //Calling for Save CB Window data + rootScope.updateWindowsContentForSaveCB(); }); + + } function showAllPins(event) {