mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-27 07:36:01 +00:00
Add prependHeadContent and optional autofocus flags
This commit is contained in:
@@ -292,6 +292,7 @@ export class PuterHomepageService extends BaseService {
|
||||
path: path,
|
||||
bodyContent: '',
|
||||
headContent: '',
|
||||
prependHeadContent: '',
|
||||
logged_in_user: logged_in_user,
|
||||
guiParams: {
|
||||
...gui_params,
|
||||
@@ -304,6 +305,9 @@ export class PuterHomepageService extends BaseService {
|
||||
|
||||
<head>
|
||||
<title>${e(title)}</title>
|
||||
|
||||
${event.prependHeadContent || ''}
|
||||
|
||||
<link rel="preload" href="${this.config.gui_bundle ?? '/dist/bundle.min.js'}" as="script" />
|
||||
${bundled
|
||||
? `<link rel="preload" href="${this.config.gui_puterjs_bundle || 'https://js.puter.com/v2/'} as="script"></script>`
|
||||
@@ -398,7 +402,7 @@ export class PuterHomepageService extends BaseService {
|
||||
}
|
||||
<!-- END Files from JSON -->
|
||||
|
||||
<!-- Custom header content to be added tthe homepage by extensions -->
|
||||
<!-- Custom header content to be added to the homepage by extensions -->
|
||||
${event.headContent || ''}
|
||||
<!-- END Custom header -->
|
||||
</head>
|
||||
|
||||
@@ -131,7 +131,10 @@ async function UIWindowLogin (options) {
|
||||
if ( options.authError ) {
|
||||
$(this_window).find('.login-error-msg').html(options.authError).fadeIn();
|
||||
}
|
||||
$(this_window).find('.email_or_username').get(0).focus({ preventScroll: true });
|
||||
if ( ! window.disable_login_autofocus )
|
||||
{
|
||||
$(this_window).find('.email_or_username').get(0).focus({ preventScroll: true });
|
||||
}
|
||||
},
|
||||
window_class: 'window-login',
|
||||
window_css: {
|
||||
|
||||
@@ -135,7 +135,10 @@ function UIWindowSignup (options) {
|
||||
if ( options.authError ) {
|
||||
$(el_window).find('.signup-error-msg').html(options.authError).fadeIn();
|
||||
}
|
||||
$(el_window).find('.username').get(0).focus({ preventScroll: true });
|
||||
if ( ! window.disable_signup_autofocus )
|
||||
{
|
||||
$(el_window).find('.username').get(0).focus({ preventScroll: true });
|
||||
}
|
||||
|
||||
// Initialize Turnstile widget with callback to capture token
|
||||
const initTurnstile = () => {
|
||||
|
||||
Reference in New Issue
Block a user