1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-13 18:15:48 +02:00

Update reply-account docs & fix error with temporary columns and advanced selector

This commit is contained in:
chylex 2017-09-29 12:47:13 +02:00
parent be060d0386
commit aee758b559
3 changed files with 20 additions and 12 deletions
Resources/Plugins/reply-account

View File

@ -8,7 +8,7 @@ Custom reply account
chylex
[version]
1.2.2
1.2.3
[website]
https://tweetduck.chylex.com
@ -20,4 +20,4 @@ configuration.js
configuration.default.js
[requires]
1.3.3
1.8

View File

@ -17,7 +17,7 @@ enabled(){
return;
}
var section = data.element.closest("section.column");
var section = data.element.closest("section.js-column");
var column = TD.controller.columnManager.get(section.attr("data-column"));
var header = $(".column-title", section);
@ -35,7 +35,7 @@ enabled(){
}
try{
query = configuration.customSelector(column.getColumnType(), columnTitle, columnAccount, column);
query = configuration.customSelector(column.getColumnType(), columnTitle, columnAccount, column, section.hasClass("column-temp"));
}catch(e){
$TD.alert("warning", "Plugin reply-account has invalid configuration: customSelector threw an error: "+e.message);
return;

View File

@ -21,11 +21,14 @@
* This assumes a basic knowledge of JavaScript and jQuery.
*
* 1. Set value of 'useAdvancedSelector' to true
* 2. Uncomment the 'customSelector' function, and replace the example code with your desired behavior
* 2. Replace the example code in 'customSelector' function with your desired behavior
*
* The 'customSelector' function should return a string in one of the formats supported by 'defaultAccount'.
* If it returns anything else (for example, false or undefined), it falls back to 'defaultAccount' behavior.
*
* When writing a custom function, you can install Dev Tools to access the browser console:
* https://tweetduck.chylex.com/guide/#dev-tools
*
*
* The 'type' parameter is TweetDeck column type. Here is the full list of column types, note that some are
* unused and have misleading names (for example, Home columns are 'col_timeline' instead of 'col_home'):
@ -46,28 +49,33 @@
* contain other text (for example, the Scheduled column contains the string 'All accounts').
*
*
* The 'column' parameter is a TweetDeck column object. If you want to see all properties of the object,
* run the following code in your browser console, which will return an array containing all of your
* current column objects in order:
* The 'column' parameter is a TweetDeck column object. If you want to see the object structure,
* run the following code in the console for an array containing all of your column objects:
* TD.controller.columnManager.getAllOrdered()
*
*
* The 'isTemporary' parameter is true if the column is not attached to the main column list,
* for example when clicking on a profile and viewing their tweets in a modal dialog.
*
*/
useAdvancedSelector: false,
/*customSelector: function(type, title, account, column){
customSelector: function(type, title, account, column, isTemporary){
console.info(arguments); // Prints all arguments into the console
if (type === "col_search" && title === "TweetDuck"){
// This is a search column that looks for 'TweetDuck' in the tweets,
// search columns are normally linked to the preferred account
// so this forces the @TryTweetDuck account to be used instead.
// so this forces the @TryTweetDuck account to be used instead
return "@TryTweetDuck";
}
else if (type === "col_timeline" && account === "@chylexcz"){
// This is a Home column of my test account @chylexcz,
// but I want to reply to tweets from my official account.
// but I want to reply to tweets from my official account
return "@chylexmc";
}
// otherwise returns 'undefined' which falls back to 'defaultAccount' behavior
}*/
}
}