Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
65158fd2
Commit
65158fd2
authored
Feb 23, 2023
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save username to cookie, autostart video on loggin
parent
9dd6abae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
static/galene.html
static/galene.html
+5
-5
static/galene.js
static/galene.js
+26
-2
No files found.
static/galene.html
View file @
65158fd2
...
@@ -117,11 +117,11 @@
...
@@ -117,11 +117,11 @@
<label
for=
"username"
>
Username
</label>
<label
for=
"username"
>
Username
</label>
<input
id=
"username"
type=
"text"
name=
"username"
<input
id=
"username"
type=
"text"
name=
"username"
autocomplete=
"username"
class=
"form-control"
/>
autocomplete=
"username"
class=
"form-control"
/>
<label
for=
"password"
>
Password
</label>
<label
for=
"password"
class=
"invisible"
>
Password
</label>
<input
id=
"password"
type=
"password"
name=
"password"
<input
id=
"password"
type=
"password"
name=
"password"
readonly
autocomplete=
"current-password"
class=
"form-control"
/>
autocomplete=
"current-password"
class=
"form-control
invisible
"
/>
<label>
Enable at start:
</label>
<label
class=
"invisible"
>
Enable at start:
</label>
<div
class=
"present-switch"
>
<div
class=
"present-switch
invisible
"
>
<!--<p class="switch-radio">
<!--<p class="switch-radio">
<input id="presentoff" type="radio" name="presentradio" value=""/>
<input id="presentoff" type="radio" name="presentradio" value=""/>
<label for="presentoff">Nothing</label>
<label for="presentoff">Nothing</label>
...
...
static/galene.js
View file @
65158fd2
...
@@ -314,6 +314,7 @@ async function gotConnected(username) {
...
@@ -314,6 +314,7 @@ async function gotConnected(username) {
username
=
getInputElement
(
'
username
'
).
value
.
trim
();
username
=
getInputElement
(
'
username
'
).
value
.
trim
();
let
pw
=
getInputElement
(
'
password
'
).
value
;
let
pw
=
getInputElement
(
'
password
'
).
value
;
getInputElement
(
'
password
'
).
value
=
''
;
getInputElement
(
'
password
'
).
value
=
''
;
if
(
!
groupStatus
.
authServer
)
if
(
!
groupStatus
.
authServer
)
credentials
=
pw
;
credentials
=
pw
;
else
else
...
@@ -2404,6 +2405,7 @@ async function gotJoined(kind, group, perms, status, data, message) {
...
@@ -2404,6 +2405,7 @@ async function gotJoined(kind, group, perms, status, data, message) {
setTitle
((
status
&&
status
.
displayName
)
||
capitalise
(
group
));
setTitle
((
status
&&
status
.
displayName
)
||
capitalise
(
group
));
displayUsername
();
displayUsername
();
setButtonsVisibility
();
setButtonsVisibility
();
setUsernameCookie
(
serverConnection
.
username
);
if
(
kind
===
'
change
'
)
if
(
kind
===
'
change
'
)
return
;
return
;
break
;
break
;
...
@@ -4002,6 +4004,27 @@ async function serverConnect() {
...
@@ -4002,6 +4004,27 @@ async function serverConnect() {
}
}
}
}
function
getUsernameCookie
()
{
let
user
=
document
.
cookie
.
split
(
"
;
"
)
.
find
((
row
)
=>
row
.
startsWith
(
"
u=
"
));
if
(
user
)
{
return
user
.
split
(
'
=
'
)[
1
];
}
return
""
;
}
/**
* @param {string} username
*/
function
setUsernameCookie
(
username
)
{
deleteUsernameCookie
();
document
.
cookie
=
'
u=
'
+
username
+
'
; path=/
'
;
}
function
deleteUsernameCookie
()
{
document
.
cookie
=
'
u=; Max-Age=0; path=/
'
;
}
async
function
start
()
{
async
function
start
()
{
group
=
decodeURIComponent
(
group
=
decodeURIComponent
(
location
.
pathname
.
replace
(
/^
\/[
a-z
]
*
\/
/
,
''
).
replace
(
/
\/
$/
,
''
)
location
.
pathname
.
replace
(
/^
\/[
a-z
]
*
\/
/
,
''
).
replace
(
/
\/
$/
,
''
)
...
@@ -4019,6 +4042,7 @@ async function start() {
...
@@ -4019,6 +4042,7 @@ async function start() {
}
}
let
parms
=
new
URLSearchParams
(
window
.
location
.
search
);
let
parms
=
new
URLSearchParams
(
window
.
location
.
search
);
let
username
=
getUsernameCookie
();
if
(
window
.
location
.
search
)
if
(
window
.
location
.
search
)
window
.
history
.
replaceState
(
null
,
''
,
window
.
location
.
pathname
);
window
.
history
.
replaceState
(
null
,
''
,
window
.
location
.
pathname
);
setTitle
(
groupStatus
.
displayName
||
capitalise
(
group
));
setTitle
(
groupStatus
.
displayName
||
capitalise
(
group
));
...
@@ -4031,9 +4055,9 @@ async function start() {
...
@@ -4031,9 +4055,9 @@ async function start() {
await
serverConnect
();
await
serverConnect
();
}
else
if
(
groupStatus
.
authPortal
)
{
}
else
if
(
groupStatus
.
authPortal
)
{
window
.
location
.
href
=
groupStatus
.
authPortal
;
window
.
location
.
href
=
groupStatus
.
authPortal
;
}
else
if
(
window
.
location
.
hash
)
{
}
else
if
(
username
)
{
let
connect
=
document
.
getElementById
(
'
connectbutton
'
);
let
connect
=
document
.
getElementById
(
'
connectbutton
'
);
getInputElement
(
'
username
'
).
value
=
window
.
location
.
hash
.
slice
(
1
)
;
getInputElement
(
'
username
'
).
value
=
username
;
getInputElement
(
'
password
'
).
value
=
""
;
getInputElement
(
'
password
'
).
value
=
""
;
connect
.
click
();
connect
.
click
();
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment