From fc9a4ea22eb91757b95cbe1bf1708be17fc2337a Mon Sep 17 00:00:00 2001 From: yo momma Date: Tue, 27 Jan 2026 03:33:16 +0000 Subject: Fix HTTPS/mixed content; make config env-driven - Replace hardcoded dump.fm URLs with host/scheme config\n- Add optional passwordless login flow\n- Update templates/static assets to avoid blocked HTTP resources\n- Ignore local uploads/SQL dumps --- static/js/pichat-old.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'static/js/pichat-old.js') diff --git a/static/js/pichat-old.js b/static/js/pichat-old.js index 6eb5553..ba2d89e 100755 --- a/static/js/pichat-old.js +++ b/static/js/pichat-old.js @@ -8,7 +8,7 @@ return cookieValue;}}; // The root domain is used so that subdomains don't result in // spurious extra urls (e.g. both dump.fm/nick and sub.dump.fm/nick) var RootDomain = location.href.match(/http:\/\/(\w)+\./) - ? 'http://dump.fm/' : '/'; + ? '/' : '/'; var cache = {}; var PendingMessages = {}; @@ -653,7 +653,7 @@ console.log("update ui"); var onError = function(resp, textStatus, errorThrown) { var msg = $.trim(resp.responseText); if (msg == "UNKNOWN_ROOM") - location.href = "http://dump.fm"; + location.href = "/"; if (IsAdmin && window.console) { console.error(resp, textStatus, errorThrown); } @@ -1127,7 +1127,7 @@ function getMessageInfo(e){ var message = $(e).parents(".dump") var id = message.attr("id").substr(8) // cut "message-001" to "001" var nick = message.attr("nick") - var link = "http://dump.fm/p/" + nick + "/" + id + var link = "/p/" + nick + "/" + id var content = message.find(".linkify") if (!content.length) content = message.find(".content") var rawContent = content.html() @@ -1144,7 +1144,7 @@ Share = { }, "facebook": function(button){ var message = getMessageInfo(button) - var url = "http://www.facebook.com/share.php?u=" + message.img + "&t=" + message.via + var url = "https://www.facebook.com/share.php?u=" + message.img + "&t=" + message.via Share.openLink(url) }, "tumblr": function(button){ @@ -1504,7 +1504,7 @@ var Search = { }, 'doAjax': function(term) { - if (Domain == "http://dump.fm") { + if (Domain == "/") { $.ajax({ "dataType": "json", "url": "/cmd/search/" + term, @@ -1514,7 +1514,7 @@ var Search = { }) } else { // search main site via jsonp $("#search-script").remove() - $("head").append("") + $("head").append("") } }, @@ -1549,7 +1549,7 @@ var Search = { results.forEach(function(r){ var url = r.url if (url.charAt(0) == '/') - url = 'http://dump.fm/images' + url + url = '/images' + url else url = 'http://' + url urls.push(url) @@ -1787,7 +1787,7 @@ function initChatMsgs() { var zoomlink = $('') .attr({'href': img.attr('src') }) .addClass('msg-image-zoom') - .append($('').attr('src', 'http://dump.fm/static/img/zoom.gif') + .append($('').attr('src', '/static/img/zoom.gif') .addClass('zoom-icon')) .click(function() { window.open(img.attr('src')); return false; }); $(this).append(zoomlink); -- cgit v1.2.3-70-g09d2