/home/techb158/trello.abdallabala.com/public
Edit: /home/techb158/trello.abdallabala.com/public/settings.js (1017B)
import { canWriteBoard, powerUpOptions } from './client-utils.js';
const t = window.TrelloPowerUp.iframe(powerUpOptions());
const form = document.getElementById('settings');
const apiBaseUrl = document.getElementById('apiBaseUrl');
const defaultTypology = document.getElementById('defaultTypology');
async function load() {
const settings = await t.get('board', 'shared', 'cosmicSettings');
apiBaseUrl.value = settings?.apiBaseUrl || window.COSMIC_API_BASE || window.location.origin;
defaultTypology.value = settings?.defaultTypology || 'ai_enabler';
}
form.addEventListener('submit', async (event) => {
event.preventDefault();
const writable = await canWriteBoard(t);
if (!writable) {
alert('You do not have permission to change board settings.');
return;
}
await t.set('board', 'shared', 'cosmicSettings', {
apiBaseUrl: apiBaseUrl.value.trim() || window.COSMIC_API_BASE || window.location.origin,
defaultTypology: defaultTypology.value
});
t.closePopup();
});
t.render(load);