mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-30 05:34:06 +02:00
Update edit-design plugin to use notification injection instead of notification.js
This commit is contained in:
parent
1a73fcdb39
commit
c75058b1da
Resources/Plugins/edit-design
@ -300,6 +300,13 @@ enabled(){
|
|||||||
case "15px": TD.settings.setFontSize("large"); break;
|
case "15px": TD.settings.setFontSize("large"); break;
|
||||||
default: TD.settings.setFontSize(parseInt(this.config.fontSize, 10) >= 16 ? "largest" : "smallest"); break;
|
default: TD.settings.setFontSize(parseInt(this.config.fontSize, 10) >= 16 ? "largest" : "smallest"); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$TDP.injectIntoNotificationsBefore(this.$token, "css", "</head>", [
|
||||||
|
"<style type='text/css'>",
|
||||||
|
".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }",
|
||||||
|
".avatar { border-radius: "+this.config.avatarRadius+"% !important }",
|
||||||
|
"</style>"
|
||||||
|
].join(""));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.uiShowActionsMenuEvent = () => {
|
this.uiShowActionsMenuEvent = () => {
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
run(){
|
|
||||||
var extend = function(target, source){
|
|
||||||
for(let prop in source){
|
|
||||||
target[prop] = source[prop];
|
|
||||||
}
|
|
||||||
|
|
||||||
return target;
|
|
||||||
};
|
|
||||||
|
|
||||||
const configFile = "config.json";
|
|
||||||
|
|
||||||
$TDP.readFile(this.$token, configFile, true).then(contents => {
|
|
||||||
try{
|
|
||||||
loadConfigObject(extend(this.defaultConfig, JSON.parse(contents)));
|
|
||||||
}catch(err){
|
|
||||||
loadConfigObject(this.defaultConfig);
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
loadConfigObject(this.defaultConfig);
|
|
||||||
});
|
|
||||||
|
|
||||||
// config handling
|
|
||||||
this.defaultConfig = {
|
|
||||||
fontSize: "12px",
|
|
||||||
avatarRadius: 10
|
|
||||||
};
|
|
||||||
|
|
||||||
var loadConfigObject = config => {
|
|
||||||
let css = window.TDPF_createCustomStyle(this);
|
|
||||||
css.insert(".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+config.fontSize+" !important }");
|
|
||||||
css.insert(".avatar { border-radius: "+config.avatarRadius+"% !important }");
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user