mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +02:00
Save columns display
This commit is contained in:
parent
bf1f0ce2fb
commit
785f3ce6ce
16 changed files with 41 additions and 31 deletions
|
@ -20,7 +20,7 @@ tools:
|
|||
excluded_dirs: { }
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'modules/*''
|
||||
- 'modules/*'
|
||||
paths: { }
|
||||
php_analyzer:
|
||||
enabled: true
|
||||
|
@ -53,5 +53,5 @@ tools:
|
|||
excluded_dirs: { }
|
||||
filter:
|
||||
excluded_paths:
|
||||
- 'modules/*''
|
||||
- 'modules/*'
|
||||
paths: { }
|
|
@ -26,6 +26,8 @@ https://github.com/thepeg/MediaTable
|
|||
http://consulenza-web.com/jquery/MediaTable/
|
||||
http://www.consulenza-web.com/2012/01/mediatable-jquery-plugin/
|
||||
|
||||
**Modified version for Ampache.**
|
||||
|
||||
**/
|
||||
|
||||
|
||||
|
@ -133,8 +135,7 @@ http://www.consulenza-web.com/2012/01/mediatable-jquery-plugin/
|
|||
|
||||
var __thInit = function( i, wdg ) {
|
||||
var $th = $(this),
|
||||
id = $th.attr('id'),
|
||||
classes = $th.attr('class');
|
||||
id = $th.attr('id');
|
||||
|
||||
// Set up an auto-generated ID for the column.
|
||||
// the ID is based upon widget's ID to allow multiple tables into one page.
|
||||
|
@ -164,50 +165,56 @@ http://www.consulenza-web.com/2012/01/mediatable-jquery-plugin/
|
|||
}
|
||||
|
||||
// Propagate column's properties to each cell.
|
||||
$('tbody tr',wdg.$table).each(function(){ __trInit.call( this, i, id, classes ); });
|
||||
var classes = $th.attr('class');
|
||||
var styles = $th.attr('style');
|
||||
$('tbody tr',wdg.$table).each(function(){ __trInit.call( this, i, id, classes, styles ); });
|
||||
|
||||
}; // EndOf: "__thInit()" ###
|
||||
|
||||
|
||||
var __trInit = function( i, id, classes ) {
|
||||
var __trInit = function( i, id, classes, styles ) {
|
||||
|
||||
var $cell = $(this).find('td,th').eq(i);
|
||||
|
||||
$cell.attr( 'headers', id );
|
||||
|
||||
if ( classes ) $cell.addClass(classes);
|
||||
if ( styles) $cell.attr('style', styles);
|
||||
|
||||
}; // EndOf: "__trInit()" ###
|
||||
|
||||
|
||||
var __liInitActions = function( $th, $checkbox, wdg ) {
|
||||
|
||||
var change = function() {
|
||||
var cookname = 'mt_' + wdg.$table.attr('data-objecttype') + '_' + $th.index();
|
||||
|
||||
var change = function() {
|
||||
var val = $checkbox.val(), // this equals the header's ID, i.e. "company"
|
||||
cols = wdg.$table.find("#" + val + ", [headers="+ val +"]"); // so we can easily find the matching header (id="company") and cells (headers="company")
|
||||
|
||||
var checked = $checkbox.is(":checked");
|
||||
$.cookie(cookname, checked, { expires: 30, path: '/'});
|
||||
|
||||
if ( $checkbox.is(":checked")) {
|
||||
if (checked) {
|
||||
cols.show();
|
||||
|
||||
} else {
|
||||
cols.hide();
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
var updateCheck = function() {
|
||||
|
||||
//if ( $th.css("display") == "table-cell") {
|
||||
if ($.cookie(cookname) !== undefined) {
|
||||
$checkbox.prop("checked", $.cookie(cookname) === true);
|
||||
change();
|
||||
}
|
||||
|
||||
if ($th.is(':visible')) {
|
||||
$checkbox.prop("checked", true);
|
||||
}
|
||||
else {
|
||||
$checkbox.prop("checked", false);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
$checkbox
|
||||
|
@ -248,6 +255,7 @@ http://www.consulenza-web.com/2012/01/mediatable-jquery-plugin/
|
|||
wdg.$table.find('thead th').each(function(i){
|
||||
var $th = $('#' + wdg.id + '-mediaTableCol-' + i);
|
||||
var $checkbox = $('#toggle-col-' + wdg.id + '-' + i);
|
||||
var cookname = 'mt_' + wdg.$table.attr('data-objecttype') + '_' + $th.index();
|
||||
if ($checkbox !== undefined) {
|
||||
$th.removeAttr('style');
|
||||
if ( $th.is(':visible') ) {
|
||||
|
@ -260,6 +268,7 @@ http://www.consulenza-web.com/2012/01/mediatable-jquery-plugin/
|
|||
var val = $checkbox.val();
|
||||
var cols = wdg.$table.find("#" + val + ", [headers="+ val +"]");
|
||||
cols.removeAttr('style');
|
||||
$.removeCookie(cookname, { path: '/' });
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -49,6 +49,7 @@ $location = get_location();
|
|||
<script src="<?php echo $web_path; ?>/modules/prettyPhoto/js/jquery.prettyPhoto.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/tag-it/tag-it.min.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/noty/packaged/jquery.noty.packaged.min.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/jquery/jquery.cookie.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/jscroll/jquery.jscroll.min.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/jquery/jquery.qrcode.min.js" language="javascript" type="text/javascript"></script>
|
||||
<script src="<?php echo $web_path; ?>/modules/rhinoslider/js/rhinoslider-1.05.min.js" language="javascript" type="text/javascript"></script>
|
||||
|
|
|
@ -24,7 +24,7 @@ $web_path = AmpConfig::get('web_path');
|
|||
$thcount = 8;
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="album">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -26,7 +26,7 @@ $web_path = AmpConfig::get('web_path');
|
|||
$thcount = 8;
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="artist">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="broadcast">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="catalog">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_catalog essential persist"><?php echo T_('Name'); ?></th>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="channel">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
$web_path = AmpConfig::get('web_path');
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="live_stream">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="playlist">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="share">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_object essential"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&type=share&sort=object', T_('Object'),'sort_share_object'); ?></th>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="smartplaylist">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -24,7 +24,7 @@ $web_path = AmpConfig::get('web_path');
|
|||
$thcount = 8;
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||
<table id="reorder_songs_table_<?php echo $browse->get_filter('album'); ?>" class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table id="reorder_songs_table_<?php echo $browse->get_filter('album'); ?>" class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="song">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -24,7 +24,7 @@ $web_path = AmpConfig::get('web_path');
|
|||
|
||||
?>
|
||||
<?php if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="user">
|
||||
<colgroup>
|
||||
<col id="col_username" />
|
||||
<col id="col_lastseen" />
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
$web_path = AmpConfig::get('web_path');
|
||||
if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php';
|
||||
?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="video">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_play essential"></th>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
*/
|
||||
?>
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0">
|
||||
<table class="tabledata" cellpadding="0" cellspacing="0" data-objecttype="wanted">
|
||||
<thead>
|
||||
<tr class="th-top">
|
||||
<th class="cel_album essential"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&type=wanted&sort=name', T_('Album'),'sort_wanted_album'); ?></th>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue