forked from rDrama/rDrama
fsd
parent
c2db52737b
commit
eca7f466df
|
@ -1469,7 +1469,7 @@ def get_post_title(v):
|
||||||
url = request.values.get("url")
|
url = request.values.get("url")
|
||||||
if not url: abort(400)
|
if not url: abort(400)
|
||||||
|
|
||||||
try: x = requests.get(url, headers=titleheaders, timeout=5)
|
try: x = requests.get(url, headers=titleheaders, timeout=5, proxies={"http":"http://127.0.0.1:18080","https":"http://127.0.0.1:18080"} )
|
||||||
except: abort(400)
|
except: abort(400)
|
||||||
|
|
||||||
soup = BeautifulSoup(x.content, 'lxml')
|
soup = BeautifulSoup(x.content, 'lxml')
|
||||||
|
|
|
@ -920,4 +920,18 @@
|
||||||
<div id="viewmore-{{offset}}"><button id="viewbtn" class="btn btn-primary" onclick="viewmore({{pid}},'{{sort}}',{{offset}},{{ids}})">VIEW MORE COMMENTS</a></div>
|
<div id="viewmore-{{offset}}"><button id="viewbtn" class="btn btn-primary" onclick="viewmore({{pid}},'{{sort}}',{{offset}},{{ids}})">VIEW MORE COMMENTS</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if not ajax and v and v.theme != 'transparent' %}
|
||||||
|
<script>
|
||||||
|
const color = getComputedStyle(document.body).getPropertyValue('background-color');
|
||||||
|
const markTemplate = (name) => {
|
||||||
|
return `<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='50px' width='100px'><text transform='translate(20, 40) rotate(-45)' fill='${color}' fill-opacity="1" font-size='20'>${name}</text></svg>`;
|
||||||
|
};
|
||||||
|
const base64Mark = btoa(markTemplate("1234"));
|
||||||
|
|
||||||
|
var style = document.createElement('style');
|
||||||
|
style.innerHTML = `#post-text,.comment-text{background-image:url("data:image/svg+xml;base64,${base64Mark}")}`;
|
||||||
|
document.getElementsByTagName('head')[0].appendChild(style);
|
||||||
|
</script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</body>
|
</body>
|
Loading…
Reference in New Issue