Skip to content

Commit

Permalink
REFACTOR: Javascript code run through a beautifier
Browse files Browse the repository at this point in the history
I used http://jsbeautifier.org/ to clean up the code.

I also deleted a few commented-out pieces of code.
  • Loading branch information
timmahrt committed Apr 11, 2017
1 parent 083a630 commit 8dad477
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 235 deletions.
37 changes: 15 additions & 22 deletions html/b-p-scores.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,9 @@ makeWordsVisibleCheckboxes = function(isProminence) {
}

removeCheckboxHandler = function() {
$('input[type=checkbox]').off();
$('input[type=checkbox]').off();
}

//ShowHide = function() {
// $("#" + x).closest("label").css({
// borderRight: "3px solid #000000"
// });
// $("#" + x).closest("label").css({
// paddingRight: "0px"
// });
//}

toggle = function() {
$(this).closest("label").css({
borderRight: this.checked ? "3px solid #000000" : "0px solid #FFFFFF"
Expand All @@ -52,25 +43,27 @@ blah2 = function() {

var didShowHide = false;
ShowHide = function(didAudioPlay, isWithinRange) {
var didPlay = didAudioPlay;
didPlay &= isWithinRange;
var didPlay = didAudioPlay;
didPlay &= isWithinRange;
if (didPlay == true) {
didShowHide = true;
document.getElementById("ShownDiv").style.display = 'none';
document.getElementById("HiddenDiv").style.display = 'block';
document.getElementById("HiddenForm").style.display = 'block';
for (e=0;e<8;e++) {
var x = e+8;
for (e = 0; e < 8; e++) {
var x = e + 8;

if (document.getElementById(e).checked==true) {
if (document.getElementById(e).checked == true) {

$("#" + x).closest("label").css({
borderRight: "3px solid #000000"
});
$("#" + x).closest("label").css({
paddingRight: "0px"
});

$("#"+x).closest("label").css({
borderRight: "3px solid #000000"
});
$("#"+x).closest("label").css({ paddingRight: "0px"});

}
}
}
removeCheckboxHandler();
makeWordsVisibleCheckboxes(true);
}
Expand Down Expand Up @@ -152,7 +145,7 @@ verifySelectedWithinRange = function(min_to_mark, max_to_mark, widgetName, minEr
return returnValue;
}

bpProcessKeyboardPress = function(e,keyID) {
bpProcessKeyboardPress = function(e, keyID) {
if (e.which == keyID) {
if (didShowHide == false) {
document.getElementById("halfwaySubmitButton").click();
Expand Down

0 comments on commit 8dad477

Please sign in to comment.