fds
This commit is contained in:
parent
b02c6f163b
commit
4be05d92ac
2 changed files with 25 additions and 21 deletions
|
@ -11,8 +11,12 @@ function hide_image() {
|
||||||
|
|
||||||
document.onpaste = function(event) {
|
document.onpaste = function(event) {
|
||||||
files = event.clipboardData.files
|
files = event.clipboardData.files
|
||||||
filename = files[0].name.toLowerCase()
|
|
||||||
|
|
||||||
|
filename = files[0]
|
||||||
|
|
||||||
|
if (filename)
|
||||||
|
{
|
||||||
|
filename = filename.name.toLowerCase()
|
||||||
if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".png") || filename.endsWith(".webp") || filename.endsWith(".gif"))
|
if (filename.endsWith(".jpg") || filename.endsWith(".jpeg") || filename.endsWith(".png") || filename.endsWith(".webp") || filename.endsWith(".gif"))
|
||||||
{
|
{
|
||||||
if (document.activeElement.id == 'post-text') {
|
if (document.activeElement.id == 'post-text') {
|
||||||
|
@ -34,6 +38,7 @@ document.onpaste = function(event) {
|
||||||
localStorage.setItem("post_url", "")
|
localStorage.setItem("post_url", "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('file-upload').addEventListener('change', function(){
|
document.getElementById('file-upload').addEventListener('change', function(){
|
||||||
f=document.getElementById('file-upload');
|
f=document.getElementById('file-upload');
|
||||||
|
@ -71,11 +76,10 @@ function autoSuggestTitle() {
|
||||||
var x = new XMLHttpRequest();
|
var x = new XMLHttpRequest();
|
||||||
x.withCredentials=true;
|
x.withCredentials=true;
|
||||||
x.onreadystatechange = function() {
|
x.onreadystatechange = function() {
|
||||||
if (x.readyState == 4 && x.status == 200) {
|
if (x.readyState == 4 && x.status == 200 && !titleField.value) {
|
||||||
|
|
||||||
title=JSON.parse(x.responseText)["title"];
|
title=JSON.parse(x.responseText)["title"];
|
||||||
titleField.value=title;
|
titleField.value=title;
|
||||||
|
|
||||||
checkForRequired()
|
checkForRequired()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,7 +272,7 @@
|
||||||
|
|
||||||
<script src="/static/assets/js/marked.js?v=248"></script>
|
<script src="/static/assets/js/marked.js?v=248"></script>
|
||||||
<script src="/static/assets/js/formatting.js?v=240"></script>
|
<script src="/static/assets/js/formatting.js?v=240"></script>
|
||||||
<script src="/static/assets/js/submit.js?v=250"></script>
|
<script src="/static/assets/js/submit.js?v=251"></script>
|
||||||
{% include "emoji_modal.html" %}
|
{% include "emoji_modal.html" %}
|
||||||
{% include "gif_modal.html" %}
|
{% include "gif_modal.html" %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue