Spaces:
Sleeping
Sleeping
Commit ·
3152818
1
Parent(s): 4dddf97
Update static/js/script.js
Browse files- static/js/script.js +14 -0
static/js/script.js
CHANGED
|
@@ -63,6 +63,14 @@ function fetchContent() {
|
|
| 63 |
let javaTpointLink = `https://www.javatpoint.com/${query.replace(/ /g, '-')}`;
|
| 64 |
$("#javatpointContent").html(`<a href='${javaTpointLink}' target='_blank'>View on JavaTpoint</a>`);
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
// YouTube API with SafeSearch and keyword filtering
|
| 68 |
$("#youtubeContent").html("Loading...");
|
|
@@ -90,6 +98,12 @@ function fetchContent() {
|
|
| 90 |
});
|
| 91 |
}
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
function playVideo(videoId, element) {
|
| 94 |
let videoFrame = `<iframe width='100%' height='300' src='https://www.youtube.com/embed/${videoId}' frameborder='0' allowfullscreen></iframe>`;
|
| 95 |
let parentCard = element.closest(".card");
|
|
|
|
| 63 |
let javaTpointLink = `https://www.javatpoint.com/${query.replace(/ /g, '-')}`;
|
| 64 |
$("#javatpointContent").html(`<a href='${javaTpointLink}' target='_blank'>View on JavaTpoint</a>`);
|
| 65 |
|
| 66 |
+
$("#mediumContent").html("Loading...");
|
| 67 |
+
let mediumLink = `https://medium.com/search?q=${query.replace(/ /g, '+')}`;
|
| 68 |
+
$("#mediumContent").html(`<a href='${mediumLink}' target='_blank'>View on Medium</a>`);
|
| 69 |
+
|
| 70 |
+
$("#quoraContent").html("Loading...");
|
| 71 |
+
let quoraLink = `https://www.quora.com/search?q=${query.replace(/ /g, '+')}`;
|
| 72 |
+
$("#quoraContent").html(`<a href='${quoraLink}' target='_blank'>View on Quora</a>`);
|
| 73 |
+
|
| 74 |
|
| 75 |
// YouTube API with SafeSearch and keyword filtering
|
| 76 |
$("#youtubeContent").html("Loading...");
|
|
|
|
| 98 |
});
|
| 99 |
}
|
| 100 |
|
| 101 |
+
function handleKeyPress(event) {
|
| 102 |
+
if (event.key === "Enter") {
|
| 103 |
+
fetchContent();
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
function playVideo(videoId, element) {
|
| 108 |
let videoFrame = `<iframe width='100%' height='300' src='https://www.youtube.com/embed/${videoId}' frameborder='0' allowfullscreen></iframe>`;
|
| 109 |
let parentCard = element.closest(".card");
|