greekbuilding names ,live synch button ,market capacity
This commit is contained in:
@@ -223,3 +223,28 @@ window.dismissCaptchaBanner = function() {
|
||||
banner.dataset.dismissed = '1';
|
||||
}
|
||||
};
|
||||
|
||||
window.requestLiveSync = async function() {
|
||||
const btn = document.getElementById('live-btn');
|
||||
const originalText = btn.textContent;
|
||||
btn.textContent = '⏳ Requesting...';
|
||||
btn.disabled = true;
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/sync-request?player_id=' + window.PLAYER_ID, { method: 'POST' });
|
||||
const data = await res.json();
|
||||
if (data.ok) {
|
||||
btn.textContent = '✅ Requested!';
|
||||
setTimeout(() => {
|
||||
btn.textContent = originalText;
|
||||
btn.disabled = false;
|
||||
}, 5000);
|
||||
}
|
||||
} catch (e) {
|
||||
btn.textContent = '❌ Failed';
|
||||
setTimeout(() => {
|
||||
btn.textContent = originalText;
|
||||
btn.disabled = false;
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user