<div id="panel">
<div class="panel-tile">
+ <form @submit.prevent="loadCSV">
+ <label>Checkout Commit:</label>
+ <input v-model="commit" required placeholder="refs/heads/main">
+ <button>Checkout</button>
+ </form>
+ <div style="border: 0.1px solid rgb(161, 161, 161); margin-bottom: 10pt; margin-top: 10pt;"></div>
+
<label>Current tag:</label>
<select v-model="CurrentCategory" style="max-width: 300px;">
<option v-for="category in sortedCategories" :key="category" :value="category">
return {
ready: false,
isEdited: false,
+ commit: "refs/heads/main",
newFamily: '',
newWeight: '',
CurrentCategory: "/Expressive/Calm",
window.open("https://github.com/google/fonts/edit/main/tags/all/families.csv")
},
loadCSV() {
- const csvFilePath = 'https://raw.githubusercontent.com/google/fonts/main/tags/all/families.csv'; // Update this path to your CSV file
+ if (this.history.length > 0) {
+ let proceed = confirm("Checking out a new commit will delete any changes you've made. Would you like to continue?")
+ if (proceed === false) {
+ return;
+ }
+ }
+ this.history = [];
+ const csvFilePath = `https://raw.githubusercontent.com/google/fonts/${this.commit}/tags/all/families.csv`; // Update this path to your CSV file
fetch(csvFilePath)
- .then(response => response.text())
+ .then(response => {
+ if (response.status === 404) {
+ alert(`No data found for commit "${this.commit}". Please input a git commit hash e.g 538d9635c160306b40af31c9a3821c59b285bbff`);
+ }
+ return response.text()
+ })
.then(csvText => {
Papa.parse(csvText, {
header: true,