Merge branch '5.5'
authorAlexander Ebert <ebert@woltlab.com>
Tue, 25 Jul 2023 14:16:56 +0000 (16:16 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 25 Jul 2023 14:16:56 +0000 (16:16 +0200)
1  2 
ts/WoltLabSuite/Core/Date/Picker.ts
wcfsetup/install/files/acp/templates/index.tpl
wcfsetup/install/files/js/WoltLabSuite/Core/Date/Picker.js

index c0cb4a8de8942320bb4d33871eea71f762fe3609,d35f4a54b464e180a994823ef88e82d656642867..a8bb6ffa074759158866c7f6af106598cc8b14d8
@@@ -564,19 -531,10 +564,19 @@@ function renderGrid(day?: number, month
  
    // update active day
    if (day) {
-     for (let i = 0; i < 35; i++) {
+     for (let i = 0; i < 37; i++) {
        const cell = _dateCells[i];
  
 -      cell.classList[!cell.classList.contains("otherMonth") && +cell.textContent! === day ? "add" : "remove"]("active");
 +      let active = +cell.textContent! === day;
 +      if (cell.classList.contains("otherMonth") || cell.classList.contains("disabled")) {
 +        active = false;
 +      }
 +
 +      if (active) {
 +        cell.classList.add("active");
 +      } else {
 +        cell.classList.remove("active");
 +      }
      }
  
      _dateGrid.dataset.day = day.toString();
index a4e09610ff77a5c805661a4cbebbe40c3f324a7f,a96b7e1369dfd5ff489e3c414e8d8fa41c4cdb5c..07a5afa3e1b8999ea55d73297d9ed20c1e14ee1d
        {if ENABLE_WOLTLAB_NEWS}
                <div id="news" class="hidden tabMenuContent">
                        <div class="section">
 -                              <iframe
 -                                      id="woltlab_newsfeed"
 -                                      src="https://newsfeed.woltlab.com/{if $__wcf->language->languageCode === 'de'}de{else}en{/if}_light.html"
 -                                      referrerpolicy="no-referrer"
 -                                      sandbox="allow-popups allow-popups-to-escape-sandbox"
 -                              ></iframe>
 +                              <div class="woltlabNewsfeed woltlabNewsfeed--loading">
 +                                      <woltlab-core-loading-indicator size="48"></woltlab-core-loading-indicator>
 +                                      <iframe
 +                                              class="woltlabNewsfeed__iframe"
 +                                              referrerpolicy="no-referrer"
-                                               sandbox
++                                              sandbox="allow-popups allow-popups-to-escape-sandbox"
 +                                      ></iframe>
 +                              </div>
 +
 +                              <script data-eager="true">
 +                              {
 +                                      const languageCode = "{if $__wcf->language->languageCode === 'de'}de{else}en{/if}";
 +                                      let colorScheme = document.documentElement.dataset.colorScheme;
 +                                      const container = document.querySelector(".woltlabNewsfeed");
 +                                      const iframe = container.querySelector(".woltlabNewsfeed__iframe");
 +
 +                                      const updateColorScheme = () => {
 +                                              container.classList.add("woltlabNewsfeed--loading");
 +                                              iframe.addEventListener(
 +                                                      "load",
 +                                                      () => container.classList.remove("woltlabNewsfeed--loading"),
 +                                                      { once: true }
 +                                              );
 +                                              iframe.src = `https://newsfeed.woltlab.com/${ languageCode }_${ colorScheme }.html`;
 +                                      };
 +
 +                                      const observer = new MutationObserver(() => {
 +                                              const newScheme = document.documentElement.dataset.colorScheme;
 +                                              if (newScheme === "light" || newScheme === "dark") {
 +                                                      colorScheme = newScheme;
 +                                                      updateColorScheme();
 +                                              }
 +                                      });
 +                                      observer.observe(document.documentElement, {
 +                                              attributeFilter: ["data-color-scheme"]
 +                                      });
 +
 +                                      updateColorScheme();
 +                              }
 +                              </script>
                        </div>
                </div>
        {/if}
index bcfb8ec537ba4a2488e36d51814d00c9915c66a3,ebb21a9c07ef9dc118b0d56b940a5f04572a0b1e..59755dc92b07474413f1098a36da459abae6eb47
@@@ -470,18 -441,9 +470,18 @@@ define(["require", "exports", "tslib", 
          }
          // update active day
          if (day) {
-             for (let i = 0; i < 35; i++) {
+             for (let i = 0; i < 37; i++) {
                  const cell = _dateCells[i];
 -                cell.classList[!cell.classList.contains("otherMonth") && +cell.textContent === day ? "add" : "remove"]("active");
 +                let active = +cell.textContent === day;
 +                if (cell.classList.contains("otherMonth") || cell.classList.contains("disabled")) {
 +                    active = false;
 +                }
 +                if (active) {
 +                    cell.classList.add("active");
 +                }
 +                else {
 +                    cell.classList.remove("active");
 +                }
              }
              _dateGrid.dataset.day = day.toString();
          }