Commit 22e5a2da authored by Florian Kaiser's avatar Florian Kaiser
Browse files

add client-side sorting utilising jquery.tablesorter.js

parent be918944
#hello {
color: red;
#storageusage-wrapper {
padding: 12px;
}
#storageusage {
/*font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
width: 100%;
border-collapse: collapse;
}
#storageusage td, #storageusage th {
font-size: 1em;
border: 1px solid #ccc;
padding: 3px 7px 2px 7px;
}
#storageusage th {
font-size: 1.1em;
font-weight: bold;
text-align: left;
padding-top: 5px;
padding-bottom: 4px;
background-color: #888;
color: #000;
}
\ No newline at end of file
.tablesorter-header {
/* black (unsorted) double arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
background-repeat: no-repeat;
background-position: center right;
white-space: normal;
cursor: pointer;
}
.tablesorter-headerAsc {
/* black asc arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
}
.tablesorter-headerDesc {
/* black desc arrow */
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
}
This diff is collapsed.
......@@ -9,13 +9,23 @@
*/
(function ($, OC) {
$(document).ready(function () {
$(".storageusage-progress").each(function() {
$(this).progressbar({
value: parseInt( $(this).attr("storageusage-percent") )
});
});
$("table").tablesorter({
theme: 'blue',
textExtraction: function(node) {
if ($(node).attr("value")) {
return $(node).attr("value");
} else {
return $(node).text();
}
}
});
});
})(jQuery, OC);
\ No newline at end of file
<?php
script('storageusage', 'jquery.tablesorter');
script('storageusage', 'script');
style('storageusage', 'style');
style('storageusage', 'tablesorter');
?>
<div id="app">
......
<style type="text/css">
#storageusage {
/*font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
width: 100%;
border-collapse: collapse;
}
#storageusage td, #storageusage th {
font-size: 1em;
border: 1px solid #ccc;
padding: 3px 7px 2px 7px;
}
#storageusage th {
font-size: 1.1em;
text-align: left;
padding-top: 5px;
padding-bottom: 4px;
background-color: #888;
color: #000;
}
</style>
<div style="padding: 12px">
<div id="storageusage-wrapper">
<table id="storageusage">
<thead>
<tr>
......@@ -41,9 +16,9 @@
<tr class="<?php if ($alt=!$alt) echo 'alt';?>">
<td><?php p($row['username']); ?></td>
<td><?php p($row['objects']); ?></td>
<td storageusage-bytes="<?php p($row['bytes']); ?>"><?php p($this->human_file_size($row['bytes'])); ?></td>
<td storageusage-quotavalue="<?php p($row['quotavalue']); ?>"><?php p($row['quotastring']); ?></td>
<td><div class="storageusage-progress" storageusage-percent="<?php p((int) ($row['bytes'] / $row['quotavalue'])); ?>"></div></td>
<td value="<?php p($row['bytes']); ?>"><?php p($this->human_file_size($row['bytes'])); ?></td>
<td value="<?php p($row['quotavalue']); ?>"><?php p($row['quotastring']); ?></td>
<td value="<?php p((int) ($row['bytes'] / $row['quotavalue'])); ?>"><div class="storageusage-progress" storageusage-percent="<?php p((int) ($row['bytes'] / $row['quotavalue'])); ?>"></div></td>
</tr>
<?php } ?>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment