Skip to content

Commit

Permalink
Merge branch 'main' into scroll_to_current_slot
Browse files Browse the repository at this point in the history
  • Loading branch information
campbell-m committed May 31, 2024
2 parents 61a7982 + eeb5003 commit 03da7a5
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 22 deletions.
1 change: 1 addition & 0 deletions web/js/admin.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/datatables.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/datepicker.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

use MRBS\Intl\FormatterFlatpickr;use MRBS\Intl\IntlDatePatternConverter;
Expand Down
1 change: 1 addition & 0 deletions web/js/edit_area.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/edit_entry.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/edit_users.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/functions.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/general.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/import.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/index.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require '../defaultincludes.inc';
Expand Down
5 changes: 3 additions & 2 deletions web/js/init.js.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php
declare(strict_types=1);
namespace MRBS;

require_once "../functions.inc";

http_headers(array("Content-type: application/x-javascript"),
60*30); // 30 minute expiry


// Add a class of "js" so that we know if we're using JavaScript or not.
// jQuery hasn't been loaded yet, so use JavaScript ?>
var html = document.getElementsByTagName('html')[0];
Expand Down
1 change: 1 addition & 0 deletions web/js/kiosk.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
27 changes: 14 additions & 13 deletions web/js/pending.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down Expand Up @@ -29,38 +30,38 @@
pendingDataTable,
i,
colVisIncludeCols;

<?php
// Add a '-' control to the subtables and make them close on clicking it
?>
maintable.find('table.sub th.control')
.text('-');


$(document).on('click', 'table.sub th.control', function () {
var nTr = $(this).closest('.table_container').parent().prev(),
serial = $(this).parent().parent().parent().attr('id').replace('subtable_', '');

$('#subtable_' + serial + '_wrapper').slideUp( function () {
pendingDataTable.row(nTr).child.hide();
nTr.show();
});
});

<?php
// Detach all the subtables from the DOM (detach keeps a copy) so that they
// don't appear, but so that we've got the data when we want to "open" a row
?>
subtables = maintable.find('tr.sub_table').detach();

<?php
// Set up a click event that "opens" the table row and inserts the subtable
?>
maintable.find('td.control')
.text('+');

$(document).on('click', 'td.control', function () {

var nTr = $(this).parent(),
serial = nTr.attr('id').replace('row_', ''),
subtableId = 'subtable_' + serial,
Expand All @@ -71,13 +72,13 @@
<?php
// We want the columns in the main and sub tables to align. So
// find the widths of the main table columns and use those values
// to set the widths of the subtable columns.
// to set the widths of the subtable columns.
?>
maintable.find('tr').eq(0).find('th').each(function(i){
columnDefs.push({width: ($(this).outerWidth()) + "px",
targets: i});
});

columnDefs.push({orderable: false, targets: 0});
columnDefs = columnDefs.concat(getTypes(subtable));

Expand All @@ -93,7 +94,7 @@

$('#subtable_' + serial + '_wrapper').hide().slideDown();
});

<?php // Turn the table into a datatable ?>
tableOptions = {order: [[startTimeCol, 'asc']]};
tableOptions.columnDefs = [{orderable: false, targets: 0}];
Expand All @@ -104,7 +105,7 @@
// this on the dataTables forum. In the meantime we comment out the FixedColumns.
?>
tableOptions.stateSave = false;

<?php
// Remove the first column from the column visibility
// list because it is the control column
Expand All @@ -121,5 +122,5 @@
?>
tableOptions.colReorder = {"fixedColumnsLeft": 1};
pendingDataTable = makeDataTable('#pending_table', tableOptions);

});
1 change: 1 addition & 0 deletions web/js/refresh.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

// Implements Ajax refreshing of the calendar view. Only necessary, obviously,
Expand Down
1 change: 1 addition & 0 deletions web/js/report.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
1 change: 1 addition & 0 deletions web/js/resizable.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down
15 changes: 8 additions & 7 deletions web/js/search.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand All @@ -15,18 +16,18 @@


$(document).on('page_ready', function() {

var searchForm = $('#search_form'),
table = $('#search_results'),
tableOptions;

<?php
// Turn the list of users into a dataTable, provided that we can use
// an Ajax source. Otherwise they just get the old style search page
// with "Next" and "Prev" buttons to get new pages from the server.

// Add in a hidden input to the search form so that we can tell if we are using DataTables
// (which will be if JavaScript is enabled). We need to know this because when we're using an
// (which will be if JavaScript is enabled). We need to know this because when we're using an
// Ajax data source we don't want to send the HTML version of the table data.
?>

Expand All @@ -35,7 +36,7 @@
name: 'datatable',
value: '1'
}).appendTo(searchForm);

if (table.length)
{
tableOptions = {ajax: {url: 'search.php' + ((args.site) ? '?site=' + args.site : ''),
Expand All @@ -51,12 +52,12 @@
data.csrf_token = getCSRFToken();
return data;
}}};

<?php // Get the types and feed those into dataTables ?>
tableOptions.columnDefs = getTypes(table);

makeDataTable('#search_results', tableOptions, {"leftColumns": 1});
}

});

1 change: 1 addition & 0 deletions web/js/view_entry.js.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace MRBS;

require "../defaultincludes.inc";
Expand Down

0 comments on commit 03da7a5

Please sign in to comment.