`;
// list of languages
- const available_languages = listSupportedLanguages();
+ const available_languages = window.listSupportedLanguages();
h += `
`;
for (let lang of available_languages) {
h += `
${html_encode(lang.name)}
`;
diff --git a/src/UI/Settings/UITabUsage.js b/src/UI/Settings/UITabUsage.js
index 976475cfb..ba72bd618 100644
--- a/src/UI/Settings/UITabUsage.js
+++ b/src/UI/Settings/UITabUsage.js
@@ -42,16 +42,16 @@ export default {
},
init: ($el_window) => {
$.ajax({
- url: api_origin + "/drivers/usage",
+ url: window.api_origin + "/drivers/usage",
type: 'GET',
async: true,
contentType: "application/json",
headers: {
- "Authorization": "Bearer " + auth_token
+ "Authorization": "Bearer " + window.auth_token
},
statusCode: {
401: function () {
- logout();
+ window.logout();
},
},
success: function (res) {
@@ -93,16 +93,16 @@ export default {
// df
$.ajax({
- url: api_origin + "/df",
+ url: window.api_origin + "/df",
type: 'GET',
async: true,
contentType: "application/json",
headers: {
- "Authorization": "Bearer " + auth_token
+ "Authorization": "Bearer " + window.auth_token
},
statusCode: {
401: function () {
- logout();
+ window.logout();
},
},
success: function (res) {
@@ -113,15 +113,15 @@ export default {
let host_usage_percentage = 0;
if ( res.host_used ) {
- $('#storage-puter-used').html(byte_format(res.used));
+ $('#storage-puter-used').html(window.byte_format(res.used));
$('#storage-puter-used-w').show();
general_used = res.host_used;
host_usage_percentage = ((res.host_used - res.used) / res.capacity * 100).toFixed(0);
}
- $('#storage-used').html(byte_format(general_used));
- $('#storage-capacity').html(byte_format(res.capacity));
+ $('#storage-used').html(window.byte_format(general_used));
+ $('#storage-capacity').html(window.byte_format(res.capacity));
$('#storage-used-percent').html(
usage_percentage + '%' +
(host_usage_percentage > 0
diff --git a/src/UI/Settings/UIWindowChangeEmail.js b/src/UI/Settings/UIWindowChangeEmail.js
index 61f6a2882..1b28c0aee 100644
--- a/src/UI/Settings/UIWindowChangeEmail.js
+++ b/src/UI/Settings/UIWindowChangeEmail.js
@@ -93,11 +93,11 @@ async function UIWindowChangeEmail(options){
$(el_window).find('.new-email').attr('disabled', true);
$.ajax({
- url: api_origin + "/change_email/start",
+ url: window.api_origin + "/change_email/start",
type: 'POST',
async: true,
headers: {
- "Authorization": "Bearer "+auth_token
+ "Authorization": "Bearer "+window.auth_token
},
contentType: "application/json",
data: JSON.stringify({
diff --git a/src/UI/Settings/UIWindowFinalizeUserDeletion.js b/src/UI/Settings/UIWindowFinalizeUserDeletion.js
index 505a6270f..e4511f4e5 100644
--- a/src/UI/Settings/UIWindowFinalizeUserDeletion.js
+++ b/src/UI/Settings/UIWindowFinalizeUserDeletion.js
@@ -26,7 +26,7 @@ async function UIWindowFinalizeUserDeletion(options){
let h = '';
// if user is temporary, ask them to type in 'confirm' to delete their account
- if(user.is_temp){
+ if(window.user.is_temp){
h += `
`;
h += `
×
`;
h += `

`;
@@ -94,7 +94,7 @@ async function UIWindowFinalizeUserDeletion(options){
$(el_window).find('.proceed-with-user-deletion').on('click', function(){
$(el_window).find('.error-message').hide();
// if user is temporary, check if they typed 'confirm'
- if(user.is_temp){
+ if(window.user.is_temp){
if($(el_window).find('.confirm-temporary-user-deletion').val() !== 'confirm'){
$(el_window).find('.error-message').html(i18n('type_confirm_to_delete_account'), false);
$(el_window).find('.error-message').show();
@@ -112,19 +112,19 @@ async function UIWindowFinalizeUserDeletion(options){
// delete user
$.ajax({
- url: api_origin + "/delete-own-user",
+ url: window.api_origin + "/delete-own-user",
type: 'POST',
async: true,
contentType: "application/json",
headers: {
- "Authorization": "Bearer " + auth_token
+ "Authorization": "Bearer " + window.auth_token
},
data: JSON.stringify({
password: $(el_window).find('.confirm-user-deletion-password').val(),
}),
statusCode: {
401: function () {
- logout();
+ window.logout();
},
400: function(){
$(el_window).find('.error-message').html(i18n('incorrect_password'));
@@ -136,7 +136,7 @@ async function UIWindowFinalizeUserDeletion(options){
// mark user as deleted
window.user.deleted = true;
// log user out
- logout();
+ window.logout();
}
else{
$(el_window).find('.error-message').html(html_encode(data.error));
diff --git a/src/UI/Settings/UIWindowSettings.js b/src/UI/Settings/UIWindowSettings.js
index 2a720372e..28300f231 100644
--- a/src/UI/Settings/UIWindowSettings.js
+++ b/src/UI/Settings/UIWindowSettings.js
@@ -45,7 +45,7 @@ async function UIWindowSettings(options){
// side bar
h += ``;
@@ -82,7 +82,6 @@ async function UIWindowSettings(options){
allow_user_select: true,
backdrop: false,
width: 800,
- height: 500,
height: 'auto',
dominant: true,
show_in_taskbar: false,