Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaRHristov committed Jan 16, 2025
1 parent 34c59bd commit 1cd86f2
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 30 deletions.
75 changes: 48 additions & 27 deletions Source/Function/Commit/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,33 @@
// const { user, repo } = Astro.props;
const UUID = (await import("@Function/Commit/UUID/Fn.js")).default();
const Data = [
[
"Tiger Nixon",
"System Architect",
"Edinburgh",
"5421",
"2011/04/25",
"$3,120",
],
[
"Garrett Winters",
"Director",
"Edinburgh",
"8422",
"2011/07/25",
"$5,300",
],
];
---

<commit-table data-uuid={UUID}>
<table>
<thead>
<tr>
<th>Commit</th>
<th>Author</th>
<th>Date</th>
<th>Message</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</tbody>
</table>
<commit-table data-uuid={UUID} data-data={JSON.stringify(Data)}>
<table></table>
</commit-table>

<script>
import DataTable from "datatables.net-dt";
import $ from "jquery";
import jszip from "jszip";
import pdfmake from "pdfmake";

Expand All @@ -48,15 +49,35 @@ const UUID = (await import("@Function/Commit/UUID/Fn.js")).default();
import "datatables.net-select-dt";
import "datatables.net-staterestore-dt";

class Commit extends HTMLDivElement {
class Commit extends HTMLElement {
connectedCallback() {
const UUID = this.dataset["uuid"];

console.log(UUID);
let table = new DataTable(
`[data-uuid=${this.dataset["uuid"]}] table`,
{
// data: JSON.parse(this.dataset["data"] ?? "[]"),
data: [
{
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "$3,120",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421",
},
{
"name": "Garrett Winters",
"position": "Director",
"salary": "$5,300",
"start_date": "2011/07/25",
"office": "Edinburgh",
"extn": "8422",
},
],
// responsive: true,
},
);
}
}

customElements.define("commit-table", Commit, {
extends: "div",
});
customElements.define("commit-table", Commit);
</script>
8 changes: 5 additions & 3 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ export default (await import("astro/config")).defineConfig({
{
name: "crossorigin",
transform(Code, Identifier, _) {
const crossorigin = Identifier.includes(".js")
? `crossorigin=\\"anonymous\\"`
: 'crossorigin="anonymous"';
const crossorigin =
Identifier.includes(".js") ||
Identifier.includes(".astro")
? `crossorigin=\\"anonymous\\"`
: 'crossorigin="anonymous"';

return Code.replace(/<script/g, `<script ${crossorigin}`)
.replace(
Expand Down

0 comments on commit 1cd86f2

Please sign in to comment.