Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
ENH: refs #0460. Show bitstream md5, mimetype, and exact size in fanc…
Browse files Browse the repository at this point in the history
…y tooltip
  • Loading branch information
zachmullen committed Jan 26, 2012
1 parent d9060d1 commit e7a178e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
6 changes: 1 addition & 5 deletions core/public/css/item/item.view.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ div.viewInfo{
display:block!important;
}

table#browseTable{
table.bitstreamList{
display: table!important;
}

Expand Down Expand Up @@ -34,10 +34,6 @@ div.genericInfo .genericSubtitle {
font-size: 10px;
}

#browseTable {
margin-top:0px;
}

.itemStats {
float: right;
font-size: 10px;
Expand Down
25 changes: 25 additions & 0 deletions core/public/js/item/item.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,31 @@ $(document).ready(function() {
showDialog(json.item.message.duplicate);
});

$('tr.bitstreamRow').qtip({
content: {
text: function(api) {
var name = $(this).find('td:first div span[name=filename]').html();
var md5 = $(this).find('td:first div span[name=md5]').html();
var size = $(this).find('td:first div span[name=sizeBytes]').html();
var type = $(this).find('td:first div span[name=mimeType]').html();
var text = '<b>Filename:</b> ' + name + '<br/>';
text += '<b>Size:</b> ' + size + ' bytes<br/>';
text += '<b>MIME Type:</b> ' + type + '<br/>';
text += '<b>MD5:</b> ' + md5 + '<br/>';
return text;
}
},
position: {
target: 'mouse',
adjust: {
mouse: false
}
},
hide: {
event: 'unfocus mouseleave'
}
});

$('a#itemDeleteLink').click(function() {
$.ajax({
type: "GET",
Expand Down
20 changes: 13 additions & 7 deletions core/views/item/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,30 @@ if($this->preview) // module visualize
echo '</div>';
echo '<div class="revisionContent">';
echo '<h4 style="margin-top: 0px;margin-bottom: 5px;">'.$this->t('CONTENT').'</h4>';
echo '<table style="display:block;" id="browseTable" class="bitstreamList">'; ?>
echo '<table style="display:block;" class="bitstreamList">'; ?>
<thead>
<tr>
<th><?php echo $this->t('Name');?></th>
<th><?php echo $this->t('Size');?></th>
<th><?php echo $this->t('Type');?></th>
</tr>
</thead>
<tbody>
<?php
$bitstreams = $revision->getBitstreams();
foreach($bitstreams as $bitstream)
{
echo "<tr>";
echo " <td>{$this->slicename($bitstream->getName(),50)}</td>";
echo " <td>{$this->Utility->formatSize($bitstream->getSizebytes())} </td>";
echo " <td>{$bitstream->getMimetype()}</td>";
echo "</tr>";
echo '<tr class="bitstreamRow">';
echo '<td>';
echo ' <div style="display: none;">';
echo ' <span name="filename">'.$bitstream->getName().'</span>';
echo ' <span name="md5">'.$bitstream->getChecksum().'</span>';
echo ' <span name="sizeBytes">'.$bitstream->getSizebytes().'</span>';
echo ' <span name="mimeType">'.$bitstream->getMimetype().'</span>';
echo ' </div>';
echo $this->slicename($bitstream->getName(), 50);
echo '</td>';
echo '<td>'.$this->Utility->formatSize($bitstream->getSizebytes()).'</td>';
echo '</tr>';
}
?>
</tbody>
Expand Down

0 comments on commit e7a178e

Please sign in to comment.