-
Notifications
You must be signed in to change notification settings - Fork 181
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
Adds "Save Song" button to save music to localstorage.Still in need… #212
Changes from all commits
2ce8cba
9425843
605e18b
97d2c4c
0f9db37
f049c95
249d435
4b04ab8
87f3102
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,7 @@ var ZenPlayer = { | |
that.setupTitle(); | ||
that.setupVideoDescription(); | ||
that.setupPlyrToggle(); | ||
that.setupSongSave(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tab indents |
||
}); | ||
|
||
plyrPlayer.addEventListener("playing", function() { | ||
|
@@ -261,8 +262,21 @@ var ZenPlayer = { | |
// Show player button click event | ||
$("#togglePlayer").click(function(event) { | ||
toggleElement(event, ".plyr__video-wrapper", "Player"); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert this change |
||
}); | ||
}, | ||
setupSongSave: function() { | ||
$("#save").click(function() { | ||
var mySongs = JSON.parse(localStorage.getItem("mySongs")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tab |
||
if (mySongs === null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lots of tabs here 😄 |
||
localStorage.setItem("mySongs", JSON.stringify([getCurrentVideoID()])); | ||
} | ||
else { | ||
mySongs.push(getCurrentVideoID()); | ||
localStorage.setItem("mySongs", JSON.stringify(mySongs)); | ||
} | ||
}); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Insert a comma here and see if it builds (Line 279) |
||
getVideoDescription: function(videoID) { | ||
var description = ""; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this added break?