From 3260e3b76b06d915fd09b5b5d95ab93c500f85b2 Mon Sep 17 00:00:00 2001 From: Ro <47260987+are0h@users.noreply.github.com> Date: Sun, 18 Sep 2022 13:07:52 -0700 Subject: [PATCH] Updated dependencies, replaced Moment Composer package dependencies hadn't been updated in awhile, so a part of the clean up for the php 8.1 install, that has been handled Moment was being used to handle date formatting but it hasn't been updated in awhile either, so I switched to Carbon which is still in active development. --- brain/data/Book.php | 12 +- brain/views/dash/page-edit.twig | 2 +- composer.json | 5 +- composer.lock | 516 ++- public/assets/css/dash.css | 78 +- public/assets/images/global/rikc-logo.svg | 18 +- public/assets/scripts/Start.js | 3783 ++++++++++----------- src/com/actions/PageActions.js | 1 + src/com/ui/FileManager.js | 1 - 9 files changed, 2275 insertions(+), 2141 deletions(-) diff --git a/brain/data/Book.php b/brain/data/Book.php index 4695548..955a731 100644 --- a/brain/data/Book.php +++ b/brain/data/Book.php @@ -2,6 +2,7 @@ namespace brain\data; +use Carbon\Carbon; use brain\utility\DocTools; use brain\utility\StringTools; use brain\utility\FileUploader; @@ -65,9 +66,10 @@ class Book if (isset($files['page_files'])) { $imageList = ''; $fileList = ''; - // var_dump($files["page_files"] ); + //var_dump($files['page_files']); foreach ($files['page_files'] as $file) { $type = $file->getClientMediaType(); + //var_dump($type); switch ($type) { case 'image/jpeg': case 'image/png': @@ -129,10 +131,10 @@ class Book $deleted = isset($page['deleted']) ? $page['deleted'] : 'false'; } - $created = $task != 'create' - ? new \Moment\Moment($page['rawCreated']) - : new \Moment\Moment(); - $updated = new \Moment\Moment(); + //TODO: switch to Carbon for Date formatting + // https://carbon.nesbot.com/ + $created = $task != 'create' ? new Carbon($page['rawCreated']) : Carbon::now(); + $updated = Carbon::now(); // grab current index from settings and update $id = $task != 'create' ? $body['id'] : Settings::getCurrentIndex(); diff --git a/brain/views/dash/page-edit.twig b/brain/views/dash/page-edit.twig index 2477ed9..f069689 100644 --- a/brain/views/dash/page-edit.twig +++ b/brain/views/dash/page-edit.twig @@ -194,5 +194,5 @@ {% endblock %} {% block javascripts %} - + {% endblock %} diff --git a/composer.json b/composer.json index da31ce9..cadd4bb 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "phpmailer/phpmailer": "^6.4", "league/commonmark": "^2.1", "symfony/yaml": "^5.4", - "olegatro/html-sanitizer-relative": "^1.0" + "olegatro/html-sanitizer-relative": "^1.0", + "nesbot/carbon": "^2.62" } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index db3cf63..698a8ac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cfedfb006726f5c6b4bac05285ccf5e8", + "content-hash": "5265e13cf91844428ed9c0e717a0f370", "packages": [ { "name": "dflydev/dot-access-data", @@ -246,16 +246,16 @@ }, { "name": "league/commonmark", - "version": "2.3.1", + "version": "2.3.5", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "cb36fee279f7fca01d5d9399ddd1b37e48e2eca1" + "reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/cb36fee279f7fca01d5d9399ddd1b37e48e2eca1", - "reference": "cb36fee279f7fca01d5d9399ddd1b37e48e2eca1", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/84d74485fdb7074f4f9dd6f02ab957b1de513257", + "reference": "84d74485fdb7074f4f9dd6f02ab957b1de513257", "shasum": "" }, "require": { @@ -277,13 +277,13 @@ "github/gfm": "0.29.0", "michelf/php-markdown": "^1.4", "nyholm/psr7": "^1.5", - "phpstan/phpstan": "^0.12.88 || ^1.0.0", - "phpunit/phpunit": "^9.5.5", + "phpstan/phpstan": "^1.8.2", + "phpunit/phpunit": "^9.5.21", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3", + "symfony/finder": "^5.3 | ^6.0", "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0", - "unleashedtech/php-coding-standard": "^3.1", - "vimeo/psalm": "^4.7.3" + "unleashedtech/php-coding-standard": "^3.1.1", + "vimeo/psalm": "^4.24.0" }, "suggest": { "symfony/yaml": "v2.3+ required if using the Front Matter extension" @@ -348,7 +348,7 @@ "type": "tidelift" } ], - "time": "2022-05-14T15:37:39+00:00" + "time": "2022-07-29T10:59:45+00:00" }, { "name": "league/config", @@ -558,16 +558,16 @@ }, { "name": "masterminds/html5", - "version": "2.7.5", + "version": "2.7.6", "source": { "type": "git", "url": "https://github.com/Masterminds/html5-php.git", - "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab" + "reference": "897eb517a343a2281f11bc5556d6548db7d93947" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/f640ac1bdddff06ea333a920c95bbad8872429ab", - "reference": "f640ac1bdddff06ea333a920c95bbad8872429ab", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/897eb517a343a2281f11bc5556d6548db7d93947", + "reference": "897eb517a343a2281f11bc5556d6548db7d93947", "shasum": "" }, "require": { @@ -621,9 +621,9 @@ ], "support": { "issues": "https://github.com/Masterminds/html5-php/issues", - "source": "https://github.com/Masterminds/html5-php/tree/2.7.5" + "source": "https://github.com/Masterminds/html5-php/tree/2.7.6" }, - "time": "2021-07-01T14:25:37+00:00" + "time": "2022-08-18T16:18:26+00:00" }, { "name": "mnapoli/front-yaml", @@ -664,6 +664,108 @@ }, "time": "2020-12-04T10:52:19+00:00" }, + { + "name": "nesbot/carbon", + "version": "2.62.1", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", + "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "ondrejmirtes/better-reflection": "*", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.99 || ^1.7.14", + "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2022-09-02T07:48:13+00:00" + }, { "name": "nette/schema", "version": "v1.2.2", @@ -728,20 +830,20 @@ }, { "name": "nette/utils", - "version": "v3.2.7", + "version": "v3.2.8", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99" + "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/0af4e3de4df9f1543534beab255ccf459e7a2c99", - "reference": "0af4e3de4df9f1543534beab255ccf459e7a2c99", + "url": "https://api.github.com/repos/nette/utils/zipball/02a54c4c872b99e4ec05c4aec54b5a06eb0f6368", + "reference": "02a54c4c872b99e4ec05c4aec54b5a06eb0f6368", "shasum": "" }, "require": { - "php": ">=7.2 <8.2" + "php": ">=7.2 <8.3" }, "conflict": { "nette/di": "<3.0.6" @@ -807,9 +909,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.7" + "source": "https://github.com/nette/utils/tree/v3.2.8" }, - "time": "2022-01-24T11:29:14+00:00" + "time": "2022-09-12T23:36:20+00:00" }, { "name": "nikic/fast-route", @@ -905,16 +1007,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.0", + "version": "v6.6.4", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1" + "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e43bac82edc26ca04b36143a48bde1c051cfd5b1", - "reference": "e43bac82edc26ca04b36143a48bde1c051cfd5b1", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", + "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", "shasum": "" }, "require": { @@ -926,8 +1028,8 @@ "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "doctrine/annotations": "^1.2", - "php-parallel-lint/php-console-highlighter": "^0.5.0", - "php-parallel-lint/php-parallel-lint": "^1.3.1", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", "squizlabs/php_codesniffer": "^3.6.2", @@ -971,7 +1073,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.0" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" }, "funding": [ { @@ -979,7 +1081,7 @@ "type": "github" } ], - "time": "2022-02-28T15:31:21+00:00" + "time": "2022-08-22T09:22:00+00:00" }, { "name": "psr/container", @@ -1460,16 +1562,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -1522,7 +1624,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -1530,7 +1632,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/diff", @@ -1600,16 +1702,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -1665,7 +1767,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -1673,7 +1775,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/recursion-context", @@ -2002,7 +2104,7 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -2049,7 +2151,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, "funding": [ { @@ -2069,16 +2171,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -2093,7 +2195,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2131,7 +2233,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -2147,20 +2249,20 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "433d05519ce6990bf3530fba6957499d327395c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", + "reference": "433d05519ce6990bf3530fba6957499d327395c2", "shasum": "" }, "require": { @@ -2172,7 +2274,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2212,7 +2314,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" }, "funding": [ { @@ -2228,20 +2330,20 @@ "type": "tidelift" } ], - "time": "2021-11-23T21:10:46+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "219aa369ceff116e673852dce47c3a41794c14bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", + "reference": "219aa369ceff116e673852dce47c3a41794c14bd", "shasum": "" }, "require": { @@ -2253,7 +2355,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2296,7 +2398,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" }, "funding": [ { @@ -2312,20 +2414,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -2340,7 +2442,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2379,7 +2481,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -2395,20 +2497,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -2417,7 +2519,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2462,7 +2564,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -2478,20 +2580,20 @@ "type": "tidelift" } ], - "time": "2022-03-04T08:16:47+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", "shasum": "" }, "require": { @@ -2500,7 +2602,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2541,7 +2643,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" }, "funding": [ { @@ -2557,20 +2659,20 @@ "type": "tidelift" } ], - "time": "2021-09-13T13:58:11+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/property-access", - "version": "v5.4.8", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "fe501d498d6ec7e9efe928c90fabedf629116495" + "reference": "c641d63e943ed31981bad4b4dcf29fe7da2ffa8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/fe501d498d6ec7e9efe928c90fabedf629116495", - "reference": "fe501d498d6ec7e9efe928c90fabedf629116495", + "url": "https://api.github.com/repos/symfony/property-access/zipball/c641d63e943ed31981bad4b4dcf29fe7da2ffa8c", + "reference": "c641d63e943ed31981bad4b4dcf29fe7da2ffa8c", "shasum": "" }, "require": { @@ -2622,7 +2724,7 @@ "reflection" ], "support": { - "source": "https://github.com/symfony/property-access/tree/v5.4.8" + "source": "https://github.com/symfony/property-access/tree/v5.4.11" }, "funding": [ { @@ -2638,20 +2740,20 @@ "type": "tidelift" } ], - "time": "2022-04-12T15:48:08+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/property-info", - "version": "v6.0.7", + "version": "v6.0.11", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "0f26f0870f05d65d5c06681ecbf36e546204f4b5" + "reference": "518f172491b9c09afd5d963f783909b80c4b0308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/0f26f0870f05d65d5c06681ecbf36e546204f4b5", - "reference": "0f26f0870f05d65d5c06681ecbf36e546204f4b5", + "url": "https://api.github.com/repos/symfony/property-info/zipball/518f172491b9c09afd5d963f783909b80c4b0308", + "reference": "518f172491b9c09afd5d963f783909b80c4b0308", "shasum": "" }, "require": { @@ -2711,7 +2813,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v6.0.7" + "source": "https://github.com/symfony/property-info/tree/v6.0.11" }, "funding": [ { @@ -2727,20 +2829,20 @@ "type": "tidelift" } ], - "time": "2022-03-31T17:18:25+00:00" + "time": "2022-07-19T08:33:44+00:00" }, { "name": "symfony/string", - "version": "v6.0.8", + "version": "v6.0.12", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d" + "reference": "3a975ba1a1508ad97df45f4590f55b7cc4c1a0a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", - "reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d", + "url": "https://api.github.com/repos/symfony/string/zipball/3a975ba1a1508ad97df45f4590f55b7cc4c1a0a0", + "reference": "3a975ba1a1508ad97df45f4590f55b7cc4c1a0a0", "shasum": "" }, "require": { @@ -2796,7 +2898,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.0.8" + "source": "https://github.com/symfony/string/tree/v6.0.12" }, "funding": [ { @@ -2812,20 +2914,193 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:02+00:00" + "time": "2022-08-12T18:05:20+00:00" }, { - "name": "symfony/yaml", - "version": "v5.4.3", + "name": "symfony/translation", + "version": "v6.0.12", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2" + "url": "https://github.com/symfony/translation.git", + "reference": "5e71973b4991e141271465dacf4bf9e719941424" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2", + "url": "https://api.github.com/repos/symfony/translation/zipball/5e71973b4991e141271465dacf4bf9e719941424", + "reference": "5e71973b4991e141271465dacf4bf9e719941424", + "shasum": "" + }, + "require": { + "php": ">=8.0.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.3|^3.0" + }, + "conflict": { + "symfony/config": "<5.4", + "symfony/console": "<5.4", + "symfony/dependency-injection": "<5.4", + "symfony/http-kernel": "<5.4", + "symfony/twig-bundle": "<5.4", + "symfony/yaml": "<5.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^5.4|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/finder": "^5.4|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.4|^6.0", + "symfony/intl": "^5.4|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^5.4|^6.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v6.0.12" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-08-02T16:01:06+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/acbfbb274e730e5a0236f619b6168d9dedb3e282", + "reference": "acbfbb274e730e5a0236f619b6168d9dedb3e282", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-06-27T17:10:44+00:00" + }, + { + "name": "symfony/yaml", + "version": "v5.4.12", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", + "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", "shasum": "" }, "require": { @@ -2871,7 +3146,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.3" + "source": "https://github.com/symfony/yaml/tree/v5.4.12" }, "funding": [ { @@ -2887,7 +3162,7 @@ "type": "tidelift" } ], - "time": "2022-01-26T16:32:32+00:00" + "time": "2022-08-02T15:52:22+00:00" }, { "name": "tgalopin/html-sanitizer", @@ -2935,20 +3210,21 @@ "issues": "https://github.com/tgalopin/html-sanitizer/issues", "source": "https://github.com/tgalopin/html-sanitizer/tree/1.5.0" }, + "abandoned": "symfony/html-sanitizer", "time": "2021-09-14T08:27:50+00:00" }, { "name": "twig/twig", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342" + "reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/e939eae92386b69b49cfa4599dd9bead6bf4a342", - "reference": "e939eae92386b69b49cfa4599dd9bead6bf4a342", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077", + "reference": "e07cdd3d430cd7e453c31b36eb5ad6c0c5e43077", "shasum": "" }, "require": { @@ -2999,7 +3275,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.4.1" + "source": "https://github.com/twigphp/Twig/tree/v3.4.2" }, "funding": [ { @@ -3011,7 +3287,7 @@ "type": "tidelift" } ], - "time": "2022-05-17T05:48:52+00:00" + "time": "2022-08-12T06:47:24+00:00" } ], "packages-dev": [], diff --git a/public/assets/css/dash.css b/public/assets/css/dash.css index a5ebd7d..1935f00 100644 --- a/public/assets/css/dash.css +++ b/public/assets/css/dash.css @@ -1652,8 +1652,7 @@ * 2. Prevent adjustments of font size after orientation changes in iOS. */ html { - line-height: 1.15; - /* 1 */ + line-height: 1.15; /* 1 */ } /* Sections @@ -1688,12 +1687,9 @@ h1 { * 2. Show the overflow in Edge and IE. */ hr { - box-sizing: content-box; - /* 1 */ - height: 0; - /* 1 */ - overflow: visible; - /* 2 */ + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ } /** @@ -1701,10 +1697,8 @@ hr { * 2. Correct the odd `em` font sizing in all browsers. */ pre { - font-family: monospace; - /* 1 */ - font-size: 1em; - /* 2 */ + font-family: monospace; /* 1 */ + font-size: 1em; /* 2 */ } /* Text-level semantics @@ -1721,12 +1715,9 @@ a { * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. */ abbr[title] { - border-bottom: none; - /* 1 */ - text-decoration: underline; - /* 2 */ - text-decoration: underline dotted; - /* 2 */ + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ } /** @@ -1744,10 +1735,8 @@ strong { code, kbd, samp { - font-family: monospace; - /* 1 */ - font-size: 1em; - /* 2 */ + font-family: monospace; /* 1 */ + font-size: 1em; /* 2 */ } /** @@ -1797,14 +1786,10 @@ input, optgroup, select, textarea { - font-family: inherit; - /* 1 */ - font-size: 100%; - /* 1 */ - line-height: 1.15; - /* 1 */ - margin: 0; - /* 2 */ + font-family: inherit; /* 1 */ + font-size: 100%; /* 1 */ + line-height: 1.15; /* 1 */ + margin: 0; /* 2 */ } /** @@ -1865,18 +1850,12 @@ fieldset { * `fieldset` elements in all browsers. */ legend { - box-sizing: border-box; - /* 1 */ - color: inherit; - /* 2 */ - display: table; - /* 1 */ - max-width: 100%; - /* 1 */ - padding: 0; - /* 3 */ - white-space: normal; - /* 1 */ + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ } /** @@ -1899,10 +1878,8 @@ textarea { */ [type=checkbox], [type=radio] { - box-sizing: border-box; - /* 1 */ - padding: 0; - /* 2 */ + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ } /** @@ -1918,8 +1895,7 @@ textarea { * 2. Correct the outline style in Safari. */ [type=search] { - outline-offset: -2px; - /* 2 */ + outline-offset: -2px; /* 2 */ } /** @@ -1930,8 +1906,7 @@ textarea { * 2. Change font properties to `inherit` in Safari. */ ::-webkit-file-upload-button { - font: inherit; - /* 2 */ + font: inherit; /* 2 */ } /* Interactive @@ -3570,7 +3545,6 @@ select { display: none; visibility: hidden; } - #post-edit-index #post-edit-index-wrapper #post-header #post-title #post-options { margin: 5px 0 0; width: 100%; @@ -3591,7 +3565,6 @@ select { display: none; visibility: hidden; } - #post-edit-index #post-edit-index-wrapper #post-header #post-title #post-title-text { width: 96.4%; } @@ -3925,7 +3898,6 @@ select { width: auto; width: 100%; } - .dp-day-of-week, .dp-day { padding: 8px; diff --git a/public/assets/images/global/rikc-logo.svg b/public/assets/images/global/rikc-logo.svg index 3c55698..56bdf9d 100644 --- a/public/assets/images/global/rikc-logo.svg +++ b/public/assets/images/global/rikc-logo.svg @@ -1,15 +1,13 @@ - - - - - + + + - - - + + + - - + + diff --git a/public/assets/scripts/Start.js b/public/assets/scripts/Start.js index 85f5177..45dd849 100644 --- a/public/assets/scripts/Start.js +++ b/public/assets/scripts/Start.js @@ -80,11 +80,13 @@ return cache[name].exports; function localRequire(x) { - return newRequire(localRequire.resolve(x)); + var res = localRequire.resolve(x); + return res === false ? {} : newRequire(res); } function resolve(x) { - return modules[name][1][x] || x; + var id = modules[name][1][x]; + return id != null ? id : x; } } @@ -140,77 +142,15 @@ this[globalName] = mainExports; } } -})({"jRsG2":[function(require,module,exports) { +})({"hHepG":[function(require,module,exports) { +"use strict"; +var global = arguments[3]; var HMR_HOST = null; var HMR_PORT = 1234; var HMR_SECURE = false; -var HMR_ENV_HASH = "4a236f9275d0a351"; -module.bundle.HMR_BUNDLE_ID = "770375bf412ba982"; -"use strict"; -function _createForOfIteratorHelper(o, allowArrayLike) { - var it; - if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - var F = function F() { - }; - return { - s: F, - n: function n() { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] - }; - }, - e: function e(_e) { - throw _e; - }, - f: F - }; - } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - var normalCompletion = true, didErr = false, err; - return { - s: function s() { - it = o[Symbol.iterator](); - }, - n: function n() { - var step = it.next(); - normalCompletion = step.done; - return step; - }, - e: function e(_e2) { - didErr = true; - err = _e2; - }, - f: function f() { - try { - if (!normalCompletion && it.return != null) it.return(); - } finally{ - if (didErr) throw err; - } - } - }; -} -function _unsupportedIterableToArray(o, minLen) { - if (!o) return; - if (typeof o === "string") return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) n = o.constructor.name; - if (n === "Map" || n === "Set") return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); -} -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) len = arr.length; - for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i]; - return arr2; -} -/* global HMR_HOST, HMR_PORT, HMR_ENV_HASH, HMR_SECURE */ /*:: +var HMR_ENV_HASH = "d6ea1d42532a7575"; +module.bundle.HMR_BUNDLE_ID = "57183d3b35a81405"; +/* global HMR_HOST, HMR_PORT, HMR_ENV_HASH, HMR_SECURE, chrome, browser, importScripts */ /*:: import type { HMRAsset, HMRMessage, @@ -237,12 +177,19 @@ interface ParcelModule { _disposeCallbacks: Array<(mixed) => void>, |}; } +interface ExtensionContext { + runtime: {| + reload(): void, + |}; +} declare var module: {bundle: ParcelRequire, ...}; declare var HMR_HOST: string; declare var HMR_PORT: string; declare var HMR_ENV_HASH: string; declare var HMR_SECURE: boolean; -*/ var OVERLAY_ID = '__parcel__error__overlay__'; +declare var chrome: ExtensionContext; +declare var browser: ExtensionContext; +*/ var OVERLAY_ID = "__parcel__error__overlay__"; var OldModule = module.bundle.Module; function Module(moduleName) { OldModule.call(this, moduleName); @@ -250,72 +197,70 @@ function Module(moduleName) { data: module.bundle.hotData, _acceptCallbacks: [], _disposeCallbacks: [], - accept: function accept(fn) { - this._acceptCallbacks.push(fn || function() { - }); + accept: function(fn) { + this._acceptCallbacks.push(fn || function() {}); }, - dispose: function dispose(fn) { + dispose: function(fn) { this._disposeCallbacks.push(fn); } }; module.bundle.hotData = undefined; } module.bundle.Module = Module; -var checkedAssets, acceptedAssets, assetsToAccept; +var checkedAssets, acceptedAssets, assetsToAccept /*: Array<[ParcelRequire, string]> */ ; function getHostname() { - return HMR_HOST || (location.protocol.indexOf('http') === 0 ? location.hostname : 'localhost'); + return HMR_HOST || (location.protocol.indexOf("http") === 0 ? location.hostname : "localhost"); } function getPort() { return HMR_PORT || location.port; } // eslint-disable-next-line no-redeclare var parent = module.bundle.parent; -if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') { +if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== "undefined") { var hostname = getHostname(); var port = getPort(); - var protocol = HMR_SECURE || location.protocol == 'https:' && !/localhost|127.0.0.1|0.0.0.0/.test(hostname) ? 'wss' : 'ws'; - var ws = new WebSocket(protocol + '://' + hostname + (port ? ':' + port : '') + '/'); // $FlowFixMe - ws.onmessage = function(event) { - checkedAssets = { - }; - acceptedAssets = { - }; + var protocol = HMR_SECURE || location.protocol == "https:" && !/localhost|127.0.0.1|0.0.0.0/.test(hostname) ? "wss" : "ws"; + var ws = new WebSocket(protocol + "://" + hostname + (port ? ":" + port : "") + "/"); // Safari doesn't support sourceURL in error stacks. + // eval may also be disabled via CSP, so do a quick check. + var supportsSourceURL = false; + try { + (0, eval)('throw new Error("test"); //# sourceURL=test.js'); + } catch (err) { + supportsSourceURL = err.stack.includes("test.js"); + } // $FlowFixMe + ws.onmessage = async function(event) { + checkedAssets = {} /*: {|[string]: boolean|} */ ; + acceptedAssets = {} /*: {|[string]: boolean|} */ ; assetsToAccept = []; var data = JSON.parse(event.data); - if (data.type === 'update') { + if (data.type === "update") { // Remove error overlay if there is one - if (typeof document !== 'undefined') removeErrorOverlay(); - var assets = data.assets.filter(function(asset) { - return asset.envHash === HMR_ENV_HASH; - }); // Handle HMR Update - var handled = assets.every(function(asset) { - return asset.type === 'css' || asset.type === 'js' && hmrAcceptCheck(module.bundle.root, asset.id, asset.depsByBundle); + if (typeof document !== "undefined") removeErrorOverlay(); + let assets = data.assets.filter((asset)=>asset.envHash === HMR_ENV_HASH); // Handle HMR Update + let handled = assets.every((asset)=>{ + return asset.type === "css" || asset.type === "js" && hmrAcceptCheck(module.bundle.root, asset.id, asset.depsByBundle); }); if (handled) { - console.clear(); - assets.forEach(function(asset) { - hmrApply(module.bundle.root, asset); - }); + console.clear(); // Dispatch custom event so other runtimes (e.g React Refresh) are aware. + if (typeof window !== "undefined" && typeof CustomEvent !== "undefined") window.dispatchEvent(new CustomEvent("parcelhmraccept")); + await hmrApplyUpdates(assets); for(var i = 0; i < assetsToAccept.length; i++){ var id = assetsToAccept[i][1]; if (!acceptedAssets[id]) hmrAcceptRun(assetsToAccept[i][0], id); } - } else window.location.reload(); - } - if (data.type === 'error') { - // Log parcel errors to console - var _iterator = _createForOfIteratorHelper(data.diagnostics.ansi), _step; - try { - for(_iterator.s(); !(_step = _iterator.n()).done;){ - var ansiDiagnostic = _step.value; - var stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack; - console.error('🚨 [parcel]: ' + ansiDiagnostic.message + '\n' + stack + '\n\n' + ansiDiagnostic.hints.join('\n')); - } - } catch (err) { - _iterator.e(err); - } finally{ - _iterator.f(); + } else if ("reload" in location) location.reload(); + else { + // Web extension context + var ext = typeof chrome === "undefined" ? typeof browser === "undefined" ? null : browser : chrome; + if (ext && ext.runtime && ext.runtime.reload) ext.runtime.reload(); } - if (typeof document !== 'undefined') { + } + if (data.type === "error") { + // Log parcel errors to console + for (let ansiDiagnostic of data.diagnostics.ansi){ + let stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack; + console.error("\uD83D\uDEA8 [parcel]: " + ansiDiagnostic.message + "\n" + stack + "\n\n" + ansiDiagnostic.hints.join("\n")); + } + if (typeof document !== "undefined") { // Render the fancy html overlay removeErrorOverlay(); var overlay = createErrorOverlay(data.diagnostics.html); // $FlowFixMe @@ -327,35 +272,40 @@ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') { console.error(e.message); }; ws.onclose = function() { - console.warn('[parcel] 🚨 Connection to the HMR server was lost'); + console.warn("[parcel] \uD83D\uDEA8 Connection to the HMR server was lost"); }; } function removeErrorOverlay() { var overlay = document.getElementById(OVERLAY_ID); if (overlay) { overlay.remove(); - console.log('[parcel] ✨ Error resolved'); + console.log("[parcel] \u2728 Error resolved"); } } function createErrorOverlay(diagnostics) { - var overlay = document.createElement('div'); + var overlay = document.createElement("div"); overlay.id = OVERLAY_ID; - var errorHTML = '
'; - var _iterator2 = _createForOfIteratorHelper(diagnostics), _step2; - try { - for(_iterator2.s(); !(_step2 = _iterator2.n()).done;){ - var diagnostic = _step2.value; - var stack = diagnostic.codeframe ? diagnostic.codeframe : diagnostic.stack; - errorHTML += "\n
\n
\n \uD83D\uDEA8 ".concat(diagnostic.message, "\n
\n
").concat(stack, "
\n
\n ").concat(diagnostic.hints.map(function(hint) { - return '
💡 ' + hint + '
'; - }).join(''), "\n
\n ").concat(diagnostic.documentation ? "
\uD83D\uDCDD Learn more
") : '', "\n
\n "); - } - } catch (err) { - _iterator2.e(err); - } finally{ - _iterator2.f(); + let errorHTML = '
'; + for (let diagnostic of diagnostics){ + let stack = diagnostic.frames.length ? diagnostic.frames.reduce((p, frame)=>{ + return `${p} +${frame.location} +${frame.code}`; + }, "") : diagnostic.stack; + errorHTML += ` +
+
+ 🚨 ${diagnostic.message} +
+
${stack}
+
+ ${diagnostic.hints.map((hint)=>"
\uD83D\uDCA1 " + hint + "
").join("")} +
+ ${diagnostic.documentation ? `
📝 Learn more
` : ""} +
+ `; } - errorHTML += '
'; + errorHTML += "
"; overlay.innerHTML = errorHTML; return overlay; } @@ -380,7 +330,7 @@ function updateLink(link) { if (link.parentNode !== null) // $FlowFixMe link.parentNode.removeChild(link); }; - newLink.setAttribute('href', link.getAttribute('href').split('?')[0] + '?' + Date.now()); // $FlowFixMe + newLink.setAttribute("href", link.getAttribute("href").split("?")[0] + "?" + Date.now()); // $FlowFixMe link.parentNode.insertBefore(newLink, link.nextSibling); } var cssTimeout = null; @@ -390,23 +340,82 @@ function reloadCSS() { var links = document.querySelectorAll('link[rel="stylesheet"]'); for(var i = 0; i < links.length; i++){ // $FlowFixMe[incompatible-type] - var href = links[i].getAttribute('href'); + var href = links[i].getAttribute("href"); var hostname = getHostname(); - var servedFromHMRServer = hostname === 'localhost' ? new RegExp('^(https?:\\/\\/(0.0.0.0|127.0.0.1)|localhost):' + getPort()).test(href) : href.indexOf(hostname + ':' + getPort()); - var absolute = /^https?:\/\//i.test(href) && href.indexOf(window.location.origin) !== 0 && !servedFromHMRServer; + var servedFromHMRServer = hostname === "localhost" ? new RegExp("^(https?:\\/\\/(0.0.0.0|127.0.0.1)|localhost):" + getPort()).test(href) : href.indexOf(hostname + ":" + getPort()); + var absolute = /^https?:\/\//i.test(href) && href.indexOf(location.origin) !== 0 && !servedFromHMRServer; if (!absolute) updateLink(links[i]); } cssTimeout = null; }, 50); } +async function hmrApplyUpdates(assets) { + global.parcelHotUpdate = Object.create(null); + let scriptsToRemove; + try { + // If sourceURL comments aren't supported in eval, we need to load + // the update from the dev server over HTTP so that stack traces + // are correct in errors/logs. This is much slower than eval, so + // we only do it if needed (currently just Safari). + // https://bugs.webkit.org/show_bug.cgi?id=137297 + // This path is also taken if a CSP disallows eval. + if (!supportsSourceURL) { + let promises = assets.map((asset)=>{ + if (asset.type === "js") { + if (typeof document !== "undefined") { + let script = document.createElement("script"); + script.src = asset.url; + return new Promise((resolve, reject)=>{ + var _document$head; + script.onload = ()=>resolve(script); + script.onerror = reject; + (_document$head = document.head) === null || _document$head === void 0 || _document$head.appendChild(script); + }); + } else if (typeof importScripts === "function") return new Promise((resolve, reject)=>{ + try { + importScripts(asset.url); + } catch (err) { + reject(err); + } + }); + } + }); + scriptsToRemove = await Promise.all(promises); + } + assets.forEach(function(asset) { + hmrApply(module.bundle.root, asset); + }); + } finally{ + delete global.parcelHotUpdate; + if (scriptsToRemove) scriptsToRemove.forEach((script)=>{ + if (script) { + var _document$head2; + (_document$head2 = document.head) === null || _document$head2 === void 0 || _document$head2.removeChild(script); + } + }); + } +} function hmrApply(bundle, asset) { var modules = bundle.modules; if (!modules) return; - if (asset.type === 'css') reloadCSS(); - else if (asset.type === 'js') { - var deps = asset.depsByBundle[bundle.HMR_BUNDLE_ID]; + if (asset.type === "css") reloadCSS(); + else if (asset.type === "js") { + let deps = asset.depsByBundle[bundle.HMR_BUNDLE_ID]; if (deps) { - var fn = new Function('require', 'module', 'exports', asset.output); + if (modules[asset.id]) { + // Remove dependencies that are removed and will become orphaned. + // This is necessary so that if the asset is added back again, the cache is gone, and we prevent a full page reload. + let oldDeps = modules[asset.id][1]; + for(let dep in oldDeps)if (!deps[dep] || deps[dep] !== oldDeps[dep]) { + let id = oldDeps[dep]; + let parents = getParents(module.bundle.root, id); + if (parents.length === 1) hmrDelete(module.bundle.root, id); + } + } + if (supportsSourceURL) // Global eval. We would use `new Function` here but browser + // support for source maps is better with eval. + (0, eval)(asset.output); + let fn = global.parcelHotUpdate[asset.id]; modules[asset.id] = [ fn, deps @@ -414,7 +423,48 @@ function hmrApply(bundle, asset) { } else if (bundle.parent) hmrApply(bundle.parent, asset); } } +function hmrDelete(bundle, id1) { + let modules = bundle.modules; + if (!modules) return; + if (modules[id1]) { + // Collect dependencies that will become orphaned when this module is deleted. + let deps = modules[id1][1]; + let orphans = []; + for(let dep in deps){ + let parents = getParents(module.bundle.root, deps[dep]); + if (parents.length === 1) orphans.push(deps[dep]); + } // Delete the module. This must be done before deleting dependencies in case of circular dependencies. + delete modules[id1]; + delete bundle.cache[id1]; // Now delete the orphans. + orphans.forEach((id)=>{ + hmrDelete(module.bundle.root, id); + }); + } else if (bundle.parent) hmrDelete(bundle.parent, id1); +} function hmrAcceptCheck(bundle, id, depsByBundle) { + if (hmrAcceptCheckOne(bundle, id, depsByBundle)) return true; + // Traverse parents breadth first. All possible ancestries must accept the HMR update, or we'll reload. + let parents = getParents(module.bundle.root, id); + let accepted = false; + while(parents.length > 0){ + let v = parents.shift(); + let a = hmrAcceptCheckOne(v[0], v[1], null); + if (a) // If this parent accepts, stop traversing upward, but still consider siblings. + accepted = true; + else { + // Otherwise, queue the parents in the next level upward. + let p = getParents(module.bundle.root, v[1]); + if (p.length === 0) { + // If there are no parents, then we've reached an entry without accepting. Reload. + accepted = false; + break; + } + parents.push(...p); + } + } + return accepted; +} +function hmrAcceptCheckOne(bundle, id, depsByBundle) { var modules = bundle.modules; if (!modules) return; if (depsByBundle && !depsByBundle[bundle.HMR_BUNDLE_ID]) { @@ -430,17 +480,11 @@ function hmrAcceptCheck(bundle, id, depsByBundle) { bundle, id ]); - if (cached && cached.hot && cached.hot._acceptCallbacks.length) return true; - var parents = getParents(module.bundle.root, id); // If no parents, the asset is new. Prevent reloading the page. - if (!parents.length) return true; - return parents.some(function(v) { - return hmrAcceptCheck(v[0], v[1], null); - }); + if (!cached || cached.hot && cached.hot._acceptCallbacks.length) return true; } function hmrAcceptRun(bundle, id) { var cached = bundle.cache[id]; - bundle.hotData = { - }; + bundle.hotData = {}; if (cached && cached.hot) cached.hot.data = bundle.hotData; if (cached && cached.hot && cached.hot._disposeCallbacks.length) cached.hot._disposeCallbacks.forEach(function(cb) { cb(bundle.hotData); @@ -458,15 +502,15 @@ function hmrAcceptRun(bundle, id) { acceptedAssets[id] = true; } -},{}],"bEyX8":[function(require,module,exports) { +},{}],"7bZzU":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); var _base = require("./Base"); var _baseDefault = parcelHelpers.interopDefault(_base); document.addEventListener("DOMContentLoaded", function() { - new _baseDefault.default(); + new (0, _baseDefault.default)(); }, false); -},{"./Base":"kvSpR","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"kvSpR":[function(require,module,exports) { +},{"./Base":"cqs8R","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"cqs8R":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _fipamoAdminAPI = require("../libraries/FipamoAdminAPI"); @@ -480,8 +524,8 @@ var _dashManager = require("./controllers/DashManager"); var _dashManagerDefault = parcelHelpers.interopDefault(_dashManager); var _notifications = require("./ui/Notifications"); var _notificationsDefault = parcelHelpers.interopDefault(_notifications); -const data = new _dataUtilsDefault.default(); -const notify = new _notificationsDefault.default(); +const data = new (0, _dataUtilsDefault.default)(); +const notify = new (0, _notificationsDefault.default)(); class Base { //-------------------------- // constructor @@ -493,24 +537,18 @@ class Base { // methods //-------------------------- start() { - if (document.getElementById('dash-form') || document.getElementById('dash-init')) { - var options = document.getElementsByClassName('init-option'); - for(let index = 0; index < options.length; index++)options[index].addEventListener('click', (e)=>this.handleOptions(e) - ); - if (document.getElementById('dash-form')) document.getElementById('login-btn').addEventListener('click', (e)=>this.handleLogin(e) - ); + if (document.getElementById("dash-form") || document.getElementById("dash-init")) { + var options = document.getElementsByClassName("init-option"); + for(let index = 0; index < options.length; index++)options[index].addEventListener("click", (e)=>this.handleOptions(e)); + if (document.getElementById("dash-form")) document.getElementById("login-btn").addEventListener("click", (e)=>this.handleLogin(e)); else { - document.getElementById('init-blog').addEventListener('click', (e)=>this.handleSetup(e) - ); - document.getElementById('blog-restore').addEventListener('click', (e)=>this.handleRestore(e) - ); + document.getElementById("init-blog").addEventListener("click", (e)=>this.handleSetup(e)); + document.getElementById("blog-restore").addEventListener("click", (e)=>this.handleRestore(e)); } - } else if (document.getElementById('dash-reset')) { - document.getElementById('get-secret-btn').addEventListener('click', (e)=>this.handleReset(e) - ); - document.getElementById('reset-btn').addEventListener('click', (e)=>this.handleReset(e) - ); - } else new _dashManagerDefault.default(); + } else if (document.getElementById("dash-reset")) { + document.getElementById("get-secret-btn").addEventListener("click", (e)=>this.handleReset(e)); + document.getElementById("reset-btn").addEventListener("click", (e)=>this.handleReset(e)); + } else new (0, _dashManagerDefault.default)(); } // event handlers //-------------------------- @@ -518,9 +556,9 @@ class Base { if (this.processing) return; let self = this; e.preventDefault(); - let authForm = data.formDataToJSON(document.getElementById('login')); - notify.alert('Looking, hold up', null); - let api = new _fipamoAdminAPIDefault.default(); + let authForm = data.formDataToJSON(document.getElementById("login")); + notify.alert("Looking, hold up", null); + let api = new (0, _fipamoAdminAPIDefault.default)(); this.processing = true; api.login(authForm).then((response)=>{ self.processing = false; @@ -529,7 +567,7 @@ class Base { notify.alert(response.message, true); e.target.innerHTML = response.message; setTimeout(()=>{ - window.location = '/dashboard'; + window.location = "/dashboard"; }, 500); } }).catch((err)=>{ @@ -537,13 +575,13 @@ class Base { notify.alert(err, false); }); } - handleSetup(e1) { + handleSetup(e) { if (this.processing) return; let self = this; - e1.stopPropagation(); - e1.preventDefault(); - let setUpForm = data.formDataToJSON(document.getElementById('init-form')); - let mm = new _maintenanceManagerDefault.default(); + e.stopPropagation(); + e.preventDefault(); + let setUpForm = data.formDataToJSON(document.getElementById("init-form")); + let mm = new (0, _maintenanceManagerDefault.default)(); this.processing = true; mm.create(setUpForm).then((response)=>{ if (response.type === _dataEvent.API_INIT_LAME) { @@ -553,7 +591,7 @@ class Base { self.processing = false; notify.alert(response.message, true); setTimeout(()=>{ - window.location = '/dashboard'; + window.location = "/dashboard"; }, 700); } }).catch((err)=>{ @@ -561,13 +599,13 @@ class Base { notify.alert(err, false); }); } - handleRestore(e2) { + handleRestore(e) { if (this.processing) return; let self = this; - e2.stopPropagation(); - e2.preventDefault(); - let mm = new _maintenanceManagerDefault.default(); - var form = document.getElementById('init-restore'); + e.stopPropagation(); + e.preventDefault(); + let mm = new (0, _maintenanceManagerDefault.default)(); + var form = document.getElementById("init-restore"); this.processing = true; mm.restore(form).then((response)=>{ if (response.type === _dataEvent.REQUEST_LAME) { @@ -577,7 +615,7 @@ class Base { self.processing = false; notify.alert(response.message, true); setTimeout(()=>{ - window.location = '/dashboard'; + window.location = "/dashboard"; }, 1500); } }).catch((err)=>{ @@ -585,41 +623,41 @@ class Base { notify.alert(err, false); }); } - handleReset(e3) { - e3.stopPropagation(); - e3.preventDefault(); + handleReset(e) { + e.stopPropagation(); + e.preventDefault(); let self = this; - let mm = new _maintenanceManagerDefault.default(); - if (e3.target.id == 'get-secret-btn') { - let data = { - email: document.getElementById('email').value, - task: 'retrieveSecret' + let mm = new (0, _maintenanceManagerDefault.default)(); + if (e.target.id == "get-secret-btn") { + let data1 = { + email: document.getElementById("email").value, + task: "retrieveSecret" }; this.processing = true; - mm.secret(data).then((response)=>{ + mm.secret(data1).then((response)=>{ self.processing = false; if (response.secret) { - document.getElementById('secret').value = response.secret; + document.getElementById("secret").value = response.secret; notify.alert(response.message, true); - } else if (response.type == 'mailSent') notify.alert(response.message, true); + } else if (response.type == "mailSent") notify.alert(response.message, true); else notify.alert(response.message, false); }).catch((err)=>{ self.processing = false; notify.alert(err, false); }); } else { - let data = { - newPass: document.getElementById('new_password').value, - newPassConfirm: document.getElementById('new_password2').value, - secret: document.getElementById('secret').value + let data2 = { + newPass: document.getElementById("new_password").value, + newPassConfirm: document.getElementById("new_password2").value, + secret: document.getElementById("secret").value }; - mm.newPass(data).then((response)=>{ + mm.newPass(data2).then((response)=>{ self.processing = false; - if (response.type == 'passNotCreated') notify.alert(response.message, false); + if (response.type == "passNotCreated") notify.alert(response.message, false); else { notify.alert(response.message, true); setTimeout(()=>{ - window.location = '/dashboard'; + window.location = "/dashboard"; }, 1000); } }).catch((err)=>{ @@ -628,95 +666,62 @@ class Base { }); } } - handleOptions(e4) { - e4.stopPropagation(); - e4.preventDefault(); - let init = document.getElementById('dash-init'); - let restore = document.getElementById('dash-restore'); - if (e4.target.id === 'init-switch-restore') { - init.style.display = 'none'; - init.style.visibility = 'hidden'; - restore.style.display = 'flex'; - restore.style.visibility = 'visible'; + handleOptions(e) { + e.stopPropagation(); + e.preventDefault(); + let init = document.getElementById("dash-init"); + let restore = document.getElementById("dash-restore"); + if (e.target.id === "init-switch-restore") { + init.style.display = "none"; + init.style.visibility = "hidden"; + restore.style.display = "flex"; + restore.style.visibility = "visible"; } else { - init.style.display = 'flex'; - init.style.visibility = 'visible'; - restore.style.display = 'none'; - restore.style.visibility = 'hidden'; + init.style.display = "flex"; + init.style.visibility = "visible"; + restore.style.display = "none"; + restore.style.visibility = "hidden"; } } } exports.default = Base; -},{"../libraries/FipamoAdminAPI":"6M96o","./controllers/MaintenanceManager":"kY7L1","./utils/DataUtils":"lpIyf","./events/DataEvent":"edzJV","./controllers/DashManager":"7hyn2","./ui/Notifications":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"6M96o":[function(require,module,exports) { +},{"../libraries/FipamoAdminAPI":"3dcvg","./controllers/MaintenanceManager":"cYXLM","./utils/DataUtils":"eM6UW","./events/DataEvent":"hCRFh","./controllers/DashManager":"9gCOB","./ui/Notifications":"9GRdG","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"3dcvg":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "REQUEST_TYPE_POST", ()=>REQUEST_TYPE_POST -); -parcelHelpers.export(exports, "REQUEST_TYPE_GET", ()=>REQUEST_TYPE_GET -); -parcelHelpers.export(exports, "REQUEST_TYPE_PUT", ()=>REQUEST_TYPE_PUT -); -parcelHelpers.export(exports, "REQUEST_TYPE_DELETE", ()=>REQUEST_TYPE_DELETE -); -parcelHelpers.export(exports, "CONTENT_TYPE_JSON", ()=>CONTENT_TYPE_JSON -); -parcelHelpers.export(exports, "CONTENT_TYPE_FORM", ()=>CONTENT_TYPE_FORM -); -parcelHelpers.export(exports, "API_STATUS", ()=>API_STATUS -); -parcelHelpers.export(exports, "API_GET_SETTINGS", ()=>API_GET_SETTINGS -); -parcelHelpers.export(exports, "API_GET_MEMBER_INFO", ()=>API_GET_MEMBER_INFO -); -parcelHelpers.export(exports, "API_NEW_PAGE", ()=>API_NEW_PAGE -); -parcelHelpers.export(exports, "API_EDIT_PAGE", ()=>API_EDIT_PAGE -); -parcelHelpers.export(exports, "API_DELETE_PAGE", ()=>API_DELETE_PAGE -); -parcelHelpers.export(exports, "API_SETTINGS_SYNC", ()=>API_SETTINGS_SYNC -); -parcelHelpers.export(exports, "API_PUBLISH_PAGES", ()=>API_PUBLISH_PAGES -); -parcelHelpers.export(exports, "API_NAV_SYNC", ()=>API_NAV_SYNC -); -parcelHelpers.export(exports, "API_REINDEX_PAGES", ()=>API_REINDEX_PAGES -); -parcelHelpers.export(exports, "API_SEND_MAIL", ()=>API_SEND_MAIL -); -parcelHelpers.export(exports, "API_LOGIN", ()=>API_LOGIN -); -parcelHelpers.export(exports, "AUTH_STATUS", ()=>AUTH_STATUS -); -parcelHelpers.export(exports, "TASK_SETTINGS_WRITE", ()=>TASK_SETTINGS_WRITE -); -parcelHelpers.export(exports, "TASK_PUBLISH_SITE", ()=>TASK_PUBLISH_SITE -); -parcelHelpers.export(exports, "TASK_PAGE_CREATE", ()=>TASK_PAGE_CREATE -); -parcelHelpers.export(exports, "TASK_PAGE_EDIT", ()=>TASK_PAGE_EDIT -); -parcelHelpers.export(exports, "TASK_PAGE_DELETE", ()=>TASK_PAGE_DELETE -); -parcelHelpers.export(exports, "TASK_SEND_MAIL", ()=>TASK_SEND_MAIL -); -parcelHelpers.export(exports, "TASK_REINDEX_PAGE", ()=>TASK_REINDEX_PAGE -); -parcelHelpers.export(exports, "TASK_SYNC_SETTNIGS", ()=>TASK_SYNC_SETTNIGS -); -parcelHelpers.export(exports, "TASK_SYNC_NAV", ()=>TASK_SYNC_NAV -); -parcelHelpers.export(exports, "TASK_GET_SETTINGS", ()=>TASK_GET_SETTINGS -); -parcelHelpers.export(exports, "TASK_GET_MEMBER_INFO", ()=>TASK_GET_MEMBER_INFO -); -parcelHelpers.export(exports, "API_ACCESS_GOOD", ()=>API_ACCESS_GOOD -); -parcelHelpers.export(exports, "API_ACCESS_BAD", ()=>API_ACCESS_BAD -); -parcelHelpers.export(exports, "default", ()=>FipamoAdminAPI -); +parcelHelpers.export(exports, "REQUEST_TYPE_POST", ()=>REQUEST_TYPE_POST); +parcelHelpers.export(exports, "REQUEST_TYPE_GET", ()=>REQUEST_TYPE_GET); +parcelHelpers.export(exports, "REQUEST_TYPE_PUT", ()=>REQUEST_TYPE_PUT); +parcelHelpers.export(exports, "REQUEST_TYPE_DELETE", ()=>REQUEST_TYPE_DELETE); +parcelHelpers.export(exports, "CONTENT_TYPE_JSON", ()=>CONTENT_TYPE_JSON); +parcelHelpers.export(exports, "CONTENT_TYPE_FORM", ()=>CONTENT_TYPE_FORM); +parcelHelpers.export(exports, "API_STATUS", ()=>API_STATUS); +parcelHelpers.export(exports, "API_GET_SETTINGS", ()=>API_GET_SETTINGS); +parcelHelpers.export(exports, "API_GET_MEMBER_INFO", ()=>API_GET_MEMBER_INFO); +parcelHelpers.export(exports, "API_NEW_PAGE", ()=>API_NEW_PAGE); +parcelHelpers.export(exports, "API_EDIT_PAGE", ()=>API_EDIT_PAGE); +parcelHelpers.export(exports, "API_DELETE_PAGE", ()=>API_DELETE_PAGE); +parcelHelpers.export(exports, "API_SETTINGS_SYNC", ()=>API_SETTINGS_SYNC); +parcelHelpers.export(exports, "API_PUBLISH_PAGES", ()=>API_PUBLISH_PAGES); +parcelHelpers.export(exports, "API_NAV_SYNC", ()=>API_NAV_SYNC); +parcelHelpers.export(exports, "API_REINDEX_PAGES", ()=>API_REINDEX_PAGES); +parcelHelpers.export(exports, "API_SEND_MAIL", ()=>API_SEND_MAIL); +parcelHelpers.export(exports, "API_LOGIN", ()=>API_LOGIN); +parcelHelpers.export(exports, "AUTH_STATUS", ()=>AUTH_STATUS); +parcelHelpers.export(exports, "TASK_SETTINGS_WRITE", ()=>TASK_SETTINGS_WRITE); +parcelHelpers.export(exports, "TASK_PUBLISH_SITE", ()=>TASK_PUBLISH_SITE); +parcelHelpers.export(exports, "TASK_PAGE_CREATE", ()=>TASK_PAGE_CREATE); +parcelHelpers.export(exports, "TASK_PAGE_EDIT", ()=>TASK_PAGE_EDIT); +parcelHelpers.export(exports, "TASK_PAGE_DELETE", ()=>TASK_PAGE_DELETE); +parcelHelpers.export(exports, "TASK_SEND_MAIL", ()=>TASK_SEND_MAIL); +parcelHelpers.export(exports, "TASK_REINDEX_PAGE", ()=>TASK_REINDEX_PAGE); +parcelHelpers.export(exports, "TASK_SYNC_SETTNIGS", ()=>TASK_SYNC_SETTNIGS); +parcelHelpers.export(exports, "TASK_SYNC_NAV", ()=>TASK_SYNC_NAV); +parcelHelpers.export(exports, "TASK_GET_SETTINGS", ()=>TASK_GET_SETTINGS); +parcelHelpers.export(exports, "TASK_GET_MEMBER_INFO", ()=>TASK_GET_MEMBER_INFO); +parcelHelpers.export(exports, "API_ACCESS_GOOD", ()=>API_ACCESS_GOOD); +parcelHelpers.export(exports, "API_ACCESS_BAD", ()=>API_ACCESS_BAD); +parcelHelpers.export(exports, "default", ()=>FipamoAdminAPI); const REQUEST_TYPE_POST = "POST"; const REQUEST_TYPE_GET = "GET"; const REQUEST_TYPE_PUT = "PUT"; @@ -832,7 +837,7 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; "type":"exampleType", } ``` - */ sync(task, data1) { + */ sync(task, data) { return new Promise((resolve, reject)=>{ let url = ""; switch(task){ @@ -843,7 +848,7 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; url = API_NAV_SYNC; break; } - this._request(this.baseURL ? this.baseURL + url : url, TASK_SETTINGS_WRITE, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data1).then((result)=>{ + this._request(this.baseURL ? this.baseURL + url : url, TASK_SETTINGS_WRITE, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data).then((result)=>{ resolve(result); }).catch((err)=>{ reject(err); @@ -865,9 +870,9 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; "type":"exampleType", } * ``` - */ publish(data2) { + */ publish(data) { return new Promise((resolve, reject)=>{ - this._request(this.baseURL ? this.baseURL + API_PUBLISH_PAGES : API_PUBLISH_PAGES, TASK_PUBLISH_SITE, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data2).then((result)=>{ + this._request(this.baseURL ? this.baseURL + API_PUBLISH_PAGES : API_PUBLISH_PAGES, TASK_PUBLISH_SITE, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data).then((result)=>{ resolve(result); }).catch((err)=>{ reject(err); @@ -904,9 +909,9 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; "type":"exampleType", } ``` - */ pageActions(task1, data3) { + */ pageActions(task, data) { let url, event, content; - switch(task1){ + switch(task){ case TASK_PAGE_CREATE: url = API_NEW_PAGE; event = TASK_PAGE_CREATE; @@ -926,10 +931,10 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; break; } if (this.baseURL) //data.key = this.key; - data3.remote = true; - else data3.remote = false; + data.remote = true; + else data.remote = false; return new Promise((resolve, reject)=>{ - this._request(this.baseURL ? this.baseURL + url : url, event, REQUEST_TYPE_POST, content, data3).then((result)=>{ + this._request(this.baseURL ? this.baseURL + url : url, event, REQUEST_TYPE_POST, content, data).then((result)=>{ resolve(result); }).catch((err)=>{ reject(err); @@ -1002,8 +1007,7 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; var self = this; return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); - request.upload.addEventListener("progress", (e)=>self.handleLoadProgress(e, self.progressBar) - ); + request.upload.addEventListener("progress", (e)=>self.handleLoadProgress(e, self.progressBar)); request.open(requestType, requestURL, true); request.onload = ()=>{ if (request.status == 200) { @@ -1033,26 +1037,26 @@ const API_ACCESS_BAD = "apiUseNotAuthorized"; } // event handlers //-------------------------- - handleLoadProgress(e, progressBar1) { + handleLoadProgress(e, progressBar) { let percent = Math.ceil(e.loaded / e.total * 100); //if a progress bar element is present, talk to it - if (progressBar1 != null) progressBar1.style.width = percent + "%"; + if (progressBar != null) progressBar.style.width = percent + "%"; } } -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"ciiiV":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"gkKU3":[function(require,module,exports) { exports.interopDefault = function(a) { return a && a.__esModule ? a : { default: a }; }; exports.defineInteropFlag = function(a) { - Object.defineProperty(a, '__esModule', { + Object.defineProperty(a, "__esModule", { value: true }); }; exports.exportAll = function(source, dest) { Object.keys(source).forEach(function(key) { - if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) return; + if (key === "default" || key === "__esModule" || dest.hasOwnProperty(key)) return; Object.defineProperty(dest, key, { enumerable: true, get: function() { @@ -1069,86 +1073,60 @@ exports.export = function(dest, destName, get) { }); }; -},{}],"kY7L1":[function(require,module,exports) { +},{}],"cYXLM":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "REQUEST_TYPE_POST", ()=>REQUEST_TYPE_POST -); -parcelHelpers.export(exports, "REQUEST_TYPE_GET", ()=>REQUEST_TYPE_GET -); -parcelHelpers.export(exports, "REQUEST_TYPE_PUT", ()=>REQUEST_TYPE_PUT -); -parcelHelpers.export(exports, "REQUEST_TYPE_DELETE", ()=>REQUEST_TYPE_DELETE -); -parcelHelpers.export(exports, "CONTENT_TYPE_JSON", ()=>CONTENT_TYPE_JSON -); -parcelHelpers.export(exports, "CONTENT_TYPE_FORM", ()=>CONTENT_TYPE_FORM -); -parcelHelpers.export(exports, "API_STATUS", ()=>API_STATUS -); -parcelHelpers.export(exports, "API_INIT", ()=>API_INIT -); -parcelHelpers.export(exports, "API_RESTORE", ()=>API_RESTORE -); -parcelHelpers.export(exports, "API_GET_SECRET", ()=>API_GET_SECRET -); -parcelHelpers.export(exports, "API_RESET_PASS", ()=>API_RESET_PASS -); -parcelHelpers.export(exports, "API_CREATE_BACKUP", ()=>API_CREATE_BACKUP -); -parcelHelpers.export(exports, "API_DOWNLOAD_BACKUP", ()=>API_DOWNLOAD_BACKUP -); -parcelHelpers.export(exports, "API_RESTORE_BACKUP", ()=>API_RESTORE_BACKUP -); -parcelHelpers.export(exports, "API_UPLOAD_AVATAR", ()=>API_UPLOAD_AVATAR -); -parcelHelpers.export(exports, "API_UPLOAD_BACKGROUND", ()=>API_UPLOAD_BACKGROUND -); -parcelHelpers.export(exports, "API_IMAGE_UPLOAD", ()=>API_IMAGE_UPLOAD -); -parcelHelpers.export(exports, "TASK_SITE_INIT", ()=>TASK_SITE_INIT -); -parcelHelpers.export(exports, "TASK_BACKUP_RESTORE", ()=>TASK_BACKUP_RESTORE -); -parcelHelpers.export(exports, "TASK_BACKUP_CREATE", ()=>TASK_BACKUP_CREATE -); -parcelHelpers.export(exports, "TASK_GET_SECRET", ()=>TASK_GET_SECRET -); -parcelHelpers.export(exports, "TASK_RESET_PASS", ()=>TASK_RESET_PASS -); -parcelHelpers.export(exports, "TASK_UPLOAD_FILES", ()=>TASK_UPLOAD_FILES -); -parcelHelpers.export(exports, "API_ACCESS_GOOD", ()=>API_ACCESS_GOOD -); -parcelHelpers.export(exports, "API_ACCESS_BAD", ()=>API_ACCESS_BAD -); -parcelHelpers.export(exports, "default", ()=>MaintenanceManager -); -const REQUEST_TYPE_POST = 'POST'; -const REQUEST_TYPE_GET = 'GET'; -const REQUEST_TYPE_PUT = 'PUT'; -const REQUEST_TYPE_DELETE = 'DELETE'; //** POST CONTENT TYPES **// -const CONTENT_TYPE_JSON = 'json'; -const CONTENT_TYPE_FORM = 'x-www-form-urlencoded'; //** API URLS **// -const API_STATUS = '/api/v1/status'; -const API_INIT = '/api/v1/init'; -const API_RESTORE = '/api/v1/restore'; -const API_GET_SECRET = '/api/v1/get-secret'; -const API_RESET_PASS = '/api/v1/reset-password'; -const API_CREATE_BACKUP = '/api/v1/backup'; -const API_DOWNLOAD_BACKUP = '/api/v1/backup/download'; -const API_RESTORE_BACKUP = '/api/v1/backup/restore'; -const API_UPLOAD_AVATAR = '/api/v1/settings/add-avatar'; -const API_UPLOAD_BACKGROUND = '/api/v1/settings/add-feature-background'; -const API_IMAGE_UPLOAD = '/api/v1/page/add-entry-image'; //** API TASKS **// -const TASK_SITE_INIT = 'blogInit'; -const TASK_BACKUP_RESTORE = 'restoreBackup'; -const TASK_BACKUP_CREATE = 'createBackup'; -const TASK_GET_SECRET = 'retrieveSecret'; -const TASK_RESET_PASS = 'resetPassword'; -const TASK_UPLOAD_FILES = 'uploadFiles'; //** API STATUS **// -const API_ACCESS_GOOD = 'apiUseAuthorized'; -const API_ACCESS_BAD = 'apiUseNotAuthorized'; +parcelHelpers.export(exports, "REQUEST_TYPE_POST", ()=>REQUEST_TYPE_POST); +parcelHelpers.export(exports, "REQUEST_TYPE_GET", ()=>REQUEST_TYPE_GET); +parcelHelpers.export(exports, "REQUEST_TYPE_PUT", ()=>REQUEST_TYPE_PUT); +parcelHelpers.export(exports, "REQUEST_TYPE_DELETE", ()=>REQUEST_TYPE_DELETE); +parcelHelpers.export(exports, "CONTENT_TYPE_JSON", ()=>CONTENT_TYPE_JSON); +parcelHelpers.export(exports, "CONTENT_TYPE_FORM", ()=>CONTENT_TYPE_FORM); +parcelHelpers.export(exports, "API_STATUS", ()=>API_STATUS); +parcelHelpers.export(exports, "API_INIT", ()=>API_INIT); +parcelHelpers.export(exports, "API_RESTORE", ()=>API_RESTORE); +parcelHelpers.export(exports, "API_GET_SECRET", ()=>API_GET_SECRET); +parcelHelpers.export(exports, "API_RESET_PASS", ()=>API_RESET_PASS); +parcelHelpers.export(exports, "API_CREATE_BACKUP", ()=>API_CREATE_BACKUP); +parcelHelpers.export(exports, "API_DOWNLOAD_BACKUP", ()=>API_DOWNLOAD_BACKUP); +parcelHelpers.export(exports, "API_RESTORE_BACKUP", ()=>API_RESTORE_BACKUP); +parcelHelpers.export(exports, "API_UPLOAD_AVATAR", ()=>API_UPLOAD_AVATAR); +parcelHelpers.export(exports, "API_UPLOAD_BACKGROUND", ()=>API_UPLOAD_BACKGROUND); +parcelHelpers.export(exports, "API_IMAGE_UPLOAD", ()=>API_IMAGE_UPLOAD); +parcelHelpers.export(exports, "TASK_SITE_INIT", ()=>TASK_SITE_INIT); +parcelHelpers.export(exports, "TASK_BACKUP_RESTORE", ()=>TASK_BACKUP_RESTORE); +parcelHelpers.export(exports, "TASK_BACKUP_CREATE", ()=>TASK_BACKUP_CREATE); +parcelHelpers.export(exports, "TASK_GET_SECRET", ()=>TASK_GET_SECRET); +parcelHelpers.export(exports, "TASK_RESET_PASS", ()=>TASK_RESET_PASS); +parcelHelpers.export(exports, "TASK_UPLOAD_FILES", ()=>TASK_UPLOAD_FILES); +parcelHelpers.export(exports, "API_ACCESS_GOOD", ()=>API_ACCESS_GOOD); +parcelHelpers.export(exports, "API_ACCESS_BAD", ()=>API_ACCESS_BAD); +parcelHelpers.export(exports, "default", ()=>MaintenanceManager); +const REQUEST_TYPE_POST = "POST"; +const REQUEST_TYPE_GET = "GET"; +const REQUEST_TYPE_PUT = "PUT"; +const REQUEST_TYPE_DELETE = "DELETE"; //** POST CONTENT TYPES **// +const CONTENT_TYPE_JSON = "json"; +const CONTENT_TYPE_FORM = "x-www-form-urlencoded"; //** API URLS **// +const API_STATUS = "/api/v1/status"; +const API_INIT = "/api/v1/init"; +const API_RESTORE = "/api/v1/restore"; +const API_GET_SECRET = "/api/v1/get-secret"; +const API_RESET_PASS = "/api/v1/reset-password"; +const API_CREATE_BACKUP = "/api/v1/backup"; +const API_DOWNLOAD_BACKUP = "/api/v1/backup/download"; +const API_RESTORE_BACKUP = "/api/v1/backup/restore"; +const API_UPLOAD_AVATAR = "/api/v1/settings/add-avatar"; +const API_UPLOAD_BACKGROUND = "/api/v1/settings/add-feature-background"; +const API_IMAGE_UPLOAD = "/api/v1/page/add-entry-image"; //** API TASKS **// +const TASK_SITE_INIT = "blogInit"; +const TASK_BACKUP_RESTORE = "restoreBackup"; +const TASK_BACKUP_CREATE = "createBackup"; +const TASK_GET_SECRET = "retrieveSecret"; +const TASK_RESET_PASS = "resetPassword"; +const TASK_UPLOAD_FILES = "uploadFiles"; //** API STATUS **// +const API_ACCESS_GOOD = "apiUseAuthorized"; +const API_ACCESS_BAD = "apiUseNotAuthorized"; /** * A tub of methods for creating/restoring installs, resetting passwords and uploading images. */ class MaintenanceManager { @@ -1164,7 +1142,7 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; this.key = null; if (key) this.key = key; if (baseURL) this.baseURL = baseURL; //if key is valid, checks to see if a session is active and returns - this._request(this.baseURL ? this.baseURL + API_STATUS + '?key=' + this.key : API_STATUS + '?key=' + this.key).then((response)=>{ + this._request(this.baseURL ? this.baseURL + API_STATUS + "?key=" + this.key : API_STATUS + "?key=" + this.key).then((response)=>{ if (response.type === API_ACCESS_GOOD) this.token = response.token; }); } @@ -1175,9 +1153,9 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; * @property {string} new_member_email - email for new user * @property {string} new_member_pass - password for new user * @property {string} new_member_title - title for new user - */ create(data1) { + */ create(data) { return new Promise((resolve, reject)=>{ - this._request(API_INIT, TASK_SITE_INIT, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data1).then((result)=>{ + this._request(API_INIT, TASK_SITE_INIT, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data).then((result)=>{ resolve(result); }).catch((err)=>{ reject(err); @@ -1215,7 +1193,7 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; method = REQUEST_TYPE_POST; type = CONTENT_TYPE_JSON; data = { - task: 'create_backup' + task: "create_backup" }; this._request(url, event, method, type, data).then((result)=>{ resolve(result); @@ -1243,9 +1221,9 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; * @property {string} new_password - password for user * @property {string} new_password2 - confirm password for user * @property {string} secret - secret key for user - */ newPass(data2) { + */ newPass(data) { return new Promise((resolve, reject)=>{ - this._request(API_RESET_PASS, TASK_RESET_PASS, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data2).then((result)=>{ + this._request(API_RESET_PASS, TASK_RESET_PASS, REQUEST_TYPE_POST, CONTENT_TYPE_JSON, data).then((result)=>{ resolve(result); }).catch((err)=>{ reject(err); @@ -1258,12 +1236,12 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; * @param {input} files - form input containing files */ imageUpload(type, files) { return new Promise((resolve, reject)=>{ - let url = ''; + let url = ""; switch(type){ - case 'avatar-upload': + case "avatar-upload": url = API_UPLOAD_AVATAR; break; - case 'background-upload': + case "background-upload": url = API_UPLOAD_BACKGROUND; break; default: @@ -1272,15 +1250,15 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; } var imageData = new FormData(); if (this.baseURL) { - imageData.append('key', this.key); - imageData.append('remote', true); - } else imageData.append('remote', false); + imageData.append("key", this.key); + imageData.append("remote", true); + } else imageData.append("remote", false); for(var i = 0; i < files.length; i++){ var file = files[i]; // Check the file type. - if (!file.type.match('image.*')) continue; - if (type === 'avatar-upload') imageData.append('avatar_upload', file, file.name); - else if (type === 'background-upload') imageData.append('background_upload', file, file.name); - else imageData.append('post_image', file, file.name); + if (!file.type.match("image.*")) continue; + if (type === "avatar-upload") imageData.append("avatar_upload", file, file.name); + else if (type === "background-upload") imageData.append("background_upload", file, file.name); + else imageData.append("post_image", file, file.name); } this._request(url, TASK_UPLOAD_FILES, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, imageData).then((r)=>{ resolve(r); @@ -1295,23 +1273,22 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; var self = this; return new Promise(function(resolve, reject) { var request = new XMLHttpRequest(); - request.upload.addEventListener('progress', (e)=>self.handleLoadProgress(e, self.progressBar) - ); + request.upload.addEventListener("progress", (e)=>self.handleLoadProgress(e, self.progressBar)); request.open(requestType, requestURL, true); request.onload = ()=>{ if (request.status == 200) { - let response = JSON.parse(request['response']); + let response = JSON.parse(request["response"]); resolve(response); } else { - let error = JSON.parse(request['response']); + let error = JSON.parse(request["response"]); reject(error); } }; if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) { - if (eventType === TASK_UPLOAD_FILES) request.setRequestHeader('fipamo-access-token', self.token); + if (eventType === TASK_UPLOAD_FILES) request.setRequestHeader("fipamo-access-token", self.token); switch(contentType){ case CONTENT_TYPE_JSON: - request.setRequestHeader('Content-type', 'application/' + contentType); + request.setRequestHeader("Content-type", "application/" + contentType); request.send(JSON.stringify(requestData)); break; case CONTENT_TYPE_FORM: @@ -1323,31 +1300,30 @@ const API_ACCESS_BAD = 'apiUseNotAuthorized'; } // event handlers //-------------------------- - handleLoadProgress(e, progressBar1) { + handleLoadProgress(e, progressBar) { let percent = Math.ceil(e.loaded / e.total * 100); //if a progress bar element is present, talk to it - if (progressBar1 != null) progressBar1.style.width = percent + '%'; + if (progressBar != null) progressBar.style.width = percent + "%"; } } -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"lpIyf":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"eM6UW":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); class DataUtils { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- imgLoad(url) { - 'use strict'; // Create new promise with the Promise() constructor; + "use strict"; // Create new promise with the Promise() constructor; // This has as its argument a function with two parameters, resolve and reject return new Promise(function(resolve, reject) { // Standard XHR to load an image var request = new XMLHttpRequest(); - request.open('GET', url); - request.responseType = 'blob'; // When the request loads, check whether it was successful + request.open("GET", url); + request.responseType = "blob"; // When the request loads, check whether it was successful request.onload = function() { if (request.status === 200) // If successful, resolve the promise by passing back the request response resolve(request.response); @@ -1357,18 +1333,18 @@ class DataUtils { request.onerror = function() { // Also deal with the case when the entire request fails to begin with // This is probably a network error, so reject the promise with an appropriate message - reject(new Error('There was a network error.')); + reject(new Error("There was a network error.")); }; // Send the request request.send(); }); } loadImage(src) { - 'use strict'; + "use strict"; let self = this; return new Promise(function(resolve, reject) { // Get a reference to the body element, and create a new image object var myImage = new Image(); - myImage.crossOrigin = ''; // or "anonymous" + myImage.crossOrigin = ""; // or "anonymous" // Call the function with the URL we want to load, but then chain the // promise then() method on to the end of it. This contains two callbacks self.imgLoad(src).then(function(response) { @@ -1388,8 +1364,7 @@ class DataUtils { * @param : $('#form_example'); * @return a JSON Stringify */ formDataToJSON(form) { - let object = { - }; + let object = {}; let formData = new FormData(form); formData.forEach((value, key)=>{ if (!object.hasOwnProperty(key)) { @@ -1406,93 +1381,51 @@ class DataUtils { } exports.default = DataUtils; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"edzJV":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"hCRFh":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "AUTH_STATUS", ()=>AUTH_STATUS -); -parcelHelpers.export(exports, "REQUEST_GOOD", ()=>REQUEST_GOOD -); -parcelHelpers.export(exports, "REQUEST_LAME", ()=>REQUEST_LAME -); -parcelHelpers.export(exports, "API_REQUEST_GOOD", ()=>API_REQUEST_GOOD -); -parcelHelpers.export(exports, "API_REQUEST_LAME", ()=>API_REQUEST_LAME -); -parcelHelpers.export(exports, "IMG_REQUEST_GOOD", ()=>IMG_REQUEST_GOOD -); -parcelHelpers.export(exports, "IMG_REQUEST_LAME", ()=>IMG_REQUEST_LAME -); -parcelHelpers.export(exports, "SETTINGS_LOADED", ()=>SETTINGS_LOADED -); -parcelHelpers.export(exports, "POST_IMAGE_ADDED", ()=>POST_IMAGE_ADDED -); -parcelHelpers.export(exports, "FEATURE_IMAGE_ADDED", ()=>FEATURE_IMAGE_ADDED -); -parcelHelpers.export(exports, "PAGE_ERROR", ()=>PAGE_ERROR -); -parcelHelpers.export(exports, "PAGE_ADDED", ()=>PAGE_ADDED -); -parcelHelpers.export(exports, "PAGE_UPDATED", ()=>PAGE_UPDATED -); -parcelHelpers.export(exports, "PAGE_DELETED", ()=>PAGE_DELETED -); -parcelHelpers.export(exports, "PAGES_RENDERED", ()=>PAGES_RENDERED -); -parcelHelpers.export(exports, "PAGES_NOT_RENDERED", ()=>PAGES_NOT_RENDERED -); -parcelHelpers.export(exports, "TAG_PAGES_RENDERED", ()=>TAG_PAGES_RENDERED -); -parcelHelpers.export(exports, "TAG_PAGES_NOT_RENDERED", ()=>TAG_PAGES_NOT_RENDERED -); -parcelHelpers.export(exports, "SETTINGS_UPDATED", ()=>SETTINGS_UPDATED -); -parcelHelpers.export(exports, "SETTINGS_NOT_UPDATED", ()=>SETTINGS_NOT_UPDATED -); -parcelHelpers.export(exports, "MENU_ADD_ITEM", ()=>MENU_ADD_ITEM -); -parcelHelpers.export(exports, "MENU_DELETE_ITEM", ()=>MENU_DELETE_ITEM -); -parcelHelpers.export(exports, "MENU_UPDATED", ()=>MENU_UPDATED -); -parcelHelpers.export(exports, "AVATAR_UPLOADED", ()=>AVATAR_UPLOADED -); -parcelHelpers.export(exports, "SITE_BACKGROUND_UPLOADED", ()=>SITE_BACKGROUND_UPLOADED -); -parcelHelpers.export(exports, "UPLOAD_PROGRESS", ()=>UPLOAD_PROGRESS -); -parcelHelpers.export(exports, "API_PAGE_WRITE", ()=>API_PAGE_WRITE -); -parcelHelpers.export(exports, "API_PAGE_CREATE", ()=>API_PAGE_CREATE -); -parcelHelpers.export(exports, "API_PAGE_DELETE", ()=>API_PAGE_DELETE -); -parcelHelpers.export(exports, "API_SETTINGS_WRITE", ()=>API_SETTINGS_WRITE -); -parcelHelpers.export(exports, "API_BACKUP_CREATE", ()=>API_BACKUP_CREATE -); -parcelHelpers.export(exports, "API_BACKUP_DOWNLOAD", ()=>API_BACKUP_DOWNLOAD -); -parcelHelpers.export(exports, "API_BACKUP_RESTORE", ()=>API_BACKUP_RESTORE -); -parcelHelpers.export(exports, "API_IMAGES_UPLOAD", ()=>API_IMAGES_UPLOAD -); -parcelHelpers.export(exports, "API_RENDER_PAGES", ()=>API_RENDER_PAGES -); -parcelHelpers.export(exports, "API_REINDEX_PAGES", ()=>API_REINDEX_PAGES -); -parcelHelpers.export(exports, "API_INIT", ()=>API_INIT -); -parcelHelpers.export(exports, "API_INIT_GOOD", ()=>API_INIT_GOOD -); -parcelHelpers.export(exports, "API_INIT_LAME", ()=>API_INIT_LAME -); -parcelHelpers.export(exports, "API_GET_SECRET", ()=>API_GET_SECRET -); -parcelHelpers.export(exports, "API_RESET_PASS", ()=>API_RESET_PASS -); -parcelHelpers.export(exports, "SEND_MAIL", ()=>SEND_MAIL -); +parcelHelpers.export(exports, "AUTH_STATUS", ()=>AUTH_STATUS); +parcelHelpers.export(exports, "REQUEST_GOOD", ()=>REQUEST_GOOD); +parcelHelpers.export(exports, "REQUEST_LAME", ()=>REQUEST_LAME); +parcelHelpers.export(exports, "API_REQUEST_GOOD", ()=>API_REQUEST_GOOD); +parcelHelpers.export(exports, "API_REQUEST_LAME", ()=>API_REQUEST_LAME); +parcelHelpers.export(exports, "IMG_REQUEST_GOOD", ()=>IMG_REQUEST_GOOD); +parcelHelpers.export(exports, "IMG_REQUEST_LAME", ()=>IMG_REQUEST_LAME); +parcelHelpers.export(exports, "SETTINGS_LOADED", ()=>SETTINGS_LOADED); +parcelHelpers.export(exports, "POST_IMAGE_ADDED", ()=>POST_IMAGE_ADDED); +parcelHelpers.export(exports, "FEATURE_IMAGE_ADDED", ()=>FEATURE_IMAGE_ADDED); +parcelHelpers.export(exports, "PAGE_ERROR", ()=>PAGE_ERROR); +parcelHelpers.export(exports, "PAGE_ADDED", ()=>PAGE_ADDED); +parcelHelpers.export(exports, "PAGE_UPDATED", ()=>PAGE_UPDATED); +parcelHelpers.export(exports, "PAGE_DELETED", ()=>PAGE_DELETED); +parcelHelpers.export(exports, "PAGES_RENDERED", ()=>PAGES_RENDERED); +parcelHelpers.export(exports, "PAGES_NOT_RENDERED", ()=>PAGES_NOT_RENDERED); +parcelHelpers.export(exports, "TAG_PAGES_RENDERED", ()=>TAG_PAGES_RENDERED); +parcelHelpers.export(exports, "TAG_PAGES_NOT_RENDERED", ()=>TAG_PAGES_NOT_RENDERED); +parcelHelpers.export(exports, "SETTINGS_UPDATED", ()=>SETTINGS_UPDATED); +parcelHelpers.export(exports, "SETTINGS_NOT_UPDATED", ()=>SETTINGS_NOT_UPDATED); +parcelHelpers.export(exports, "MENU_ADD_ITEM", ()=>MENU_ADD_ITEM); +parcelHelpers.export(exports, "MENU_DELETE_ITEM", ()=>MENU_DELETE_ITEM); +parcelHelpers.export(exports, "MENU_UPDATED", ()=>MENU_UPDATED); +parcelHelpers.export(exports, "AVATAR_UPLOADED", ()=>AVATAR_UPLOADED); +parcelHelpers.export(exports, "SITE_BACKGROUND_UPLOADED", ()=>SITE_BACKGROUND_UPLOADED); +parcelHelpers.export(exports, "UPLOAD_PROGRESS", ()=>UPLOAD_PROGRESS); +parcelHelpers.export(exports, "API_PAGE_WRITE", ()=>API_PAGE_WRITE); +parcelHelpers.export(exports, "API_PAGE_CREATE", ()=>API_PAGE_CREATE); +parcelHelpers.export(exports, "API_PAGE_DELETE", ()=>API_PAGE_DELETE); +parcelHelpers.export(exports, "API_SETTINGS_WRITE", ()=>API_SETTINGS_WRITE); +parcelHelpers.export(exports, "API_BACKUP_CREATE", ()=>API_BACKUP_CREATE); +parcelHelpers.export(exports, "API_BACKUP_DOWNLOAD", ()=>API_BACKUP_DOWNLOAD); +parcelHelpers.export(exports, "API_BACKUP_RESTORE", ()=>API_BACKUP_RESTORE); +parcelHelpers.export(exports, "API_IMAGES_UPLOAD", ()=>API_IMAGES_UPLOAD); +parcelHelpers.export(exports, "API_RENDER_PAGES", ()=>API_RENDER_PAGES); +parcelHelpers.export(exports, "API_REINDEX_PAGES", ()=>API_REINDEX_PAGES); +parcelHelpers.export(exports, "API_INIT", ()=>API_INIT); +parcelHelpers.export(exports, "API_INIT_GOOD", ()=>API_INIT_GOOD); +parcelHelpers.export(exports, "API_INIT_LAME", ()=>API_INIT_LAME); +parcelHelpers.export(exports, "API_GET_SECRET", ()=>API_GET_SECRET); +parcelHelpers.export(exports, "API_RESET_PASS", ()=>API_RESET_PASS); +parcelHelpers.export(exports, "SEND_MAIL", ()=>SEND_MAIL); const AUTH_STATUS = "getAuthStatus"; const REQUEST_GOOD = "requestGood"; const REQUEST_LAME = "requestLame"; @@ -1539,7 +1472,7 @@ class DataEvent { } exports.default = new DataEvent(); -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"7hyn2":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"9gCOB":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _postIndex = require("./PostIndex"); @@ -1553,25 +1486,24 @@ class DashManager { // constructor //-------------------------- constructor(){ - this.currentDisplay = ''; - this.urlPieces = document.URL.split('/'); + this.currentDisplay = ""; + this.urlPieces = document.URL.split("/"); this.chooseDisplay(this.urlPieces[4], this.urlPieces[5]); } // methods //-------------------------- - start() { - } + start() {} chooseDisplay(section, page) { - this.currentDisplay = ''; + this.currentDisplay = ""; switch(section){ - case 'page': - this.currentDisplay = new _postIndexDefault.default(page); + case "page": + this.currentDisplay = new (0, _postIndexDefault.default)(page); break; - case 'settings': - this.currentDisplay = new _settingsIndexDefault.default(); + case "settings": + this.currentDisplay = new (0, _settingsIndexDefault.default)(); break; - case 'navigation': - this.currentDisplay = new _navIndexDefault.default(); + case "navigation": + this.currentDisplay = new (0, _navIndexDefault.default)(); break; default: break; @@ -1581,7 +1513,7 @@ class DashManager { } exports.default = DashManager; -},{"./PostIndex":"k5HNa","./SettingsIndex":"js2Fi","./NavIndex":"9sqHb","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"k5HNa":[function(require,module,exports) { +},{"./PostIndex":"gp1bn","./SettingsIndex":"4SQpj","./NavIndex":"6S99f","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"gp1bn":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _pageEditor = require("./PageEditor"); @@ -1597,14 +1529,13 @@ class PostIndex { } // methods //-------------------------- - start() { - } - choosePage(page1) { + start() {} + choosePage(page) { this.currentPage = ""; - switch(page1){ + switch(page){ case "edit": case "add": - this.currentPage = new _pageEditorDefault.default(); + this.currentPage = new (0, _pageEditorDefault.default)(); break; default: break; @@ -1613,7 +1544,7 @@ class PostIndex { } exports.default = PostIndex; -},{"./PageEditor":"dJ1gj","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"dJ1gj":[function(require,module,exports) { +},{"./PageEditor":"jaapu","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"jaapu":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); //TOOLS @@ -1631,7 +1562,7 @@ var _notifications = require("../ui/Notifications"); var _notificationsDefault = parcelHelpers.interopDefault(_notifications); var _fileManager = require("../ui/FileManager"); var _fileManagerDefault = parcelHelpers.interopDefault(_fileManager); -const notify = new _notificationsDefault.default(); +const notify = new (0, _notificationsDefault.default)(); class PostEditor { //-------------------------- // constructor @@ -1639,31 +1570,27 @@ class PostEditor { constructor(){ this.processing = false; let self = "this"; - this.admin = new _fipamoAdminAPIDefault.default(null, document.getElementById('notify-progress')); - this.mm = new _maintenanceManagerDefault.default(null, null, document.getElementById('notify-progress')); - this.urlPieces = document.URL.split('/'); + this.admin = new (0, _fipamoAdminAPIDefault.default)(null, document.getElementById("notify-progress")); + this.mm = new (0, _maintenanceManagerDefault.default)(null, null, document.getElementById("notify-progress")); + this.urlPieces = document.URL.split("/"); this.post = []; this.postID = null; this.postUUID = null; this.postLayout = null; this.fm = null; - if (document.getElementById('post-edit-index').getAttribute('data-index')) { - this.postID = document.getElementById('post-edit-index').getAttribute('data-index'); - this.postUUID = document.getElementById('post-edit-index').getAttribute('data-uuid'); - this.postLayout = document.getElementById('post-edit-index').getAttribute('data-layout'); + if (document.getElementById("post-edit-index").getAttribute("data-index")) { + this.postID = document.getElementById("post-edit-index").getAttribute("data-index"); + this.postUUID = document.getElementById("post-edit-index").getAttribute("data-uuid"); + this.postLayout = document.getElementById("post-edit-index").getAttribute("data-layout"); } - if (document.getElementById('edit')) { - this.editor = new _textEditorDefault.default(document.getElementById('edit'), document.getElementById('header').offsetHeight + document.getElementById('post-header').offsetHeight + document.getElementById('post-feature').offsetHeight); - this.editor.addListener(_editorEvent.EDITOR_DELETE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_DELETE) - , false); - this.editor.addListener(_editorEvent.EDITOR_UPLOAD_POST_IMAGE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_UPLOAD_POST_IMAGE) - , false); - this.editor.addListener(_editorEvent.EDITOR_UPDATE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_UPDATE) - , false); - this.editor.addListener(_editorEvent.EDITOR_SAVE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_SAVE) - , false); - document.getElementById('post-image-upload').addEventListener('change', (e)=>{ - self.handleImageUpload(e.target.id, e.target.files); + if (document.getElementById("edit")) { + this.editor = new (0, _textEditorDefault.default)(document.getElementById("edit"), document.getElementById("header").offsetHeight + document.getElementById("post-header").offsetHeight + document.getElementById("post-feature").offsetHeight); + this.editor.addListener(_editorEvent.EDITOR_DELETE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_DELETE), false); + this.editor.addListener(_editorEvent.EDITOR_UPLOAD_POST_IMAGE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_UPLOAD_POST_IMAGE), false); + this.editor.addListener(_editorEvent.EDITOR_UPDATE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_UPDATE), false); + this.editor.addListener(_editorEvent.EDITOR_SAVE, ()=>this.handleEditorOptions(_editorEvent.EDITOR_SAVE), false); + document.getElementById("post-image-upload").addEventListener("change", (e)=>{ + this.handleImageUpload(e.target.id, e.target.files); }, false); /* TinyDatePicker(document.getElementById('post-date'), { @@ -1678,12 +1605,11 @@ class PostEditor { // methods //-------------------------- start() { - if (document.getElementById('page-file-drop')) { + if (document.getElementById("page-file-drop")) { //insert fileManager here - this.fm = new _fileManagerDefault.default(document.getElementById('page-file-drop'), document.getElementById('page-files-upload'), document.getElementById('page-images-list'), document.getElementById('page-files-list')); - var optionButtons = document.querySelectorAll('.post-option-btn'); - for(var i = 0, length = optionButtons.length; i < length; i++)optionButtons[i].addEventListener('click', (e)=>this.handlePostOptions(e) - , false); + this.fm = new (0, _fileManagerDefault.default)(document.getElementById("page-file-drop"), document.getElementById("page-files-upload"), document.getElementById("page-images-list"), document.getElementById("page-files-list")); + var optionButtons = document.querySelectorAll(".post-option-btn"); + for(var i = 0, length = optionButtons.length; i < length; i++)optionButtons[i].addEventListener("click", (e)=>this.handlePostOptions(e), false); } } // event handlers @@ -1691,42 +1617,42 @@ class PostEditor { handlePostOptions(e) { let currentOption = null; switch(e.target.id){ - case 'option-page-icon': - case 'option-menu-pin': - currentOption = document.getElementById('option-menu-pin'); + case "option-page-icon": + case "option-menu-pin": + currentOption = document.getElementById("option-menu-pin"); break; - case 'option-feature-icon': - case 'option-feature': - currentOption = document.getElementById('option-feature'); + case "option-feature-icon": + case "option-feature": + currentOption = document.getElementById("option-feature"); break; - case 'option-published-icon': - case 'option-published': - currentOption = document.getElementById('option-published'); + case "option-published-icon": + case "option-published": + currentOption = document.getElementById("option-published"); break; } if (currentOption != null) { - let active = currentOption.getAttribute('data-active'); - active == 'false' ? currentOption.setAttribute('data-active', 'true') : currentOption.setAttribute('data-active', 'false'); + let active = currentOption.getAttribute("data-active"); + active == "false" ? currentOption.setAttribute("data-active", "true") : currentOption.setAttribute("data-active", "false"); } } - handleEditorOptions(e1) { + handleEditorOptions(e) { if (this.processing) return; let self = this; - switch(e1){ + switch(e){ case _editorEvent.EDITOR_SAVE: case _editorEvent.EDITOR_UPDATE: - var task = ''; - e1 === _editorEvent.EDITOR_SAVE ? task = _fipamoAdminAPI.TASK_PAGE_CREATE : task = _fipamoAdminAPI.TASK_PAGE_EDIT; - new _pageActionsDefault.default().collectInfo(this.fm.getFiles()).then((page)=>{ + var task = ""; + e === _editorEvent.EDITOR_SAVE ? task = (0, _fipamoAdminAPI.TASK_PAGE_CREATE) : task = (0, _fipamoAdminAPI.TASK_PAGE_EDIT); + new (0, _pageActionsDefault.default)().collectInfo(this.fm.getFiles()).then((page)=>{ self.processing = true; - notify.alert('Writing down changes', null); + notify.alert("Writing down changes", null); self.admin.pageActions(task, page).then((r)=>{ self.processing = false; if (r.type === _dataEvent.PAGE_ERROR || r.type === _dataEvent.API_REQUEST_LAME) notify.alert(r.message, false); else if (r.type === _dataEvent.PAGE_UPDATED) notify.alert(r.message, true); else { notify.alert(r.message, true); - window.location = '/dashboard/page/edit/' + r.id; + window.location = "/dashboard/page/edit/" + r.id; } }).catch((err)=>{ self.processing = false; @@ -1735,44 +1661,43 @@ class PostEditor { }); break; case _editorEvent.EDITOR_DELETE: - if (this.postLayout === 'index') { - notify.alert('Index cannot be deleted', false); + if (this.postLayout === "index") { + notify.alert("Index cannot be deleted", false); return; } - if (confirm("AYE! You know you're deleting this post, right?")) new _pageActionsDefault.default().collectInfo(document.getElementById('featured-image-upload').files[0]).then((page)=>{ + if (confirm("AYE! You know you're deleting this post, right?")) new (0, _pageActionsDefault.default)().collectInfo(document.getElementById("featured-image-upload").files[0]).then((page)=>{ self.processing = true; - this.admin.pageActions(_fipamoAdminAPI.TASK_PAGE_DELETE, page).then(()=>{ + this.admin.pageActions((0, _fipamoAdminAPI.TASK_PAGE_DELETE), page).then(()=>{ self.processing = false; - window.location = '/dashboard/pages'; + window.location = "/dashboard/pages"; }).catch((err)=>{ self.processing = false; notify.alert(err, false); }); - }).catch(()=>{ - }); + }).catch(()=>{}); break; case _editorEvent.EDITOR_UPLOAD_POST_IMAGE: - document.getElementById('post-image-upload').click(); + document.getElementById("post-image-upload").click(); break; } } handleImageUpload(type, files) { let self = this; - notify.alert('Uploading Image', null); + notify.alert("Uploading Image", null); self.mm.imageUpload(type, files).then((r)=>{ if (r.type == _dataEvent.POST_IMAGE_ADDED) { self.editor.notify(_editorEvent.EDITOR_UPLOAD_POST_IMAGE, r.url); - notify.alert('Image Added to Entry', true); - } else notify.alert('Uh oh. Image not added', false); + notify.alert("Image Added to Entry", true); + } else notify.alert("Uh oh. Image not added", false); }).catch(()=>{ - notify.alert('Uh oh. Image not added', false); //console.log('ERROR', err); + notify.alert("Uh oh. Image not added", false); //console.log('ERROR', err); }); } } exports.default = PostEditor; PostEditor.uploadFiles = []; -},{"../../libraries/FipamoAdminAPI":"6M96o","./MaintenanceManager":"kY7L1","../events/DataEvent":"edzJV","../actions/PageActions":"5t6eY","../events/EditorEvent":"dW8iq","../ui/TextEditor":"bMFpA","../ui/Notifications":"fmUxI","../ui/FileManager":"kp4D5","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"5t6eY":[function(require,module,exports) { +},{"../../libraries/FipamoAdminAPI":"3dcvg","./MaintenanceManager":"cYXLM","../events/DataEvent":"hCRFh","../actions/PageActions":"aIgBQ","../events/EditorEvent":"lqMYV","../ui/TextEditor":"hpLqF","../ui/Notifications":"9GRdG","../ui/FileManager":"6B20o","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"aIgBQ":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _stringUtils = require("../utils/StringUtils"); @@ -1781,41 +1706,41 @@ class PostActions { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- collectInfo(files) { return new Promise((resolve, reject)=>{ let pageInfo = new FormData(); - let txt = document.createElement('textarea'); - txt.innerHTML = document.getElementById('highlight-content').innerHTML; + pageInfo.enctype = "multipart/form-data"; + let txt = document.createElement("textarea"); + txt.innerHTML = document.getElementById("highlight-content").innerHTML; let html = txt.value; - html = html.replace(/<\/?span[^>]*>/g, ''); //removes prism styling - html = html.replace(/<\/?br[^>]*>/g, '\n'); //convert back to encoded line break for storage - pageInfo.append('id', document.getElementById('post-edit-index').getAttribute('data-index')); - pageInfo.append('uuid', document.getElementById('post-edit-index').getAttribute('data-uuid')); - pageInfo.append('layout', document.getElementById('post-edit-index').getAttribute('data-layout')); - pageInfo.append('current_title', document.getElementById('post-edit-index').getAttribute('data-slug')); - pageInfo.append('content', html); - pageInfo.append('title', document.getElementById('post-title-text').value); - pageInfo.append('created', document.getElementById('post-date').getAttribute('data-raw')); - pageInfo.append('slug', new _stringUtilsDefault.default().cleanString(document.getElementById('post-title-text').value)); - pageInfo.append('tags', document.getElementById('post-tags').value); - pageInfo.append('menu', document.getElementById('option-menu-pin').getAttribute('data-active')); - pageInfo.append('featured', document.getElementById('option-feature').getAttribute('data-active')); - pageInfo.append('published', document.getElementById('option-published').getAttribute('data-active')); - pageInfo.append('layout', document.getElementById('page-templates').value); - pageInfo.append('form_token', document.getElementById('form_token').value); + html = html.replace(/<\/?span[^>]*>/g, ""); //removes prism styling + html = html.replace(/<\/?br[^>]*>/g, "\n"); //convert back to encoded line break for storage + pageInfo.append("id", document.getElementById("post-edit-index").getAttribute("data-index")); + pageInfo.append("uuid", document.getElementById("post-edit-index").getAttribute("data-uuid")); + pageInfo.append("layout", document.getElementById("post-edit-index").getAttribute("data-layout")); + pageInfo.append("current_title", document.getElementById("post-edit-index").getAttribute("data-slug")); + pageInfo.append("content", html); + pageInfo.append("title", document.getElementById("post-title-text").value); + pageInfo.append("created", document.getElementById("post-date").getAttribute("data-raw")); + pageInfo.append("slug", new (0, _stringUtilsDefault.default)().cleanString(document.getElementById("post-title-text").value)); + pageInfo.append("tags", document.getElementById("post-tags").value); + pageInfo.append("menu", document.getElementById("option-menu-pin").getAttribute("data-active")); + pageInfo.append("featured", document.getElementById("option-feature").getAttribute("data-active")); + pageInfo.append("published", document.getElementById("option-published").getAttribute("data-active")); + pageInfo.append("layout", document.getElementById("page-templates").value); + pageInfo.append("form_token", document.getElementById("form_token").value); if (files.length > 0 && files != null) for(var i = 0; i < files.length; i++){ var file = files[i]; - if (file.type.match('image.*') || file.type.match('video.mp4') || file.type.match('audio.mpeg') || file.type.match('application.pdf') || file.type.match('text.plain') || file.type.match('text.rtf')) pageInfo.append('page_files[]', file, file.name); - else reject('Not an image file: ' + file.type); + if (file.type.match("image.*") || file.type.match("video.mp4") || file.type.match("audio.mpeg") || file.type.match("application.pdf") || file.type.match("text.plain") || file.type.match("text.rtf")) pageInfo.append("page_files[]", file, file.name); + else reject("Not an image file: " + file.type); } else //check to see if image exists - if (document.getElementById('featured-image')) { - var imageURL = document.getElementById('featured-image').src; - imageURL != null || imageURL != undefined ? pageInfo.append('feature_image', imageURL) : pageInfo.append('feature_image', null); + if (document.getElementById("featured-image")) { + var imageURL = document.getElementById("featured-image").src; + imageURL != null || imageURL != undefined ? pageInfo.append("feature_image", imageURL) : pageInfo.append("feature_image", null); } //console.log("FILES", files); resolve(pageInfo); @@ -1824,25 +1749,24 @@ class PostActions { } exports.default = PostActions; -},{"../utils/StringUtils":"firFv","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"firFv":[function(require,module,exports) { +},{"../utils/StringUtils":"3SgRC","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"3SgRC":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); class StringUtils { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- cleanString(string) { - var clean = string.replace(/(^\-+|[^a-zA-Z0-9\/_| -]+|\-+$)/g, '').toLowerCase().replace(/[\/_| -]+/g, '-'); + var clean = string.replace(/(^\-+|[^a-zA-Z0-9\/_| -]+|\-+$)/g, "").toLowerCase().replace(/[\/_| -]+/g, "-"); return clean; } - decodeHTML(string1, quote_style) { + decodeHTML(string, quote_style) { var optTemp = 0, i = 0, noquotes = false; - if (typeof quote_style === 'undefined') quote_style = 2; - string1 = string1.toString().replace(/</g, '<').replace(/>/g, '>'); + if (typeof quote_style === "undefined") quote_style = 2; + string = string.toString().replace(/</g, "<").replace(/>/g, ">"); var OPTS = { ENT_NOQUOTES: 0, ENT_HTML_QUOTE_SINGLE: 1, @@ -1852,7 +1776,7 @@ class StringUtils { ENT_IGNORE: 4 }; if (quote_style === 0) noquotes = true; - if (typeof quote_style !== 'number') { + if (typeof quote_style !== "number") { // Allow for a single string or an array of string flags quote_style = [].concat(quote_style); for(i = 0; i < quote_style.length; i++){ @@ -1862,35 +1786,31 @@ class StringUtils { } quote_style = optTemp; } - if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) string1 = string1.replace(/�*39;/g, "'"); // PHP doesn't currently escape if more than one 0, but it should - if (!noquotes) string1 = string1.replace(/"/g, '"'); + if (quote_style & OPTS.ENT_HTML_QUOTE_SINGLE) string = string.replace(/�*39;/g, "'"); // PHP doesn't currently escape if more than one 0, but it should + if (!noquotes) string = string.replace(/"/g, '"'); // Put this in last place to avoid escape being double-decoded - string1 = string1.replace(/&/g, '&'); - return string1; + string = string.replace(/&/g, "&"); + return string; } } exports.default = StringUtils; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"dW8iq":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"lqMYV":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "EDITOR_DELETE", ()=>EDITOR_DELETE -); -parcelHelpers.export(exports, "EDITOR_UPLOAD_POST_IMAGE", ()=>EDITOR_UPLOAD_POST_IMAGE -); -parcelHelpers.export(exports, "EDITOR_SAVE", ()=>EDITOR_SAVE -); -parcelHelpers.export(exports, "EDITOR_UPDATE", ()=>EDITOR_UPDATE -); -const EDITOR_DELETE = 'editorDelete'; -const EDITOR_UPLOAD_POST_IMAGE = 'editorUploadImage'; -const EDITOR_SAVE = 'editorSave'; -const EDITOR_UPDATE = 'editorUpdate'; +parcelHelpers.export(exports, "EDITOR_DELETE", ()=>EDITOR_DELETE); +parcelHelpers.export(exports, "EDITOR_UPLOAD_POST_IMAGE", ()=>EDITOR_UPLOAD_POST_IMAGE); +parcelHelpers.export(exports, "EDITOR_SAVE", ()=>EDITOR_SAVE); +parcelHelpers.export(exports, "EDITOR_UPDATE", ()=>EDITOR_UPDATE); +const EDITOR_DELETE = "editorDelete"; +const EDITOR_UPLOAD_POST_IMAGE = "editorUploadImage"; +const EDITOR_SAVE = "editorSave"; +const EDITOR_UPDATE = "editorUpdate"; class EditorEvent { } exports.default = new EditorEvent(); -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"bMFpA":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"hpLqF":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _dataEvent = require("../events/DataEvent"); @@ -1902,7 +1822,7 @@ var _prismCore = require("prismjs/components/prism-core"); var _prismCoreDefault = parcelHelpers.interopDefault(_prismCore); var _prismMarkup = require("prismjs/components/prism-markup"); var _prismMarkdown = require("prismjs/components/prism-markdown"); -class TextEditor extends _eventEmitterDefault.default { +class TextEditor extends (0, _eventEmitterDefault.default) { /** * Text Editor UI Component * @constructor @@ -1922,7 +1842,7 @@ class TextEditor extends _eventEmitterDefault.default { document.getElementById("edit-post-wrapper").style.height = editorHeight + "px"; e.target.style.height = editorHeight + 30 + "px"; //TODO: yeah, it's ugly but it works for now, fix soon // Syntax Highlight - _prismCoreDefault.default.highlightElement(result_element); + (0, _prismCoreDefault.default).highlightElement(result_element); }); document.getElementById("edit").addEventListener("scroll", (e)=>{ /* Scroll result to scroll coords of event - sync with textarea */ let result_element = document.querySelector("#highlight"); // Get and set x and y @@ -1941,8 +1861,7 @@ class TextEditor extends _eventEmitterDefault.default { //-------------------------- setInputs() { var editorButtons = document.querySelectorAll(".editor-button"); - for(var i = 0, length = editorButtons.length; i < length; i++)editorButtons[i].addEventListener("click", (e)=>this.handleEditorOption(e) - , false); + for(var i = 0, length = editorButtons.length; i < length; i++)editorButtons[i].addEventListener("click", (e)=>this.handleEditorOption(e), false); } notify(type, data) { switch(type){ @@ -2015,7 +1934,7 @@ class TextEditor extends _eventEmitterDefault.default { } break; case "edit-image": - this.caretPos = _caretPos.position(this.textEditor).pos; + this.caretPos = (0, _caretPos.position)(this.textEditor).pos; this.emitEvent(_editorEvent.EDITOR_UPLOAD_POST_IMAGE); break; case "submit-save": @@ -2037,49 +1956,46 @@ class TextEditor extends _eventEmitterDefault.default { } exports.default = TextEditor; -},{"../events/DataEvent":"edzJV","caret-pos":"9lzNv","../events/EventEmitter":"cbFNs","../events/EditorEvent":"dW8iq","prismjs/components/prism-core":"cps8h","prismjs/components/prism-markup":"dIns2","prismjs/components/prism-markdown":"gqRFx","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"9lzNv":[function(require,module,exports) { +},{"../events/DataEvent":"hCRFh","caret-pos":"eNzYQ","../events/EventEmitter":"7LyKC","../events/EditorEvent":"lqMYV","prismjs/components/prism-core":"dRApq","prismjs/components/prism-markup":"lzIPu","prismjs/components/prism-markdown":"15tfx","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"eNzYQ":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "getOffset", ()=>getOffset1 -); -parcelHelpers.export(exports, "offset", ()=>offset1 -); -parcelHelpers.export(exports, "position", ()=>position1 -); +parcelHelpers.export(exports, "getOffset", ()=>getOffset); +parcelHelpers.export(exports, "offset", ()=>offset); +parcelHelpers.export(exports, "position", ()=>position); var attributes = [ - 'borderBottomWidth', - 'borderLeftWidth', - 'borderRightWidth', - 'borderTopStyle', - 'borderRightStyle', - 'borderBottomStyle', - 'borderLeftStyle', - 'borderTopWidth', - 'boxSizing', - 'fontFamily', - 'fontSize', - 'fontWeight', - 'height', - 'letterSpacing', - 'lineHeight', - 'marginBottom', - 'marginLeft', - 'marginRight', - 'marginTop', - 'outlineWidth', - 'overflow', - 'overflowX', - 'overflowY', - 'paddingBottom', - 'paddingLeft', - 'paddingRight', - 'paddingTop', - 'textAlign', - 'textOverflow', - 'textTransform', - 'whiteSpace', - 'wordBreak', - 'wordWrap' + "borderBottomWidth", + "borderLeftWidth", + "borderRightWidth", + "borderTopStyle", + "borderRightStyle", + "borderBottomStyle", + "borderLeftStyle", + "borderTopWidth", + "boxSizing", + "fontFamily", + "fontSize", + "fontWeight", + "height", + "letterSpacing", + "lineHeight", + "marginBottom", + "marginLeft", + "marginRight", + "marginTop", + "outlineWidth", + "overflow", + "overflowX", + "overflowY", + "paddingBottom", + "paddingLeft", + "paddingRight", + "paddingTop", + "textAlign", + "textOverflow", + "textTransform", + "whiteSpace", + "wordBreak", + "wordWrap" ]; /** * Create a mirror @@ -2091,19 +2007,19 @@ var attributes = [ */ var createMirror = function createMirror(element, html1) { /** * The mirror element - */ var mirror = document.createElement('div'); + */ var mirror = document.createElement("div"); /** * Create the CSS for the mirror object * * @return {object} The style object */ var mirrorCss = function mirrorCss() { var css = { - position: 'absolute', + position: "absolute", left: -9999, top: 0, zIndex: -2000 }; - if (element.tagName === 'TEXTAREA') attributes.push('width'); + if (element.tagName === "TEXTAREA") attributes.push("width"); attributes.forEach(function(attr) { css[attr] = getComputedStyle(element)[attr]; }); @@ -2128,7 +2044,7 @@ var attributes = [ * * @return {Rect} The bounding rect */ var rect = function rect() { - var marker = mirror.ownerDocument.getElementById('caret-position-marker'); + var marker = mirror.ownerDocument.getElementById("caret-position-marker"); var boundingRect = { left: marker.offsetLeft, top: marker.offsetTop, @@ -2143,6 +2059,7 @@ var attributes = [ }; }; function _typeof(obj1) { + "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") _typeof = function(obj) { return typeof obj; }; @@ -2158,7 +2075,7 @@ function _typeof(obj1) { * * @return {bool} If it is content editable */ var isContentEditable = function isContentEditable(element) { - return !!(element.contentEditable ? element.contentEditable === 'true' : element.getAttribute('contenteditable') === 'true'); + return !!(element.contentEditable ? element.contentEditable === "true" : element.getAttribute("contenteditable") === "true"); }; /** * Get the context from settings passed in @@ -2167,8 +2084,7 @@ function _typeof(obj1) { * * @return {object} window and document */ var getContext = function getContext() { - var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { - }; + var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var customPos = settings.customPos, iframe = settings.iframe, noShadowCaret = settings.noShadowCaret; if (iframe) return { iframe: iframe, @@ -2191,7 +2107,7 @@ function _typeof(obj1) { * @param {object} ctx The context * * @return {object} top and left - */ var getOffset1 = function getOffset(element, ctx) { + */ var getOffset = function getOffset(element, ctx) { var win = ctx && ctx.window || window; var doc = ctx && ctx.document || document; var rect = element.getBoundingClientRect(); @@ -2210,7 +2126,7 @@ function _typeof(obj1) { * * @return {bool} If it is an object */ var isObject = function isObject(value) { - return _typeof(value) === 'object' && value !== null; + return _typeof(value) === "object" && value !== null; }; /** * Create a Input caret object. @@ -2242,12 +2158,12 @@ function _typeof(obj1) { * * @return {object} The offset */ var getOffset$1 = function getOffset$1(pos) { - var rect = getOffset1(element); - var position = getPosition(pos); + var rect = getOffset(element); + var position1 = getPosition(pos); return { - top: rect.top + position.top + ctx.document.body.scrollTop, - left: rect.left + position.left + ctx.document.body.scrollLeft, - height: position.height + top: rect.top + position1.top + ctx.document.body.scrollTop, + left: rect.left + position1.left + ctx.document.body.scrollLeft, + height: position1.height }; }; /** @@ -2258,16 +2174,16 @@ function _typeof(obj1) { * @return {object} The position */ var getPosition = function getPosition(pos) { var format = function format(val) { - var value = val.replace(/<|>|`|"|&/g, '?').replace(/\r\n|\r|\n/g, '
'); + var value = val.replace(/<|>|`|"|&/g, "?").replace(/\r\n|\r|\n/g, "
"); return value; }; if (ctx.customPos || ctx.customPos === 0) pos = ctx.customPos; - var position = pos === undefined ? getPos() : pos; - var startRange = element.value.slice(0, position); - var endRange = element.value.slice(position); - var html = "".concat(format(startRange), ""); + var position2 = pos === undefined ? getPos() : pos; + var startRange = element.value.slice(0, position2); + var endRange = element.value.slice(position2); + var html = ''.concat(format(startRange), ""); html += '|'; - html += "".concat(format(endRange), ""); + html += ''.concat(format(endRange), ""); var mirror = createMirror(element, html); var rect = mirror.rect(); rect.pos = getPos(); @@ -2296,21 +2212,21 @@ function _typeof(obj1) { */ var setPos = function setPos(pos) { var sel = ctx.window.getSelection(); if (sel) { - var offset = 0; + var offset1 = 0; var found = false; - var find1 = function find(position, parent) { + var find1 = function find(position3, parent) { for(var i = 0; i < parent.childNodes.length; i++){ var node = parent.childNodes[i]; if (found) break; if (node.nodeType === 3) { - if (offset + node.length >= position) { + if (offset1 + node.length >= position3) { found = true; var range = ctx.document.createRange(); - range.setStart(node, position - offset); + range.setStart(node, position3 - offset1); sel.removeAllRanges(); sel.addRange(range); break; - } else offset += node.length; + } else offset1 += node.length; } else find(pos, node); } }; @@ -2322,14 +2238,14 @@ function _typeof(obj1) { * Get the offset * * @return {object} The offset - */ var getOffset = function getOffset() { + */ var getOffset1 = function getOffset() { var range = getRange(); - var offset = { + var offset2 = { height: 0, left: 0, right: 0 }; - if (!range) return offset; + if (!range) return offset2; var hasCustomPos = ctx.customPos || ctx.customPos === 0; // endContainer in Firefox would be the element at the start of // the line if (range.endOffset - 1 > 0 && range.endContainer !== element || hasCustomPos) { @@ -2338,20 +2254,20 @@ function _typeof(obj1) { clonedRange.setStart(range.endContainer, fixedPosition - 1 < 0 ? 0 : fixedPosition - 1); clonedRange.setEnd(range.endContainer, fixedPosition); var rect = clonedRange.getBoundingClientRect(); - offset = { + offset2 = { height: rect.height, left: rect.left + rect.width, top: rect.top }; clonedRange.detach(); } - if ((!offset || offset && offset.height === 0) && !ctx.noShadowCaret) { + if ((!offset2 || offset2 && offset2.height === 0) && !ctx.noShadowCaret) { var _clonedRange = range.cloneRange(); - var shadowCaret = ctx.document.createTextNode('|'); + var shadowCaret = ctx.document.createTextNode("|"); _clonedRange.insertNode(shadowCaret); _clonedRange.selectNode(shadowCaret); var _rect = _clonedRange.getBoundingClientRect(); - offset = { + offset2 = { height: _rect.height, left: _rect.left, top: _rect.top @@ -2359,29 +2275,29 @@ function _typeof(obj1) { shadowCaret.parentNode.removeChild(shadowCaret); _clonedRange.detach(); } - if (offset) { + if (offset2) { var doc = ctx.document.documentElement; - offset.top += ctx.window.pageYOffset - (doc.clientTop || 0); - offset.left += ctx.window.pageXOffset - (doc.clientLeft || 0); + offset2.top += ctx.window.pageYOffset - (doc.clientTop || 0); + offset2.left += ctx.window.pageXOffset - (doc.clientLeft || 0); } - return offset; + return offset2; }; /** * Get the position * * @return {object} The position */ var getPosition = function getPosition() { - var offset = getOffset(); + var offset3 = getOffset1(); var pos = getPos(); var rect = element.getBoundingClientRect(); var inputOffset = { top: rect.top + ctx.document.body.scrollTop, left: rect.left + ctx.document.body.scrollLeft }; - offset.left -= inputOffset.left; - offset.top -= inputOffset.top; - offset.pos = pos; - return offset; + offset3.left -= inputOffset.left; + offset3.top -= inputOffset.top; + offset3.pos = pos; + return offset3; }; /** * Get the range @@ -2409,7 +2325,7 @@ function _typeof(obj1) { getPos: getPos, setPos: setPos, getPosition: getPosition, - getOffset: getOffset, + getOffset: getOffset1, getRange: getRange }; }; @@ -2417,9 +2333,8 @@ var createCaret = function createCaret(element, ctx) { if (isContentEditable(element)) return createEditableCaret(element, ctx); return createInputCaret(element, ctx); }; -var position1 = function position(element, value) { - var settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - }; +var position = function position(element, value) { + var settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var options = settings; if (isObject(value)) { options = value; @@ -2435,9 +2350,8 @@ var position1 = function position(element, value) { * @param {Element} element The DOM element * @param {number|undefined} value The value to set * @param {object} settings Any settings for context - */ var offset1 = function offset(element, value) { - var settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - }; + */ var offset = function offset(element, value) { + var settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var options = settings; if (isObject(value)) { options = value; @@ -2448,7 +2362,7 @@ var position1 = function position(element, value) { return caret.getOffset(value); }; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"cbFNs":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"7LyKC":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); class EventEmitter { @@ -2464,25 +2378,25 @@ class EventEmitter { this.listeners.has(label) || this.listeners.set(label, []); this.listeners.get(label).push(callback); } - removeListener(label1, callback1) { + removeListener(label, callback) { var isFunction = function(obj) { - return typeof obj == 'function' || false; + return typeof obj == "function" || false; }; - var listeners = this.listeners.get(label1), index1; + var listeners = this.listeners.get(label), index1; if (listeners && listeners.length) { index1 = listeners.reduce((i, listener, index)=>{ - return isFunction(listener) && listener === callback1 ? i = index : i; + return isFunction(listener) && listener === callback ? i = index : i; }, -1); if (index1 > -1) { listeners.splice(index1, 1); - this.listeners.set(label1, listeners); + this.listeners.set(label, listeners); return true; } } return false; } - emitEvent(label2, ...args) { - var listeners = this.listeners.get(label2); + emitEvent(label, ...args) { + var listeners = this.listeners.get(label); if (listeners && listeners.length) { listeners.forEach((listener)=>{ listener(...args); @@ -2494,13 +2408,12 @@ class EventEmitter { } exports.default = EventEmitter; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"cps8h":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"dRApq":[function(require,module,exports) { var global = arguments[3]; /// -var _self1 = typeof window !== 'undefined' ? window // if in browser - : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self // if in worker - : { -} // if in node js +var _self = typeof window !== "undefined" ? window // if in browser + : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self // if in worker + : {} // if in node js ; /** * Prism: Lightweight, robust, elegant syntax highlighting @@ -2509,13 +2422,12 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser * @author Lea Verou * @namespace * @public - */ var Prism = function(_self) { + */ var Prism = function(_self1) { // Private helper vars - var lang1 = /\blang(?:uage)?-([\w-]+)\b/i; + var lang1 = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i; var uniqueId = 0; // The grammar object for plaintext - var plainTextGrammar = { - }; + var plainTextGrammar = {}; var _ = { /** * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the @@ -2537,8 +2449,28 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser * @type {boolean} * @memberof Prism * @public - */ manual: _self.Prism && _self.Prism.manual, - disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, + */ manual: _self1.Prism && _self1.Prism.manual, + /** + * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses + * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your + * own worker, you don't want it to do this. + * + * By setting this value to `true`, Prism will not add its own listeners to the worker. + * + * You obviously have to change this value before Prism executes. To do this, you can add an + * empty Prism object into the global scope before loading the Prism script like this: + * + * ```js + * window.Prism = window.Prism || {}; + * Prism.disableWorkerMessageHandler = true; + * // Load Prism's script + * ``` + * + * @default false + * @type {boolean} + * @memberof Prism + * @public + */ disableWorkerMessageHandler: _self1.Prism && _self1.Prism.disableWorkerMessageHandler, /** * A namespace for utility methods. * @@ -2551,7 +2483,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser encode: function encode(tokens) { if (tokens instanceof Token) return new Token(tokens.type, encode(tokens.content), tokens.alias); else if (Array.isArray(tokens)) return tokens.map(encode); - else return tokens.replace(/&/g, '&').replace(/' + env.content + ''; + _.hooks.run("wrap", env); + var attributes = ""; + for(var name in env.attributes)attributes += " " + name + '="' + (env.attributes[name] || "").replace(/"/g, """) + '"'; + return "<" + env.tag + ' class="' + env.classes.join(" ") + '"' + attributes + ">" + env.content + ""; }; /** * @param {RegExp} pattern @@ -3209,7 +3149,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser patterns ]; for(var j = 0; j < patterns.length; ++j){ - if (rematch && rematch.cause == token + ',' + j) return; + if (rematch && rematch.cause == token + "," + j) return; var patternObj = patterns[j]; var inside = patternObj.inside; var lookbehind = !!patternObj.lookbehind; @@ -3218,7 +3158,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser if (greedy && !patternObj.pattern.global) { // Without the global flag, lastIndex won't work var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0]; - patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g'); + patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g"); } /** @type {RegExp} */ var pattern = patternObj.pattern || patternObj; for(var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next){ @@ -3231,7 +3171,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser var match; if (greedy) { match = matchPattern(pattern, pos, text, lookbehind); - if (!match) break; + if (!match || match.index >= text.length) break; var from = match.index; var to = match.index + match[0].length; var p = pos; @@ -3247,7 +3187,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser // the current node is a Token, then the match starts inside another Token, which is invalid if (currentNode.value instanceof Token) continue; // find the last node which is affected by this match - for(var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === 'string'); k = k.next){ + for(var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === "string"); k = k.next){ removeCount++; p += k.value.length; } @@ -3279,7 +3219,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser // at least one Token object was removed, so we have to do some rematching // this can only happen if the current pattern is greedy /** @type {RematchOptions} */ var nestedRematch = { - cause: token + ',' + j, + cause: token + "," + j, reach: reach }; matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch); @@ -3364,17 +3304,17 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser } return array; } - if (!_self.document) { - if (!_self.addEventListener) // in Node.js + if (!_self1.document) { + if (!_self1.addEventListener) // in Node.js return _; if (!_.disableWorkerMessageHandler) // In worker - _self.addEventListener('message', function(evt) { + _self1.addEventListener("message", function(evt) { var message = JSON.parse(evt.data); var lang = message.language; var code = message.code; var immediateClose = message.immediateClose; - _self.postMessage(_.highlight(code, _.languages[lang], lang)); - if (immediateClose) _self.close(); + _self1.postMessage(_.highlight(code, _.languages[lang], lang)); + if (immediateClose) _self1.close(); }, false); return _; } @@ -3382,7 +3322,7 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser var script = _.util.currentScript(); if (script) { _.filename = script.src; - if (script.hasAttribute('data-manual')) _.manual = true; + if (script.hasAttribute("data-manual")) _.manual = true; } function highlightAutomaticallyCallback() { if (!_.manual) _.highlightAll(); @@ -3395,15 +3335,15 @@ var _self1 = typeof window !== 'undefined' ? window // if in browser // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded. // See https://github.com/PrismJS/prism/issues/2102 var readyState = document.readyState; - if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); + if (readyState === "loading" || readyState === "interactive" && script && script.defer) document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback); else if (window.requestAnimationFrame) window.requestAnimationFrame(highlightAutomaticallyCallback); else window.setTimeout(highlightAutomaticallyCallback, 16); } return _; -}(_self1); -if (typeof module !== 'undefined' && module.exports) module.exports = Prism; +}(_self); +if (module.exports) module.exports = Prism; // hack for components to work correctly in node.js -if (typeof global !== 'undefined') global.Prism = Prism; +if (typeof global !== "undefined") global.Prism = Prism; // some additional documentation/types /** * The expansion of a simple `RegExp` literal to support additional properties. @@ -3446,88 +3386,88 @@ if (typeof global !== 'undefined') global.Prism = Prism; * @public */ -},{}],"dIns2":[function(require,module,exports) { +},{}],"lzIPu":[function(require,module,exports) { Prism.languages.markup = { - 'comment': { + "comment": { pattern: //, greedy: true }, - 'prolog': { + "prolog": { pattern: /<\?[\s\S]+?\?>/, greedy: true }, - 'doctype': { + "doctype": { // https://www.w3.org/TR/xml/#NT-doctypedecl pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, greedy: true, inside: { - 'internal-subset': { + "internal-subset": { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: true, greedy: true, inside: null // see below }, - 'string': { + "string": { pattern: /"[^"]*"|'[^']*'/, greedy: true }, - 'punctuation': /^$|[[\]]/, - 'doctype-tag': /^DOCTYPE/i, - 'name': /[^\s<>'"]+/ + "punctuation": /^$|[[\]]/, + "doctype-tag": /^DOCTYPE/i, + "name": /[^\s<>'"]+/ } }, - 'cdata': { + "cdata": { pattern: //i, greedy: true }, - 'tag': { + "tag": { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: true, inside: { - 'tag': { + "tag": { pattern: /^<\/?[^\s>\/]+/, inside: { - 'punctuation': /^<\/?/, - 'namespace': /^[^\s>\/:]+:/ + "punctuation": /^<\/?/, + "namespace": /^[^\s>\/:]+:/ } }, - 'special-attr': [], - 'attr-value': { + "special-attr": [], + "attr-value": { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { - 'punctuation': [ + "punctuation": [ { pattern: /^=/, - alias: 'attr-equals' + alias: "attr-equals" }, /"|'/ ] } }, - 'punctuation': /\/?>/, - 'attr-name': { + "punctuation": /\/?>/, + "attr-name": { pattern: /[^\s>\/]+/, inside: { - 'namespace': /^[^\s>\/:]+:/ + "namespace": /^[^\s>\/:]+:/ } } } }, - 'entity': [ + "entity": [ { pattern: /&[\da-z]{1,8};/i, - alias: 'named-entity' + alias: "named-entity" }, /&#x?[\da-f]{1,8};/i ] }; -Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; -Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup; +Prism.languages.markup["tag"].inside["attr-value"].inside["entity"] = Prism.languages.markup["entity"]; +Prism.languages.markup["doctype"].inside["internal-subset"].inside = Prism.languages.markup; // Plugin to make entity title show the real entity, idea by Roman Komarov -Prism.hooks.add('wrap', function(env) { - if (env.type === 'entity') env.attributes['title'] = env.content.replace(/&/, '&'); +Prism.hooks.add("wrap", function(env) { + if (env.type === "entity") env.attributes["title"] = env.content.replace(/&/, "&"); }); -Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { +Object.defineProperty(Prism.languages.markup.tag, "addInlined", { /** * Adds an inlined language to markup. * @@ -3539,38 +3479,36 @@ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { * @example * addInlined('style', 'css'); */ value: function addInlined(tagName, lang) { - var includedCdataInside = { - }; - includedCdataInside['language-' + lang] = { + var includedCdataInside = {}; + includedCdataInside["language-" + lang] = { pattern: /(^$)/i, lookbehind: true, inside: Prism.languages[lang] }; - includedCdataInside['cdata'] = /^$/i; + includedCdataInside["cdata"] = /^$/i; var inside = { - 'included-cdata': { + "included-cdata": { pattern: //i, inside: includedCdataInside } }; - inside['language-' + lang] = { + inside["language-" + lang] = { pattern: /[\s\S]+/, inside: Prism.languages[lang] }; - var def = { - }; + var def = {}; def[tagName] = { pattern: RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function() { return tagName; - }), 'i'), + }), "i"), lookbehind: true, greedy: true, inside: inside }; - Prism.languages.insertBefore('markup', 'cdata', def); + Prism.languages.insertBefore("markup", "cdata", def); } }); -Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', { +Object.defineProperty(Prism.languages.markup.tag, "addAttribute", { /** * Adds an pattern to highlight languages embedded in HTML attributes. * @@ -3582,27 +3520,27 @@ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', { * @example * addAttribute('style', 'css'); */ value: function(attrName, lang) { - Prism.languages.markup.tag.inside['special-attr'].push({ - pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'), + Prism.languages.markup.tag.inside["special-attr"].push({ + pattern: RegExp(/(^|["'\s])/.source + "(?:" + attrName + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), lookbehind: true, inside: { - 'attr-name': /^[^\s=]+/, - 'attr-value': { + "attr-name": /^[^\s=]+/, + "attr-value": { pattern: /=[\s\S]+/, inside: { - 'value': { + "value": { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: true, alias: [ lang, - 'language-' + lang + "language-" + lang ], inside: Prism.languages[lang] }, - 'punctuation': [ + "punctuation": [ { pattern: /^=/, - alias: 'attr-equals' + alias: "attr-equals" }, /"|'/ ] @@ -3615,13 +3553,12 @@ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', { Prism.languages.html = Prism.languages.markup; Prism.languages.mathml = Prism.languages.markup; Prism.languages.svg = Prism.languages.markup; -Prism.languages.xml = Prism.languages.extend('markup', { -}); +Prism.languages.xml = Prism.languages.extend("markup", {}); Prism.languages.ssml = Prism.languages.xml; Prism.languages.atom = Prism.languages.xml; Prism.languages.rss = Prism.languages.xml; -},{}],"gqRFx":[function(require,module,exports) { +},{}],"15tfx":[function(require,module,exports) { (function(Prism) { // Allow only one line break var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source; @@ -3638,77 +3575,76 @@ Prism.languages.rss = Prism.languages.xml; pattern = pattern.replace(//g, function() { return inner; }); - return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')'); + return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + pattern + ")"); } var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source; var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() { return tableCell; }); var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source; - Prism.languages.markdown = Prism.languages.extend('markup', { - }); - Prism.languages.insertBefore('markdown', 'prolog', { - 'front-matter-block': { + Prism.languages.markdown = Prism.languages.extend("markup", {}); + Prism.languages.insertBefore("markdown", "prolog", { + "front-matter-block": { pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, lookbehind: true, greedy: true, inside: { - 'punctuation': /^---|---$/, - 'font-matter': { + "punctuation": /^---|---$/, + "front-matter": { pattern: /\S+(?:\s+\S+)*/, alias: [ - 'yaml', - 'language-yaml' + "yaml", + "language-yaml" ], inside: Prism.languages.yaml } } }, - 'blockquote': { + "blockquote": { // > ... pattern: /^>(?:[\t ]*>)*/m, - alias: 'punctuation' + alias: "punctuation" }, - 'table': { - pattern: RegExp('^' + tableRow + tableLine + '(?:' + tableRow + ')*', 'm'), + "table": { + pattern: RegExp("^" + tableRow + tableLine + "(?:" + tableRow + ")*", "m"), inside: { - 'table-data-rows': { - pattern: RegExp('^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'), + "table-data-rows": { + pattern: RegExp("^(" + tableRow + tableLine + ")(?:" + tableRow + ")*$"), lookbehind: true, inside: { - 'table-data': { + "table-data": { pattern: RegExp(tableCell), inside: Prism.languages.markdown }, - 'punctuation': /\|/ + "punctuation": /\|/ } }, - 'table-line': { - pattern: RegExp('^(' + tableRow + ')' + tableLine + '$'), + "table-line": { + pattern: RegExp("^(" + tableRow + ")" + tableLine + "$"), lookbehind: true, inside: { - 'punctuation': /\||:?-{3,}:?/ + "punctuation": /\||:?-{3,}:?/ } }, - 'table-header-row': { - pattern: RegExp('^' + tableRow + '$'), + "table-header-row": { + pattern: RegExp("^" + tableRow + "$"), inside: { - 'table-header': { + "table-header": { pattern: RegExp(tableCell), - alias: 'important', + alias: "important", inside: Prism.languages.markdown }, - 'punctuation': /\|/ + "punctuation": /\|/ } } } }, - 'code': [ + "code": [ { // Prefixed by 4 spaces or 1 tab and preceded by an empty line pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/, lookbehind: true, - alias: 'keyword' + alias: "keyword" }, { // ```optional language @@ -3717,26 +3653,26 @@ Prism.languages.rss = Prism.languages.xml; pattern: /^```[\s\S]*?^```$/m, greedy: true, inside: { - 'code-block': { + "code-block": { pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m, lookbehind: true }, - 'code-language': { + "code-language": { pattern: /^(```).+/, lookbehind: true }, - 'punctuation': /```/ + "punctuation": /```/ } } ], - 'title': [ + "title": [ { // title 1 // ======= // title 2 // ------- pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m, - alias: 'important', + alias: "important", inside: { punctuation: /==+$|--+$/ } @@ -3746,47 +3682,47 @@ Prism.languages.rss = Prism.languages.xml; // ###### title 6 pattern: /(^\s*)#.+/m, lookbehind: true, - alias: 'important', + alias: "important", inside: { punctuation: /^#+|#+$/ } } ], - 'hr': { + "hr": { // *** // --- // * * * // ----------- pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, lookbehind: true, - alias: 'punctuation' + alias: "punctuation" }, - 'list': { + "list": { // * item // + item // - item // 1. item pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, lookbehind: true, - alias: 'punctuation' + alias: "punctuation" }, - 'url-reference': { + "url-reference": { // [id]: http://example.com "Optional title" // [id]: http://example.com 'Optional title' // [id]: http://example.com (Optional title) // [id]: "Optional title" pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, inside: { - 'variable': { + "variable": { pattern: /^(!?\[)[^\]]+/, lookbehind: true }, - 'string': /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, - 'punctuation': /^[\[\]!:]|[<>]/ + "string": /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, + "punctuation": /^[\[\]!:]|[<>]/ }, - alias: 'url' + alias: "url" }, - 'bold': { + "bold": { // **strong** // __strong__ // allow one nested instance of italic text using the same delimiter @@ -3794,16 +3730,15 @@ Prism.languages.rss = Prism.languages.xml; lookbehind: true, greedy: true, inside: { - 'content': { + "content": { pattern: /(^..)[\s\S]+(?=..$)/, lookbehind: true, - inside: { - } // see below + inside: {} // see below }, - 'punctuation': /\*\*|__/ + "punctuation": /\*\*|__/ } }, - 'italic': { + "italic": { // *em* // _em_ // allow one nested instance of bold text using the same delimiter @@ -3811,16 +3746,15 @@ Prism.languages.rss = Prism.languages.xml; lookbehind: true, greedy: true, inside: { - 'content': { + "content": { pattern: /(^.)[\s\S]+(?=.$)/, lookbehind: true, - inside: { - } // see below + inside: {} // see below }, - 'punctuation': /[*_]/ + "punctuation": /[*_]/ } }, - 'strike': { + "strike": { // ~~strike through~~ // ~strike~ // eslint-disable-next-line regexp/strict @@ -3828,27 +3762,26 @@ Prism.languages.rss = Prism.languages.xml; lookbehind: true, greedy: true, inside: { - 'content': { + "content": { pattern: /(^~~?)[\s\S]+(?=\1$)/, lookbehind: true, - inside: { - } // see below + inside: {} // see below }, - 'punctuation': /~~?/ + "punctuation": /~~?/ } }, - 'code-snippet': { + "code-snippet": { // `code` // ``code`` pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, lookbehind: true, greedy: true, alias: [ - 'code', - 'keyword' + "code", + "keyword" ] }, - 'url': { + "url": { // [example](http://example.com "Optional title") // [example][id] // [example] [id] @@ -3856,22 +3789,21 @@ Prism.languages.rss = Prism.languages.xml; lookbehind: true, greedy: true, inside: { - 'operator': /^!/, - 'content': { + "operator": /^!/, + "content": { pattern: /(^\[)[^\]]+(?=\])/, lookbehind: true, - inside: { - } // see below + inside: {} // see below }, - 'variable': { + "variable": { pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, lookbehind: true }, - 'url': { + "url": { pattern: /(^\]\()[^\s)]+/, lookbehind: true }, - 'string': { + "string": { pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, lookbehind: true } @@ -3879,28 +3811,28 @@ Prism.languages.rss = Prism.languages.xml; } }); [ - 'url', - 'bold', - 'italic', - 'strike' + "url", + "bold", + "italic", + "strike" ].forEach(function(token) { [ - 'url', - 'bold', - 'italic', - 'strike', - 'code-snippet' + "url", + "bold", + "italic", + "strike", + "code-snippet" ].forEach(function(inside) { if (token !== inside) Prism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside]; }); }); - Prism.hooks.add('after-tokenize', function(env) { - if (env.language !== 'markdown' && env.language !== 'md') return; + Prism.hooks.add("after-tokenize", function(env) { + if (env.language !== "markdown" && env.language !== "md") return; function walkTokens(tokens) { - if (!tokens || typeof tokens === 'string') return; + if (!tokens || typeof tokens === "string") return; for(var i = 0, l = tokens.length; i < l; i++){ var token = tokens[i]; - if (token.type !== 'code') { + if (token.type !== "code") { walkTokens(token.content); continue; } @@ -3918,20 +3850,20 @@ Prism.languages.rss = Prism.languages.xml; * ]; */ var codeLang = token.content[1]; var codeBlock = token.content[3]; - if (codeLang && codeBlock && codeLang.type === 'code-language' && codeBlock.type === 'code-block' && typeof codeLang.content === 'string') { + if (codeLang && codeBlock && codeLang.type === "code-language" && codeBlock.type === "code-block" && typeof codeLang.content === "string") { // this might be a language that Prism does not support // do some replacements to support C++, C#, and F# - var lang = codeLang.content.replace(/\b#/g, 'sharp').replace(/\b\+\+/g, 'pp'); + var lang = codeLang.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp"); // only use the first word lang = (/[a-z][\w-]*/i.exec(lang) || [ - '' + "" ])[0].toLowerCase(); - var alias = 'language-' + lang; + var alias = "language-" + lang; // add alias if (!codeBlock.alias) codeBlock.alias = [ alias ]; - else if (typeof codeBlock.alias === 'string') codeBlock.alias = [ + else if (typeof codeBlock.alias === "string") codeBlock.alias = [ codeBlock.alias, alias ]; @@ -3941,9 +3873,9 @@ Prism.languages.rss = Prism.languages.xml; } walkTokens(env.tokens); }); - Prism.hooks.add('wrap', function(env) { - if (env.type !== 'code-block') return; - var codeLang = ''; + Prism.hooks.add("wrap", function(env) { + if (env.type !== "code-block") return; + var codeLang = ""; for(var i = 0, l = env.classes.length; i < l; i++){ var cls = env.classes[i]; var match = /language-(.+)/.exec(cls); @@ -3954,9 +3886,9 @@ Prism.languages.rss = Prism.languages.xml; } var grammar = Prism.languages[codeLang]; if (!grammar) { - if (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) { - var id = 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 10000000000000000); - env.attributes['id'] = id; + if (codeLang && codeLang !== "none" && Prism.plugins.autoloader) { + var id = "md-" + new Date().valueOf() + "-" + Math.floor(Math.random() * 1e16); + env.attributes["id"] = id; Prism.plugins.autoloader.loadLanguages(codeLang, function() { var ele = document.getElementById(id); if (ele) ele.innerHTML = Prism.highlight(ele.textContent, Prism.languages[codeLang], codeLang); @@ -3964,7 +3896,7 @@ Prism.languages.rss = Prism.languages.xml; } } else env.content = Prism.highlight(textContent(env.content), grammar, codeLang); }); - var tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi'); + var tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, "gi"); /** * A list of known entity names. * @@ -3972,10 +3904,10 @@ Prism.languages.rss = Prism.languages.xml; * * @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2} */ var KNOWN_ENTITY_NAMES = { - 'amp': '&', - 'lt': '<', - 'gt': '>', - 'quot': '"' + "amp": "&", + "lt": "<", + "gt": ">", + "quot": '"' }; // IE 11 doesn't support `String.fromCodePoint` var fromCodePoint = String.fromCodePoint || String.fromCharCode; @@ -3986,13 +3918,13 @@ Prism.languages.rss = Prism.languages.xml; * @returns {string} */ function textContent(html) { // remove all tags - var text = html.replace(tagPattern, ''); + var text = html.replace(tagPattern, ""); // decode known entities text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(m, code) { code = code.toLowerCase(); - if (code[0] === '#') { + if (code[0] === "#") { var value; - if (code[1] === 'x') value = parseInt(code.slice(2), 16); + if (code[1] === "x") value = parseInt(code.slice(2), 16); else value = Number(code.slice(1)); return fromCodePoint(value); } else { @@ -4007,88 +3939,87 @@ Prism.languages.rss = Prism.languages.xml; Prism.languages.md = Prism.languages.markdown; })(Prism); -},{}],"fmUxI":[function(require,module,exports) { +},{}],"9GRdG":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _animeEsJs = require("animejs/lib/anime.es.js"); var _animeEsJsDefault = parcelHelpers.interopDefault(_animeEsJs); -const notifcation = document.getElementById('notifications'); -const notify = document.getElementById('notify-message'); -const messageText = document.getElementById('message-text'); -const notifyText = document.getElementById('notify-text'); -const notifyProgress = document.getElementById('notify-progress'); -const iconGood = document.getElementById('notify-good'); -const iconLame = document.getElementById('notify-lame'); -const iconWorking = document.getElementById('notify-working'); +const notifcation = document.getElementById("notifications"); +const notify = document.getElementById("notify-message"); +const messageText = document.getElementById("message-text"); +const notifyText = document.getElementById("notify-text"); +const notifyProgress = document.getElementById("notify-progress"); +const iconGood = document.getElementById("notify-good"); +const iconLame = document.getElementById("notify-lame"); +const iconWorking = document.getElementById("notify-working"); class Notfications { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- alert(text, status) { - iconWorking.style.display = 'none'; - iconGood.style.display = 'none'; - iconLame.style.display = 'none'; - var color = ''; + iconWorking.style.display = "none"; + iconGood.style.display = "none"; + iconLame.style.display = "none"; + var color = ""; if (status !== null) { - _animeEsJsDefault.default({ + (0, _animeEsJsDefault.default)({ targets: notifyProgress, opacity: 0, - easing: 'easeInOutQuint', + easing: "easeInOutQuint", duration: 500 }); if (status) { - color = '#32cd32'; - iconWorking.style.display = 'none'; - iconGood.style.display = 'block'; + color = "#32cd32"; + iconWorking.style.display = "none"; + iconGood.style.display = "block"; } else { - color = '#F64747'; - iconWorking.style.display = 'none'; - iconLame.style.display = 'block'; + color = "#F64747"; + iconWorking.style.display = "none"; + iconLame.style.display = "block"; } } else { - color = '#200317'; - iconWorking.style.display = 'block'; - _animeEsJsDefault.default({ + color = "#200317"; + iconWorking.style.display = "block"; + (0, _animeEsJsDefault.default)({ targets: notifyProgress, opacity: 1, - easing: 'easeInOutQuint', + easing: "easeInOutQuint", duration: 500 }); } messageText.innerHTML = text; - _animeEsJsDefault.default({ + (0, _animeEsJsDefault.default)({ targets: notifcation, - marginTop: '-10', - easing: 'easeInOutQuint', + marginTop: "-10", + easing: "easeInOutQuint", duration: 10, complete: ()=>{ - _animeEsJsDefault.default({ + (0, _animeEsJsDefault.default)({ targets: notify, - rotateX: '0', - easing: 'easeInOutQuint', + rotateX: "0", + easing: "easeInOutQuint", duration: 700 }); - _animeEsJsDefault.default({ + (0, _animeEsJsDefault.default)({ targets: notifyText, backgroundColor: color, - easing: 'easeInOutQuint', + easing: "easeInOutQuint", duration: 700, complete: ()=>{ setTimeout(()=>{ - if (status !== null) _animeEsJsDefault.default({ + if (status !== null) (0, _animeEsJsDefault.default)({ targets: notify, - rotateX: '-120', - easing: 'easeInOutQuint', + rotateX: "-120", + easing: "easeInOutQuint", duration: 700, complete: ()=>{ - _animeEsJsDefault.default({ + (0, _animeEsJsDefault.default)({ targets: notifcation, - marginTop: '-55', - easing: 'easeInOutQuint', + marginTop: "-55", + easing: "easeInOutQuint", delay: 700, duration: 50 }); //notifcation.style.display = 'none'; @@ -4103,7 +4034,7 @@ class Notfications { } exports.default = Notfications; -},{"animejs/lib/anime.es.js":"bfYip","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"bfYip":[function(require,module,exports) { +},{"animejs/lib/anime.es.js":"jokr5","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"jokr5":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); /* @@ -4122,7 +4053,7 @@ var defaultInstanceSettings = { loopComplete: null, complete: null, loop: 1, - direction: 'normal', + direction: "normal", autoplay: true, timelineOffset: 0 }; @@ -4130,34 +4061,32 @@ var defaultTweenSettings = { duration: 1000, delay: 0, endDelay: 0, - easing: 'easeOutElastic(1, .5)', + easing: "easeOutElastic(1, .5)", round: 0 }; var validTransforms = [ - 'translateX', - 'translateY', - 'translateZ', - 'rotate', - 'rotateX', - 'rotateY', - 'rotateZ', - 'scale', - 'scaleX', - 'scaleY', - 'scaleZ', - 'skew', - 'skewX', - 'skewY', - 'perspective', - 'matrix', - 'matrix3d' + "translateX", + "translateY", + "translateZ", + "rotate", + "rotateX", + "rotateY", + "rotateZ", + "scale", + "scaleX", + "scaleY", + "scaleZ", + "skew", + "skewX", + "skewY", + "perspective", + "matrix", + "matrix3d" ]; // Caching var cache = { - CSS: { - }, - springs: { - } + CSS: {}, + springs: {} }; // Utils function minMax(val, min, max) { @@ -4174,10 +4103,10 @@ var is = { return Array.isArray(a); }, obj: function(a) { - return stringContains(Object.prototype.toString.call(a), 'Object'); + return stringContains(Object.prototype.toString.call(a), "Object"); }, pth: function(a) { - return is.obj(a) && a.hasOwnProperty('totalLength'); + return is.obj(a) && a.hasOwnProperty("totalLength"); }, svg: function(a) { return a instanceof SVGElement; @@ -4189,13 +4118,13 @@ var is = { return a.nodeType || is.svg(a); }, str: function(a) { - return typeof a === 'string'; + return typeof a === "string"; }, fnc: function(a) { - return typeof a === 'function'; + return typeof a === "function"; }, und: function(a) { - return typeof a === 'undefined'; + return typeof a === "undefined"; }, nil: function(a) { return is.und(a) || a === null; @@ -4213,23 +4142,23 @@ var is = { return is.hex(a) || is.rgb(a) || is.hsl(a); }, key: function(a) { - return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; + return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== "targets" && a !== "keyframes"; } }; // Easings function parseEasingParameters(string) { var match = /\(([^)]+)\)/.exec(string); - return match ? match[1].split(',').map(function(p) { + return match ? match[1].split(",").map(function(p) { return parseFloat(p); }) : []; } // Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js function spring(string, duration1) { var params = parseEasingParameters(string); - var mass = minMax(is.und(params[0]) ? 1 : params[0], 0.1, 100); - var stiffness = minMax(is.und(params[1]) ? 100 : params[1], 0.1, 100); - var damping = minMax(is.und(params[2]) ? 10 : params[2], 0.1, 100); - var velocity = minMax(is.und(params[3]) ? 0 : params[3], 0.1, 100); + var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100); + var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100); + var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100); + var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100); var w0 = Math.sqrt(stiffness / mass); var zeta = damping / (2 * Math.sqrt(stiffness * mass)); var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0; @@ -4262,51 +4191,51 @@ function spring(string, duration1) { return duration1 ? solver : getDuration; } // Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function -function steps1(steps) { - if (steps === void 0) steps = 10; +function steps(steps1) { + if (steps1 === void 0) steps1 = 10; return function(t) { - return Math.ceil(minMax(t, 0.000001, 1) * steps) * (1 / steps); + return Math.ceil(minMax(t, 0.000001, 1) * steps1) * (1 / steps1); }; } // BezierEasing https://github.com/gre/bezier-easing -var bezier1 = function() { +var bezier = function() { var kSplineTableSize = 11; - var kSampleStepSize = 1 / (kSplineTableSize - 1); + var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); function A(aA1, aA2) { - return 1 - 3 * aA2 + 3 * aA1; + return 1.0 - 3.0 * aA2 + 3.0 * aA1; } function B(aA1, aA2) { - return 3 * aA2 - 6 * aA1; + return 3.0 * aA2 - 6.0 * aA1; } function C(aA1) { - return 3 * aA1; + return 3.0 * aA1; } function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; } function getSlope(aT, aA1, aA2) { - return 3 * A(aA1, aA2) * aT * aT + 2 * B(aA1, aA2) * aT + C(aA1); + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); } function binarySubdivide(aX, aA, aB, mX1, mX2) { var currentX, currentT, i = 0; do { - currentT = aA + (aB - aA) / 2; + currentT = aA + (aB - aA) / 2.0; currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0) aB = currentT; + if (currentX > 0.0) aB = currentT; else aA = currentT; - }while (Math.abs(currentX) > 0.0000001 && ++i < 10) + }while (Math.abs(currentX) > 0.0000001 && ++i < 10); return currentT; } function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { for(var i = 0; i < 4; ++i){ var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0) return aGuessT; + if (currentSlope === 0.0) return aGuessT; var currentX = calcBezier(aGuessT, mX1, mX2) - aX; aGuessT -= currentX / currentSlope; } return aGuessT; } - function bezier(mX1, mY1, mX2, mY2) { + function bezier1(mX1, mY1, mX2, mY2) { if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) return; var sampleValues = new Float32Array(kSplineTableSize); if (mX1 !== mY1 || mX2 !== mY2) for(var i = 0; i < kSplineTableSize; ++i)sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); @@ -4320,7 +4249,7 @@ var bezier1 = function() { var guessForT = intervalStart + dist * kSampleStepSize; var initialSlope = getSlope(guessForT, mX1, mX2); if (initialSlope >= 0.001) return newtonRaphsonIterate(aX, guessForT, mX1, mX2); - else if (initialSlope === 0) return guessForT; + else if (initialSlope === 0.0) return guessForT; else return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); } return function(x) { @@ -4329,7 +4258,7 @@ var bezier1 = function() { return calcBezier(getTForX(x), mY1, mY2); }; } - return bezier; + return bezier1; }(); var penner = function() { // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing) @@ -4365,20 +4294,20 @@ var penner = function() { }, Elastic: function(amplitude, period) { if (amplitude === void 0) amplitude = 1; - if (period === void 0) period = 0.5; + if (period === void 0) period = .5; var a = minMax(amplitude, 1, 10); - var p = minMax(period, 0.1, 2); + var p = minMax(period, .1, 2); return function(t) { return t === 0 || t === 1 ? t : -a * Math.pow(2, 10 * (t - 1)) * Math.sin((t - 1 - p / (Math.PI * 2) * Math.asin(1 / a)) * (Math.PI * 2) / p); }; } }; var baseEasings = [ - 'Quad', - 'Cubic', - 'Quart', - 'Quint', - 'Expo' + "Quad", + "Cubic", + "Quart", + "Quint", + "Expo" ]; baseEasings.forEach(function(name, i) { functionEasings[name] = function() { @@ -4389,18 +4318,18 @@ var penner = function() { }); Object.keys(functionEasings).forEach(function(name) { var easeIn = functionEasings[name]; - eases['easeIn' + name] = easeIn; - eases['easeOut' + name] = function(a, b) { + eases["easeIn" + name] = easeIn; + eases["easeOut" + name] = function(a, b) { return function(t) { return 1 - easeIn(a, b)(1 - t); }; }; - eases['easeInOut' + name] = function(a, b) { + eases["easeInOut" + name] = function(a, b) { return function(t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 : 1 - easeIn(a, b)(t * -2 + 2) / 2; }; }; - eases['easeOutIn' + name] = function(a, b) { + eases["easeOutIn" + name] = function(a, b) { return function(t) { return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 : (easeIn(a, b)(t * 2 - 1) + 1) / 2; }; @@ -4410,16 +4339,16 @@ var penner = function() { }(); function parseEasings(easing, duration) { if (is.fnc(easing)) return easing; - var name = easing.split('(')[0]; + var name = easing.split("(")[0]; var ease = penner[name]; var args = parseEasingParameters(easing); switch(name){ - case 'spring': + case "spring": return spring(easing, duration); - case 'cubicBezier': - return applyArguments(bezier1, args); - case 'steps': - return applyArguments(steps1, args); + case "cubicBezier": + return applyArguments(bezier, args); + case "steps": + return applyArguments(steps, args); default: return applyArguments(ease, args); } @@ -4464,8 +4393,7 @@ function arrayContains(arr, val) { } // Objects function cloneObject(o) { - var clone = { - }; + var clone = {}; for(var p in o)clone[p] = o[p]; return clone; } @@ -4531,8 +4459,8 @@ function getUnit(val) { if (split) return split[1]; } function getTransformUnit(propName) { - if (stringContains(propName, 'translate') || propName === 'perspective') return 'px'; - if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) return 'deg'; + if (stringContains(propName, "translate") || propName === "perspective") return "px"; + if (stringContains(propName, "rotate") || stringContains(propName, "skew")) return "deg"; } // Values function getFunctionValue(val, animatable) { @@ -4546,9 +4474,9 @@ function convertPxToUnit(el, value, unit) { var valueUnit = getUnit(value); if (arrayContains([ unit, - 'deg', - 'rad', - 'turn' + "deg", + "rad", + "turn" ], valueUnit)) return value; var cached = cache.CSS[value + unit]; if (!is.und(cached)) return cached; @@ -4556,7 +4484,7 @@ function convertPxToUnit(el, value, unit) { var tempEl = document.createElement(el.tagName); var parentEl = el.parentNode && el.parentNode !== document ? el.parentNode : document.body; parentEl.appendChild(tempEl); - tempEl.style.position = 'absolute'; + tempEl.style.position = "absolute"; tempEl.style.width = baseline + unit; var factor = baseline / tempEl.offsetWidth; parentEl.removeChild(tempEl); @@ -4566,20 +4494,20 @@ function convertPxToUnit(el, value, unit) { } function getCSSValue(el, prop, unit) { if (prop in el.style) { - var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); - var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0'; + var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); + var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || "0"; return unit ? convertPxToUnit(el, value, unit) : value; } } function getAnimationType(el, prop) { - if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || is.svg(el) && el[prop])) return 'attribute'; - if (is.dom(el) && arrayContains(validTransforms, prop)) return 'transform'; - if (is.dom(el) && prop !== 'transform' && getCSSValue(el, prop)) return 'css'; - if (el[prop] != null) return 'object'; + if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || is.svg(el) && el[prop])) return "attribute"; + if (is.dom(el) && arrayContains(validTransforms, prop)) return "transform"; + if (is.dom(el) && prop !== "transform" && getCSSValue(el, prop)) return "css"; + if (el[prop] != null) return "object"; } function getElementTransforms(el) { if (!is.dom(el)) return; - var str = el.style.transform || ''; + var str = el.style.transform || ""; var reg = /(\w+)\(([^)]*)\)/g; var transforms = new Map(); var m; @@ -4587,21 +4515,21 @@ function getElementTransforms(el) { return transforms; } function getTransformValue(el, propName, animatable, unit) { - var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName); + var defaultVal = stringContains(propName, "scale") ? 1 : 0 + getTransformUnit(propName); var value = getElementTransforms(el).get(propName) || defaultVal; if (animatable) { animatable.transforms.list.set(propName, value); - animatable.transforms['last'] = propName; + animatable.transforms["last"] = propName; } return unit ? convertPxToUnit(el, value, unit) : value; } function getOriginalTargetValue(target, propName, unit, animatable) { switch(getAnimationType(target, propName)){ - case 'transform': + case "transform": return getTransformValue(target, propName, animatable, unit); - case 'css': + case "css": return getCSSValue(target, propName, unit); - case 'attribute': + case "attribute": return getAttribute(target, propName); default: return target[propName] || 0; @@ -4612,13 +4540,13 @@ function getRelativeValue(to, from) { if (!operator) return to; var u = getUnit(to) || 0; var x = parseFloat(from); - var y = parseFloat(to.replace(operator[0], '')); + var y = parseFloat(to.replace(operator[0], "")); switch(operator[0][0]){ - case '+': + case "+": return x + y + u; - case '-': + case "-": return x - y + u; - case '*': + case "*": return x * y + u; } } @@ -4636,18 +4564,18 @@ function getDistance(p1, p2) { return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2)); } function getCircleLength(el) { - return Math.PI * 2 * getAttribute(el, 'r'); + return Math.PI * 2 * getAttribute(el, "r"); } function getRectLength(el) { - return getAttribute(el, 'width') * 2 + getAttribute(el, 'height') * 2; + return getAttribute(el, "width") * 2 + getAttribute(el, "height") * 2; } function getLineLength(el) { return getDistance({ - x: getAttribute(el, 'x1'), - y: getAttribute(el, 'y1') + x: getAttribute(el, "x1"), + y: getAttribute(el, "y1") }, { - x: getAttribute(el, 'x2'), - y: getAttribute(el, 'y2') + x: getAttribute(el, "x2"), + y: getAttribute(el, "y2") }); } function getPolylineLength(el) { @@ -4669,21 +4597,21 @@ function getPolygonLength(el) { function getTotalLength(el) { if (el.getTotalLength) return el.getTotalLength(); switch(el.tagName.toLowerCase()){ - case 'circle': + case "circle": return getCircleLength(el); - case 'rect': + case "rect": return getRectLength(el); - case 'line': + case "line": return getLineLength(el); - case 'polyline': + case "polyline": return getPolylineLength(el); - case 'polygon': + case "polygon": return getPolygonLength(el); } } function setDashoffset(el) { var pathLength = getTotalLength(el); - el.setAttribute('stroke-dasharray', pathLength); + el.setAttribute("stroke-dasharray", pathLength); return pathLength; } // Motion path @@ -4696,14 +4624,13 @@ function getParentSvgEl(el) { return parentEl; } function getParentSvg(pathEl, svgData) { - var svg = svgData || { - }; + var svg = svgData || {}; var parentSvgEl = svg.el || getParentSvgEl(pathEl); var rect = parentSvgEl.getBoundingClientRect(); - var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox'); + var viewBoxAttr = getAttribute(parentSvgEl, "viewBox"); var width = rect.width; var height = rect.height; - var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [ + var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(" ") : [ 0, 0, width, @@ -4745,11 +4672,11 @@ function getPathProgress(path, progress, isPathTargetInsideSVG) { var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW; var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH; switch(path.property){ - case 'x': + case "x": return (p.x - svg.x) * scaleX; - case 'y': + case "y": return (p.y - svg.y) * scaleY; - case 'angle': + case "angle": return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI; } } @@ -4758,7 +4685,7 @@ function decomposeValue(val, unit) { // const rgx = /-?\d*\.?\d+/g; // handles basic numbers // const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation - var value = validateValue(is.pth(val) ? val.totalLength : val, unit) + ''; + var value = validateValue(is.pth(val) ? val.totalLength : val, unit) + ""; return { original: value, numbers: value.match(rgx) ? value.match(rgx).map(Number) : [ @@ -4828,13 +4755,11 @@ function flattenKeyframes(keyframes) { if (a.indexOf(b) < 0) a.push(b); return a; }, []); - var properties = { - }; + var properties = {}; var loop = function(i) { var propName = propertyNames[i]; properties[propName] = keyframes.map(function(key) { - var newKey = { - }; + var newKey = {}; for(var p in key){ if (is.key(p)) { if (p == propName) newKey.value = key[p]; @@ -4843,7 +4768,7 @@ function flattenKeyframes(keyframes) { return newKey; }); }; - for(var i = 0; i < propertyNames.length; i++)loop(i); + for(var i1 = 0; i1 < propertyNames.length; i1++)loop(i1); return properties; } function getProperties(tweenSettings, params) { @@ -4858,8 +4783,7 @@ function getProperties(tweenSettings, params) { } // Tweens function normalizeTweenValues(tween, animatable) { - var t = { - }; + var t = {}; for(var p in tween){ var value = getFunctionValue(tween[p], animatable); if (is.arr(value)) { @@ -4914,7 +4838,7 @@ var setProgressValue = { transform: function(t, p, v, transforms, manual) { transforms.list.set(p, v); if (p === transforms.last || manual) { - var str = ''; + var str = ""; transforms.list.forEach(function(value, prop) { str += prop + "(" + value + ") "; }); @@ -4970,8 +4894,7 @@ function getInstanceTimings(animations, tweenSettings) { var getTlOffset = function(anim) { return anim.timelineOffset ? anim.timelineOffset : 0; }; - var timings = { - }; + var timings = {}; timings.duration = animLength ? Math.max.apply(Math, animations.map(function(anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration; @@ -5040,7 +4963,7 @@ var engine = function() { engine(); } } - if (typeof document !== 'undefined') document.addEventListener('visibilitychange', handleVisibilityChange); + if (typeof document !== "undefined") document.addEventListener("visibilitychange", handleVisibilityChange); return play; }(); function isDocumentHidden() { @@ -5048,8 +4971,7 @@ function isDocumentHidden() { } // Public Instance function anime(params) { - if (params === void 0) params = { - }; + if (params === void 0) params = {}; var startTime = 0, lastTime = 0, now = 0; var children, childrenLength = 0; var resolve = null; @@ -5064,7 +4986,7 @@ function anime(params) { var promise1 = makePromise(instance1); function toggleInstanceDirection() { var direction = instance1.direction; - if (direction !== 'alternate') instance1.direction = direction !== 'normal' ? 'normal' : 'reverse'; + if (direction !== "alternate") instance1.direction = direction !== "normal" ? "normal" : "reverse"; instance1.reversed = !instance1.reversed; children.forEach(function(child) { return child.reversed = instance1.reversed; @@ -5126,7 +5048,7 @@ function anime(params) { var b = strings[s + 1]; var n$1 = numbers[s]; if (!isNaN(n$1)) { - if (!b) progress += n$1 + ' '; + if (!b) progress += n$1 + " "; else progress += n$1 + b; } } @@ -5152,11 +5074,11 @@ function anime(params) { if (children) syncInstanceChildren(insTime); if (!instance1.began && instance1.currentTime > 0) { instance1.began = true; - setCallback('begin'); + setCallback("begin"); } if (!instance1.loopBegan && instance1.currentTime > 0) { instance1.loopBegan = true; - setCallback('loopBegin'); + setCallback("loopBegin"); } if (insTime <= insDelay && instance1.currentTime !== 0) setAnimationsProgress(0); if (insTime >= insEndDelay && instance1.currentTime !== insDuration || !insDuration) setAnimationsProgress(insDuration); @@ -5164,17 +5086,17 @@ function anime(params) { if (!instance1.changeBegan) { instance1.changeBegan = true; instance1.changeCompleted = false; - setCallback('changeBegin'); + setCallback("changeBegin"); } - setCallback('change'); + setCallback("change"); setAnimationsProgress(insTime); } else if (instance1.changeBegan) { instance1.changeCompleted = true; instance1.changeBegan = false; - setCallback('changeComplete'); + setCallback("changeComplete"); } instance1.currentTime = minMax(insTime, 0, insDuration); - if (instance1.began) setCallback('update'); + if (instance1.began) setCallback("update"); if (engineTime >= insDuration) { lastTime = 0; countIteration(); @@ -5182,18 +5104,18 @@ function anime(params) { instance1.paused = true; if (!instance1.completed) { instance1.completed = true; - setCallback('loopComplete'); - setCallback('complete'); - if (!instance1.passThrough && 'Promise' in window) { + setCallback("loopComplete"); + setCallback("complete"); + if (!instance1.passThrough && "Promise" in window) { resolve(); promise1 = makePromise(instance1); } } } else { startTime = now; - setCallback('loopComplete'); + setCallback("loopComplete"); instance1.loopBegan = false; - if (instance1.direction === 'alternate') toggleInstanceDirection(); + if (instance1.direction === "alternate") toggleInstanceDirection(); } } } @@ -5209,12 +5131,12 @@ function anime(params) { instance1.completed = false; instance1.changeCompleted = false; instance1.reversePlayback = false; - instance1.reversed = direction === 'reverse'; + instance1.reversed = direction === "reverse"; instance1.remaining = instance1.loop; children = instance1.children; childrenLength = children.length; for(var i = childrenLength; i--;)instance1.children[i].reset(); - if (instance1.reversed && instance1.loop !== true || direction === 'alternate' && instance1.loop === 1) instance1.remaining++; + if (instance1.reversed && instance1.loop !== true || direction === "alternate" && instance1.loop === 1) instance1.remaining++; setAnimationsProgress(instance1.reversed ? instance1.duration : 0); }; // internal method (for engine) to adjust animation timings before restoring engine ticks (rAF) @@ -5286,16 +5208,15 @@ function removeTargetsFromActiveInstances(targets) { } // Stagger helpers function stagger(val3, params) { - if (params === void 0) params = { - }; - var direction = params.direction || 'normal'; + if (params === void 0) params = {}; + var direction = params.direction || "normal"; var easing = params.easing ? parseEasings(params.easing) : null; var grid = params.grid; var axis = params.axis; var fromIndex = params.from || 0; - var fromFirst = fromIndex === 'first'; - var fromCenter = fromIndex === 'center'; - var fromLast = fromIndex === 'last'; + var fromFirst = fromIndex === "first"; + var fromCenter = fromIndex === "center"; + var fromLast = fromIndex === "last"; var isRange = is.arr(val3); var val1 = isRange ? parseFloat(val3[0]) : parseFloat(val3); var val2 = isRange ? parseFloat(val3[1]) : 0; @@ -5318,8 +5239,8 @@ function stagger(val3, params) { var distanceX = fromX - toX; var distanceY = fromY - toY; var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY); - if (axis === 'x') value = -distanceX; - if (axis === 'y') value = -distanceY; + if (axis === "x") value = -distanceX; + if (axis === "y") value = -distanceY; values.push(value); } maxValue = Math.max.apply(Math, values); @@ -5327,7 +5248,7 @@ function stagger(val3, params) { if (easing) values = values.map(function(val) { return easing(val / maxValue) * maxValue; }); - if (direction === 'reverse') values = values.map(function(val) { + if (direction === "reverse") values = values.map(function(val) { return axis ? val < 0 ? val * -1 : -val : Math.abs(maxValue - val); }); } @@ -5337,8 +5258,7 @@ function stagger(val3, params) { } // Timeline function timeline(params) { - if (params === void 0) params = { - }; + if (params === void 0) params = {}; var tl = anime(params); tl.duration = 0; tl.add = function(instanceParams, timelineOffset) { @@ -5371,7 +5291,7 @@ function timeline(params) { }; return tl; } -anime.version = '3.2.1'; +anime.version = "3.2.1"; anime.speed = 1; // TODO:#review: naming, documentation anime.suspendWhenDocumentHidden = true; @@ -5391,7 +5311,7 @@ anime.random = function(min, max) { }; exports.default = anime; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"kp4D5":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"6B20o":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _sortablejs = require("sortablejs"); @@ -5400,7 +5320,7 @@ var _dataUtils = require("../utils/DataUtils"); var _dataUtilsDefault = parcelHelpers.interopDefault(_dataUtils); var _notificationsJs = require("./Notifications.js"); var _notificationsJsDefault = parcelHelpers.interopDefault(_notificationsJs); -const notify = new _notificationsJsDefault.default(); +const notify = new (0, _notificationsJsDefault.default)(); class FileManager { //-------------------------- // constructor @@ -5411,30 +5331,30 @@ class FileManager { this.imageList = imageList; this.fileList = fileList; this.accetableFiles = [ - 'image/jpeg', - 'image/gif', - 'image/png', - 'image/svg', - 'audio/mpeg', - 'video/mp4', - 'application/pdf', - 'text/plain', - 'text/rtf' + "image/jpeg", + "image/gif", + "image/png", + "image/svg", + "audio/mpeg", + "video/mp4", + "application/pdf", + "text/plain", + "text/rtf" ]; this.files = []; this.sortedFiles = []; this.storage = []; - this.mediaSort = _sortablejsDefault.default.create(this.imageList, { + this.mediaSort = (0, _sortablejsDefault.default).create(this.imageList, { animation: 150, onUpdate: ()=>{ - notify.alert('REINDEXING MEDIA', null); + notify.alert("REINDEXING MEDIA", null); this.updateFiles(); } }); - this.fileSort = _sortablejsDefault.default.create(this.fileList, { + this.fileSort = (0, _sortablejsDefault.default).create(this.fileList, { animation: 150, onUpdate: ()=>{ - notify.alert('REINDEXING FILES', null); + notify.alert("REINDEXING FILES", null); this.updateFiles(); } }); @@ -5443,15 +5363,11 @@ class FileManager { // methods //-------------------------- start() { - this.upload.addEventListener('dragover', (e)=>this.handleFileActions(e) - , false); - this.upload.addEventListener('drop', (e)=>this.handleFileActions(e) - , false); - this.input.addEventListener('change', (e)=>this.handleFileActions(e) - , false); - var removeMedia = document.querySelectorAll('.media-remove'); - for(var i = 0, length = removeMedia.length; i < length; i++)removeMedia[i].addEventListener('click', (e)=>this.removeFile(e, 'media') - , false); + this.upload.addEventListener("dragover", (e)=>this.handleFileActions(e), false); + this.upload.addEventListener("drop", (e)=>this.handleFileActions(e), false); + this.input.addEventListener("change", (e)=>this.handleFileActions(e), false); + var removeMedia = document.querySelectorAll(".media-remove"); + for(var i = 0, length = removeMedia.length; i < length; i++)removeMedia[i].addEventListener("click", (e)=>this.removeFile(e, "media"), false); } getFiles() { return this.files; @@ -5459,7 +5375,7 @@ class FileManager { reindexFiles(sortOrder, step) { let count = sortOrder.length; if (step == 0) this.files = []; - var utils = new _dataUtilsDefault.default(); + var utils = new (0, _dataUtilsDefault.default)(); utils.imgLoad(sortOrder[step].earl).then((blob)=>{ var fresh = new File([ blob @@ -5471,7 +5387,7 @@ class FileManager { if (this.files.length <= limit) { step = step + 1; this.reindexFiles(sortOrder, step); - } else notify.alert('FILES READY TO UPLOAD', true); + } else notify.alert("FILES READY TO UPLOAD", true); }); } sortFiles(files) { @@ -5481,71 +5397,70 @@ class FileManager { reader.onload = ((theFile)=>{ return function(f) { //create remove button object - var remove = document.createElement('button'); - remove.className = 'media-remove'; - remove.innerHTML = 'X'; - remove.addEventListener('click', (e)=>self.removeFile(e, 'media') - , false); //get counts for lists + var remove = document.createElement("button"); + remove.className = "media-remove"; + remove.innerHTML = "X"; + remove.addEventListener("click", (e)=>self.removeFile(e, "media"), false); //get counts for lists var mediaCount = self.imageList.childNodes.length; var fileCount = self.fileList.childNodes.length; // sort files switch(theFile.type){ - case 'image/jpg': - case 'image/jpeg': - case 'image/gif': - case 'image/svg': - case 'image/png': + case "image/jpg": + case "image/jpeg": + case "image/gif": + case "image/svg": + case "image/png": //create element and add to list //var image = document.createElement('img'); //image.src = f.target.result; //image.title = escape(theFile.name); - var span = document.createElement('div'); - span.style.background = 'url(' + f.target.result + ') no-repeat center center / cover'; - span.className = 'img-item'; //image.setAttribute('id', i); + var span = document.createElement("div"); + span.style.background = "url(" + f.target.result + ") no-repeat center center / cover"; + span.className = "img-item"; //image.setAttribute('id', i); self.storage.push([ { - id: 'page_image' + i, + id: "page_image" + i, data: f.target.result, type: theFile.type, name: escape(theFile.name) } ]); if (mediaCount < 0) mediaCount = 0; - span.setAttribute('id', mediaCount); - remove.setAttribute('id', mediaCount); - span.setAttribute('data-file-name', theFile.name); + span.setAttribute("id", mediaCount); + remove.setAttribute("id", mediaCount); + span.setAttribute("data-file-name", theFile.name); span.appendChild(remove); self.imageList.appendChild(span); break; - case 'video/mp4': - var video = document.createElement('div'); - video.className = 'video-item'; - video.setAttribute('data-source', f.target.result); + case "video/mp4": + var video = document.createElement("div"); + video.className = "video-item"; + video.setAttribute("data-source", f.target.result); if (mediaCount < 0) mediaCount = 0; - video.setAttribute('id', mediaCount); - remove.setAttribute('id', mediaCount); - video.setAttribute('data-file-name', theFile.name); + video.setAttribute("id", mediaCount); + remove.setAttribute("id", mediaCount); + video.setAttribute("data-file-name", theFile.name); video.appendChild(remove); self.imageList.appendChild(video); break; - case 'audio/mpeg': - var sound = document.createElement('div'); - sound.className = 'audio-item'; - sound.setAttribute('data-source', f.target.result); - sound.setAttribute('id', fileCount); - remove.setAttribute('id', fileCount); - sound.setAttribute('data-file-name', theFile.name); + case "audio/mpeg": + var sound = document.createElement("div"); + sound.className = "audio-item"; + sound.setAttribute("data-source", f.target.result); + sound.setAttribute("id", fileCount); + remove.setAttribute("id", fileCount); + sound.setAttribute("data-file-name", theFile.name); sound.appendChild(remove); self.fileList.appendChild(sound); break; - case 'application/pdf': - case 'text/plain': - case 'text/rtf': - var file = document.createElement('div'); - file.className = 'file-item'; - file.setAttribute('data-source', f.target.result); - file.setAttribute('id', fileCount); - remove.setAttribute('id', fileCount); - file.setAttribute('data-file-name', theFile.name); + case "application/pdf": + case "text/plain": + case "text/rtf": + var file = document.createElement("div"); + file.className = "file-item"; + file.setAttribute("data-source", f.target.result); + file.setAttribute("id", fileCount); + remove.setAttribute("id", fileCount); + file.setAttribute("data-file-name", theFile.name); file.appendChild(remove); self.fileList.appendChild(file); break; @@ -5567,12 +5482,12 @@ class FileManager { for(let index1 = 0; index1 < this.fileList.childNodes.length; index1++)items.push(this.fileList.childNodes[index1]); for(let index2 = 0; index2 < items.length; index2++){ var item = items[index2]; - let url = ''; - if (item.className == 'img-item') url = item.style.backgroundImage.slice(4, -1).replace(/"/g, ''); - else url = item.getAttribute('data-source'); + let url = ""; + if (item.className == "img-item") url = item.style.backgroundImage.slice(4, -1).replace(/"/g, ""); + else url = item.getAttribute("data-source"); currentFiles.push({ earl: url, - fileName: item.getAttribute('data-file-name') + fileName: item.getAttribute("data-file-name") }); } this.reindexFiles(currentFiles, 0); @@ -5580,12 +5495,12 @@ class FileManager { removeFile(e) { var list = []; switch(e.target.parentNode.className){ - case 'img-item': - case 'video-item': + case "img-item": + case "video-item": list = this.imageList; break; - case 'audio-item': - case 'file-item': + case "audio-item": + case "file-item": list = this.fileList; break; } @@ -5593,25 +5508,25 @@ class FileManager { let media = list.childNodes[index]; if (media.id == e.target.id) { list.removeChild(media); - notify.alert('REINDEXING MEDIA', null); + notify.alert("REINDEXING MEDIA", null); this.updateFiles(); } } } - handleFileActions(e1) { - e1.stopPropagation(); - e1.preventDefault(); + handleFileActions(e) { + e.stopPropagation(); + e.preventDefault(); let self = this; let rawList = []; let sortedList = []; let notOnTheList = []; - switch(e1.type){ - case 'dragover': - e1.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy. + switch(e.type){ + case "dragover": + e.dataTransfer.dropEffect = "copy"; // Explicitly show this is a copy. break; - case 'change': - case 'drop': - e1.type == 'drop' ? rawList = e1.dataTransfer.files : rawList = e1.target.files; + case "change": + case "drop": + e.type == "drop" ? rawList = e.dataTransfer.files : rawList = e.target.files; for(var i = 0, f; f = rawList[i]; i++)// check witch files are cool to upload if (this.accetableFiles.includes(f.type)) sortedList.push(f); else notOnTheList.push(f); @@ -5623,17 +5538,14 @@ class FileManager { } exports.default = FileManager; -},{"sortablejs":"fLJM6","../utils/DataUtils":"lpIyf","./Notifications.js":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"fLJM6":[function(require,module,exports) { +},{"sortablejs":"4mik1","../utils/DataUtils":"eM6UW","./Notifications.js":"9GRdG","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"4mik1":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "MultiDrag", ()=>MultiDragPlugin -); -parcelHelpers.export(exports, "Sortable", ()=>Sortable -); -parcelHelpers.export(exports, "Swap", ()=>SwapPlugin -); +parcelHelpers.export(exports, "MultiDrag", ()=>MultiDragPlugin); +parcelHelpers.export(exports, "Sortable", ()=>Sortable); +parcelHelpers.export(exports, "Swap", ()=>SwapPlugin); /**! - * Sortable 1.14.0 + * Sortable 1.15.0 * @author RubaXa * @author owenm * @license MIT @@ -5650,8 +5562,7 @@ parcelHelpers.export(exports, "Swap", ()=>SwapPlugin } function _objectSpread2(target) { for(var i = 1; i < arguments.length; i++){ - var source = arguments[i] != null ? arguments[i] : { - }; + var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) ownKeys(Object(source), true).forEach(function(key) { _defineProperty(target, key, source[key]); }); @@ -5663,6 +5574,7 @@ function _objectSpread2(target) { return target; } function _typeof(obj1) { + "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") _typeof = function(obj) { return typeof obj; }; @@ -5692,10 +5604,8 @@ function _extends() { return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { - if (source == null) return { - }; - var target = { - }; + if (source == null) return {}; + var target = {}; var sourceKeys = Object.keys(source); var key, i; for(i = 0; i < sourceKeys.length; i++){ @@ -5706,8 +5616,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { return target; } function _objectWithoutProperties(source, excluded) { - if (source == null) return { - }; + if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { @@ -5746,9 +5655,9 @@ function _arrayLikeToArray(arr, len) { function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -var version = "1.14.0"; +var version = "1.15.0"; function userAgent(pattern) { - if (typeof window !== 'undefined' && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern); + if (typeof window !== "undefined" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(pattern); } var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i); var Edge = userAgent(/Edge/i); @@ -5768,7 +5677,7 @@ function off(el, event, fn) { } function matches(/**HTMLElement*/ el, /**String*/ selector) { if (!selector) return; - selector[0] === '>' && (selector = selector.substring(1)); + selector[0] === ">" && (selector = selector.substring(1)); if (el) try { if (el.matches) return el.matches(selector); else if (el.msMatchesSelector) return el.msMatchesSelector(selector); @@ -5785,19 +5694,19 @@ function closest(/**HTMLElement*/ el, /**String*/ selector, /**HTMLElement*/ ctx if (el) { ctx = ctx || document; do { - if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) return el; + if (selector != null && (selector[0] === ">" ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) return el; if (el === ctx) break; - /* jshint boss:true */ }while (el = getParentOrHost(el)) + /* jshint boss:true */ }while (el = getParentOrHost(el)); } return null; } var R_SPACE = /\s+/g; function toggleClass(el, name, state) { if (el && name) { - if (el.classList) el.classList[state ? 'add' : 'remove'](name); + if (el.classList) el.classList[state ? "add" : "remove"](name); else { - var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' '); - el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' '); + var className = (" " + el.className + " ").replace(R_SPACE, " ").replace(" " + name + " ", " "); + el.className = (className + (state ? " " + name : "")).replace(R_SPACE, " "); } } } @@ -5805,22 +5714,22 @@ function css(el, prop, val) { var style = el && el.style; if (style) { if (val === void 0) { - if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, ''); + if (document.defaultView && document.defaultView.getComputedStyle) val = document.defaultView.getComputedStyle(el, ""); else if (el.currentStyle) val = el.currentStyle; return prop === void 0 ? val : val[prop]; } else { - if (!(prop in style) && prop.indexOf('webkit') === -1) prop = '-webkit-' + prop; - style[prop] = val + (typeof val === 'string' ? '' : 'px'); + if (!(prop in style) && prop.indexOf("webkit") === -1) prop = "-webkit-" + prop; + style[prop] = val + (typeof val === "string" ? "" : "px"); } } } function matrix(el, selfOnly) { - var appliedTransforms = ''; - if (typeof el === 'string') appliedTransforms = el; + var appliedTransforms = ""; + if (typeof el === "string") appliedTransforms = el; else do { - var transform = css(el, 'transform'); - if (transform && transform !== 'none') appliedTransforms = transform + ' ' + appliedTransforms; - /* jshint boss:true */ }while (!selfOnly && (el = el.parentNode)) + var transform = css(el, "transform"); + if (transform && transform !== "none") appliedTransforms = transform + " " + appliedTransforms; + /* jshint boss:true */ }while (!selfOnly && (el = el.parentNode)); var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; /*jshint -W056 */ return matrixFn && new matrixFn(appliedTransforms); } @@ -5869,15 +5778,15 @@ function getWindowScrollingElement() { container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312) // Not needed on <= IE11 if (!IE11OrLess) { - do if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) { + do if (container && container.getBoundingClientRect && (css(container, "transform") !== "none" || relativeToNonStaticParent && css(container, "position") !== "static")) { var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container - top -= containerRect.top + parseInt(css(container, 'border-top-width')); - left -= containerRect.left + parseInt(css(container, 'border-left-width')); + top -= containerRect.top + parseInt(css(container, "border-top-width")); + left -= containerRect.left + parseInt(css(container, "border-left-width")); bottom = top + elRect.height; right = left + elRect.width; break; } - while (container = container.parentNode) + while (container = container.parentNode); } } if (undoScale && el !== window) { @@ -5911,7 +5820,7 @@ function getWindowScrollingElement() { var parent = getParentAutoScrollElement(el, true), elSideVal = getRect(el)[elSide]; /* jshint boss:true */ while(parent){ var parentSideVal = getRect(parent)[parentSide], visible = void 0; - if (parentSide === 'top' || parentSide === 'left') visible = elSideVal >= parentSideVal; + if (parentSide === "top" || parentSide === "left") visible = elSideVal >= parentSideVal; else visible = elSideVal <= parentSideVal; if (!visible) return parent; if (parent === getWindowScrollingElement()) break; @@ -5929,7 +5838,7 @@ function getWindowScrollingElement() { */ function getChild(el, childNum, options, includeDragEl) { var currentChild = 0, i = 0, children = el.children; while(i < children.length){ - if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) { + if (children[i].style.display !== "none" && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) { if (currentChild === childNum) return children[i]; currentChild++; } @@ -5944,7 +5853,7 @@ function getWindowScrollingElement() { * @return {HTMLElement} The last child, ignoring ghostEl */ function lastChild(el, selector) { var last = el.lastElementChild; - while(last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector)))last = last.previousElementSibling; + while(last && (last === Sortable.ghost || css(last, "display") === "none" || selector && !matches(last, selector)))last = last.previousElementSibling; return last || null; } /** @@ -5953,11 +5862,11 @@ function getWindowScrollingElement() { * @param {HTMLElement} el * @param {selector} selector * @return {number} - */ function index1(el, selector) { - var index = 0; + */ function index(el, selector) { + var index1 = 0; if (!el || !el.parentNode) return -1; - /* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) index++; - return index; + /* jshint boss:true */ while(el = el.previousElementSibling)if (el.nodeName.toUpperCase() !== "TEMPLATE" && el !== Sortable.clone && (!selector || matches(el, selector))) index1++; + return index1; } /** * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements. @@ -5970,7 +5879,7 @@ function getWindowScrollingElement() { var elMatrix = matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d; offsetLeft += el.scrollLeft * scaleX; offsetTop += el.scrollTop * scaleY; - }while (el !== winScroller && (el = el.parentNode)) + }while (el !== winScroller && (el = el.parentNode)); return [ offsetLeft, offsetTop @@ -5998,13 +5907,13 @@ function getParentAutoScrollElement(el, includeSelf) { do // we don't need to get elem css if it isn't even overflowing in the first place (performance) if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) { var elemCSS = css(elem); - if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) { + if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == "auto" || elemCSS.overflowX == "scroll") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == "auto" || elemCSS.overflowY == "scroll")) { if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement(); if (gotSelf || includeSelf) return elem; gotSelf = true; } } - while (elem = elem.parentNode) + while (elem = elem.parentNode); return getWindowScrollingElement(); } function extend(dst, src) { @@ -6037,7 +5946,7 @@ function scrollBy(el, x, y) { el.scrollLeft += x; el.scrollTop += y; } -function clone1(el) { +function clone(el) { var Polymer = window.Polymer; var $ = window.jQuery || window.Zepto; if (Polymer && Polymer.dom) return Polymer.dom(el).cloneNode(true); @@ -6045,20 +5954,20 @@ function clone1(el) { else return el.cloneNode(true); } function setRect(el, rect) { - css(el, 'position', 'absolute'); - css(el, 'top', rect.top); - css(el, 'left', rect.left); - css(el, 'width', rect.width); - css(el, 'height', rect.height); + css(el, "position", "absolute"); + css(el, "top", rect.top); + css(el, "left", rect.left); + css(el, "width", rect.width); + css(el, "height", rect.height); } function unsetRect(el) { - css(el, 'position', ''); - css(el, 'top', ''); - css(el, 'left', ''); - css(el, 'width', ''); - css(el, 'height', ''); + css(el, "position", ""); + css(el, "top", ""); + css(el, "left", ""); + css(el, "width", ""); + css(el, "height", ""); } -var expando = 'Sortable' + new Date().getTime(); +var expando = "Sortable" + new Date().getTime(); function AnimationStateManager() { var animationStates = [], animationCallbackId; return { @@ -6067,13 +5976,12 @@ function AnimationStateManager() { if (!this.options.animation) return; var children = [].slice.call(this.el.children); children.forEach(function(child) { - if (css(child, 'display') === 'none' || child === Sortable.ghost) return; + if (css(child, "display") === "none" || child === Sortable.ghost) return; animationStates.push({ target: child, rect: getRect(child) }); - var fromRect = _objectSpread2({ - }, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation + var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation if (child.thisAnimationDuration) { var childMatrix = matrix(child, true); if (childMatrix) { @@ -6096,7 +6004,7 @@ function AnimationStateManager() { var _this = this; if (!this.options.animation) { clearTimeout(animationCallbackId); - if (typeof callback === 'function') callback(); + if (typeof callback === "function") callback(); return; } var animating = false, animationTime = 0; @@ -6135,27 +6043,27 @@ function AnimationStateManager() { }); clearTimeout(animationCallbackId); if (!animating) { - if (typeof callback === 'function') callback(); + if (typeof callback === "function") callback(); } else animationCallbackId = setTimeout(function() { - if (typeof callback === 'function') callback(); + if (typeof callback === "function") callback(); }, animationTime); animationStates = []; }, animate: function animate(target, currentRect, toRect, duration) { if (duration) { - css(target, 'transition', ''); - css(target, 'transform', ''); + css(target, "transition", ""); + css(target, "transform", ""); var elMatrix = matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1); target.animatingX = !!translateX; target.animatingY = !!translateY; - css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)'); + css(target, "transform", "translate3d(" + translateX + "px," + translateY + "px,0)"); this.forRepaintDummy = repaint(target); // repaint - css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : '')); - css(target, 'transform', 'translate3d(0,0,0)'); - typeof target.animated === 'number' && clearTimeout(target.animated); + css(target, "transition", "transform " + duration + "ms" + (this.options.easing ? " " + this.options.easing : "")); + css(target, "transform", "translate3d(0,0,0)"); + typeof target.animated === "number" && clearTimeout(target.animated); target.animated = setTimeout(function() { - css(target, 'transition', ''); - css(target, 'transform', ''); + css(target, "transition", ""); + css(target, "transform", ""); target.animated = false; target.animatingX = false; target.animatingY = false; @@ -6170,18 +6078,18 @@ function repaint(target) { function calculateRealTime(animatingRect, fromRect, toRect, options) { return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation; } -var plugins1 = []; -var defaults1 = { +var plugins = []; +var defaults = { initializeByDefault: true }; var PluginManager = { mount: function mount(plugin) { // Set default static properties - for(var option in defaults1)if (defaults1.hasOwnProperty(option) && !(option in plugin)) plugin[option] = defaults1[option]; - plugins1.forEach(function(p) { + for(var option in defaults)if (defaults.hasOwnProperty(option) && !(option in plugin)) plugin[option] = defaults[option]; + plugins.forEach(function(p) { if (p.pluginName === plugin.pluginName) throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once"); }); - plugins1.push(plugin); + plugins.push(plugin); }, pluginEvent: function pluginEvent(eventName, sortable, evt) { var _this = this; @@ -6189,8 +6097,8 @@ var PluginManager = { evt.cancel = function() { _this.eventCanceled = true; }; - var eventNameGlobal = eventName + 'Global'; - plugins1.forEach(function(plugin) { + var eventNameGlobal = eventName + "Global"; + plugins.forEach(function(plugin) { if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable if (sortable[plugin.pluginName][eventNameGlobal]) sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({ sortable: sortable @@ -6202,93 +6110,90 @@ var PluginManager = { }, evt)); }); }, - initializePlugins: function initializePlugins(sortable, el, defaults, options) { - plugins1.forEach(function(plugin) { + initializePlugins: function initializePlugins(sortable, el, defaults1, options) { + plugins.forEach(function(plugin) { var pluginName = plugin.pluginName; if (!sortable.options[pluginName] && !plugin.initializeByDefault) return; var initialized = new plugin(sortable, el, sortable.options); initialized.sortable = sortable; initialized.options = sortable.options; sortable[pluginName] = initialized; // Add default options from plugin - _extends(defaults, initialized.defaults); + _extends(defaults1, initialized.defaults); }); for(var option in sortable.options){ if (!sortable.options.hasOwnProperty(option)) continue; var modified = this.modifyOption(sortable, option, sortable.options[option]); - if (typeof modified !== 'undefined') sortable.options[option] = modified; + if (typeof modified !== "undefined") sortable.options[option] = modified; } }, getEventProperties: function getEventProperties(name, sortable) { - var eventProperties = { - }; - plugins1.forEach(function(plugin) { - if (typeof plugin.eventProperties !== 'function') return; + var eventProperties = {}; + plugins.forEach(function(plugin) { + if (typeof plugin.eventProperties !== "function") return; _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name)); }); return eventProperties; }, modifyOption: function modifyOption(sortable, name, value) { var modifiedValue; - plugins1.forEach(function(plugin) { + plugins.forEach(function(plugin) { // Plugin must exist on the Sortable if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin - if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value); + if (plugin.optionListeners && typeof plugin.optionListeners[name] === "function") modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value); }); return modifiedValue; } }; function dispatchEvent(_ref) { - var sortable = _ref.sortable, rootEl = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex = _ref.oldIndex, newIndex = _ref.newIndex, oldDraggableIndex = _ref.oldDraggableIndex, newDraggableIndex = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, extraEventProperties = _ref.extraEventProperties; - sortable = sortable || rootEl && rootEl[expando]; + var sortable = _ref.sortable, rootEl1 = _ref.rootEl, name = _ref.name, targetEl = _ref.targetEl, cloneEl1 = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex1 = _ref.oldIndex, newIndex1 = _ref.newIndex, oldDraggableIndex1 = _ref.oldDraggableIndex, newDraggableIndex1 = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable1 = _ref.putSortable, extraEventProperties = _ref.extraEventProperties; + sortable = sortable || rootEl1 && rootEl1[expando]; if (!sortable) return; - var evt, options = sortable.options, onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature + var evt, options = sortable.options, onName = "on" + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent(name, { bubbles: true, cancelable: true }); else { - evt = document.createEvent('Event'); + evt = document.createEvent("Event"); evt.initEvent(name, true, true); } - evt.to = toEl || rootEl; - evt.from = fromEl || rootEl; - evt.item = targetEl || rootEl; - evt.clone = cloneEl; - evt.oldIndex = oldIndex; - evt.newIndex = newIndex; - evt.oldDraggableIndex = oldDraggableIndex; - evt.newDraggableIndex = newDraggableIndex; + evt.to = toEl || rootEl1; + evt.from = fromEl || rootEl1; + evt.item = targetEl || rootEl1; + evt.clone = cloneEl1; + evt.oldIndex = oldIndex1; + evt.newIndex = newIndex1; + evt.oldDraggableIndex = oldDraggableIndex1; + evt.newDraggableIndex = newDraggableIndex1; evt.originalEvent = originalEvent; - evt.pullMode = putSortable ? putSortable.lastPutMode : undefined; - var allEventProperties = _objectSpread2(_objectSpread2({ - }, extraEventProperties), PluginManager.getEventProperties(name, sortable)); + evt.pullMode = putSortable1 ? putSortable1.lastPutMode : undefined; + var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable)); for(var option in allEventProperties)evt[option] = allEventProperties[option]; - if (rootEl) rootEl.dispatchEvent(evt); + if (rootEl1) rootEl1.dispatchEvent(evt); if (options[onName]) options[onName].call(sortable, evt); } var _excluded = [ "evt" ]; var pluginEvent = function pluginEvent(eventName, sortable) { - var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { - }, originalEvent = _ref.evt, data = _objectWithoutProperties(_ref, _excluded); + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, originalEvent = _ref.evt, data = _objectWithoutProperties(_ref, _excluded); PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({ - dragEl: dragEl1, - parentEl: parentEl1, + dragEl: dragEl, + parentEl: parentEl, ghostEl: ghostEl, - rootEl: rootEl1, + rootEl: rootEl, nextEl: nextEl, lastDownEl: lastDownEl, - cloneEl: cloneEl1, + cloneEl: cloneEl, cloneHidden: cloneHidden, dragStarted: moved, - putSortable: putSortable1, + putSortable: putSortable, activeSortable: Sortable.active, originalEvent: originalEvent, - oldIndex: oldIndex1, - oldDraggableIndex: oldDraggableIndex1, - newIndex: newIndex1, - newDraggableIndex: newDraggableIndex1, + oldIndex: oldIndex, + oldDraggableIndex: oldDraggableIndex, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex, hideGhostForTarget: _hideGhostForTarget, unhideGhostForTarget: _unhideGhostForTarget, cloneNowHidden: function cloneNowHidden() { @@ -6308,43 +6213,43 @@ var pluginEvent = function pluginEvent(eventName, sortable) { }; function _dispatchEvent(info) { dispatchEvent(_objectSpread2({ - putSortable: putSortable1, - cloneEl: cloneEl1, - targetEl: dragEl1, - rootEl: rootEl1, - oldIndex: oldIndex1, - oldDraggableIndex: oldDraggableIndex1, - newIndex: newIndex1, - newDraggableIndex: newDraggableIndex1 + putSortable: putSortable, + cloneEl: cloneEl, + targetEl: dragEl, + rootEl: rootEl, + oldIndex: oldIndex, + oldDraggableIndex: oldDraggableIndex, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex }, info)); } -var dragEl1, parentEl1, ghostEl, rootEl1, nextEl, lastDownEl, cloneEl1, cloneHidden, oldIndex1, newIndex1, oldDraggableIndex1, newDraggableIndex1, activeGroup, putSortable1, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, // For positioning ghost absolutely +var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, // For positioning ghost absolutely ghostRelativeParent, ghostRelativeParentInitialScroll = [], // (left, top) _silent = false, savedInputChecked = []; -/** @const */ var documentExists = typeof document !== 'undefined', PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float', // This will not pass for IE9, because IE9 DnD only works on anchors -supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'), supportCssPointerEvents = function() { +/** @const */ var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", // This will not pass for IE9, because IE9 DnD only works on anchors +supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() { if (!documentExists) return; // false when <= IE11 if (IE11OrLess) return false; - var el = document.createElement('x'); - el.style.cssText = 'pointer-events:auto'; - return el.style.pointerEvents === 'auto'; + var el = document.createElement("x"); + el.style.cssText = "pointer-events:auto"; + return el.style.pointerEvents === "auto"; }(), _detectDirection = function _detectDirection(el, options) { var elCSS = css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = getChild(el, 0, options), child2 = getChild(el, 1, options), firstChildCSS = child1 && css(child1), secondChildCSS = child2 && css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width; - if (elCSS.display === 'flex') return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal'; - if (elCSS.display === 'grid') return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal'; - if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') { - var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right'; - return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal'; + if (elCSS.display === "flex") return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal"; + if (elCSS.display === "grid") return elCSS.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal"; + if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== "none") { + var touchingSideChild2 = firstChildCSS["float"] === "left" ? "left" : "right"; + return child2 && (secondChildCSS.clear === "both" || secondChildCSS.clear === touchingSideChild2) ? "vertical" : "horizontal"; } - return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal'; + return child1 && (firstChildCSS.display === "block" || firstChildCSS.display === "flex" || firstChildCSS.display === "table" || firstChildCSS.display === "grid" || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === "none" || child2 && elCSS[CSSFloatProperty] === "none" && firstChildWidth + secondChildWidth > elWidth) ? "vertical" : "horizontal"; }, _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) { var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height; return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2; -}, /** - * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold. - * @param {Number} x X position - * @param {Number} y Y position - * @return {HTMLElement} Element of the first found nearest Sortable +}, /** + * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold. + * @param {Number} x X position + * @param {Number} y Y position + * @return {HTMLElement} Element of the first found nearest Sortable */ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) { var ret; sortables.some(function(sortable) { @@ -6356,24 +6261,23 @@ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in return ret; }, _prepareGroup = function _prepareGroup(options) { function toFn(value, pull) { - return function(to, from, dragEl, evt) { + return function(to, from, dragEl1, evt) { var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name; if (value == null && (pull || sameGroup)) // Default pull value // Default pull and put value if same group return true; else if (value == null || value === false) return false; - else if (pull && value === 'clone') return value; - else if (typeof value === 'function') return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt); + else if (pull && value === "clone") return value; + else if (typeof value === "function") return toFn(value(to, from, dragEl1, evt), pull)(to, from, dragEl1, evt); else { var otherGroup = (pull ? to : from).options.group.name; - return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1; + return value === true || typeof value === "string" && value === otherGroup || value.join && value.indexOf(otherGroup) > -1; } }; } - var group = { - }; + var group = {}; var originalGroup = options.group; - if (!originalGroup || _typeof(originalGroup) != 'object') originalGroup = { + if (!originalGroup || _typeof(originalGroup) != "object") originalGroup = { name: originalGroup }; group.name = originalGroup.name; @@ -6382,11 +6286,11 @@ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in group.revertClone = originalGroup.revertClone; options.group = group; }, _hideGhostForTarget = function _hideGhostForTarget() { - if (!supportCssPointerEvents && ghostEl) css(ghostEl, 'display', 'none'); + if (!supportCssPointerEvents && ghostEl) css(ghostEl, "display", "none"); }, _unhideGhostForTarget = function _unhideGhostForTarget() { - if (!supportCssPointerEvents && ghostEl) css(ghostEl, 'display', ''); + if (!supportCssPointerEvents && ghostEl) css(ghostEl, "display", ""); }; // #1184 fix - Prevent click event on fallback if dragged but item not changed position -if (documentExists) document.addEventListener('click', function(evt) { +if (documentExists && !ChromeForAndroid) document.addEventListener("click", function(evt) { if (ignoreNextClick) { evt.preventDefault(); evt.stopPropagation && evt.stopPropagation(); @@ -6396,13 +6300,12 @@ if (documentExists) document.addEventListener('click', function(evt) { } }, true); var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) { - if (dragEl1) { + if (dragEl) { evt = evt.touches ? evt.touches[0] : evt; var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY); if (nearest) { // Create imitation event - var event = { - }; + var event = {}; for(var i in evt)if (evt.hasOwnProperty(i)) event[i] = evt[i]; event.target = event.rootEl = nearest; event.preventDefault = void 0; @@ -6412,26 +6315,24 @@ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) } }; var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) { - if (dragEl1) dragEl1.parentNode[expando]._isOutsideThisEl(evt.target); + if (dragEl) dragEl.parentNode[expando]._isOutsideThisEl(evt.target); }; -/** - * @class Sortable - * @param {HTMLElement} el - * @param {Object} [options] +/** + * @class Sortable + * @param {HTMLElement} el + * @param {Object} [options] */ function Sortable(el, options) { - if (!(el && el.nodeType && el.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat(({ - }).toString.call(el)); + if (!(el && el.nodeType && el.nodeType === 1)) throw "Sortable: `el` must be an HTMLElement, not ".concat(({}).toString.call(el)); this.el = el; // root element - this.options = options = _extends({ - }, options); // Export instance + this.options = options = _extends({}, options); // Export instance el[expando] = this; - var defaults = { + var defaults2 = { group: null, sort: true, disabled: false, store: null, handle: null, - draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*', + draggable: /^[uo]l$/i.test(el.nodeName) ? ">li" : ">*", swapThreshold: 1, // percentage; 0 <= x <= 1 invertSwap: false, @@ -6442,51 +6343,51 @@ var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) { direction: function direction() { return _detectDirection(el, this.options); }, - ghostClass: 'sortable-ghost', - chosenClass: 'sortable-chosen', - dragClass: 'sortable-drag', - ignore: 'a, img', + ghostClass: "sortable-ghost", + chosenClass: "sortable-chosen", + dragClass: "sortable-drag", + ignore: "a, img", filter: null, preventOnFilter: true, animation: 0, easing: null, - setData: function setData(dataTransfer, dragEl) { - dataTransfer.setData('Text', dragEl.textContent); + setData: function setData(dataTransfer, dragEl2) { + dataTransfer.setData("Text", dragEl2.textContent); }, dropBubble: false, dragoverBubble: false, - dataIdAttr: 'data-id', + dataIdAttr: "data-id", delay: 0, delayOnTouchOnly: false, touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1, forceFallback: false, - fallbackClass: 'sortable-fallback', + fallbackClass: "sortable-fallback", fallbackOnBody: false, fallbackTolerance: 0, fallbackOffset: { x: 0, y: 0 }, - supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari, + supportPointer: Sortable.supportPointer !== false && "PointerEvent" in window && !Safari, emptyInsertThreshold: 5 }; - PluginManager.initializePlugins(this, el, defaults); // Set default options - for(var name in defaults)!(name in options) && (options[name] = defaults[name]); + PluginManager.initializePlugins(this, el, defaults2); // Set default options + for(var name in defaults2)!(name in options) && (options[name] = defaults2[name]); _prepareGroup(options); // Bind all private methods - for(var fn in this)if (fn.charAt(0) === '_' && typeof this[fn] === 'function') this[fn] = this[fn].bind(this); + for(var fn in this)if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this); // Setup drag mode this.nativeDraggable = options.forceFallback ? false : supportDraggable; if (this.nativeDraggable) // Touch start threshold cannot be greater than the native dragstart threshold this.options.touchStartThreshold = 1; // Bind events - if (options.supportPointer) on(el, 'pointerdown', this._onTapStart); + if (options.supportPointer) on(el, "pointerdown", this._onTapStart); else { - on(el, 'mousedown', this._onTapStart); - on(el, 'touchstart', this._onTapStart); + on(el, "mousedown", this._onTapStart); + on(el, "touchstart", this._onTapStart); } if (this.nativeDraggable) { - on(el, 'dragover', this); - on(el, 'dragenter', this); + on(el, "dragover", this); + on(el, "dragenter", this); } sortables.push(this.el); // Restore sorting options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager @@ -6498,54 +6399,54 @@ Sortable.prototype = /** @lends Sortable.prototype */ { if (!this.el.contains(target) && target !== this.el) lastTarget = null; }, _getDirection: function _getDirection(evt, target) { - return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl1) : this.options.direction; + return typeof this.options.direction === "function" ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction; }, _onTapStart: function _onTapStart(/** Event|TouchEvent */ evt) { if (!evt.cancelable) return; - var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter; + var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === "touch" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter; _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group. - if (dragEl1) return; + if (dragEl) return; if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) return; // only left button and enabled // cancel dnd if original target is content editable if (originalTarget.isContentEditable) return; // Safari ignores further event handling after mousedown - if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') return; + if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === "SELECT") return; target = closest(target, options.draggable, el, false); if (target && target.animated) return; if (lastDownEl === target) // Ignoring duplicate `down` return; // Get the index of the dragged element within its parent - oldIndex1 = index1(target); - oldDraggableIndex1 = index1(target, options.draggable); // Check filter - if (typeof filter === 'function') { + oldIndex = index(target); + oldDraggableIndex = index(target, options.draggable); // Check filter + if (typeof filter === "function") { if (filter.call(this, evt, target, this)) { _dispatchEvent({ sortable: _this, rootEl: originalTarget, - name: 'filter', + name: "filter", targetEl: target, toEl: el, fromEl: el }); - pluginEvent('filter', _this, { + pluginEvent("filter", _this, { evt: evt }); preventOnFilter && evt.cancelable && evt.preventDefault(); return; // cancel dnd } } else if (filter) { - filter = filter.split(',').some(function(criteria) { + filter = filter.split(",").some(function(criteria) { criteria = closest(originalTarget, criteria.trim(), el, false); if (criteria) { _dispatchEvent({ sortable: _this, rootEl: criteria, - name: 'filter', + name: "filter", targetEl: target, fromEl: el, toEl: el }); - pluginEvent('filter', _this, { + pluginEvent("filter", _this, { evt: evt }); return true; @@ -6562,17 +6463,17 @@ Sortable.prototype = /** @lends Sortable.prototype */ { }, _prepareDragStart: function _prepareDragStart(/** Event */ evt, /** Touch */ touch, /** HTMLElement */ target) { var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn; - if (target && !dragEl1 && target.parentNode === el) { + if (target && !dragEl && target.parentNode === el) { var dragRect = getRect(target); - rootEl1 = el; - dragEl1 = target; - parentEl1 = dragEl1.parentNode; - nextEl = dragEl1.nextSibling; + rootEl = el; + dragEl = target; + parentEl = dragEl.parentNode; + nextEl = dragEl.nextSibling; lastDownEl = target; activeGroup = options.group; - Sortable.dragged = dragEl1; + Sortable.dragged = dragEl; tapEvt = { - target: dragEl1, + target: dragEl, clientX: (touch || evt).clientX, clientY: (touch || evt).clientY }; @@ -6580,9 +6481,9 @@ Sortable.prototype = /** @lends Sortable.prototype */ { tapDistanceTop = tapEvt.clientY - dragRect.top; this._lastX = (touch || evt).clientX; this._lastY = (touch || evt).clientY; - dragEl1.style['will-change'] = 'all'; + dragEl.style["will-change"] = "all"; dragStartFn = function dragStartFn() { - pluginEvent('delayEnded', _this, { + pluginEvent("delayEnded", _this, { evt: evt }); if (Sortable.eventCanceled) { @@ -6591,30 +6492,30 @@ Sortable.prototype = /** @lends Sortable.prototype */ { } // Delayed drag has been triggered // we can re-enable the events: touchmove/mousemove _this._disableDelayedDragEvents(); - if (!FireFox && _this.nativeDraggable) dragEl1.draggable = true; + if (!FireFox && _this.nativeDraggable) dragEl.draggable = true; // Bind the events: dragstart/dragend _this._triggerDragStart(evt, touch); // Drag start event _dispatchEvent({ sortable: _this, - name: 'choose', + name: "choose", originalEvent: evt }); // Chosen item - toggleClass(dragEl1, options.chosenClass, true); + toggleClass(dragEl, options.chosenClass, true); }; // Disable "draggable" - options.ignore.split(',').forEach(function(criteria) { - find(dragEl1, criteria.trim(), _disableDraggable); + options.ignore.split(",").forEach(function(criteria) { + find(dragEl, criteria.trim(), _disableDraggable); }); - on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent); - on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent); - on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent); - on(ownerDocument, 'mouseup', _this._onDrop); - on(ownerDocument, 'touchend', _this._onDrop); - on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox) + on(ownerDocument, "dragover", nearestEmptyInsertDetectEvent); + on(ownerDocument, "mousemove", nearestEmptyInsertDetectEvent); + on(ownerDocument, "touchmove", nearestEmptyInsertDetectEvent); + on(ownerDocument, "mouseup", _this._onDrop); + on(ownerDocument, "touchend", _this._onDrop); + on(ownerDocument, "touchcancel", _this._onDrop); // Make dragEl draggable (must be before delay for FireFox) if (FireFox && this.nativeDraggable) { this.options.touchStartThreshold = 4; - dragEl1.draggable = true; + dragEl.draggable = true; } - pluginEvent('delayStart', this, { + pluginEvent("delayStart", this, { evt: evt }); // Delay is impossible for native DnD in Edge or IE if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) { @@ -6624,12 +6525,12 @@ Sortable.prototype = /** @lends Sortable.prototype */ { } // If the user moves the pointer or let go the click or touch // before the delay has been reached: // disable the delayed drag - on(ownerDocument, 'mouseup', _this._disableDelayedDrag); - on(ownerDocument, 'touchend', _this._disableDelayedDrag); - on(ownerDocument, 'touchcancel', _this._disableDelayedDrag); - on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler); - on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler); - options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler); + on(ownerDocument, "mouseup", _this._disableDelayedDrag); + on(ownerDocument, "touchend", _this._disableDelayedDrag); + on(ownerDocument, "touchcancel", _this._disableDelayedDrag); + on(ownerDocument, "mousemove", _this._delayedDragTouchMoveHandler); + on(ownerDocument, "touchmove", _this._delayedDragTouchMoveHandler); + options.supportPointer && on(ownerDocument, "pointermove", _this._delayedDragTouchMoveHandler); _this._dragStartTimer = setTimeout(dragStartFn, options.delay); } else dragStartFn(); } @@ -6639,28 +6540,28 @@ Sortable.prototype = /** @lends Sortable.prototype */ { if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) this._disableDelayedDrag(); }, _disableDelayedDrag: function _disableDelayedDrag() { - dragEl1 && _disableDraggable(dragEl1); + dragEl && _disableDraggable(dragEl); clearTimeout(this._dragStartTimer); this._disableDelayedDragEvents(); }, _disableDelayedDragEvents: function _disableDelayedDragEvents() { var ownerDocument = this.el.ownerDocument; - off(ownerDocument, 'mouseup', this._disableDelayedDrag); - off(ownerDocument, 'touchend', this._disableDelayedDrag); - off(ownerDocument, 'touchcancel', this._disableDelayedDrag); - off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler); - off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler); - off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler); + off(ownerDocument, "mouseup", this._disableDelayedDrag); + off(ownerDocument, "touchend", this._disableDelayedDrag); + off(ownerDocument, "touchcancel", this._disableDelayedDrag); + off(ownerDocument, "mousemove", this._delayedDragTouchMoveHandler); + off(ownerDocument, "touchmove", this._delayedDragTouchMoveHandler); + off(ownerDocument, "pointermove", this._delayedDragTouchMoveHandler); }, _triggerDragStart: function _triggerDragStart(/** Event */ evt, /** Touch */ touch) { - touch = touch || evt.pointerType == 'touch' && evt; + touch = touch || evt.pointerType == "touch" && evt; if (!this.nativeDraggable || touch) { - if (this.options.supportPointer) on(document, 'pointermove', this._onTouchMove); - else if (touch) on(document, 'touchmove', this._onTouchMove); - else on(document, 'mousemove', this._onTouchMove); + if (this.options.supportPointer) on(document, "pointermove", this._onTouchMove); + else if (touch) on(document, "touchmove", this._onTouchMove); + else on(document, "mousemove", this._onTouchMove); } else { - on(dragEl1, 'dragend', this); - on(rootEl1, 'dragstart', this._onDragStart); + on(dragEl, "dragend", this); + on(rootEl, "dragstart", this._onDragStart); } try { if (document.selection) // Timeout neccessary for IE9 @@ -6668,24 +6569,23 @@ Sortable.prototype = /** @lends Sortable.prototype */ { document.selection.empty(); }); else window.getSelection().removeAllRanges(); - } catch (err) { - } + } catch (err) {} }, _dragStarted: function _dragStarted(fallback, evt) { awaitingDragStarted = false; - if (rootEl1 && dragEl1) { - pluginEvent('dragStarted', this, { + if (rootEl && dragEl) { + pluginEvent("dragStarted", this, { evt: evt }); - if (this.nativeDraggable) on(document, 'dragover', _checkOutsideTargetEl); + if (this.nativeDraggable) on(document, "dragover", _checkOutsideTargetEl); var options = this.options; // Apply effect - !fallback && toggleClass(dragEl1, options.dragClass, false); - toggleClass(dragEl1, options.ghostClass, true); + !fallback && toggleClass(dragEl, options.dragClass, false); + toggleClass(dragEl, options.ghostClass, true); Sortable.active = this; fallback && this._appendGhost(); // Drag start event _dispatchEvent({ sortable: this, - name: 'start', + name: "start", originalEvent: evt }); } else this._nulling(); @@ -6702,7 +6602,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ { if (target === parent) break; parent = target; } - dragEl1.parentNode[expando]._isOutsideThisEl(target); + dragEl.parentNode[expando]._isOutsideThisEl(target); if (parent) do { if (parent[expando]) { var inserted = void 0; @@ -6715,7 +6615,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ { if (inserted && !this.options.dragoverBubble) break; } target = parent; // store last element - }while (parent = parent.parentNode) + }while (parent = parent.parentNode); _unhideGhostForTarget(); } }, @@ -6739,10 +6639,10 @@ Sortable.prototype = /** @lends Sortable.prototype */ { f: dy }; var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")"); - css(ghostEl, 'webkitTransform', cssMatrix); - css(ghostEl, 'mozTransform', cssMatrix); - css(ghostEl, 'msTransform', cssMatrix); - css(ghostEl, 'transform', cssMatrix); + css(ghostEl, "webkitTransform", cssMatrix); + css(ghostEl, "mozTransform", cssMatrix); + css(ghostEl, "msTransform", cssMatrix); + css(ghostEl, "transform", cssMatrix); lastDx = dx; lastDy = dy; touchEvt = touch; @@ -6754,11 +6654,11 @@ Sortable.prototype = /** @lends Sortable.prototype */ { // Bug if using scale(): https://stackoverflow.com/questions/2637058 // Not being adjusted for if (!ghostEl) { - var container = this.options.fallbackOnBody ? document.body : rootEl1, rect = getRect(dragEl1, true, PositionGhostAbsolutely, true, container), options = this.options; // Position absolutely + var container = this.options.fallbackOnBody ? document.body : rootEl, rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), options = this.options; // Position absolutely if (PositionGhostAbsolutely) { // Get relatively positioned parent ghostRelativeParent = container; - while(css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document)ghostRelativeParent = ghostRelativeParent.parentNode; + while(css(ghostRelativeParent, "position") === "static" && css(ghostRelativeParent, "transform") === "none" && ghostRelativeParent !== document)ghostRelativeParent = ghostRelativeParent.parentNode; if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) { if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement(); rect.top += ghostRelativeParent.scrollTop; @@ -6766,88 +6666,89 @@ Sortable.prototype = /** @lends Sortable.prototype */ { } else ghostRelativeParent = getWindowScrollingElement(); ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent); } - ghostEl = dragEl1.cloneNode(true); + ghostEl = dragEl.cloneNode(true); toggleClass(ghostEl, options.ghostClass, false); toggleClass(ghostEl, options.fallbackClass, true); toggleClass(ghostEl, options.dragClass, true); - css(ghostEl, 'transition', ''); - css(ghostEl, 'transform', ''); - css(ghostEl, 'box-sizing', 'border-box'); - css(ghostEl, 'margin', 0); - css(ghostEl, 'top', rect.top); - css(ghostEl, 'left', rect.left); - css(ghostEl, 'width', rect.width); - css(ghostEl, 'height', rect.height); - css(ghostEl, 'opacity', '0.8'); - css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed'); - css(ghostEl, 'zIndex', '100000'); - css(ghostEl, 'pointerEvents', 'none'); + css(ghostEl, "transition", ""); + css(ghostEl, "transform", ""); + css(ghostEl, "box-sizing", "border-box"); + css(ghostEl, "margin", 0); + css(ghostEl, "top", rect.top); + css(ghostEl, "left", rect.left); + css(ghostEl, "width", rect.width); + css(ghostEl, "height", rect.height); + css(ghostEl, "opacity", "0.8"); + css(ghostEl, "position", PositionGhostAbsolutely ? "absolute" : "fixed"); + css(ghostEl, "zIndex", "100000"); + css(ghostEl, "pointerEvents", "none"); Sortable.ghost = ghostEl; container.appendChild(ghostEl); // Set transform-origin - css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%'); + css(ghostEl, "transform-origin", tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + "% " + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + "%"); } }, _onDragStart: function _onDragStart(/**Event*/ evt, /**boolean*/ fallback) { var _this = this; var dataTransfer = evt.dataTransfer; var options = _this.options; - pluginEvent('dragStart', this, { + pluginEvent("dragStart", this, { evt: evt }); if (Sortable.eventCanceled) { this._onDrop(); return; } - pluginEvent('setupClone', this); + pluginEvent("setupClone", this); if (!Sortable.eventCanceled) { - cloneEl1 = clone1(dragEl1); - cloneEl1.draggable = false; - cloneEl1.style['will-change'] = ''; + cloneEl = clone(dragEl); + cloneEl.removeAttribute("id"); + cloneEl.draggable = false; + cloneEl.style["will-change"] = ""; this._hideClone(); - toggleClass(cloneEl1, this.options.chosenClass, false); - Sortable.clone = cloneEl1; + toggleClass(cloneEl, this.options.chosenClass, false); + Sortable.clone = cloneEl; } // #1143: IFrame support workaround _this.cloneId = _nextTick(function() { - pluginEvent('clone', _this); + pluginEvent("clone", _this); if (Sortable.eventCanceled) return; - if (!_this.options.removeCloneOnHide) rootEl1.insertBefore(cloneEl1, dragEl1); + if (!_this.options.removeCloneOnHide) rootEl.insertBefore(cloneEl, dragEl); _this._hideClone(); _dispatchEvent({ sortable: _this, - name: 'clone' + name: "clone" }); }); - !fallback && toggleClass(dragEl1, options.dragClass, true); // Set proper drop events + !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events if (fallback) { ignoreNextClick = true; _this._loopId = setInterval(_this._emulateDragOver, 50); } else { // Undo what was set in _prepareDragStart before drag started - off(document, 'mouseup', _this._onDrop); - off(document, 'touchend', _this._onDrop); - off(document, 'touchcancel', _this._onDrop); + off(document, "mouseup", _this._onDrop); + off(document, "touchend", _this._onDrop); + off(document, "touchcancel", _this._onDrop); if (dataTransfer) { - dataTransfer.effectAllowed = 'move'; - options.setData && options.setData.call(_this, dataTransfer, dragEl1); + dataTransfer.effectAllowed = "move"; + options.setData && options.setData.call(_this, dataTransfer, dragEl); } - on(document, 'drop', _this); // #1276 fix: - css(dragEl1, 'transform', 'translateZ(0)'); + on(document, "drop", _this); // #1276 fix: + css(dragEl, "transform", "translateZ(0)"); } awaitingDragStarted = true; _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt)); - on(document, 'selectstart', _this); + on(document, "selectstart", _this); moved = true; - if (Safari) css(document.body, 'user-select', 'none'); + if (Safari) css(document.body, "user-select", "none"); }, // Returns true - if no further action is needed (either inserted or another condition) _onDragOver: function _onDragOver(/**Event*/ evt) { - var el = this.el, target1 = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable1 || activeSortable, vertical, _this = this, completedFired = false; + var el = this.el, target1 = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable || activeSortable, vertical, _this = this, completedFired = false; if (_silent) return; function dragOverEvent(name, extra) { pluginEvent(name, _this, _objectSpread2({ evt: evt, isOwner: isOwner, - axis: vertical ? 'vertical' : 'horizontal', + axis: vertical ? "vertical" : "horizontal", revert: revert, dragRect: dragRect, targetRect: targetRect, @@ -6856,18 +6757,18 @@ Sortable.prototype = /** @lends Sortable.prototype */ { target: target1, completed: completed, onMove: function onMove(target, after) { - return _onMove(rootEl1, el, dragEl1, dragRect, target, getRect(target), evt, after); + return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after); }, changed: changed }, extra)); } // Capture animation state function capture() { - dragOverEvent('dragOverAnimationCapture'); + dragOverEvent("dragOverAnimationCapture"); _this.captureAnimationState(); if (_this !== fromSortable) fromSortable.captureAnimationState(); } // Return invocation when dragEl is inserted (or completed) function completed(insertion) { - dragOverEvent('dragOverCompleted', { + dragOverEvent("dragOverCompleted", { insertion: insertion }); if (insertion) { @@ -6876,15 +6777,15 @@ Sortable.prototype = /** @lends Sortable.prototype */ { else activeSortable._showClone(_this); if (_this !== fromSortable) { // Set ghost class to new sortable's ghost class - toggleClass(dragEl1, putSortable1 ? putSortable1.options.ghostClass : activeSortable.options.ghostClass, false); - toggleClass(dragEl1, options.ghostClass, true); + toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false); + toggleClass(dragEl, options.ghostClass, true); } - if (putSortable1 !== _this && _this !== Sortable.active) putSortable1 = _this; - else if (_this === Sortable.active && putSortable1) putSortable1 = null; + if (putSortable !== _this && _this !== Sortable.active) putSortable = _this; + else if (_this === Sortable.active && putSortable) putSortable = null; // Animation if (fromSortable === _this) _this._ignoreWhileAnimating = target1; _this.animateAll(function() { - dragOverEvent('dragOverAnimationComplete'); + dragOverEvent("dragOverAnimationComplete"); _this._ignoreWhileAnimating = null; }); if (_this !== fromSortable) { @@ -6892,47 +6793,47 @@ Sortable.prototype = /** @lends Sortable.prototype */ { fromSortable._ignoreWhileAnimating = null; } } // Null lastTarget if it is not inside a previously swapped element - if (target1 === dragEl1 && !dragEl1.animated || target1 === el && !target1.animated) lastTarget = null; + if (target1 === dragEl && !dragEl.animated || target1 === el && !target1.animated) lastTarget = null; // no bubbling and not fallback if (!options.dragoverBubble && !evt.rootEl && target1 !== document) { - dragEl1.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted + dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted !insertion && nearestEmptyInsertDetectEvent(evt); } !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation(); return completedFired = true; } // Call when dragEl has been inserted function changed() { - newIndex1 = index1(dragEl1); - newDraggableIndex1 = index1(dragEl1, options.draggable); + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); _dispatchEvent({ sortable: _this, - name: 'change', + name: "change", toEl: el, - newIndex: newIndex1, - newDraggableIndex: newDraggableIndex1, + newIndex: newIndex, + newDraggableIndex: newDraggableIndex, originalEvent: evt }); } if (evt.preventDefault !== void 0) evt.cancelable && evt.preventDefault(); target1 = closest(target1, options.draggable, el, true); - dragOverEvent('dragOver'); + dragOverEvent("dragOver"); if (Sortable.eventCanceled) return completedFired; - if (dragEl1.contains(evt.target) || target1.animated && target1.animatingX && target1.animatingY || _this._ignoreWhileAnimating === target1) return completed(false); + if (dragEl.contains(evt.target) || target1.animated && target1.animatingX && target1.animatingY || _this._ignoreWhileAnimating === target1) return completed(false); ignoreNextClick = false; - if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl1 !== rootEl1) // Reverting item into the original list - : putSortable1 === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl1, evt)) && group.checkPut(this, activeSortable, dragEl1, evt))) { - vertical = this._getDirection(evt, target1) === 'vertical'; - dragRect = getRect(dragEl1); - dragOverEvent('dragOverValid'); + if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl // Reverting item into the original list + ) : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) { + vertical = this._getDirection(evt, target1) === "vertical"; + dragRect = getRect(dragEl); + dragOverEvent("dragOverValid"); if (Sortable.eventCanceled) return completedFired; if (revert) { - parentEl1 = rootEl1; // actualization + parentEl = rootEl; // actualization capture(); this._hideClone(); - dragOverEvent('revert'); + dragOverEvent("revert"); if (!Sortable.eventCanceled) { - if (nextEl) rootEl1.insertBefore(dragEl1, nextEl); - else rootEl1.appendChild(dragEl1); + if (nextEl) rootEl.insertBefore(dragEl, nextEl); + else rootEl.appendChild(dragEl); } return completed(true); } @@ -6940,33 +6841,35 @@ Sortable.prototype = /** @lends Sortable.prototype */ { if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) { // Insert to end of list // If already at end of list: Do not insert - if (elLastChild === dragEl1) return completed(false); + if (elLastChild === dragEl) return completed(false); // if there is a last element, it is the target if (elLastChild && el === evt.target) target1 = elLastChild; if (target1) targetRect = getRect(target1); - if (_onMove(rootEl1, el, dragEl1, dragRect, target1, targetRect, evt, !!target1) !== false) { + if (_onMove(rootEl, el, dragEl, dragRect, target1, targetRect, evt, !!target1) !== false) { capture(); - el.appendChild(dragEl1); - parentEl1 = el; // actualization + if (elLastChild && elLastChild.nextSibling) // the last draggable element is not the last node + el.insertBefore(dragEl, elLastChild.nextSibling); + else el.appendChild(dragEl); + parentEl = el; // actualization changed(); return completed(true); } } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) { // Insert to start of list var firstChild = getChild(el, 0, options, true); - if (firstChild === dragEl1) return completed(false); + if (firstChild === dragEl) return completed(false); target1 = firstChild; targetRect = getRect(target1); - if (_onMove(rootEl1, el, dragEl1, dragRect, target1, targetRect, evt, false) !== false) { + if (_onMove(rootEl, el, dragEl, dragRect, target1, targetRect, evt, false) !== false) { capture(); - el.insertBefore(dragEl1, firstChild); - parentEl1 = el; // actualization + el.insertBefore(dragEl, firstChild); + parentEl = el; // actualization changed(); return completed(true); } } else if (target1.parentNode === el) { targetRect = getRect(target1); - var direction = 0, targetBeforeFirstSwap, differentLevel = dragEl1.parentNode !== el, differentRowCol = !_dragElInRowColumn(dragEl1.animated && dragEl1.toRect || dragRect, target1.animated && target1.toRect || targetRect, vertical), side1 = vertical ? 'top' : 'left', scrolledPastTop = isScrolledPast(target1, 'top', 'top') || isScrolledPast(dragEl1, 'top', 'top'), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0; + var direction = 0, targetBeforeFirstSwap, differentLevel = dragEl.parentNode !== el, differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target1.animated && target1.toRect || targetRect, vertical), side1 = vertical ? "top" : "left", scrolledPastTop = isScrolledPast(target1, "top", "top") || isScrolledPast(dragEl, "top", "top"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0; if (lastTarget !== target1) { targetBeforeFirstSwap = targetRect[side1]; pastFirstInvertThresh = false; @@ -6976,65 +6879,65 @@ Sortable.prototype = /** @lends Sortable.prototype */ { var sibling; if (direction !== 0) { // Check if target is beside dragEl in respective direction (ignoring hidden elements) - var dragIndex = index1(dragEl1); + var dragIndex = index(dragEl); do { dragIndex -= direction; - sibling = parentEl1.children[dragIndex]; - }while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl)) + sibling = parentEl.children[dragIndex]; + }while (sibling && (css(sibling, "display") === "none" || sibling === ghostEl)); } // If dragEl is already beside target: Do not insert if (direction === 0 || sibling === target1) return completed(false); lastTarget = target1; lastDirection = direction; var nextSibling = target1.nextElementSibling, after1 = false; after1 = direction === 1; - var moveVector = _onMove(rootEl1, el, dragEl1, dragRect, target1, targetRect, evt, after1); + var moveVector = _onMove(rootEl, el, dragEl, dragRect, target1, targetRect, evt, after1); if (moveVector !== false) { if (moveVector === 1 || moveVector === -1) after1 = moveVector === 1; _silent = true; setTimeout(_unsilent, 30); capture(); - if (after1 && !nextSibling) el.appendChild(dragEl1); - else target1.parentNode.insertBefore(dragEl1, after1 ? nextSibling : target1); + if (after1 && !nextSibling) el.appendChild(dragEl); + else target1.parentNode.insertBefore(dragEl, after1 ? nextSibling : target1); // Undo chrome's scroll adjustment (has no effect on other browsers) if (scrolledPastTop) scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop); - parentEl1 = dragEl1.parentNode; // actualization + parentEl = dragEl.parentNode; // actualization // must be done before animation if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target1)[side1]); changed(); return completed(true); } } - if (el.contains(dragEl1)) return completed(false); + if (el.contains(dragEl)) return completed(false); } return false; }, _ignoreWhileAnimating: null, _offMoveEvents: function _offMoveEvents() { - off(document, 'mousemove', this._onTouchMove); - off(document, 'touchmove', this._onTouchMove); - off(document, 'pointermove', this._onTouchMove); - off(document, 'dragover', nearestEmptyInsertDetectEvent); - off(document, 'mousemove', nearestEmptyInsertDetectEvent); - off(document, 'touchmove', nearestEmptyInsertDetectEvent); + off(document, "mousemove", this._onTouchMove); + off(document, "touchmove", this._onTouchMove); + off(document, "pointermove", this._onTouchMove); + off(document, "dragover", nearestEmptyInsertDetectEvent); + off(document, "mousemove", nearestEmptyInsertDetectEvent); + off(document, "touchmove", nearestEmptyInsertDetectEvent); }, _offUpEvents: function _offUpEvents() { var ownerDocument = this.el.ownerDocument; - off(ownerDocument, 'mouseup', this._onDrop); - off(ownerDocument, 'touchend', this._onDrop); - off(ownerDocument, 'pointerup', this._onDrop); - off(ownerDocument, 'touchcancel', this._onDrop); - off(document, 'selectstart', this); + off(ownerDocument, "mouseup", this._onDrop); + off(ownerDocument, "touchend", this._onDrop); + off(ownerDocument, "pointerup", this._onDrop); + off(ownerDocument, "touchcancel", this._onDrop); + off(document, "selectstart", this); }, _onDrop: function _onDrop(/**Event*/ evt) { var el = this.el, options = this.options; // Get the index of the dragged element within its parent - newIndex1 = index1(dragEl1); - newDraggableIndex1 = index1(dragEl1, options.draggable); - pluginEvent('drop', this, { + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); + pluginEvent("drop", this, { evt: evt }); - parentEl1 = dragEl1 && dragEl1.parentNode; // Get again after plugin event - newIndex1 = index1(dragEl1); - newDraggableIndex1 = index1(dragEl1, options.draggable); + parentEl = dragEl && dragEl.parentNode; // Get again after plugin event + newIndex = index(dragEl); + newDraggableIndex = index(dragEl, options.draggable); if (Sortable.eventCanceled) { this._nulling(); return; @@ -7047,95 +6950,95 @@ Sortable.prototype = /** @lends Sortable.prototype */ { _cancelNextTick(this.cloneId); _cancelNextTick(this._dragStartId); // Unbind events if (this.nativeDraggable) { - off(document, 'drop', this); - off(el, 'dragstart', this._onDragStart); + off(document, "drop", this); + off(el, "dragstart", this._onDragStart); } this._offMoveEvents(); this._offUpEvents(); - if (Safari) css(document.body, 'user-select', ''); - css(dragEl1, 'transform', ''); + if (Safari) css(document.body, "user-select", ""); + css(dragEl, "transform", ""); if (evt) { if (moved) { evt.cancelable && evt.preventDefault(); !options.dropBubble && evt.stopPropagation(); } ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl); - if (rootEl1 === parentEl1 || putSortable1 && putSortable1.lastPutMode !== 'clone') // Remove clone(s) - cloneEl1 && cloneEl1.parentNode && cloneEl1.parentNode.removeChild(cloneEl1); - if (dragEl1) { - if (this.nativeDraggable) off(dragEl1, 'dragend', this); - _disableDraggable(dragEl1); - dragEl1.style['will-change'] = ''; // Remove classes + if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== "clone") // Remove clone(s) + cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl); + if (dragEl) { + if (this.nativeDraggable) off(dragEl, "dragend", this); + _disableDraggable(dragEl); + dragEl.style["will-change"] = ""; // Remove classes // ghostClass is added in dragStarted - if (moved && !awaitingDragStarted) toggleClass(dragEl1, putSortable1 ? putSortable1.options.ghostClass : this.options.ghostClass, false); - toggleClass(dragEl1, this.options.chosenClass, false); // Drag stop event + if (moved && !awaitingDragStarted) toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false); + toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event _dispatchEvent({ sortable: this, - name: 'unchoose', - toEl: parentEl1, + name: "unchoose", + toEl: parentEl, newIndex: null, newDraggableIndex: null, originalEvent: evt }); - if (rootEl1 !== parentEl1) { - if (newIndex1 >= 0) { + if (rootEl !== parentEl) { + if (newIndex >= 0) { // Add event _dispatchEvent({ - rootEl: parentEl1, - name: 'add', - toEl: parentEl1, - fromEl: rootEl1, + rootEl: parentEl, + name: "add", + toEl: parentEl, + fromEl: rootEl, originalEvent: evt }); // Remove event _dispatchEvent({ sortable: this, - name: 'remove', - toEl: parentEl1, + name: "remove", + toEl: parentEl, originalEvent: evt }); // drag from one list and drop into another _dispatchEvent({ - rootEl: parentEl1, - name: 'sort', - toEl: parentEl1, - fromEl: rootEl1, + rootEl: parentEl, + name: "sort", + toEl: parentEl, + fromEl: rootEl, originalEvent: evt }); _dispatchEvent({ sortable: this, - name: 'sort', - toEl: parentEl1, + name: "sort", + toEl: parentEl, originalEvent: evt }); } - putSortable1 && putSortable1.save(); + putSortable && putSortable.save(); } else { - if (newIndex1 !== oldIndex1) { - if (newIndex1 >= 0) { + if (newIndex !== oldIndex) { + if (newIndex >= 0) { // drag & drop within the same list _dispatchEvent({ sortable: this, - name: 'update', - toEl: parentEl1, + name: "update", + toEl: parentEl, originalEvent: evt }); _dispatchEvent({ sortable: this, - name: 'sort', - toEl: parentEl1, + name: "sort", + toEl: parentEl, originalEvent: evt }); } } } if (Sortable.active) { - /* jshint eqnull:true */ if (newIndex1 == null || newIndex1 === -1) { - newIndex1 = oldIndex1; - newDraggableIndex1 = oldDraggableIndex1; + /* jshint eqnull:true */ if (newIndex == null || newIndex === -1) { + newIndex = oldIndex; + newDraggableIndex = oldDraggableIndex; } _dispatchEvent({ sortable: this, - name: 'end', - toEl: parentEl1, + name: "end", + toEl: parentEl, originalEvent: evt }); // Save sorting this.save(); @@ -7145,8 +7048,8 @@ Sortable.prototype = /** @lends Sortable.prototype */ { this._nulling(); }, _nulling: function _nulling() { - pluginEvent('nulling', this); - rootEl1 = dragEl1 = parentEl1 = ghostEl = nextEl = cloneEl1 = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex1 = newDraggableIndex1 = oldIndex1 = oldDraggableIndex1 = lastTarget = lastDirection = putSortable1 = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null; + pluginEvent("nulling", this); + rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null; savedInputChecked.forEach(function(el) { el.checked = true; }); @@ -7154,25 +7057,25 @@ Sortable.prototype = /** @lends Sortable.prototype */ { }, handleEvent: function handleEvent(/**Event*/ evt) { switch(evt.type){ - case 'drop': - case 'dragend': + case "drop": + case "dragend": this._onDrop(evt); break; - case 'dragenter': - case 'dragover': - if (dragEl1) { + case "dragenter": + case "dragover": + if (dragEl) { this._onDragOver(evt); _globalDragOver(evt); } break; - case 'selectstart': + case "selectstart": evt.preventDefault(); break; } }, - /** - * Serializes the item into an array of string. - * @returns {String[]} + /** + * Serializes the item into an array of string. + * @returns {String[]} */ toArray: function toArray() { var order = [], el, children = this.el.children, i = 0, n = children.length, options = this.options; for(; i < n; i++){ @@ -7181,69 +7084,68 @@ Sortable.prototype = /** @lends Sortable.prototype */ { } return order; }, - /** - * Sorts the elements according to the array. - * @param {String[]} order order of the items + /** + * Sorts the elements according to the array. + * @param {String[]} order order of the items */ sort: function sort(order, useAnimation) { - var items = { - }, rootEl = this.el; + var items = {}, rootEl2 = this.el; this.toArray().forEach(function(id, i) { - var el = rootEl.children[i]; - if (closest(el, this.options.draggable, rootEl, false)) items[id] = el; + var el = rootEl2.children[i]; + if (closest(el, this.options.draggable, rootEl2, false)) items[id] = el; }, this); useAnimation && this.captureAnimationState(); order.forEach(function(id) { if (items[id]) { - rootEl.removeChild(items[id]); - rootEl.appendChild(items[id]); + rootEl2.removeChild(items[id]); + rootEl2.appendChild(items[id]); } }); useAnimation && this.animateAll(); }, - /** - * Save the current sorting + /** + * Save the current sorting */ save: function save() { var store = this.options.store; store && store.set && store.set(this); }, - /** - * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. - * @param {HTMLElement} el - * @param {String} [selector] default: `options.draggable` - * @returns {HTMLElement|null} + /** + * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. + * @param {HTMLElement} el + * @param {String} [selector] default: `options.draggable` + * @returns {HTMLElement|null} */ closest: function closest$1(el, selector) { return closest(el, selector || this.options.draggable, this.el, false); }, - /** - * Set/get option - * @param {string} name - * @param {*} [value] - * @returns {*} + /** + * Set/get option + * @param {string} name + * @param {*} [value] + * @returns {*} */ option: function option(name, value) { var options = this.options; if (value === void 0) return options[name]; else { var modifiedValue = PluginManager.modifyOption(this, name, value); - if (typeof modifiedValue !== 'undefined') options[name] = modifiedValue; + if (typeof modifiedValue !== "undefined") options[name] = modifiedValue; else options[name] = value; - if (name === 'group') _prepareGroup(options); + if (name === "group") _prepareGroup(options); } }, - /** - * Destroy + /** + * Destroy */ destroy: function destroy() { - pluginEvent('destroy', this); + pluginEvent("destroy", this); var el1 = this.el; el1[expando] = null; - off(el1, 'mousedown', this._onTapStart); - off(el1, 'touchstart', this._onTapStart); - off(el1, 'pointerdown', this._onTapStart); + off(el1, "mousedown", this._onTapStart); + off(el1, "touchstart", this._onTapStart); + off(el1, "pointerdown", this._onTapStart); if (this.nativeDraggable) { - off(el1, 'dragover', this); - off(el1, 'dragenter', this); + off(el1, "dragover", this); + off(el1, "dragenter", this); } // Remove draggable attributes - Array.prototype.forEach.call(el1.querySelectorAll('[draggable]'), function(el) { - el.removeAttribute('draggable'); + Array.prototype.forEach.call(el1.querySelectorAll("[draggable]"), function(el) { + el.removeAttribute("draggable"); }); this._onDrop(); this._disableDelayedDragEvents(); @@ -7252,47 +7154,47 @@ Sortable.prototype = /** @lends Sortable.prototype */ { }, _hideClone: function _hideClone() { if (!cloneHidden) { - pluginEvent('hideClone', this); + pluginEvent("hideClone", this); if (Sortable.eventCanceled) return; - css(cloneEl1, 'display', 'none'); - if (this.options.removeCloneOnHide && cloneEl1.parentNode) cloneEl1.parentNode.removeChild(cloneEl1); + css(cloneEl, "display", "none"); + if (this.options.removeCloneOnHide && cloneEl.parentNode) cloneEl.parentNode.removeChild(cloneEl); cloneHidden = true; } }, - _showClone: function _showClone(putSortable) { - if (putSortable.lastPutMode !== 'clone') { + _showClone: function _showClone(putSortable2) { + if (putSortable2.lastPutMode !== "clone") { this._hideClone(); return; } if (cloneHidden) { - pluginEvent('showClone', this); + pluginEvent("showClone", this); if (Sortable.eventCanceled) return; // show clone at dragEl or original position - if (dragEl1.parentNode == rootEl1 && !this.options.group.revertClone) rootEl1.insertBefore(cloneEl1, dragEl1); - else if (nextEl) rootEl1.insertBefore(cloneEl1, nextEl); - else rootEl1.appendChild(cloneEl1); - if (this.options.group.revertClone) this.animate(dragEl1, cloneEl1); - css(cloneEl1, 'display', ''); + if (dragEl.parentNode == rootEl && !this.options.group.revertClone) rootEl.insertBefore(cloneEl, dragEl); + else if (nextEl) rootEl.insertBefore(cloneEl, nextEl); + else rootEl.appendChild(cloneEl); + if (this.options.group.revertClone) this.animate(dragEl, cloneEl); + css(cloneEl, "display", ""); cloneHidden = false; } } }; function _globalDragOver(/**Event*/ evt) { - if (evt.dataTransfer) evt.dataTransfer.dropEffect = 'move'; + if (evt.dataTransfer) evt.dataTransfer.dropEffect = "move"; evt.cancelable && evt.preventDefault(); } -function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) { +function _onMove(fromEl, toEl, dragEl3, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) { var evt, sortable = fromEl[expando], onMoveFn = sortable.options.onMove, retVal; // Support for new CustomEvent feature - if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent('move', { + if (window.CustomEvent && !IE11OrLess && !Edge) evt = new CustomEvent("move", { bubbles: true, cancelable: true }); else { - evt = document.createEvent('Event'); - evt.initEvent('move', true, true); + evt = document.createEvent("Event"); + evt.initEvent("move", true, true); } evt.to = toEl; evt.from = fromEl; - evt.dragged = dragEl; + evt.dragged = dragEl3; evt.draggedRect = dragRect; evt.related = targetEl || toEl; evt.relatedRect = targetRect || getRect(toEl); @@ -7344,20 +7246,20 @@ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, inv } return 0; } -/** - * Gets the direction dragEl must be swapped relative to target in order to make it - * seem that dragEl has been "inserted" into that element's position - * @param {HTMLElement} target The target whose position dragEl is being inserted at - * @return {Number} Direction dragEl must be swapped +/** + * Gets the direction dragEl must be swapped relative to target in order to make it + * seem that dragEl has been "inserted" into that element's position + * @param {HTMLElement} target The target whose position dragEl is being inserted at + * @return {Number} Direction dragEl must be swapped */ function _getInsertDirection(target) { - if (index1(dragEl1) < index1(target)) return 1; + if (index(dragEl) < index(target)) return 1; else return -1; } -/** - * Generate id - * @param {HTMLElement} el - * @returns {String} - * @private +/** + * Generate id + * @param {HTMLElement} el + * @returns {String} + * @private */ function _generateId(el) { var str = el.tagName + el.className + el.src + el.href + el.textContent, i = str.length, sum = 0; while(i--)sum += str.charCodeAt(i); @@ -7365,7 +7267,7 @@ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, inv } function _saveInputCheckedState(root) { savedInputChecked.length = 0; - var inputs = root.getElementsByTagName('input'); + var inputs = root.getElementsByTagName("input"); var idx = inputs.length; while(idx--){ var el = inputs[idx]; @@ -7378,7 +7280,7 @@ function _nextTick(fn) { function _cancelNextTick(id) { return clearTimeout(id); } // Fixed #973: -if (documentExists) on(document, 'touchmove', function(evt) { +if (documentExists) on(document, "touchmove", function(evt) { if ((Sortable.active || awaitingDragStarted) && evt.cancelable) evt.preventDefault(); }); // Export utils @@ -7394,38 +7296,36 @@ Sortable.utils = { throttle: throttle, closest: closest, toggleClass: toggleClass, - clone: clone1, - index: index1, + clone: clone, + index: index, nextTick: _nextTick, cancelNextTick: _cancelNextTick, detectDirection: _detectDirection, getChild: getChild }; -/** - * Get the Sortable instance of an element - * @param {HTMLElement} element The element - * @return {Sortable|undefined} The instance of Sortable +/** + * Get the Sortable instance of an element + * @param {HTMLElement} element The element + * @return {Sortable|undefined} The instance of Sortable */ Sortable.get = function(element) { return element[expando]; }; -/** - * Mount a plugin to Sortable - * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted +/** + * Mount a plugin to Sortable + * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted */ Sortable.mount = function() { - for(var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++)plugins[_key] = arguments[_key]; - if (plugins[0].constructor === Array) plugins = plugins[0]; - plugins.forEach(function(plugin) { - if (!plugin.prototype || !plugin.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat(({ - }).toString.call(plugin)); - if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({ - }, Sortable.utils), plugin.utils); + for(var _len = arguments.length, plugins1 = new Array(_len), _key = 0; _key < _len; _key++)plugins1[_key] = arguments[_key]; + if (plugins1[0].constructor === Array) plugins1 = plugins1[0]; + plugins1.forEach(function(plugin) { + if (!plugin.prototype || !plugin.prototype.constructor) throw "Sortable: Mounted plugin must be a constructor function, not ".concat(({}).toString.call(plugin)); + if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils); PluginManager.mount(plugin); }); }; -/** - * Create sortable instance - * @param {HTMLElement} el - * @param {Object} [options] +/** + * Create sortable instance + * @param {HTMLElement} el + * @param {Object} [options] */ Sortable.create = function(el, options) { return new Sortable(el, options); }; // Export @@ -7440,16 +7340,16 @@ function AutoScrollPlugin() { scrollSpeed: 10, bubbleScroll: true }; // Bind all private methods - for(var fn in this)if (fn.charAt(0) === '_' && typeof this[fn] === 'function') this[fn] = this[fn].bind(this); + for(var fn in this)if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this); } AutoScroll.prototype = { dragStarted: function dragStarted(_ref) { var originalEvent = _ref.originalEvent; - if (this.sortable.nativeDraggable) on(document, 'dragover', this._handleAutoScroll); + if (this.sortable.nativeDraggable) on(document, "dragover", this._handleAutoScroll); else { - if (this.options.supportPointer) on(document, 'pointermove', this._handleFallbackAutoScroll); - else if (originalEvent.touches) on(document, 'touchmove', this._handleFallbackAutoScroll); - else on(document, 'mousemove', this._handleFallbackAutoScroll); + if (this.options.supportPointer) on(document, "pointermove", this._handleFallbackAutoScroll); + else if (originalEvent.touches) on(document, "touchmove", this._handleFallbackAutoScroll); + else on(document, "mousemove", this._handleFallbackAutoScroll); } }, dragOverCompleted: function dragOverCompleted(_ref2) { @@ -7458,11 +7358,11 @@ function AutoScrollPlugin() { if (!this.options.dragOverBubble && !originalEvent.rootEl) this._handleAutoScroll(originalEvent); }, drop: function drop() { - if (this.sortable.nativeDraggable) off(document, 'dragover', this._handleAutoScroll); + if (this.sortable.nativeDraggable) off(document, "dragover", this._handleAutoScroll); else { - off(document, 'pointermove', this._handleFallbackAutoScroll); - off(document, 'touchmove', this._handleFallbackAutoScroll); - off(document, 'mousemove', this._handleFallbackAutoScroll); + off(document, "pointermove", this._handleFallbackAutoScroll); + off(document, "touchmove", this._handleFallbackAutoScroll); + off(document, "mousemove", this._handleFallbackAutoScroll); } clearPointerElemChangedInterval(); clearAutoScrolls(); @@ -7483,7 +7383,7 @@ function AutoScrollPlugin() { // MACOS Safari does not have autoscroll, // Firefox and Chrome are good if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) { - autoScroll1(evt, this.options, elem, fallback); // Listener for pointer element change + autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change var ogElemScroller = getParentAutoScrollElement(elem, true); if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) { pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour @@ -7493,7 +7393,7 @@ function AutoScrollPlugin() { ogElemScroller = newElem; clearAutoScrolls(); } - autoScroll1(evt, _this.options, newElem, fallback); + autoScroll(evt, _this.options, newElem, fallback); }, 10); lastAutoScrollX = x; lastAutoScrollY = y; @@ -7504,52 +7404,51 @@ function AutoScrollPlugin() { clearAutoScrolls(); return; } - autoScroll1(evt, this.options, getParentAutoScrollElement(elem, false), false); + autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false); } } }; return _extends(AutoScroll, { - pluginName: 'scroll', + pluginName: "scroll", initializeByDefault: true }); } function clearAutoScrolls() { - autoScrolls.forEach(function(autoScroll) { - clearInterval(autoScroll.pid); + autoScrolls.forEach(function(autoScroll1) { + clearInterval(autoScroll1.pid); }); autoScrolls = []; } function clearPointerElemChangedInterval() { clearInterval(pointerElemChangedInterval); } -var autoScroll1 = throttle(function(evt, options, rootEl, isFallback) { +var autoScroll = throttle(function(evt, options, rootEl3, isFallback) { // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521 if (!options.scroll) return; var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = getWindowScrollingElement(); var scrollThisInstance = false, scrollCustomFn; // New scroll root, set scrollEl - if (scrollRootEl !== rootEl) { - scrollRootEl = rootEl; + if (scrollRootEl !== rootEl3) { + scrollRootEl = rootEl3; clearAutoScrolls(); scrollEl = options.scroll; scrollCustomFn = options.scrollFn; - if (scrollEl === true) scrollEl = getParentAutoScrollElement(rootEl, true); + if (scrollEl === true) scrollEl = getParentAutoScrollElement(rootEl3, true); } var layersOut = 0; var currentParent = scrollEl; do { var el = currentParent, rect = getRect(el), top = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop; if (el === winScroller) { - canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible'); - canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible'); + canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll" || elCSS.overflowX === "visible"); + canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll" || elCSS.overflowY === "visible"); } else { - canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll'); - canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll'); + canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll"); + canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll"); } var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX); var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY); if (!autoScrolls[layersOut]) { - for(var i = 0; i <= layersOut; i++)if (!autoScrolls[i]) autoScrolls[i] = { - }; + for(var i = 0; i <= layersOut; i++)if (!autoScrolls[i]) autoScrolls[i] = {}; } if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) { autoScrolls[layersOut].el = el; @@ -7563,8 +7462,8 @@ var autoScroll1 = throttle(function(evt, options, rootEl, isFallback) { if (isFallback && this.layer === 0) Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0; var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0; - if (typeof scrollCustomFn === 'function') { - if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') return; + if (typeof scrollCustomFn === "function") { + if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== "continue") return; } scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY); }).bind({ @@ -7573,74 +7472,72 @@ var autoScroll1 = throttle(function(evt, options, rootEl, isFallback) { } } layersOut++; - }while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false))) + }while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false))); scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not }, 30); var drop = function drop(_ref) { - var originalEvent = _ref.originalEvent, putSortable = _ref.putSortable, dragEl = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget; + var originalEvent = _ref.originalEvent, putSortable3 = _ref.putSortable, dragEl4 = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget; if (!originalEvent) return; - var toSortable = putSortable || activeSortable; + var toSortable = putSortable3 || activeSortable; hideGhostForTarget(); var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent; var target = document.elementFromPoint(touch.clientX, touch.clientY); unhideGhostForTarget(); if (toSortable && !toSortable.el.contains(target)) { - dispatchSortableEvent('spill'); + dispatchSortableEvent("spill"); this.onSpill({ - dragEl: dragEl, - putSortable: putSortable + dragEl: dragEl4, + putSortable: putSortable3 }); } }; -function Revert() { -} +function Revert() {} Revert.prototype = { startIndex: null, dragStart: function dragStart(_ref2) { - var oldDraggableIndex = _ref2.oldDraggableIndex; - this.startIndex = oldDraggableIndex; + var oldDraggableIndex2 = _ref2.oldDraggableIndex; + this.startIndex = oldDraggableIndex2; }, onSpill: function onSpill(_ref3) { - var dragEl = _ref3.dragEl, putSortable = _ref3.putSortable; + var dragEl5 = _ref3.dragEl, putSortable4 = _ref3.putSortable; this.sortable.captureAnimationState(); - if (putSortable) putSortable.captureAnimationState(); + if (putSortable4) putSortable4.captureAnimationState(); var nextSibling = getChild(this.sortable.el, this.startIndex, this.options); - if (nextSibling) this.sortable.el.insertBefore(dragEl, nextSibling); - else this.sortable.el.appendChild(dragEl); + if (nextSibling) this.sortable.el.insertBefore(dragEl5, nextSibling); + else this.sortable.el.appendChild(dragEl5); this.sortable.animateAll(); - if (putSortable) putSortable.animateAll(); + if (putSortable4) putSortable4.animateAll(); }, drop: drop }; _extends(Revert, { - pluginName: 'revertOnSpill' + pluginName: "revertOnSpill" }); -function Remove() { -} +function Remove() {} Remove.prototype = { onSpill: function onSpill(_ref4) { - var dragEl = _ref4.dragEl, putSortable = _ref4.putSortable; - var parentSortable = putSortable || this.sortable; + var dragEl6 = _ref4.dragEl, putSortable5 = _ref4.putSortable; + var parentSortable = putSortable5 || this.sortable; parentSortable.captureAnimationState(); - dragEl.parentNode && dragEl.parentNode.removeChild(dragEl); + dragEl6.parentNode && dragEl6.parentNode.removeChild(dragEl6); parentSortable.animateAll(); }, drop: drop }; _extends(Remove, { - pluginName: 'removeOnSpill' + pluginName: "removeOnSpill" }); var lastSwapEl; function SwapPlugin() { function Swap() { this.defaults = { - swapClass: 'sortable-swap-highlight' + swapClass: "sortable-swap-highlight" }; } Swap.prototype = { dragStart: function dragStart(_ref) { - var dragEl = _ref.dragEl; - lastSwapEl = dragEl; + var dragEl7 = _ref.dragEl; + lastSwapEl = dragEl7; }, dragOverValid: function dragOverValid(_ref2) { var completed = _ref2.completed, target = _ref2.target, onMove = _ref2.onMove, activeSortable = _ref2.activeSortable, changed = _ref2.changed, cancel = _ref2.cancel; @@ -7659,15 +7556,15 @@ function SwapPlugin() { cancel(); }, drop: function drop(_ref3) { - var activeSortable = _ref3.activeSortable, putSortable = _ref3.putSortable, dragEl = _ref3.dragEl; - var toSortable = putSortable || this.sortable; + var activeSortable = _ref3.activeSortable, putSortable6 = _ref3.putSortable, dragEl8 = _ref3.dragEl; + var toSortable = putSortable6 || this.sortable; var options = this.options; lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false); - if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) { - if (dragEl !== lastSwapEl) { + if (lastSwapEl && (options.swap || putSortable6 && putSortable6.options.swap)) { + if (dragEl8 !== lastSwapEl) { toSortable.captureAnimationState(); if (toSortable !== activeSortable) activeSortable.captureAnimationState(); - swapNodes(dragEl, lastSwapEl); + swapNodes(dragEl8, lastSwapEl); toSortable.animateAll(); if (toSortable !== activeSortable) activeSortable.animateAll(); } @@ -7678,7 +7575,7 @@ function SwapPlugin() { } }; return _extends(Swap, { - pluginName: 'swap', + pluginName: "swap", eventProperties: function eventProperties() { return { swapItem: lastSwapEl @@ -7689,8 +7586,8 @@ function SwapPlugin() { function swapNodes(n1, n2) { var p1 = n1.parentNode, p2 = n2.parentNode, i1, i2; if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return; - i1 = index1(n1); - i2 = index1(n2); + i1 = index(n1); + i2 = index(n2); if (p1.isEqualNode(p2) && i1 < i2) i2++; p1.insertBefore(n2, p1.children[i1]); p2.insertBefore(n1, p2.children[i2]); @@ -7702,24 +7599,27 @@ dragStarted = false, dragEl$1, clonesFromRect, clonesHidden; function MultiDragPlugin() { function MultiDrag(sortable) { // Bind all private methods - for(var fn in this)if (fn.charAt(0) === '_' && typeof this[fn] === 'function') this[fn] = this[fn].bind(this); - if (sortable.options.supportPointer) on(document, 'pointerup', this._deselectMultiDrag); - else { - on(document, 'mouseup', this._deselectMultiDrag); - on(document, 'touchend', this._deselectMultiDrag); + for(var fn in this)if (fn.charAt(0) === "_" && typeof this[fn] === "function") this[fn] = this[fn].bind(this); + if (!sortable.options.avoidImplicitDeselect) { + if (sortable.options.supportPointer) on(document, "pointerup", this._deselectMultiDrag); + else { + on(document, "mouseup", this._deselectMultiDrag); + on(document, "touchend", this._deselectMultiDrag); + } } - on(document, 'keydown', this._checkKeyDown); - on(document, 'keyup', this._checkKeyUp); + on(document, "keydown", this._checkKeyDown); + on(document, "keyup", this._checkKeyUp); this.defaults = { - selectedClass: 'sortable-selected', + selectedClass: "sortable-selected", multiDragKey: null, - setData: function setData(dataTransfer, dragEl) { - var data = ''; + avoidImplicitDeselect: false, + setData: function setData(dataTransfer, dragEl9) { + var data = ""; if (multiDragElements.length && multiDragSortable === sortable) multiDragElements.forEach(function(multiDragElement, i) { - data += (!i ? '' : ', ') + multiDragElement.textContent; + data += (!i ? "" : ", ") + multiDragElement.textContent; }); - else data = dragEl.textContent; - dataTransfer.setData('Text', data); + else data = dragEl9.textContent; + dataTransfer.setData("Text", data); } }; } @@ -7737,10 +7637,10 @@ function MultiDragPlugin() { var sortable = _ref2.sortable, cancel = _ref2.cancel; if (!this.isMultiDrag) return; for(var i = 0; i < multiDragElements.length; i++){ - multiDragClones.push(clone1(multiDragElements[i])); + multiDragClones.push(clone(multiDragElements[i])); multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex; multiDragClones[i].draggable = false; - multiDragClones[i].style['will-change'] = ''; + multiDragClones[i].style["will-change"] = ""; toggleClass(multiDragClones[i], this.options.selectedClass, false); multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false); } @@ -7748,22 +7648,22 @@ function MultiDragPlugin() { cancel(); }, clone: function clone(_ref3) { - var sortable = _ref3.sortable, rootEl = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel; + var sortable = _ref3.sortable, rootEl4 = _ref3.rootEl, dispatchSortableEvent = _ref3.dispatchSortableEvent, cancel = _ref3.cancel; if (!this.isMultiDrag) return; if (!this.options.removeCloneOnHide) { if (multiDragElements.length && multiDragSortable === sortable) { - insertMultiDragClones(true, rootEl); - dispatchSortableEvent('clone'); + insertMultiDragClones(true, rootEl4); + dispatchSortableEvent("clone"); cancel(); } } }, showClone: function showClone(_ref4) { - var cloneNowShown = _ref4.cloneNowShown, rootEl = _ref4.rootEl, cancel = _ref4.cancel; + var cloneNowShown = _ref4.cloneNowShown, rootEl5 = _ref4.rootEl, cancel = _ref4.cancel; if (!this.isMultiDrag) return; - insertMultiDragClones(false, rootEl); - multiDragClones.forEach(function(clone) { - css(clone, 'display', ''); + insertMultiDragClones(false, rootEl5); + multiDragClones.forEach(function(clone1) { + css(clone1, "display", ""); }); cloneNowShown(); clonesHidden = false; @@ -7773,9 +7673,9 @@ function MultiDragPlugin() { var _this = this; var sortable = _ref5.sortable, cloneNowHidden = _ref5.cloneNowHidden, cancel = _ref5.cancel; if (!this.isMultiDrag) return; - multiDragClones.forEach(function(clone) { - css(clone, 'display', 'none'); - if (_this.options.removeCloneOnHide && clone.parentNode) clone.parentNode.removeChild(clone); + multiDragClones.forEach(function(clone2) { + css(clone2, "display", "none"); + if (_this.options.removeCloneOnHide && clone2.parentNode) clone2.parentNode.removeChild(clone2); }); cloneNowHidden(); clonesHidden = true; @@ -7785,7 +7685,7 @@ function MultiDragPlugin() { var sortable = _ref6.sortable; if (!this.isMultiDrag && multiDragSortable) multiDragSortable.multiDrag._deselectMultiDrag(); multiDragElements.forEach(function(multiDragElement) { - multiDragElement.sortableIndex = index1(multiDragElement); + multiDragElement.sortableIndex = index(multiDragElement); }); // Sort multi-drag elements multiDragElements = multiDragElements.sort(function(a, b) { return a.sortableIndex - b.sortableIndex; @@ -7807,7 +7707,7 @@ function MultiDragPlugin() { if (this.options.animation) { multiDragElements.forEach(function(multiDragElement) { if (multiDragElement === dragEl$1) return; - css(multiDragElement, 'position', 'absolute'); + css(multiDragElement, "position", "absolute"); }); var dragRect = getRect(dragEl$1, false, true, true); multiDragElements.forEach(function(multiDragElement) { @@ -7836,7 +7736,7 @@ function MultiDragPlugin() { } }, revert: function revert(_ref9) { - var fromSortable = _ref9.fromSortable, rootEl = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect; + var fromSortable = _ref9.fromSortable, rootEl6 = _ref9.rootEl, sortable = _ref9.sortable, dragRect = _ref9.dragRect; if (multiDragElements.length > 1) { // Setup unfold animation multiDragElements.forEach(function(multiDragElement) { @@ -7849,24 +7749,24 @@ function MultiDragPlugin() { fromSortable.removeAnimationState(multiDragElement); }); folding = false; - insertMultiDragElements(!this.options.removeCloneOnHide, rootEl); + insertMultiDragElements(!this.options.removeCloneOnHide, rootEl6); } }, dragOverCompleted: function dragOverCompleted(_ref10) { - var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl = _ref10.parentEl, putSortable = _ref10.putSortable; + var sortable = _ref10.sortable, isOwner = _ref10.isOwner, insertion = _ref10.insertion, activeSortable = _ref10.activeSortable, parentEl1 = _ref10.parentEl, putSortable7 = _ref10.putSortable; var options = this.options; if (insertion) { // Clones must be hidden before folding animation to capture dragRectAbsolute properly if (isOwner) activeSortable._hideClone(); initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location - if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) { + if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable7)) { // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible var dragRectAbsolute = getRect(dragEl$1, false, true, true); multiDragElements.forEach(function(multiDragElement) { if (multiDragElement === dragEl$1) return; setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted // while folding, and so that we can capture them again because old sortable will no longer be fromSortable - parentEl.appendChild(multiDragElement); + parentEl1.appendChild(multiDragElement); }); folding = true; } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out @@ -7876,13 +7776,13 @@ function MultiDragPlugin() { if (multiDragElements.length > 1) { var clonesHiddenBefore = clonesHidden; activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden - if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) multiDragClones.forEach(function(clone) { + if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) multiDragClones.forEach(function(clone3) { activeSortable.addAnimationState({ - target: clone, + target: clone3, rect: clonesFromRect }); - clone.fromRect = clonesFromRect; - clone.thisAnimationDuration = null; + clone3.fromRect = clonesFromRect; + clone3.thisAnimationDuration = null; }); } else activeSortable._showClone(sortable); } @@ -7894,8 +7794,7 @@ function MultiDragPlugin() { multiDragElement.thisAnimationDuration = null; }); if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) { - clonesFromRect = _extends({ - }, dragRect); + clonesFromRect = _extends({}, dragRect); var dragMatrix = matrix(dragEl$1, true); clonesFromRect.top -= dragMatrix.f; clonesFromRect.left -= dragMatrix.e; @@ -7908,10 +7807,10 @@ function MultiDragPlugin() { } }, drop: function drop(_ref12) { - var evt = _ref12.originalEvent, rootEl = _ref12.rootEl, parentEl = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex = _ref12.oldIndex, putSortable = _ref12.putSortable; - var toSortable = putSortable || this.sortable; + var evt = _ref12.originalEvent, rootEl7 = _ref12.rootEl, parentEl2 = _ref12.parentEl, sortable = _ref12.sortable, dispatchSortableEvent = _ref12.dispatchSortableEvent, oldIndex2 = _ref12.oldIndex, putSortable8 = _ref12.putSortable; + var toSortable = putSortable8 || this.sortable; if (!evt) return; - var options = this.options, children = parentEl.children; // Multi-drag selection + var options = this.options, children = parentEl2.children; // Multi-drag selection if (!dragStarted) { if (options.multiDragKey && !this.multiDragKeyDown) this._deselectMultiDrag(); toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1)); @@ -7919,13 +7818,13 @@ function MultiDragPlugin() { multiDragElements.push(dragEl$1); dispatchEvent({ sortable: sortable, - rootEl: rootEl, - name: 'select', + rootEl: rootEl7, + name: "select", targetEl: dragEl$1, - originalEvt: evt + originalEvent: evt }); // Modifier activated, select from last to dragEl if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) { - var lastIndex = index1(lastMultiDragSelect), currentIndex = index1(dragEl$1); + var lastIndex = index(lastMultiDragSelect), currentIndex = index(dragEl$1); if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) { // Must include lastMultiDragSelect (select it), in case modified selection from no selection // (but previous selection existed) @@ -7943,10 +7842,10 @@ function MultiDragPlugin() { multiDragElements.push(children[i]); dispatchEvent({ sortable: sortable, - rootEl: rootEl, - name: 'select', + rootEl: rootEl7, + name: "select", targetEl: children[i], - originalEvt: evt + originalEvent: evt }); } } @@ -7957,17 +7856,17 @@ function MultiDragPlugin() { lastMultiDragSelect = null; dispatchEvent({ sortable: sortable, - rootEl: rootEl, - name: 'deselect', + rootEl: rootEl7, + name: "deselect", targetEl: dragEl$1, - originalEvt: evt + originalEvent: evt }); } } // Multi-drag drop if (dragStarted && this.isMultiDrag) { folding = false; // Do not "unfold" after around dragEl if reverted - if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) { - var dragRect = getRect(dragEl$1), multiDragIndex = index1(dragEl$1, ':not(.' + this.options.selectedClass + ')'); + if ((parentEl2[expando].options.sort || parentEl2 !== rootEl7) && multiDragElements.length > 1) { + var dragRect = getRect(dragEl$1), multiDragIndex = index(dragEl$1, ":not(." + this.options.selectedClass + ")"); if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null; toSortable.captureAnimationState(); if (!initialFolding) { @@ -7988,21 +7887,21 @@ function MultiDragPlugin() { // properly they must all be removed removeMultiDragElements(); multiDragElements.forEach(function(multiDragElement) { - if (children[multiDragIndex]) parentEl.insertBefore(multiDragElement, children[multiDragIndex]); - else parentEl.appendChild(multiDragElement); + if (children[multiDragIndex]) parentEl2.insertBefore(multiDragElement, children[multiDragIndex]); + else parentEl2.appendChild(multiDragElement); multiDragIndex++; }); // If initial folding is done, the elements may have changed position because they are now // unfolding around dragEl, even though dragEl may not have his index changed, so update event // must be fired here as Sortable will not. - if (oldIndex === index1(dragEl$1)) { + if (oldIndex2 === index(dragEl$1)) { var update = false; multiDragElements.forEach(function(multiDragElement) { - if (multiDragElement.sortableIndex !== index1(multiDragElement)) { + if (multiDragElement.sortableIndex !== index(multiDragElement)) { update = true; return; } }); - if (update) dispatchSortableEvent('update'); + if (update) dispatchSortableEvent("update"); } } // Must be done after capturing individual rects (scroll bar) multiDragElements.forEach(function(multiDragElement) { @@ -8012,8 +7911,8 @@ function MultiDragPlugin() { } multiDragSortable = toSortable; } // Remove clones if necessary - if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') multiDragClones.forEach(function(clone) { - clone.parentNode && clone.parentNode.removeChild(clone); + if (rootEl7 === parentEl2 || putSortable8 && putSortable8.lastPutMode !== "clone") multiDragClones.forEach(function(clone4) { + clone4.parentNode && clone4.parentNode.removeChild(clone4); }); }, nullingGlobal: function nullingGlobal() { @@ -8022,11 +7921,11 @@ function MultiDragPlugin() { }, destroyGlobal: function destroyGlobal() { this._deselectMultiDrag(); - off(document, 'pointerup', this._deselectMultiDrag); - off(document, 'mouseup', this._deselectMultiDrag); - off(document, 'touchend', this._deselectMultiDrag); - off(document, 'keydown', this._checkKeyDown); - off(document, 'keyup', this._checkKeyUp); + off(document, "pointerup", this._deselectMultiDrag); + off(document, "mouseup", this._deselectMultiDrag); + off(document, "touchend", this._deselectMultiDrag); + off(document, "keydown", this._checkKeyDown); + off(document, "keyup", this._checkKeyUp); }, _deselectMultiDrag: function _deselectMultiDrag(evt) { if (typeof dragStarted !== "undefined" && dragStarted) return; // Only deselect if selection is in this sortable @@ -8040,9 +7939,9 @@ function MultiDragPlugin() { dispatchEvent({ sortable: this.sortable, rootEl: this.sortable.el, - name: 'deselect', + name: "deselect", targetEl: el, - originalEvt: evt + originalEvent: evt }); } }, @@ -8055,11 +7954,11 @@ function MultiDragPlugin() { }; return _extends(MultiDrag, { // Static methods & properties - pluginName: 'multiDrag', + pluginName: "multiDrag", utils: { - /** - * Selects the provided multi-drag item - * @param {HTMLElement} el The element to be selected + /** + * Selects the provided multi-drag item + * @param {HTMLElement} el The element to be selected */ select: function select(el) { var sortable = el.parentNode[expando]; if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return; @@ -8070,14 +7969,14 @@ function MultiDragPlugin() { toggleClass(el, sortable.options.selectedClass, true); multiDragElements.push(el); }, - /** - * Deselects the provided multi-drag item - * @param {HTMLElement} el The element to be deselected + /** + * Deselects the provided multi-drag item + * @param {HTMLElement} el The element to be deselected */ deselect: function deselect(el) { - var sortable = el.parentNode[expando], index = multiDragElements.indexOf(el); - if (!sortable || !sortable.options.multiDrag || !~index) return; + var sortable = el.parentNode[expando], index2 = multiDragElements.indexOf(el); + if (!sortable || !sortable.options.multiDrag || !~index2) return; toggleClass(el, sortable.options.selectedClass, false); - multiDragElements.splice(index, 1); + multiDragElements.splice(index2, 1); } }, eventProperties: function eventProperties() { @@ -8088,13 +7987,13 @@ function MultiDragPlugin() { multiDragElement: multiDragElement, index: multiDragElement.sortableIndex }); // multiDragElements will already be sorted if folding - var newIndex; - if (folding && multiDragElement !== dragEl$1) newIndex = -1; - else if (folding) newIndex = index1(multiDragElement, ':not(.' + _this3.options.selectedClass + ')'); - else newIndex = index1(multiDragElement); + var newIndex2; + if (folding && multiDragElement !== dragEl$1) newIndex2 = -1; + else if (folding) newIndex2 = index(multiDragElement, ":not(." + _this3.options.selectedClass + ")"); + else newIndex2 = index(multiDragElement); newIndicies.push({ multiDragElement: multiDragElement, - index: newIndex + index: newIndex2 }); }); return { @@ -8107,29 +8006,29 @@ function MultiDragPlugin() { optionListeners: { multiDragKey: function multiDragKey(key) { key = key.toLowerCase(); - if (key === 'ctrl') key = 'Control'; + if (key === "ctrl") key = "Control"; else if (key.length > 1) key = key.charAt(0).toUpperCase() + key.substr(1); return key; } } }); } -function insertMultiDragElements(clonesInserted, rootEl) { +function insertMultiDragElements(clonesInserted, rootEl8) { multiDragElements.forEach(function(multiDragElement, i) { - var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)]; - if (target) rootEl.insertBefore(multiDragElement, target); - else rootEl.appendChild(multiDragElement); + var target = rootEl8.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)]; + if (target) rootEl8.insertBefore(multiDragElement, target); + else rootEl8.appendChild(multiDragElement); }); } -/** - * Insert multi-drag clones - * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted - * @param {HTMLElement} rootEl - */ function insertMultiDragClones(elementsInserted, rootEl) { - multiDragClones.forEach(function(clone, i) { - var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)]; - if (target) rootEl.insertBefore(clone, target); - else rootEl.appendChild(clone); +/** + * Insert multi-drag clones + * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted + * @param {HTMLElement} rootEl + */ function insertMultiDragClones(elementsInserted, rootEl9) { + multiDragClones.forEach(function(clone5, i) { + var target = rootEl9.children[clone5.sortableIndex + (elementsInserted ? Number(i) : 0)]; + if (target) rootEl9.insertBefore(clone5, target); + else rootEl9.appendChild(clone5); }); } function removeMultiDragElements() { @@ -8142,7 +8041,7 @@ Sortable.mount(new AutoScrollPlugin()); Sortable.mount(Remove, Revert); exports.default = Sortable; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"js2Fi":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"4SQpj":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _settingsActions = require("../actions/SettingsActions"); @@ -8156,7 +8055,7 @@ var _mailer = require("../actions/Mailer"); var _mailerDefault = parcelHelpers.interopDefault(_mailer); var _notifications = require("../ui/Notifications"); var _notificationsDefault = parcelHelpers.interopDefault(_notifications); -const notify = new _notificationsDefault.default(); +const notify = new (0, _notificationsDefault.default)(); class SettingsIndex { //-------------------------- // constructor @@ -8164,22 +8063,20 @@ class SettingsIndex { constructor(){ this.processing = false; this.start(); - this.admin = new _fipamoAdminAPIDefault.default(null); - this.mm = new _maintenanceManagerDefault.default(null, null); + this.admin = new (0, _fipamoAdminAPIDefault.default)(null); + this.mm = new (0, _maintenanceManagerDefault.default)(null, null); } // methods //-------------------------- start() { let self = this; //handle save button - document.getElementById("save-toggle").addEventListener("click", ()=>new _settingsActionsDefault.default().getInfo().then((data)=>{ + document.getElementById("save-toggle").addEventListener("click", ()=>new (0, _settingsActionsDefault.default)().getInfo().then((data)=>{ notify.alert("Saving Settings", null); - self.admin.sync(_fipamoAdminAPI.TASK_SYNC_SETTNIGS, data).then((r)=>{ + self.admin.sync((0, _fipamoAdminAPI.TASK_SYNC_SETTNIGS), data).then((r)=>{ if (r.type == _dataEvent.SETTINGS_UPDATED) notify.alert(r.message, true); else notify.alert(r.message, true); }); - }).catch(()=>{ - }) - ); //handle set up image uploads + }).catch(()=>{})); //handle set up image uploads document.getElementById("avatar").addEventListener("click", ()=>{ document.getElementById("avatar-upload").click(); }); @@ -8218,24 +8115,17 @@ class SettingsIndex { dynamicRenderStatus.innerHTML = "STATIC PAGE RENDERING"; } }); - document.getElementById("send-mail").addEventListener("click", (e)=>this.handleMailer(e) - ); - document.getElementById("publish-pages").addEventListener("click", (e)=>this.handlePublished(e) - ); //handle page render on save toggle - document.getElementById("render-toggle").addEventListener("click", (e)=>this.toggleRender(e) - ); - document.getElementById("render-toggle-icon").addEventListener("click", (e)=>this.toggleRender(e) - ); //handle theme toggle + document.getElementById("send-mail").addEventListener("click", (e)=>this.handleMailer(e)); + document.getElementById("publish-pages").addEventListener("click", (e)=>this.handlePublished(e)); //handle page render on save toggle + document.getElementById("render-toggle").addEventListener("click", (e)=>this.toggleRender(e)); + document.getElementById("render-toggle-icon").addEventListener("click", (e)=>this.toggleRender(e)); //handle theme toggle let themeBtns = document.querySelectorAll(".theme-select"); - for(var i = 0, length = themeBtns.length; i < length; i++)themeBtns[i].addEventListener("click", (e)=>this.handleThemes(e) - ); + for(var i = 0, length = themeBtns.length; i < length; i++)themeBtns[i].addEventListener("click", (e)=>this.handleThemes(e)); //handle mail options let mailBtn = document.querySelectorAll(".mail-option"); - for(i = 0, length = mailBtn.length; i < length; i++)mailBtn[i].addEventListener("click", (e)=>this.handleMailOptions(e) - ); + for(i = 0, length = mailBtn.length; i < length; i++)mailBtn[i].addEventListener("click", (e)=>this.handleMailOptions(e)); //handle backup from settings [disabled] - document.getElementById("create-backup").addEventListener("click", (e)=>this.handleBackup(e) - ); + document.getElementById("create-backup").addEventListener("click", (e)=>this.handleBackup(e)); /* document .getElementById("reindex-pages") @@ -8254,35 +8144,35 @@ class SettingsIndex { e.target.innerHTML = "SITE IS PRIVATE"; } } - toggleRender(e1) { - e1.stopPropagation(); - e1.preventDefault(); + toggleRender(e) { + e.stopPropagation(); + e.preventDefault(); let button = document.getElementById("render-toggle"); if (button.getAttribute("data-render") == "false") button.setAttribute("data-render", "true"); //e.target.innerHTML = 'RENDER PAGES ON SAVE'; else button.setAttribute("data-render", "false"); //e.target.innerHTML = "DON'T RENDER PAGES ON SAVE"; } handleMailer() { - let mailer = new _mailerDefault.default(); + let mailer = new (0, _mailerDefault.default)(); mailer.testMail(); //mailer.sendMail(); } - handleThemes(e2) { - e2.stopPropagation(); - e2.preventDefault(); + handleThemes(e) { + e.stopPropagation(); + e.preventDefault(); let themes = document.querySelectorAll(".theme-select"); - for(var i = 0, length = themes.length; i < length; i++)e2.target.id == themes[i].id ? themes[i].setAttribute("data-enabled", "true") : themes[i].setAttribute("data-enabled", "false"); + for(var i = 0, length = themes.length; i < length; i++)e.target.id == themes[i].id ? themes[i].setAttribute("data-enabled", "true") : themes[i].setAttribute("data-enabled", "false"); } - handleMailOptions(e3) { - e3.preventDefault(); - e3.stopPropagation(); + handleMailOptions(e) { + e.preventDefault(); + e.stopPropagation(); let smtp = document.getElementById("mail-smtp"); let mailgun = document.getElementById("mail-mg"); let mail = document.querySelectorAll(".mail-option"); - for(var i = 0, length = mail.length; i < length; i++)if (e3.target.id == mail[i].id) { + for(var i = 0, length = mail.length; i < length; i++)if (e.target.id == mail[i].id) { mail[i].setAttribute("data-enabled", "true"); - if (e3.target.id == "option-smtp") { + if (e.target.id == "option-smtp") { smtp.setAttribute("data-enabled", "true"); mailgun.setAttribute("data-enabled", "false"); - } else if (e3.target.id == "option-none") { + } else if (e.target.id == "option-none") { smtp.setAttribute("data-enabled", "false"); mailgun.setAttribute("data-enabled", "false"); } else { @@ -8301,13 +8191,12 @@ class SettingsIndex { notify.alert(r.message, true); document.getElementById("background").src = r.url; } - }).catch(()=>{ - }); + }).catch(()=>{}); } - handlePublished(e4) { + handlePublished(e) { if (this.processing) return; - e4.preventDefault(); - e4.stopPropagation(); + e.preventDefault(); + e.stopPropagation(); let self = this; let task = { task: "PUBLISH_ALL" @@ -8322,9 +8211,9 @@ class SettingsIndex { notify.alert(err, false); }); } - handleBackup(e5) { - e5.preventDefault(); - e5.stopPropagation(); + handleBackup(e) { + e.preventDefault(); + e.stopPropagation(); notify.alert("Creating backup", null); this.mm.backup().then((r)=>{ notify.alert(r.message, true); @@ -8332,11 +8221,11 @@ class SettingsIndex { notify.alert(err, false); }); } - handleReindex(e6) { + handleReindex(e) { if (this.processing) return; let self = this; - e6.preventDefault(); - e6.stopPropagation(); + e.preventDefault(); + e.stopPropagation(); let task = { task: "cleanup pages indexes" }; @@ -8353,15 +8242,14 @@ class SettingsIndex { } exports.default = SettingsIndex; -},{"../actions/SettingsActions":"1wxe0","./MaintenanceManager":"kY7L1","../../libraries/FipamoAdminAPI":"6M96o","../../../src/com/events/DataEvent":"edzJV","../actions/Mailer":"hoAIx","../ui/Notifications":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"1wxe0":[function(require,module,exports) { +},{"../actions/SettingsActions":"dwGCY","./MaintenanceManager":"cYXLM","../../libraries/FipamoAdminAPI":"3dcvg","../../../src/com/events/DataEvent":"hCRFh","../actions/Mailer":"kqgKI","../ui/Notifications":"9GRdG","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"dwGCY":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); class SettingsActions { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- getInfo() { @@ -8422,27 +8310,26 @@ class SettingsActions { } exports.default = SettingsActions; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"hoAIx":[function(require,module,exports) { +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"kqgKI":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _fipamoAdminAPI = require("../../libraries/FipamoAdminAPI"); var _fipamoAdminAPIDefault = parcelHelpers.interopDefault(_fipamoAdminAPI); var _notifications = require("../ui/Notifications"); var _notificationsDefault = parcelHelpers.interopDefault(_notifications); -const notify = new _notificationsDefault.default(); +const notify = new (0, _notificationsDefault.default)(); class Mailer { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- sendMail() { let mailData = { content: "This is a test email" }; - let admin = new _fipamoAdminAPIDefault.default(); + let admin = new (0, _fipamoAdminAPIDefault.default)(); admin.sendMail(mailData).then((result)=>{ notify.alert(result.message, true); }).catch((err)=>{ @@ -8454,7 +8341,7 @@ class Mailer { content: "This is a test email", mail_task: "TESTING" }; - let admin = new _fipamoAdminAPIDefault.default(); + let admin = new (0, _fipamoAdminAPIDefault.default)(); admin.sendMail(mailData).then((result)=>{ notify.alert(result.message, true); }).catch((err)=>{ @@ -8464,7 +8351,7 @@ class Mailer { } exports.default = Mailer; -},{"../../libraries/FipamoAdminAPI":"6M96o","../ui/Notifications":"fmUxI","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"9sqHb":[function(require,module,exports) { +},{"../../libraries/FipamoAdminAPI":"3dcvg","../ui/Notifications":"9GRdG","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"6S99f":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); var _fipamoAdminAPI = require("../../libraries/FipamoAdminAPI"); @@ -8476,14 +8363,14 @@ var _notifications = require("../ui/Notifications"); var _notificationsDefault = parcelHelpers.interopDefault(_notifications); var _sortablejs = require("sortablejs"); var _sortablejsDefault = parcelHelpers.interopDefault(_sortablejs); -const notify = new _notificationsDefault.default(); +const notify = new (0, _notificationsDefault.default)(); class NavIndex { //-------------------------- // constructor //-------------------------- constructor(){ this.processing = false; - this.admin = new _fipamoAdminAPIDefault.default(null); + this.admin = new (0, _fipamoAdminAPIDefault.default)(null); this.start(); } // methods @@ -8491,60 +8378,58 @@ class NavIndex { start() { //grabs elements and makes them sortables let self = this; - _sortablejsDefault.default.create(document.getElementById('nav-pages'), { + (0, _sortablejsDefault.default).create(document.getElementById("nav-pages"), { onUpdate: ()=>{ - new _navActionsDefault.default().syncMenu().then((data)=>{ - notify.alert('Updating Menu', null); - self.admin.sync(_fipamoAdminAPI.TASK_SYNC_NAV, data).then((r)=>{ + new (0, _navActionsDefault.default)().syncMenu().then((data)=>{ + notify.alert("Updating Menu", null); + self.admin.sync((0, _fipamoAdminAPI.TASK_SYNC_NAV), data).then((r)=>{ if (r.type == _dataEvent.MENU_UPDATED) notify.alert(r.message, true); else notify.alert(r.message, true); }); }); } }); - var nav = document.querySelectorAll('.nav-btn'); - for(var i = 0, length = nav.length; i < length; i++)nav[i].addEventListener('click', (e)=>this.handleNavButton(e) - , false); + var nav = document.querySelectorAll(".nav-btn"); + for(var i = 0, length = nav.length; i < length; i++)nav[i].addEventListener("click", (e)=>this.handleNavButton(e), false); } // event handlers //-------------------------- handleNavButton(e) { if (this.processing) return; - let id = ''; + let id = ""; let self = this; switch(e.target.id){ - case 'remove-item': - id = e.target.getAttribute('data-id'); - new _navActionsDefault.default().removeItem(id); - new _navActionsDefault.default().syncMenu().then((data)=>{ - data.remove = e.target.getAttribute('data-uuid'); - notify.alert('Editing Menu', null); + case "remove-item": + id = e.target.getAttribute("data-id"); + new (0, _navActionsDefault.default)().removeItem(id); + new (0, _navActionsDefault.default)().syncMenu().then((data)=>{ + data.remove = e.target.getAttribute("data-uuid"); + notify.alert("Editing Menu", null); self.processing = true; - self.admin.sync(_fipamoAdminAPI.TASK_SYNC_NAV, data).then((r)=>{ + self.admin.sync((0, _fipamoAdminAPI.TASK_SYNC_NAV), data).then((r)=>{ self.processing = false; if (r.type == _dataEvent.MENU_UPDATED) notify.alert(r.message, true); else notify.alert(r.message, true); }); }); break; - case 'edit-item': + case "edit-item": self.processing = false; - window.location = '/dashboard/page/edit/' + e.target.getAttribute('data-id'); + window.location = "/dashboard/page/edit/" + e.target.getAttribute("data-id"); break; } } } exports.default = NavIndex; -},{"../../libraries/FipamoAdminAPI":"6M96o","../actions/NavActions":"3Mi5a","../events/DataEvent":"edzJV","../ui/Notifications":"fmUxI","sortablejs":"fLJM6","@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}],"3Mi5a":[function(require,module,exports) { +},{"../../libraries/FipamoAdminAPI":"3dcvg","../actions/NavActions":"cBQfD","../events/DataEvent":"hCRFh","../ui/Notifications":"9GRdG","sortablejs":"4mik1","@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}],"cBQfD":[function(require,module,exports) { var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); parcelHelpers.defineInteropFlag(exports); class NavActions { //-------------------------- // constructor //-------------------------- - constructor(){ - } + constructor(){} // methods //-------------------------- syncMenu() { @@ -8571,6 +8456,6 @@ class NavActions { } exports.default = NavActions; -},{"@parcel/transformer-js/src/esmodule-helpers.js":"ciiiV"}]},["jRsG2","bEyX8"], "bEyX8", "parcelRequiredac0") +},{"@parcel/transformer-js/src/esmodule-helpers.js":"gkKU3"}]},["hHepG","7bZzU"], "7bZzU", "parcelRequiredac0") //# sourceMappingURL=Start.js.map diff --git a/src/com/actions/PageActions.js b/src/com/actions/PageActions.js index 9399a5e..7ef79cd 100644 --- a/src/com/actions/PageActions.js +++ b/src/com/actions/PageActions.js @@ -10,6 +10,7 @@ export default class PostActions { collectInfo(files) { return new Promise((resolve, reject) => { let pageInfo = new FormData(); + pageInfo.enctype = 'multipart/form-data'; let txt = document.createElement('textarea'); txt.innerHTML = document.getElementById('highlight-content').innerHTML; let html = txt.value; diff --git a/src/com/ui/FileManager.js b/src/com/ui/FileManager.js index 8013a4d..36a37cc 100644 --- a/src/com/ui/FileManager.js +++ b/src/com/ui/FileManager.js @@ -98,7 +98,6 @@ export default class FileManager { //get counts for lists var mediaCount = self.imageList.childNodes.length; var fileCount = self.fileList.childNodes.length; - // sort files switch (theFile.type) { case 'image/jpg':