js/myaction.js
/* Get the list of useractions with no CompleteTime timestamps and appends
them to the page. Also resets the action arrays. */
Get the list of useractions with no CompleteTime timestamps and appends
them to the page. Also resets the action arrays.
Get the list of useractions with no CompleteTime timestamps and appends them to the page . Also resets the action arrays .
function filter_my_action_table(data) {
    $("#my_action_content").empty();
    $("#score_content").empty();
    myAction = [];
    pointRecord= [];
    categoryRecord=[];
    list=[];
    nameRecord=[];
    sum = 0;
    actionCounter = 0;
    for (action of data) {
        if (action['CompleteTime'] != null)
        {
            continue;
        }
        var userAction = $(
            '<div class="col-lg-4 text-center" style="color:black">'
            + '<div class="panel panel-default" >'
            + '<div class ="challenge_box">'
            + '<div  class ="row">'
            + '<img src="/images/categories/'+ action['Category'] + '.png" alt="" class ="challenge_img">'
            + '<p class ="challenge_name col-sm-7" style="text-align:left;">'+ action['Description'] + '</p>'
            + '<p class ="label label-danger col-sm-3" style="font-size:1em;margin-left:2%;">Points: ' + action['Points'] +'</p>' 
            + '</div>'
            + '<div class ="row">'
            + '<img src="images/check1.svg" height="50px" width="50px" class ="challenge_check" id = "'+ action['ActionID'] + '" onclick="finishAction(\''+ action['ActionID'] + '\')">'
            + '</div>'
            + '<img src="images/hourglass.svg" style="visibility:hidden" height="150px" width="150px">'
            + '<p class="submit-text">Ready to submit!</p>'
            + '</div>'
            + '<p style="font-size:18px;visibility:hidden">Submission Time: </p>'
            + '</div>'
            + '</div>'
        );
        $("#my_action_content").append(userAction)
        myAction[action['ActionID']] = 1;
        list.push(action['ActionID']);
        pointRecord[action['ActionID']] = action['Points'];
        nameRecord[action['ActionID']] = action['Description'];
        categoryRecord[action['ActionID']] = action['Category'];
        actionCounter = actionCounter+1;
        get_num_action();
    }
    check_myAction_status();
    update_my_current_pick();
}
function filter_my_action_table ( data ) { $ ( "#my_action_content" ) . empty ( ) ; $ ( "#score_content" ) . empty ( ) ; myAction = [ ] ; pointRecord = [ ] ; categoryRecord = [ ] ; list = [ ] ; nameRecord = [ ] ; sum = 0 ; actionCounter = 0 ; for ( action of data ) { if ( action [ 'CompleteTime' ] != null ) { continue ; } var userAction = $ ( '<div class="col-lg-4 text-center" style="color:black">' + '<div class="panel panel-default" >' + '<div class ="challenge_box">' + '<div  class ="row">' + '<img src="/images/categories/' + action [ 'Category' ] + '.png" alt="" class ="challenge_img">' + '<p class ="challenge_name col-sm-7" style="text-align:left;">' + action [ 'Description' ] + '</p>' + '<p class ="label label-danger col-sm-3" style="font-size:1em;margin-left:2%;">Points: ' + action [ 'Points' ] + '</p>' + '</div>' + '<div class ="row">' + '<img src="images/check1.svg" height="50px" width="50px" class ="challenge_check" id = "' + action [ 'ActionID' ] + '" onclick="finishAction(\'' + action [ 'ActionID' ] + '\')">' + '</div>' + '<img src="images/hourglass.svg" style="visibility:hidden" height="150px" width="150px">' + '<p class="submit-text">Ready to submit!</p>' + '</div>' + '<p style="font-size:18px;visibility:hidden">Submission Time: </p>' + '</div>' + '</div>' ) ; $ ( "#my_action_content" ) . append ( userAction ) myAction [ action [ 'ActionID' ] ] = 1 ; list . push ( action [ 'ActionID' ] ) ; pointRecord [ action [ 'ActionID' ] ] = action [ 'Points' ] ; nameRecord [ action [ 'ActionID' ] ] = action [ 'Description' ] ; categoryRecord [ action [ 'ActionID' ] ] = action [ 'Category' ] ; actionCounter = actionCounter + 1 ; get_num_action ( ) ; } check_myAction_status ( ) ; update_my_current_pick ( ) ; }
Get the list of useractions with no CompleteTime timestamps and appends
them to the page.
Get the list of useractions with no CompleteTime timestamps and appends them to the page .