Removed some unnecessary HTML code

Displaying it with JavaScript instead
This commit is contained in:
Gergely Polonkai (W00d5t0ck) 2013-02-26 02:18:39 +01:00
parent f72cec984e
commit 4bb7dfadbc
3 changed files with 27 additions and 13 deletions

View File

@ -4,21 +4,20 @@ var passwords_visible = false;
function pwitem_update() {
$('#error').html('');
$('#passwordinfo').html('Fetching...');
$('#passwordinfo').hide();
$('#info').html('Fetching...');
$.post('getpw.php', { id: $(this).attr('id').replace(/^pw_/, '') }, function(pwxml) {
pwinfo = $('result', pwxml);
if (pwinfo.length > 0)
{
$('#passwordinfo').html(
'<ul>' +
'<li>Short description: ' + $('short', pwinfo).text() + '</li>' +
'<li>Long description: ' + $('long', pwinfo).text() + '</li>' +
'<li>Username: ' + $('username', pwinfo).text() + '</li>' +
'<li>Password: ' + $('password', pwinfo).text() + '</li>' +
'<li>Additional information: ' + $('additional', pwinfo).text() + '</li>' +
'</ul>'
);
$('#passwordinfo > ul > li:eq(0) > span').html($('short', pwinfo).text());
$('#passwordinfo > ul > li:eq(1) > span').html($('long', pwinfo).text());
$('#passwordinfo > ul > li:eq(2) > span').html($('username', pwinfo).text());
$('#passwordinfo > ul > li:eq(3) > span').html($('password', pwinfo).text());
$('#passwordinfo > ul > li:eq(4) > span').html($('additional', pwinfo).text());
$('#info').html('');
$('#passwordinfo').show();
}
});
};
@ -78,7 +77,7 @@ $(document).ready(function() {
$('#error').html('');
$('#info').html('');
$('#results').html('');
$('#passwordinfo').html('');
$('#passwordinfo').hide();
$('#query').val('');
if (groups_visible)
{
@ -131,7 +130,7 @@ $(document).ready(function() {
$('#showpasswordgroups').click(function(e) {
$('#passwordgroups').show();
$('#passwords').hide();
$('#passwordinfo').html('');
$('#passwordinfo').hide();
});
});

View File

@ -70,3 +70,7 @@ span.button {
display: none;
}
#passwordinfo {
display: none;
}

View File

@ -73,5 +73,16 @@
</div>
<span id="showpasswordgroups" class="button">Back to password groups</span>
</div>
<div id="passwordinfo"></div>
<div id="passwordinfo">
<ul>
<li><strong>Short description</strong>: <span></span></li>
<li><strong>Long description</strong>: <span></span></li>
<li><strong>Username</strong>: <span></span></li>
<li><strong>Password</strong>: <span></span></li>
<li>
<strong>Additional information</strong>:<br />
<span></span>
</li>
</ul>
</div>
{include file="foot.tpl"}