diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index 2786ad2..352f475 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -1489,6 +1489,22 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $ $('body,html').animate({ scrollTop: $('#' + selected_Id).position().top }, 500); } } + + + //open resoruce on slide + $scope.loadResourceOnCurrentSlide = function (id) { + + } + }] ); +function GetAIAModuleInformation(id) { + alert(id); + + var scope = angular.element(document.querySelector('[ng-controller="CurrBuildController"]')).scope(); + scope.$apply(function () { + scope.loadResourceOnCurrentSlide(id); + }); +} + diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 8d2af9f..150dbb6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -493,16 +493,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - var u = $location.url(); + // var u = $location.url(); + var isopenResourceRequest = sessionStorage.getItem('isModuleOpenByOpenResource'); - if ($rootScope.isOpenResourceBtnClicked == true) { + if (isopenResourceRequest == "true") { // $rootScope.MULTI_VIEW_ID = $rootScope.MULTI_VIEW_ID + 1; - $rootScope.multiViewInfoIndex = 0; - $rootScope.multiViewInfo.push({ "Target": $event.currentTarget, "id": $rootScope.MULTI_VIEW_ID, "bodyViewID": $event.currentTarget.id, "bodyName": $event.currentTarget.textContent }); - // $rootScope.multiSearchData = []; - localStorage.setItem("multiViewInfo", JSON.stringify($rootScope.multiViewInfo)); - console.log($rootScope.multiViewInfo); - $location.url('/curriculum-builder-detail'); + //$rootScope.multiViewInfoIndex = 0; + //$rootScope.multiViewInfo.push({ "Target": $event.currentTarget, "id": $rootScope.MULTI_VIEW_ID, "bodyViewID": $event.currentTarget.id, "bodyName": $event.currentTarget.textContent }); + //// $rootScope.multiSearchData = []; + //localStorage.setItem("multiViewInfo", JSON.stringify($rootScope.multiViewInfo)); + //console.log($rootScope.multiViewInfo); + //$location.url('/curriculum-builder-detail'); + // $(document, parent.window.document).trigger('myCustomTrigger'); + + parent.GetDaViewId($event.currentTarget.id); + + parent.closeIFrame(); + } else { @@ -515,7 +522,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'hidden'); } - + //load json data for body view $scope.loadDissectibleAnatomyData = function () { diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 78871a2..a8861b7 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -127,6 +127,10 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A // break; //} + $rootScope.isModuleOpenByOpenResource = true; + + sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); + $('#dvOpenResoucePanel').css('display', 'block'); // var homepath = $location.protocol() + "//" + $location.host() + ":" + $location.port() + "/"; @@ -142,7 +146,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A currentController: 'HomeController', parentSlug: 'curriculum-builder-detail', content: '
' + - '', + '', title: "Open Module in Curriculum Builder", position: { top: 1, @@ -155,34 +159,33 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A width: screen.width-10, height: 600 }, - + }); - + } - $scope.loadOpenResource = function () { + $scope.loadOpenResource = function (iframe) { - var iframe = document.getElementById('OpenModuleInCB'); + //var iframe = document.getElementById('OpenModuleInCB'); var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document; var head = $(innerDoc).contents().find("head"); if (head != undefined && head != null) { - $scope.loadopenresourceContent(head); + $scope.loadopenresourceContent(head, iframe); } else { $timeout(function () { var head = $(innerDoc).contents().find("head"); - $scope.loadopenresourceContent(head); + $scope.loadopenresourceContent(head, iframe); }, 1000); } - - + } - $scope.loadopenresourceContent=function(header) + $scope.loadopenresourceContent = function (header, iframe) { //disable link var css = ''; $(header).append(css); + $timeout(function () { + // var elmnt = iframe.contentWindow.document.getElementById("da-view-list"); + // var location1 = iframe.contentWindow.document.location.href; + + // $('#' + elmnt.id).trigger('click'); + // $("#" + elmnt.id).css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); + // iframe.setAttribute("src", location + "/da-view-list"); + //window.location.href = location; + // var currentlocation = iframe.contentWindow.document.location.href; + // iframe.contentWindow.document.locatiom.replace(currentlocation + "da-view-list"); + // document.getElementById("OpenModuleInCB").src = "http://stackoverflow.com"; + // location.replace("https://www.w3schools.com") + + // window.top.location.href = "http://www.example.com"; + var myframe = iframe; + + }, 1000); + } @@ -6828,15 +6849,23 @@ function printImagePreview(event) { } -function loadOpenResource(event) { +function loadOpenResource(iframe) { console.log('resource loading') var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); scope.$apply(function () { - scope.loadOpenResource(); + scope.loadOpenResource(iframe); }); } +function closeIFrame() { + $('#OpenResourcePanel').remove(); + $("#CBDetailPageDiv").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); + $(".navbar-fixed-top").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); + $("#topMenuBar").css({ "display": "block", "pointer-events": "auto", "opacity": "1" }); +} + +