add assets
This commit is contained in:
@@ -28,8 +28,7 @@
|
||||
timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch
|
||||
timezoneOffset: 0,
|
||||
init: function() {
|
||||
const body = document.getElementsByTagName('body')[0];
|
||||
const serverOffset = body.dataset.adminUtcOffset;
|
||||
const serverOffset = document.body.dataset.adminUtcOffset;
|
||||
if (serverOffset) {
|
||||
const localOffset = new Date().getTimezoneOffset() * -60;
|
||||
DateTimeShortcuts.timezoneOffset = localOffset - serverOffset;
|
||||
@@ -48,8 +47,7 @@
|
||||
},
|
||||
// Return the current time while accounting for the server timezone.
|
||||
now: function() {
|
||||
const body = document.getElementsByTagName('body')[0];
|
||||
const serverOffset = body.dataset.adminUtcOffset;
|
||||
const serverOffset = document.body.dataset.adminUtcOffset;
|
||||
if (serverOffset) {
|
||||
const localNow = new Date();
|
||||
const localOffset = localNow.getTimezoneOffset() * -60;
|
||||
|
||||
@@ -7,13 +7,9 @@
|
||||
|
||||
function showAdminPopup(triggeringLink, name_regexp, add_popup) {
|
||||
const name = triggeringLink.id.replace(name_regexp, '');
|
||||
let href = triggeringLink.href;
|
||||
const href = new URL(triggeringLink.href);
|
||||
if (add_popup) {
|
||||
if (href.indexOf('?') === -1) {
|
||||
href += '?_popup=1';
|
||||
} else {
|
||||
href += '&_popup=1';
|
||||
}
|
||||
href.searchParams.set('_popup', 1);
|
||||
}
|
||||
const win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
|
||||
win.focus();
|
||||
|
||||
Reference in New Issue
Block a user