truncate long names, replace link text with doc title

pull/1/head
ansuz 9 years ago
parent 71b1f71ba0
commit 0911572031

@ -161,6 +161,13 @@
'/code/': 'Code' '/code/': 'Code'
}; };
var truncateTitle = function (title, len) {
if (title.length > len) {
return title.slice(0, len) + '…';
}
return title;
};
var recentPads = Cryptpad.getRecentPads(); var recentPads = Cryptpad.getRecentPads();
recentPads.sort(Cryptpad.mostRecent); recentPads.sort(Cryptpad.mostRecent);
@ -193,8 +200,8 @@
var id = 'pad-'+index; var id = 'pad-'+index;
$tbody.append('<tr id="'+id+'">' + $tbody.append('<tr id="'+id+'">' +
'<td>' + name + '</td>' + '<td>' + name + '</td>' +
'<td>' + title + '</td>' + //'<td>' + title + '</td>' +
'<td><a href="' + pad.href + '">' + pad.href + '</a></td>' + '<td><a href="' + pad.href + '" title="'+ pad.title + '">' + truncateTitle(pad.title, 20) + '</a></td>' +
'<td>' + created + '</td>' + // created '<td>' + created + '</td>' + // created
'<td>' + date + '</td>' + '<td>' + date + '</td>' +
'<td class="remove"></td>'+ '<td class="remove"></td>'+
@ -231,7 +238,7 @@
<tr> <tr>
<th>Type</th> <th>Type</th>
<th>Title</th> <!-- <th>Title</th> -->
<th>Link</th> <th>Link</th>
<th>Created</th> <th>Created</th>
<th>Last Accessed</th> <th>Last Accessed</th>

Loading…
Cancel
Save