adding url to toot content
This commit is contained in:
parent
a4a9163efc
commit
64db0492a5
@ -9,6 +9,7 @@
|
||||
<input type="textarea" name="Comment" id="toot-comment" placeholder="Your comment here" cols="20" autofocus><br>
|
||||
<input type="text" id="toot-hashtags"></span><br>
|
||||
<button id="toot-button">Toot !</button><br><br>
|
||||
<span id='toot-url'></span>
|
||||
<br>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
@ -1,8 +1,10 @@
|
||||
function tootInfo(message) {
|
||||
tootContent = document.getElementById("toot-info").innerHTML
|
||||
tootContent += " "
|
||||
tootContent += "\n\n"
|
||||
tootContent += document.getElementById("toot-comment").value
|
||||
tootContent += " "
|
||||
tootContent += "\n\n"
|
||||
tootContent += document.getElementById('toot-url').innerText
|
||||
tootContent += "\n\n"
|
||||
tootContent += document.getElementById("toot-hashtags").value
|
||||
url = "http://localhost:5000/toot"
|
||||
fetch(url, {
|
||||
@ -18,8 +20,9 @@ function tootInfo(message) {
|
||||
}
|
||||
|
||||
function handleResponse(message) {
|
||||
document.getElementById("toot-info").innerHTML = message.artist + " - " + message.title + '\n\n'
|
||||
document.getElementById("toot-info").innerHTML = message.artist + " - " + message.title
|
||||
document.getElementById("toot-hashtags").value = "#radio #np #musique #music" + '\n'
|
||||
document.getElementById('toot-url').innerText = message.url
|
||||
}
|
||||
|
||||
function handleError(error) {
|
||||
|
@ -2,4 +2,8 @@
|
||||
height: 100px;
|
||||
max-width: 100px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
}
|
||||
/*
|
||||
#toot-url {
|
||||
visibility: hidden;
|
||||
} */
|
@ -1,5 +1,5 @@
|
||||
browser.runtime.onMessage.addListener((data, sender, sendResponse) => {
|
||||
deezerTitle = document.getElementsByClassName('track-link')[0].innerHTML
|
||||
deezerArtist = document.getElementsByClassName('track-link')[1].innerHTML
|
||||
sendResponse({title: deezerTitle, artist: deezerArtist})
|
||||
sendResponse({title: deezerTitle, artist: deezerArtist, url: window.location.href})
|
||||
});
|
Loading…
Reference in New Issue
Block a user