Skip to content

Commit

Permalink
Merge pull request #46873 from nextcloud/chore/hide-initial-state-int…
Browse files Browse the repository at this point in the history
…o-container

chore(core): wrap initial state into hidden container
  • Loading branch information
AndyScherzinger authored Aug 1, 2024
2 parents c93bd56 + 885ec73 commit 5bfe8df
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
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

0 comments on commit 5bfe8df

Please sign in to comment.