From e10c219040d38af4cb2a50c52bc2fb3719c9bf22 Mon Sep 17 00:00:00 2001 From: Jonas Leder <jonas@jonasled.de> Date: Mon, 28 Feb 2022 18:12:30 +0100 Subject: [PATCH] remove jquery --- app/templates/editEntries.html | 24 ------------------------ app/userprofile.py | 2 +- 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/app/templates/editEntries.html b/app/templates/editEntries.html index d787bcb..d8ed0e6 100644 --- a/app/templates/editEntries.html +++ b/app/templates/editEntries.html @@ -1,7 +1,6 @@ <!DOCTYPE html> <html lang="en"> <head> - <link href="/static/jquery-ui.css" rel="stylesheet"> <link href="/static/style.css" rel="stylesheet"> <link href="/static/font.css" rel="stylesheet"> <link href="/static/darkmode.css" rel="stylesheet"> @@ -20,30 +19,7 @@ <p><a href="/user/api"><button id="small">API</button></a>	<a href="/"><button id="small">home</button></a></p> </div> </div> - <!-- ui-dialog --> - <div id="dialog" title="QRCODE"> - <img id="dialogContent" src=""> - </div> - - <script src="/static/external/jquery/jquery.js"></script> - <script src="/static/jquery-ui.js"></script> <script> - $( "#dialog" ).dialog({ - autoOpen: false - }); - - function buttonListener(value){ - value = "/user/makeqr" - $.post(value, {link: value} , function(data, status){ - document.getElementById("dialogContent").src = data; - $( "#dialog" ).dialog( "open" ); - setTimeout(function(){ - $('#dialog').dialog({width: document.getElementById("dialogContent").width + 37}); - }, 1); - - }); - } - function deleteLink(link, elementId) { if(confirm("Do you realy wan't to delete this")){ var xhttp = new XMLHttpRequest(); diff --git a/app/userprofile.py b/app/userprofile.py index 9f2496c..2a91593 100644 --- a/app/userprofile.py +++ b/app/userprofile.py @@ -33,7 +33,7 @@ def userProfile(request, cookieNotice, s, pageNumber, url_scheme): calls = str(cursor2.execute('SELECT CALLS FROM ANALYTICS WHERE SHORT_URL=?', [entries[1]]).fetchone()[0]) except: calls = "0" - response = response + "<tr id=tr_" + str(idCounter) + ">\n<td>" + entries[0] + "</td>\n<td><a href=\"" + url_scheme + "://" + entries[1] + '">' + entries[1] + '</a></td>\n<td>' + calls + '</td>\n<td><a id="red" href="javascript:deleteLink(\'' + escape(entries[1].replace("'", "\\'")) + '\', \'tr_' + str(idCounter) + '\')">delete</a> <a href="#" id="dialog-link" onclick="buttonListener(\'' + entries[1] + '\', this)">QR</a></tr>\n' + response = response + "<tr id=tr_" + str(idCounter) + ">\n<td>" + entries[0] + "</td>\n<td><a href=\"" + url_scheme + "://" + entries[1] + '">' + entries[1] + '</a></td>\n<td>' + calls + '</td>\n<td><a id="red" href="javascript:deleteLink(\'' + escape(entries[1].replace("'", "\\'")) + '\', \'tr_' + str(idCounter) + '\')">delete</a></tr>\n' idCounter=idCounter+1 response = response + "</table>" #Close the table -- GitLab