feat: added home button

This commit is contained in:
SamTV12345 2025-07-28 19:41:36 +02:00 committed by SamTV12345
parent bc5237518e
commit 483153493f
8 changed files with 27 additions and 2 deletions

View file

@ -651,6 +651,7 @@
"right": [
["importexport", "timeslider", "savedrevision"],
["settings", "embed"],
["home"],
["showusers"]
],
"timeslider": [

View file

@ -650,6 +650,7 @@
"right": [
["importexport", "timeslider", "savedrevision"],
["settings", "embed"],
["home"],
["showusers"]
],
"timeslider": [

View file

@ -70,7 +70,8 @@
"pad.toolbar.savedRevision.title": "Version speichern",
"pad.toolbar.settings.title": "Einstellungen",
"pad.toolbar.embed.title": "Dieses Pad teilen oder einbetten",
"pad.toolbar.showusers.title": "Benutzer dieses Pads anzeigen",
"pad.toolbar.home.title": "Zurück zur Startseite",
"pad.toolbar.showusers.title": "Benutzer dieses Pads anzeigen",
"pad.colorpicker.save": "Speichern",
"pad.colorpicker.cancel": "Abbrechen",
"pad.loading": "Laden …",

View file

@ -53,6 +53,7 @@
"pad.toolbar.savedRevision.title": "Save Revision",
"pad.toolbar.settings.title": "Settings",
"pad.toolbar.embed.title": "Share and Embed this pad",
"pad.toolbar.home.title": "Back to home",
"pad.toolbar.showusers.title": "Show the users on this pad",
"pad.colorpicker.save": "Save",

View file

@ -240,6 +240,7 @@ module.exports = {
settings: defaultButtonAttributes('settings'),
embed: defaultButtonAttributes('embed'),
showusers: defaultButtonAttributes('showusers'),
home: defaultButtonAttributes('home'),
timeslider_export: {
command: 'import_export',

View file

@ -101,7 +101,7 @@
.buttonicon-pencil-alt:before { content: '\e808'; } /* '' */
.buttonicon-file-code:before { content: '\e809'; } /* '' */
.buttonicon-mail:before { content: '\e80a'; } /* '' */
.buttonicon-home:before { content: '\e80b'; } /* '' */
.buttonicon-home:before { content: '\e80b'; font-size: 20px } /* '' */
.buttonicon-trash:before { content: '\e80e'; } /* '' */
.buttonicon-times:before { content: '\e826'; } /* '' */
.buttonicon-pause:before { content: '\e829'; } /* '' */

View file

@ -364,6 +364,9 @@ exports.padeditbar = new class {
this.registerDropdownCommand('connectivity');
this.registerDropdownCommand('import_export');
this.registerDropdownCommand('embed');
this.registerCommand('home', ()=>{
window.location.href = window.location.href + "/../.."
})
this.registerCommand('settings', () => {
this.toggleDropDown('settings');

View file

@ -0,0 +1,17 @@
import {expect, test} from "@playwright/test";
import {clearPadContent, getPadBody, goToNewPad} from "../helper/padHelper";
test.beforeEach(async ({ page })=>{
// create a new pad before each test run
await goToNewPad(page);
})
test('should go to home on pad', async ({page}) => {
const homeButton = page.locator('.buttonicon.buttonicon-home')
const attribute = await homeButton.getAttribute('data-l10n-id')
expect(attribute).toBe('pad.toolbar.home.title');
await homeButton.click();
const url = page.url();
expect(url).not.toContain('/p/');
})