2 app.config(function($routeProvider) {
6 // templateUrl: 'app/fusion/notebook-integration/scripts/view-models/notebook-frame.html',
7 templateUrl: 'app/fusion/notebook-integration/scripts/view-models/notebookInputs.html',
8 controller: 'nbookController'
10 }).controller('nbookController', ['$scope', '$location','$window','$http', function ($scope,$location,$window,$http) {
12 $scope.keyValueList = [{}];
13 console.log('onload nbookController');
14 $scope.submitParameters = function() {
16 $scope.iframevisibility = false;
17 console.log('Inside nbook invoke save');
21 $scope.additionalqueryParams = {};
23 //Use this if there is only one 1 query param key value pair
24 $scope.additionalqueryParams.paramKey = $scope.qparamKey;
25 $scope.additionalqueryParams.paramVal = $scope.qparamVal;
28 // console.log('$scope.additionalqueryParams',$scope.additionalqueryParams);
29 console.log('$scope.notebookvalue',$scope.notebookvalue);
32 console.log('$scope.additionalqueryParams',$scope.additionalqueryParams);
34 console.log('$scope.keyValueList',$scope.keyValueList);
36 console.log('$scope.keyValueList.length',$scope.keyValueList.length);
39 for(var i = 0; i < $scope.keyValueList.length; i++) {
40 var obj = $scope.keyValueList[i];
41 //console.log('obj.qK',obj.qK);
42 if (obj.qK != undefined && obj.qV != undefined) {
43 //console.log('Inside qk defined');
45 qryStr = qryStr+'&'+obj.qK+'='+obj.qV;
47 qryStr = obj.qK+'='+obj.qV;
52 console.log('qryStr',qryStr);
56 //var testurl = 'nbooktest.htm?nid='+$scope.notebookvalue+'&k1='+$scope.additionalqueryParams.paramKey+'&v1='+$scope.additionalqueryParams.paramVal;
58 // var testurl = 'nbooktest.htm?nid='+$scope.notebookvalue+'&'+$scope.additionalqueryParams.paramKey+'='+$scope.additionalqueryParams.paramVal;
60 var queryurl = 'nbooktest.htm?nid='+$scope.notebookvalue+'&'+qryStr;
62 // var testurl = 'notebook.htm#/notebook-frame';
64 window.open (queryurl,'_self',false);
69 $scope.addKeyValuePairs = function (kv) {
72 if ($scope.keyValueList.length < 9) {
73 $scope.keyValueList.push({
76 // alert($scope.reportRunJson.rangeAxisList.length);
77 // console.log('$scope.keyValueList',$scope.keyValueList);
80 //document.getElementById("addbtn").disabled = true;
81 // $scope.btnactive = false;
82 document.getElementById("addbtn")["disabled"] = true;
83 //document.getElementById("addbtn")["style.background-color"] = "#FFFF00";
85 //$('#addbtn').btn('type') = "disabled";
89 $scope.removeKeyValuePairs = function (index) {
90 $scope.keyValueList.splice(index, 1);
91 if ($scope.keyValueList.length == 8) {
92 document.getElementById("addbtn")["disabled"] = false;
94 //console.log($scope.hardCodeReport.rangeAxisList)