Skip to content

Commit

Permalink
Update metadata.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid authored May 15, 2024
1 parent c952939 commit cf8f383
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class Metadata {
.classOn('material-symbols-sharp')
.text('add')

this.download = new HTML('button')

Check failure on line 83 in src/metadata.ts

View workflow job for this annotation

GitHub Actions / deploy

Property 'download' does not exist on type 'Metadata'.
.attr({ title: 'Download' })
.classOn('material-symbols-sharp')
.text('download')

this.options = new HTML('div').classOn('options')
this.menu = new HTML('button')
.attr({ title: 'Menu' })
Expand Down Expand Up @@ -132,6 +137,7 @@ class Metadata {
this.playPause.appendTo(this.icons)
this.nextTrack.appendTo(this.icons)
if (this.sdk != null) this.like.appendTo(this.icons) // Only show the like button if the SDK is available
this.download.appendTo(this.icons)

Check failure on line 140 in src/metadata.ts

View workflow job for this annotation

GitHub Actions / deploy

Property 'download' does not exist on type 'Metadata'.

this.options.appendTo(document.body)
this.menu.appendTo(this.options)
Expand Down Expand Up @@ -215,11 +221,19 @@ class Metadata {
this.player.prev().catch(console.error)
})

// Register the click events for the buttons
this.nextTrack.on('click', () => {
this.player.next().catch(console.error)
})

this.download.on('click', () => {

Check failure on line 228 in src/metadata.ts

View workflow job for this annotation

GitHub Actions / deploy

Property 'download' does not exist on type 'Metadata'.
var link = document.createElement("a");
link.href = this.player.audio.src;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
delete link;

Check failure on line 234 in src/metadata.ts

View workflow job for this annotation

GitHub Actions / deploy

'delete' cannot be called on an identifier in strict mode.

Check failure on line 234 in src/metadata.ts

View workflow job for this annotation

GitHub Actions / deploy

The operand of a 'delete' operator must be a property reference.
})

// Register the click events for the like button
if (this.sdk != null) {
this.like.on('click', () => {
Expand Down

0 comments on commit cf8f383

Please sign in to comment.