mirror of
https://codeberg.org/vegvisir/website.git
synced 2025-09-14 00:43:42 +02:00
First (rushed 😦) release of the Vegvisir website. Reviewed-on: https://codeberg.org/vegvisir/website/pulls/1 Co-authored-by: vlw <victor@vlw.se> Co-committed-by: vlw <victor@vlw.se>
77 lines
No EOL
3.4 KiB
PHP
77 lines
No EOL
3.4 KiB
PHP
<?= VV::include("modules/snippet/Snippet.php") ?>
|
|
<?php // General information ?>
|
|
<section class="md">
|
|
<container>
|
|
<p>(Vegvisir 3)</p>
|
|
<h1><code>vegvisir.Navigation.TARGET</code></h1>
|
|
<p>Defines the <a href=""><code>target</code></a> element of a navigation triggered from a <a href="">bound element</a>.</p>
|
|
</container>
|
|
</section>
|
|
<section class="md">
|
|
<container>
|
|
<h1>Description</h1>
|
|
<?= Snippet::put("docs/API/JS/Navigation/TARGET/description", Snippet::JAVASCRIPT) ?>
|
|
<p>This object follows the same syntax as the <code>target</code> attribute of <a href=""><code>HTMLAnchorElement</code></a>.</p>
|
|
<p>If a string is provided to a <code>target</code> attribute of the <a href="">bound element</a> that <strong>isn't</strong> in this enumerable, the string will be treated as a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors" target="_blank">CSS selector</a>.</p>
|
|
</container>
|
|
</section>
|
|
|
|
<?php // Method parameters ?>
|
|
<section class="md">
|
|
<container>
|
|
<h2>Values</h2>
|
|
<p>These values correspond to the value of a <code>target</code> attribute on a <a href="">bound element</a>.</p>
|
|
</container>
|
|
</section>
|
|
<section class="md inset">
|
|
<container>
|
|
<h3><code>_top</code></h3>
|
|
<p>Target <a href=""><code>vegvisir.Navigation.rootShellElement</code></a>. This is the same as performing a normal soft-navigation.</p>
|
|
<p>This is the default behavior if a <code>target</code> attribute is omitted or equals an empty string.</p>
|
|
</container>
|
|
</section>
|
|
<section class="md inset">
|
|
<container>
|
|
<h3><code>_self</code></h3>
|
|
<p>Target the <a href="">bound element</a> itself with the defaults <a href=""><code>vegvisir.Navigation.POSITION.BEFOREEND</code></a> and <a href=""><code>vegvisir.Navigation.MODE.REPLACE</code></a>, which will replace the <a href="">bound element</a> itself with the contents of the destination URL.</p>
|
|
<p>The default position and mode behavior can be overridden with by setting a <a href=""><code>vv-position</code></a> and <a href=""><code>vv-mode</code></a> attribute on the <a href="">bound element</a> respectivly.</p>
|
|
</container>
|
|
</section>
|
|
<section class="md inset">
|
|
<container>
|
|
<h3><code>_blank</code></h3>
|
|
<p>Default browser behavior. The destination URL will open in a new tab or window.</p>
|
|
</container>
|
|
</section>
|
|
<section class="md inset">
|
|
<container>
|
|
<h3><code>_parent</code></h3>
|
|
<p>Target the closest parent <a href="">HTMLElement</a> that has a <a href=""><code>vv-page</code></a> attribute.</p>
|
|
<p><a href=""><code>vegvisir.Navigation.rootShellElement</code></a> will become the target if no parent is found.</p>
|
|
</container>
|
|
</section>
|
|
<section class="md inset">
|
|
<container>
|
|
<h3>default</h3>
|
|
<p>The value of the <a href="">bound element</a>'s <code>target</code> attribute will be treated as a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors" target="_blank">CSS selector</a> if the string value does not equal an entry in this enumerable.</p>
|
|
</container>
|
|
</section>
|
|
|
|
<?php // Examples ?>
|
|
<section class="md">
|
|
<container>
|
|
<h1>Examples</h1>
|
|
</container>
|
|
</section>
|
|
<section class="md inset">
|
|
<container>
|
|
<h2>Basic usage</h2>
|
|
<p>Here's an example that uses a native anchor tag to do various navigations.</p>
|
|
<?= Snippet::put("docs/API/JS/Navigation/TARGET/example-0-0", Snippet::PHP) ?>
|
|
<?= Snippet::put("docs/API/JS/Navigation/TARGET/example-0-1", Snippet::PHP) ?>
|
|
</container>
|
|
</section>
|
|
|
|
<?php // Contribute ?>
|
|
|
|
<?= VV::shell("shells/docs") ?>
|