diff --git a/public/docs/PHP/VV/error.php b/public/docs/JS/EVENTS.php similarity index 63% rename from public/docs/PHP/VV/error.php rename to public/docs/JS/EVENTS.php index 7c80fac..790b499 100644 --- a/public/docs/PHP/VV/error.php +++ b/public/docs/JS/EVENTS.php @@ -4,4 +4,4 @@ require_once VV::root("src/Consts.php"); ?> - \ No newline at end of file + \ No newline at end of file diff --git a/public/docs/JS/MODE.php b/public/docs/JS/MODE.php new file mode 100644 index 0000000..d610ade --- /dev/null +++ b/public/docs/JS/MODE.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/POSITION.php b/public/docs/JS/POSITION.php new file mode 100644 index 0000000..9691dfc --- /dev/null +++ b/public/docs/JS/POSITION.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/TARGET.php b/public/docs/JS/TARGET.php new file mode 100644 index 0000000..a12c623 --- /dev/null +++ b/public/docs/JS/TARGET.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/abort.php b/public/docs/JS/abort.php new file mode 100644 index 0000000..77e69ca --- /dev/null +++ b/public/docs/JS/abort.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/bindElements.php b/public/docs/JS/bindElements.php new file mode 100644 index 0000000..13aa9a3 --- /dev/null +++ b/public/docs/JS/bindElements.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/constructor.php b/public/docs/JS/constructor.php new file mode 100644 index 0000000..9e10542 --- /dev/null +++ b/public/docs/JS/constructor.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/index.php b/public/docs/JS/index.php new file mode 100644 index 0000000..626a45e --- /dev/null +++ b/public/docs/JS/index.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/navigate.php b/public/docs/JS/navigate.php new file mode 100644 index 0000000..3476ff9 --- /dev/null +++ b/public/docs/JS/navigate.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/JS/options.php b/public/docs/JS/options.php new file mode 100644 index 0000000..c63465a --- /dev/null +++ b/public/docs/JS/options.php @@ -0,0 +1,7 @@ + + \ No newline at end of file diff --git a/public/docs/v3.1.3/JS/EVENTS.php b/public/docs/v3.1.3/JS/EVENTS.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/EVENTS.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/MODE.php b/public/docs/v3.1.3/JS/MODE.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/MODE.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/POSITION.php b/public/docs/v3.1.3/JS/POSITION.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/POSITION.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/TARGET.php b/public/docs/v3.1.3/JS/TARGET.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/TARGET.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/abort.php b/public/docs/v3.1.3/JS/abort.php new file mode 100644 index 0000000..57d78d9 --- /dev/null +++ b/public/docs/v3.1.3/JS/abort.php @@ -0,0 +1,30 @@ + +
+ +
+

.abort

+

Abort a Vegvisir navigation in action.

+

This is an instance property of vegvisir.Navigation.

+
+
+ +
+
+

Return value

+
+
+

AbortController

+

Returns an instance of AbortController.

+
+
+
+

Examples

+
+
+

Abort a navigation in progress

+

In this example we will perform a simple programmatic Vegvsir navigation and abort it immediately.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/bindElements.php b/public/docs/v3.1.3/JS/bindElements.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/bindElements.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/constructor.php b/public/docs/v3.1.3/JS/constructor.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/constructor.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/index.php b/public/docs/v3.1.3/JS/index.php new file mode 100644 index 0000000..dbe27e3 --- /dev/null +++ b/public/docs/v3.1.3/JS/index.php @@ -0,0 +1,10 @@ + +
+
+ +

JavaScript Cheat Sheet

+

Vegvisir will automatically bind HTMLAnchorElement tags and perform soft-navigation between pages on the same origin.

+

The Navigation lets you interact with, and expand Vegvisirs front-end behavior.

+
+
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/navigate.php b/public/docs/v3.1.3/JS/navigate.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/navigate.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/JS/options.php b/public/docs/v3.1.3/JS/options.php new file mode 100644 index 0000000..1bd72b5 --- /dev/null +++ b/public/docs/v3.1.3/JS/options.php @@ -0,0 +1,53 @@ + +
+ +
+

VV::embed()

+

Inline the contents of any file.

+

This can be very useful for bundling SVGs, plaintext files, HTML, and more for faster page loading.

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to an asset to inline.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns the contents of a file passed to $pathname as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Inlining an SVG icon

+

In this example we will be inlining an SVG icon from /public/assets/icon.svg directly into our page as if it were hardcoded.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/PHP/VV/include.php b/public/docs/v3.1.3/PHP/VV/include.php new file mode 100644 index 0000000..889d0a2 --- /dev/null +++ b/public/docs/v3.1.3/PHP/VV/include.php @@ -0,0 +1,52 @@ + +
+ +
+

VV::include()

+

Inject the compiled output of another Vegvisir page (or other PHP script).

+
+
+ +
+
+

Parameters

+
+
+

string

+

$pathname

+

Path to another Vegvisir page or other PHP file.

+
+
+

bool

+

$relative

+

Flag which when set to:

+
    +
  1. + true +

    Will make $pathname look for a source file relative to root_path.

    +
  2. +
  3. + false +

    Will make $pathname look for a source file relative to the root of the whole filesystem.

    +
  4. +
+
+
+

Return value

+
+
+

string

+

Returns a minified version of the included source file as a string. If a file can not be found at $pathname, an empty string is returned.

+
+
+
+

Examples

+
+
+

Importing a code snippet into a page

+

In this example we will be including a PHP file that contains reusable code (a banner) from /snippets/banner.php into a Vegvisir page /public/index.php.

+
+
+ +
+
\ No newline at end of file diff --git a/public/docs/v3.1.3/PHP/VV/init.php b/public/docs/v3.1.3/PHP/VV/init.php new file mode 100644 index 0000000..1fa5d8e --- /dev/null +++ b/public/docs/v3.1.3/PHP/VV/init.php @@ -0,0 +1,36 @@ + +
+ +
+

VV::init()

+

Initialize the Vegvisir front-end.

+

Place this as close to the bottom of your body tag in your shell_page as possible.

+
+
+ +
+
+

Parameters

+
+
+

This method takes no parameters.

+
+
+

Return value

+
+
+

string

+

Returns a script tag with the compiled and minified JavaScript required to run the Vegvisir front-end.

+
+
+
+

Examples

+
+
+

Initializing a Vegvisir website

+

In this example we will initialize a single-page website with the two required files to run a bare-bones Vegvisir website: /public/index.php and /public/shell.php.

+
+
+ +
+
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/description/syntax.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/description/syntax.js.php new file mode 100644 index 0000000..1908234 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/description/syntax.js.php @@ -0,0 +1 @@ +
new Navigation().abort -> AbortController
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/example_abort/example.js.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/example_abort/example.js.php new file mode 100644 index 0000000..efed215 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/JS/abort/example_abort/example.js.php @@ -0,0 +1 @@ +
const nav = new vegvisir.Navigation("some/page");
// Abort initialized navigation
nav.abort.abort();
// Navigate to URL if not aborted
if (!nav.abort.aborted) {
    nav.navigate();
}
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/description/syntax.php.php new file mode 100644 index 0000000..cd4bb9b --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::include(
        string $pathname,
        bool $relative = true
    ): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/banner.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/banner.php.php new file mode 100644 index 0000000..c66c006 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/banner.php.php @@ -0,0 +1 @@ +
<section class="banner">
    <h1>This snippet can be imported into any page with VV::include()</h1>
    <p>We can also use native PHP templating to perform SSR.</p>
    <p>Did we get a foo? <?= array_key_exists("foo"$_GET) ? "yes we did" : "no we didn't" ?>.</p>
</section>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/compiled.html.php new file mode 100644 index 0000000..5faf7a0 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/compiled.html.php @@ -0,0 +1 @@ +
<main>
    <section class="banner">
        <h1>This snippet can be imported into any page with VV::include()</h1>
        <p>We can also use native PHP templating to perform SSR.</p>
        <p>Did we get a foo? yes we did.</p>
    </section>
    <section>
        <h1>Hey psst!</h1>
        <p>You can pass search parameters to included pages and they will be accessible in their own scope under the $_GET superglobal</p>
    </section>
</main>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/index.php.php new file mode 100644 index 0000000..dfd9fa4 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/include/example_import/index.php.php @@ -0,0 +1 @@ +
<main>
    <?= VV::include("snippets/banner?foo=bar"?>
    <section>
        <h1>Hey psst!</h1>
        <p>You can pass search parameters to included pages and they will be accessible in their own scope under the $_GET superglobal</p>
    </section>
</main>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/description/syntax.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/description/syntax.php.php new file mode 100644 index 0000000..9f78810 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/description/syntax.php.php @@ -0,0 +1 @@ +
<?php
    VV::init(): string
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/compiled.html.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/compiled.html.php new file mode 100644 index 0000000..26113a5 --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/compiled.html.php @@ -0,0 +1 @@ +
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <vv-shell>
        <section>
            <h1>Hey!</h1>
            <p>This index.php file present at the root of the "/public" directory will be loaded as this website's main landing page.</p>
        </section>
    </vv-shell>
    <script>...</script>
</body>
</html>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/index.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/index.php.php new file mode 100644 index 0000000..f99e45d --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/index.php.php @@ -0,0 +1 @@ +
<section>
    <h1>Hey!</h1>
    <p>This index.php file present at the root of the "/public" directory will be loaded as this website's main landing page.</p>
</section>
\ No newline at end of file diff --git a/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/shell.php.php b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/shell.php.php new file mode 100644 index 0000000..369b3eb --- /dev/null +++ b/snippets/HTMLCodeDemoElement/docs/v3.1.3/PHP/VV/init/example_init/shell.php.php @@ -0,0 +1 @@ +
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <?php // The landingpage "/public/index.php" will be loaded INTO this vv-shell element ?>
    <vv-shell></vv-shell>
    <?= VV::init() ?>
</body>
</html>
\ No newline at end of file diff --git a/snippets/docs/v3.1.3/aside.php b/snippets/docs/v3.1.3/aside.php index eb1596c..2cbf6b1 100644 --- a/snippets/docs/v3.1.3/aside.php +++ b/snippets/docs/v3.1.3/aside.php @@ -38,10 +38,6 @@

VV::embed()

- - @@ -61,5 +57,41 @@

JavaScript

+ + + + + + + + + \ No newline at end of file