Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmart committed Apr 17, 2024
1 parent f7dbe11 commit 55bf937
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
18 changes: 9 additions & 9 deletions _static/coalitions_demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ openPopup = function (content, type) {
popupFull.classList = 'success';
popupTitle.innerHTML = 'Success';
}
popupFull.classList.add('show');
popupFull.classList.add('show');
}


Expand Down Expand Up @@ -144,7 +144,7 @@ function updatePayoffsCoalitions() {
let results = computePayoffs(choices);

for (let i = 0; i < numPlayers; i++) {
let cell = document.getElementById(`payoff-${i+1}`);
let cell = document.getElementById(`payoff-${i + 1}`);
if (results.members[i] === true) {
cell.style.color = 'green';
cell.style.fontWeight = 'bold';
Expand Down Expand Up @@ -192,14 +192,14 @@ function updatePayoffsPreferred() {
let results = computePayoffs(preferredOffers)

for (let i = 0; i < numPlayers; i++) {
let preferred = document.getElementById(`preferred-${i+1}`);
let preferred = document.getElementById(`preferred-${i + 1}`);
if (preferredOffers[i] == 0) {
preferred.innerHTML = '—';
} else {
preferred.innerHTML = preferredOffers[i];
}

let payoff = document.getElementById(`payoff-${i+1}-preferred`);
let payoff = document.getElementById(`payoff-${i + 1}-preferred`);
if (results.members[i] === true) {
payoff.style.color = 'green';
payoff.style.fontWeight = 'bold';
Expand Down Expand Up @@ -291,7 +291,7 @@ function acceptTask(element) {
}
}

document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
// Setup
let thisPlayerHeaders = document.getElementsByClassName(`player-${js_vars.my_id}`);
for (let i = 0; i < thisPlayerHeaders.length; i++) {
Expand All @@ -306,10 +306,10 @@ document.addEventListener("DOMContentLoaded", function() {
next_buttons[i].style.visibility = 'hidden';
}

$('html').bind('keypress', function(e) {
if(e.keyCode === 13 || e.key == 'Enter') {
return false;
$('html').bind('keypress', function (e) {
if (e.keyCode === 13 || e.key == 'Enter') {
return false;
}
});
});

})
14 changes: 7 additions & 7 deletions _static/proposal_demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let popupFull = document.getElementById('popup-full');
let popupTitle = document.getElementById('popup-title');
let popupContent = document.getElementById('popup-content');

let tasks ={
let tasks = {
"grand-coalition": false,
"sub-coalition": false,
"efficient": false,
Expand Down Expand Up @@ -51,7 +51,7 @@ openPopup = function (content, type) {
popupFull.classList = 'success';
popupTitle.innerHTML = 'Success';
}
popupFull.classList.add('show');
popupFull.classList.add('show');
}

for (let i = 0; i < numPlayers; i++) {
Expand Down Expand Up @@ -225,7 +225,7 @@ function acceptTask(element) {
}
}

document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function () {
// Setup
let thisPlayerHeaders = document.getElementsByClassName(`player-${js_vars.my_id}`);
for (let i = 0; i < thisPlayerHeaders.length; i++) {
Expand Down Expand Up @@ -294,10 +294,10 @@ document.addEventListener("DOMContentLoaded", function() {
next_buttons[i].style.visibility = 'hidden';
}

$('html').bind('keypress', function(e) {
if(e.keyCode === 13 || e.key == 'Enter') {
return false;
$('html').bind('keypress', function (e) {
if (e.keyCode === 13 || e.key == 'Enter') {
return false;
}
});
});

})
6 changes: 3 additions & 3 deletions _static/questions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$('input').bind('keypress', function(e) {
if(e.keyCode === 13 || e.key == 'Enter') {
return false;
$('input').bind('keypress', function (e) {
if (e.keyCode === 13 || e.key == 'Enter') {
return false;
}
});

0 comments on commit 55bf937

Please sign in to comment.