mirror of
https://github.com/Nathanwoodburn/hnschat-web.git
synced 2025-04-13 19:58:15 +10:00
fix: Use dynamically generated upload url
This commit is contained in:
parent
282e54e4e2
commit
be885c3f65
@ -1352,7 +1352,7 @@ export class HNSChat {
|
|||||||
async upload(data, attachment) {
|
async upload(data, attachment) {
|
||||||
let output = new Promise(resolve => {
|
let output = new Promise(resolve => {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "https://hns.chat/upload",
|
url: `${window.location.origin}/upload`,
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: data,
|
data: data,
|
||||||
cache: false,
|
cache: false,
|
||||||
|
@ -1680,6 +1680,7 @@ export class ui {
|
|||||||
switch (url.host) {
|
switch (url.host) {
|
||||||
case "hns.chat":
|
case "hns.chat":
|
||||||
case "hnschat":
|
case "hnschat":
|
||||||
|
case window.location.host:
|
||||||
match = url.pathname.match(/^(\/uploads\/.{32}|\/avatar\/.{16})$/);
|
match = url.pathname.match(/^(\/uploads\/.{32}|\/avatar\/.{16})$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
return "image";
|
return "image";
|
||||||
|
16
index.php
16
index.php
@ -9,20 +9,4 @@
|
|||||||
<?php
|
<?php
|
||||||
include "etc/page/chat.php";
|
include "etc/page/chat.php";
|
||||||
?>
|
?>
|
||||||
<script>
|
|
||||||
var _paq = window._paq = window._paq || [];
|
|
||||||
_paq.push(["setCookieDomain", "*.hns.chat"]);
|
|
||||||
_paq.push(["setDomains", ["*.hns.chat","*.hnschat"]]);
|
|
||||||
_paq.push(['trackPageView']);
|
|
||||||
_paq.push(['enableLinkTracking']);
|
|
||||||
(function() {
|
|
||||||
var u="https://35k1m0.com/trkr/";
|
|
||||||
_paq.push(['setTrackerUrl', u+'trkr.php']);
|
|
||||||
_paq.push(['setSiteId', '13']);
|
|
||||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
|
||||||
g.async=true; g.src=u+'trkr.js'; s.parentNode.insertBefore(g,s);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<noscript><p><img src="https://35k1m0.com/trkr/trkr.php?idsite=13&rec=1" style="border:0;" alt="" /></p></noscript>
|
|
||||||
<script async src="https://trkr.35k1m0.com/script.js" data-website-id="38ec710a-a492-4465-a2ba-292eb4b645a5"></script>
|
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user