Before you delete ${acctname} account, Windows can automatically save the contents of ${acctname}
My Documents to a folder called ${acct.name} on your desktop. However, Windows
cannot save ${acctname} e-mail messages, Internet favorites, and other settings.
`);
listAccounts();
});
function newAccount() {
let win = new Window({
width: 594,
height: 434,
title: 'Create New Account',
canResize: false,
center: true
});
win.content(`
Create User Account
Choose a user name and picture
Your user name and picture represent your user account. The account you create here is a computer
administrator account. It is recommended to close all open applications before continuing.
Type a user name (for example, John)
`);
win.el.find('.username').on('keyup', function() {
console.log($(this).val());
if ($(this).val() === '') {
win.el.find('.next').attr('disabled', 'disabled');
} else {
win.el.find('.next').removeAttr('disabled');
}
});
win.el.find('.next').on('click', function() {
if (win.el.find('.username').val() === '') {
xp.alert('You need to type a username in order to continue!');
} else {
xp.profile.image = win.el.find('.userimgopt.selected').attr('src');
xp.profile.name = win.el.find('.username').val();
var oldConfigFile = configFile;
configFile = `/Documents and Settings/${xp.profile.name}/config.json`;
xp.wallpaper.href = 'https://cdn.glitch.com/01d2e04f-e49d-4304-aa9e-55b9849b4cce%2FBliss.jpg?1519950052202';
win.content(`
Please wait while we create the user account.
`);
setTimeout(() => {
requiredDirectories = [
`/Documents and Settings`,
`/Documents and Settings/${xp.profile.name}`,
`/Documents and Settings/${xp.profile.name}/My Documents`,
`/Documents and Settings/${xp.profile.name}/My Documents/My Pictures`,
`/Documents and Settings/${xp.profile.name}/My Documents/My Videos`,
`/Documents and Settings/${xp.profile.name}/My Documents/My Music`
];
var i = 0;
function createDirs() {
var dirToCreate = requiredDirectories[i];
if (dirToCreate !== undefined) {
xp.filesystem.createDir(dirToCreate, (e) => {
i ++;
createDirs();
});
} else {
saveConfig(() => {
configFile = oldConfigFile;
loadConfig(() => {
win.close();
});
});
}
}
createDirs();
}, 2000);
}
});
win.el.find('.userimgopt').on('click', function() {
win.el.find('.userimgopt').each(function() {
$(this).removeClass('selected');
});
$(this).addClass('selected');
win.el.find('.userimg').attr('src', $(this).attr('src'));
});
}
});
});