mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Upgrading JS framework version
This commit is contained in:
1 parent
c8747a0c5e
commit
b09cc8ab6e
21 files changed
+430
-260
No files matched your search
@@ -38,7 +38,7 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<div class="row">
|
||||
<div class="col span-8">
|
||||
<input name="name" id="name" type="text" autocomplete="off" data-ls-echo="{{account.name}}" required class="margin-bottom-no">
|
||||
<input name="name" id="name" type="text" autocomplete="off" data-ls-bind="{{account.name}}" required class="margin-bottom-no">
|
||||
</div>
|
||||
<div class="col span-4">
|
||||
<button type="submit" class="fill reverse"><?php echo Locale::getText('console.account.section.overview.actions.update-name'); ?></button>
|
||||
@@ -65,7 +65,7 @@ use Utopia\Locale\Locale;
|
||||
<label><?php echo Locale::getText('console.account.section.overview.labels.email'); ?></label>
|
||||
<div class="row">
|
||||
<div class="col span-8">
|
||||
<input name="email" type="email" class="margin-bottom-no" autocomplete="off" placeholder="me@example.com" data-ls-echo="{{account.email}}" required>
|
||||
<input name="email" type="email" class="margin-bottom-no" autocomplete="off" placeholder="me@example.com" data-ls-bind="{{account.email}}" required>
|
||||
</div>
|
||||
<div class="col span-4">
|
||||
<div data-ui-modal class="modal close width-small height-small" data-button-text="<?php echo $this->escape(Locale::getText('console.account.section.overview.actions.update-email')); ?>" data-button-class="fill reverse">
|
||||
@@ -191,7 +191,7 @@ use Utopia\Locale\Locale;
|
||||
data-success-triggers="account.update"
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo $this->escape(Locale::getText('console.account.section.security.devices.logout.failure')); ?>">
|
||||
<input type="hidden" name="userId" data-ls-echo="{{session.id}}">
|
||||
<input type="hidden" name="userId" data-ls-bind="{{session.id}}">
|
||||
<button class="danger"><?php echo Locale::getText('console.account.section.security.devices.logout'); ?></button>
|
||||
</form>
|
||||
</span>
|
||||
@@ -207,22 +207,22 @@ use Utopia\Locale\Locale;
|
||||
data-success-redirect-url="/"
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo $this->escape(Locale::getText('console.account.section.security.devices.logout.failure')); ?>">
|
||||
<input type="hidden" name="userId" data-ls-echo="{{session.id}}">
|
||||
<input type="hidden" name="userId" data-ls-bind="{{session.id}}">
|
||||
<button class="danger"><?php echo Locale::getText('console.account.section.security.devices.logout'); ?></button>
|
||||
</form>
|
||||
</span>
|
||||
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/browsers/{{session.client.short_name|lowerCase}}?width=120&height=120" data-ls-title="{{session.client.name}}" data-ls-alt="{{session.client.name}}" class="avatar trans pull-start margin-end" />
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/browsers/{{session.client.short_name|lowerCase}}?width=120&height=120" data-ls-title="{{session.client.name}}" data-ls-alt="{{session.client.name}}" class="avatar trans pull-start margin-end" />
|
||||
|
||||
<span data-ls-echo="{{session.client.name}}"></span> <span data-ls-echo="{{session.client.version}}"></span> on <span data-ls-echo="{{session.model}}"></span> <span data-ls-echo="{{session.OS.name}}"></span> <span data-ls-echo="{{session.OS.version}}"></span>
|
||||
<span data-ls-bind="{{session.client.name}}"></span> <span data-ls-bind="{{session.client.version}}"></span> on <span data-ls-bind="{{session.model}}"></span> <span data-ls-bind="{{session.OS.name}}"></span> <span data-ls-bind="{{session.OS.version}}"></span>
|
||||
|
||||
<span data-ls-if="true == {{session.current}}" style="display: none;">
|
||||
<span class="tag green"><?php echo Locale::getText('console.account.section.security.devices.current'); ?></span>
|
||||
</span>
|
||||
|
||||
<div class="note info margin-top-small">
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/flags/{{session.geo.isoCode}}?width=80&height=80" class="avatar xs margin-end-small inline" />
|
||||
<small data-ls-echo="{{session.ip}}"></small> / <small data-ls-echo="{{session.geo.country}}"></small>
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/flags/{{session.geo.isoCode}}?width=80&height=80" class="avatar xs margin-end-small inline" />
|
||||
<small data-ls-bind="{{session.ip}}"></small> / <small data-ls-bind="{{session.geo.country}}"></small>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -265,17 +265,17 @@ use Utopia\Locale\Locale;
|
||||
</thead>
|
||||
<tbody data-ls-loop="securityLogs" data-ls-as="log">
|
||||
<tr>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.date')); ?>: "><span data-ls-echo="{{log.time|date-time}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.event')); ?>: "><span data-ls-echo="{{log.event}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.date')); ?>: "><span data-ls-bind="{{log.time|date-time}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.event')); ?>: "><span data-ls-bind="{{log.event}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.client')); ?>: ">
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/browsers/{{log.client.short_name|lowerCase}}?width=80&height=80" data-ls-title="{{log.client.name}}" data-ls-alt="{{log.client.name}}" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-echo="{{log.client.name}} {{log.client.version}} on {{log.model}} {{log.OS.name}} {{log.OS.version}}"></span>
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/browsers/{{log.client.short_name|lowerCase}}?width=80&height=80" data-ls-title="{{log.client.name}}" data-ls-alt="{{log.client.name}}" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-bind="{{log.client.name}} {{log.client.version}} on {{log.model}} {{log.OS.name}} {{log.OS.version}}"></span>
|
||||
</td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.location')); ?>: ">
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/flags/{{log.geo.isoCode}}?width=80&height=80" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-echo="{{log.geo.country}}"></span>
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/flags/{{log.geo.isoCode}}?width=80&height=80" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-bind="{{log.geo.country}}"></span>
|
||||
</td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.ip')); ?>: "><span data-ls-echo="{{log.ip}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.ip')); ?>: "><span data-ls-bind="{{log.ip}}"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -4,7 +4,12 @@ use Utopia\Locale\Locale;
|
||||
<header class="clear" data-ls-rerender="project.update">
|
||||
|
||||
<div data-ls-wait="projects.load" class="list pull-start project-only">
|
||||
<select data-ls-options="{{projects}}" data-key="{{option.$uid}}" data-label="{{option.name}}" data-ls-echo="{{router.params.project}}" aria-label="<?php echo $this->escape(Locale::getText('console.navigation.switch')); ?>" data-switch=""></select>
|
||||
<!-- <select data-ls-options="{{projects}}" data-key="{{option.$uid}}" data-label="{{option.name}}" data-ls-bind="{{router.params.project}}" aria-label="<?php /*echo $this->escape(Locale::getText('console.navigation.switch')); */?>" data-switch=""></select>
|
||||
-->
|
||||
|
||||
<select data-ls-loop="projects" data-ls-as="option" data-ls-bind="{{router.params.project}}">
|
||||
<option data-ls-attrs="value={{option.$uid}}" data-ls-bind="{{option.name}}"></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button style="width: 40px; height: 40px; line-height: 40px; overflow: visible;" id="setup" class="tooltip round down project-only" aria-label="Quick Start" data-tooltip="Create a new project"><i class="icon-plus"></i></button>
|
||||
@@ -24,34 +29,22 @@ use Utopia\Locale\Locale;
|
||||
<a href="/console">Back to Console <i class="icon-right-open"></i></a>
|
||||
</div>
|
||||
|
||||
<a data-ls-href="/console/account" class="account pull-end clear">
|
||||
<img src="" data-ui-gravatar="{{account.email}}" data-name="{{account.name}}" alt="<?php echo $this->escape(Locale::getText('console.navigation.user-avatar')); ?>" class="avatar margin-start pull-end" />
|
||||
<span class="name pull-end" data-ls-echo="{{account.name}}"></span>
|
||||
<a href="/console/account" class="account pull-end clear">
|
||||
<img src="" data-ui-gravatar="{{account.email}}" data-name="{{account.name}}" alt="User Avatar" class="avatar margin-start pull-end" />
|
||||
<span class="name pull-end" data-ls-bind="{{account.name}}"></span>
|
||||
</a>
|
||||
</div>
|
||||
<!--
|
||||
<div class="notifications margin-end-large pull-end">
|
||||
<div class="drop-list bottom" data-ls-ui-open="" data-button-class="link" data-button-icon="icon-bell" tabindex="1">
|
||||
<ul>
|
||||
<ul>
|
||||
<li><div class="link">Message 1</div></li>
|
||||
<li><div class="link">Message 2</div></li>
|
||||
<li><div class="link">Message 3</div></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<nav data-ls-rerender="project.load,project.update">
|
||||
<a class="logo" href="/console">
|
||||
<img src="/images/appwrite-nav.svg" alt="<?php echo Locale::getText('console.navigation.logo'); ?>" />
|
||||
<img src="/images/appwrite-nav.svg" alt="Appwrite Logo" />
|
||||
</a>
|
||||
|
||||
<div data-ui-highlight class="project-only">
|
||||
|
||||
<ul class="links">
|
||||
<li>
|
||||
<a data-ls-href="/console/home?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/home?project={{router.params.project}}">
|
||||
<i class="icon-home"></i>
|
||||
Home
|
||||
</a>
|
||||
@@ -62,19 +55,19 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<ul class="links">
|
||||
<li>
|
||||
<a data-ls-href="/console/database?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/database?project={{router.params.project}}">
|
||||
<i class="icon-database"></i>
|
||||
Database
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-ls-href="/console/storage?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/storage?project={{router.params.project}}">
|
||||
<i class="icon-folder"></i>
|
||||
Storage
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-ls-href="/console/users?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/users?project={{router.params.project}}">
|
||||
<i class="icon-users"></i>
|
||||
Users
|
||||
</a>
|
||||
@@ -85,19 +78,19 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<ul class="links">
|
||||
<li>
|
||||
<a data-ls-href="/console/settings/keys?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/settings/keys?project={{router.params.project}}">
|
||||
<i class="icon-key-inv"></i>
|
||||
API Keys
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-ls-href="/console/settings/webhooks?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/settings/webhooks?project={{router.params.project}}">
|
||||
<i class="icon-link"></i>
|
||||
Webhooks
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-ls-href="/console/settings/tasks?project={{router.params.project}}">
|
||||
<a data-ls-attrs="href=/console/settings/tasks?project={{router.params.project}}">
|
||||
<i class="icon-clock"></i>
|
||||
Tasks
|
||||
</a>
|
||||
@@ -106,7 +99,7 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<ul class="links bottom project-only">
|
||||
<li>
|
||||
<a data-ls-href="/console/settings?project={{router.params.project}}"><i class="icon-cog"></i> Settings</a>
|
||||
<a data-ls-attrs="href=/console/settings?project={{router.params.project}}"><i class="icon-cog"></i> Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ use Utopia\Locale\Locale;
|
||||
?>
|
||||
<div class="cover margin-bottom-large">
|
||||
<h1 class="zone xl margin-bottom-large margin-top">
|
||||
<a data-ls-href="/console/openings/new?company={{router.params.company}}" class="button icon margin-top-tiny pull-end"><i class="icon-plus"></i> Upload</a>
|
||||
<a data-ls-attrs="href=/console/openings/new?company={{router.params.company}}" class="button icon margin-top-tiny pull-end"><i class="icon-plus"></i> Upload</a>
|
||||
|
||||
<?php echo Locale::getText('console.database.title'); ?>
|
||||
</h1>
|
||||
|
||||
@@ -2,17 +2,16 @@
|
||||
<div class="cover margin-bottom-small">
|
||||
<div class="zone xl margin-bottom-large margin-top-small">
|
||||
<h1 class="margin-bottom-small">
|
||||
<span class="title" data-ls-echo="{{console-project.name}}"> </span> <span class="tag focus" style="vertical-align: middle">Beta Plan</span>
|
||||
<span class="title" data-ls-bind="{{console-project.name}}"> </span> <span class="tag focus" style="vertical-align: middle">Beta Plan</span>
|
||||
</h1>
|
||||
|
||||
<p data-ls-echo="{{console-project.description}}" data-default="Update your project description under project settings." class="note text-one-liner margin-bottom-large"> </p>
|
||||
<p data-ls-bind="{{console-project.description}}" class="note text-one-liner margin-bottom-large"> </p>
|
||||
|
||||
<ul class="margin-top margin-bottom-large clear">
|
||||
<li class="pull-start margin-end"><a data-ls-href="/console/settings?project={{router.params.project}}"><i class="icon-cog"></i> Settings</a> </li>
|
||||
<li class="pull-start margin-end"><a data-ls-href="/console/settings/keys?project={{router.params.project}}"><i class="icon-key-inv"></i> API Keys</a> </li>
|
||||
<li class="pull-start margin-end"><a data-ls-href="/console/settings/webhooks?project={{router.params.project}}"><i class="icon-link"></i> Webhooks</a> </li>
|
||||
<li class="pull-start margin-end"><a data-ls-href="/console/settings/tasks?project={{router.params.project}}"><i class="icon-clock"></i> Tasks</a> </li>
|
||||
<!--<li class="pull-start margin-end"><a data-ls-href="/console/settings/members?project={{router.params.project}}"><i class="icon-users"></i> Members</a> </li>-->
|
||||
<li class="pull-start margin-end"><a data-ls-attrs="href=/console/settings?project={{router.params.project}}"><i class="icon-cog"></i> Settings</a> </li>
|
||||
<li class="pull-start margin-end"><a data-ls-attrs="href=/console/settings/keys?project={{router.params.project}}"><i class="icon-key-inv"></i> API Keys</a> </li>
|
||||
<li class="pull-start margin-end"><a data-ls-attrs="href=/console/settings/webhooks?project={{router.params.project}}"><i class="icon-link"></i> Webhooks</a> </li>
|
||||
<li class="pull-start margin-end"><a data-ls-attrs="href=/console/settings/tasks?project={{router.params.project}}"><i class="icon-clock"></i> Tasks</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,7 +29,7 @@
|
||||
<div class="row responsive">
|
||||
<div class="col span-9">
|
||||
<div class="pull-start margin-end">
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-echo="{{usage.requests.total|statsTotal}}">N/A</span></div>
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-bind="{{usage.requests.total|statsTotal}}">N/A</span></div>
|
||||
<div class="metric margin-bottom-small">Requests <span class="tooltip" data-tooltip="Total number of API requests this month"><i class="icon-info-circled"></i></span></div>
|
||||
<div class="range">Current Month</div>
|
||||
</div>
|
||||
@@ -40,7 +39,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col span-3">
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-echo="{{usage.network.total|humanFileSize}}" data-default="0">0</span></div>
|
||||
<div class="value margin-bottom-small"><span class="sum" data-ls-bind="{{usage.network.total|humanFileSize}}" data-default="0">0</span></div>
|
||||
<div class="metric margin-bottom-small">Bandwidth</div>
|
||||
<div class="range">Current Month</div>
|
||||
<div class="margin-top dev-feature">
|
||||
@@ -55,19 +54,19 @@
|
||||
|
||||
<div class="row responsive">
|
||||
<div class="col span-3">
|
||||
<div class="value"><span class="sum" data-ls-echo="{{usage.documents.total|statsTotal}}" data-default="0">0</span></div>
|
||||
<div class="value"><span class="sum" data-ls-bind="{{usage.documents.total|statsTotal}}" data-default="0">0</span></div>
|
||||
<div class="margin-top-small"><b class="text-size-small unit">Documents</b></div>
|
||||
</div>
|
||||
<div class="col span-3">
|
||||
<div class="value"><span class="sum" data-ls-echo="{{usage.storage.total|humanFileSize}}" data-default="0">0</span></div>
|
||||
<div class="value"><span class="sum" data-ls-bind="{{usage.storage.total|humanFileSize}}" data-default="0">0</span></div>
|
||||
<div class="margin-top-small"><b class="text-size-small unit">Storage</b></div>
|
||||
</div>
|
||||
<div class="col span-3">
|
||||
<div class="value"><span class="sum" data-ls-echo="{{usage.users.total}}" data-default="0">0</span></div>
|
||||
<div class="value"><span class="sum" data-ls-bind="{{usage.users.total}}" data-default="0">0</span></div>
|
||||
<div class="margin-top-small"><b class="text-size-small unit">Users</b></div>
|
||||
</div>
|
||||
<div class="col span-3">
|
||||
<div class="value"><span class="sum" data-ls-echo="{{usage.tasks.total}}" data-default="0">0</span></div>
|
||||
<div class="value"><span class="sum" data-ls-bind="{{usage.tasks.total}}" data-default="0">0</span></div>
|
||||
<div class="margin-top-small"><b class="text-size-small unit">Tasks</b></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -102,18 +101,18 @@
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to delete platform">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="platformId" data-ls-echo="{{platform.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="platformId" data-ls-bind="{{platform.$uid}}">
|
||||
|
||||
<button class="reverse danger">Delete</button>
|
||||
</form>
|
||||
|
||||
<div class="margin-bottom-tiny">
|
||||
<img src="" data-ls-src="/images/clients/{{platform.type}}.png" class="avatar pull-start margin-end" />
|
||||
<span data-ls-echo="{{platform.name}}"></span>
|
||||
<img src="" data-ls-attrs="src=/images/clients/{{platform.type}}.png" class="avatar pull-start margin-end" />
|
||||
<span data-ls-bind="{{platform.name}}"></span>
|
||||
</div>
|
||||
|
||||
<p class="note margin-bottom-no"><span data-ls-echo="{{platform.domains.0}}"></span></p>
|
||||
<p class="note margin-bottom-no"><span data-ls-bind="{{platform.domains.0}}"></span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -126,7 +125,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a data-ls-href="/console/settings/keys?project={{router.params.project}}" class="pull-end">Manage Your API Keys</a>
|
||||
<a data-ls-attrs="href=/console/settings/keys?project={{router.params.project}}" class="pull-end">Manage Your API Keys</a>
|
||||
|
||||
<div class="drop-list pull-start" data-ls-ui-open="" data-button-text="Add Platform" data-button-class="button" tabindex="1">
|
||||
<ul>
|
||||
@@ -161,8 +160,8 @@
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to create platform">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="type" data-ls-echo="web">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="type" data-ls-bind="web">
|
||||
|
||||
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
|
||||
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" />
|
||||
@@ -210,11 +209,11 @@
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to update platform">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="platformId" data-ls-echo="{{platform.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="platformId" data-ls-bind="{{platform.$uid}}">
|
||||
|
||||
<label for="name">Name <span class="tooltip large" data-tooltip="Choose any name that will help you distinguish between your different apps."><i class="icon-question"></i></span></label>
|
||||
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" data-ls-echo="{{platform.name}}" />
|
||||
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" data-ls-bind="{{platform.name}}" />
|
||||
|
||||
<label for="domains">Domains <span class="tooltip large" data-tooltip="List the domains your website will use to interact with the <?php echo APP_NAME; ?> API in production or development environments."><i class="icon-question"></i></span></label>
|
||||
|
||||
@@ -224,7 +223,7 @@
|
||||
<div>
|
||||
<div data-forms-remove class="row thin">
|
||||
<div class="col span-10">
|
||||
<input name="domains" type="text" class="margin-bottom-small" autocomplete="off" placeholder="example.com" data-ls-echo="{{domain}}" data-cast-to="array" pattern="^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$" title="Please enter a valid domain name" required>
|
||||
<input name="domains" type="text" class="margin-bottom-small" autocomplete="off" placeholder="example.com" data-ls-bind="{{domain}}" data-cast-to="array" pattern="^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$" title="Please enter a valid domain name" required>
|
||||
</div>
|
||||
<div class="col span-2">
|
||||
<button type="button" data-remove class="reverse round danger pull-end"><i class="icon-cancel"></i></button>
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
|
||||
<ul data-ls-loop="console-projects" data-ls-as="project" data-ls-append="" class="tiles cell-3">
|
||||
<li class="margin-bottom">
|
||||
<a data-ls-href="/console/home?project={{project.$uid}}" class="box">
|
||||
<span data-ls-echo="{{project.name}}" class="text-one-liner"> </span>
|
||||
<p data-ls-echo="{{project.description}}" data-default="No Description. " class="note margin-top-small text-one-liner"> </p>
|
||||
<a data-ls-attrs="href=/console/home?project={{project.$uid}}" class="box">
|
||||
<span data-ls-bind="{{project.name}}" class="text-one-liner"> </span>
|
||||
<p data-ls-bind="{{project.description}}" class="note margin-top-small text-one-liner"> </p>
|
||||
<i class="icon-right-open"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -70,24 +70,24 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to update project">
|
||||
|
||||
<input name="$uid" type="hidden" data-ls-echo="{{console-project.$uid}}" />
|
||||
<input name="$uid" type="hidden" data-ls-bind="{{console-project.$uid}}" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col span-9">
|
||||
<div class="box">
|
||||
<label for="name">Name</label>
|
||||
<input name="name" id="name" type="text" autocomplete="off" data-ls-echo="{{console-project.name}}" data-forms-text-direction required>
|
||||
<input name="name" id="name" type="text" autocomplete="off" data-ls-bind="{{console-project.name}}" data-forms-text-direction required>
|
||||
|
||||
<label for="name">Project ID</label>
|
||||
<div class="input-copy">
|
||||
<input data-forms-copy type="text" disabled data-ls-echo="{{router.params.project}}" />
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="{{router.params.project}}" />
|
||||
</div>
|
||||
|
||||
<label for="description">Description <small>(optional)</small></label>
|
||||
<textarea name="description" id="description" autocomplete="off" placeholder="Help us make the world a better place" data-ls-echo="{{console-project.description}}" data-forms-text-direction data-forms-text-count></textarea>
|
||||
<textarea name="description" id="description" autocomplete="off" placeholder="Help us make the world a better place" data-ls-bind="{{console-project.description}}" data-forms-text-direction data-forms-text-count></textarea>
|
||||
|
||||
<label for="url">Website <small>(optional)</small></label>
|
||||
<input name="url" id="url" type="url" class="full-width" autocomplete="off" placeholder="https://acme-corp.com" data-ls-echo="{{console-project.url}}">
|
||||
<input name="url" id="url" type="url" class="full-width" autocomplete="off" placeholder="https://acme-corp.com" data-ls-bind="{{console-project.url}}">
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -99,7 +99,7 @@ $scopes = [ // TODO sync with project list
|
||||
<div class="margin-bottom-small">
|
||||
<div data-forms-remove class="row thin">
|
||||
<div class="col span-9">
|
||||
<input name="clients" type="url" class="full-width" autocomplete="off" placeholder="https://acme-corp.com" data-ls-echo="{{client}}" data-cast-to="array">
|
||||
<input name="clients" type="url" class="full-width" autocomplete="off" placeholder="https://acme-corp.com" data-ls-bind="{{client}}" data-cast-to="array">
|
||||
</div>
|
||||
<div class="col span-3">
|
||||
<button type="button" data-remove class="reverse danger pull-end"><i class="icon-cancel"></i></button>
|
||||
@@ -128,26 +128,26 @@ $scopes = [ // TODO sync with project list
|
||||
<div class="row thin">
|
||||
<div class="col span-6">
|
||||
<label for="legalName">Legal Name</label>
|
||||
<input name="legalName" id="legalName" type="text" autocomplete="off" data-ls-echo="{{console-project.legalName}}" data-forms-text-direction>
|
||||
<input name="legalName" id="legalName" type="text" autocomplete="off" data-ls-bind="{{console-project.legalName}}" data-forms-text-direction>
|
||||
|
||||
<div data-ls-rerender="geo-countries-load">
|
||||
<label for="legalCountry">Country</label>
|
||||
<select id="legalCountry" name="legalCountry" data-ls-options="{{geo-countries}}" data-ls-echo="{{console-project.legalCountry}}"></select>
|
||||
<select id="legalCountry" name="legalCountry" data-ls-options="{{geo-countries}}" data-ls-bind="{{console-project.legalCountry}}"></select>
|
||||
</div>
|
||||
|
||||
<label for="legalCity">City</label>
|
||||
<input name="legalCity" id="legalCity" type="text" autocomplete="off" data-ls-echo="{{console-project.legalCity}}" data-forms-text-direction>
|
||||
<input name="legalCity" id="legalCity" type="text" autocomplete="off" data-ls-bind="{{console-project.legalCity}}" data-forms-text-direction>
|
||||
</div>
|
||||
|
||||
<div class="col span-6">
|
||||
<label for="legalTaxId">Tax ID</label>
|
||||
<input name="legalTaxId" id="legalTaxId" type="text" autocomplete="off" data-ls-echo="{{console-project.legalTaxId}}" data-forms-text-direction>
|
||||
<input name="legalTaxId" id="legalTaxId" type="text" autocomplete="off" data-ls-bind="{{console-project.legalTaxId}}" data-forms-text-direction>
|
||||
|
||||
<label for="legalState">State</label>
|
||||
<input name="legalState" id="legalState" type="text" autocomplete="off" data-ls-echo="{{console-project.legalState}}" data-forms-text-direction>
|
||||
<input name="legalState" id="legalState" type="text" autocomplete="off" data-ls-bind="{{console-project.legalState}}" data-forms-text-direction>
|
||||
|
||||
<label for="legalAddress">Address</label>
|
||||
<input name="legalAddress" id="legalAddress" type="text" autocomplete="off" data-ls-echo="{{console-project.legalAddress}}" data-forms-text-direction>
|
||||
<input name="legalAddress" id="legalAddress" type="text" autocomplete="off" data-ls-bind="{{console-project.legalAddress}}" data-forms-text-direction>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +161,7 @@ $scopes = [ // TODO sync with project list
|
||||
<div class="col span-3 box-aside">
|
||||
<label for="name">Logo</label>
|
||||
<div class="text-center clear">
|
||||
<input type="hidden" name="logo" data-ls-echo="{{console-project.logo}}"
|
||||
<input type="hidden" name="logo" data-ls-bind="{{console-project.logo}}"
|
||||
data-read="<?php echo $this->escape(json_encode(['*'])); ?>"
|
||||
data-write="<?php echo $this->escape(json_encode(['team:{{console-project.teamId}}'])); ?>"
|
||||
data-accept="image/*"
|
||||
@@ -209,17 +209,17 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to update API key">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="keyId" data-ls-echo="{{key.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="keyId" data-ls-bind="{{key.$uid}}">
|
||||
|
||||
<label data-ls-for="name-{{key.$uid}}">Name</label>
|
||||
<input type="text" class="full-width" data-ls-id="name-{{key.$uid}}" name="name" required autocomplete="off" data-ls-echo="{{key.name}}" />
|
||||
<input type="text" class="full-width" data-ls-id="name-{{key.$uid}}" name="name" required autocomplete="off" data-ls-bind="{{key.name}}" />
|
||||
|
||||
<label data-ls-for="scopes-{{key.$uid}}">Scopes (<a href="/docs/keys" target="_blank">Learn More</a>)</label>
|
||||
<div class="row thin margin-bottom">
|
||||
<?php foreach ($scopes as $i => $scope): ?>
|
||||
<div class="col span-6">
|
||||
<input type="checkbox" name="scopes" data-ls-echo="<?php echo $scope; ?>" data-default="{{key.scopes}}" /> <?php echo $scope; ?>
|
||||
<input type="checkbox" name="scopes" data-ls-bind="<?php echo $scope; ?>" data-default="{{key.scopes}}" /> <?php echo $scope; ?>
|
||||
</div>
|
||||
<?php if(($i+1) % 2 === 0): ?>
|
||||
</div>
|
||||
@@ -246,13 +246,13 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to delete API key">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="keyId" data-ls-echo="{{key.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="keyId" data-ls-bind="{{key.$uid}}">
|
||||
|
||||
<button class="reverse danger">Delete</button>
|
||||
</form>
|
||||
|
||||
<div class="margin-bottom-tiny"><span data-ls-echo="{{key.name}}"></span> <span class="note">(<span data-ls-echo="{{key.scopes.length}}"></span> scopes granted)</span></div>
|
||||
<div class="margin-bottom-tiny"><span data-ls-bind="{{key.name}}"></span> <span class="note">(<span data-ls-bind="{{key.scopes.length}}"></span> scopes granted)</span></div>
|
||||
|
||||
<div data-ui-modal class="modal close" data-button-text="Show Secret" data-button-class="link margin-top-small" data-button-icon="icon-right-open">
|
||||
<button type="button" class="close pull-end" data-ls-trigger="modal-close"><i class="icon-cancel"></i></button>
|
||||
@@ -261,7 +261,7 @@ $scopes = [ // TODO sync with project list
|
||||
|
||||
<form>
|
||||
<div class="input-copy">
|
||||
<textarea disabled style="height: 130px; line-height: 26px" data-forms-copy data-ls-echo="{{key.secret}}"></textarea>
|
||||
<textarea disabled style="height: 130px; line-height: 26px" data-forms-copy data-ls-bind="{{key.secret}}"></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<button data-ls-trigger="modal-close" type="button" class="reverse">Cancel</button>
|
||||
@@ -287,7 +287,7 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to create API key">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" />
|
||||
@@ -355,17 +355,17 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to update webhook">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="webhookId" data-ls-echo="{{webhook.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="webhookId" data-ls-bind="{{webhook.$uid}}">
|
||||
|
||||
<label data-ls-for="name-{{webhook.$uid}}">Name</label>
|
||||
<input type="text" class="full-width" data-ls-id="name-{{webhook.$uid}}" name="name" required autocomplete="off" data-ls-echo="{{webhook.name}}" />
|
||||
<input type="text" class="full-width" data-ls-id="name-{{webhook.$uid}}" name="name" required autocomplete="off" data-ls-bind="{{webhook.name}}" />
|
||||
|
||||
<label data-ls-for="events-{{webhook.$uid}}">Events</label>
|
||||
<div class="row thin margin-bottom">
|
||||
<?php foreach ($events as $i => $event): ?>
|
||||
<div class="col span-6">
|
||||
<input type="checkbox" name="events" data-ls-echo="<?php echo $event; ?>" data-default="{{webhook.events}}" /> <?php echo $event; ?>
|
||||
<input type="checkbox" name="events" data-ls-bind="<?php echo $event; ?>" data-default="{{webhook.events}}" /> <?php echo $event; ?>
|
||||
</div>
|
||||
<?php if(($i+1) % 2 === 0): ?>
|
||||
</div>
|
||||
@@ -376,14 +376,14 @@ $scopes = [ // TODO sync with project list
|
||||
</div>
|
||||
|
||||
<label data-ls-for="url-{{webhook.$uid}}">POST URL</label>
|
||||
<input type="url" class="full-width" data-ls-id="url-{{webhook.$uid}}" name="url" required autocomplete="off" placeholder="https://example.com/callback" data-ls-echo="{{webhook.url}}" />
|
||||
<input type="url" class="full-width" data-ls-id="url-{{webhook.$uid}}" name="url" required autocomplete="off" placeholder="https://example.com/callback" data-ls-bind="{{webhook.url}}" />
|
||||
|
||||
<label data-ls-for="secure-{{webhook.$uid}}">SSL / TLS</label>
|
||||
<p class="note">Certificate verification</p>
|
||||
|
||||
<input name="security" data-ls-id="secure-yes-{{webhook.$uid}}" type="radio" required data-ls-echo="1" data-default="{{webhook.security}}" /> <span>Enabled</span>
|
||||
<input name="security" data-ls-id="secure-yes-{{webhook.$uid}}" type="radio" required data-ls-bind="1" data-default="{{webhook.security}}" /> <span>Enabled</span>
|
||||
|
||||
<input name="security" data-ls-id="secure-no-{{webhook.$uid}}" type="radio" required data-ls-echo="0" data-default="{{webhook.security}}" /> <span>Disabled</span>
|
||||
<input name="security" data-ls-id="secure-no-{{webhook.$uid}}" type="radio" required data-ls-bind="0" data-default="{{webhook.security}}" /> <span>Disabled</span>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
@@ -397,11 +397,11 @@ $scopes = [ // TODO sync with project list
|
||||
<div class="row thin">
|
||||
<div class="col span-6">
|
||||
<label data-ls-for="httpUser-{{webhook.$uid}}">User</label>
|
||||
<input type="text" class="full-width" data-ls-id="httpUser-{{webhook.$uid}}" name="httpUser" autocomplete="off" data-ls-echo="{{webhook.httpUser}}" />
|
||||
<input type="text" class="full-width" data-ls-id="httpUser-{{webhook.$uid}}" name="httpUser" autocomplete="off" data-ls-bind="{{webhook.httpUser}}" />
|
||||
</div>
|
||||
<div class="col span-6">
|
||||
<label data-ls-for="httpPass-{{webhook.$uid}}">Password</label>
|
||||
<input type="password" class="full-width" data-ls-id="httpPass-{{webhook.$uid}}" name="httpPass" autocomplete="off" data-ls-echo="{{webhook.httpPass}}" />
|
||||
<input type="password" class="full-width" data-ls-id="httpPass-{{webhook.$uid}}" name="httpPass" autocomplete="off" data-ls-bind="{{webhook.httpPass}}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -424,17 +424,17 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to delete webhook">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="webhookId" data-ls-echo="{{webhook.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="webhookId" data-ls-bind="{{webhook.$uid}}">
|
||||
|
||||
<button class="danger reverse">Delete</button>
|
||||
</form>
|
||||
|
||||
<span data-ls-echo="{{webhook.name}}"></span> (<span data-ls-echo="{{webhook.events.length}}"></span> events)
|
||||
<span data-ls-bind="{{webhook.name}}"></span> (<span data-ls-bind="{{webhook.events.length}}"></span> events)
|
||||
<span data-ls-if="0 == {{webhook.security}}" style="display: none;">
|
||||
<span class="note text-danger">(SSL/TLS Disabled)</span>
|
||||
</span>
|
||||
<p class="note margin-bottom-no margin-top-small"><span class="tag green">POST</span> <span data-ls-echo="{{webhook.url}}"></span></p>
|
||||
<p class="note margin-bottom-no margin-top-small"><span class="tag green">POST</span> <span data-ls-bind="{{webhook.url}}"></span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -454,7 +454,7 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to create webhook">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" />
|
||||
@@ -550,17 +550,17 @@ $scopes = [ // TODO sync with project list
|
||||
<tr>
|
||||
<td>
|
||||
<div class="margin-bottom-tiny text-one-liner">
|
||||
<span data-ls-echo="{{task.name}}"></span>
|
||||
<span data-ls-bind="{{task.name}}"></span>
|
||||
|
||||
<span data-ls-if="0 === {{task.security}}" style="display: none;">
|
||||
<span class="text-danger">SSL/TLS Disabled</span>
|
||||
</span>
|
||||
<span data-ls-if="0 !== {{task.failures}}" style="display: none;">
|
||||
<span class="text-danger" data-ls-echo="({{task.failures}} errors)"></span>
|
||||
<span class="text-danger" data-ls-bind="({{task.failures}} errors)"></span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<a data-ls-href="{{task.httpUrl}}" data-ls-echo="{{task.httpUrl}}" target="_blank" class="text-one-liner"></a>
|
||||
<a data-ls-attrs="href={{task.httpUrl}}" data-ls-bind="{{task.httpUrl}}" target="_blank" class="text-one-liner"></a>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<span data-ls-if="'play' === '{{task.status}}'" style="display: none;">
|
||||
@@ -571,14 +571,14 @@ $scopes = [ // TODO sync with project list
|
||||
</span>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<span data-ls-echo="{{task.next|date-time}}" class="note"></span>
|
||||
<span data-ls-bind="{{task.next|date-time}}" class="note"></span>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div data-ls-if="'undefined' !== '{{task.previous}}'" class="note">
|
||||
<span data-ls-echo="{{task.previous|date-time}}"></span>
|
||||
<span data-ls-bind="{{task.previous|date-time}}"></span>
|
||||
|
||||
<div data-ls-if="'undefined' !== '{{task.delay}}' && 59 < {{task.delay}}" class="note text-danger margin-top-tiny">
|
||||
<span data-ls-echo="({{task.delay|ms2hum}} Delay)"></span>
|
||||
<span data-ls-bind="({{task.delay|ms2hum}} Delay)"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div data-ls-if="'undefined' === '{{task.previous}}'" class="note">
|
||||
@@ -600,26 +600,26 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to update task">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="taskId" data-ls-echo="{{task.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="taskId" data-ls-bind="{{task.$uid}}">
|
||||
|
||||
<label data-ls-for="name-{{task.$uid}}">Name</label>
|
||||
<input type="text" class="full-width" data-ls-id="name-{{task.$uid}}" name="name" required autocomplete="off" data-ls-echo="{{task.name}}" />
|
||||
<input type="text" class="full-width" data-ls-id="name-{{task.$uid}}" name="name" required autocomplete="off" data-ls-bind="{{task.name}}" />
|
||||
|
||||
<label data-ls-for="status-{{task.$uid}}" class="margin-bottom">Status
|
||||
<div class="margin-top-small">
|
||||
<input name="status" type="radio" checked="checked" required data-ls-echo="play" data-default="{{task.status}}" /> <span>Play</span>
|
||||
<input name="status" type="radio" required data-ls-echo="pause" data-default="{{task.status}}" /> <span>Pause</span>
|
||||
<input name="status" type="radio" checked="checked" required data-ls-bind="play" data-default="{{task.status}}" /> <span>Play</span>
|
||||
<input name="status" type="radio" required data-ls-bind="pause" data-default="{{task.status}}" /> <span>Pause</span>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
<label data-ls-for="schedule-{{task.$uid}}">Schedule (CRON Syntax)</label>
|
||||
<input type="text" class="full-width" data-ls-id="schedule-{{task.$uid}}" name="schedule" required autocomplete="off" data-ls-echo="{{task.schedule}}" />
|
||||
<input type="text" class="full-width" data-ls-id="schedule-{{task.$uid}}" name="schedule" required autocomplete="off" data-ls-bind="{{task.schedule}}" />
|
||||
|
||||
<div class="row thin">
|
||||
<div class="col span-4">
|
||||
<label data-ls-for="httpMethod-{{task.$uid}}">HTTP Method</label>
|
||||
<select data-ls-id="httpMethod-{{task.$uid}}" name="httpMethod" required data-ls-echo="{{task.httpMethod}}">
|
||||
<select data-ls-id="httpMethod-{{task.$uid}}" name="httpMethod" required data-ls-bind="{{task.httpMethod}}">
|
||||
<option value="POST">POST</option>
|
||||
<option value="GET">GET</option>
|
||||
<option value="PUT">PUT</option>
|
||||
@@ -633,7 +633,7 @@ $scopes = [ // TODO sync with project list
|
||||
</div>
|
||||
<div class="col span-8">
|
||||
<label data-ls-for="httpUrl-{{task.$uid}}">HTTP URL</label>
|
||||
<input type="url" class="full-width" data-ls-id="httpUrl-{{task.$uid}}" name="httpUrl" required autocomplete="off" placeholder="https://example.com/callback" data-ls-echo="{{task.httpUrl}}" />
|
||||
<input type="url" class="full-width" data-ls-id="httpUrl-{{task.$uid}}" name="httpUrl" required autocomplete="off" placeholder="https://example.com/callback" data-ls-bind="{{task.httpUrl}}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -643,7 +643,7 @@ $scopes = [ // TODO sync with project list
|
||||
<div class="margin-bottom-small">
|
||||
<div data-forms-remove class="row thin">
|
||||
<div class="col span-10">
|
||||
<input type="hidden" name="httpHeaders" data-forms-headers data-ls-echo="{{header}}" data-cast-to="array" />
|
||||
<input type="hidden" name="httpHeaders" data-forms-headers data-ls-bind="{{header}}" data-cast-to="array" />
|
||||
</div>
|
||||
<div class="col span-2">
|
||||
<button type="button" data-remove class="reverse danger round pull-end"><i class="icon-cancel"></i></button>
|
||||
@@ -668,8 +668,8 @@ $scopes = [ // TODO sync with project list
|
||||
|
||||
<label data-ls-for="security-{{task.$uid}}" class="margin-bottom">SSL / TLS
|
||||
<p class="note">Certificate verification</p>
|
||||
<input name="security" type="radio" required data-ls-echo="1" data-default="{{task.security}}" /> <span>Enabled</span>
|
||||
<input name="security" type="radio" required data-ls-echo="0" data-default="{{task.security}}" /> <span>Disabled</span>
|
||||
<input name="security" type="radio" required data-ls-bind="1" data-default="{{task.security}}" /> <span>Enabled</span>
|
||||
<input name="security" type="radio" required data-ls-bind="0" data-default="{{task.security}}" /> <span>Disabled</span>
|
||||
</label>
|
||||
|
||||
<p class="note margin-bottom"><span class="tag red">Warning</span> Untrusted or self-signed certificates may not be secure.
|
||||
@@ -681,11 +681,11 @@ $scopes = [ // TODO sync with project list
|
||||
<div class="row thin">
|
||||
<div class="col span-6">
|
||||
<label data-ls-for="httpUser-{{task.$uid}}">User</label>
|
||||
<input type="text" class="full-width" data-ls-id="httpUser-{{task.$uid}}" name="httpUser" autocomplete="off" data-ls-echo="{{task.httpUser}}" />
|
||||
<input type="text" class="full-width" data-ls-id="httpUser-{{task.$uid}}" name="httpUser" autocomplete="off" data-ls-bind="{{task.httpUser}}" />
|
||||
</div>
|
||||
<div class="col span-6">
|
||||
<label data-ls-for="httpPass-{{task.$uid}}">Password</label>
|
||||
<input type="password" class="full-width" data-ls-id="httpPass-{{task.$uid}}" name="httpPass" autocomplete="off" data-ls-echo="{{task.httpPass}}" />
|
||||
<input type="password" class="full-width" data-ls-id="httpPass-{{task.$uid}}" name="httpPass" autocomplete="off" data-ls-bind="{{task.httpPass}}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -705,8 +705,8 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to delete task">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="taskId" data-ls-echo="{{task.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
<input type="hidden" name="taskId" data-ls-bind="{{task.$uid}}">
|
||||
|
||||
<button class="danger fill">Delete</button>
|
||||
</form>
|
||||
@@ -732,7 +732,7 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to create task">
|
||||
|
||||
<input type="hidden" name="projectId" data-ls-echo="{{console-project.$uid}}">
|
||||
<input type="hidden" name="projectId" data-ls-bind="{{console-project.$uid}}">
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" />
|
||||
@@ -842,7 +842,7 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo Locale::getText('console.settings.section.members.leave.failure'); ?>">
|
||||
|
||||
<input name="inviteId" id="inviteId" type="hidden" data-ls-echo="{{member.inviteId}}">
|
||||
<input name="inviteId" id="inviteId" type="hidden" data-ls-bind="{{member.inviteId}}">
|
||||
|
||||
<button class="danger"><?php echo Locale::getText('console.settings.section.members.labels.leave'); ?></button>
|
||||
</form>
|
||||
@@ -857,8 +857,8 @@ $scopes = [ // TODO sync with project list
|
||||
data-success-triggers="auth.invite"
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo Locale::getText('console.settings.section.members.invite.failure'); ?>">
|
||||
<input name="inviteId" id="inviteId" type="hidden" data-ls-echo="{{member.inviteId}}">
|
||||
<input name="redirect" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="inviteId" id="inviteId" type="hidden" data-ls-bind="{{member.inviteId}}">
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
|
||||
<button class="reverse"><?php echo Locale::getText('console.settings.section.members.labels.resend'); ?></button>
|
||||
</form>
|
||||
@@ -866,9 +866,9 @@ $scopes = [ // TODO sync with project list
|
||||
|
||||
<img src="" data-ui-gravatar="{{member.email}}" data-name="{{member.name}}" data-size="100" alt="User Avatar" class="avatar pull-start margin-end" />
|
||||
<div class="margin-bottom-small">
|
||||
<span data-ls-echo="{{member.name}}"></span> <span class="tag" data-ls-echo="{{member.roles.0|id2role}}"></span> <span data-ls-if="'false' == '{{member.confirm}}'" class="tag red" style="display: none;"><?php echo Locale::getText('console.settings.section.members.labels.pending'); ?></span>
|
||||
<span data-ls-bind="{{member.name}}"></span> <span class="tag" data-ls-bind="{{member.roles.0|id2role}}"></span> <span data-ls-if="'false' == '{{member.confirm}}'" class="tag red" style="display: none;"><?php echo Locale::getText('console.settings.section.members.labels.pending'); ?></span>
|
||||
</div>
|
||||
<span class="note" data-ls-echo="{{member.email}}"></span>
|
||||
<span class="note" data-ls-bind="{{member.email}}"></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -888,8 +888,8 @@ $scopes = [ // TODO sync with project list
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo Locale::getText('console.settings.section.members.invite.failure'); ?>">
|
||||
|
||||
<input name="team" id="team" type="hidden" data-ls-echo="{{console-project.teamId}}">
|
||||
<input name="redirect" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="team" id="team" type="hidden" data-ls-bind="{{console-project.teamId}}">
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
|
||||
<label for="name"><?php echo Locale::getText('console.settings.section.members.labels.name'); ?> <small>(<?php echo Locale::getText('general.optional'); ?>)</small></label>
|
||||
<input name="name" id="name" type="text" autocomplete="name">
|
||||
|
||||
@@ -6,7 +6,7 @@ $providers = $this->getParam('providers', []);
|
||||
|
||||
<div class="cover margin-bottom-large">
|
||||
<h1 class="zone xl margin-bottom-large margin-top">
|
||||
<a data-ls-href="/console/openings/new?company={{router.params.company}}" class="button icon margin-top-tiny pull-end"><i class="icon-plus"></i> Upload</a>
|
||||
<a data-ls-attrs="href=/console/openings/new?company={{router.params.company}}" class="button icon margin-top-tiny pull-end"><i class="icon-plus"></i> Upload</a>
|
||||
|
||||
<?php echo Locale::getText('console.storage.title'); ?>
|
||||
</h1>
|
||||
@@ -53,11 +53,11 @@ $providers = $this->getParam('providers', []);
|
||||
<li>
|
||||
<div class="box padding-small margin-bottom">
|
||||
|
||||
<img data-ls-src="//{{env.DOMAIN}}/v1/storage/files/{{file.$uid}}/preview?width=100&height=100&project={{router.params.project}}&mode=admin" class="pull-start avatar margin-end" />
|
||||
<img data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$uid}}/preview?width=100&height=100&project={{router.params.project}}&mode=admin" class="pull-start avatar margin-end" />
|
||||
|
||||
<button class="pull-end strip margin-top-tiny"><i class="icon icon-dot-3"></i></button>
|
||||
<div data-ls-echo="{{file.name}}" data-ls-title="{{file.name}}" class="text-one-liner margin-bottom-tiny"> </div>
|
||||
<div data-ls-echo="{{file.sizeOriginal|humanFileSize}}" class="note text-one-liner"> </div>
|
||||
<div data-ls-bind="{{file.name}}" data-ls-title="{{file.name}}" class="text-one-liner margin-bottom-tiny"> </div>
|
||||
<div data-ls-bind="{{file.sizeOriginal|humanFileSize}}" class="note text-one-liner"> </div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -96,10 +96,10 @@ $providers = $this->getParam('providers', []);
|
||||
<img src="" data-ui-gravatar="{{user.email}}" data-name="{{user.name}}" data-size="60" alt="User Avatar" class="avatar pull-start" />
|
||||
</td>
|
||||
<td data-title="Name: ">
|
||||
<a data-ls-href="/console/users/view?id={{user.$uid}}&project={{router.params.project}}" data-ls-echo="{{user.name}}"></a>
|
||||
<a data-ls-attrs="href=/console/users/view?id={{user.$uid}}&project={{router.params.project}}" data-ls-bind="{{user.name}}"></a>
|
||||
</td>
|
||||
<td data-title="Email: ">
|
||||
<span data-ls-echo="{{user.email}}" class="note"></span>
|
||||
<span data-ls-bind="{{user.email}}" class="note"></span>
|
||||
</td>
|
||||
<td data-title="Status: ">
|
||||
<span data-ls-if="'{{user.confirm}}' === 'true'">
|
||||
@@ -114,7 +114,7 @@ $providers = $this->getParam('providers', []);
|
||||
<span class="tag red">Blocked</span>
|
||||
</span>
|
||||
</td>
|
||||
<td data-title="Created: "><span data-ls-echo="{{user.registration}}" data-filter="date-text" class="note"></span></td>
|
||||
<td data-title="Created: "><span data-ls-bind="{{user.registration}}" data-filter="date-text" class="note"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -227,18 +227,18 @@ $providers = $this->getParam('providers', []);
|
||||
|
||||
<label for="name">UID</label>
|
||||
<div class="input-copy">
|
||||
<input name="teamId" data-forms-copy type="text" disabled data-ls-echo="{{team.$uid}}" />
|
||||
<input name="teamId" data-forms-copy type="text" disabled data-ls-bind="{{team.$uid}}" />
|
||||
</div>
|
||||
|
||||
<label for="name">Name</label>
|
||||
<input name="name" id="name" type="text" autocomplete="off" data-ls-echo="{{team.name}}">
|
||||
<input name="name" id="name" type="text" autocomplete="off" data-ls-bind="{{team.name}}">
|
||||
|
||||
<button>Update</button> <button data-ls-trigger="modal-close" type="button" class="reverse">Cancel</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
<td data-title="Members: "><span data-ls-echo="{{team.sum}}"></span></td>
|
||||
<td data-title="Date Created: "><span data-ls-echo="{{team.dateCreated}}" data-filter="date-text" class="note"></span></td>
|
||||
<td data-title="Members: "><span data-ls-bind="{{team.sum}}"></span></td>
|
||||
<td data-title="Date Created: "><span data-ls-bind="{{team.dateCreated}}" data-filter="date-text" class="note"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -287,10 +287,10 @@ $providers = $this->getParam('providers', []);
|
||||
<input name="provider" id="provider" type="hidden" autocomplete="off" value="<?php echo $provider; ?>">
|
||||
|
||||
<label for="oauth<?php echo ucfirst($provider); ?>Appid">App ID</label>
|
||||
<input name="appId" id="oauth<?php echo ucfirst($provider); ?>Appid" type="text" autocomplete="off" data-ls-echo="{{console-project.usersOauth<?php echo ucfirst($provider); ?>Appid}}">
|
||||
<input name="appId" id="oauth<?php echo ucfirst($provider); ?>Appid" type="text" autocomplete="off" data-ls-bind="{{console-project.usersOauth<?php echo ucfirst($provider); ?>Appid}}">
|
||||
|
||||
<label for="oauth<?php echo ucfirst($provider); ?>Secret">App Secret</label>
|
||||
<input name="secret" id="oauth<?php echo ucfirst($provider); ?>Secret" type="text" autocomplete="off" data-ls-echo="{{console-project.usersOauth<?php echo ucfirst($provider); ?>Secret}}">
|
||||
<input name="secret" id="oauth<?php echo ucfirst($provider); ?>Secret" type="text" autocomplete="off" data-ls-bind="{{console-project.usersOauth<?php echo ucfirst($provider); ?>Secret}}">
|
||||
|
||||
<div class="info row thin margin-bottom margin-top">
|
||||
<div class="col span-1">
|
||||
@@ -300,7 +300,7 @@ $providers = $this->getParam('providers', []);
|
||||
<p>To complete set up, add this OAuth redirect URI to your <?php echo ucfirst($provider); ?> app configuration.</p>
|
||||
|
||||
<div class="input-copy">
|
||||
<input data-forms-copy type="text" disabled data-ls-echo="https://{{env.DOMAIN}}/v1/oauth/callback/<?php echo $provider; ?>/{{router.params.project}}" class="margin-bottom-no" />
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="https://{{env.DOMAIN}}/v1/oauth/callback/<?php echo $provider; ?>/{{router.params.project}}" class="margin-bottom-no" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,10 +14,10 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<div class="cover">
|
||||
<h1 class="zone xl margin-bottom-large">
|
||||
<a data-ls-href="/console/users?project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> <?php echo $this->escape(Locale::getText('console.users.title')); ?></a>
|
||||
<a data-ls-attrs="href=/console/users?project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> <?php echo $this->escape(Locale::getText('console.users.title')); ?></a>
|
||||
<br />
|
||||
|
||||
<span data-ls-echo="{{user.name}}"> </span>
|
||||
<span data-ls-bind="{{user.name}}"> </span>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,7 @@ use Utopia\Locale\Locale;
|
||||
<div class="text-center">
|
||||
<img src="" data-ui-gravatar="{{user.email}}" data-name="{{user.name}}" data-size="200" alt="User Avatar" class="avatar huge margin-top-negative-xxl" />
|
||||
|
||||
<div class="margin-top-small note" data-ls-echo="Member since {{user.registration|date-text}}"></div>
|
||||
<div class="margin-top-small note" data-ls-bind="Member since {{user.registration|date-text}}"></div>
|
||||
<div class="margin-top-small">
|
||||
<span data-ls-if="'{{user.confirm}}' === 'true'" style="display: none;">
|
||||
<span class="tag green">Verified</span>
|
||||
@@ -45,7 +45,7 @@ use Utopia\Locale\Locale;
|
||||
<span class="tag">Unverified</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="margin-top-small" data-ls-echo="{{user.email}}"></div>
|
||||
<div class="margin-top-small" data-ls-bind="{{user.email}}"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -73,10 +73,10 @@ use Utopia\Locale\Locale;
|
||||
<tbody data-ls-loop="user-prefs" data-ls-as="pref">
|
||||
<tr>
|
||||
<td data-title="Key: ">
|
||||
<span data-ls-echo="{{$index}}"></span>
|
||||
<span data-ls-bind="{{$index}}"></span>
|
||||
</td>
|
||||
<td data-title="Value: ">
|
||||
<span data-ls-echo="{{pref}}"></span>
|
||||
<span data-ls-bind="{{pref}}"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -91,7 +91,7 @@ use Utopia\Locale\Locale;
|
||||
<div class="col span-4">
|
||||
<label>User ID</label>
|
||||
<div class="input-copy margin-bottom-large">
|
||||
<input id="uid" type="text" autocomplete="off" placeholder="" data-ls-echo="{{user.$uid}}" disabled data-forms-copy>
|
||||
<input id="uid" type="text" autocomplete="off" placeholder="" data-ls-bind="{{user.$uid}}" disabled data-forms-copy>
|
||||
</div>
|
||||
|
||||
<div data-ls-if="'{{user.status}}' !== '<?php echo \Auth\Auth::USER_STATUS_BLOCKED; ?>'" style="display: none">
|
||||
@@ -152,18 +152,18 @@ use Utopia\Locale\Locale;
|
||||
data-success-triggers="user.update"
|
||||
data-error="alert"
|
||||
data-error-alert="Failed to logout session">
|
||||
<input type="hidden" name="userId" data-ls-echo="{{router.params.id}}">
|
||||
<input type="hidden" name="sessionId" data-ls-echo="{{session.id}}">
|
||||
<input type="hidden" name="userId" data-ls-bind="{{router.params.id}}">
|
||||
<input type="hidden" name="sessionId" data-ls-bind="{{session.id}}">
|
||||
<button class="danger">Logout</button>
|
||||
</form>
|
||||
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/browsers/{{session.client.short_name|lowercase}}?width=120&height=120" data-ls-title="{{session.client.name}}" data-ls-alt="{{session.client.name}}" class="avatar trans pull-start margin-end" />
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/browsers/{{session.client.short_name|lowercase}}?width=120&height=120" data-ls-title="{{session.client.name}}" data-ls-alt="{{session.client.name}}" class="avatar trans pull-start margin-end" />
|
||||
|
||||
<span data-ls-echo="{{session.client.name}}"></span> <span data-ls-echo="{{session.client.version}}"></span> on <span data-ls-echo="{{session.model}}"></span> <span data-ls-echo="{{session.OS.name}}"></span> <span data-ls-echo="{{session.OS.version}}"></span>
|
||||
<span data-ls-bind="{{session.client.name}}"></span> <span data-ls-bind="{{session.client.version}}"></span> on <span data-ls-bind="{{session.model}}"></span> <span data-ls-bind="{{session.OS.name}}"></span> <span data-ls-bind="{{session.OS.version}}"></span>
|
||||
|
||||
<div class="note info margin-top-small">
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/flags/{{session.geo.isoCode}}?width=80&height=80" class="avatar xs margin-end-small inline" />
|
||||
<small data-ls-echo="{{session.ip}}"></small> / <small data-ls-echo="{{session.geo.country}}"></small>
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/flags/{{session.geo.isoCode}}?width=80&height=80" class="avatar xs margin-end-small inline" />
|
||||
<small data-ls-bind="{{session.ip}}"></small> / <small data-ls-bind="{{session.geo.country}}"></small>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -211,17 +211,17 @@ use Utopia\Locale\Locale;
|
||||
</thead>
|
||||
<tbody data-ls-loop="logs" data-ls-as="log">
|
||||
<tr>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.date')); ?>: "><span data-ls-echo="{{log.time|date-time}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.event')); ?>: "><span data-ls-echo="{{log.event}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.date')); ?>: "><span data-ls-bind="{{log.time|date-time}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.event')); ?>: "><span data-ls-bind="{{log.event}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.client')); ?>: ">
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/browsers/{{log.client.short_name|lowercase}}?width=80&height=80" data-ls-title="{{log.client.name}}" data-ls-alt="{{log.client.name}}" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-echo="{{log.client.name}} {{log.client.version}} on {{log.model}} {{log.OS.name}} {{log.OS.version}}"></span>
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/browsers/{{log.client.short_name|lowercase}}?width=80&height=80" data-ls-title="{{log.client.name}}" data-ls-alt="{{log.client.name}}" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-bind="{{log.client.name}} {{log.client.version}} on {{log.model}} {{log.OS.name}} {{log.OS.version}}"></span>
|
||||
</td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.location')); ?>: ">
|
||||
<img data-ls-src="{{env.API}}/v1/avatars/flags/{{log.geo.isoCode}}?width=80&height=80" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-echo="{{log.geo.country}}"></span>
|
||||
<img data-ls-attrs="src={{env.API}}/v1/avatars/flags/{{log.geo.isoCode}}?width=80&height=80" class="avatar xs inline margin-end-small" />
|
||||
<span data-ls-bind="{{log.geo.country}}"></span>
|
||||
</td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.ip')); ?>: "><span data-ls-echo="{{log.ip}}"></span></td>
|
||||
<td data-title="<?php echo $this->escape(Locale::getText('console.account.section.security.recent-activity.ip')); ?>: "><span data-ls-bind="{{log.ip}}"></span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -18,8 +18,8 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<div class="text-danger margin-bottom-large" style="display: none;" data-ls-if="{{router.params.failure}} == 1"><?php echo $this->escape(Locale::getText('home.auth.join.failure')); ?></div>
|
||||
|
||||
<input name="success" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/console?company={{router.params.company}}">
|
||||
<input name="failure" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/join?failure=1&company={{router.params.company}}&inviteId={{router.params.inviteId}}&secret={{router.params.secret}}&userId={{router.params.userId}}">
|
||||
<input name="success" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/console?company={{router.params.company}}">
|
||||
<input name="failure" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/join?failure=1&company={{router.params.company}}&inviteId={{router.params.inviteId}}&secret={{router.params.secret}}&userId={{router.params.userId}}">
|
||||
|
||||
<div class=""
|
||||
data-appwrite="companies.getPreview"
|
||||
@@ -37,7 +37,7 @@ use Utopia\Locale\Locale;
|
||||
|
||||
<div data-ls-if="'{{api-company.logo}}' !== '' || '{{api-company.logo}}' !== 'undefined'">
|
||||
<div data-ls-style="background: {{api-company.theme-color}}; color: {{api-company.theme-color-contrast}}; width: 100px; height: 100px; line-height: 100px; border-radius: 50%; margin: 0 auto; text-align: center">
|
||||
<img data-ls-src="{{env.API}}/v1/storage/files/{{api-company.logo}}/preview?project={{env.PROJECT}}&height=120" alt="Logo" style="opacity: 0; line-height: 80px; vertical-align: middle; max-width: 80px; max-height: 80px" />
|
||||
<img data-ls-attrs="src={{env.API}}/v1/storage/files/{{api-company.logo}}/preview?project={{env.PROJECT}}&height=120" alt="Logo" style="opacity: 0; line-height: 80px; vertical-align: middle; max-width: 80px; max-height: 80px" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@ use Utopia\Locale\Locale;
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.recovery.labels.email')); ?></label>
|
||||
<input name="email" type="email" class="full-width" autocomplete="email" placeholder="me@example.com" required>
|
||||
|
||||
<input name="redirect" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/recovery/reset" />
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/recovery/reset" />
|
||||
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-sign-in"></i> <?php echo $this->escape(Locale::getText('home.auth.recovery.action')); ?></button>
|
||||
</form>
|
||||
|
||||
@@ -21,8 +21,8 @@ use Utopia\Locale\Locale;
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo $this->escape(Locale::getText('home.auth.reset.failure')); ?>">
|
||||
|
||||
<input type="hidden" name="userId" data-ls-echo="{{router.params.userId}}">
|
||||
<input type="hidden" name="token" data-ls-echo="{{router.params.token}}">
|
||||
<input type="hidden" name="userId" data-ls-bind="{{router.params.userId}}">
|
||||
<input type="hidden" name="token" data-ls-bind="{{router.params.token}}">
|
||||
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.reset.labels.passwordA')); ?></label>
|
||||
<input name="passwordA" type="password" autocomplete="off" placeholder="" required data-forms-password-meter pattern=".{6,}" title="<?php echo $this->escape(Locale::getText('home.auth.reset.labels.password.validation')); ?>">
|
||||
|
||||
@@ -32,8 +32,8 @@ use Utopia\Locale\Locale;
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo $this->escape(Locale::getText('home.auth.signin.failure')); ?>">
|
||||
|
||||
<input name="success" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/signin?failure=1">
|
||||
<input name="success" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/signin?failure=1">
|
||||
|
||||
<input name="email" type="email" class="full-width" autocomplete="email" placeholder="<?php echo $this->escape(Locale::getText('home.auth.signin.labels.email')); ?>" required>
|
||||
|
||||
|
||||
@@ -22,14 +22,14 @@ use Utopia\Locale\Locale;
|
||||
data-error="alert"
|
||||
data-error-alert="<?php echo $this->escape(Locale::getText('home.auth.signup.failure')); ?>">
|
||||
|
||||
<input name="success" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/signup?failure=1">
|
||||
<input name="success" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/console">
|
||||
<input name="failure" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/signup?failure=1">
|
||||
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.signup.labels.name')); ?></label>
|
||||
<input name="name" type="text" autocomplete="name" placeholder="" required>
|
||||
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.signup.labels.email')); ?></label>
|
||||
<input name="email" type="email" autocomplete="email" placeholder="" required data-ls-echo="{{router.params.email}}">
|
||||
<input name="email" type="email" autocomplete="email" placeholder="" required data-ls-bind="{{router.params.email}}">
|
||||
|
||||
<label><?php echo $this->escape(Locale::getText('home.auth.signup.labels.password')); ?></label>
|
||||
<input name="password" type="password" autocomplete="off" placeholder="" required data-forms-password-meter pattern=".{6,}" title="<?php echo $this->escape(Locale::getText('home.auth.signup.labels.password.validation')); ?>">
|
||||
@@ -41,7 +41,7 @@ use Utopia\Locale\Locale;
|
||||
<?php echo $this->escape(Locale::getText('home.auth.signup.labels.agree')); ?><a href="/policy/terms" target="_blank"><?php echo $this->escape(Locale::getText('home.auth.signup.labels.terms')); ?></a><?php echo $this->escape(Locale::getText('home.auth.signup.labels.and')); ?><a href="/policy/privacy" target="_blank"><?php echo $this->escape(Locale::getText('home.auth.signup.labels.privacy')); ?></a>
|
||||
</div>
|
||||
|
||||
<input name="redirect" type="hidden" data-ls-echo="https://{{env.DOMAIN}}/auth/confirm" />
|
||||
<input name="redirect" type="hidden" data-ls-bind="https://{{env.DOMAIN}}/auth/confirm" />
|
||||
|
||||
<button type="submit"><?php echo $this->escape(Locale::getText('home.auth.signup.labels.action')); ?></button>
|
||||
</form>
|
||||
|
||||
@@ -88,10 +88,10 @@ $env = $this->getParam('env', '');
|
||||
<li>
|
||||
<div data-ls-class="{{alert.class}} message">
|
||||
<i class="icon-cancel" data-ls-ui-alerts-delete data-message="{{alert.id}}"></i>
|
||||
<span data-ls-echo="{{alert.text}}"></span>
|
||||
<span data-ls-bind="{{alert.text}}"></span>
|
||||
|
||||
<span data-ls-if="'undefined' !== '{{alert.link}}'" style="display: none;">
|
||||
<a data-ls-href="{{alert.link}}" data-ls-ui-alerts-delete data-message="{{alert.id}}"><?php echo Locale::getText('general.alerts.learn'); ?></a>
|
||||
<a data-ls-attrs="href={{alert.link}}" data-ls-ui-alerts-delete data-message="{{alert.id}}"><?php echo Locale::getText('general.alerts.learn'); ?></a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
+3
-1
@@ -12,6 +12,8 @@ const gulpCleanCSS = require('gulp-clean-css');
|
||||
const configApp = {
|
||||
mainFile: 'app.js',
|
||||
src: [
|
||||
'public/scripts/dependencies/litespeed.js',
|
||||
|
||||
'public/scripts/sdk.js',
|
||||
|
||||
'public/scripts/init.js',
|
||||
@@ -79,7 +81,7 @@ const configDep = {
|
||||
'public/scripts/dependencies/pell.js',
|
||||
'public/scripts/dependencies/prism.js',
|
||||
'public/scripts/dependencies/turndown.js',
|
||||
'public/scripts/dependencies/litespeed.js',
|
||||
|
||||
'public/scripts/polyfills/date-input.js',
|
||||
'public/scripts/polyfills/datalist.js',
|
||||
],
|
||||
|
||||
Vendored
+105
-17
@@ -1923,6 +1923,105 @@ return null;}
|
||||
if(service.instance===null){let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;}
|
||||
if(key==="__watch"){return this.watch;}
|
||||
if(key==="__proxy"){return true;}
|
||||
if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;}
|
||||
if(key==="__watch"){return this.watch=value;}
|
||||
target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;}
|
||||
skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);}
|
||||
if(service.singleton){service.instance=instance;}
|
||||
return instance;}
|
||||
return service.instance;};let resolve=function(target){if(!target){return function(){};}
|
||||
let self=this;let FN_ARGS=/^function\s*[^\(]*\(\s*([^\)]*)\)/m;let text=target.toString()||'';let args=text.match(FN_ARGS)[1].split(',');return target.apply(target,args.map(function(value){return self.get(value.trim());}));};let path=function(path,value,as,prefix){as=(as)?as:container.get('$as');prefix=(prefix)?prefix:container.get('$prefix');path=path.replace(as+'.',prefix+'.').split('.');let name=path.shift();let object=this.get(name);let result=null;while(path.length>1){if(undefined===object){return null;}
|
||||
object=object[path.shift()];}
|
||||
if(undefined!==value){object[path.shift()]=value;return true;}
|
||||
if(undefined===object){return null;}
|
||||
let shift=path.shift();if(undefined===shift){result=object;}else{return object[shift];}
|
||||
return result;};let bind=function(element,path,callback,as,prefix){as=(as)?as:container.get('$as');prefix=(prefix)?prefix:container.get('$prefix');let event=path.replace(as+'.',prefix+'.')+'.changed';let printer=function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;}
|
||||
callback();};document.addEventListener(event,printer);};let container={set:set,get:get,resolve:resolve,path:path,bind:bind,setCachePrefix:setCachePrefix,getCachePrefix:getCachePrefix};set('container',container,true,false,false);return container;}();window.ls.container.set('http',function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){param=encodeURIComponent(param);let a=document.createElement('a');param+=(value?"="+encodeURIComponent(value):"");a.href=url;a.search+=(a.search?"&":"")+param;return a.href;};let request=function(method,url,headers,payload,progress){let i;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
if(typeof headers!=='object'){throw new Error('var headers must be of type object');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
for(i=0;i<globalParams.length;i++){url=addParam(url,globalParams[i].key,globalParams[i].value);}
|
||||
return new Promise(function(resolve,reject){let xmlhttp=new XMLHttpRequest();xmlhttp.open(method,url,true);xmlhttp.setRequestHeader('Ajax','1');for(i=0;i<globalHeaders.length;i++){xmlhttp.setRequestHeader(globalHeaders[i].key,globalHeaders[i].value);}
|
||||
for(let key in headers){if(headers.hasOwnProperty(key)){xmlhttp.setRequestHeader(key,headers[key]);}}
|
||||
xmlhttp.onload=function(){if(4===xmlhttp.readyState&&200===xmlhttp.status){resolve(xmlhttp.response);}else{document.dispatchEvent(new CustomEvent('http-'+method.toLowerCase()+'-'+xmlhttp.status));reject(new Error(xmlhttp.statusText));}};if(progress){xmlhttp.addEventListener('progress',progress);xmlhttp.upload.addEventListener('progress',progress,false);}
|
||||
xmlhttp.onerror=function(){reject(new Error("Network Error"));};xmlhttp.send(payload);})};return{'get':function(url){return request('GET',url,{},'')},'post':function(url,headers,payload){return request('POST',url,headers,payload)},'put':function(url,headers,payload){return request('PUT',url,headers,payload)},'patch':function(url,headers,payload){return request('PATCH',url,headers,payload)},'delete':function(url){return request('DELETE',url,{},'')},'addGlobalParam':function(key,value){globalParams.push({key:key,value:value});},'addGlobalHeader':function(key,value){globalHeaders.push({key:key,value:value});}}},true,false,false);window.ls.container.set('cookie',function(document){function get(name){let value="; "+document.cookie,parts=value.split("; "+name+"=");if(parts.length===2){return parts.pop().split(";").shift();}
|
||||
return null;}
|
||||
function set(name,value,days){let date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));let expires=(0<days)?'expires='+date.toUTCString():'expires=0';document.cookie=name+"="+value+";"+expires+";path=/";return this;}
|
||||
return{'get':get,'set':set}},true,false,false);window.ls.container.set('view',function(http,container){let stock={};let execute=function(view,node,container){container.set('element',node,true,false,false);container.resolve(view.controller);if(true!==view.repeat){node.removeAttribute(view.selector);}};let parse=function(node,skip){if(node.attributes&&skip!==true){let attrs=[];let attrsLen=node.attributes.length;for(let x=0;x<attrsLen;x++){attrs.push(node.attributes[x].nodeName);}
|
||||
if(1!==node.nodeType){return;}
|
||||
if(attrs&&attrsLen){for(let x=0;x<attrsLen;x++){if(node.$lsSkip===true){break;}
|
||||
let pointer=(!/Edge/.test(navigator.userAgent))?x:(attrsLen-1)-x;let length=attrsLen;let attr=attrs[pointer];if(!stock[attr]){continue;}
|
||||
let comp=stock[attr];if(typeof comp.template==="function"){comp.template=container.resolve(comp.template);}
|
||||
if(!comp.template){(function(comp,node,container){execute(comp,node,container);})(comp,node,container);if(length!==attrsLen){x--;}
|
||||
continue;}
|
||||
node.classList.remove('load-end');node.classList.add('load-start');node.$lsSkip=true;http.get(comp.template).then(function(node,comp){return function(data){node.$lsSkip=false;node.innerHTML=data;node.classList.remove('load-start');node.classList.add('load-end');(function(comp,node,container){execute(comp,node,container);})(comp,node,container);parse(node,true);}}(node,comp),function(error){throw new Error('Failed to load comp template: '+error.message);});}}}
|
||||
if(true===node.$lsSkip){return;}
|
||||
let list=(node)?node.childNodes:[];if(node.$lsSkip===true){list=[];}
|
||||
for(let i=0;i<list.length;i++){let child=list[i];parse(child);}};return{stock:stock,add:function(object){if(typeof object!=='object'){throw new Error('object must be of type object');}
|
||||
let defaults={'selector':'','controller':function(){},'template':'','repeat':false,'protected':false};for(let prop in defaults){if(!defaults.hasOwnProperty(prop)){continue;}
|
||||
if(prop in object){continue;}
|
||||
object[prop]=defaults[prop];}
|
||||
if(!object.selector){throw new Error('View component is missing a selector attribute');}
|
||||
stock[object.selector]=object;return this;},render:function(element){parse(element);element.dispatchEvent(new window.Event('rendered',{bubbles:false}));}}},true,false,false);window.ls.container.set('router',function(window){let states=[];let current=null;let previous=null;let getPrevious=function(){return previous;};let setPrevious=function(value){previous=value;return this;};let getCurrent=function(){return current;};let setCurrent=function(value){current=value;return this;};let setParam=function(key,value){state.params[key]=value;return this;};let getParam=function(key,def){if(key in state.params){return state.params[key];}
|
||||
return def;};let getParams=function(){return state.params;};let getURL=function(){return window.location.href;};let reset=function(){state.params=getJsonFromUrl(window.location.search);state.hash=window.location.hash;};let add=function(path,view){if(typeof path!=='string'){throw new Error('path must be of type string');}
|
||||
if(typeof view!=='object'){throw new Error('view must be of type object');}
|
||||
states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname+((location.hash)?location.hash:'');states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;}
|
||||
return b.path.length-a.path.length;});for(let i=0;i<states.length;i++){let value=states[i];value.path=(value.path.substring(0,1)!=='/')?location.pathname+value.path:value.path;let match=new RegExp("^"+value.path.replace(/:[^\s/]+/g,'([\\w-]+)')+"$");let found=url.match(match);if(found){previous=current;current=value;return value;}}
|
||||
return null};let change=function(URL,replace){if(!replace){window.history.pushState({},'',URL);}else{window.history.replaceState({},'',URL);}
|
||||
window.dispatchEvent(new PopStateEvent('popstate',{}));return this;};let reload=function(){return change(window.location.href);};let getJsonFromUrl=function(URL){let query;if(URL){let pos=location.href.indexOf('?');if(pos===-1)return[];query=location.href.substr(pos+1);}else{query=location.search.substr(1);}
|
||||
let result={};query.split('&').forEach(function(part){if(!part){return;}
|
||||
part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];}
|
||||
if(!index){result[key].push(val);}else{result[key][index]=val;}}});return result;};let state={setParam:setParam,getParam:getParam,getParams:getParams,getURL:getURL,add:add,change:change,reload:reload,reset:reset,match:match,getCurrent:getCurrent,setCurrent:setCurrent,getPrevious:getPrevious,setPrevious:setPrevious,params:getJsonFromUrl(window.location.search),hash:window.location.hash};return state;},true,false,false);window.ls.container.set('expression',function(container,filter,$as,$prefix){let reg=/(\{{.*?\}})/gi;let paths=[];return{parse:function(string,def,as,prefix){def=def||'';paths=[];return string.replace(reg,function(match){let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=(reference[0]||'');let result=container.path(path,undefined,as,prefix);if(!paths.includes(path)){paths.push(path);}
|
||||
result=(null===result||undefined===result)?def:result;result=(typeof result==='object')?JSON.stringify(result):result;if(reference.length>=2){for(let i=1;i<reference.length;i++){result=filter.apply(reference[i],result);}}
|
||||
return result;});},getPaths:function(){return paths;},}},true,false,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false,false);return container.resolve(filters[name]);};add('uppercase',function($value){return $value.toUpperCase();});add('lowercase',function($value){return $value.toLowerCase();});return{add:add,apply:apply}},true,false,false);window.ls.container.get('filter').add('escape',function(value){if(typeof value!=='string'){return value;}
|
||||
return value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false,false).set('document',window.document,true,false,false).set('element',window.document,true,false,false);window.ls.run=function(window){try{this.view.render(window.document);}catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let scopeElement=document.createElement('div');let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
router.reset();if(null===route){return;}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';}else if(null!==router.getPrevious()){view.render(element);}
|
||||
document.dispatchEvent(new CustomEvent('state-changed'));};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};scopeElement.setAttribute('data-ls-scope','');element.insertBefore(scopeElement,element.firstChild);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
if(!target.href){return false;}
|
||||
if((event.metaKey)){return false;}
|
||||
if((target.hasAttribute('target'))&&('_blank'===target.getAttribute('target'))){return false;}
|
||||
if(target.hostname!==window.location.hostname){return false;}
|
||||
let route=router.match(target);if(null===route){return false;}
|
||||
event.preventDefault();if(window.location===target.href){return false;}
|
||||
route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;}
|
||||
window.history.pushState({},'Unknown',target.href);}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i];let key=expression.parse(attr.substring(0,attr.indexOf('=')),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());let value=expression.parse(attr.substring(attr.indexOf('=')+1),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container,$prefix,$as){let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}else{element.removeAttribute('checked');}}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}else{element.removeAttribute('checked');element.checked=false;}
|
||||
if(bind){element.addEventListener('change',function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.checked,$as,$prefix);}});}}
|
||||
return;}
|
||||
if(element.value!==value){element.value=value;}
|
||||
if(bind){element.addEventListener('input',sync);}}else{if(element.innerText!==value){element.innerHTML=value;}}};let sync=(function(as,prefix){return function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.value,as,prefix);}}})($as,$prefix);let syntax=element.getAttribute('data-ls-bind');let result=expression.parse(syntax,null,$as,$prefix);let paths=expression.getPaths();echo(result,true);for(let i=0;i<paths.length;i++){container.bind(element,paths[i],function(){echo(expression.parse(syntax,null,$as,$prefix),false);});}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,$as,$prefix){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(){if(debug){console.info('debug-ls-if',expression.parse(syntax,'undefined',$as,$prefix));}
|
||||
try{result=!!(eval(expression.parse(syntax,'undefined',$as,$prefix).replace(/(\r\n|\n|\r)/gm,' ')));}catch(error){throw new Error('Failed to evaluate expression "'+syntax+'": '+error);}
|
||||
paths=expression.getPaths();if(!result){element.style.visibility='hidden';element.style.display='none';}else{element.style.removeProperty('display');element.style.removeProperty('visibility');}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-loop',template:false,repeat:false,nested:false,controller:function(element,view,container,window){let expr=element.getAttribute('data-ls-loop');let as=element.getAttribute('data-ls-as');let echo=function(){let array=container.path(expr);array=(!array)?[]:array;while(element.hasChildNodes()){element.removeChild(element.lastChild);element.lastChild=null;}
|
||||
if(array instanceof Array&&typeof array!=='object'){throw new Error('Reference value must be array or object. '+(typeof array)+' given');}
|
||||
let children=[];element.$lsSkip=true;element.style.visibility=(0===array.length)?'hidden':'visible';for(let prop in array){if(!array.hasOwnProperty(prop)){continue;}
|
||||
children[prop]=template.cloneNode(true);element.appendChild(children[prop]);(function(index){let context=expr+'.'+index;container.set(as,container.path(context),true);container.set('$index',index,true,false,false);container.set('$prefix',context,true,false,false);container.set('$as',as,true,false,false);view.render(children[prop]);})(prop);}
|
||||
container.set('$index',null,true,false,false);container.set('$prefix','',true,false,false);container.set('$as','',true,false,false);};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr,echo);container.bind(element,expr+'.length',echo);}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:true,controller:function(element,view,http,expression,document){let template=expression.parse(element.getAttribute('data-ls-template'));let type=element.getAttribute('data-type')||'url';element.innerHTML='';let parse=function(data,element){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));};if('script'===type){let inlineTemplate=document.getElementById(template);if(inlineTemplate&&inlineTemplate.innerHTML){parse(inlineTemplate.innerHTML,element);}else{element.innerHTML='<span style="color: red">Missing template "'+template+'"</span>';}
|
||||
return;}
|
||||
http.get(template).then(function(element){return function(data){parse(data,element);}}(element),function(){throw new Error('Failed loading template');});}});!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}n(84);var o=n(41),i=r(o),a=function(){i["default"].addPickerToOtherInputs(),i["default"].supportsDateInput()||i["default"].addPickerToDateInputs()};a(),document.addEventListener("DOMContentLoaded",function(){a()}),document.querySelector("body").addEventListener("mousedown",function(){a()})},function(t,e,n){t.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(32),i=n(25),a=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(u){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(59),o=n(16);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(4),o=n(14);t.exports=n(1)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(23)("wks"),o=n(15),i=n(2).Symbol,a="function"==typeof i,u=t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))};u.store=r},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(12);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(2),o=n(8),i=n(56),a=n(6),u="prototype",s=function(t,e,n){var c,l,f,d=t&s.F,p=t&s.G,h=t&s.S,y=t&s.P,m=t&s.B,v=t&s.W,b=p?o:o[e]||(o[e]={}),g=b[u],x=p?r:h?r[e]:(r[e]||{})[u];p&&(n=e);for(c in n)l=!d&&x&&void 0!==x[c],l&&c in b||(f=l?x[c]:n[c],b[c]=p&&"function"!=typeof x[c]?n[c]:m&&l?i(f,r):v&&x[c]==f?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[u]=t[u],e}(f):y&&"function"==typeof f?i(Function.call,f):f,y&&((b.virtual||(b.virtual={}))[c]=f,t&s.R&&g&&!g[c]&&a(g,c,f)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(38),o=n(17);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports={}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(4).f,o=n(3),i=n(7)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(23)("keys"),o=n(15);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(2),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(12);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(2),o=n(8),i=n(19),a=n(27),u=n(4).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},function(t,e,n){e.f=n(7)},function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(45),i=r(o);eLine truncated
|
||||
var inputs=document.querySelectorAll('input[list]');var triggerEvent=function(elem,eventType){var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent(eventType,true,true);elem.dispatchEvent(event);}else{event=document.createEventObject();event.eventType=eventType;elem.fireEvent("on"+eventType,event);}};for(var i=0;i<inputs.length;i++){var input=inputs[i];var listId=input.getAttribute('list');var datalist=document.getElementById(listId);if(!datalist){console.error('No datalist found for input: '+listId);return;}
|
||||
var childSelect=document.querySelector('select['+IE_SELECT_ATTRIBUTE+'="'+listId+'"]');var parent=childSelect||datalist;var listItems=parent.getElementsByTagName('option');convert(input,datalist,listItems);if(childSelect){childSelect.parentNode.removeChild(childSelect);}}
|
||||
function convert(input,datalist,listItems){var fakeList=document.createElement('ul');var visibleItems=null;fakeList.id=listId;fakeList.className=LIST_CLASS;document.body.appendChild(fakeList);var scrollValue=0;var tempItems=document.createDocumentFragment();for(var i=0;i<listItems.length;i++){var item=listItems[i];var li=document.createElement('li');li.innerText=item.value;tempItems.appendChild(li);}
|
||||
fakeList.appendChild(tempItems);var fakeItems=fakeList.childNodes;var eachItem=function(callback){for(var i=0;i<fakeItems.length;i++){callback(fakeItems[i]);}};var listen=function(elem,event,func){if(elem.addEventListener){elem.addEventListener(event,func,false);}else{elem.attachEvent('on'+event,func);}};datalist.parentNode.removeChild(datalist);listen(input,'focus',function(){fakeList.scrollTop=0;scrollValue=0;});listen(input,'blur',function(evt){setTimeout(function(){fakeList.style.display='none';eachItem(function(item){item.className='';});},100);});var positionList=function(){fakeList.style.top=input.offsetTop+input.offsetHeight+'px';fakeList.style.left=input.offsetLeft+'px';fakeList.style.width=input.offsetWidth+'px';};var itemSelected=function(item){input.value=item.innerText;triggerEvent(input,'change');setTimeout(function(){fakeList.style.display='none';},100);};var buildList=function(e){fakeList.style.display='block';positionList();visibleItems=[];eachItem(function(item){var query=input.value.toLowerCase();var isFound=query.length&&item.innerText.toLowerCase().indexOf(query)>-1;if(isFound){visibleItems.push(item);}
|
||||
item.style.display=isFound?'block':'none';});};listen(input,'keyup',buildList);listen(input,'focus',buildList);eachItem(function(item){listen(item,'mouseover',function(evt){eachItem(function(_item){_item.className=item==_item?ACTIVE_CLASS:'';});});listen(item,'mouseout',function(evt){item.className='';});listen(item,'mousedown',function(evt){itemSelected(item);});});listen(window,'resize',positionList);listen(input,'keydown',function(e){var activeItem=fakeList.querySelector("."+ACTIVE_CLASS);if(!visibleItems.length){return;}
|
||||
var lastVisible=visibleItems[visibleItems.length-1];var datalistItemsHeight=lastVisible.offsetTop+lastVisible.offsetHeight;var isUp=e.keyCode==38;var isDown=e.keyCode==40;if((isUp||isDown)){if(isDown&&!activeItem){visibleItems[0].className=ACTIVE_CLASS;}else if(activeItem){var prevVisible=null;var nextVisible=null;for(var i=0;i<visibleItems.length;i++){var visItem=visibleItems[i];if(visItem==activeItem){prevVisible=visibleItems[i-1];nextVisible=visibleItems[i+1];break;}}
|
||||
activeItem.className='';if(isUp){if(prevVisible){prevVisible.className=ACTIVE_CLASS;if(prevVisible.offsetTop<fakeList.scrollTop){fakeList.scrollTop-=prevVisible.offsetHeight;}}else{visibleItems[visibleItems.length-1].className=ACTIVE_CLASS;}}
|
||||
if(isDown){if(nextVisible){nextVisible.className=ACTIVE_CLASS;if(nextVisible.offsetTop+nextVisible.offsetHeight>fakeList.scrollTop+fakeList.offsetHeight){fakeList.scrollTop+=nextVisible.offsetHeight;}}else{visibleItems[0].className=ACTIVE_CLASS;}}}}
|
||||
if(activeItem&&(e.keyCode==13||e.keyCode==9)){itemSelected(activeItem);}});}}(document));
|
||||
|
||||
window.ls=window.ls||{};window.ls.container=function(){let stock={};let cachePrefix='none';let memory={};let setCachePrefix=function(prefix){cachePrefix=prefix;return this;};let getCachePrefix=function(){return cachePrefix;};let set=function(name,object,singleton,cache=false,watch=true){if(typeof name!=='string'){throw new Error('var name must be of type string');}
|
||||
if(typeof singleton!=='boolean'){throw new Error('var singleton "'+singleton+'" of service "'+name+'" must be of type boolean');}
|
||||
if(cache){window.localStorage.setItem(getCachePrefix()+'.'+name,JSON.stringify(object));}
|
||||
stock[name]={name:name,object:object,singleton:singleton,instance:null,watch:watch,};return this;};let get=function(name){let service=(undefined!==stock[name])?stock[name]:null;if(null===service){if(memory[getCachePrefix()+'.'+name]){return memory[getCachePrefix()+'.'+name];}
|
||||
let cached=window.localStorage.getItem(getCachePrefix()+'.'+name);if(cached){cached=JSON.parse(cached);memory[getCachePrefix()+'.'+name]=cached;return cached;}
|
||||
return null;}
|
||||
if(service.instance===null){let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;}
|
||||
if(key==="__watch"){return this.watch;}
|
||||
if(key==="__proxy"){return true;}
|
||||
if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}
|
||||
else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;}
|
||||
if(key==="__watch"){return this.watch=value;}
|
||||
@@ -1982,13 +2081,13 @@ else{result[key][index]=val;}}});return result;};let state={setParam:setParam,ge
|
||||
result=(null===result||undefined===result)?def:result;result=(typeof result==='object')?JSON.stringify(result):result;if(reference.length>=2){for(let i=1;i<reference.length;i++){result=filter.apply(reference[i],result);}}
|
||||
return result;});},getPaths:function(){return paths;},}},true,false,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false,false);return container.resolve(filters[name]);};add('uppercase',function($value){return $value.toUpperCase();});add('lowercase',function($value){return $value.toLowerCase();});return{add:add,apply:apply}},true,false,false);window.ls.container.get('filter').add('escape',function(value){if(typeof value!=='string'){return value;}
|
||||
return value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false,false).set('document',window.document,true,false,false).set('element',window.document,true,false,false);window.ls.run=function(window){try{this.view.render(window.document);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let scopeElement=document.createElement('div');let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',repeat:false,controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
router.reset();if(null===route){return;}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';}
|
||||
else if(null!==router.getPrevious()){view.render(element);}
|
||||
else if(null!==router.getPrevious()){view.render(element);console.log('render 3')}
|
||||
document.dispatchEvent(new CustomEvent('state-changed'));};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};scopeElement.setAttribute('data-ls-scope','');element.insertBefore(scopeElement,element.firstChild);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
return null;};element.setAttribute('data-ls-scope','');view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
if(!target.href){return false;}
|
||||
if((event.metaKey)){return false;}
|
||||
if((target.hasAttribute('target'))&&('_blank'===target.getAttribute('target'))){return false;}
|
||||
@@ -1997,7 +2096,7 @@ let route=router.match(target);if(null===route){return false;}
|
||||
event.preventDefault();if(window.location===target.href){return false;}
|
||||
route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;}
|
||||
window.history.pushState({},'Unknown',target.href);}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i].split('=');let key=(attr[0])?expression.parse(attr[0],null,$as,$prefix):null;paths=paths.concat(expression.getPaths());let value=(attr[1])?expression.parse(attr[1],null,$as,$prefix):null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i];let key=expression.parse(attr.substring(0,attr.indexOf('=')),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());let value=expression.parse(attr.substring(attr.indexOf('=')+1),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container,$prefix,$as){let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}
|
||||
else{element.removeAttribute('checked');}}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}
|
||||
@@ -2017,18 +2116,7 @@ children[prop]=template.cloneNode(true);element.appendChild(children[prop]);(fun
|
||||
container.set('$index',null,true,false,false);container.set('$prefix','',true,false,false);container.set('$as','',true,false,false);};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr,echo);container.bind(element,expr+'.length',echo);}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:true,controller:function(element,view,http,expression,document){let template=expression.parse(element.getAttribute('data-ls-template'));let type=element.getAttribute('data-type')||'url';element.innerHTML='';let parse=function(data,element){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));};if('script'===type){let inlineTemplate=document.getElementById(template);if(inlineTemplate&&inlineTemplate.innerHTML){parse(inlineTemplate.innerHTML,element);}
|
||||
else{element.innerHTML='<span style="color: red">Missing template "'+template+'"</span>';}
|
||||
return;}
|
||||
http.get(template).then(function(element){return function(data){parse(data,element);}}(element),function(){throw new Error('Failed loading template');});}});!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}n(84);var o=n(41),i=r(o),a=function(){i["default"].addPickerToOtherInputs(),i["default"].supportsDateInput()||i["default"].addPickerToDateInputs()};a(),document.addEventListener("DOMContentLoaded",function(){a()}),document.querySelector("body").addEventListener("mousedown",function(){a()})},function(t,e,n){t.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(32),i=n(25),a=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(u){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(59),o=n(16);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(4),o=n(14);t.exports=n(1)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(23)("wks"),o=n(15),i=n(2).Symbol,a="function"==typeof i,u=t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))};u.store=r},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(12);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(2),o=n(8),i=n(56),a=n(6),u="prototype",s=function(t,e,n){var c,l,f,d=t&s.F,p=t&s.G,h=t&s.S,y=t&s.P,m=t&s.B,v=t&s.W,b=p?o:o[e]||(o[e]={}),g=b[u],x=p?r:h?r[e]:(r[e]||{})[u];p&&(n=e);for(c in n)l=!d&&x&&void 0!==x[c],l&&c in b||(f=l?x[c]:n[c],b[c]=p&&"function"!=typeof x[c]?n[c]:m&&l?i(f,r):v&&x[c]==f?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[u]=t[u],e}(f):y&&"function"==typeof f?i(Function.call,f):f,y&&((b.virtual||(b.virtual={}))[c]=f,t&s.R&&g&&!g[c]&&a(g,c,f)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(38),o=n(17);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports={}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(4).f,o=n(3),i=n(7)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(23)("keys"),o=n(15);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(2),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(12);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(2),o=n(8),i=n(19),a=n(27),u=n(4).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},function(t,e,n){e.f=n(7)},function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(45),i=r(o);eLine truncated
|
||||
var inputs=document.querySelectorAll('input[list]');var triggerEvent=function(elem,eventType){var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent(eventType,true,true);elem.dispatchEvent(event);}else{event=document.createEventObject();event.eventType=eventType;elem.fireEvent("on"+eventType,event);}};for(var i=0;i<inputs.length;i++){var input=inputs[i];var listId=input.getAttribute('list');var datalist=document.getElementById(listId);if(!datalist){console.error('No datalist found for input: '+listId);return;}
|
||||
var childSelect=document.querySelector('select['+IE_SELECT_ATTRIBUTE+'="'+listId+'"]');var parent=childSelect||datalist;var listItems=parent.getElementsByTagName('option');convert(input,datalist,listItems);if(childSelect){childSelect.parentNode.removeChild(childSelect);}}
|
||||
function convert(input,datalist,listItems){var fakeList=document.createElement('ul');var visibleItems=null;fakeList.id=listId;fakeList.className=LIST_CLASS;document.body.appendChild(fakeList);var scrollValue=0;var tempItems=document.createDocumentFragment();for(var i=0;i<listItems.length;i++){var item=listItems[i];var li=document.createElement('li');li.innerText=item.value;tempItems.appendChild(li);}
|
||||
fakeList.appendChild(tempItems);var fakeItems=fakeList.childNodes;var eachItem=function(callback){for(var i=0;i<fakeItems.length;i++){callback(fakeItems[i]);}};var listen=function(elem,event,func){if(elem.addEventListener){elem.addEventListener(event,func,false);}else{elem.attachEvent('on'+event,func);}};datalist.parentNode.removeChild(datalist);listen(input,'focus',function(){fakeList.scrollTop=0;scrollValue=0;});listen(input,'blur',function(evt){setTimeout(function(){fakeList.style.display='none';eachItem(function(item){item.className='';});},100);});var positionList=function(){fakeList.style.top=input.offsetTop+input.offsetHeight+'px';fakeList.style.left=input.offsetLeft+'px';fakeList.style.width=input.offsetWidth+'px';};var itemSelected=function(item){input.value=item.innerText;triggerEvent(input,'change');setTimeout(function(){fakeList.style.display='none';},100);};var buildList=function(e){fakeList.style.display='block';positionList();visibleItems=[];eachItem(function(item){var query=input.value.toLowerCase();var isFound=query.length&&item.innerText.toLowerCase().indexOf(query)>-1;if(isFound){visibleItems.push(item);}
|
||||
item.style.display=isFound?'block':'none';});};listen(input,'keyup',buildList);listen(input,'focus',buildList);eachItem(function(item){listen(item,'mouseover',function(evt){eachItem(function(_item){_item.className=item==_item?ACTIVE_CLASS:'';});});listen(item,'mouseout',function(evt){item.className='';});listen(item,'mousedown',function(evt){itemSelected(item);});});listen(window,'resize',positionList);listen(input,'keydown',function(e){var activeItem=fakeList.querySelector("."+ACTIVE_CLASS);if(!visibleItems.length){return;}
|
||||
var lastVisible=visibleItems[visibleItems.length-1];var datalistItemsHeight=lastVisible.offsetTop+lastVisible.offsetHeight;var isUp=e.keyCode==38;var isDown=e.keyCode==40;if((isUp||isDown)){if(isDown&&!activeItem){visibleItems[0].className=ACTIVE_CLASS;}else if(activeItem){var prevVisible=null;var nextVisible=null;for(var i=0;i<visibleItems.length;i++){var visItem=visibleItems[i];if(visItem==activeItem){prevVisible=visibleItems[i-1];nextVisible=visibleItems[i+1];break;}}
|
||||
activeItem.className='';if(isUp){if(prevVisible){prevVisible.className=ACTIVE_CLASS;if(prevVisible.offsetTop<fakeList.scrollTop){fakeList.scrollTop-=prevVisible.offsetHeight;}}else{visibleItems[visibleItems.length-1].className=ACTIVE_CLASS;}}
|
||||
if(isDown){if(nextVisible){nextVisible.className=ACTIVE_CLASS;if(nextVisible.offsetTop+nextVisible.offsetHeight>fakeList.scrollTop+fakeList.offsetHeight){fakeList.scrollTop+=nextVisible.offsetHeight;}}else{visibleItems[0].className=ACTIVE_CLASS;}}}}
|
||||
if(activeItem&&(e.keyCode==13||e.keyCode==9)){itemSelected(activeItem);}});}}(document));
|
||||
|
||||
(function(a,b){(function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};t=a.document,d="before",c="after",m="readyState",l="addEventListener",k="removeEventListener",g="dispatchEvent",q="XMLHttpRequest",h="FormData",n=["load","loadend","loadstart"],e=["progress","abort","error","timeout"],w=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1]),isNaN(w)&&(w=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1])),(A=Array.prototype).indexOf||(A.indexOf=function(a){var b,c,d,e;for(b=d=0,e=this.length;e>d;b=++d)if(c=this[b],c===a)return b;return-1}),y=function(a,b){return Array.prototype.slice.call(a,b)},s=function(a){return"returnValue"===a||"totalSize"===a||"position"===a},v=function(a,b){var c,d;for(c in a)if(d=a[c],!s(c))try{b[c]=a[c]}catch(e){}return b},x=function(a,b,c){var d,e,f,h;for(e=function(a){return function(d){var e,f,h;e={};for(f in d)s(f)||(h=d[f],e[f]=h===b?c:h);return c[g](a,e)}},f=0,h=a.length;h>f;f++)d=a[f],c._has(d)&&(b["on"+d]=e(d))},u=function(a){var b;if(null!=t.createEventObject)return b=t.createEventObject(),b.type=a,b;try{return new Event(a)}catch(c){return{type:a}}},f=function(a){var c,d,e;return d={},e=function(a){return d[a]||[]},c={},c[l]=function(a,c,f){d[a]=e(a),d[a].indexOf(c)>=0||(f=f===b?d[a].length:f,d[a].splice(f,0,c))},c[k]=function(a,c){var f;return a===b?void(d={}):(c===b&&(d[a]=[]),f=e(a).indexOf(c),void(-1!==f&&e(a).splice(f,1)))},c[g]=function(){var b,d,f,g,h,i,j,k;for(b=y(arguments),d=b.shift(),a||(b[0]=v(b[0],u(d))),g=c["on"+d],g&&g.apply(c,b),k=e(d).concat(e("*")),f=i=0,j=k.length;j>i;f=++i)h=k[f],h.apply(c,b)},c._has=function(a){return!(!d[a]&&!c["on"+a])},a&&(c.listeners=function(a){return y(e(a))},c.on=c[l],c.off=c[k],c.fire=c[g],c.once=function(a,b){var d;return d=function(){return c.off(a,d),b.apply(null,arguments)},c.on(a,d)},c.destroy=function(){return d={}}),c},z=f(!0),z.EventEmitter=f,z[d]=function(a,b){if(a.length<1||a.length>2)throw"invalid hook";return z[l](d,a,b)},z[c]=function(a,b){if(a.length<2||a.length>3)throw"invalid hook";return z[l](c,a,b)},z.enable=function(){a[q]=p,i&&(a[h]=o)},z.disable=function(){a[q]=z[q],i&&(a[h]=i)},r=z.headers=function(a,b){var c,d,e,f,g,h,i,j,k;switch(null==b&&(b={}),typeof a){case"object":d=[];for(e in a)g=a[e],f=e.toLowerCase(),d.push(""+f+": "+g);return d.join("\n");case"string":for(d=a.split("\n"),i=0,j=d.length;j>i;i++)c=d[i],/([^:]+):\s*(.+)/.test(c)&&(f=null!=(k=RegExp.$1)?k.toLowerCase():void 0,h=RegExp.$2,null==b[f]&&(b[f]=h));return b}},i=a[h],o=function(a){var b;this.fd=a?new i(a):new i,this.form=a,b=[],Object.defineProperty(this,"entries",{get:function(){var c;return c=a?y(a.querySelectorAll("input,select")).filter(function(a){var b;return"checkbox"!==(b=a.type)&&"radio"!==b||a.checked}).map(function(a){return[a.name,"file"===a.type?a.files:a.value]}):[],c.concat(b)}}),this.append=function(a){return function(){var c;return c=y(arguments),b.push(c),a.fd.append.apply(a.fd,c)}}(this)},i&&(z[h]=i,a[h]=o),j=a[q],z[q]=j,p=a[q]=function(){var a,b,h,i,j,k,p,s,t,u,y,A,C,D,E,F,G,H,I,J,K;a=-1,H=new z[q],y={},D=null,p=void 0,E=void 0,A=void 0,u=function(){var b,c,d,e;if(A.status=D||H.status,D===a&&10>w||(A.statusText=H.statusText),D!==a){e=r(H.getAllResponseHeaders());for(b in e)d=e[b],A.headers[b]||(c=b.toLowerCase(),A.headers[c]=d)}},t=function(){H.responseType&&"text"!==H.responseType?"document"===H.responseType?(A.xml=H.responseXML,A.data=H.responseXML):A.data=H.response:(A.text=H.responseText,A.data=H.responseText),"responseURL"in H&&(A.finalUrl=H.responseURL)},G=function(){k.status=A.status,k.statusText=A.statusText},F=function(){"text"in A&&(k.responseText=A.text),"xml"in A&&(k.responseXML=A.xml),"data"in A&&(k.response=A.data),"finalUrl"in A&&(k.responseURL=A.finalUrl)},i=function(a){for(;a>b&&4>b;)k[m]=++b,1===b&&k[g]("loadstart",{}),2===b&&G(),4===b&&(G(),F()),k[g]("readystatechange",{}),4===b&&setTimeout(h,0)},h=function(){p||k[g]("load",{}),k[g]("loadend",{}),p&&(k[m]=0)},b=0,C=function(a){var b,d;return 4!==a?void i(a):(b=z.listeners(c),d=function(){var a;return b.length?(a=b.shift(),2===a.length?(a(y,A),d()):3===a.length&&y.async?a(y,A,d):d()):i(4)},void d())},k=y.xhr=f(),H.onreadystatechange=function(){try{2===H[m]&&u()}catch(a){}4===H[m]&&(E=!1,u(),t()),C(H[m])},s=function(){p=!0},k[l]("error",s),k[l]("timeout",s),k[l]("abort",s),k[l]("progress",function(){3>b?C(3):k[g]("readystatechange",{})}),("withCredentials"in H||z.addWithCredentials)&&(k.withCredentials=!1),k.status=0,K=e.concat(n);for(I=0,J=K.length;J>I;I++)j=K[I],k["on"+j]=null;return k.open=function(a,c,d,e,f){b=0,p=!1,E=!1,y.headers={},y.headerNames={},y.status=0,A={},A.headers={},y.method=a,y.url=c,y.async=d!==!1,y.user=e,y.pass=f,C(1)},k.send=function(a){var b,c,f,g,h,i,j,l;for(l=["type","timeout","withCredentials"],i=0,j=l.length;j>i;i++)c=l[i],f="type"===c?"responseType":c,f in kLine truncated
|
||||
http.get(template).then(function(element){return function(data){parse(data,element);}}(element),function(){throw new Error('Failed loading template');});}});(function(a,b){(function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};t=a.document,d="before",c="after",m="readyState",l="addEventListener",k="removeEventListener",g="dispatchEvent",q="XMLHttpRequest",h="FormData",n=["load","loadend","loadstart"],e=["progress","abort","error","timeout"],w=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1]),isNaN(w)&&(w=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1])),(A=Array.prototype).indexOf||(A.indexOf=function(a){var b,c,d,e;for(b=d=0,e=this.length;e>d;b=++d)if(c=this[b],c===a)return b;return-1}),y=function(a,b){return Array.prototype.slice.call(a,b)},s=function(a){return"returnValue"===a||"totalSize"===a||"position"===a},v=function(a,b){var c,d;for(c in a)if(d=a[c],!s(c))try{b[c]=a[c]}catch(e){}return b},x=function(a,b,c){var d,e,f,h;for(e=function(a){return function(d){var e,f,h;e={};for(f in d)s(f)||(h=d[f],e[f]=h===b?c:h);return c[g](a,e)}},f=0,h=a.length;h>f;f++)d=a[f],c._has(d)&&(b["on"+d]=e(d))},u=function(a){var b;if(null!=t.createEventObject)return b=t.createEventObject(),b.type=a,b;try{return new Event(a)}catch(c){return{type:a}}},f=function(a){var c,d,e;return d={},e=function(a){return d[a]||[]},c={},c[l]=function(a,c,f){d[a]=e(a),d[a].indexOf(c)>=0||(f=f===b?d[a].length:f,d[a].splice(f,0,c))},c[k]=function(a,c){var f;return a===b?void(d={}):(c===b&&(d[a]=[]),f=e(a).indexOf(c),void(-1!==f&&e(a).splice(f,1)))},c[g]=function(){var b,d,f,g,h,i,j,k;for(b=y(arguments),d=b.shift(),a||(b[0]=v(b[0],u(d))),g=c["on"+d],g&&g.apply(c,b),k=e(d).concat(e("*")),f=i=0,j=k.length;j>i;f=++i)h=k[f],h.apply(c,b)},c._has=function(a){return!(!d[a]&&!c["on"+a])},a&&(c.listeners=function(a){return y(e(a))},c.on=c[l],c.off=c[k],c.fire=c[g],c.once=function(a,b){var d;return d=function(){return c.off(a,d),b.apply(null,arguments)},c.on(a,d)},c.destroy=function(){return d={}}),c},z=f(!0),z.EventEmitter=f,z[d]=function(a,b){if(a.length<1||a.length>2)throw"invalid hook";return z[l](d,a,b)},z[c]=function(a,b){if(a.length<2||a.length>3)throw"invalid hook";return z[l](c,a,b)},z.enable=function(){a[q]=p,i&&(a[h]=o)},z.disable=function(){a[q]=z[q],i&&(a[h]=i)},r=z.headers=function(a,b){var c,d,e,f,g,h,i,j,k;switch(null==b&&(b={}),typeof a){case"object":d=[];for(e in a)g=a[e],f=e.toLowerCase(),d.push(""+f+": "+g);return d.join("\n");case"string":for(d=a.split("\n"),i=0,j=d.length;j>i;i++)c=d[i],/([^:]+):\s*(.+)/.test(c)&&(f=null!=(k=RegExp.$1)?k.toLowerCase():void 0,h=RegExp.$2,null==b[f]&&(b[f]=h));return b}},i=a[h],o=function(a){var b;this.fd=a?new i(a):new i,this.form=a,b=[],Object.defineProperty(this,"entries",{get:function(){var c;return c=a?y(a.querySelectorAll("input,select")).filter(function(a){var b;return"checkbox"!==(b=a.type)&&"radio"!==b||a.checked}).map(function(a){return[a.name,"file"===a.type?a.files:a.value]}):[],c.concat(b)}}),this.append=function(a){return function(){var c;return c=y(arguments),b.push(c),a.fd.append.apply(a.fd,c)}}(this)},i&&(z[h]=i,a[h]=o),j=a[q],z[q]=j,p=a[q]=function(){var a,b,h,i,j,k,p,s,t,u,y,A,C,D,E,F,G,H,I,J,K;a=-1,H=new z[q],y={},D=null,p=void 0,E=void 0,A=void 0,u=function(){var b,c,d,e;if(A.status=D||H.status,D===a&&10>w||(A.statusText=H.statusText),D!==a){e=r(H.getAllResponseHeaders());for(b in e)d=e[b],A.headers[b]||(c=b.toLowerCase(),A.headers[c]=d)}},t=function(){H.responseType&&"text"!==H.responseType?"document"===H.responseType?(A.xml=H.responseXML,A.data=H.responseXML):A.data=H.response:(A.text=H.responseText,A.data=H.responseText),"responseURL"in H&&(A.finalUrl=H.responseURL)},G=function(){k.status=A.status,k.statusText=A.statusText},F=function(){"text"in A&&(k.responseText=A.text),"xml"in A&&(k.responseXML=A.xml),"data"in A&&(k.response=A.data),"finalUrl"in A&&(k.responseURL=A.finalUrl)},i=function(a){for(;a>b&&4>b;)k[m]=++b,1===b&&k[g]("loadstart",{}),2===b&&G(),4===b&&(G(),F()),k[g]("readystatechange",{}),4===b&&setTimeout(h,0)},h=function(){p||k[g]("load",{}),k[g]("loadend",{}),p&&(k[m]=0)},b=0,C=function(a){var b,d;return 4!==a?void i(a):(b=z.listeners(c),d=function(){var a;return b.length?(a=b.shift(),2===a.length?(a(y,A),d()):3===a.length&&y.async?a(y,A,d):d()):i(4)},void d())},k=y.xhr=f(),H.onreadystatechange=function(){try{2===H[m]&&u()}catch(a){}4===H[m]&&(E=!1,u(),t()),C(H[m])},s=function(){p=!0},k[l]("error",s),k[l]("timeout",s),k[l]("abort",s),k[l]("progress",function(){3>b?C(3):k[g]("readystatechange",{})}),("withCredentials"in H||z.addWithCredentials)&&(k.withCredentials=!1),k.status=0,K=e.concat(n);for(I=0,J=K.length;J>I;I++)j=K[I],k["on"+j]=null;return k.open=function(a,c,d,e,f){b=0,p=!1,E=!1,y.headers={},y.headerNames={},y.status=0,A={},A.headers={},y.method=a,y.url=c,y.async=d!==!1,y.user=e,y.passLine truncated
|
||||
if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href;};let request=function(method,url,headers,payload,progress){let i;http.addGlobalHeader('X-Appwrite-Project',config.project);http.addGlobalHeader('X-Appwrite-Locale',config.locale);http.addGlobalHeader('X-Appwrite-Mode',config.mode);if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('let method must contain a valid HTTP method name');}
|
||||
if(typeof url!=='string'){throw new Error('let url must be of type string');}
|
||||
if(typeof headers!=='object'){throw new Error('let headers must be of type object');}
|
||||
@@ -2154,7 +2242,7 @@ return(date.getTime()/1000)}
|
||||
return{format:format,strtotime:strtotime}}(),true);})(window);(function(window){"use strict";window.ls.container.set('di',function(){var list={'load':true};return{listen:function(event,callback){if(list[event]){callback();}
|
||||
document.addEventListener(event,callback);},report:function(event){list[event]=true;},check:function(event){return(list[event]);},reset:function(){list={'load':true};},list:list};},true);})(window);(function(window){"use strict";window.ls.container.set('env',function(){return APP_ENV;},true);})(window);(function(window){"use strict";window.ls.container.set('markdown',function(window){var md=window.markdownit();function renderEm(tokens,idx,opts,_,slf){var token=tokens[idx];if(token.markup==='__'){token.tag='u';}
|
||||
return slf.renderToken(tokens,idx,opts);}
|
||||
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.AppwriteSDK();sdk.config.domain=APP_ENV.API;sdk.config.project=router.params.project||null;sdk.config.locale=APP_ENV.LOCALE;sdk.config.mode='admin';return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add('/auth/signin',{template:'/auth/signin',scope:'home'}).add('/auth/signup',{template:'/auth/signup',scope:'home'}).add('/auth/recovery',{template:'/auth/recovery',scope:'home'}).add('/auth/recovery/reset',{template:'/auth/recovery/reset',scope:'home'}).add('/auth/confirm',{template:'/auth/confirm',scope:'home'}).add('/auth/join',{template:'/auth/join',scope:'home'}).add('/console',{template:'/console',scope:'console'}).add('/console/account',{template:'/console/account',scope:'console'}).add('/console/account/:tab',{template:'/console/account',scope:'console'}).add('/console/home',{template:'/console/home',scope:'console',project:true}).add('/console/home/:tab',{template:'/console/home',scope:'console',project:true}).add('/console/platforms/:platform',{template:function(window){return window.location.pathname;},scope:'console',project:true}).add('/console/notifications',{template:'/console/notifications',scope:'console'}).add('/console/settings',{template:'/console/settings',scope:'console',project:true}).add('/console/settings/:tab',{template:'/console/settings',scope:'console',project:true}).add('/console/database',{template:'/console/database',scope:'console',project:true}).add('/console/database/:tab',{template:'/console/database',scope:'console',project:true}).add('/console/storage',{template:'/console/storage',scope:'console',project:true}).add('/console/storage/:tab',{template:'/console/storage',scope:'console',project:true}).add('/console/users',{template:'/console/users',scope:'console',project:true}).add('/console/users/view',{template:'/console/users/view',scope:'console',project:true}).add('/console/users/view/:tab',{template:'/console/users/view',scope:'console',project:true}).add('/console/users/:tab',{template:'/console/users',scope:'console',project:true});let date=window.ls.container.get('date');let timezone=window.ls.container.get('timezone');let markdown=window.ls.container.get('markdown');window.ls.filter.add('lowerCase',function(value){return value.toLowerCase();}).add('date',function(value,options){return date.format('Y-m-d',value);}).add('date-time',function(value,options){return date.format('Y-m-d H:i',value);}).add('date-text',function(value,options){return date.format('d M Y',value);}).add('date-long',function(value,options){return date.format('l, j F, H:i',value);}).add('min2hum',function(value,options){if(value>=60){if(value%60===0){return Math.ceil(value/60)+' hours';}
|
||||
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.AppwriteSDK();sdk.config.domain=APP_ENV.API;sdk.config.project=router.params.project||null;sdk.config.locale=APP_ENV.LOCALE;sdk.config.mode='admin';return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add('/auth/signin',{template:'/auth/signin?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/signup',{template:'/auth/signup?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/recovery',{template:'/auth/recovery?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/recovery/reset',{template:'/auth/recovery/reset?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/confirm',{template:'/auth/confirm?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/join',{template:'/auth/join?version='+APP_ENV.VERSION,scope:'home'}).add('/console',{template:'/console?version='+APP_ENV.VERSION,scope:'console'}).add('/console/account',{template:'/console/account?version='+APP_ENV.VERSION,scope:'console'}).add('/console/account/:tab',{template:'/console/account?version='+APP_ENV.VERSION,scope:'console'}).add('/console/home',{template:'/console/home?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/home/:tab',{template:'/console/home?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/platforms/:platform',{template:function(window){return window.location.pathname+'?version='+APP_ENV.VERSION;},scope:'console',project:true}).add('/console/notifications',{template:'/console/notifications?version='+APP_ENV.VERSION,scope:'console'}).add('/console/settings',{template:'/console/settings?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/settings/:tab',{template:'/console/settings?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/database',{template:'/console/database?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/database/:tab',{template:'/console/database?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/storage',{template:'/console/storage?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/storage/:tab',{template:'/console/storage?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users',{template:'/console/users?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users/view',{template:'/console/users/view?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users/view/:tab',{template:'/console/users/view?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users/:tab',{template:'/console/users?version='+APP_ENV.VERSION,scope:'console',project:true});let date=window.ls.container.get('date');let timezone=window.ls.container.get('timezone');let markdown=window.ls.container.get('markdown');window.ls.filter.add('lowerCase',function(value){return value.toLowerCase();}).add('date',function(value,options){return date.format('Y-m-d',value);}).add('date-time',function(value,options){return date.format('Y-m-d H:i',value);}).add('date-text',function(value,options){return date.format('d M Y',value);}).add('date-long',function(value,options){return date.format('l, j F, H:i',value);}).add('min2hum',function(value,options){if(value>=60){if(value%60===0){return Math.ceil(value/60)+' hours';}
|
||||
else{return Math.ceil(value/60)+' hours and '+(value%60)+' minutes';}}
|
||||
return value+' minutes';}).add('ms2hum',function(value,options){let temp=value;const years=Math.floor(temp/31536000),days=Math.floor((temp%=31536000)/86400),hours=Math.floor((temp%=86400)/3600),minutes=Math.floor((temp%=3600)/60),seconds=temp%60;if(days||hours||seconds||minutes){return(years?years+"y ":"")+
|
||||
(days?days+"d ":"")+
|
||||
|
||||
Vendored
+15
-30
@@ -1923,8 +1923,7 @@ return null;}
|
||||
if(service.instance===null){let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;}
|
||||
if(key==="__watch"){return this.watch;}
|
||||
if(key==="__proxy"){return true;}
|
||||
if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}
|
||||
else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;}
|
||||
if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;}
|
||||
if(key==="__watch"){return this.watch=value;}
|
||||
target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;}
|
||||
skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);}
|
||||
@@ -1935,8 +1934,7 @@ let self=this;let FN_ARGS=/^function\s*[^\(]*\(\s*([^\)]*)\)/m;let text=target.t
|
||||
object=object[path.shift()];}
|
||||
if(undefined!==value){object[path.shift()]=value;return true;}
|
||||
if(undefined===object){return null;}
|
||||
let shift=path.shift();if(undefined===shift){result=object;}
|
||||
else{return object[shift];}
|
||||
let shift=path.shift();if(undefined===shift){result=object;}else{return object[shift];}
|
||||
return result;};let bind=function(element,path,callback,as,prefix){as=(as)?as:container.get('$as');prefix=(prefix)?prefix:container.get('$prefix');let event=path.replace(as+'.',prefix+'.')+'.changed';let printer=function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;}
|
||||
callback();};document.addEventListener(event,printer);};let container={set:set,get:get,resolve:resolve,path:path,bind:bind,setCachePrefix:setCachePrefix,getCachePrefix:getCachePrefix};set('container',container,true,false,false);return container;}();window.ls.container.set('http',function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){param=encodeURIComponent(param);let a=document.createElement('a');param+=(value?"="+encodeURIComponent(value):"");a.href=url;a.search+=(a.search?"&":"")+param;return a.href;};let request=function(method,url,headers,payload,progress){let i;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
@@ -1945,8 +1943,7 @@ if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
for(i=0;i<globalParams.length;i++){url=addParam(url,globalParams[i].key,globalParams[i].value);}
|
||||
return new Promise(function(resolve,reject){let xmlhttp=new XMLHttpRequest();xmlhttp.open(method,url,true);xmlhttp.setRequestHeader('Ajax','1');for(i=0;i<globalHeaders.length;i++){xmlhttp.setRequestHeader(globalHeaders[i].key,globalHeaders[i].value);}
|
||||
for(let key in headers){if(headers.hasOwnProperty(key)){xmlhttp.setRequestHeader(key,headers[key]);}}
|
||||
xmlhttp.onload=function(){if(4===xmlhttp.readyState&&200===xmlhttp.status){resolve(xmlhttp.response);}
|
||||
else{document.dispatchEvent(new CustomEvent('http-'+method.toLowerCase()+'-'+xmlhttp.status));reject(new Error(xmlhttp.statusText));}};if(progress){xmlhttp.addEventListener('progress',progress);xmlhttp.upload.addEventListener('progress',progress,false);}
|
||||
xmlhttp.onload=function(){if(4===xmlhttp.readyState&&200===xmlhttp.status){resolve(xmlhttp.response);}else{document.dispatchEvent(new CustomEvent('http-'+method.toLowerCase()+'-'+xmlhttp.status));reject(new Error(xmlhttp.statusText));}};if(progress){xmlhttp.addEventListener('progress',progress);xmlhttp.upload.addEventListener('progress',progress,false);}
|
||||
xmlhttp.onerror=function(){reject(new Error("Network Error"));};xmlhttp.send(payload);})};return{'get':function(url){return request('GET',url,{},'')},'post':function(url,headers,payload){return request('POST',url,headers,payload)},'put':function(url,headers,payload){return request('PUT',url,headers,payload)},'patch':function(url,headers,payload){return request('PATCH',url,headers,payload)},'delete':function(url){return request('DELETE',url,{},'')},'addGlobalParam':function(key,value){globalParams.push({key:key,value:value});},'addGlobalHeader':function(key,value){globalHeaders.push({key:key,value:value});}}},true,false,false);window.ls.container.set('cookie',function(document){function get(name){let value="; "+document.cookie,parts=value.split("; "+name+"=");if(parts.length===2){return parts.pop().split(";").shift();}
|
||||
return null;}
|
||||
function set(name,value,days){let date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));let expires=(0<days)?'expires='+date.toUTCString():'expires=0';document.cookie=name+"="+value+";"+expires+";path=/";return this;}
|
||||
@@ -1970,22 +1967,16 @@ return def;};let getParams=function(){return state.params;};let getURL=function(
|
||||
if(typeof view!=='object'){throw new Error('view must be of type object');}
|
||||
states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname+((location.hash)?location.hash:'');states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;}
|
||||
return b.path.length-a.path.length;});for(let i=0;i<states.length;i++){let value=states[i];value.path=(value.path.substring(0,1)!=='/')?location.pathname+value.path:value.path;let match=new RegExp("^"+value.path.replace(/:[^\s/]+/g,'([\\w-]+)')+"$");let found=url.match(match);if(found){previous=current;current=value;return value;}}
|
||||
return null};let change=function(URL,replace){if(!replace){window.history.pushState({},'',URL);}
|
||||
else{window.history.replaceState({},'',URL);}
|
||||
return null};let change=function(URL,replace){if(!replace){window.history.pushState({},'',URL);}else{window.history.replaceState({},'',URL);}
|
||||
window.dispatchEvent(new PopStateEvent('popstate',{}));return this;};let reload=function(){return change(window.location.href);};let getJsonFromUrl=function(URL){let query;if(URL){let pos=location.href.indexOf('?');if(pos===-1)return[];query=location.href.substr(pos+1);}else{query=location.search.substr(1);}
|
||||
let result={};query.split('&').forEach(function(part){if(!part){return;}
|
||||
part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}
|
||||
else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];}
|
||||
if(!index){result[key].push(val);}
|
||||
else{result[key][index]=val;}}});return result;};let state={setParam:setParam,getParam:getParam,getParams:getParams,getURL:getURL,add:add,change:change,reload:reload,reset:reset,match:match,getCurrent:getCurrent,setCurrent:setCurrent,getPrevious:getPrevious,setPrevious:setPrevious,params:getJsonFromUrl(window.location.search),hash:window.location.hash};return state;},true,false,false);window.ls.container.set('expression',function(container,filter,$as,$prefix){let reg=/(\{{.*?\}})/gi;let paths=[];return{parse:function(string,def,as,prefix){def=def||'';paths=[];return string.replace(reg,function(match)
|
||||
{let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=(reference[0]||'');let result=container.path(path,undefined,as,prefix);if(!paths.includes(path)){paths.push(path);}
|
||||
part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];}
|
||||
if(!index){result[key].push(val);}else{result[key][index]=val;}}});return result;};let state={setParam:setParam,getParam:getParam,getParams:getParams,getURL:getURL,add:add,change:change,reload:reload,reset:reset,match:match,getCurrent:getCurrent,setCurrent:setCurrent,getPrevious:getPrevious,setPrevious:setPrevious,params:getJsonFromUrl(window.location.search),hash:window.location.hash};return state;},true,false,false);window.ls.container.set('expression',function(container,filter,$as,$prefix){let reg=/(\{{.*?\}})/gi;let paths=[];return{parse:function(string,def,as,prefix){def=def||'';paths=[];return string.replace(reg,function(match){let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=(reference[0]||'');let result=container.path(path,undefined,as,prefix);if(!paths.includes(path)){paths.push(path);}
|
||||
result=(null===result||undefined===result)?def:result;result=(typeof result==='object')?JSON.stringify(result):result;if(reference.length>=2){for(let i=1;i<reference.length;i++){result=filter.apply(reference[i],result);}}
|
||||
return result;});},getPaths:function(){return paths;},}},true,false,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false,false);return container.resolve(filters[name]);};add('uppercase',function($value){return $value.toUpperCase();});add('lowercase',function($value){return $value.toLowerCase();});return{add:add,apply:apply}},true,false,false);window.ls.container.get('filter').add('escape',function(value){if(typeof value!=='string'){return value;}
|
||||
return value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false,false).set('document',window.document,true,false,false).set('element',window.document,true,false,false);window.ls.run=function(window){try{this.view.render(window.document);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let scopeElement=document.createElement('div');let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
return value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false,false).set('document',window.document,true,false,false).set('element',window.document,true,false,false);window.ls.run=function(window){try{this.view.render(window.document);}catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let scopeElement=document.createElement('div');let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
router.reset();if(null===route){return;}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';}
|
||||
else if(null!==router.getPrevious()){view.render(element);}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';}else if(null!==router.getPrevious()){view.render(element);}
|
||||
document.dispatchEvent(new CustomEvent('state-changed'));};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};scopeElement.setAttribute('data-ls-scope','');element.insertBefore(scopeElement,element.firstChild);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
@@ -1997,25 +1988,19 @@ let route=router.match(target);if(null===route){return false;}
|
||||
event.preventDefault();if(window.location===target.href){return false;}
|
||||
route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;}
|
||||
window.history.pushState({},'Unknown',target.href);}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i].split('=');let key=(attr[0])?expression.parse(attr[0],null,$as,$prefix):null;paths=paths.concat(expression.getPaths());let value=(attr[1])?expression.parse(attr[1],null,$as,$prefix):null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container,$prefix,$as){let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}
|
||||
else{element.removeAttribute('checked');}}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}
|
||||
else{element.removeAttribute('checked');element.checked=false;}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i];let key=expression.parse(attr.substring(0,attr.indexOf('=')),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());let value=expression.parse(attr.substring(attr.indexOf('=')+1),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container,$prefix,$as){let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}else{element.removeAttribute('checked');}}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}else{element.removeAttribute('checked');element.checked=false;}
|
||||
if(bind){element.addEventListener('change',function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.checked,$as,$prefix);}});}}
|
||||
return;}
|
||||
if(element.value!==value){element.value=value;}
|
||||
if(bind){element.addEventListener('input',sync);}}
|
||||
else{if(element.innerText!==value){element.innerHTML=value;}}};let sync=(function(as,prefix){return function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.value,as,prefix);}}})($as,$prefix);let syntax=element.getAttribute('data-ls-bind');let result=expression.parse(syntax,null,$as,$prefix);let paths=expression.getPaths();echo(result,true);for(let i=0;i<paths.length;i++){container.bind(element,paths[i],function(){echo(expression.parse(syntax,null,$as,$prefix),false);});}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,$as,$prefix){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(){if(debug){console.info('debug-ls-if',expression.parse(syntax,'undefined',$as,$prefix));}
|
||||
try{result=!!(eval(expression.parse(syntax,'undefined',$as,$prefix).replace(/(\r\n|\n|\r)/gm,' ')));}
|
||||
catch(error){throw new Error('Failed to evaluate expression "'+syntax+'": '+error);}
|
||||
paths=expression.getPaths();if(!result){element.style.visibility='hidden';element.style.display='none';}
|
||||
else{element.style.removeProperty('display');element.style.removeProperty('visibility');}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-loop',template:false,repeat:false,nested:false,controller:function(element,view,container,window){let expr=element.getAttribute('data-ls-loop');let as=element.getAttribute('data-ls-as');let echo=function(){let array=container.path(expr);array=(!array)?[]:array;while(element.hasChildNodes()){element.removeChild(element.lastChild);element.lastChild=null;}
|
||||
if(bind){element.addEventListener('input',sync);}}else{if(element.innerText!==value){element.innerHTML=value;}}};let sync=(function(as,prefix){return function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.value,as,prefix);}}})($as,$prefix);let syntax=element.getAttribute('data-ls-bind');let result=expression.parse(syntax,null,$as,$prefix);let paths=expression.getPaths();echo(result,true);for(let i=0;i<paths.length;i++){container.bind(element,paths[i],function(){echo(expression.parse(syntax,null,$as,$prefix),false);});}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,$as,$prefix){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(){if(debug){console.info('debug-ls-if',expression.parse(syntax,'undefined',$as,$prefix));}
|
||||
try{result=!!(eval(expression.parse(syntax,'undefined',$as,$prefix).replace(/(\r\n|\n|\r)/gm,' ')));}catch(error){throw new Error('Failed to evaluate expression "'+syntax+'": '+error);}
|
||||
paths=expression.getPaths();if(!result){element.style.visibility='hidden';element.style.display='none';}else{element.style.removeProperty('display');element.style.removeProperty('visibility');}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-loop',template:false,repeat:false,nested:false,controller:function(element,view,container,window){let expr=element.getAttribute('data-ls-loop');let as=element.getAttribute('data-ls-as');let echo=function(){let array=container.path(expr);array=(!array)?[]:array;while(element.hasChildNodes()){element.removeChild(element.lastChild);element.lastChild=null;}
|
||||
if(array instanceof Array&&typeof array!=='object'){throw new Error('Reference value must be array or object. '+(typeof array)+' given');}
|
||||
let children=[];element.$lsSkip=true;element.style.visibility=(0===array.length)?'hidden':'visible';for(let prop in array){if(!array.hasOwnProperty(prop)){continue;}
|
||||
children[prop]=template.cloneNode(true);element.appendChild(children[prop]);(function(index){let context=expr+'.'+index;container.set(as,container.path(context),true);container.set('$index',index,true,false,false);container.set('$prefix',context,true,false,false);container.set('$as',as,true,false,false);view.render(children[prop]);})(prop);}
|
||||
container.set('$index',null,true,false,false);container.set('$prefix','',true,false,false);container.set('$as','',true,false,false);};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr,echo);container.bind(element,expr+'.length',echo);}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:true,controller:function(element,view,http,expression,document){let template=expression.parse(element.getAttribute('data-ls-template'));let type=element.getAttribute('data-type')||'url';element.innerHTML='';let parse=function(data,element){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));};if('script'===type){let inlineTemplate=document.getElementById(template);if(inlineTemplate&&inlineTemplate.innerHTML){parse(inlineTemplate.innerHTML,element);}
|
||||
else{element.innerHTML='<span style="color: red">Missing template "'+template+'"</span>';}
|
||||
container.set('$index',null,true,false,false);container.set('$prefix','',true,false,false);container.set('$as','',true,false,false);};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr,echo);container.bind(element,expr+'.length',echo);}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:true,controller:function(element,view,http,expression,document){let template=expression.parse(element.getAttribute('data-ls-template'));let type=element.getAttribute('data-type')||'url';element.innerHTML='';let parse=function(data,element){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));};if('script'===type){let inlineTemplate=document.getElementById(template);if(inlineTemplate&&inlineTemplate.innerHTML){parse(inlineTemplate.innerHTML,element);}else{element.innerHTML='<span style="color: red">Missing template "'+template+'"</span>';}
|
||||
return;}
|
||||
http.get(template).then(function(element){return function(data){parse(data,element);}}(element),function(){throw new Error('Failed loading template');});}});!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}n(84);var o=n(41),i=r(o),a=function(){i["default"].addPickerToOtherInputs(),i["default"].supportsDateInput()||i["default"].addPickerToDateInputs()};a(),document.addEventListener("DOMContentLoaded",function(){a()}),document.querySelector("body").addEventListener("mousedown",function(){a()})},function(t,e,n){t.exports=!n(11)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(9),o=n(32),i=n(25),a=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(u){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(59),o=n(16);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(4),o=n(14);t.exports=n(1)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(23)("wks"),o=n(15),i=n(2).Symbol,a="function"==typeof i,u=t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))};u.store=r},function(t,e){var n=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){var r=n(12);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(2),o=n(8),i=n(56),a=n(6),u="prototype",s=function(t,e,n){var c,l,f,d=t&s.F,p=t&s.G,h=t&s.S,y=t&s.P,m=t&s.B,v=t&s.W,b=p?o:o[e]||(o[e]={}),g=b[u],x=p?r:h?r[e]:(r[e]||{})[u];p&&(n=e);for(c in n)l=!d&&x&&void 0!==x[c],l&&c in b||(f=l?x[c]:n[c],b[c]=p&&"function"!=typeof x[c]?n[c]:m&&l?i(f,r):v&&x[c]==f?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[u]=t[u],e}(f):y&&"function"==typeof f?i(Function.call,f):f,y&&((b.virtual||(b.virtual={}))[c]=f,t&s.R&&g&&!g[c]&&a(g,c,f)))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,t.exports=s},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(38),o=n(17);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e){t.exports={}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(4).f,o=n(3),i=n(7)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(23)("keys"),o=n(15);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e,n){var r=n(2),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(12);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(2),o=n(8),i=n(19),a=n(27),u=n(4).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},function(t,e,n){e.f=n(7)},function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(45),i=r(o);eLine truncated
|
||||
var inputs=document.querySelectorAll('input[list]');var triggerEvent=function(elem,eventType){var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent(eventType,true,true);elem.dispatchEvent(event);}else{event=document.createEventObject();event.eventType=eventType;elem.fireEvent("on"+eventType,event);}};for(var i=0;i<inputs.length;i++){var input=inputs[i];var listId=input.getAttribute('list');var datalist=document.getElementById(listId);if(!datalist){console.error('No datalist found for input: '+listId);return;}
|
||||
|
||||
Vendored
+105
-2
@@ -1,5 +1,108 @@
|
||||
|
||||
(function(a,b){(function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};t=a.document,d="before",c="after",m="readyState",l="addEventListener",k="removeEventListener",g="dispatchEvent",q="XMLHttpRequest",h="FormData",n=["load","loadend","loadstart"],e=["progress","abort","error","timeout"],w=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1]),isNaN(w)&&(w=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1])),(A=Array.prototype).indexOf||(A.indexOf=function(a){var b,c,d,e;for(b=d=0,e=this.length;e>d;b=++d)if(c=this[b],c===a)return b;return-1}),y=function(a,b){return Array.prototype.slice.call(a,b)},s=function(a){return"returnValue"===a||"totalSize"===a||"position"===a},v=function(a,b){var c,d;for(c in a)if(d=a[c],!s(c))try{b[c]=a[c]}catch(e){}return b},x=function(a,b,c){var d,e,f,h;for(e=function(a){return function(d){var e,f,h;e={};for(f in d)s(f)||(h=d[f],e[f]=h===b?c:h);return c[g](a,e)}},f=0,h=a.length;h>f;f++)d=a[f],c._has(d)&&(b["on"+d]=e(d))},u=function(a){var b;if(null!=t.createEventObject)return b=t.createEventObject(),b.type=a,b;try{return new Event(a)}catch(c){return{type:a}}},f=function(a){var c,d,e;return d={},e=function(a){return d[a]||[]},c={},c[l]=function(a,c,f){d[a]=e(a),d[a].indexOf(c)>=0||(f=f===b?d[a].length:f,d[a].splice(f,0,c))},c[k]=function(a,c){var f;return a===b?void(d={}):(c===b&&(d[a]=[]),f=e(a).indexOf(c),void(-1!==f&&e(a).splice(f,1)))},c[g]=function(){var b,d,f,g,h,i,j,k;for(b=y(arguments),d=b.shift(),a||(b[0]=v(b[0],u(d))),g=c["on"+d],g&&g.apply(c,b),k=e(d).concat(e("*")),f=i=0,j=k.length;j>i;f=++i)h=k[f],h.apply(c,b)},c._has=function(a){return!(!d[a]&&!c["on"+a])},a&&(c.listeners=function(a){return y(e(a))},c.on=c[l],c.off=c[k],c.fire=c[g],c.once=function(a,b){var d;return d=function(){return c.off(a,d),b.apply(null,arguments)},c.on(a,d)},c.destroy=function(){return d={}}),c},z=f(!0),z.EventEmitter=f,z[d]=function(a,b){if(a.length<1||a.length>2)throw"invalid hook";return z[l](d,a,b)},z[c]=function(a,b){if(a.length<2||a.length>3)throw"invalid hook";return z[l](c,a,b)},z.enable=function(){a[q]=p,i&&(a[h]=o)},z.disable=function(){a[q]=z[q],i&&(a[h]=i)},r=z.headers=function(a,b){var c,d,e,f,g,h,i,j,k;switch(null==b&&(b={}),typeof a){case"object":d=[];for(e in a)g=a[e],f=e.toLowerCase(),d.push(""+f+": "+g);return d.join("\n");case"string":for(d=a.split("\n"),i=0,j=d.length;j>i;i++)c=d[i],/([^:]+):\s*(.+)/.test(c)&&(f=null!=(k=RegExp.$1)?k.toLowerCase():void 0,h=RegExp.$2,null==b[f]&&(b[f]=h));return b}},i=a[h],o=function(a){var b;this.fd=a?new i(a):new i,this.form=a,b=[],Object.defineProperty(this,"entries",{get:function(){var c;return c=a?y(a.querySelectorAll("input,select")).filter(function(a){var b;return"checkbox"!==(b=a.type)&&"radio"!==b||a.checked}).map(function(a){return[a.name,"file"===a.type?a.files:a.value]}):[],c.concat(b)}}),this.append=function(a){return function(){var c;return c=y(arguments),b.push(c),a.fd.append.apply(a.fd,c)}}(this)},i&&(z[h]=i,a[h]=o),j=a[q],z[q]=j,p=a[q]=function(){var a,b,h,i,j,k,p,s,t,u,y,A,C,D,E,F,G,H,I,J,K;a=-1,H=new z[q],y={},D=null,p=void 0,E=void 0,A=void 0,u=function(){var b,c,d,e;if(A.status=D||H.status,D===a&&10>w||(A.statusText=H.statusText),D!==a){e=r(H.getAllResponseHeaders());for(b in e)d=e[b],A.headers[b]||(c=b.toLowerCase(),A.headers[c]=d)}},t=function(){H.responseType&&"text"!==H.responseType?"document"===H.responseType?(A.xml=H.responseXML,A.data=H.responseXML):A.data=H.response:(A.text=H.responseText,A.data=H.responseText),"responseURL"in H&&(A.finalUrl=H.responseURL)},G=function(){k.status=A.status,k.statusText=A.statusText},F=function(){"text"in A&&(k.responseText=A.text),"xml"in A&&(k.responseXML=A.xml),"data"in A&&(k.response=A.data),"finalUrl"in A&&(k.responseURL=A.finalUrl)},i=function(a){for(;a>b&&4>b;)k[m]=++b,1===b&&k[g]("loadstart",{}),2===b&&G(),4===b&&(G(),F()),k[g]("readystatechange",{}),4===b&&setTimeout(h,0)},h=function(){p||k[g]("load",{}),k[g]("loadend",{}),p&&(k[m]=0)},b=0,C=function(a){var b,d;return 4!==a?void i(a):(b=z.listeners(c),d=function(){var a;return b.length?(a=b.shift(),2===a.length?(a(y,A),d()):3===a.length&&y.async?a(y,A,d):d()):i(4)},void d())},k=y.xhr=f(),H.onreadystatechange=function(){try{2===H[m]&&u()}catch(a){}4===H[m]&&(E=!1,u(),t()),C(H[m])},s=function(){p=!0},k[l]("error",s),k[l]("timeout",s),k[l]("abort",s),k[l]("progress",function(){3>b?C(3):k[g]("readystatechange",{})}),("withCredentials"in H||z.addWithCredentials)&&(k.withCredentials=!1),k.status=0,K=e.concat(n);for(I=0,J=K.length;J>I;I++)j=K[I],k["on"+j]=null;return k.open=function(a,c,d,e,f){b=0,p=!1,E=!1,y.headers={},y.headerNames={},y.status=0,A={},A.headers={},y.method=a,y.url=c,y.async=d!==!1,y.user=e,y.pass=f,C(1)},k.send=function(a){var b,c,f,g,h,i,j,l;for(l=["type","timeout","withCredentials"],i=0,j=l.length;j>i;i++)c=l[i],f="type"===c?"responseType":c,f in kLine truncated
|
||||
window.ls=window.ls||{};window.ls.container=function(){let stock={};let cachePrefix='none';let memory={};let setCachePrefix=function(prefix){cachePrefix=prefix;return this;};let getCachePrefix=function(){return cachePrefix;};let set=function(name,object,singleton,cache=false,watch=true){if(typeof name!=='string'){throw new Error('var name must be of type string');}
|
||||
if(typeof singleton!=='boolean'){throw new Error('var singleton "'+singleton+'" of service "'+name+'" must be of type boolean');}
|
||||
if(cache){window.localStorage.setItem(getCachePrefix()+'.'+name,JSON.stringify(object));}
|
||||
stock[name]={name:name,object:object,singleton:singleton,instance:null,watch:watch,};return this;};let get=function(name){let service=(undefined!==stock[name])?stock[name]:null;if(null===service){if(memory[getCachePrefix()+'.'+name]){return memory[getCachePrefix()+'.'+name];}
|
||||
let cached=window.localStorage.getItem(getCachePrefix()+'.'+name);if(cached){cached=JSON.parse(cached);memory[getCachePrefix()+'.'+name]=cached;return cached;}
|
||||
return null;}
|
||||
if(service.instance===null){let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;}
|
||||
if(key==="__watch"){return this.watch;}
|
||||
if(key==="__proxy"){return true;}
|
||||
if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}
|
||||
else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;}
|
||||
if(key==="__watch"){return this.watch=value;}
|
||||
target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;}
|
||||
skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);}
|
||||
if(service.singleton){service.instance=instance;}
|
||||
return instance;}
|
||||
return service.instance;};let resolve=function(target){if(!target){return function(){};}
|
||||
let self=this;let FN_ARGS=/^function\s*[^\(]*\(\s*([^\)]*)\)/m;let text=target.toString()||'';let args=text.match(FN_ARGS)[1].split(',');return target.apply(target,args.map(function(value){return self.get(value.trim());}));};let path=function(path,value,as,prefix){as=(as)?as:container.get('$as');prefix=(prefix)?prefix:container.get('$prefix');path=path.replace(as+'.',prefix+'.').split('.');let name=path.shift();let object=this.get(name);let result=null;while(path.length>1){if(undefined===object){return null;}
|
||||
object=object[path.shift()];}
|
||||
if(undefined!==value){object[path.shift()]=value;return true;}
|
||||
if(undefined===object){return null;}
|
||||
let shift=path.shift();if(undefined===shift){result=object;}
|
||||
else{return object[shift];}
|
||||
return result;};let bind=function(element,path,callback,as,prefix){as=(as)?as:container.get('$as');prefix=(prefix)?prefix:container.get('$prefix');let event=path.replace(as+'.',prefix+'.')+'.changed';let printer=function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;}
|
||||
callback();};document.addEventListener(event,printer);};let container={set:set,get:get,resolve:resolve,path:path,bind:bind,setCachePrefix:setCachePrefix,getCachePrefix:getCachePrefix};set('container',container,true,false,false);return container;}();window.ls.container.set('http',function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){param=encodeURIComponent(param);let a=document.createElement('a');param+=(value?"="+encodeURIComponent(value):"");a.href=url;a.search+=(a.search?"&":"")+param;return a.href;};let request=function(method,url,headers,payload,progress){let i;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
if(typeof headers!=='object'){throw new Error('var headers must be of type object');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
for(i=0;i<globalParams.length;i++){url=addParam(url,globalParams[i].key,globalParams[i].value);}
|
||||
return new Promise(function(resolve,reject){let xmlhttp=new XMLHttpRequest();xmlhttp.open(method,url,true);xmlhttp.setRequestHeader('Ajax','1');for(i=0;i<globalHeaders.length;i++){xmlhttp.setRequestHeader(globalHeaders[i].key,globalHeaders[i].value);}
|
||||
for(let key in headers){if(headers.hasOwnProperty(key)){xmlhttp.setRequestHeader(key,headers[key]);}}
|
||||
xmlhttp.onload=function(){if(4===xmlhttp.readyState&&200===xmlhttp.status){resolve(xmlhttp.response);}
|
||||
else{document.dispatchEvent(new CustomEvent('http-'+method.toLowerCase()+'-'+xmlhttp.status));reject(new Error(xmlhttp.statusText));}};if(progress){xmlhttp.addEventListener('progress',progress);xmlhttp.upload.addEventListener('progress',progress,false);}
|
||||
xmlhttp.onerror=function(){reject(new Error("Network Error"));};xmlhttp.send(payload);})};return{'get':function(url){return request('GET',url,{},'')},'post':function(url,headers,payload){return request('POST',url,headers,payload)},'put':function(url,headers,payload){return request('PUT',url,headers,payload)},'patch':function(url,headers,payload){return request('PATCH',url,headers,payload)},'delete':function(url){return request('DELETE',url,{},'')},'addGlobalParam':function(key,value){globalParams.push({key:key,value:value});},'addGlobalHeader':function(key,value){globalHeaders.push({key:key,value:value});}}},true,false,false);window.ls.container.set('cookie',function(document){function get(name){let value="; "+document.cookie,parts=value.split("; "+name+"=");if(parts.length===2){return parts.pop().split(";").shift();}
|
||||
return null;}
|
||||
function set(name,value,days){let date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));let expires=(0<days)?'expires='+date.toUTCString():'expires=0';document.cookie=name+"="+value+";"+expires+";path=/";return this;}
|
||||
return{'get':get,'set':set}},true,false,false);window.ls.container.set('view',function(http,container){let stock={};let execute=function(view,node,container){container.set('element',node,true,false,false);container.resolve(view.controller);if(true!==view.repeat){node.removeAttribute(view.selector);}};let parse=function(node,skip){if(node.attributes&&skip!==true){let attrs=[];let attrsLen=node.attributes.length;for(let x=0;x<attrsLen;x++){attrs.push(node.attributes[x].nodeName);}
|
||||
if(1!==node.nodeType){return;}
|
||||
if(attrs&&attrsLen){for(let x=0;x<attrsLen;x++){if(node.$lsSkip===true){break;}
|
||||
let pointer=(!/Edge/.test(navigator.userAgent))?x:(attrsLen-1)-x;let length=attrsLen;let attr=attrs[pointer];if(!stock[attr]){continue;}
|
||||
let comp=stock[attr];if(typeof comp.template==="function"){comp.template=container.resolve(comp.template);}
|
||||
if(!comp.template){(function(comp,node,container){execute(comp,node,container);})(comp,node,container);if(length!==attrsLen){x--;}
|
||||
continue;}
|
||||
node.classList.remove('load-end');node.classList.add('load-start');node.$lsSkip=true;http.get(comp.template).then(function(node,comp){return function(data){node.$lsSkip=false;node.innerHTML=data;node.classList.remove('load-start');node.classList.add('load-end');(function(comp,node,container){execute(comp,node,container);})(comp,node,container);parse(node,true);}}(node,comp),function(error){throw new Error('Failed to load comp template: '+error.message);});}}}
|
||||
if(true===node.$lsSkip){return;}
|
||||
let list=(node)?node.childNodes:[];if(node.$lsSkip===true){list=[];}
|
||||
for(let i=0;i<list.length;i++){let child=list[i];parse(child);}};return{stock:stock,add:function(object){if(typeof object!=='object'){throw new Error('object must be of type object');}
|
||||
let defaults={'selector':'','controller':function(){},'template':'','repeat':false,'protected':false};for(let prop in defaults){if(!defaults.hasOwnProperty(prop)){continue;}
|
||||
if(prop in object){continue;}
|
||||
object[prop]=defaults[prop];}
|
||||
if(!object.selector){throw new Error('View component is missing a selector attribute');}
|
||||
stock[object.selector]=object;return this;},render:function(element){parse(element);element.dispatchEvent(new window.Event('rendered',{bubbles:false}));}}},true,false,false);window.ls.container.set('router',function(window){let states=[];let current=null;let previous=null;let getPrevious=function(){return previous;};let setPrevious=function(value){previous=value;return this;};let getCurrent=function(){return current;};let setCurrent=function(value){current=value;return this;};let setParam=function(key,value){state.params[key]=value;return this;};let getParam=function(key,def){if(key in state.params){return state.params[key];}
|
||||
return def;};let getParams=function(){return state.params;};let getURL=function(){return window.location.href;};let reset=function(){state.params=getJsonFromUrl(window.location.search);state.hash=window.location.hash;};let add=function(path,view){if(typeof path!=='string'){throw new Error('path must be of type string');}
|
||||
if(typeof view!=='object'){throw new Error('view must be of type object');}
|
||||
states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname+((location.hash)?location.hash:'');states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;}
|
||||
return b.path.length-a.path.length;});for(let i=0;i<states.length;i++){let value=states[i];value.path=(value.path.substring(0,1)!=='/')?location.pathname+value.path:value.path;let match=new RegExp("^"+value.path.replace(/:[^\s/]+/g,'([\\w-]+)')+"$");let found=url.match(match);if(found){previous=current;current=value;return value;}}
|
||||
return null};let change=function(URL,replace){if(!replace){window.history.pushState({},'',URL);}
|
||||
else{window.history.replaceState({},'',URL);}
|
||||
window.dispatchEvent(new PopStateEvent('popstate',{}));return this;};let reload=function(){return change(window.location.href);};let getJsonFromUrl=function(URL){let query;if(URL){let pos=location.href.indexOf('?');if(pos===-1)return[];query=location.href.substr(pos+1);}else{query=location.search.substr(1);}
|
||||
let result={};query.split('&').forEach(function(part){if(!part){return;}
|
||||
part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}
|
||||
else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];}
|
||||
if(!index){result[key].push(val);}
|
||||
else{result[key][index]=val;}}});return result;};let state={setParam:setParam,getParam:getParam,getParams:getParams,getURL:getURL,add:add,change:change,reload:reload,reset:reset,match:match,getCurrent:getCurrent,setCurrent:setCurrent,getPrevious:getPrevious,setPrevious:setPrevious,params:getJsonFromUrl(window.location.search),hash:window.location.hash};return state;},true,false,false);window.ls.container.set('expression',function(container,filter,$as,$prefix){let reg=/(\{{.*?\}})/gi;let paths=[];return{parse:function(string,def,as,prefix){def=def||'';paths=[];return string.replace(reg,function(match)
|
||||
{let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=(reference[0]||'');let result=container.path(path,undefined,as,prefix);if(!paths.includes(path)){paths.push(path);}
|
||||
result=(null===result||undefined===result)?def:result;result=(typeof result==='object')?JSON.stringify(result):result;if(reference.length>=2){for(let i=1;i<reference.length;i++){result=filter.apply(reference[i],result);}}
|
||||
return result;});},getPaths:function(){return paths;},}},true,false,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false,false);return container.resolve(filters[name]);};add('uppercase',function($value){return $value.toUpperCase();});add('lowercase',function($value){return $value.toLowerCase();});return{add:add,apply:apply}},true,false,false);window.ls.container.get('filter').add('escape',function(value){if(typeof value!=='string'){return value;}
|
||||
return value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false,false).set('document',window.document,true,false,false).set('element',window.document,true,false,false);window.ls.run=function(window){try{this.view.render(window.document);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',repeat:false,controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
router.reset();if(null===route){return;}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';}
|
||||
else if(null!==router.getPrevious()){view.render(element);console.log('render 3')}
|
||||
document.dispatchEvent(new CustomEvent('state-changed'));};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};element.setAttribute('data-ls-scope','');view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
if(!target.href){return false;}
|
||||
if((event.metaKey)){return false;}
|
||||
if((target.hasAttribute('target'))&&('_blank'===target.getAttribute('target'))){return false;}
|
||||
if(target.hostname!==window.location.hostname){return false;}
|
||||
let route=router.match(target);if(null===route){return false;}
|
||||
event.preventDefault();if(window.location===target.href){return false;}
|
||||
route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;}
|
||||
window.history.pushState({},'Unknown',target.href);}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i];let key=expression.parse(attr.substring(0,attr.indexOf('=')),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());let value=expression.parse(attr.substring(attr.indexOf('=')+1),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container,$prefix,$as){let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}
|
||||
else{element.removeAttribute('checked');}}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}
|
||||
else{element.removeAttribute('checked');element.checked=false;}
|
||||
if(bind){element.addEventListener('change',function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.checked,$as,$prefix);}});}}
|
||||
return;}
|
||||
if(element.value!==value){element.value=value;}
|
||||
if(bind){element.addEventListener('input',sync);}}
|
||||
else{if(element.innerText!==value){element.innerHTML=value;}}};let sync=(function(as,prefix){return function(){for(let i=0;i<paths.length;i++){container.path(paths[i],element.value,as,prefix);}}})($as,$prefix);let syntax=element.getAttribute('data-ls-bind');let result=expression.parse(syntax,null,$as,$prefix);let paths=expression.getPaths();echo(result,true);for(let i=0;i<paths.length;i++){container.bind(element,paths[i],function(){echo(expression.parse(syntax,null,$as,$prefix),false);});}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,$as,$prefix){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(){if(debug){console.info('debug-ls-if',expression.parse(syntax,'undefined',$as,$prefix));}
|
||||
try{result=!!(eval(expression.parse(syntax,'undefined',$as,$prefix).replace(/(\r\n|\n|\r)/gm,' ')));}
|
||||
catch(error){throw new Error('Failed to evaluate expression "'+syntax+'": '+error);}
|
||||
paths=expression.getPaths();if(!result){element.style.visibility='hidden';element.style.display='none';}
|
||||
else{element.style.removeProperty('display');element.style.removeProperty('visibility');}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-loop',template:false,repeat:false,nested:false,controller:function(element,view,container,window){let expr=element.getAttribute('data-ls-loop');let as=element.getAttribute('data-ls-as');let echo=function(){let array=container.path(expr);array=(!array)?[]:array;while(element.hasChildNodes()){element.removeChild(element.lastChild);element.lastChild=null;}
|
||||
if(array instanceof Array&&typeof array!=='object'){throw new Error('Reference value must be array or object. '+(typeof array)+' given');}
|
||||
let children=[];element.$lsSkip=true;element.style.visibility=(0===array.length)?'hidden':'visible';for(let prop in array){if(!array.hasOwnProperty(prop)){continue;}
|
||||
children[prop]=template.cloneNode(true);element.appendChild(children[prop]);(function(index){let context=expr+'.'+index;container.set(as,container.path(context),true);container.set('$index',index,true,false,false);container.set('$prefix',context,true,false,false);container.set('$as',as,true,false,false);view.render(children[prop]);})(prop);}
|
||||
container.set('$index',null,true,false,false);container.set('$prefix','',true,false,false);container.set('$as','',true,false,false);};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr,echo);container.bind(element,expr+'.length',echo);}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,repeat:true,controller:function(element,view,http,expression,document){let template=expression.parse(element.getAttribute('data-ls-template'));let type=element.getAttribute('data-type')||'url';element.innerHTML='';let parse=function(data,element){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));};if('script'===type){let inlineTemplate=document.getElementById(template);if(inlineTemplate&&inlineTemplate.innerHTML){parse(inlineTemplate.innerHTML,element);}
|
||||
else{element.innerHTML='<span style="color: red">Missing template "'+template+'"</span>';}
|
||||
return;}
|
||||
http.get(template).then(function(element){return function(data){parse(data,element);}}(element),function(){throw new Error('Failed loading template');});}});(function(a,b){(function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};t=a.document,d="before",c="after",m="readyState",l="addEventListener",k="removeEventListener",g="dispatchEvent",q="XMLHttpRequest",h="FormData",n=["load","loadend","loadstart"],e=["progress","abort","error","timeout"],w=parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1]),isNaN(w)&&(w=parseInt((/trident\/.*; rv:(\d+)/.exec(navigator.userAgent.toLowerCase())||[])[1])),(A=Array.prototype).indexOf||(A.indexOf=function(a){var b,c,d,e;for(b=d=0,e=this.length;e>d;b=++d)if(c=this[b],c===a)return b;return-1}),y=function(a,b){return Array.prototype.slice.call(a,b)},s=function(a){return"returnValue"===a||"totalSize"===a||"position"===a},v=function(a,b){var c,d;for(c in a)if(d=a[c],!s(c))try{b[c]=a[c]}catch(e){}return b},x=function(a,b,c){var d,e,f,h;for(e=function(a){return function(d){var e,f,h;e={};for(f in d)s(f)||(h=d[f],e[f]=h===b?c:h);return c[g](a,e)}},f=0,h=a.length;h>f;f++)d=a[f],c._has(d)&&(b["on"+d]=e(d))},u=function(a){var b;if(null!=t.createEventObject)return b=t.createEventObject(),b.type=a,b;try{return new Event(a)}catch(c){return{type:a}}},f=function(a){var c,d,e;return d={},e=function(a){return d[a]||[]},c={},c[l]=function(a,c,f){d[a]=e(a),d[a].indexOf(c)>=0||(f=f===b?d[a].length:f,d[a].splice(f,0,c))},c[k]=function(a,c){var f;return a===b?void(d={}):(c===b&&(d[a]=[]),f=e(a).indexOf(c),void(-1!==f&&e(a).splice(f,1)))},c[g]=function(){var b,d,f,g,h,i,j,k;for(b=y(arguments),d=b.shift(),a||(b[0]=v(b[0],u(d))),g=c["on"+d],g&&g.apply(c,b),k=e(d).concat(e("*")),f=i=0,j=k.length;j>i;f=++i)h=k[f],h.apply(c,b)},c._has=function(a){return!(!d[a]&&!c["on"+a])},a&&(c.listeners=function(a){return y(e(a))},c.on=c[l],c.off=c[k],c.fire=c[g],c.once=function(a,b){var d;return d=function(){return c.off(a,d),b.apply(null,arguments)},c.on(a,d)},c.destroy=function(){return d={}}),c},z=f(!0),z.EventEmitter=f,z[d]=function(a,b){if(a.length<1||a.length>2)throw"invalid hook";return z[l](d,a,b)},z[c]=function(a,b){if(a.length<2||a.length>3)throw"invalid hook";return z[l](c,a,b)},z.enable=function(){a[q]=p,i&&(a[h]=o)},z.disable=function(){a[q]=z[q],i&&(a[h]=i)},r=z.headers=function(a,b){var c,d,e,f,g,h,i,j,k;switch(null==b&&(b={}),typeof a){case"object":d=[];for(e in a)g=a[e],f=e.toLowerCase(),d.push(""+f+": "+g);return d.join("\n");case"string":for(d=a.split("\n"),i=0,j=d.length;j>i;i++)c=d[i],/([^:]+):\s*(.+)/.test(c)&&(f=null!=(k=RegExp.$1)?k.toLowerCase():void 0,h=RegExp.$2,null==b[f]&&(b[f]=h));return b}},i=a[h],o=function(a){var b;this.fd=a?new i(a):new i,this.form=a,b=[],Object.defineProperty(this,"entries",{get:function(){var c;return c=a?y(a.querySelectorAll("input,select")).filter(function(a){var b;return"checkbox"!==(b=a.type)&&"radio"!==b||a.checked}).map(function(a){return[a.name,"file"===a.type?a.files:a.value]}):[],c.concat(b)}}),this.append=function(a){return function(){var c;return c=y(arguments),b.push(c),a.fd.append.apply(a.fd,c)}}(this)},i&&(z[h]=i,a[h]=o),j=a[q],z[q]=j,p=a[q]=function(){var a,b,h,i,j,k,p,s,t,u,y,A,C,D,E,F,G,H,I,J,K;a=-1,H=new z[q],y={},D=null,p=void 0,E=void 0,A=void 0,u=function(){var b,c,d,e;if(A.status=D||H.status,D===a&&10>w||(A.statusText=H.statusText),D!==a){e=r(H.getAllResponseHeaders());for(b in e)d=e[b],A.headers[b]||(c=b.toLowerCase(),A.headers[c]=d)}},t=function(){H.responseType&&"text"!==H.responseType?"document"===H.responseType?(A.xml=H.responseXML,A.data=H.responseXML):A.data=H.response:(A.text=H.responseText,A.data=H.responseText),"responseURL"in H&&(A.finalUrl=H.responseURL)},G=function(){k.status=A.status,k.statusText=A.statusText},F=function(){"text"in A&&(k.responseText=A.text),"xml"in A&&(k.responseXML=A.xml),"data"in A&&(k.response=A.data),"finalUrl"in A&&(k.responseURL=A.finalUrl)},i=function(a){for(;a>b&&4>b;)k[m]=++b,1===b&&k[g]("loadstart",{}),2===b&&G(),4===b&&(G(),F()),k[g]("readystatechange",{}),4===b&&setTimeout(h,0)},h=function(){p||k[g]("load",{}),k[g]("loadend",{}),p&&(k[m]=0)},b=0,C=function(a){var b,d;return 4!==a?void i(a):(b=z.listeners(c),d=function(){var a;return b.length?(a=b.shift(),2===a.length?(a(y,A),d()):3===a.length&&y.async?a(y,A,d):d()):i(4)},void d())},k=y.xhr=f(),H.onreadystatechange=function(){try{2===H[m]&&u()}catch(a){}4===H[m]&&(E=!1,u(),t()),C(H[m])},s=function(){p=!0},k[l]("error",s),k[l]("timeout",s),k[l]("abort",s),k[l]("progress",function(){3>b?C(3):k[g]("readystatechange",{})}),("withCredentials"in H||z.addWithCredentials)&&(k.withCredentials=!1),k.status=0,K=e.concat(n);for(I=0,J=K.length;J>I;I++)j=K[I],k["on"+j]=null;return k.open=function(a,c,d,e,f){b=0,p=!1,E=!1,y.headers={},y.headerNames={},y.status=0,A={},A.headers={},y.method=a,y.url=c,y.async=d!==!1,y.user=e,y.passLine truncated
|
||||
if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href;};let request=function(method,url,headers,payload,progress){let i;http.addGlobalHeader('X-Appwrite-Project',config.project);http.addGlobalHeader('X-Appwrite-Locale',config.locale);http.addGlobalHeader('X-Appwrite-Mode',config.mode);if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('let method must contain a valid HTTP method name');}
|
||||
if(typeof url!=='string'){throw new Error('let url must be of type string');}
|
||||
if(typeof headers!=='object'){throw new Error('let headers must be of type object');}
|
||||
@@ -125,7 +228,7 @@ return(date.getTime()/1000)}
|
||||
return{format:format,strtotime:strtotime}}(),true);})(window);(function(window){"use strict";window.ls.container.set('di',function(){var list={'load':true};return{listen:function(event,callback){if(list[event]){callback();}
|
||||
document.addEventListener(event,callback);},report:function(event){list[event]=true;},check:function(event){return(list[event]);},reset:function(){list={'load':true};},list:list};},true);})(window);(function(window){"use strict";window.ls.container.set('env',function(){return APP_ENV;},true);})(window);(function(window){"use strict";window.ls.container.set('markdown',function(window){var md=window.markdownit();function renderEm(tokens,idx,opts,_,slf){var token=tokens[idx];if(token.markup==='__'){token.tag='u';}
|
||||
return slf.renderToken(tokens,idx,opts);}
|
||||
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.AppwriteSDK();sdk.config.domain=APP_ENV.API;sdk.config.project=router.params.project||null;sdk.config.locale=APP_ENV.LOCALE;sdk.config.mode='admin';return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add('/auth/signin',{template:'/auth/signin',scope:'home'}).add('/auth/signup',{template:'/auth/signup',scope:'home'}).add('/auth/recovery',{template:'/auth/recovery',scope:'home'}).add('/auth/recovery/reset',{template:'/auth/recovery/reset',scope:'home'}).add('/auth/confirm',{template:'/auth/confirm',scope:'home'}).add('/auth/join',{template:'/auth/join',scope:'home'}).add('/console',{template:'/console',scope:'console'}).add('/console/account',{template:'/console/account',scope:'console'}).add('/console/account/:tab',{template:'/console/account',scope:'console'}).add('/console/home',{template:'/console/home',scope:'console',project:true}).add('/console/home/:tab',{template:'/console/home',scope:'console',project:true}).add('/console/platforms/:platform',{template:function(window){return window.location.pathname;},scope:'console',project:true}).add('/console/notifications',{template:'/console/notifications',scope:'console'}).add('/console/settings',{template:'/console/settings',scope:'console',project:true}).add('/console/settings/:tab',{template:'/console/settings',scope:'console',project:true}).add('/console/database',{template:'/console/database',scope:'console',project:true}).add('/console/database/:tab',{template:'/console/database',scope:'console',project:true}).add('/console/storage',{template:'/console/storage',scope:'console',project:true}).add('/console/storage/:tab',{template:'/console/storage',scope:'console',project:true}).add('/console/users',{template:'/console/users',scope:'console',project:true}).add('/console/users/view',{template:'/console/users/view',scope:'console',project:true}).add('/console/users/view/:tab',{template:'/console/users/view',scope:'console',project:true}).add('/console/users/:tab',{template:'/console/users',scope:'console',project:true});let date=window.ls.container.get('date');let timezone=window.ls.container.get('timezone');let markdown=window.ls.container.get('markdown');window.ls.filter.add('lowerCase',function(value){return value.toLowerCase();}).add('date',function(value,options){return date.format('Y-m-d',value);}).add('date-time',function(value,options){return date.format('Y-m-d H:i',value);}).add('date-text',function(value,options){return date.format('d M Y',value);}).add('date-long',function(value,options){return date.format('l, j F, H:i',value);}).add('min2hum',function(value,options){if(value>=60){if(value%60===0){return Math.ceil(value/60)+' hours';}
|
||||
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.AppwriteSDK();sdk.config.domain=APP_ENV.API;sdk.config.project=router.params.project||null;sdk.config.locale=APP_ENV.LOCALE;sdk.config.mode='admin';return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add('/auth/signin',{template:'/auth/signin?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/signup',{template:'/auth/signup?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/recovery',{template:'/auth/recovery?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/recovery/reset',{template:'/auth/recovery/reset?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/confirm',{template:'/auth/confirm?version='+APP_ENV.VERSION,scope:'home'}).add('/auth/join',{template:'/auth/join?version='+APP_ENV.VERSION,scope:'home'}).add('/console',{template:'/console?version='+APP_ENV.VERSION,scope:'console'}).add('/console/account',{template:'/console/account?version='+APP_ENV.VERSION,scope:'console'}).add('/console/account/:tab',{template:'/console/account?version='+APP_ENV.VERSION,scope:'console'}).add('/console/home',{template:'/console/home?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/home/:tab',{template:'/console/home?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/platforms/:platform',{template:function(window){return window.location.pathname+'?version='+APP_ENV.VERSION;},scope:'console',project:true}).add('/console/notifications',{template:'/console/notifications?version='+APP_ENV.VERSION,scope:'console'}).add('/console/settings',{template:'/console/settings?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/settings/:tab',{template:'/console/settings?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/database',{template:'/console/database?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/database/:tab',{template:'/console/database?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/storage',{template:'/console/storage?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/storage/:tab',{template:'/console/storage?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users',{template:'/console/users?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users/view',{template:'/console/users/view?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users/view/:tab',{template:'/console/users/view?version='+APP_ENV.VERSION,scope:'console',project:true}).add('/console/users/:tab',{template:'/console/users?version='+APP_ENV.VERSION,scope:'console',project:true});let date=window.ls.container.get('date');let timezone=window.ls.container.get('timezone');let markdown=window.ls.container.get('markdown');window.ls.filter.add('lowerCase',function(value){return value.toLowerCase();}).add('date',function(value,options){return date.format('Y-m-d',value);}).add('date-time',function(value,options){return date.format('Y-m-d H:i',value);}).add('date-text',function(value,options){return date.format('d M Y',value);}).add('date-long',function(value,options){return date.format('l, j F, H:i',value);}).add('min2hum',function(value,options){if(value>=60){if(value%60===0){return Math.ceil(value/60)+' hours';}
|
||||
else{return Math.ceil(value/60)+' hours and '+(value%60)+' minutes';}}
|
||||
return value+' minutes';}).add('ms2hum',function(value,options){let temp=value;const years=Math.floor(temp/31536000),days=Math.floor((temp%=31536000)/86400),hours=Math.floor((temp%=86400)/3600),minutes=Math.floor((temp%=3600)/60),seconds=temp%60;if(days||hours||seconds||minutes){return(years?years+"y ":"")+
|
||||
(days?days+"d ":"")+
|
||||
|
||||
@@ -67,13 +67,13 @@ else{window.history.replaceState({},'',URL);}
|
||||
result=(null===result||undefined===result)?def:result;result=(typeof result==='object')?JSON.stringify(result):result;if(reference.length>=2){for(let i=1;i<reference.length;i++){result=filter.apply(reference[i],result);}}
|
||||
return result;});},getPaths:function(){return paths;},}},true,false,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false,false);return container.resolve(filters[name]);};add('uppercase',function($value){return $value.toUpperCase();});add('lowercase',function($value){return $value.toLowerCase();});return{add:add,apply:apply}},true,false,false);window.ls.container.get('filter').add('escape',function(value){if(typeof value!=='string'){return value;}
|
||||
return value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false,false).set('document',window.document,true,false,false).set('element',window.document,true,false,false);window.ls.run=function(window){try{this.view.render(window.document);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let scopeElement=document.createElement('div');let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=function(){return function(error){console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',repeat:false,controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
router.reset();if(null===route){return;}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';}
|
||||
else if(null!==router.getPrevious()){view.render(element);}
|
||||
else if(null!==router.getPrevious()){view.render(element);console.log('render 3')}
|
||||
document.dispatchEvent(new CustomEvent('state-changed'));};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};scopeElement.setAttribute('data-ls-scope','');element.insertBefore(scopeElement,element.firstChild);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
return null;};element.setAttribute('data-ls-scope','');view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
if(!target.href){return false;}
|
||||
if((event.metaKey)){return false;}
|
||||
if((target.hasAttribute('target'))&&('_blank'===target.getAttribute('target'))){return false;}
|
||||
@@ -82,7 +82,7 @@ catch(error){let handler=window.ls.container.resolve(this.error);handler(error);
|
||||
event.preventDefault();if(window.location===target.href){return false;}
|
||||
route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;}
|
||||
window.history.pushState({},'Unknown',target.href);}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i].split('=');let key=(attr[0])?expression.parse(attr[0],null,$as,$prefix):null;paths=paths.concat(expression.getPaths());let value=(attr[1])?expression.parse(attr[1],null,$as,$prefix):null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container,$as,$prefix){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let check=function(){for(let i=0;i<attrs.length;i++){let attr=attrs[i];let key=expression.parse(attr.substring(0,attr.indexOf('=')),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());let value=expression.parse(attr.substring(attr.indexOf('=')+1),null,$as,$prefix)||null;paths=paths.concat(expression.getPaths());if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){container.bind(element,paths[i],check);}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container,$prefix,$as){let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}
|
||||
else{element.removeAttribute('checked');}}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}
|
||||
|
||||
+23
-23
@@ -1,108 +1,108 @@
|
||||
window.ls.router
|
||||
.add('/auth/signin', {
|
||||
template: '/auth/signin',
|
||||
template: '/auth/signin?version=' + APP_ENV.VERSION,
|
||||
scope: 'home'
|
||||
})
|
||||
.add('/auth/signup', {
|
||||
template: '/auth/signup',
|
||||
template: '/auth/signup?version=' + APP_ENV.VERSION,
|
||||
scope: 'home'
|
||||
})
|
||||
.add('/auth/recovery', {
|
||||
template: '/auth/recovery',
|
||||
template: '/auth/recovery?version=' + APP_ENV.VERSION,
|
||||
scope: 'home'
|
||||
})
|
||||
.add('/auth/recovery/reset', {
|
||||
template: '/auth/recovery/reset',
|
||||
template: '/auth/recovery/reset?version=' + APP_ENV.VERSION,
|
||||
scope: 'home'
|
||||
})
|
||||
.add('/auth/confirm', {
|
||||
template: '/auth/confirm',
|
||||
template: '/auth/confirm?version=' + APP_ENV.VERSION,
|
||||
scope: 'home'
|
||||
})
|
||||
.add('/auth/join', {
|
||||
template: '/auth/join',
|
||||
template: '/auth/join?version=' + APP_ENV.VERSION,
|
||||
scope: 'home'
|
||||
})
|
||||
.add('/console', {
|
||||
template: '/console',
|
||||
template: '/console?version=' + APP_ENV.VERSION,
|
||||
scope: 'console'
|
||||
})
|
||||
.add('/console/account', {
|
||||
template: '/console/account',
|
||||
template: '/console/account?version=' + APP_ENV.VERSION,
|
||||
scope: 'console'
|
||||
})
|
||||
.add('/console/account/:tab', {
|
||||
template: '/console/account',
|
||||
template: '/console/account?version=' + APP_ENV.VERSION,
|
||||
scope: 'console'
|
||||
})
|
||||
.add('/console/home', {
|
||||
template: '/console/home',
|
||||
template: '/console/home?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/home/:tab', {
|
||||
template: '/console/home',
|
||||
template: '/console/home?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/platforms/:platform', {
|
||||
template: function (window) {
|
||||
return window.location.pathname;
|
||||
return window.location.pathname + '?version=' + APP_ENV.VERSION;
|
||||
},
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/notifications', {
|
||||
template: '/console/notifications',
|
||||
template: '/console/notifications?version=' + APP_ENV.VERSION,
|
||||
scope: 'console'
|
||||
})
|
||||
.add('/console/settings', {
|
||||
template: '/console/settings',
|
||||
template: '/console/settings?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/settings/:tab', {
|
||||
template: '/console/settings',
|
||||
template: '/console/settings?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/database', {
|
||||
template: '/console/database',
|
||||
template: '/console/database?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/database/:tab', {
|
||||
template: '/console/database',
|
||||
template: '/console/database?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/storage', {
|
||||
template: '/console/storage',
|
||||
template: '/console/storage?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/storage/:tab', {
|
||||
template: '/console/storage',
|
||||
template: '/console/storage?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/users', {
|
||||
template: '/console/users',
|
||||
template: '/console/users?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/users/view', {
|
||||
template: '/console/users/view',
|
||||
template: '/console/users/view?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/users/view/:tab', {
|
||||
template: '/console/users/view',
|
||||
template: '/console/users/view?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
.add('/console/users/:tab', {
|
||||
template: '/console/users',
|
||||
template: '/console/users?version=' + APP_ENV.VERSION,
|
||||
scope: 'console',
|
||||
project: true
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user