AIA.controller("CurrBuildController", ["$scope", "$rootScope", "pages", "$log", "Modules", "$http", "$compile", "$location", function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location) { // $rootScope.currentActiveModuleTitle = pages[6].name; $scope.showTabButton = false; $scope.listCurriculumBuilder = null; $scope.dataPopup = null; $scope.countLeftlist; $scope.countRightlist; $scope.IsVisible = function () { $scope.scroll(); } $scope.scroll = function () { // $window.scrollTo(0, 0); $("html,body").scrollTop(0); //alert("scroll"); } $scope.openAIAFlexCB = function () { var userInfo; var encryptedUserName; var encryptedPassword var urlPrams; var key = CryptoJS.enc.Base64.parse("MTIzNDU2NzgxMjM0NTY3OAXUD"); var iv = CryptoJS.enc.Base64.parse("EBESExQVFhcYGRobHB0eHwXUD"); if ($rootScope.isCallFromSite) { if ($rootScope.IsCalsCred) { encryptedUserName = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.username, key, { iv: iv }); encryptedPassword = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.password, key, { iv: iv }); $location.url('/'); window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword + '&mod=7'); } else { $location.url('/'); var encryptedSiteIP = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.siteIP, key, { iv: iv }); var encryptedAccountNumber = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.accountNumber, key, { iv: iv }); var encryptedEdition = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.edition, key, { iv: iv }); var encryptedUrlReferer = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.urlReferer, key, { iv: iv }); var encryptedRemoteIPAddress = CryptoJS.AES.encrypt($rootScope.siteUrlInfo.remoteIPAddress, key, { iv: iv }); var encryptedSiteId = CryptoJS.AES.encrypt($rootscope.siteId, key, { iv: iv }); window.open('http://qa.interactiveanatomy.com/Default.aspx?si=' + encryptedSiteIP + '&ac=' + encryptedAccountNumber + '&ed=' + encryptedEdition + '&rf=' + encryptedUrlReferer + '&rm=' + encryptedRemoteIPAddress + '&mod=7' + '&s=' + encryptedSiteId); } } else { userInfo = ($rootScope.userData); var encryptedUserName = CryptoJS.AES.encrypt(userInfo.LoginId, key, { iv: iv }); var encryptedPassword = CryptoJS.AES.encrypt(userInfo.Password, key, { iv: iv }); $location.url('/'); window.open('http://qa.interactiveanatomy.com/Default.aspx?un=' + encryptedUserName + '&up=' + encryptedPassword+'mod=7'); } } //load json data $scope.loadCurriculumBuiderData = function () { if ($rootScope.refreshcheck == null) { $location.path('/'); } //get current path var currentURL = $location.path(); var selectedModuleName = ''; //set module title angular.forEach($rootScope.userModules, function (value, key) { if (value.slug === currentURL.replace('/', '')) { selectedModuleName = value.name; } $rootScope.currentActiveModuleTitle = selectedModuleName; }) //get current path var currentURL = $location.path(); $http({ method: 'GET', url: 'content/data/json/cb/cb_list_content.json' }).success(function (data) { $scope.listCurriculumBuilder = data; //load default body view list $scope.getCBViewList(); }) .error(function (data, status, headers, config) { console.log(data); }); } //get CB body view list $scope.getCBViewList = function ($event) { $('#leftBodyViewList').empty(); $scope.countLeftlist = Object.keys($scope.listCurriculumBuilder.slideshows.slideshow).length / 2; $scope.loadleftBodyViewList = new jinqJs() .from($scope.listCurriculumBuilder.slideshows.slideshow) .select(); for (var i = 0; i < $scope.countLeftlist; i++) { console.log($scope.listCurriculumBuilder.slideshows.slideshow[i]._label); //alert($scope.listCurriculumBuilder.slideshows.slideshow[i]._label); var $el = $('
  • ' + $scope.listCurriculumBuilder.slideshows.slideshow[i]._label + '
  • ').appendTo('#leftBodyViewList'); $compile($el)($scope); } $scope.countRightlist = Object.keys($scope.listCurriculumBuilder.slideshows.slideshow).length; for (var i = $scope.countLeftlist; i < $scope.countRightlist; i++) { console.log($scope.listCurriculumBuilder.slideshows.slideshow[i]._label); var $el1 = $('
  • ' + $scope.listCurriculumBuilder.slideshows.slideshow[i]._label + '
  • ').appendTo('#rightBodyViewList'); $compile($el)($scope); } } $scope.loadSlideShowXmldata = function (e) { // alert(e); $http({ method: 'GET', url: 'content/data/json/cb/SlideShow/AIA_Curriculum_Builder_Guide.sldshw' }).success(function (data) { $scope.dataPopup = data; alert($scope.dataPopup); }) .error(function (data, status, headers, config) { console.log(data); }); } }] );