soiz1 commited on
Commit
34d9482
·
verified ·
1 Parent(s): 926e24f

Update src/addons/addons/save-to-google/userscript.js

Browse files
src/addons/addons/save-to-google/userscript.js CHANGED
@@ -300,10 +300,11 @@ export default async ({ addon, console, msg }) => {
300
  fileItem.appendChild(linkContainer);
301
 
302
  // 操作ボタン
303
- const buttonContainer = document.createElement("div");
304
- buttonContainer.style.display = "grid";
305
- buttonContainer.style.gridTemplateColumns = "1fr 1fr";
306
- buttonContainer.style.gap = "0.5rem";
 
307
 
308
  const loadButton = document.createElement("button");
309
  loadButton.textContent = "読み込む";
@@ -374,9 +375,22 @@ export default async ({ addon, console, msg }) => {
374
  }
375
  });
376
 
377
- buttonContainer.appendChild(loadButton);
378
- buttonContainer.appendChild(replaceButton);
379
- buttonContainer.appendChild(deleteButton);
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  fileItem.appendChild(buttonContainer);
381
 
382
  fileList.appendChild(fileItem);
 
300
  fileItem.appendChild(linkContainer);
301
 
302
  // 操作ボタン
303
+ const buttonContainer = document.createElement("div");
304
+ buttonContainer.style.display = "grid";
305
+ buttonContainer.style.gridTemplateColumns = "1fr 1fr 1fr"; // 3列に変更
306
+ buttonContainer.style.gap = "0.5rem";
307
+
308
 
309
  const loadButton = document.createElement("button");
310
  loadButton.textContent = "読み込む";
 
375
  }
376
  });
377
 
378
+ const shareButton = document.createElement("button");
379
+ shareButton.textContent = "共有";
380
+ shareButton.className = "button";
381
+ shareButton.style.width = "100%";
382
+ shareButton.style.backgroundColor = "#4CAF50";
383
+ shareButton.style.color = "white";
384
+
385
+ shareButton.addEventListener("click", (e) => {
386
+ e.stopPropagation();
387
+ window.open(`https://scratch-school.ct.ws/upload.php?id=${project.id}`, "_blank");
388
+ });
389
+
390
+ buttonContainer.appendChild(loadButton);
391
+ buttonContainer.appendChild(replaceButton);
392
+ buttonContainer.appendChild(shareButton);
393
+ buttonContainer.appendChild(deleteButton);
394
  fileItem.appendChild(buttonContainer);
395
 
396
  fileList.appendChild(fileItem);