Skip to content

Commit

Permalink
#fixes #156
Browse files Browse the repository at this point in the history
some small usability improvements to login:
- autofocus username field
- submit on enter key
  • Loading branch information
JoernT committed Jun 20, 2021
1 parent 3360020 commit 0da69dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
12 changes: 9 additions & 3 deletions bower_components/existdb-launcher/existdb-login.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<h2>Login</h2>
<paper-dialog-scrollable>
<form action="login">
<paper-input name="user" label="User" value="{{user}}"></paper-input>
<paper-input name="password" label="Password" type="password" value="{{password}}"></paper-input>
<paper-input name="user" label="User" value="{{user}}" on-keyup="_submitDialog" autofocus></paper-input>
<paper-input name="password" label="Password" type="password" value="{{password}}" on-keyup="_submitDialog"></paper-input>
<input id="logout" type="hidden" name="logout"></input>
</form>
<template is="dom-if" if="[[_invalid]]">
Expand Down Expand Up @@ -222,7 +222,7 @@ <h2>Login</h2>
this.user = resp.user;
this.groups = resp.groups;
this._invalid = false;
if (!wasLoggedIn && this.$.loginDialog.opened && this.loginUrl) {
if (!wasLoggedIn && this.loginUrl) {
window.location = this.loginUrl;
}
this.$.loginDialog.close();
Expand All @@ -247,6 +247,12 @@ <h2>Login</h2>
return true;
}

_submitDialog(ev){
if(ev.keyCode === 13){
this._confirmLogin();
}
}

/**
* Fired on successful login.
*
Expand Down
15 changes: 1 addition & 14 deletions controller.xql
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,7 @@ else if ($exist:path = "/admin") then (
<set-header name="Cache-Control" value="no-cache"/>
</forward>
</dispatch>
)
else(
(:
let $log := util:log("info", "user is not logged in")
return
:)
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
(:<forward url="{$exist:controller}/index.html"></forward>:)
<redirect url="login.html">
<cache-control cache="no"/>
<set-header name="Cache-Control" value="no-cache"/>
</redirect>
</dispatch>
)
) else ()
)
else
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
Expand Down
2 changes: 1 addition & 1 deletion expath-pkg.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://exist-db.org/apps/dashboard" abbrev="dashboard" version="2.0.7" spec="1.0">
<package xmlns="http://expath.org/ns/pkg" name="http://exist-db.org/apps/dashboard" abbrev="dashboard" version="2.0.8" spec="1.0">
<title>Dashboard</title>
<dependency processor="http://exist-db.org" semver-min="5.0.0"/>
<dependency package="http://www.functx.com" semver-min="1.0"/>
Expand Down

0 comments on commit 0da69dc

Please sign in to comment.