add a refresh button to the home page table

pull/1/head
ansuz 9 years ago
parent dd3a5d47be
commit e79d3d4d4e

@ -59,7 +59,7 @@
<th>Link</th> <th>Link</th>
<th>Created</th> <th>Created</th>
<th>Last Accessed</th> <th>Last Accessed</th>
<th></th> <!-- remove column --> <th class="table-refresh" title="refresh listing"></th> <!-- remove column -->
</tr> </tr>
</tbody> </tbody>

@ -156,11 +156,16 @@ tbody tr {
text-align: center; text-align: center;
} }
tbody tr:first-of-type th { tbody tr:first-of-type th {
font-size: 20px;
border-top: 0px; border-top: 0px;
font-weight: bold; font-weight: bold;
padding: 10px; padding: 10px;
text-decoration: underline; text-decoration: underline;
} }
tbody tr:first-of-type th.table-refresh {
color: #46E981;
text-decoration: none;
}
tbody tr:nth-child(odd) { tbody tr:nth-child(odd) {
background-color: #685d56; background-color: #685d56;
} }

@ -49,6 +49,12 @@ define([
var makeRecentPadsTable = function (recentPads) { var makeRecentPadsTable = function (recentPads) {
if (!recentPads.length) { return; } if (!recentPads.length) { return; }
$('tbody tr').each(function (i, e) {
if (!i) { return; }
$(this).remove();
});
recentPads.some(function (pad, index) { recentPads.some(function (pad, index) {
if (!pad) { return; } if (!pad) { return; }
@ -112,8 +118,7 @@ define([
}); });
}; };
Cryptpad.ready(function () { var refreshTable = function () {
console.log("ready");
Cryptpad.getRecentPads(function (err, recentPads) { Cryptpad.getRecentPads(function (err, recentPads) {
if (err) { if (err) {
console.log("unable to get recent pads"); console.log("unable to get recent pads");
@ -131,6 +136,12 @@ define([
$tryit.text(Messages.recentPads); $tryit.text(Messages.recentPads);
} }
}); });
};
Cryptpad.ready(function () {
console.log("ready");
refreshTable();
$('.table-refresh').click(refreshTable);
}); });
}); });

@ -188,10 +188,17 @@ tbody {
tr { tr {
text-align: center; text-align: center;
&:first-of-type th{ &:first-of-type th{
font-size: 20px;
border-top: 0px; border-top: 0px;
font-weight: bold; font-weight: bold;
padding: 10px; padding: 10px;
text-decoration: underline; text-decoration: underline;
&.table-refresh {
color: @cp-green;
text-decoration: none;
//border-bottom: 0px;
}
} }
&:nth-child(odd) { &:nth-child(odd) {
background-color: @light-base; background-color: @light-base;
@ -210,6 +217,7 @@ tbody {
border-right: 0px; border-right: 0px;
} }
} }
.remove { .remove {
cursor: pointer !important; cursor: pointer !important;
color: @cp-red; color: @cp-red;

Loading…
Cancel
Save