Last active
June 19, 2021 13:25
-
-
Save muro3r/71443ca0cea404e277d5d55bef6d77c4 to your computer and use it in GitHub Desktop.
「プレー録画機能」にいい感じのフィールドを追加する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name addFilenameToMovieList | |
// @namespace https://gist.github.com/muro3r/71443ca0cea404e277d5d55bef6d77c4 | |
// @version 0.1.0 | |
// @description プレー録画機能ページにファイル名っぽいのを追加する | |
// @author muro3r | |
// @match https://p.eagate.573.jp/game/2dx/28/djdata/play_recorder/movie_list.html | |
// ==/UserScript== | |
// 項目名の追加 | |
document.querySelector('ul#pc-title').appendChild(document.createElement('li')); | |
// 各行末尾にファイル名もどきを追加する | |
document.querySelectorAll("div.cat").forEach((element) => { | |
const rowData = {}; | |
for (const row of element.querySelectorAll("[data-name]")) { | |
rowData[row.attributes["data-name"].textContent] = row.textContent; | |
} | |
const valueWrapper = document.createElement("p"); | |
const element_ = document.createElement("input"); | |
element_.value = `${rowData["プレー日時"].replace(/(:|\/)/gi, "-")} ${rowData["楽曲名"]} ${rowData["譜面"]} (${rowData["プレー店舗"]})`; | |
valueWrapper.appendChild(element_); | |
element.appendChild(valueWrapper); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment