MCPcopy Create free account
hub / github.com/UseBetterCanvas/bettercanvas / changeCardColor

Function changeCardColor

js/content.js:1141–1156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1139 let cnum = i % colors.length;
1140
1141 let changeCardColor = () => {
1142 fetch(domain + "/api/v1/users/self/colors/courses_" + course_id,
1143 {
1144 method: "PUT",
1145 headers: {
1146 "content-type": "application/json",
1147 'accept': 'application/json',
1148 'X-CSRF-Token': csrfToken,
1149 },
1150 body: JSON.stringify({ "hexcode": colors[cnum] })
1151 }).then(() => {
1152 card.el.querySelector(".ic-DashboardCard__header_hero").style.backgroundColor = colors[cnum];
1153 card.el.querySelector(".ic-DashboardCard__header-title span").style.color = colors[cnum];
1154 card.el.querySelector(".ic-DashboardCard__header-button-bg").style.backgroundColor = colors[cnum];
1155 });
1156 }
1157
1158 colorChanges.push(changeCardColor);
1159

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected