Add prependHeadContent and optional autofocus flags

This commit is contained in:
jelveh
2026-03-29 10:10:09 -07:00
parent bfea3bbce9
commit 0a6dd0c611
3 changed files with 13 additions and 3 deletions
@@ -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>
+4 -1
View File
@@ -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: {
+4 -1
View File
@@ -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 = () => {