Skip to content

Commit

Permalink
g
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 21, 2024
1 parent 33eda59 commit 41c56ba
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function createHamburgerMenu() {
`;
menu.innerHTML += `
<div class="menu-item" data-action="editTitle">ページタイトルを編集</div>
`;
menu.innerHTML += `
<div class="menu-item" data-action="uploadAll">Upload All</div>
`;
document.body.appendChild(menu);

Expand Down Expand Up @@ -136,6 +139,9 @@ menu.innerHTML += `
case 'editTitle':
editPageTitle();
break;
case 'uploadAll':
uploadAllData();
break;
}
menu.style.display = 'none';
});
Expand All @@ -153,6 +159,15 @@ menu.innerHTML += `
return { hamburger, menu };
}

function uploadAllData(tray = getRootElement().__trayInstance){
if (tray.uploadData){
tray.uploadData();
}
if (tray.children.length){
tray.children.map(t=>uploadAllData(t))
}
}

function editPageTitle() {
const currentTitle = document.title;
const newTitle = prompt("新しいページタイトルを入力してください:", currentTitle);
Expand Down

0 comments on commit 41c56ba

Please sign in to comment.