Revert "Merge pull request #2395 from matrix-org/dbkr/merge_develop_experimental"
This reverts commit ad47144355
.
This commit is contained in:
parent
d111fe27bb
commit
f928be6f59
77 changed files with 598 additions and 3532 deletions
|
@ -392,7 +392,7 @@ class Tinter {
|
|||
// XXX: we could just move this all into TintableSvg, but as it's so similar
|
||||
// to the CSS fixup stuff in Tinter (just that the fixups are stored in TintableSvg)
|
||||
// keeping it here for now.
|
||||
calcSvgFixups(svgs, forceColors) {
|
||||
calcSvgFixups(svgs) {
|
||||
// go through manually fixing up SVG colours.
|
||||
// we could do this by stylesheets, but keeping the stylesheets
|
||||
// updated would be a PITA, so just brute-force search for the
|
||||
|
@ -420,21 +420,13 @@ class Tinter {
|
|||
const tag = tags[j];
|
||||
for (let k = 0; k < this.svgAttrs.length; k++) {
|
||||
const attr = this.svgAttrs[k];
|
||||
for (let m = 0; m < this.keyHex.length; m++) { // dev note: don't use L please.
|
||||
// We use a different attribute from the one we're setting
|
||||
// because we may also be using forceColors. If we were to
|
||||
// check the keyHex against a forceColors value, it may not
|
||||
// match and therefore not change when we need it to.
|
||||
const valAttrName = "mx-val-" + attr;
|
||||
let attribute = tag.getAttribute(valAttrName);
|
||||
if (!attribute) attribute = tag.getAttribute(attr); // fall back to the original
|
||||
if (attribute && (attribute.toUpperCase() === this.keyHex[m] || attribute.toLowerCase() === this.keyRgb[m])) {
|
||||
for (let l = 0; l < this.keyHex.length; l++) {
|
||||
if (tag.getAttribute(attr) &&
|
||||
tag.getAttribute(attr).toUpperCase() === this.keyHex[l]) {
|
||||
fixups.push({
|
||||
node: tag,
|
||||
attr: attr,
|
||||
refAttr: valAttrName,
|
||||
index: m,
|
||||
forceColors: forceColors,
|
||||
index: l,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -450,9 +442,7 @@ class Tinter {
|
|||
if (DEBUG) console.log("applySvgFixups start for " + fixups);
|
||||
for (let i = 0; i < fixups.length; i++) {
|
||||
const svgFixup = fixups[i];
|
||||
const forcedColor = svgFixup.forceColors ? svgFixup.forceColors[svgFixup.index] : null;
|
||||
svgFixup.node.setAttribute(svgFixup.attr, forcedColor ? forcedColor : this.colors[svgFixup.index]);
|
||||
svgFixup.node.setAttribute(svgFixup.refAttr, this.colors[svgFixup.index]);
|
||||
svgFixup.node.setAttribute(svgFixup.attr, this.colors[svgFixup.index]);
|
||||
}
|
||||
if (DEBUG) console.log("applySvgFixups end");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue