This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
bloxml.html
102 lines (78 loc) · 2.95 KB
/
bloxml.html
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
<!DOCTYPE html>
<html>
<head>
<title>A specific BloXML use case</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
<script src="lib/blockly_compressed.js"></script>
<script src="lib/blockly_msg_js_en.js"></script>
<script src="src/blockly_extensions.js"></script>
<script src="src/js_extensions.js"></script>
<script src="src/HueGenerator.js"></script>
<script src="src/UnicodeIndenter.js"></script>
<script src="src/parser.js"></script>
<script src="src/frontend.js"></script>
<script src="src/Validator.js"></script>
<script src="src/XMLGenerator.js"></script>
<script src="lib/vkbeautify.0.99.00.beta.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<style>
body{
margin: 25px;
}
textarea{
width: 100%;
resize: none;
}
.tab-content{
padding: 10px;
}
.leftMargin{
margin-left: 2.5%;
}
#blocklyDiv{
float: left;
width: 100%;
height: 1000px;
border: 1px solid #ddd;
}
</style>
</head>
<body>
<h3>A specific BloXML use case</h3>
<span class="label label-info" id="url_area"></span>
<span class="text-danger" id="parsing_error_area"></span>
<span class="text-danger" id="validation_error_area"></span>
<div align="right">
<button class="btn btn-primary leftMargin" id="validateBtn" onclick="xmlToBlocklyWorkspace.validateBlocklyGraph();">
Export the blockly diagram into XML
</button>
</div>
<!-- Div for blockly workspace and toolbox -->
<div id="blockly_area">
<div id="blocklyDiv"></div>
<xml id="toolbox" style="display: none">
</xml>
</div>
<div id="blockly_code_area" style="display:none"></div>
<textarea id="xml_output_area" rows="25" readonly></textarea>
<script>
var xmlToBlocklyWorkspace = new XMLToBlocklyWorkspace();
var rngURL = getDecodedQueryVariable( "url" );
if( rngURL ) {
document.getElementById('url_area').innerHTML = "RNG from '" + rngURL + "'";
var rngFileContent = syncLoadFileFromURL(rngURL);
xmlToBlocklyWorkspace.handleRNG( rngFileContent );
} else {
// try entering https://raw.githubusercontent.com/Ensembl/XML-To-Blockly/gh-pages/examples/addressBook.rng
// as an example
document.getElementById('parsing_error_area').innerHTML = "You need to define the URL of your RNG file<br/>"
+ "<form action='"+ window.location.toString() + "' method='get'>"
+ " URL of the RNG file: <input type='text' name='url'>"
+ "<input type='submit' value='Submit'></form>";
}
</script>
</body>
</html>