forked from sparqling/sparql-formatter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
104 lines (98 loc) · 4.8 KB
/
index.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
103
104
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>SPARQL 1.1 formatter</title>
<link crossorigin='anonymous' href='https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css'
integrity='sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh' rel='stylesheet'>
<link href='./sites/codemirror/codemirror.css' rel='stylesheet'>
<link href='./sites/style.css' rel='stylesheet'>
<link href='./sites/img/favicon.ico' rel='icon'>
<link href='https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css' rel='stylesheet'>
<link href="https://use.fontawesome.com/releases/v5.6.1/css/all.css" rel="stylesheet">
<script src='./sites/codemirror/codemirror.js'></script>
<script src='./sites/codemirror/simple.js'></script>
<script src='./sites/codemirror/mark-selection.js'></script>
<script src='./sites/codemirror/sparql.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js'></script>
</head>
<body>
<div id='app'>
<nav class='navbar navbar-expand-md navbar-light bg-white shadow-sm sticky-top' id='header'>
<div class="container-fluid">
<div class="navbar-header">
<h3 class="mt-2">
SPARQL 1.1 formatter
</h3>
</div>
<div class="nav navbar-nav navbar-right">
<a href="https://github.com/sparqling/sparql-formatter" target="_blank" rel="noopener noreferrer">
<img src="./sites/img/GitHub_Logo_White.png" style="height: 22px;">
<img src="./sites/img/GitHub-Mark-Light-32px.png">
</a>
</div>
</div>
</nav>
<div id='main-area'>
<div id='input-area' class="mt-2 ml-1">
<span class="ml-3 subheading">Input:</span>
<div class="float-right">
<span class="mr-1 text-muted">example</span>
<select id="query-select" class="text-muted rounded" style="width: 150px"></select>
</div>
<div class="mt-1 text-container">
<textarea id='input-sparql'>
SELECT * WHERE { ?s ?p ?o. } LIMIT 10</textarea>
</div>
</div>
<div id="resize-handle" class="handle"></div>
<div id='formatted-area' class="mt-2 mr-2">
<span class="ml-3 subheading">Formatted:</span>
<div class="float-right">
<span class="mr-1 text-muted">indent</span>
<select id="indent-depth" class="text-muted rounded" style="width: 75px">
<option>2</option>
<option>4</option>
</select>
</div>
<div class="mt-1 text-container">
<button id="copy-button" class="border-0 rounded">
<i class="far fa-copy text-muted small"></i>
<span class="small text-muted">Copy</span>
</button>
<textarea id='formatted-sparql'>
SELECT *
WHERE {
?s ?p ?o .
}
LIMIT 10</textarea>
</div>
</div>
</div>
</div>
<script>
const q = document.querySelector.bind(document);
const editor = CodeMirror.fromTextArea(q('#input-sparql'), {
lineNumbers: true,
viewportMargin: Infinity,
lineWrapping: true
});
const outputArea = CodeMirror.fromTextArea(q('#formatted-sparql'), {
lineNumbers: true,
viewportMargin: Infinity,
lineWrapping: false,
cursorBlinkRate: -1,
readOnly: true
});
editor.setSize('100%', '100%');
outputArea.setSize('100%', '100%');
</script>
<script src='https://cdn.jsdelivr.net/gh/sparqling/[email protected]/dist/main.js'></script>
<script src='./sites/main.js'></script>
</body>
</html>