-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathapp.js
More file actions
34 lines (28 loc) · 975 Bytes
/
Copy pathapp.js
File metadata and controls
34 lines (28 loc) · 975 Bytes
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
$("#form").on("submit", function(e) {
e.preventDefault();
});
function process() {
init($('#form').serializeArray());
var theme = url.substring(url.indexOf('frontend/') + 9, url.indexOf('/index.html'));
var domain = url.substring(0, url.indexOf(':208') + 5); // Only works while cPanel runs on 208x
var ftp = (ftpserver.length > 0);
var header = [ //Build header
'$auth = base64_encode("' + username + ':' + password + '");',
'$domain = "' + domain + '";',
'$theme = "' + theme + '";',
'$ftp = ' + ftp + ';',
'$ftp_server = "' + ftpserver + '";',
'$ftp_username = "' + ftpusername + '";',
'$ftp_password = "' + ftppassword + '";',
'$ftp_port = "' + ftpport + '";',
'$ftp_directory = "' + ftpdirectory + '";'
].join('\n');
code = code.replace('{{header}}', header);
$('#result').val(code);
document.location.href="#submitButton";
}
function init(data) {
for (var i = 0; i < data.length; i++) {
window[data[i].name] = data[i].value;
}
}