Fix load flash
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
1ef41c355b
commit
b46c505b77
@ -282,7 +282,8 @@
|
|||||||
<paper-tab tab="memories"><paper-icon-button icon="today"></paper-icon-button></paper-tab>
|
<paper-tab tab="memories"><paper-icon-button icon="today"></paper-icon-button></paper-tab>
|
||||||
<paper-tab tab="albums"><paper-icon-button icon="folder"></paper-icon-button></paper-tab>
|
<paper-tab tab="albums"><paper-icon-button icon="folder"></paper-icon-button></paper-tab>
|
||||||
</paper-tabs>
|
</paper-tabs>
|
||||||
<iron-pages id="pages" attr-for-selected="id" selected="[[mode]]" fallback-selection="memories">
|
<iron-pages id="pages" attr-for-selected="id" selected="[[mode]]" fallback-selection="loading">
|
||||||
|
<div id="loading"></div>
|
||||||
<div id="time"><div>... time slider ...</div></div>
|
<div id="time"><div>... time slider ...</div></div>
|
||||||
<div id="memories" class="flex layout vertical center">
|
<div id="memories" class="flex layout vertical center">
|
||||||
<div class="memory-buttons layout self-stretch horizontal around-justified">
|
<div class="memory-buttons layout self-stretch horizontal around-justified">
|
||||||
@ -319,10 +320,11 @@
|
|||||||
<app-header-layout>
|
<app-header-layout>
|
||||||
<app-header reveals slot="header">
|
<app-header reveals slot="header">
|
||||||
<div id="header" class="layout horizontal center">
|
<div id="header" class="layout horizontal center">
|
||||||
<paper-icon-button icon="search" on-tap="drawerToggle"></paper-icon-button>
|
<paper-icon-button hidden$="[[!user]]" icon="search" on-tap="drawerToggle"></paper-icon-button>
|
||||||
<iron-pages class="flex" attr-for-selected="mode" selected="[[mode]]">
|
<iron-pages class="flex" attr-for-selected="mode" selected="[[mode]]">
|
||||||
<div mode="login"><div>You are not logged in.</div></div>
|
<div id="loading"></div>
|
||||||
<div mode="albums" id="breadcrumb" class="horizontal layout center">
|
<div mode="login"><div>You are not logged in.</div></div>
|
||||||
|
<div mode="albums" id="breadcrumb" class="horizontal layout center">
|
||||||
<template is="dom-repeat" items="[[breadcrumb(path)]]">
|
<template is="dom-repeat" items="[[breadcrumb(path)]]">
|
||||||
<div tabindex="0" on-tap="loadPath">[[item.name]] /</div>
|
<div tabindex="0" on-tap="loadPath">[[item.name]] /</div>
|
||||||
</template>
|
</template>
|
||||||
@ -340,31 +342,35 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</app-header>
|
</app-header>
|
||||||
<div>
|
<iron-pages attr-for-selected="id" selected="[[mode]]" fallback-selection="content">
|
||||||
<div hidden$="[[!user]]">
|
<div id="loading" class="layout vertical center">
|
||||||
|
<paper-spinner active$="[[loading]]" class="thin"></paper-spinner>
|
||||||
|
<div>~ Loading ~</div>
|
||||||
|
</div>
|
||||||
|
<div id="content">
|
||||||
<div id="thumbnails" class="layout horizontal wrap"></div>
|
<div id="thumbnails" class="layout horizontal wrap"></div>
|
||||||
<div id="bottom" class="layout vertical center">
|
<div id="bottom" class="layout vertical center">
|
||||||
<paper-spinner hidden$="[[!loading]]" active$="[[loading]]" class="thin"></paper-spinner>
|
<paper-spinner hidden$="[[!loading]]" active$="[[loading]]" class="thin"></paper-spinner>
|
||||||
<div hidden$="[[loading]]">~ the end ~</div>
|
<div hidden$="[[loading]]">~ the end ~</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="login" hidden$="[[user]]" class="layout horizontal center">
|
<div id="login" class="layout horizontal center">
|
||||||
<div class="flex layout vertical">
|
<div class="flex layout vertical">
|
||||||
<div id="instructions">
|
<div id="instructions">
|
||||||
<p><b>ketrenos.com</b> is a personal website for my family and friends.</p>
|
<p><b>ketrenos.com</b> is a personal website for my family and friends.</p>
|
||||||
<p>If you already have an email account on this domain, you can login to the photo viewer
|
<p>If you already have an email account on this domain, you can login to the photo viewer
|
||||||
using your normal @ketrenos.com account name, and password.</p>
|
using your normal @ketrenos.com account name, and password.</p>
|
||||||
</p>If you are a friend or family member (immediate, or extended)
|
</p>If you are a friend or family member (immediate, or extended)
|
||||||
<a on-tap="requestAccess" href="#">request access</a>,
|
<a on-tap="requestAccess" href="#">request access</a>,
|
||||||
provide your email address, and tell me who in the extended Ketrenos
|
provide your email address, and tell me who in the extended Ketrenos
|
||||||
universe you know. If you're not a bot, I'll very likely give you access :)</p>
|
universe you know. If you're not a bot, I'll very likely give you access :)</p>
|
||||||
</div>
|
</div>
|
||||||
<paper-input tabindex=0 autofocus id="username" label="User ID" value="{{username}}" on-keypress="enterCheck"></paper-input>
|
<paper-input tabindex=0 autofocus id="username" label="User ID" value="{{username}}" on-keypress="enterCheck"></paper-input>
|
||||||
<paper-input tabindex=0 id="password" label="Password" type="password" value="{{password}}" on-keypress="enterCheck"></paper-input>
|
<paper-input tabindex=0 id="password" label="Password" type="password" value="{{password}}" on-keypress="enterCheck"></paper-input>
|
||||||
<paper-button tabindex=0 id="loginButton" disabled$="[[disableLogin(username,password)]]" on-tap="login" raised><div hidden$="[[loggingIn]]">login</div><div hidden$="[[!loggingIn]]"><paper-spinner active$="[[loggingIn]]"></paper-spinner></div></paper-button>
|
<paper-button tabindex=0 id="loginButton" disabled$="[[disableLogin(username,password)]]" on-tap="login" raised><div hidden$="[[loggingIn]]">login</div><div hidden$="[[!loggingIn]]"><paper-spinner active$="[[loggingIn]]"></paper-spinner></div></paper-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</iron-pages>
|
||||||
</app-header-layout>
|
</app-header-layout>
|
||||||
</app-drawer-layout>
|
</app-drawer-layout>
|
||||||
<div id="pager">pager</div>
|
<div id="pager">pager</div>
|
||||||
@ -373,7 +379,7 @@
|
|||||||
<div>item</div>
|
<div>item</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<paper-dialog id="requestAccess" modal>
|
<paper-dialog id="requestAccess" with-backdrop>
|
||||||
<div class="layout vertical">
|
<div class="layout vertical">
|
||||||
<div class="title">Create an account</div>
|
<div class="title">Create an account</div>
|
||||||
<div>
|
<div>
|
||||||
@ -459,7 +465,7 @@
|
|||||||
},
|
},
|
||||||
mode: {
|
mode: {
|
||||||
type: String,
|
type: String,
|
||||||
value: "login"
|
value: "loading"
|
||||||
},
|
},
|
||||||
date: {
|
date: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -1236,9 +1242,13 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
userChanged: function(user) {
|
userChanged: function(user) {
|
||||||
|
if (!this.firstRequest) {
|
||||||
|
this.mode = "loading";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.resetPhotos();
|
this.resetPhotos();
|
||||||
this.path = "";
|
this.path = "";
|
||||||
this.mode = "";
|
|
||||||
if (user) {
|
if (user) {
|
||||||
this.mode = "memories";
|
this.mode = "memories";
|
||||||
} else {
|
} else {
|
||||||
@ -1265,7 +1275,10 @@
|
|||||||
}.bind(this), 100);
|
}.bind(this), 100);
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.firstRequest = false;
|
||||||
|
|
||||||
window.fetch("api/v1/users", function(error, xhr) {
|
window.fetch("api/v1/users", function(error, xhr) {
|
||||||
|
this.firstRequest = true;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -1286,6 +1299,12 @@
|
|||||||
|
|
||||||
if (results && results.username) {
|
if (results && results.username) {
|
||||||
this.user = results;
|
this.user = results;
|
||||||
|
} else {
|
||||||
|
if (this.user) {
|
||||||
|
this.user = null;
|
||||||
|
} else {
|
||||||
|
this.userChanged(this.user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ function ldapPromise(username, password) {
|
|||||||
return Promise.reject("LDAP not being used");
|
return Promise.reject("LDAP not being used");
|
||||||
}
|
}
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
ldap.authenticate(username, password, function(error, user) {
|
ldap.authenticate(username.replace(/@.*$/, ""), password, function(error, user) {
|
||||||
if (error) {
|
if (error) {
|
||||||
return reject(error);
|
return reject(error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user