forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_web.js.html
More file actions
45 lines (40 loc) · 1.76 KB
/
Copy pathadd_web.js.html
File metadata and controls
45 lines (40 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<script>
$(function() {
$('#v_domain').change(function() {
var prefix = 'www.';
document.getElementById('v_aliases').value = prefix + document.getElementById('v_domain').value;
});
});
function WEBrandom() {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var webrandom = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
webrandom += chars.substr(rnum, 1);
}
document.v_add_web.v_stats_password.value = webrandom;
}
function FTPrandom(elm) {
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';
var string_length = 10;
var ftprandomstring = '';
for (var i = 0; i < string_length; i++) {
var rnum = Math.floor(Math.random() * chars.length);
ftprandomstring += chars.substr(rnum, 1);
}
$(elm).parents('.ftptable').find('.v-ftp-user-psw').val(ftprandomstring);
}
function elementHideShow(elementToHideOrShow){
var el = document.getElementById(elementToHideOrShow);
el.style.display = el.style.display === 'none' ? 'block' : 'none';
}
$('#vstobjects').bind('submit', function(evt) {
$('input[disabled]').each(function(i, elm) {
$(elm).removeAttr('disabled');
});
});
GLOBAL.FTP_USER_PREFIX = <?=json_encode($user)?>;
GLOBAL.FTP_USER_PREPATH = <?=json_encode($v_ftp_user_prepath)?>;
</script>
<script src="/js/pages/add.web.js"></script>