Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core): wrap initial state into hidden container #46873

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions core/templates/layout.base.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
</head>
<body id="body-public" class="layout-base">
<?php include 'layout.noscript.warning.php'; ?>
<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
<?php include 'layout.initial-state.php'; ?>
<div id="content" class="app-public" role="main">
<?php print_unescaped($_['content']); ?>
</div>
Expand Down
4 changes: 1 addition & 3 deletions core/templates/layout.guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
</head>
<body id="<?php p($_['bodyid']);?>">
<?php include 'layout.noscript.warning.php'; ?>
<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
<?php include 'layout.initial-state.php'; ?>
<div class="wrapper">
<div class="v-align">
<?php if ($_['bodyid'] === 'body-login'): ?>
Expand Down
11 changes: 11 additions & 0 deletions core/templates/layout.initial-state.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
?>
<div id="initial-state-container" style="display: none;">
<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
</div>
6 changes: 2 additions & 4 deletions core/templates/layout.public.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
<?php print_unescaped($_['headers']); ?>
</head>
<body id="<?php p($_['bodyid']);?>">
<?php include('layout.noscript.warning.php'); ?>
<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
<?php include('layout.noscript.warning.php'); ?>
<?php include('layout.initial-state.php'); ?>
<div id="skip-actions">
<?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
<?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
Expand Down
7 changes: 2 additions & 5 deletions core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@
<body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) {
p("data-theme-$themeId ");
}?> data-themes=<?php p(join(',', $_['enabledThemes'])) ?>>
<?php include 'layout.noscript.warning.php'; ?>

<?php foreach ($_['initialStates'] as $app => $initialState) { ?>
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
<?php include 'layout.noscript.warning.php'; ?>
<?php include 'layout.initial-state.php'; ?>

<div id="skip-actions">
<?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
Expand Down
Loading