/**
 * Phoebe pedagogic planner
 *
 * PHP version 5
 *
 * LICENSE: The GNU General Public License (GPL), version 2. See LICENSE.txt
 *
 * Copyright (c) 2006-2008 JISC/HEFCE/University of Oxford
 *
 * @author      David Balch <david.balch@conted.ox.ac.uk>
 * @license     http://opensource.org/licenses/gpl-license.php GPL2
 * @link        http://phoebe-project.conted.ox.ac.uk/
 */
/* Edit design metadata */

$(document).ready(function() {
    // User account small text inputs
    $(".user.editable").editable("/db/setUserData.php", {
        indicator: "Saving...", tooltip: 'Click to edit', onblur: 'submit'
    });
});

function setPref(theInput) {
    //console.log(theInput);
    switch (theInput.type) {
        case 'checkbox':
            if(theInput.checked) {
                newValue = 1;
            } else {
                newValue = 0;
            }
            break;
        case 'radio':
            newValue = theInput.value;
            break;
    }

    newPropId = $.post("/db/setUserData.php", {
        id: theInput.name, value: newValue
    }, function(data) {return data;});
}