forked from rDrama/rDrama
master
parent
add068d6d2
commit
c6edcb97eb
|
@ -263,7 +263,7 @@ def after_request(response):
|
||||||
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
||||||
response.headers.add("Referrer-Policy", "same-origin")
|
response.headers.add("Referrer-Policy", "same-origin")
|
||||||
response.headers.add("Feature-Policy",
|
response.headers.add("Feature-Policy",
|
||||||
"geolocation 'none'; midi 'none'; notifications 'none'; push 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; vibrate 'none'; fullscreen 'none'; payment 'none';")
|
"geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'none'; payment 'none';")
|
||||||
if not request.path.startswith("/embed/"):
|
if not request.path.startswith("/embed/"):
|
||||||
response.headers.add("X-Frame-Options",
|
response.headers.add("X-Frame-Options",
|
||||||
"deny")
|
"deny")
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Image(Base):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path(self):
|
def path(self):
|
||||||
return f"/assets/images/platy.jpg"
|
return f"/assets/images/cover.png"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,6 @@ def sanitize(text, linkgen=False, flair=False):
|
||||||
if not url: continue
|
if not url: continue
|
||||||
netloc = urlparse(url).netloc
|
netloc = urlparse(url).netloc
|
||||||
|
|
||||||
domain = get_domain(netloc)
|
|
||||||
|
|
||||||
if "profile-pic-20" not in tag.get("class", ""):
|
if "profile-pic-20" not in tag.get("class", ""):
|
||||||
#print(tag.get('class'))
|
#print(tag.get('class'))
|
||||||
# set classes and wrap in link
|
# set classes and wrap in link
|
||||||
|
|
|
@ -362,21 +362,6 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.expandable-image').click( function(event) {
|
|
||||||
|
|
||||||
if (event.which != 1) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
var url= $(this).data('url');
|
|
||||||
|
|
||||||
expandDesktopImage(url,url);
|
|
||||||
})
|
|
||||||
|
|
||||||
$('.text-expand').click(function(event){
|
$('.text-expand').click(function(event){
|
||||||
if (event.which != 1) {
|
if (event.which != 1) {
|
||||||
return
|
return
|
||||||
|
@ -468,6 +453,18 @@
|
||||||
|
|
||||||
// Expand Images on Desktop
|
// Expand Images on Desktop
|
||||||
|
|
||||||
|
$('.expandable-image').click( function(event) {
|
||||||
|
|
||||||
|
if (event.which != 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var url= $(this).data('url');
|
||||||
|
|
||||||
|
expandDesktopImage(url,url);
|
||||||
|
})
|
||||||
|
|
||||||
function expandDesktopImage(image, link) {
|
function expandDesktopImage(image, link) {
|
||||||
|
|
||||||
// Link text
|
// Link text
|
||||||
|
@ -484,6 +481,38 @@
|
||||||
linkText.textContent = 'View original';
|
linkText.textContent = 'View original';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Expand Videos on Desktop
|
||||||
|
|
||||||
|
$('.expandable-video').click( function(event) {
|
||||||
|
|
||||||
|
if (event.which != 1) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
var url= $(this).data('url');
|
||||||
|
|
||||||
|
expandDesktopVideo(url,url);
|
||||||
|
})
|
||||||
|
|
||||||
|
function expandDesktopVideo(video, link) {
|
||||||
|
|
||||||
|
// Link text
|
||||||
|
|
||||||
|
var linkText = document.getElementById("desktop-expanded-video-link");
|
||||||
|
var imgLink = document.getElementById("desktop-expanded-video-wrap-link");
|
||||||
|
|
||||||
|
var inlineVideo = document.getElementById("desktop-expanded-video");
|
||||||
|
|
||||||
|
inlineVideo.src = Video.replace("100w.gif", "giphy.gif");
|
||||||
|
linkText.href = Video;
|
||||||
|
imgLink.href=Video;
|
||||||
|
|
||||||
|
linkText.textContent = 'View original';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
post_comment=function(fullname){
|
post_comment=function(fullname){
|
||||||
|
|
||||||
|
|
||||||
|
@ -1096,6 +1125,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% include "expanded_image_modal.html" %}
|
{% include "expanded_image_modal.html" %}
|
||||||
|
{% include "expanded_video_modal.html" %}
|
||||||
|
|
||||||
<script src="/assets/js/all_js.js"></script>
|
<script src="/assets/js/all_js.js"></script>
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,7 @@ We also have some custom hooks for mentioning users and subreddits. Note that th
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% include "expanded_image_modal.html" %}
|
{% include "expanded_image_modal.html" %}
|
||||||
|
{% include "expanded_video_modal.html" %}
|
||||||
|
|
||||||
<script src="/assets/js/all_js.js"></script>
|
<script src="/assets/js/all_js.js"></script>
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,10 @@
|
||||||
<a href="javascript:void(0)" rel="nofollow noopener" class="expandable-image" data-toggle="modal" data-target="#expandImageModal" data-url="{{p.realurl(v)}}">
|
<a href="javascript:void(0)" rel="nofollow noopener" class="expandable-image" data-toggle="modal" data-target="#expandImageModal" data-url="{{p.realurl(v)}}">
|
||||||
<img src="{{p.thumb_url}}" class="post-img">
|
<img src="{{p.thumb_url}}" class="post-img">
|
||||||
</a>
|
</a>
|
||||||
|
{% elif "streamable.com" in p.url %}
|
||||||
|
<a href="javascript:void(0)" rel="nofollow noopener" class="expandable-video" data-toggle="modal" data-target="#expandVideoModal" data-url="{{p.realurl(v)}}">
|
||||||
|
<img src="{{p.thumb_url}}" class="post-img">
|
||||||
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a {% if v and v.newtabexternal %}target="_blank"{% endif %} href="{{p.realurl(v)}}" rel="nofollow noopener">
|
<a {% if v and v.newtabexternal %}target="_blank"{% endif %} href="{{p.realurl(v)}}" rel="nofollow noopener">
|
||||||
<img src="{{p.thumb_url}}" class="post-img">
|
<img src="{{p.thumb_url}}" class="post-img">
|
||||||
|
|
Loading…
Reference in New Issue