mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 10:32:10 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
fb2f1e3031 | |||
00a0da3df3 | |||
8c447b1ffb | |||
a4841175e8 | |||
9b139132a1 | |||
4a404ecabc | |||
aee758b559 | |||
be060d0386 |
@@ -4,11 +4,18 @@ using CefSharp;
|
|||||||
namespace TweetDuck.Core.Handling{
|
namespace TweetDuck.Core.Handling{
|
||||||
sealed class DragHandlerBrowser : IDragHandler{
|
sealed class DragHandlerBrowser : IDragHandler{
|
||||||
public bool OnDragEnter(IWebBrowser browserControl, IBrowser browser, IDragData dragData, DragOperationsMask mask){
|
public bool OnDragEnter(IWebBrowser browserControl, IBrowser browser, IDragData dragData, DragOperationsMask mask){
|
||||||
|
void TriggerDragStart(string type, string data = null){
|
||||||
|
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", type, data);
|
||||||
|
}
|
||||||
|
|
||||||
if (dragData.IsLink){
|
if (dragData.IsLink){
|
||||||
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", "link", dragData.LinkUrl);
|
TriggerDragStart("link", dragData.LinkUrl);
|
||||||
|
}
|
||||||
|
else if (dragData.IsFragment){
|
||||||
|
TriggerDragStart("text", dragData.FragmentText.Trim());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", "unknown");
|
TriggerDragStart("unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -22,7 +22,7 @@ namespace TweetDuck.Core.Notification.Screenshot{
|
|||||||
browser.LoadingStateChanged += (sender, args) => {
|
browser.LoadingStateChanged += (sender, args) => {
|
||||||
if (!args.IsLoading){
|
if (!args.IsLoading){
|
||||||
using(IFrame frame = args.Browser.MainFrame){
|
using(IFrame frame = args.Browser.MainFrame){
|
||||||
ScriptLoader.ExecuteScript(frame, "window.setTimeout($TD_NotificationScreenshot.trigger, 129)", "gen:screenshot");
|
ScriptLoader.ExecuteScript(frame, "window.setTimeout($TD_NotificationScreenshot.trigger, document.getElementsByTagName('iframe').length ? 267 : 67)", "gen:screenshot");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -21,7 +21,7 @@ namespace TweetDuck{
|
|||||||
public const string BrandName = "TweetDuck";
|
public const string BrandName = "TweetDuck";
|
||||||
public const string Website = "https://tweetduck.chylex.com";
|
public const string Website = "https://tweetduck.chylex.com";
|
||||||
|
|
||||||
public const string VersionTag = "1.10";
|
public const string VersionTag = "1.10.1";
|
||||||
|
|
||||||
public static readonly bool IsPortable = File.Exists("makeportable");
|
public static readonly bool IsPortable = File.Exists("makeportable");
|
||||||
|
|
||||||
|
@@ -57,9 +57,10 @@
|
|||||||
<details>
|
<details>
|
||||||
<summary id="emoji">How to add emoji to tweets</summary>
|
<summary id="emoji">How to add emoji to tweets</summary>
|
||||||
<div>
|
<div>
|
||||||
<p>When writing a new tweet, click the heart icon to open an emoji picker. If you're writing a reply, click the <em>Popout</em> icon first to bring the reply into the large panel.</p>
|
<p>When writing a new tweet, click the heart icon to open an emoji picker. If you're writing a reply, click the <em>Popout</em> icon to bring the reply into the New Tweet panel.</p>
|
||||||
<p>Then you can immediately type into the <em>Search</em> field, which accepts keywords separated by space. Pressing <em>Enter</em> in the search field (when not empty) will insert the first result into your tweet. Pressing <em>Escape</em> closes the emoji picker.</p>
|
<p>Then you can immediately type into the <em>Search</em> field, which accepts keywords separated by space. Pressing <em>Enter</em> in the search field (when not empty) will insert the first result into your tweet. Pressing <em>Escape</em> closes the emoji picker.</p>
|
||||||
<p>You can also use your mouse to scroll through the emoji, click on the emoji to insert them, and change the skin tone.</p>
|
<p>You can also use your mouse to change the skin tone, scroll through the emoji, and click on the emoji to insert them.</p>
|
||||||
|
<p>Typing <em>:emoji_name:</em> in the New Tweet panel will automatically search for an emoji using those keywords. If a single emoji is found, it will be inserted into the tweet (press <em>Backspace</em> or <em>Escape</em> to revert it). If multiple emojis are found, it will open the emoji picker where you can refine the search, or press <em>Escape</em> to go back.</p>
|
||||||
<p>Emoji are provided by an official plugin called <em>Emoji keyboard</em>, which is enabled by default. The heart icon will not show if the plugin is disabled.</p>
|
<p>Emoji are provided by an official plugin called <em>Emoji keyboard</em>, which is enabled by default. The heart icon will not show if the plugin is disabled.</p>
|
||||||
<img src="img/new-tweet-emoji.png" alt="">
|
<img src="img/new-tweet-emoji.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
|
@@ -8,7 +8,7 @@ Custom reply account
|
|||||||
chylex
|
chylex
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
1.2.2
|
1.2.3
|
||||||
|
|
||||||
[website]
|
[website]
|
||||||
https://tweetduck.chylex.com
|
https://tweetduck.chylex.com
|
||||||
@@ -20,4 +20,4 @@ configuration.js
|
|||||||
configuration.default.js
|
configuration.default.js
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
1.3.3
|
1.8
|
@@ -17,7 +17,7 @@ enabled(){
|
|||||||
return;
|
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 column = TD.controller.columnManager.get(section.attr("data-column"));
|
||||||
var header = $(".column-title", section);
|
var header = $(".column-title", section);
|
||||||
@@ -35,7 +35,7 @@ enabled(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
query = configuration.customSelector(column.getColumnType(), columnTitle, columnAccount, column);
|
query = configuration.customSelector(column.getColumnType(), columnTitle, columnAccount, column, section.hasClass("column-temp"));
|
||||||
}catch(e){
|
}catch(e){
|
||||||
$TD.alert("warning", "Plugin reply-account has invalid configuration: customSelector threw an error: "+e.message);
|
$TD.alert("warning", "Plugin reply-account has invalid configuration: customSelector threw an error: "+e.message);
|
||||||
return;
|
return;
|
||||||
|
@@ -21,11 +21,14 @@
|
|||||||
* This assumes a basic knowledge of JavaScript and jQuery.
|
* This assumes a basic knowledge of JavaScript and jQuery.
|
||||||
*
|
*
|
||||||
* 1. Set value of 'useAdvancedSelector' to true
|
* 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'.
|
* 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.
|
* 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
|
* 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'):
|
* 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').
|
* 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,
|
* The 'column' parameter is a TweetDeck column object. If you want to see the object structure,
|
||||||
* run the following code in your browser console, which will return an array containing all of your
|
* run the following code in the console for an array containing all of your column objects:
|
||||||
* current column objects in order:
|
|
||||||
* TD.controller.columnManager.getAllOrdered()
|
* 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,
|
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"){
|
if (type === "col_search" && title === "TweetDuck"){
|
||||||
// This is a search column that looks for 'TweetDuck' in the tweets,
|
// This is a search column that looks for 'TweetDuck' in the tweets,
|
||||||
// search columns are normally linked to the preferred account
|
// 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";
|
return "@TryTweetDuck";
|
||||||
}
|
}
|
||||||
else if (type === "col_timeline" && account === "@chylexcz"){
|
else if (type === "col_timeline" && account === "@chylexcz"){
|
||||||
// This is a Home column of my test 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";
|
return "@chylexmc";
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise returns 'undefined' which falls back to 'defaultAccount' behavior
|
// otherwise returns 'undefined' which falls back to 'defaultAccount' behavior
|
||||||
}*/
|
}
|
||||||
}
|
}
|
@@ -580,7 +580,7 @@
|
|||||||
setImportantProperty(selectedTweet.find(".js-media-preview-container"), "margin-bottom", "4px");
|
setImportantProperty(selectedTweet.find(".js-media-preview-container"), "margin-bottom", "4px");
|
||||||
selectedTweet.find(".js-translate-call-to-action").first().remove();
|
selectedTweet.find(".js-translate-call-to-action").first().remove();
|
||||||
selectedTweet.find(".js-tweet").first().nextAll().remove();
|
selectedTweet.find(".js-tweet").first().nextAll().remove();
|
||||||
selectedTweet.find("footer").last().prevUntil(":not(.txt-mute.txt-small)").addBack().remove(); // footer, date, location
|
selectedTweet.find("footer").last().prevUntil(":not(.txt-mute)").addBack().remove(); // footer, date, location
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
setImportantProperty(selectedTweet.find(".js-media-preview-container"), "margin-bottom", "10px");
|
setImportantProperty(selectedTweet.find(".js-media-preview-container"), "margin-bottom", "10px");
|
||||||
@@ -684,7 +684,7 @@
|
|||||||
let isDraggingValid = false;
|
let isDraggingValid = false;
|
||||||
|
|
||||||
window.TDGF_onGlobalDragStart = function(type, data){
|
window.TDGF_onGlobalDragStart = function(type, data){
|
||||||
isDraggingValid = type === "link" && tweetRegex.test(data);
|
isDraggingValid = (type === "link" || type === "text") && tweetRegex.test(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
app.delegate("section.js-column", {
|
app.delegate("section.js-column", {
|
||||||
@@ -796,11 +796,13 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block: Make middle click on tweet reply icon open the compose drawer.
|
// Block: Make middle click on tweet reply icon open the compose drawer. Only works for non-temporary columns.
|
||||||
//
|
//
|
||||||
app.delegate(".js-reply-action", "mousedown", function(e){
|
app.delegate(".js-reply-action", "auxclick", function(e){
|
||||||
if (e.which === 2){
|
if (e.which === 2){
|
||||||
if ($("[data-drawer='compose']").hasClass("is-hidden")){
|
let column = $(this).closest(".js-column");
|
||||||
|
|
||||||
|
if (column && column.hasClass("column") && $("[data-drawer='compose']").hasClass("is-hidden")){
|
||||||
$(document).trigger("uiDrawerShowDrawer", {
|
$(document).trigger("uiDrawerShowDrawer", {
|
||||||
drawer: "compose",
|
drawer: "compose",
|
||||||
withAnimation: true
|
withAnimation: true
|
||||||
|
@@ -42,7 +42,11 @@
|
|||||||
border-radius: 1px !important;
|
border-radius: 1px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.compose-text-container, .dropdown-menu, .list-item-last, .quoted-tweet, .input-group-button, input, textarea, select, .prf-header, .accs li, .accs img {
|
.compose-text-container, .compose-reply-tweet, .compose-message-recipient-input-container, .compose-message-recipient {
|
||||||
|
border-radius: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu, .list-item-last, .quoted-tweet, .input-group-button, input, textarea, select, .prf-header, .accs li, .accs img {
|
||||||
border-radius: 0 !important;
|
border-radius: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,9 +193,14 @@ a[data-full-url] {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************/
|
.is-inverted-dark .inline-reply .btn:hover {
|
||||||
/* Fix glaring visual issues because twitter is fucking incompetent */
|
/* Reply buttons in modals are bork */
|
||||||
/********************************************************************/
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
/* Fix glaring visual issues that twitter hasn't fixed yet smh */
|
||||||
|
/***************************************************************/
|
||||||
|
|
||||||
.column-nav-link .attribution {
|
.column-nav-link .attribution {
|
||||||
/* fix cut off account names */
|
/* fix cut off account names */
|
||||||
@@ -203,6 +212,17 @@ a[data-full-url] {
|
|||||||
margin: 20px 0 0 !important;
|
margin: 20px 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.compose-reply-tweet-remove {
|
||||||
|
/* fix close reply button position; this would make sense if the reply account name became full size, but it still cuts off where the button used to be */
|
||||||
|
top: 3px !important;
|
||||||
|
right: -2px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#account-safeguard-checkbox, #inline-account-safeguard-checkbox {
|
||||||
|
/* fix "Ready to Tweet/send" alignment with the checkbox */
|
||||||
|
vertical-align: -15%;
|
||||||
|
}
|
||||||
|
|
||||||
/************************************************/
|
/************************************************/
|
||||||
/* Fix tooltips in navigation and column header */
|
/* Fix tooltips in navigation and column header */
|
||||||
/************************************************/
|
/************************************************/
|
||||||
|
Reference in New Issue
Block a user