moved tablesorter to its own package

This commit is contained in:
Derek Macias 2016-01-16 13:38:20 -07:00
parent 3a8c98f505
commit 9625c122cb
8 changed files with 9 additions and 5863 deletions

View File

@ -19,8 +19,9 @@ get_content_from_github($pkg_repo, $repo_file);
get_content_from_github($pkg_desc, $desc_file);
?>
<link type="text/css" rel="stylesheet" href="/plugins/NerdPack/styles/NerdPack.css">
<link type="text/css" rel="stylesheet" href="/plugins/NerdPack/styles/NerdPack-<?=$theme;?>.css">
<link type="text/css" rel="stylesheet" href="/plugins/NerdPack/css/NerdPack.css">
<link type="text/css" rel="stylesheet" href="/plugins/tablesorter/css/tablesorter.css">
<link type="text/css" rel="stylesheet" href="/plugins/tablesorter/css/tablesorter-<?=$theme;?>.css">
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
<span class="status" style="display: inline-block; margin-right: 110px;margin-top: -45px;"><input id="uninstallpkg" type="checkbox"></span>
@ -49,7 +50,7 @@ get_content_from_github($pkg_desc, $desc_file);
: <input id="btnApply" type="button" value="Apply"><input type="button" value="Done" onClick="done()">
</form>
<script type="text/javascript" src="/plugins/NerdPack/javascript/jquery.NerdPack.js"></script>
<script type="text/javascript" src="/plugins/NerdPack/javascript/jquery.tablesorter.combined.js"></script>
<script type="text/javascript" src="/plugins/NerdPack/javascript/parsers/parser-metric.js"></script>
<script type="text/javascript" src="/plugins/NerdPack/js/jquery.NerdPack.js"></script>
<script type="text/javascript" src="/plugins/tablesorter/js/jquery.tablesorter.combined.min.js"></script>
<script type="text/javascript" src="/plugins/tablesorter/js/parsers/parser-metric.js"></script>
<script type="text/javascript" src="/webGui/javascript/jquery.switchbutton.js"></script>

View File

@ -0,0 +1,3 @@
.package {
cursor: pointer;
}

View File

@ -1,92 +0,0 @@
/*! Parser: metric *//*
* Demo: http://jsfiddle.net/Mottie/abkNM/382/
* Set the metric name in the header (defaults to 'm|meter'), e.g.
* <th data-metric-name-abbr="b|B" data-metric-name-full="byte|Byte|BYTE">HDD Size</th>
* <th data-metric-name="m|meter">Distance</th> <!-- data-metric-name is deprecated in v2.22.2 -->
*/
/*jshint jquery:true */
;( function( $ ) {
'use strict';
var prefixes = {
// 'prefix' : [ base 10, base 2 ]
// skipping IEEE 1541 defined prefixes: kibibyte, mebibyte, etc, for now.
'Y|Yotta|yotta' : [ 1e24, Math.pow(1024, 8) ], // 1024^8
'Z|Zetta|zetta' : [ 1e21, Math.pow(1024, 7) ], // 1024^7
'E|Exa|exa' : [ 1e18, Math.pow(1024, 6) ], // 1024^6
'P|Peta|peta' : [ 1e15, Math.pow(1024, 5) ], // 1024^5
'T|Tera|tera' : [ 1e12, Math.pow(1024, 4) ], // 1024^4
'G|Giga|giga' : [ 1e9, Math.pow(1024, 3) ], // 1024^3
'M|Mega|mega' : [ 1e6, Math.pow(1024, 2) ], // 1024^2
'k|Kilo|kilo' : [ 1e3, 1024 ], // 1024
// prefixes below here are rarely, if ever, used in binary
'h|hecto' : [ 1e2, 1e2 ],
'da|deka' : [ 1e1, 1e1 ],
'd|deci' : [ 1e-1, 1e-1 ],
'c|centi' : [ 1e-2, 1e-2 ],
'm|milli' : [ 1e-3, 1e-3 ],
'µ|micro' : [ 1e-6, 1e-6 ],
'n|nano' : [ 1e-9, 1e-9 ],
'p|pico' : [ 1e-12, 1e-12 ],
'f|femto' : [ 1e-15, 1e-15 ],
'a|atto' : [ 1e-18, 1e-18 ],
'z|zepto' : [ 1e-21, 1e-21 ],
'y|yocto' : [ 1e-24, 1e-24 ]
},
// the \\d+ will not catch digits with spaces, commas or decimals; so use the value from n instead
RegLong = '(\\d+)(\\s+)?([Zz]etta|[Ee]xa|[Pp]eta|[Tt]era|[Gg]iga|[Mm]ega|kilo|hecto|deka|deci|centi|milli|micro|nano|pico|femto|atto|zepto|yocto)(',
RegAbbr = '(\\d+)(\\s+)?(Z|E|P|T|G|M|k|h|da|d|c|m|µ|n|p|f|a|z|y)(',
// make these case-insensitive because we all forget the case for these binary values
byteTest = /^[b|bit|byte|o|octet]/i;
$.tablesorter.addParser({
id: 'metric',
is: function() {
return false;
},
format: function(txt, table, cell, cellIndex) {
var unit, isBinary, nameLong, nameAbbr,
// default base unit name
base = 'm|meter',
// process number here to get a numerical format (us or eu)
num = $.tablesorter.formatFloat( txt.replace(/[^\w,. \-()]/g, ''), table ),
$t = table.config.$headerIndexed[ cellIndex ],
regex = $t.data( 'metric' );
if ( !regex ) {
// stored values
unit = ( $t.attr('data-metric-name') || base ).split( '|' );
nameLong = $t.attr( 'data-metric-name-full' ) || '';
nameAbbr = $t.attr( 'data-metric-name-abbr' ) || '';
regex = [ nameLong || unit[1] || unit[0].substring(1), nameAbbr || unit[0] ];
isBinary = byteTest.test( regex.join( '' ) );
// adding 'data-metric-name-full' which would contain 'byte|BYTE|Byte' etc
regex[2] = new RegExp( RegLong + (
( nameLong === '' ? '' : nameLong + '|' + nameAbbr ) ||
// with data-metric-name='b|byte', we end up with 'b|B|byte|BYTE' - maybe not the best solution for case-insensitivity
( ( isBinary ? regex[0].toLowerCase() + '|' + regex[0].toUpperCase() : regex[0] ) + '|' +
( isBinary ? regex[1].toLowerCase() + '|' + regex[1].toUpperCase() : regex[1] ) ) ) +
')' );
// adding 'data-metric-name-abbr' which would contain 'b|B' etc
regex[3] = new RegExp( RegAbbr + ( nameAbbr ||
( ( isBinary ? regex[1].toLowerCase() + '|' + regex[1].toUpperCase() : regex[1] ) ) ) +
')' );
$t.data( 'metric', regex );
}
// find match to full name or abbreviation
unit = txt.match( regex[2] ) || txt.match( regex[3] );
if ( unit ) {
for ( base in prefixes ) {
if ( unit[3].match( base ) ) {
// exception when using binary prefix
// change base for binary use
isBinary = byteTest.test( unit[4] ) ? 1 : 0;
return num * prefixes[ base ][ isBinary ];
}
}
}
return num;
},
type: 'numeric'
});
})(jQuery);

View File

@ -1,26 +0,0 @@
/* header */
.tablesorter .headerSortUp,
.tablesorter .tablesorter-headerSortUp,
.tablesorter .tablesorter-headerAsc {
background-color:#101010;
}
.tablesorter .headerSortDown,
.tablesorter .tablesorter-headerSortDown,
.tablesorter .tablesorter-headerDesc {
background-color:#101010;
}
/* filter widget */
.tablesorter .tablesorter-filter-row {
background-color: #101010;
}
.tablesorter .tablesorter-filter-row td {
background-color: #101010;
border-bottom: #000000 1px solid;
}
/* filters */
.tablesorter input.tablesorter-filter,
.tablesorter select.tablesorter-filter {
background-color: #000000;
border: 1px solid #101010;
color: #808080;
}

View File

@ -1,26 +0,0 @@
/* header */
.tablesorter .headerSortUp,
.tablesorter .tablesorter-headerSortUp,
.tablesorter .tablesorter-headerAsc {
background-color:#E0E0E0;
}
.tablesorter .headerSortDown,
.tablesorter .tablesorter-headerSortDown,
.tablesorter .tablesorter-headerDesc {
background-color:#E0E0E0;
}
/* filter widget */
.tablesorter .tablesorter-filter-row {
background-color: #E0E0E0;
}
.tablesorter .tablesorter-filter-row td {
background-color: #E0E0E0;
border-bottom: #FFFFFF 1px solid;
}
/* filters */
.tablesorter input.tablesorter-filter,
.tablesorter select.tablesorter-filter {
background-color: #FFFFFF;
border: 1px solid #E0E0E0;
}

View File

@ -1,100 +0,0 @@
.package {
cursor: pointer;
}
/* header */
.tablesorter {
font-family:arimo;
margin:0 0 15px 0;
}
.tablesorter .header,
.tablesorter .tablesorter-header {
background-position: center right;
background-repeat: no-repeat;
cursor: pointer;
outline: none;
}
.tablesorter .headerSortUp,
.tablesorter .tablesorter-headerSortUp,
.tablesorter .tablesorter-headerAsc {
background-image: url(/webGui/images/sort-asc.png);
}
.tablesorter .headerSortDown,
.tablesorter .tablesorter-headerSortDown,
.tablesorter .tablesorter-headerDesc {
background-image: url(/webGui/images/sort-desc.png);
}
/* tbody */
.tablesorter td {
padding:4px 20px 4px 6px;
vertical-align:middle;
text-align:justify;
}
tablesorter tbody tr.tr_last td{
padding:8px 20px 8px 6px;
}
/* filter widget */
.tablesorter .tablesorter-filter-row td {
line-height: normal;
text-align: center; /* center the input */
-webkit-transition: line-height 0.1s ease;
-moz-transition: line-height 0.1s ease;
-o-transition: line-height 0.1s ease;
transition: line-height 0.1s ease;
}
/* optional disabled input styling */
.tablesorter .tablesorter-filter-row .disabled {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: not-allowed;
}
/* filters */
.tablesorter input.tablesorter-filter,
.tablesorter select.tablesorter-filter {
width: 95%;
height: auto;
margin: 1px auto;
padding: 1px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: height 0.1s ease;
-moz-transition: height 0.1s ease;
-o-transition: height 0.1s ease;
transition: height 0.1s ease;
}
/* rows hidden by filtering (needed for child rows) */
.tablesorter .filtered {
display: none;
}
/* HOVER ROW highlight colors */
table.hover-highlight tbody > tr:hover > td, /* override tablesorter theme row hover */
table.hover-highlight tbody > tr.odd:hover > td,
table.hover-highlight tbody > tr.even:hover > td {
background-color: #9FC2E6;
color: #000000;
}
/* ************************************************* */
/* **** No need to modify the definitions below **** */
/* ************************************************* */
.hover-highlight td:hover::after, .hover-highlight th:hover::after {
content: '';
position: absolute;
width: 100%;
height: 999em;
left: 0;
top: -555em;
z-index: -1;
}
/* required styles */
.hover-highlight {
overflow: hidden;
}
.hover-highlight td, .hover-highlight th {
position: relative;
outline: 0;
}