$('#open_stemma_add').show();
$('#open_stemma_edit').show();
$('#open_textinfo_edit').show();
+ $('#relatebutton_label').text('View collation and edit relationships');
} else {
$('#open_stemma_add').hide();
$('#open_stemma_edit').hide();
$('#open_textinfo_edit').hide();
+ $('#relatebutton_label').text('View collation and relationships');
}
// Then get and load the actual content.
load_stemma( selectedStemmaID );
// Set up the relationship mapper button
$('#run_relater').attr( 'action', _get_url([ "relation", textid ]) );
+ // Set up the download button
+ $('#dl_tradition').attr( 'href', _get_url([ "download", textid ]) );
+ $('#dl_tradition').attr( 'download', selectedTextInfo.name + '.xml' );
});
}
// Who the owner is
$('#owner_id').empty().append('no one');
if( selectedTextInfo.owner ) {
- $('#owner_id').empty().append( selectedTextInfo.owner );
+ var owneremail = selectedTextInfo.owner;
+ var chop = owneremail.indexOf( '@' );
+ if( chop > -1 ) {
+ owneremail = owneremail.substr( 0, chop + 1 ) + '...';
+ }
+ $('#owner_id').empty().append( owneremail );
}
// Whether or not it is public
$('#not_public').empty();
function file_selected( e ) {
if( e.files.length == 1 ) {
$('#upload_button').button('enable');
+ $('#new_file_name_container').html( '<span id="new_file_name">' + e.files[0].name + '</span>' );
} else {
$('#upload_button').button('disable');
+ $('#new_file_name_container').html( '(Use \'pick file\' to select a tradition file to upload.)' );
}
}
upload_new();
}
},
+ pick_file: {
+ text: 'Pick File',
+ id: 'pick_file_button',
+ click: function() {
+ $('#new_file').click();
+ }
+ },
Cancel: function() {
$('#upload-collation-dialog').dialog('close');
}