Your IP : 3.16.159.162


Current Path : /usr/local/mgr5/skins/dragon/
Upload File :
Current File : //usr/local/mgr5/skins/dragon/eula.xsl

<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="UTF-8" indent="yes" />

  <xsl:template match="/">
    <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;&#10;</xsl:text>
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="/doc">
    <html lang="{/doc/@lang}">
      <head>
        <title>
          <xsl:value-of select="/doc/h1[1]"/>
        </title>
        <xsl:if test="/doc/@host">
          <base href='{/doc/@host}{/doc/@theme}{/doc/@img}'/>
        </xsl:if>
        <script language="JavaScript">
          <xsl:if test="not(/doc/@host)">
            document.write("&lt;base href='"+location.protocol+"//"+location.host+"<xsl:value-of select="/doc/@theme"/><xsl:value-of select="/doc/@img"/>'&gt;");
          </xsl:if>
      </script>
      <script>
        let colorScheme = localStorage.getItem('isp_color_scheme');

        if (!colorScheme) {
          colorScheme = 'light';
          localStorage.setItem('isp_color_scheme', colorScheme);
        } else if (colorScheme === 'auto') {
          const matchMedia = window.matchMedia('(prefers-color-scheme: dark)');

          matchMedia.addEventListener('change', event => {
            document.documentElement.setAttribute(
              'data-color-scheme',
              event.matches ? 'dark' : 'light',
            );
          });

          if (matchMedia.matches) {
            colorScheme = 'dark';
          } else {
            colorScheme = 'light';
          }
        }

        document.documentElement.setAttribute('data-color-scheme', colorScheme);
      </script>
      <style>
        :root {
          --isp-c-interstellar: #1a1a1a;
          --isp-c-gandalf-the-grey: #e6e6e6;
          --isp-c-jon-snow: #ffffff;

          --isp-c-malewicz: #263659;
          --isp-c-deep: #3c6cdd;
          --isp-c-blue-velvet: #4778eb;
          --isp-c-mood: #80a6ff;

          --isp-dc-monochrome: var(--isp-c-jon-snow);
          --isp-dc-highway-star: var(--isp-c-malewicz);
          --isp-dc-lapis-lazuli: var(--isp-c-deep);
          --isp-dc-fremen: var(--isp-c-blue-velvet);

          color-scheme: light;
        }

        [data-color-scheme="dark"] {
          --isp-dc-monochrome: var(--isp-c-interstellar);
          --isp-dc-highway-star: var(--isp-c-gandalf-the-grey);
          --isp-dc-lapis-lazuli: var(--isp-c-blue-velvet);
          --isp-dc-fremen: var(--isp-c-mood);

          color-scheme: dark;
        }

        body {
          margin: 0;
          padding: 20px 60px 40px;

          color: var(--isp-dc-highway-star);
          background-color: var(--isp-dc-monochrome);

          font-family: "Ubuntu", system-ui, sans-serif;
          font-size: 14px;
        }

        .buttons {
            display: flex;
            justify-content: center;
            gap: 10px;

            margin-top: 20px;
        }

        .isp-button {
          display: inline-flex;
          align-items: center;
          justify-content: center;

          min-width: 70px;

          height: 35px;

          padding: 0 14px;

          cursor: pointer;
          transition-duration: 0.25s;
          transition-property: background-color, border-color, color;

          border-width: 1px;
          border-style: solid;
          border-radius: 5px;

          font: 14px "Ubuntu", sans-serif;
        }

        .isp-button_theme_primary {
          --isp-icons-main-color: var(--isp-c-jon-snow);
          --isp-icons-success-color: var(--isp-c-jon-snow);
          --isp-icons-danger-color: var(--isp-c-jon-snow);
          --isp-icons-accent-color: var(--isp-c-jon-snow);

          color: var(--isp-c-jon-snow);
          border-color: var(--isp-c-blue-velvet);
          background: var(--isp-c-blue-velvet);
        }

        .isp-button_theme_primary:hover {
          border-color: var(--isp-c-deep);
          background: var(--isp-c-deep);
        }

        .isp-button_theme_secondary {
          --isp-icons-main-color: var(--isp-dc-fremen);
          --isp-icons-success-color: var(--isp-dc-fremen);
          --isp-icons-danger-color: var(--isp-dc-fremen);
          --isp-icons-accent-color: var(--isp-dc-fremen);

          color: var(--isp-dc-fremen);
          border-color: var(--isp-dc-fremen);
          background: transparent;
        }

        .isp-button_theme_secondary:hover {
          color: var(--isp-dc-lapis-lazuli);
          border-color: var(--isp-dc-lapis-lazuli);
          background: transparent;
        }
      </style>
    </head>
    <body>
      <div>
        <xsl:apply-templates/>
      </div>
    </body>
  </html>
</xsl:template>

<xsl:template match="h1">
  <h1>
    <xsl:apply-templates/>
  </h1>
</xsl:template>

<xsl:template match="h2">
  <h2>
    <xsl:apply-templates/>
  </h2>
</xsl:template>

<xsl:template match="div">
  <div>
    <xsl:for-each select="@*">
      <xsl:copy/>
    </xsl:for-each>
    <xsl:apply-templates/>
  </div>
</xsl:template>

<xsl:template match="form">
  <form>
    <xsl:attribute name="onsubmit">
      if (this.checkValidity &amp;&amp; !this.checkValidity()) {
        window.document.querySelector(':invalid').focus();
        return false;
      }
    </xsl:attribute>
    <input type="hidden" name="answer" value="" id="answer"/>
    <input type="hidden" name="func" value="eula"/>
    <input type="hidden" name="newwindow" value="eula"/>
    <xsl:apply-templates/>
  </form>
</xsl:template>

<xsl:template match="field">
  <div class="eula-form-wrapper">
    <div class="eula-form">
      <xsl:copy-of select="*"/>
    </div>
  </div>
</xsl:template>

<xsl:template match="p">
  <p>
    <xsl:apply-templates/>
  </p>
</xsl:template>

<xsl:template match="ul">
  <ul>
    <xsl:apply-templates/>
  </ul>
</xsl:template>

<xsl:template match="li">
  <li>
    <xsl:apply-templates/>
  </li>
</xsl:template>

<xsl:template match="u">
  <u>
    <xsl:apply-templates/>
  </u>
</xsl:template>

<xsl:template match="br">
  <br/>
</xsl:template>

<xsl:template match="buttons">
  <div class="buttons">
    <xsl:apply-templates/>
  </div>
</xsl:template>

<xsl:template match="button">
  <button type="submit" class="isp-button">
    <xsl:attribute name="onclick">
      <xsl:choose>
        <xsl:when test="@action = 'decline'">
          window.location = '<xsl:value-of select="/doc/@binary"/>?func=eula&amp;answer=decline&amp;newwindow=yes';
        </xsl:when>
        <xsl:otherwise>
          document.getElementById('answer').value = '<xsl:value-of select="@action"/>';
        </xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>

    <xsl:attribute name="class">
      <xsl:choose>
        <xsl:when test="@action = 'decline'">
          isp-button isp-button_theme_secondary
        </xsl:when>
        <xsl:otherwise>
          isp-button isp-button_theme_primary
        </xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>

    <xsl:value-of select="@value"/>
  </button>
</xsl:template>

</xsl:stylesheet>