Skip to content
This repository was archived by the owner on Mar 8, 2026. It is now read-only.

Commit 073ebb5

Browse files
committed
html, css changes, made settings functional
1 parent 5310fbd commit 073ebb5

15 files changed

Lines changed: 53 additions & 30 deletions

src/back/api/sendingFile.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33

44
from src.back.system.history import History as his
5+
from src.back.system.settings import Settings
56

67
# main reason why this is here:
78
# 1. catbox for some reason need this
@@ -24,7 +25,8 @@ def catbox(file_path):
2425
if response.status_code == 200:
2526
result = response.text.strip()
2627
if result:
27-
his().storeHistory("catbox", os.path.basename(file_path), result, "")
28+
if Settings().readSet._history():
29+
his().storeHistory("catbox", os.path.basename(file_path), result, "")
2830
return result
2931
return "Error: Server returned empty response."
3032
return f"Server Error: {response.status_code}"
@@ -43,7 +45,8 @@ def litterbox(file_path, duration="1h"):
4345
if response.status_code == 200:
4446
result = response.text.strip()
4547
if result:
46-
his().storeHistory("litterbox", os.path.basename(file_path), result, duration)
48+
if Settings().readSet._history():
49+
his().storeHistory("litterbox", os.path.basename(file_path), result, duration)
4750
return result
4851
return "Error: Server returned empty response."
4952
return f"Server Error: {response.status_code}"
@@ -61,7 +64,8 @@ def buzzheavier(file_path):
6164
data = response.json()
6265
fileID = data.get("data", {}).get("id")
6366
if fileID:
64-
his().storeHistory("buzzheavier", filename, f"https://buzzheavier.com/{fileID}", "")
67+
if Settings().readSet._history():
68+
his().storeHistory("buzzheavier", filename, f"https://buzzheavier.com/{fileID}", "")
6569
return f"https://buzzheavier.com/{fileID}"
6670
return "Error: Could not find file ID in response."
6771
return f"Server Error: {response.status_code}"

src/back/system/contact.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def pickFile(self):
2121

2222
def uploadTo(self, path, platform, duration="1h"):
2323
filename = os.path.basename(path)
24-
notify("Upload Started", f"Sending {filename} to {platform}...")
24+
25+
if Settings().readSet._notifyYou():
26+
notify("Upload Started", f"Sending {filename} to {platform}...")
2527

2628
result = ""
2729
if platform == "catbox":
@@ -34,13 +36,19 @@ def uploadTo(self, path, platform, duration="1h"):
3436
result = "Unknown platform"
3537

3638
if result.startswith("http"):
37-
notify("Upload Success!", f"Link: {result}")
39+
if Settings().readSet._notifyYou():
40+
notify("Upload Success!", f"Link: {result}")
3841
else:
39-
notify("Upload Failed", f"Problem with {platform}: {result}")
42+
if Settings().readSet._notifyYou():
43+
notify("Upload Failed", f"Problem with {platform}: {result}")
4044

4145
return result
4246

4347
def checkForUpdates(self):
48+
if not Settings().readSet._checkForUpdates():
49+
print.debug("Updates disabled by user.")
50+
return {"status": "disabled"}
51+
4452
# checks if the local file exists
4553
try:
4654
if getattr(sys, 'frozen', False):

src/front/main/css/popupStyle.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,9 @@
6464

6565
.secondary {
6666
margin-top: 20px !important;
67+
}
68+
69+
.headerText {
70+
font-weight: bold;
71+
font-size: 25px;
6772
}

src/front/main/index.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@
3232
}
3333
}
3434

35-
window.addEventListener('DOMContentLoaded', () => {
36-
loadPopups().then(() => {
37-
checkUpdates(); // Call this AFTER popups are loaded
38-
});
35+
window.addEventListener('DOMContentLoaded', async () => {
36+
await loadPopups();
37+
if (window.pywebview) {
38+
checkUpdates();
39+
} else {
40+
window.addEventListener('pywebviewready', checkUpdates);
41+
}
3942
});
4043

4144
async function chooseFile() {
@@ -224,7 +227,6 @@
224227
}
225228
}
226229

227-
// I don't even wanna explain how this works dude
228230
async function checkUpdates() {
229231
try {
230232
const result = await window.pywebview.api.checkForUpdates();
@@ -243,15 +245,15 @@
243245
showPopup('newUpdateAvailablePopup');
244246
}
245247
} catch (e) {
246-
console.error("Javascript failed to call update check:", e);
248+
console.error("Failed to check for updates:", e);
247249
}
248250
}
249251

250252
async function currentLocalVersion() {
251253
try {
252254
const result = await window.pywebview.api.localCurrentVersion();
253255
const versionText = document.getElementById('localCurrentVersion');
254-
if (versionText) {
256+
if (versionText && result) {
255257
versionText.innerText = `Current Local Version: ${result}`;
256258
}
257259
} catch (e) {

src/front/main/popup/credits.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<div id="creditsPopup" class="popup-overlay" onclick="if(event.target == this) closePopup('creditsPopup')">
22
<div class="popup-content">
33
<div class="overflow" style="height: 375px;">
4-
<h2>Credits</h2>
4+
<span class="headerText" style="padding-bottom: 10px;">Credits</span> <br/>
55

66
<a href="https://codedave.pages.dev/" target="_blank">
77
<div class="item">
88
<img src="https://codedave.pages.dev/assets/misc/Daveberry%20Wave.png" width="50" height="50" alt="Daveberry"/>
99

1010
<div class="info">
1111
<span class="bigText">Daveberry</span> <br/>
12-
<span class="role"> Lead Dev </span> <br/>
12+
<span class="role"> Lead Developer </span> <br/>
1313
<span> The guy who did everything in this native app </span>
1414
</div>
1515
</div>
@@ -21,13 +21,13 @@ <h2>Credits</h2>
2121

2222
<div class="info">
2323
<span class="bigText">Runyra</span> <br/>
24-
<span class="role"> Lead Dev </span> <br/>
24+
<span class="role"> Lead Developer </span> <br/>
2525
<span> Basically nothing, but working on the Vencord/Equicord plugin in discord.</span>
2626
</div>
2727
</div>
2828
</a>
2929

30-
<h2 style="padding-top: 10px;">Service Providers</h2>
30+
<span class="headerText" style="padding-top: 10px; padding-bottom: 10px;">Service Providers</span> <br/>
3131

3232
<a href="https://catbox.moe/" target="_blank">
3333
<div class="item">

src/front/main/popup/extra/limiter/catbox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="catboxLimiterPopup" class="popup-overlay" onclick="if(event.target == this) closePopup('catboxLimiterPopup')">
22
<div class="popup-content">
3-
<h3>File too big for Catbox!</h3>
3+
<span class="headerText" style="padding-bottom: 10px;">File too big for Catbox!</span> <br/>
44
<p>Limit: 200MB</p>
55
<div class="button secondary" onclick="closePopup('catboxLimiterPopup')">Cancel</div>
66
</div>

src/front/main/popup/extra/limiter/litterbox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="litterboxLimiterPopup" class="popup-overlay" onclick="if(event.target == this) closePopup('litterboxLimiterPopup')">
22
<div class="popup-content">
3-
<h3>File too big for Litterbox!</h3>
3+
<span class="headerText" style="padding-bottom: 10px;">File too big for Litterbox!</span> <br/>
44
<p>Limit: 1GB</p>
55
<div class="button secondary" onclick="closePopup('litterboxLimiterPopup')">Cancel</div>
66
</div>

src/front/main/popup/extra/litterboxTime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="litterboxTimePopup" class="popup-overlay" onclick="if(event.target == this) closePopup('litterboxTimePopup')">
22
<div class="popup-content">
3-
<h3>Expire After...</h3>
3+
<span class="headerText" style="padding-bottom: 10px;">Expire After...</span> <br/>
44
<div class="button" onclick="litterBoxExpire('1 Hours')">1 Hour</div>
55
<div class="button" onclick="litterBoxExpire('12 Hours')">12 Hours</div>
66
<div class="button" onclick="litterBoxExpire('24 Hours')">24 Hours</div>

src/front/main/popup/extra/sendTo-Fallback.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="fallbackPopup" class="popup-overlay" onclick="if(event.target == this) closePopup('fallbackPopup')">
22
<div class="popup-content">
3-
<h3>Please select a file!</h3>
3+
<span class="headerText" style="padding-bottom: 10px;">Please select a file!</span> <br/>
44
<p>You can't upload a file if you don't select one. That would turn a n͇̹̩͔͉͉͙̘͊͆̀̔̀̊ų̻̼͇̫̤̼̓̀̚͡l̨̛̬͕̂͊̌͘ͅḷ̶̟̺͉̬̓̒́̂͞͠</p>
55
<div class="button secondary" onclick="closePopup('fallbackPopup')">Close</div>
66
</div>

src/front/main/popup/extra/updaters/failedToFetch.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div id="failedToFetchPopup" class="popup-overlay" onclick="if(event.target == this) closePopup('failedToFetchPopup')">
22
<div class="popup-content">
3-
<h3>Uh oh! Failed to fetch!</h3>
3+
<span class="headerText" style="padding-bottom: 10px;">Uh oh! Failed to fetch!</span> <br/>
44
<p>Something somewhere in the code failed to fetch. Maybe check your connection or is the website down?</p>
55
<p>Let us know if we made a problem at
66
<a href="https://github.com/daveberrys/SendYourFiles/issues" target="_blank">

0 commit comments

Comments
 (0)