Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
3cc75c2d
Commit
3cc75c2d
authored
May 21, 2017
by
Andreas Valder
Browse files
added password generator function to permission editor, closes #265
parent
c48327c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
static/moderator.js
View file @
3cc75c2d
...
...
@@ -191,8 +191,11 @@ var moderator = {
html
+=
'
<option value="none">Kein Zugriff</option>
'
;
html
+=
'
</select>
'
;
html
+=
'
<input class="col-xs-12 passwordinput authuser" type="text" placeholder="Benutzername">
'
;
html
+=
'
<input class="col-xs-12 passwordinput authpassword" type="text" placeholder="Passwort">
'
;
html
+=
'
<input class="col-xs-10 passwordinput authpassword" type="text" placeholder="Passwort">
'
html
+=
'
<button class="col-xs-2 passwordinput authpgen" type="button" onclick="$(
\'
.authpassword
\'
,this.parentNode).val(moderator.permissioneditor.randompw());"><span class="fa fa-plus" aria-hidden="true"></span></button>
'
html
+=
'
<input class="col-xs-12 authl2p" type="text" placeholder="Lernraum" style="display: none;">
'
;
html
+=
'
<button class="col-xs-6" onclick="moderator.permissioneditor.addbtnclick(this)">Add</button>
'
;
//html += '<button class="col-xs-4" onclick="moderator.permissionedior.updatebtnclick(this)">Update</button>';
html
+=
'
<button class="col-xs-6" onclick="moderator.permissioneditor.delbtnclick(this)">Delete</button>
'
;
...
...
@@ -248,6 +251,15 @@ var moderator = {
$
(
"
.authl2p
"
,
element
.
parentElement
).
hide
();
break
;
}
},
randompw
:
function
()
{;
var
array
=
new
Uint8Array
(
10
);
window
.
crypto
.
getRandomValues
(
array
);
var
result
=
''
;
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
result
+=
String
.
fromCharCode
(
48
+
(
array
[
i
]
/
255.0
)
*
74
);
}
return
result
;
}
},
plots
:
{
...
...
Write
Preview
Supports
Markdown
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