mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-23 21:15:49 +02:00
Update reply-account plugin to use default config and swap event order when enabled late
This commit is contained in:
parent
520db2c32e
commit
e2bba8d9e1
Resources/Plugins/reply-account
@ -1,7 +1,7 @@
|
||||
enabled(){
|
||||
var configuration = {};
|
||||
var configuration = { defaultAccount: "" };
|
||||
|
||||
window.TDPF_loadConfigurationFile(this, "user.configuration.js", obj => configuration = obj);
|
||||
window.TDPF_loadConfigurationFile(this, "user.configuration.js", "user.configuration.default.js", obj => configuration = obj);
|
||||
|
||||
this.uiInlineComposeTweetEvent = function(e, data){
|
||||
var account = null;
|
||||
@ -45,7 +45,21 @@ enabled(){
|
||||
}
|
||||
|
||||
ready(){
|
||||
$(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
|
||||
var events = $._data(document, "events");
|
||||
|
||||
if ("uiInlineComposeTweet" in events){
|
||||
$(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
|
||||
|
||||
var handlers = events["uiInlineComposeTweet"];
|
||||
var oldHandler = handlers[0];
|
||||
var newHandler = handlers[1];
|
||||
|
||||
handlers[0] = newHandler;
|
||||
handlers[1] = oldHandler;
|
||||
}
|
||||
else{
|
||||
$(document).on("uiInlineComposeTweet", this.uiInlineComposeTweetEvent);
|
||||
}
|
||||
}
|
||||
|
||||
disabled(){
|
||||
|
@ -1,4 +1,14 @@
|
||||
{
|
||||
/*
|
||||
* WARNING
|
||||
* -------
|
||||
*
|
||||
* Make sure you are editing 'user.configuration.js'.
|
||||
* This file is automatically generated first time the plugin is enabled.
|
||||
* Do not edit the default configuration file, as it will be replaced with each update.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Simple way of configuring the plugin
|
||||
* ------------------------------------
|
Loading…
Reference in New Issue
Block a user