forked from jan/debianmemberportfolio
add support for automatic DM data lookup
This commit is contained in:
parent
556e254870
commit
e5a73bfe75
3 changed files with 39 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
## -*- coding: utf-8 -*-
|
||||
<%doc>
|
||||
Helper JavaScript for the data input form.
|
||||
Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
|
||||
Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
|
||||
|
||||
This file is part of DDPortfolio service.
|
||||
|
||||
|
@ -21,7 +21,7 @@ License along with this program. If not, see
|
|||
</%doc>
|
||||
|
||||
function updateFields(data, textStatus) {
|
||||
if (data.isdd == 1) {
|
||||
if (data.type == 2) { // DD
|
||||
$('#name').attr('value', data.name).attr('readonly', 'readonly');
|
||||
$('#gpgfp').attr('value', data.gpgfp);
|
||||
$('#username').attr('value', data.username).attr(
|
||||
|
@ -36,6 +36,19 @@ function updateFields(data, textStatus) {
|
|||
$('#aliothusernamefield').show();
|
||||
|
||||
$('#nonddemail').focus().select();
|
||||
} else if (data.type == 1) { // DM
|
||||
$('#name').attr('value', data.name).attr('readonly', 'readonly');
|
||||
$('#gpgfp').attr('value', data.gpgfp);
|
||||
$('#username').attr('value', '');
|
||||
$('#nonddemail').attr('value', data.email).focus();
|
||||
|
||||
$('#namefield').show();
|
||||
$('#gpgfpfield').show();
|
||||
$('#usernamefield').hide();
|
||||
$('#nonddemailfield').hide();
|
||||
$('#aliothusernamefield').show();
|
||||
|
||||
$('#aliothusername').focus().select();
|
||||
} else {
|
||||
$('#nonddemail').attr('value', data.email);
|
||||
$('#name').removeAttr('readonly');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue