Private GIT

Skip to content
Snippets Groups Projects
Commit d192ec77 authored by Nic Wolfe's avatar Nic Wolfe
Browse files

Changed the remaining tables to dataTables, removed the tableSorter code,...

Changed the remaining tables to dataTables, removed the tableSorter code, fixed the default sort order and some display bugs in home/history
parent dace2cc0
No related branches found
No related tags found
No related merge requests found
/* SB Theme */
table.tablesorter {
width: 100%;
margin-left:auto;
margin-right:auto;
text-align:left;
color: #000;
background-color: #fff;
border-spacing: 0;
}
table.tablesorter th,
table.tablesorter td {
padding: 4px;
border-left: #fff 1px solid;
border-top: #fff 1px solid;
}
/* remove extra border from left edge */
table.tablesorter th:first-child,
table.tablesorter td:first-child {
border-left: none;
}
table.tablesorter th {
border-collapse: collapse;
background-color: #333;
color: #fff;
text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
text-align: center;
}
table.tablesorter .tablesorter-header {
/* background-image: url(../images/tablesorter/bg.gif); */
background-repeat: no-repeat;
background-position: center right;
padding: 4px 18px 4px 4px;
cursor: pointer;
}
table.tablesorter th.tablesorter-headerSortUp {
background-color: #57442B;
/* background-image: url(../images/tablesorter/asc.gif); */
}
table.tablesorter th.tablesorter-headerSortDown {
background-color: #57442B;
/* background-image: url(../images/tablesorter/desc.gif); */
}
/* Zebra Widget - row alternating colors */
table.tablesorter tr.odd td {
background-color: #f5f1e4;
}
table.tablesorter tr.even td {
background-color: #dfdacf;
}
/* filter widget */
table.tablesorter input.tablesorter-filter {
width: 98%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
table.tablesorter tr.tablesorter-filter,
table.tablesorter tr.tablesorter-filter td {
text-align: center;
background: #eee;
}
/* optional disabled input styling */
table.tablesorter input.tablesorter-filter.disabled {
display: none;
}
/* xtra css for sb */
.tablesorter-header-inner {
text-align: center;
padding: 0 2px;
}
tr.tablesorter-stickyHeader {
background-color: #fff;
padding: 2px 0;
}
table.tablesorter tfoot a {
color:#fff;
text-decoration: none;
}
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
<script type="text/javascript" src="$sbRoot/js/lib/jquery.dataTables.min.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/jquery.dataTables.reloadAjax.js"></script> <script type="text/javascript" src="$sbRoot/js/jquery.dataTables.reloadAjax.js"></script>
<script type="text/javascript" src="$sbRoot/js/jquery.dataTables.sorting.js"></script> <script type="text/javascript" src="$sbRoot/js/jquery.dataTables.sorting.js"></script>
<script type="text/javascript" src="$sbRoot/js/home.js"></script>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
...@@ -24,8 +23,12 @@ ...@@ -24,8 +23,12 @@
{ {
\$("#historyTable").dataTable({ \$("#historyTable").dataTable({
"bJQueryUI": true, "bJQueryUI": true,
"sPaginationType": "full_numbers", "bStateSave": false,
"bStateSave": true, "aaSorting": [[0, 'desc']],
"iDisplayLength": 50,
"sPaginationType": "two_button",
"aoColumnDefs": [ "aoColumnDefs": [
{ "asSorting": [ "desc", "asc" ], "aTargets": [0] }, { "asSorting": [ "desc", "asc" ], "aTargets": [0] },
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8"> <form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">
<script type="text/javascript" src="$sbRoot/js/lib/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/jquery.dataTables.sorting.js"></script>
<script type="text/javascript" src="$sbRoot/js/addExistingShow.js"></script> <script type="text/javascript" src="$sbRoot/js/addExistingShow.js"></script>
<script type="text/javascript" src="$sbRoot/js/rootDirs.js"></script> <script type="text/javascript" src="$sbRoot/js/rootDirs.js"></script>
<script type="text/javascript" src="$sbRoot/js/addShowOptions.js"></script> <script type="text/javascript" src="$sbRoot/js/addShowOptions.js"></script>
......
<table id="addRootDirTable" class="sickbeardTable tablesorter"> <table id="addRootDirTable">
<thead><tr><th width="1%"><input type="checkbox" id="checkAll" checked=checked></th><th>Directory</th><th width="20%">Show Name (tvshow.nfo)</td></tr></thead> <thead><tr><th width="1%"><input type="checkbox" id="checkAll" checked=checked></th><th>Directory</th><th width="20%">Show Name (tvshow.nfo)</td></tr></thead>
<tfoot> <tfoot>
<tr> <tr>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/jquery.pnotify.default.css" /> <link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/jquery.pnotify.default.css" />
<link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/sickbeard-jquery/jquery-ui-1.8.18.custom.css" /> <link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/sickbeard-jquery/jquery-ui-1.8.18.custom.css" />
<link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/superfish.css" /> <link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/superfish.css" />
<link rel="stylesheet" type="text/css" href="$sbRoot/css/tablesorter.css"/>
<link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/jquery.qtip2.css"/> <link rel="stylesheet" type="text/css" href="$sbRoot/css/lib/jquery.qtip2.css"/>
<link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="$sbRoot/css/iphone.css" /> <link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="$sbRoot/css/iphone.css" />
...@@ -27,9 +26,6 @@ ...@@ -27,9 +26,6 @@
#contentWrapper { background: url("$sbRoot/images/bg.gif") repeat scroll 0 0 transparent; } #contentWrapper { background: url("$sbRoot/images/bg.gif") repeat scroll 0 0 transparent; }
.sf-sub-indicator { background: url("$sbRoot/images/arrows.png") no-repeat -10px -100px; } .sf-sub-indicator { background: url("$sbRoot/images/arrows.png") no-repeat -10px -100px; }
.sf-shadow ul { background: url("$sbRoot/images/shadow.png") no-repeat bottom right; } .sf-shadow ul { background: url("$sbRoot/images/shadow.png") no-repeat bottom right; }
th.tablesorter-header { background-image: url("$sbRoot/images/tablesorter/bg.gif"); }
th.tablesorter-headerSortUp { background-image: url("$sbRoot/images/tablesorter/asc.gif"); }
th.tablesorter-headerSortDown { background-image: url("$sbRoot/images/tablesorter/desc.gif"); }
.browserDialog.busy .ui-dialog-buttonpane { background: url("$sbRoot/images/loading.gif") 10px 50% no-repeat !important; } .browserDialog.busy .ui-dialog-buttonpane { background: url("$sbRoot/images/loading.gif") 10px 50% no-repeat !important; }
...@@ -47,8 +43,6 @@ th.tablesorter-headerSortDown { background-image: url("$sbRoot/images/tablesorte ...@@ -47,8 +43,6 @@ th.tablesorter-headerSortDown { background-image: url("$sbRoot/images/tablesorte
<script type="text/javascript" src="$sbRoot/js/lib/jquery.cookiejar.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.cookiejar.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.json-2.2.min.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.json-2.2.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.selectboxes.min.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.selectboxes.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.tablesorter-2.1.10.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.tablesorter.widgets.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.qtip-2011-11-14.min.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.qtip-2011-11-14.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.pnotify-1.0.2.min.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.pnotify-1.0.2.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/lib/jquery.expand-1.3.8.js"></script> <script type="text/javascript" src="$sbRoot/js/lib/jquery.expand-1.3.8.js"></script>
......
...@@ -8,8 +8,12 @@ ...@@ -8,8 +8,12 @@
#import os.path #import os.path
#include $os.path.join($sickbeard.PROG_DIR, "data/interfaces/default/inc_top.tmpl") #include $os.path.join($sickbeard.PROG_DIR, "data/interfaces/default/inc_top.tmpl")
<script type="text/javascript" src="$sbRoot/js/lib/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="$sbRoot/js/jquery.dataTables.sorting.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
<!-- <!--
/*
\$.tablesorter.addParser({ \$.tablesorter.addParser({
id: 'showNames', id: 'showNames',
is: function(s) { is: function(s) {
...@@ -53,13 +57,79 @@ ...@@ -53,13 +57,79 @@
} }
}); });
}); });
*/
\$(document).ready(function()
{
\$("#massUpdateTable").dataTable({
"bPaginate": false,
"bInfo": false,
"bFilter": false,
"bAutoWidth": false,
"bProcessing": false,
"sDom": "lftipr",
"bJQueryUI": true,
// use localstorage to save state
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
localStorage.setItem( 'DataTables_'+window.location.pathname, JSON.stringify(oData) );
},
"fnStateLoad": function (oSettings) {
var data = localStorage.getItem('DataTables_'+window.location.pathname);
return JSON.parse(data);
},
"aoColumnDefs": [
{
"sClass": "center",
"aTargets": [0, 1, 3, 4, 5, 6, 7, 8, 9, 10]
},
{ "asSorting": [ "desc", "asc" ], "aTargets": [0] },
{
"bSortable": false,
"bSearchable": false,
"aTargets": [0, 7, 8, 9, 10]
},
{
"sType": "quality",
"bUseRendered": false,
// render the quality in a span
"fnRender": function ( oObj, sVal ) {
return '<span class="quality '+sVal+'">'+sVal+'</span>';
},
"aDataSort": [3, 1],
"aTargets": [ 3 ],
},
{
"sType": "alt-string",
"bUseRendered": true,
"aTargets": [4, 5],
},
{
"sType": "titles",
"bUseRendered": false,
"aTargets": [ 6 ],
},
]
});
});
//--> //-->
</script> </script>
<script type="text/javascript" src="$sbRoot/js/massUpdate.js"></script> <script type="text/javascript" src="$sbRoot/js/massUpdate.js"></script>
<form name="massUpdateForm" method="post" action="massUpdate"> <form name="massUpdateForm" method="post" action="massUpdate">
<table id="massUpdateTable" class="sickbeardTable tablesorter" cellspacing="1" border="0" cellpadding="0"> <table id="massUpdateTable" cellspacing="1" border="0" cellpadding="0">
<thead> <thead>
<tr> <tr>
<th width="1%">Edit&nbsp;<input type="checkbox" class="bulkCheck" id="editCheck" /></th> <th width="1%">Edit&nbsp;<input type="checkbox" class="bulkCheck" id="editCheck" /></th>
...@@ -110,22 +180,26 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name)) ...@@ -110,22 +180,26 @@ $myShowList.sort(lambda x, y: cmp(x.name, y.name))
#set $curDelete = "<input type=\"checkbox\" class=\"deleteCheck\" id=\"delete-"+str($curShow.tvdbid)+"\" "+$curDelete_disabled+"/>" #set $curDelete = "<input type=\"checkbox\" class=\"deleteCheck\" id=\"delete-"+str($curShow.tvdbid)+"\" "+$curDelete_disabled+"/>"
<tr> <tr>
<td align="center"><input type="checkbox" class="editCheck" id="edit-$curShow.tvdbid" /></td> <td><input type="checkbox" class="editCheck" id="edit-$curShow.tvdbid" /></td>
<td align="center"><img src="$sbRoot/images/flags/${curShow.lang}.png" width="16" height="11" alt="$curShow.lang" /></td> <td><img src="$sbRoot/images/flags/${curShow.lang}.png" width="16" height="11" alt="$curShow.lang" /></td>
<td class="tvShow"><a href="$sbRoot/home/displayShow?show=$curShow.tvdbid">$curShow.name</a></td> <td class="tvShow"><a href="$sbRoot/home/displayShow?show=$curShow.tvdbid">$curShow.name</a></td>
#if $curShow.quality in $qualityPresets: #if False and $curShow.quality in $qualityPresets:
<td align="center"><span class="quality $qualityPresetStrings[$curShow.quality]">$qualityPresetStrings[$curShow.quality]</span></td> <td><span class="quality $qualityPresetStrings[$curShow.quality]">$qualityPresetStrings[$curShow.quality]</span></td>
#elif False:
<td><span class="quality Custom">Custom</span></td>
#elif $curShow.quality in $qualityPresets:
<td>$qualityPresetStrings[$curShow.quality]</td>
#else: #else:
<td align="center"><span class="quality Custom">Custom</span></td> <td>Custom</td>
#end if #end if
<td align="center"><img src="$sbRoot/images/#if int($curShow.seasonfolders) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td> <td><img src="$sbRoot/images/#if int($curShow.seasonfolders) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
<td align="center"><img src="$sbRoot/images/#if int($curShow.paused) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td> <td><img src="$sbRoot/images/#if int($curShow.paused) == 1 then "yes16.png\" alt=\"Y\"" else "no16.png\" alt=\"N\""# width="16" height="16" /></td>
<td align="center">$curShow.status</td> <td>$curShow.status</td>
<td align="center">$curUpdate</td> <td>$curUpdate</td>
<td align="center">$curRefresh</td> <td>$curRefresh</td>
<td align="center">$curRename</td> <td>$curRename</td>
<!-- <td align="center"><input type="checkbox" class="metadataCheck" id="metadata-$curShow.tvdbid" /></td>//--> <!-- <td align="center"><input type="checkbox" class="metadataCheck" id="metadata-$curShow.tvdbid" /></td>//-->
<td align="center">$curDelete</td> <td>$curDelete</td>
</tr> </tr>
#end for #end for
</tbody> </tbody>
......
...@@ -45,12 +45,42 @@ $(document).ready(function() { ...@@ -45,12 +45,42 @@ $(document).ready(function() {
$('#tableDiv').html('<img id="searchingAnim" src="'+sbRoot+'/images/loading32.gif" height="32" width="32" /> loading folders...'); $('#tableDiv').html('<img id="searchingAnim" src="'+sbRoot+'/images/loading32.gif" height="32" width="32" /> loading folders...');
$.get(sbRoot+'/home/addShows/massAddTable', url, function(data) { $.get(sbRoot+'/home/addShows/massAddTable', url, function(data) {
$('#tableDiv').html(data); $('#tableDiv').html(data);
$("#addRootDirTable").tablesorter({ $("#addRootDirTable").dataTable({
//sortList: [[1,0]],
widgets: ['zebra'], // disable most stuff for the table
headers: { "bPaginate": false,
0: { sorter: false } "bInfo": false,
} "bFilter": false,
"bAutoWidth": false,
"bProcessing": false,
// only show the basic DOM elements
"sDom": "lftipr",
"bJQueryUI": true,
"aoColumnDefs": [
{ "sClass": "center", "aTargets": [0] },
// checkbox
{
"bSortable": false,
"bSearchable": false,
"aTargets": [0],
},
// path
{
"sType": "titles",
"aTargets": [ 1 ]
},
// TVDB link
{
"sType": "link-text",
"aTargets": [ 2 ]
},
],
}); });
}); });
......
...@@ -135,6 +135,7 @@ $(document).ready(function(){ ...@@ -135,6 +135,7 @@ $(document).ready(function(){
"aTargets": [6] "aTargets": [6]
}, },
], ],
"aoColumns": [ "aoColumns": [
{ "mDataProp": "next_airdate" }, { "mDataProp": "next_airdate" },
{ "mDataProp": "name" }, { "mDataProp": "name" },
...@@ -143,9 +144,11 @@ $(document).ready(function(){ ...@@ -143,9 +144,11 @@ $(document).ready(function(){
{ "mDataProp": "percent_downloaded" }, { "mDataProp": "percent_downloaded" },
{ "mDataProp": "active" }, { "mDataProp": "active" },
{ "mDataProp": "status" } { "mDataProp": "status" }
] ],
"aaSorting": [[5, 'asc'], [1, 'asc']]
}); });
// start watching the show list crcs // start watching the show list crcs
check_crc(); //check_crc();
}); });
...@@ -63,6 +63,26 @@ $(document).ready(function(){ ...@@ -63,6 +63,26 @@ $(document).ready(function(){
return ((x < y) ? 1 : ((x > y) ? -1 : 0)); return ((x < y) ? 1 : ((x > y) ? -1 : 0));
}; };
$.fn.dataTableExt.oSort['link-text-asc'] = function(a,b) {
var x = a.match(/>\s*(.*?)\s*<\s*\/\s*a\s*>/);
var y = b.match(/>\s*(.*?)\s*<\s*\/\s*a\s*>/);
x = x != null ? x[1].toLowerCase() : a.toLowerCase();
y = y != null ? y[1].toLowerCase() : b.toLowerCase();
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
};
$.fn.dataTableExt.oSort['link-text-desc'] = function(a,b) {
var x = a.match(/>\s*(.*?)\s*<\s*\/\s*a\s*>/);
var y = b.match(/>\s*(.*?)\s*<\s*\/\s*a\s*>/);
x = x != null ? x[1].toLowerCase() : a.toLowerCase();
y = y != null ? y[1].toLowerCase() : b.toLowerCase();
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};
$.fn.dataTableExt.oSort['empty-last-asc'] = function(a,b) { $.fn.dataTableExt.oSort['empty-last-asc'] = function(a,b) {
if (a == "") if (a == "")
return 1; return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment