diff --git a/css/maps.js b/css/maps.js new file mode 100644 index 00000000..dbe5ffdb --- /dev/null +++ b/css/maps.js @@ -0,0 +1,33 @@ + var bbox = "?bbox=-165.76171875000003%2C-3.864254615721396%2C30.410156250000004%2C72.44879155730672&layer=mapnik" + var iframe = document.getElementById('myFrame'); + iframe.src=`https://www.openstreetmap.org/export/embed.html${bbox}` + iframe.addEventListener('load', function() { + var iframeDocument = iframe.contentDocument || iframe.contentWindow.document; + var links = iframeDocument.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + links[i].addEventListener('click', function(event) { + var url = event.target.href; + if (url.includes('www.openstreetmap.org')) { + event.preventDefault(); + iframe.src = url; + window.history.pushState(null, '', url); + } else { + window.location.href = url; + } + }); + } + }); + + window.onpopstate = function(event) { + iframe.src = window.location.href; + }; + + iframe.addEventListener('load', function() { + var iframeDocument = iframe.contentDocument || iframe.contentWindow.document; + var elements = iframeDocument.querySelectorAll('[style*="//dka575ofm4ao0.cloudfront.net"]'); + for (var i = 0; i < elements.length; i++) { + var style = elements[i].style.backgroundImage; + var newStyle = style.replace('//dka575ofm4ao0.cloudfront.net', 'https://p.poketube.fun/https://dka575ofm4ao0.cloudfront.net'); + elements[i].style.backgroundImage = newStyle; + } + }); diff --git a/html/account-create.ejs b/html/account-create.ejs index 96cf455e..e8dfa317 100644 --- a/html/account-create.ejs +++ b/html/account-create.ejs @@ -63,10 +63,10 @@ var apiurl = "https://poketube.fun/api" if(!localStorage.getItem("UserID")) { localStorage.setItem('UserID', `<%- userid %>`); <% db.set(`user.${userid}`, userid) %> - location.href = "/my-acc?ID=" + `<%- userid %>` + location.href = "/my-acc?ID=" + `<%- userid %>` + "&rparam=1" } if(localStorage.getItem("UserID")) { - location.href = "/my-acc?ID=" + localStorage.getItem("UserID") + location.href = "/my-acc?ID=" + localStorage.getItem("UserID") + "&rparam=1" } \ No newline at end of file diff --git a/html/map.ejs b/html/map.ejs index dcc65ab7..be304791 100644 --- a/html/map.ejs +++ b/html/map.ejs @@ -44,40 +44,6 @@ //--> - + diff --git a/html/poketube.ejs b/html/poketube.ejs index defa0967..71e74f3b 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1,397 +1,374 @@ <% try { %> -<% if (!isMobile) { %> +<% if (!isMobile) { %> + HEYOOOOOOOOOO!!!!!! + + poketube is the privacy first youtube front end ! fell free to pull request on codeberg.org! + + if you want to host an instance, see README.md + + license below: + + This Source Code Form is subject to the terms of the GNU General Public License: + + Copyright (C) 2021-2024 POKETUBE (https://codeberg.org/Ashley/poketube) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see https://www.gnu.org/licenses/. + +--> -<% if(secure) { %> -<% } %><% if(!secure) { %> -<% } %> - - +<% if(secure) { %><% } %><% if(!secure) { %><% } %> + + - - <% if (e === false) { %> - - <% } %> + <% if (e === false) { %> + + <% } %> <% if (!e) { %> - - - - - - - - - - <% } %> - - - - - <%=inv_vid.title%> | PokeTube - +@keyframes spin { + to { + transform: rotate(360deg); + } +} + + @@ -400,3401 +377,2923 @@ - <% if (k.Video.Channel.Name == "7clouds") { %> - - <% } %> +<% if (k.Video.Channel.Name == "7clouds") { %> + + <% } %> - - - + + + - <% if (inv_vid.videoId == "QrGrOK8oZG8") { %> + <% if (inv_vid.videoId == "QrGrOK8oZG8") { %> - - <% } %> + + <% } %> + + + + <% if(IsOldWindows) { %> + + + <% } %> + + + + - - <% } %> - - - - - <% if(shortsui) { %> - - <% } %> + // Append the style element to the document head + document.head.appendChild(styleElement); + } - <% if (inv_vid.author.endsWith(' - Topic')) { %> - + <% } %> - // Create a style element and set its content - const styleElement = document.createElement('style'); - styleElement.innerHTML = styles; + <% if (inv_vid.author.endsWith(' - Topic')) { %> + - <% } %> - <% if(dm) { %> + // Create a style element and set its content + const styleElement = document.createElement('style'); + styleElement.innerHTML = styles; + // Append the style element to the document head + document.head.appendChild(styleElement); + } - - <% } %> - - - - - - - - - - - - - -
-
-
-
-
- - - + + +
+ +
+ -
-
-
- <% if (k.Video.Channel.Name == "7clouds") { %> -
<% if (k.Video.Channel.Name !== "7clouds") { %>
<% if (inv_vid?.title !== k.Video.Title) { %> title="Non-Translated title : <%=inv_vid.title%>" - <% } %>> - <%-k.Video.Title.replace(/\/channel\//g, "/channel?id=").replace(/https:\/\/youtube.com/g, ""); %> - - -
- - <% if (inv_vid.genre === "Music") { %> - -
 Lossless
- <% } %> - - <% if (inv_vid.genre !== "Music") { %> - - Jump to - Connections - <% } %> - -
- - - - " %>"> - -
-
- <%=k.Video.Channel.Name%> - - <% if (inv_vid?.authorVerified) { %> -
- - -
- - <% } %> -
- - -
- <%= k.Video.Channel.subscriberCount.replace("subscribers", "Subs") %> -
- - -
- - -
- -
-
- - - -
- - -
- - - Download -
-
- - <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %> - <% if (support != undefined) { %> - - - - - - - <% }%> <% }%> - <% }%> - - <% if (support == undefined) { %> - - <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %> - - - - - - <% }%> <% }%> - <% }%> <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - - <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %> - -
- - - WIP! - - - <% }%> - <% }%> - - - - <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('IGNORE_THIS_PLEASE)')) { %> - <% if (inv.comments) { %> - - - <% }%> - <% }%> - <% }%> - - -
- -
-
- -
- -
- - -
- - <%=engagement.viewCount.toLocaleString()%> Views โ€ข <%=date%> โ€ข Click to toggle off description - - - <% if (String(inv_vid.descriptionHtml) != "undefined") { %> - <% if (String(inv_vid.descriptionHtml) != " ") { %> - <% if (String(inv_vid.descriptionHtml) != "

") { %> - -
- - - <%-String(channelurlfixer(inv_vid.descriptionHtml)).replace(/\n/g, "
").replace(/twitter\.com/g, "twitter.com").replace(/reddit\.com/g, "redlib.matthew.science") %> -
- <% } %> <% } %> <% } %> - - <% if (String(inv_vid.descriptionHtml) != "undefined") { %> - <% if (String(inv_vid.descriptionHtml) != " ") { %> - <% if (String(inv_vid.descriptionHtml) == "

") { %> - -
- - - <%-String(linkify(inv_vid.description)).replace(/\n/g, "
").replace(/twitter\.com/g, "twitter.com").replace(/reddit\.com/g, "redlib.matthew.science") %> -
- <% } %> <% } %> <% } %> - - - <% if (String(inv_vid.description) == " ") { %> - -

No Description On this Video ( sad innit :c )

- <% } %> - - - <% if (wiki.extract_html) { %> -
- From da web
- -
- - <%-wiki.extract_html%> - -

- - From wikipedia under CC-BY-SA 3.0 -

- - -

- <% } %> - - - - -
- Metadata And Engagement
- -

- - Views : <%=engagement.viewCount.toLocaleString()%>
- Genre: <%-inv_vid.genre %>
- Date of upload: <%=date%> ^^
-


- Rating : <%=engagement.rating.toLocaleString()%> - (<%=engagement.dislikes.toLocaleString()%>/<%=engagement.likes.toLocaleString()%> LTDR) -
- RYD date created : <%=engagement.dateCreated.toLocaleString()%>
- See in json - - - - - - - - - <% if (Array.isArray(inv_vid?.keywords)) { %> - -
- Tags
-
- - <% inv_vid?.keywords.forEach(x => { %> - - - <% }) %> -
- - - <% } %> - - - -
- - - <% if (inv_vid.genre === "Gaming") { %> - -
-
- Poke! Games Hub
- Snake - - Tic Tac Toe - - Sudoku - - Ping Pong - - -
- <% } %> - -
- -
- Connections
- - <% if (!twitter) { %> - <% if (!discord) { %> - <% if (!reddit) { %> - <% if (!twitch) { %> - - <% if (!instagram) { %> -
- Nyo connections found on the description ;_; - report a issue lol -
- <% } %> - <% } %> - <% } %> - - <% } %> <% } %> - - -
- <% if (twitter) { %> - - <% } %> - - <% if (discord) { %> - - <% } %> - - - <% if (twitch) { %> - - <% } %> - - - <% if (reddit) { %> - - <% } %> - - <% if (instagram) { %> - - <% } %> -
- -
- -

- - -
- - - -
- - -
- - -
-
- - -
- - <%=convert(engagement.likes)%> -
-
- <%=convert(engagement.dislikes)%> -
-
- - - Download - + + <% if (isvidious) { %> + <% if (!qua) { %> + + Open video in new tab + + + <% } %> + + <% if (qua === "medium") { %> + + + Open video in new tab + + + <% } %> + <% } %> + + <% if (!isvidious) { %> + + <% if (!qua) { %> + + Open video in new tab + - <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> - <% if (!inv_vid.title.endsWith('Audio)')) { %> + <% } %> - - - Encryption - - <% }%><% }%> - - <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - - <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - - - Open In Music Player - - - <% }%> - <% }%> - -
+ <% if (qua === "medium") { %> + + Open video in new tab + + <% } %> + <% } %>
- -
- -
- -
- -
- - <% if(inv.error) { %> -

- <%- inv.error %>
Backtrace:
- - <%- inv.errorBacktrace %> - - Report this issue -

- <% } %> - - - <% if (inv.comments) { %> -
- -
- -
-
- YouTube Comments - - <% if (!isNaN(inv.commentCount)) { %> <%= inv.commentCount.toLocaleString() %> <% } else { %> 0 - <% } %> Comments -
- -

- Top Comments of this video!! :3 -

- +
+ Loop Video
- <% inv.comments.forEach(x =>{ %>
-
-
-
-
-
-
-
"> -
<% if (!x.authorIsChannelOwner) { %>

<%- x.author%><% if (x.verified) { %><% } %>

- <%- x.publishedText %>

<% } %><% if (x.authorIsChannelOwner) { %>

<%- x.author%><% if (x.verified) { %><% } %>

- <%- x.publishedText %>

<% } %> -
-

- <%- x.contentHtml %>

<% if (x.likeCount === 0) { %> | <% } else { %> - <%= convert(x.likeCount) %> | <% } %><% if(x.creatorHeart) { %> <% } %> -

-
-
-
-
-
<% }) %> -
- Go To Top -
-
- -
- - - <% } %> - - - <% if(!inv.comments) { %> -
- - <% } %> - - - <% if(inv.comments) { %> -
- - <% } %> - - - - - + <% if(secure) { %> + + + <% } %> + + + + + + <% } %> + <% if (isMobile) { %> + <% if (isMobile) { %> + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see https://www.gnu.org/licenses/. +--> - -<% if (e === false) { %> - - -<% } %> -<% if (!e) { %> + + <% if (e === false) { %> + + <% } %> + <% if (!e) { %> - + -<% } %> - + <% } %> <%=inv_vid.title%> | PokeTube Mobile - - - + + + -/https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css rel=stylesheet> + /https://site-assets.fontawesome.com/releases/v6.1.1/css/all.css rel=stylesheet> + + <% if (Array.isArray( !inv.comments)) { %> -<% if (Array.isArray( !inv.comments)) { %> + + + <% } %> - margin-top: -14.9em; + - -<% } %> - - - - - - -
- -
-
-
- <% if (lightOrDark(color) == "dark") { %> - -
-
-
- -
- - <% if (!qua) { %> - - - <% } %> - <% if (qua) { %> - - - <% } %> + + + +
+ +
+
+
-
+