mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-03 23:34:09 +02:00
Add an option to revert replies in edit-design plugin
This commit is contained in:
parent
2a6a607c7b
commit
790d1787fd
Resources/Plugins/edit-design
@ -9,8 +9,9 @@ enabled(){
|
|||||||
fontSize: "12px",
|
fontSize: "12px",
|
||||||
hideTweetActions: true,
|
hideTweetActions: true,
|
||||||
moveTweetActionsToRight: true,
|
moveTweetActionsToRight: true,
|
||||||
smallComposeTextSize: false,
|
revertReplies: false,
|
||||||
roundedScrollBars: false,
|
roundedScrollBars: false,
|
||||||
|
smallComposeTextSize: false,
|
||||||
optimizeAnimations: true,
|
optimizeAnimations: true,
|
||||||
avatarRadius: 10
|
avatarRadius: 10
|
||||||
};
|
};
|
||||||
@ -32,6 +33,8 @@ enabled(){
|
|||||||
if (window.TD_APP_READY){
|
if (window.TD_APP_READY){
|
||||||
this.onAppReady();
|
this.onAppReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.injectDeciderReplyHook(this.tmpConfig.revertReplies);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onAppReady = () => {
|
this.onAppReady = () => {
|
||||||
@ -114,6 +117,11 @@ enabled(){
|
|||||||
let modal = $("#td-design-plugin-modal");
|
let modal = $("#td-design-plugin-modal");
|
||||||
this.setAndShowContainer(modal, false);
|
this.setAndShowContainer(modal, false);
|
||||||
|
|
||||||
|
// RELOAD
|
||||||
|
this.reloadPage = false;
|
||||||
|
modal.find("[data-td-reload]").click(() => this.reloadPage = true);
|
||||||
|
|
||||||
|
// UI EVENTS
|
||||||
let getTextForCustom = function(key){
|
let getTextForCustom = function(key){
|
||||||
return "Custom ("+me.config[key]+")";
|
return "Custom ("+me.config[key]+")";
|
||||||
};
|
};
|
||||||
@ -190,13 +198,30 @@ enabled(){
|
|||||||
}).methods({
|
}).methods({
|
||||||
_render: () => $(this.htmlModal),
|
_render: () => $(this.htmlModal),
|
||||||
destroy: function(){
|
destroy: function(){
|
||||||
|
if (this.reloadPage){
|
||||||
|
location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$("#td-design-plugin-modal").hide();
|
$("#td-design-plugin-modal").hide();
|
||||||
this.supr();
|
this.supr();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// decider injections
|
||||||
|
this.injectDeciderReplyHook = enable => {
|
||||||
|
let prevFunc = TD.decider.updateFromBackend;
|
||||||
|
|
||||||
|
TD.decider.updateFromBackend = function(data){
|
||||||
|
data["simplified_replies"] = !enable;
|
||||||
|
return prevFunc.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
TD.decider.updateForGuestId();
|
||||||
|
};
|
||||||
|
|
||||||
// css and layout injection
|
// css and layout injection
|
||||||
this.resetDesign = function(){
|
this.resetDesign = () => {
|
||||||
if (this.css){
|
if (this.css){
|
||||||
this.css.remove();
|
this.css.remove();
|
||||||
}
|
}
|
||||||
@ -204,7 +229,7 @@ enabled(){
|
|||||||
this.css = window.TDPF_createCustomStyle(this);
|
this.css = window.TDPF_createCustomStyle(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.reinjectAll = function(){
|
this.reinjectAll = () => {
|
||||||
this.resetDesign();
|
this.resetDesign();
|
||||||
|
|
||||||
this.css.insert(".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }");
|
this.css.insert(".txt-base-smallest:not(.icon), .txt-base-largest:not(.icon) { font-size: "+this.config.fontSize+" !important }");
|
||||||
|
@ -78,6 +78,10 @@
|
|||||||
<input data-td-key="moveTweetActionsToRight" class="js-theme-checkbox touch-larger-label" type="checkbox">
|
<input data-td-key="moveTweetActionsToRight" class="js-theme-checkbox touch-larger-label" type="checkbox">
|
||||||
Tweet actions on the right side
|
Tweet actions on the right side
|
||||||
</label>
|
</label>
|
||||||
|
<label class="checkbox">
|
||||||
|
<input data-td-key="revertReplies" data-td-reload class="js-theme-checkbox touch-larger-label" type="checkbox">
|
||||||
|
Revert reply style (reloads page)
|
||||||
|
</label>
|
||||||
|
|
||||||
<!-- DESIGN -->
|
<!-- DESIGN -->
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user