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

Commit e7a178e

Browse files
committed
ENH: refs #0460. Show bitstream md5, mimetype, and exact size in fancy tooltip
1 parent d9060d1 commit e7a178e

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

core/public/css/item/item.view.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ div.viewInfo{
66
display:block!important;
77
}
88

9-
table#browseTable{
9+
table.bitstreamList{
1010
display: table!important;
1111
}
1212

@@ -34,10 +34,6 @@ div.genericInfo .genericSubtitle {
3434
font-size: 10px;
3535
}
3636

37-
#browseTable {
38-
margin-top:0px;
39-
}
40-
4137
.itemStats {
4238
float: right;
4339
font-size: 10px;

core/public/js/item/item.view.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,31 @@ $(document).ready(function() {
5555
showDialog(json.item.message.duplicate);
5656
});
5757

58+
$('tr.bitstreamRow').qtip({
59+
content: {
60+
text: function(api) {
61+
var name = $(this).find('td:first div span[name=filename]').html();
62+
var md5 = $(this).find('td:first div span[name=md5]').html();
63+
var size = $(this).find('td:first div span[name=sizeBytes]').html();
64+
var type = $(this).find('td:first div span[name=mimeType]').html();
65+
var text = '<b>Filename:</b> ' + name + '<br/>';
66+
text += '<b>Size:</b> ' + size + ' bytes<br/>';
67+
text += '<b>MIME Type:</b> ' + type + '<br/>';
68+
text += '<b>MD5:</b> ' + md5 + '<br/>';
69+
return text;
70+
}
71+
},
72+
position: {
73+
target: 'mouse',
74+
adjust: {
75+
mouse: false
76+
}
77+
},
78+
hide: {
79+
event: 'unfocus mouseleave'
80+
}
81+
});
82+
5883
$('a#itemDeleteLink').click(function() {
5984
$.ajax({
6085
type: "GET",

core/views/item/view.phtml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,24 +145,30 @@ if($this->preview) // module visualize
145145
echo '</div>';
146146
echo '<div class="revisionContent">';
147147
echo '<h4 style="margin-top: 0px;margin-bottom: 5px;">'.$this->t('CONTENT').'</h4>';
148-
echo '<table style="display:block;" id="browseTable" class="bitstreamList">'; ?>
148+
echo '<table style="display:block;" class="bitstreamList">'; ?>
149149
<thead>
150150
<tr>
151151
<th><?php echo $this->t('Name');?></th>
152152
<th><?php echo $this->t('Size');?></th>
153-
<th><?php echo $this->t('Type');?></th>
154153
</tr>
155154
</thead>
156155
<tbody>
157156
<?php
158157
$bitstreams = $revision->getBitstreams();
159158
foreach($bitstreams as $bitstream)
160159
{
161-
echo "<tr>";
162-
echo " <td>{$this->slicename($bitstream->getName(),50)}</td>";
163-
echo " <td>{$this->Utility->formatSize($bitstream->getSizebytes())} </td>";
164-
echo " <td>{$bitstream->getMimetype()}</td>";
165-
echo "</tr>";
160+
echo '<tr class="bitstreamRow">';
161+
echo '<td>';
162+
echo ' <div style="display: none;">';
163+
echo ' <span name="filename">'.$bitstream->getName().'</span>';
164+
echo ' <span name="md5">'.$bitstream->getChecksum().'</span>';
165+
echo ' <span name="sizeBytes">'.$bitstream->getSizebytes().'</span>';
166+
echo ' <span name="mimeType">'.$bitstream->getMimetype().'</span>';
167+
echo ' </div>';
168+
echo $this->slicename($bitstream->getName(), 50);
169+
echo '</td>';
170+
echo '<td>'.$this->Utility->formatSize($bitstream->getSizebytes()).'</td>';
171+
echo '</tr>';
166172
}
167173
?>
168174
</tbody>

0 commit comments

Comments
 (0)