Skip to content

Commit 81016a0

Browse files
committed
demo_project
1 parent 5c6de29 commit 81016a0

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

index.html

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,19 @@ <h2>Welcome to PROV-A</h2>
7676
</section>
7777

7878
<div class="container" style="flex: 1">
79+
<div class="d-flex justify-content-center my-5">
80+
<button type="button" class="btn btn-primary ms-2" id="demoDataBtn">
81+
<i class="fa-solid fa-forward-fast"></i> Quick Start with Demo Project
82+
</button>
83+
</div>
7984
<div class="row text-center my-5 mx-5 align-items-stretch">
8085
<!-- Step 1: Initialise Project -->
8186
<div class="col-sm pb-2">
8287
<div class="card shadow h-100 d-flex flex-column">
8388
<div class="card-body d-flex flex-column align-items-center flex-grow-1 justify-content-between">
8489
<a href="initialise-project.html" class="home-card" aria-label="Initialise Project">
8590
<i class="fa-solid fa-play fa-6x bg-init text-white icon-circular"></i><br>
86-
<span class="btn bg-init mt-3">Initialise Project</span>
91+
<span class="btn bg-init mt-3" style="color: white !important">Initialise Project</span>
8792
</a>
8893
<p class="mt-2 text-muted">
8994
Start your project by importing a table or creating one from scratch.
@@ -103,7 +108,7 @@ <h2>Welcome to PROV-A</h2>
103108
<div class="card-body d-flex flex-column align-items-center flex-grow-1 justify-content-between">
104109
<a href="structure-data.html" class="home-card" aria-label="Structure Data">
105110
<i class="fa-solid fa-list-check fa-6x bg-edit text-white icon-circular"></i><br>
106-
<span class="btn bg-edit mt-3">Structure Data</span>
111+
<span class="btn bg-edit mt-3" style="color: white !important">Structure Data</span>
107112
</a>
108113
<p class="mt-2 text-muted">
109114
Organise and structure your data interactively.
@@ -123,7 +128,7 @@ <h2>Welcome to PROV-A</h2>
123128
<div class="card-body d-flex flex-column align-items-center flex-grow-1 justify-content-between">
124129
<a href="generate-lod.html" class="home-card" aria-label="Query Data">
125130
<i class="fa-solid fa-diagram-project fa-6x bg-data text-white icon-circular"></i><br>
126-
<span class="btn bg-data mt-3">Generate LOD</span>
131+
<span class="btn bg-data mt-3" style="color: white !important">Generate LOD</span>
127132
</a>
128133
<p class="mt-2 text-muted">
129134
Generate Linked Open Data and query it using SPARQL.
@@ -149,4 +154,26 @@ <h2>Welcome to PROV-A</h2>
149154
</div>
150155
</footer>
151156
</body>
157+
<script>
158+
document.getElementById('demoDataBtn').addEventListener('click', function(event) {
159+
event.preventDefault();
160+
const userConfirmed = confirm("⚠️ Any previous project will be overwritten! Are you sure you want to use demo project?");
161+
if (!userConfirmed) {
162+
return;
163+
}
164+
const jsonUrl = 'https://raw.githubusercontent.com/prov-a/prov-a.github.io/refs/heads/main/src/demo_project.json';
165+
fetch(jsonUrl)
166+
.then(response => {
167+
return response.json();
168+
})
169+
.then(jsonData => {
170+
localStorage.setItem('provaData', JSON.stringify(jsonData));
171+
window.location.href = "structure-data.html";
172+
})
173+
.catch(error => {
174+
console.error('Error loading JSON:', error);
175+
alert('Failed to load project data.');
176+
});
177+
});
178+
</script>
152179
</html>

initialise-project.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ <h2 class="h5 mb-0">Artifacts Data</h2>
255255

256256
// Add event listener to remove buttons
257257
$(document).on('click', '.btn-remove', function() {
258-
const confirmed = confirm('Are you sure you want to delete the row?');
258+
const confirmed = confirm('⚠️ Are you sure you want to delete the row?');
259259
if (confirmed) {
260260
$(this).closest('tr').remove();
261261
updateAddRowButtonVisibility(); // Update Add Row button visibility
@@ -336,7 +336,7 @@ <h2 class="h5 mb-0">Artifacts Data</h2>
336336

337337
// Confirmation before leaving the page
338338
window.addEventListener('beforeunload', function(e) {
339-
const confirmationMessage = 'Data will be lost. Are you sure you want to leave this page?';
339+
const confirmationMessage = '⚠️ Data will be lost. Are you sure you want to leave this page?';
340340
e.returnValue = confirmationMessage;
341341
return confirmationMessage;
342342
});

structure-data.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ <h4>No Results</h4>
104104
const relation_snippet = relation_form;
105105

106106
$(document).on('click', '.btn-change', function() {
107-
const confirmed = confirm('Make sure you downloaded the project before exiting. Are you sure you want to change project?');
107+
const confirmed = confirm('⚠️ Make sure you downloaded the project before exiting. Are you sure you want to change project?');
108108
if (confirmed) {
109109
localStorage.clear()
110110
indexedDB.databases().then(databases => {

0 commit comments

Comments
 (0)