Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump action #1

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
],
"new-parens": "off",
"newline-per-chained-call": "off",
"no-alert": "error",
"no-alert": "off",
"no-array-constructor": "error",
"no-await-in-loop": "error",
"no-bitwise": "off",
Expand Down Expand Up @@ -190,6 +190,7 @@
"no-useless-constructor": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-unused-vars": "off",
"no-var": "off",
"no-void": "off",
"no-warning-comments": "error",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build
Expand Down
29 changes: 14 additions & 15 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
function fetchMeetings(query, callback) {
const script = document.createElement('script');
script.src = query + '&callback=' + callback.name;
const script = document.createElement("script");
script.src = query + "&callback=" + callback.name;
document.body.appendChild(script);
}

function handleMeetingsData(meetings) {
const csvContent = 'data:text/csv;charset=utf-8,' + encodeURIComponent(
convertToCSV(meetings)
);
const downloadLink = document.getElementById('downloadLink');
const csvContent =
"data:text/csv;charset=utf-8," + encodeURIComponent(convertToCSV(meetings));
const downloadLink = document.getElementById("downloadLink");
downloadLink.href = csvContent;
downloadLink.style.display = 'block';
downloadLink.style.display = "block";
}

function convertToCSV(data) {
const csvRows = [];
const keys = Object.keys(data[0]);

// header row
csvRows.push(keys.join(','));
csvRows.push(keys.join(","));

data.forEach((row) => {
const values = keys.map((key) => {
let value = row[key];
if (typeof value === 'string') {
if (typeof value === "string") {
// Escape double quotes and wrap in double quotes if it contains a comma
if (value.includes(',') || value.includes('"')) {
if (value.includes(",") || value.includes('"')) {
value = `"${value.replace(/"/g, '""')}"`;
}
}
return value;
});

csvRows.push(values.join(','));
csvRows.push(values.join(","));
});

return csvRows.join('\n');
return csvRows.join("\n");
}

function exportToCSV() {
const query = document.getElementById('query').value;
if (!query.includes('/client_interface/jsonp')) {
alert('Invalid BMLT query URL, must use jsonp endpoint.');
const query = document.getElementById("query").value;
if (!query.includes("/client_interface/jsonp")) {
alert("Invalid BMLT query URL, must use jsonp endpoint.");
return;
}

Expand Down