app/static/scripts/globalScripts.js
// used to update the current properties of people in a relation entry
used to update the current properties of people in a relation entry
used to update the current properties of people in a relation entry
function create_relationship(relation_entry_object) {
    switch(relation_entry_object.relation_type) {
        case 0: 
                var parent = person_from_id(relation_entry_object.person_a_id);
                var child = person_from_id(relation_entry_object.person_b_id);
                parent.add_child(child);
                child.add_parent(parent);
            break;
        case 1: 
                var child_a = person_from_id(relation_entry_object.person_a_id);
                var child_b = person_from_id(relation_entry_object.person_b_id);
                child_a.add_sibling(child_b);
                child_b.add_sibling(child_a);
            break;
        case 2: 
                var parent_a = person_from_id(relation_entry_object.person_a_id);
                var parent_b = person_from_id(relation_entry_object.person_a_id);
                parent_a.add_partner(parent_b);
                parent_b.add_partner(parent_a);
            break;
        default:
            console.log('relation type = ', relation_entry_object.relation_type);
            throw "Relation Type Out of Bounds";
    }
}
function create_relationship ( relation_entry_object ) { switch ( relation_entry_object . relation_type ) { case 0 : var parent = person_from_id ( relation_entry_object . person_a_id ) ; var child = person_from_id ( relation_entry_object . person_b_id ) ; parent . add_child ( child ) ; child . add_parent ( parent ) ; break ; case 1 : var child_a = person_from_id ( relation_entry_object . person_a_id ) ; var child_b = person_from_id ( relation_entry_object . person_b_id ) ; child_a . add_sibling ( child_b ) ; child_b . add_sibling ( child_a ) ; break ; case 2 : var parent_a = person_from_id ( relation_entry_object . person_a_id ) ; var parent_b = person_from_id ( relation_entry_object . person_a_id ) ; parent_a . add_partner ( parent_b ) ; parent_b . add_partner ( parent_a ) ; break ; default : console . log ( 'relation type = ' , relation_entry_object . relation_type ) ; throw "Relation Type Out of Bounds" ; } }
used to update the current properties of people in a relation entry
used to update the current properties of people in a relation entry
//console.log('creating relationship', relation_entry_object); // PERSON A IS ALWAYS THE PARENT // parent to child // child to child // parent to parent