Skip to content

Commit

Permalink
bump action
Browse files Browse the repository at this point in the history
fix lint
  • Loading branch information
pjaudiomv committed Oct 18, 2023
1 parent 1a83857 commit 3081975
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
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

0 comments on commit 3081975

Please sign in to comment.