954899189d52232b3b5e4d4b633e82b717d653ea
[portal/sdk.git] /
1 appDS2.controller('notebookFrameController', function ($scope,$location,$window,$http,$routeParams) {
2         var nid = $window.location.search.substr($window.location.search.indexOf("=")+1);
3         $scope.additionalqueryParams={};
4         if ($window.location.search.substr($window.location.search.indexOf("=")+1)) {
5                 $scope.queryParams = $window.location.search;
6                 if($window.location.search.substring(0, $window.location.search.length-1).indexOf("&")!=-1) {
7                         $scope.notebookparam = $window.location.search.substring($window.location.search.indexOf("?")+1,$window.location.search.indexOf("&"));
8                         $scope.additionalqueryParams = JSON.parse('{"' + decodeURI($scope.queryParams.substr($scope.queryParams.indexOf("&")+1).replace(/&/g, "\",\"").replace(/=/g,"\":\"")) + '"}');
9                 }
10                 else {
11                         $scope.notebookparam1 = $window.location.search.substr($window.location.search.indexOf("?")+1);
12                         $scope.notebookparam = $scope.notebookparam1.substring(0, $scope.notebookparam1.length - 1);
13                 }
14                 $scope.notebookvalue = $scope.notebookparam.substr($scope.notebookparam.indexOf("=")+1);
15         }
16         else {
17                 $scope.notebookvalue = '833c0a69ec1433fbb2f8752af733cf0e';
18         }
19         $http({method:'POST', url:'rNotebookFE/authCr', data: $scope.notebookvalue, params:{'qparams' : $scope.additionalqueryParams}, transformResponse: [function (data) {
20               // Do whatever you want!
21         document.getElementById('itestframe').src = data;
22               return data;
23           }]})
24 });