aboutsummaryrefslogtreecommitdiffstats
path: root/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/ase.js
blob: 3f3432ecffe522009e52e668a5833be8e3a54772 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//window.filename = "";
//window.name = "My_Flow_1";
window.description = "My Sequence Diagram";
window.arrowTip = 12;
window.resized = false;
window.arrowConnections = true;
window.negativeWidth = false;
window.gridPitchx = 160;
window.gridPitchy = 42;
window.clipboard = [];
window.selection = [];
//var networkMap();
var step = 1;
var sessiontoken = '';
var uid= 'XX0000';
var username= '';
var toscaDetails = {
		'toscaID':'',
		'name':'',
		'domain':''
};
var ase = {
		'elementsFileName' : '',
		'description' : 'My Sequence Diagram',
		'name' : 'My_Flow_1',
		'filename' : '',
		'elementsFile' : '../mocks/networkElements.yml'
};

		

$(function() {

	newProject(null,null,initialRows);

    //buildTable();
    //buildDomain();    
        
    var loadSample = false;
    var showBpmn = false;
    
    
    $('#sampleEx').click(function(){
    	if (! loadSample ) {
    		loadSample = loadSampleData();
    	}
    });
    $('#bpmnEx').click(function(){
    	convertToBPMN(makeJSON(),window.description,'show');
    });
    $('#popupEx').click(function(){
    	showPopup();
    });
    
//    if ( getParameterByName("bpmn") === "1" ) {
//    	
//    } else if ( getParameterByName("sample") === "1" ) {
//    	$('#sampleDiv').show();
//    } else if ( getParameterByName("interact") === "1" ) {
//       
//    
//	}
    
    
    

    //Allows nodes to scroll with the page and adjusts transparencies
	$(window).scroll(function(event) {
		scroll();
    });

	toggleDoubleLine(document.getElementById('row1'),null,"Step 1:","");
	//buildDomain();    
	//addStep(document.getElementById('row1'),'row1',step,'');
	buildNetworkMap();
	$("#backHome").click(function(){ document.location = "../welcome.htm?showASE=true";});
});

function getParameterByName( name ){
  var regexS = "[\\?&]"+name+"=([^&#]*)"; 
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.search );
  if( results == null ){
    return "";
  } else {
    return decodeURIComponent(results[1].replace(/\+/g, " "));
  }
}

function loadSampleData() {
    try {
    	//loadFile(0,null,preloadedJSON);
    	loadFile(0,null,trinity_3g_json);
    } catch(err){
    	return false;
    } finally {
    	
    }
    return true;
}

function showPopup(){
	bootbox.dialog({
		backdrop:true,
		animate:false,
		onEscape: function() {},
		title: '<div style="float:left">Sample Dialog</div>',
		size: 'small',
		message: '<div id="saveWarning"></div><h4>Sample Dialog using Bootstraps bootbox.dialog components.</h4>'+
		'<br><hr>'
	});
}