diff --git a/src/UI/UITaskbar.js b/src/UI/UITaskbar.js index 43b7a603..2184f4c4 100644 --- a/src/UI/UITaskbar.js +++ b/src/UI/UITaskbar.js @@ -21,19 +21,19 @@ import UITaskbarItem from './UITaskbarItem.js' import UIPopover from './UIPopover.js' async function UITaskbar(options){ - global_element_id++; + window.global_element_id++; options = options ?? {}; options.content = options.content ?? ''; // get launch apps $.ajax({ - url: api_origin + "/get-launch-apps", + url: window.api_origin + "/get-launch-apps", type: 'GET', async: true, contentType: "application/json", headers: { - "Authorization": "Bearer "+auth_token + "Authorization": "Bearer "+window.auth_token }, success: function (apps){ window.launch_apps = apps; @@ -41,7 +41,7 @@ async function UITaskbar(options){ }); let h = ''; - h += `
`; + h += `
`; $('.desktop').append(h); @@ -74,15 +74,15 @@ async function UITaskbar(options){ // In the rare case that launch_apps is not populated yet, get it from the server // then populate the popover - if(!launch_apps || !launch_apps.recent || launch_apps.recent.length === 0){ + if(!window.launch_apps || !window.launch_apps.recent || window.launch_apps.recent.length === 0){ // get launch apps - launch_apps = await $.ajax({ - url: api_origin + "/get-launch-apps", + window.launch_apps = await $.ajax({ + url: window.api_origin + "/get-launch-apps", type: 'GET', async: true, contentType: "application/json", headers: { - "Authorization": "Bearer "+auth_token + "Authorization": "Bearer "+window.auth_token }, }); } @@ -96,14 +96,14 @@ async function UITaskbar(options){ // ------------------------------------------- // Recent apps // ------------------------------------------- - if(launch_apps.recent.length > 0){ + if(window.launch_apps.recent.length > 0){ // heading apps_str += `

${i18n('recent')}

`; // apps apps_str += `
`; - for (let index = 0; index < window.launch_recent_apps_count && index < launch_apps.recent.length; index++) { - const app_info = launch_apps.recent[index]; + for (let index = 0; index < window.launch_recent_apps_count && index < window.launch_apps.recent.length; index++) { + const app_info = window.launch_apps.recent[index]; apps_str += `
`; apps_str += `
`; apps_str += ``; @@ -116,14 +116,14 @@ async function UITaskbar(options){ // ------------------------------------------- // Reccomended apps // ------------------------------------------- - if(launch_apps.recommended.length > 0){ + if(window.launch_apps.recommended.length > 0){ // heading - apps_str += `

Recommended

`; + apps_str += `

Recommended

`; // apps apps_str += `