Merge branch 'main' into #10

This commit is contained in:
Nariman Jelveh
2024-03-18 17:30:47 -07:00
committed by GitHub
22 changed files with 2202 additions and 581 deletions
+24 -2
View File
@@ -34,6 +34,7 @@ import UIWindowQR from "./UIWindowQR.js"
import UIWindowRefer from "./UIWindowRefer.js"
import UITaskbar from "./UITaskbar.js"
import new_context_menu_item from "../helpers/new_context_menu_item.js"
import ChangeLanguage from "../i18n/i18nChangeLanguage.js"
async function UIDesktop(options){
let h = '';
@@ -1070,7 +1071,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
if(window.user.is_temp){
items.push(
{
html: `Save Session`,
html: i18n('save_session'),
icon: `<svg style="margin-bottom: -4px; width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48px" height="48px" viewBox="0 0 48 48"><g transform="translate(0, 0)"><path d="M45.521,39.04L27.527,5.134c-1.021-1.948-3.427-2.699-5.375-1.679-.717,.376-1.303,.961-1.679,1.679L2.479,39.04c-.676,1.264-.635,2.791,.108,4.017,.716,1.207,2.017,1.946,3.42,1.943H41.993c1.403,.003,2.704-.736,3.42-1.943,.743-1.226,.784-2.753,.108-4.017ZM23.032,15h1.937c.565,0,1.017,.467,1,1.031l-.438,14c-.017,.54-.459,.969-1,.969h-1.062c-.54,0-.983-.429-1-.969l-.438-14c-.018-.564,.435-1.031,1-1.031Zm.968,25c-1.657,0-3-1.343-3-3s1.343-3,3-3,3,1.343,3,3-1.343,3-3,3Z" fill="#ffbb00"></path></g></svg>`,
icon_active: `<svg style="margin-bottom: -4px; width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48px" height="48px" viewBox="0 0 48 48"><g transform="translate(0, 0)"><path d="M45.521,39.04L27.527,5.134c-1.021-1.948-3.427-2.699-5.375-1.679-.717,.376-1.303,.961-1.679,1.679L2.479,39.04c-.676,1.264-.635,2.791,.108,4.017,.716,1.207,2.017,1.946,3.42,1.943H41.993c1.403,.003,2.704-.736,3.42-1.943,.743-1.226,.784-2.753,.108-4.017ZM23.032,15h1.937c.565,0,1.017,.467,1,1.031l-.438,14c-.017,.54-.459,.969-1,.969h-1.062c-.54,0-.983-.429-1-.969l-.438-14c-.018-.564,.435-1.031,1-1.031Zm.968,25c-1.657,0-3-1.343-3-3s1.343-3,3-3,3,1.343,3,3-1.343,3-3,3Z" fill="#ffbb00"></path></g></svg>`,
onClick: async function(){
@@ -1122,7 +1123,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
items.push(
{
html: 'Add existing account',
html: i18n('add_existing_account'),
// icon: l_user.username === user.username ? '✓' : '',
onClick: async function(val){
await UIWindowLogin({
@@ -1143,6 +1144,19 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
}
// -------------------------------------------
// Load avaialble languages
// -------------------------------------------
const supoprtedLanguagesItems = ListSupportedLanugages().map(lang => {
return {
html: lang.name,
icon: window.locale === lang.code ? '✓' : '',
onClick: async function(){
ChangeLanguage(lang.code);
}
}
});
UIContextMenu({
id: 'user-options-menu',
parent_element: parent_element,
@@ -1177,6 +1191,14 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
UIWindowChangePassword();
}
},
//--------------------------------------------------
// Change Language
//--------------------------------------------------
{
html: i18n('change_language'),
items: supoprtedLanguagesItems
},
//--------------------------------------------------
// Contact Us
//--------------------------------------------------