Skip to content

Commit 4ab28f3

Browse files
committed
user script for canned replies
1 parent 69680d6 commit 4ab28f3

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// @author elaskavaia
55
// @match *://studio.boardgamearena.com/licensing
66
// @icon https://www.google.com/s2/favicons?sz=64&domain=boardgamearena.com
7+
// @updateURL https://raw.githubusercontent.com/elaskavaia/bga-sharedcode/master/userscripts/bgalicensesorter.user.js
78
// @run-at document-idle
89
// @version 0.3
910
// @grant none
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// ==UserScript==
2+
// @name BGA Bug report canned replies
3+
// @namespace https://boardgamearena.com/
4+
// @version 0.1
5+
// @description select canned reply
6+
// @author elaskavaia
7+
// @match https://boardgamearena.com/bug?id=*
8+
// @icon https://www.google.com/s2/favicons?sz=64&domain=boardgamearena.com
9+
// @downloadURL https://raw.githubusercontent.com/elaskavaia/bga-sharedcode/master/userscripts/bugcannedanswers.user.js
10+
// @updateURL https://raw.githubusercontent.com/elaskavaia/bga-sharedcode/master/userscripts/bugcannedanswers.user.js
11+
// @run-at document-idle
12+
// @grant none
13+
// ==/UserScript==
14+
15+
(function () {
16+
"use strict";
17+
18+
// Your code here...
19+
//debugger;
20+
let table = [
21+
{
22+
title: "Rule X",
23+
text: "Not a bug. Please conslult the rule book.",
24+
resolution: "notabug",
25+
acton: "change_bug_status"
26+
},
27+
{
28+
title: "Missing screenshot",
29+
text: "Insufficient information. Please provide table number, move number and screenshot",
30+
resolution: "infoneeded",
31+
acton: "change_bug_status"
32+
},
33+
{
34+
title: "Missing move",
35+
text: "Insufficient information. Please provide table number, move number and/or log details",
36+
resolution: "infoneeded",
37+
acton: "change_bug_status"
38+
}
39+
];
40+
let tools = document.querySelector("#moderator_quicktools .pagesection__content");
41+
tools.innerHTML += "<p>Canned answers:</p>";
42+
const report_log = document.getElementById("report_log");
43+
for (let i in table) {
44+
const id = `${table[i].acton}_${table[i].resolution}`;
45+
const a = document.createElement("a");
46+
a.id = id;
47+
a.classList.add("bgabutton", "bgabutton_blue", table[i].acton);
48+
a.innerHTML = table[i].title;
49+
tools.appendChild(a);
50+
tools.appendChild(document.createTextNode(" "));
51+
const text = table[i].text;
52+
53+
a.addEventListener("click", (event) => {
54+
report_log.innerHTML = text;
55+
});
56+
}
57+
})();

0 commit comments

Comments
 (0)