mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 10:32:10 +02:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
98799734c5 | |||
96f491a666 | |||
29e541dbef | |||
1343b9c113 | |||
94920fd459 | |||
b2f3b245b7 | |||
15bc6c1d73 | |||
2c175b8d3a | |||
a48c17a769 | |||
03465c4ab0 | |||
b4e936c530 | |||
fb1482370a | |||
e831bc2bea |
@@ -74,7 +74,7 @@ namespace TweetDuck.Configuration{
|
|||||||
|
|
||||||
public TweetNotification.Size NotificationSize { get; set; } = TweetNotification.Size.Auto;
|
public TweetNotification.Size NotificationSize { get; set; } = TweetNotification.Size.Auto;
|
||||||
public Size CustomNotificationSize { get; set; } = Size.Empty;
|
public Size CustomNotificationSize { get; set; } = Size.Empty;
|
||||||
public int NotificationScrollSpeed { get; set; } = 10;
|
public int NotificationScrollSpeed { get; set; } = 100;
|
||||||
|
|
||||||
public int NotificationSoundVolume { get; set; } = 100;
|
public int NotificationSoundVolume { get; set; } = 100;
|
||||||
private string _notificationSoundPath;
|
private string _notificationSoundPath;
|
||||||
@@ -173,6 +173,11 @@ namespace TweetDuck.Configuration{
|
|||||||
|
|
||||||
private void LoadInternal(bool backup){
|
private void LoadInternal(bool backup){
|
||||||
Serializer.Read(backup ? GetBackupFile(file) : file, this);
|
Serializer.Read(backup ? GetBackupFile(file) : file, this);
|
||||||
|
|
||||||
|
if (NotificationScrollSpeed == 10){ // incorrect initial value
|
||||||
|
NotificationScrollSpeed = 100;
|
||||||
|
Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static UserConfig Load(string file){
|
public static UserConfig Load(string file){
|
||||||
|
@@ -75,6 +75,9 @@ namespace TweetDuck.Core{
|
|||||||
Controls.Add(new MenuStrip{ Visible = false }); // fixes Alt freezing the program in Win 10 Anniversary Update
|
Controls.Add(new MenuStrip{ Visible = false }); // fixes Alt freezing the program in Win 10 Anniversary Update
|
||||||
|
|
||||||
Disposed += (sender, args) => {
|
Disposed += (sender, args) => {
|
||||||
|
Config.MuteToggled -= Config_MuteToggled;
|
||||||
|
Config.TrayBehaviorChanged -= Config_TrayBehaviorChanged;
|
||||||
|
|
||||||
browser.Dispose();
|
browser.Dispose();
|
||||||
contextMenu.Dispose();
|
contextMenu.Dispose();
|
||||||
|
|
||||||
@@ -84,6 +87,8 @@ namespace TweetDuck.Core{
|
|||||||
analytics?.Dispose();
|
analytics?.Dispose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Config.MuteToggled += Config_MuteToggled;
|
||||||
|
|
||||||
this.trayIcon.ClickRestore += trayIcon_ClickRestore;
|
this.trayIcon.ClickRestore += trayIcon_ClickRestore;
|
||||||
this.trayIcon.ClickClose += trayIcon_ClickClose;
|
this.trayIcon.ClickClose += trayIcon_ClickClose;
|
||||||
Config.TrayBehaviorChanged += Config_TrayBehaviorChanged;
|
Config.TrayBehaviorChanged += Config_TrayBehaviorChanged;
|
||||||
@@ -193,6 +198,10 @@ namespace TweetDuck.Core{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Config_MuteToggled(object sender, EventArgs e){
|
||||||
|
TriggerAnalyticsEvent(AnalyticsFile.Event.MuteNotification);
|
||||||
|
}
|
||||||
|
|
||||||
private void Config_TrayBehaviorChanged(object sender, EventArgs e){
|
private void Config_TrayBehaviorChanged(object sender, EventArgs e){
|
||||||
UpdateTrayIcon();
|
UpdateTrayIcon();
|
||||||
}
|
}
|
||||||
@@ -259,6 +268,11 @@ namespace TweetDuck.Core{
|
|||||||
private void updates_UpdateAccepted(object sender, UpdateEventArgs e){
|
private void updates_UpdateAccepted(object sender, UpdateEventArgs e){
|
||||||
this.InvokeAsyncSafe(() => {
|
this.InvokeAsyncSafe(() => {
|
||||||
FormManager.CloseAllDialogs();
|
FormManager.CloseAllDialogs();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Config.DismissedUpdate)){
|
||||||
|
Config.DismissedUpdate = null;
|
||||||
|
Config.Save();
|
||||||
|
}
|
||||||
|
|
||||||
updates.BeginUpdateDownload(this, e.UpdateInfo, update => {
|
updates.BeginUpdateDownload(this, e.UpdateInfo, update => {
|
||||||
if (update.DownloadStatus == UpdateDownloadStatus.Done){
|
if (update.DownloadStatus == UpdateDownloadStatus.Done){
|
||||||
@@ -377,7 +391,7 @@ namespace TweetDuck.Core{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (showGuide){
|
if (showGuide){
|
||||||
ShowChildForm(new FormGuide());
|
FormGuide.Show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ using TweetDuck.Core.Other;
|
|||||||
|
|
||||||
namespace TweetDuck.Core.Handling{
|
namespace TweetDuck.Core.Handling{
|
||||||
abstract class ContextMenuBase : IContextMenuHandler{
|
abstract class ContextMenuBase : IContextMenuHandler{
|
||||||
protected static readonly bool HasDevTools = File.Exists(Path.Combine(Program.ProgramPath, "devtools_resources.pak"));
|
public static readonly bool HasDevTools = File.Exists(Path.Combine(Program.ProgramPath, "devtools_resources.pak"));
|
||||||
|
|
||||||
private static TwitterUtils.ImageQuality ImageQuality => Program.UserConfig.TwitterImageQuality;
|
private static TwitterUtils.ImageQuality ImageQuality => Program.UserConfig.TwitterImageQuality;
|
||||||
|
|
||||||
|
@@ -109,6 +109,8 @@ namespace TweetDuck.Core.Notification{
|
|||||||
|
|
||||||
public bool CanViewDetail => currentNotification != null && !string.IsNullOrEmpty(currentNotification.ColumnId) && !string.IsNullOrEmpty(currentNotification.ChirpId);
|
public bool CanViewDetail => currentNotification != null && !string.IsNullOrEmpty(currentNotification.ColumnId) && !string.IsNullOrEmpty(currentNotification.ChirpId);
|
||||||
public bool IsPaused => pauseCounter > 0;
|
public bool IsPaused => pauseCounter > 0;
|
||||||
|
|
||||||
|
protected bool IsCursorOverBrowser => browser.Bounds.Contains(PointToClient(Cursor.Position));
|
||||||
|
|
||||||
public bool FreezeTimer { get; set; }
|
public bool FreezeTimer { get; set; }
|
||||||
public bool ContextMenuOpen { get; set; }
|
public bool ContextMenuOpen { get; set; }
|
||||||
@@ -201,8 +203,7 @@ namespace TweetDuck.Core.Notification{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual string GetTweetHTML(TweetNotification tweet){
|
protected virtual string GetTweetHTML(TweetNotification tweet){
|
||||||
string bodyClasses = browser.Bounds.Contains(PointToClient(Cursor.Position)) ? "td-hover" : string.Empty;
|
return tweet.GenerateHtml(IsCursorOverBrowser ? "td-hover" : string.Empty);
|
||||||
return tweet.GenerateHtml(bodyClasses);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void LoadTweet(TweetNotification tweet){
|
protected virtual void LoadTweet(TweetNotification tweet){
|
||||||
|
@@ -113,8 +113,8 @@ namespace TweetDuck.Core.Notification{
|
|||||||
if (nCode == 0){
|
if (nCode == 0){
|
||||||
int eventType = wParam.ToInt32();
|
int eventType = wParam.ToInt32();
|
||||||
|
|
||||||
if (eventType == NativeMethods.WM_MOUSEWHEEL && browser.Bounds.Contains(PointToClient(Cursor.Position))){
|
if (eventType == NativeMethods.WM_MOUSEWHEEL && IsCursorOverBrowser){
|
||||||
browser.SendMouseWheelEvent(0, 0, 0, BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed/100.0), CefEventFlags.None);
|
browser.SendMouseWheelEvent(0, 0, 0, BrowserUtils.Scale(NativeMethods.GetMouseHookData(lParam), Program.UserConfig.NotificationScrollSpeed*0.01), CefEventFlags.None);
|
||||||
return NativeMethods.HOOK_HANDLED;
|
return NativeMethods.HOOK_HANDLED;
|
||||||
}
|
}
|
||||||
else if (eventType == NativeMethods.WM_XBUTTONDOWN && DesktopBounds.Contains(Cursor.Position)){
|
else if (eventType == NativeMethods.WM_XBUTTONDOWN && DesktopBounds.Contains(Cursor.Position)){
|
||||||
|
@@ -14,7 +14,7 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
|
|
||||||
public enum Event{
|
public enum Event{
|
||||||
OpenOptions, OpenPlugins, OpenAbout, OpenGuide,
|
OpenOptions, OpenPlugins, OpenAbout, OpenGuide,
|
||||||
DesktopNotification, SoundNotification,
|
DesktopNotification, SoundNotification, MuteNotification,
|
||||||
BrowserContextMenu, BrowserExtraMouseButton,
|
BrowserContextMenu, BrowserExtraMouseButton,
|
||||||
NotificationContextMenu, NotificationExtraMouseButton, NotificationKeyboardShortcut,
|
NotificationContextMenu, NotificationExtraMouseButton, NotificationKeyboardShortcut,
|
||||||
TweetScreenshot, TweetDetail, VideoPlay, GCReload
|
TweetScreenshot, TweetDetail, VideoPlay, GCReload
|
||||||
@@ -35,6 +35,7 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
|
|
||||||
public int CountDesktopNotifications { get; private set; } = 0;
|
public int CountDesktopNotifications { get; private set; } = 0;
|
||||||
public int CountSoundNotifications { get; private set; } = 0;
|
public int CountSoundNotifications { get; private set; } = 0;
|
||||||
|
public int CountMuteNotifications { get; private set; } = 0;
|
||||||
|
|
||||||
public int CountBrowserContextMenus { get; private set; } = 0;
|
public int CountBrowserContextMenus { get; private set; } = 0;
|
||||||
public int CountBrowserExtraMouseButtons { get; private set; } = 0;
|
public int CountBrowserExtraMouseButtons { get; private set; } = 0;
|
||||||
@@ -64,6 +65,7 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
|
|
||||||
case Event.DesktopNotification: ++CountDesktopNotifications; break;
|
case Event.DesktopNotification: ++CountDesktopNotifications; break;
|
||||||
case Event.SoundNotification: ++CountSoundNotifications; break;
|
case Event.SoundNotification: ++CountSoundNotifications; break;
|
||||||
|
case Event.MuteNotification: ++CountMuteNotifications; break;
|
||||||
|
|
||||||
case Event.BrowserContextMenu: ++CountBrowserContextMenus; break;
|
case Event.BrowserContextMenu: ++CountBrowserContextMenus; break;
|
||||||
case Event.BrowserExtraMouseButton: ++CountBrowserExtraMouseButtons; break;
|
case Event.BrowserExtraMouseButton: ++CountBrowserExtraMouseButtons; break;
|
||||||
|
@@ -8,6 +8,7 @@ using TweetDuck.Configuration;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using TweetDuck.Core.Handling;
|
||||||
using TweetDuck.Core.Notification;
|
using TweetDuck.Core.Notification;
|
||||||
using TweetDuck.Core.Utils;
|
using TweetDuck.Core.Utils;
|
||||||
using TweetDuck.Plugins;
|
using TweetDuck.Plugins;
|
||||||
@@ -18,8 +19,9 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
Dictionary<string, string> editLayoutDesign = EditLayoutDesignPluginData;
|
Dictionary<string, string> editLayoutDesign = EditLayoutDesignPluginData;
|
||||||
|
|
||||||
return new AnalyticsReport{
|
return new AnalyticsReport{
|
||||||
{ "App Version" , Program.VersionTag },
|
{ "App Version" , Program.VersionTag },
|
||||||
{ "App Type" , Program.IsPortable ? "portable" : "installed" },
|
{ "App Type" , Program.IsPortable ? "portable" : "installed" },
|
||||||
|
{ "App Dev Tools" , Bool(ContextMenuBase.HasDevTools) },
|
||||||
0,
|
0,
|
||||||
{ "System Name" , SystemName },
|
{ "System Name" , SystemName },
|
||||||
{ "System Edition" , SystemEdition },
|
{ "System Edition" , SystemEdition },
|
||||||
@@ -51,17 +53,18 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
{ "Tray" , TrayMode },
|
{ "Tray" , TrayMode },
|
||||||
{ "Tray Highlight" , Bool(UserConfig.EnableTrayHighlight) },
|
{ "Tray Highlight" , Bool(UserConfig.EnableTrayHighlight) },
|
||||||
0,
|
0,
|
||||||
{ "Notification Position" , NotificationPosition },
|
{ "Notification Position" , NotificationPosition },
|
||||||
{ "Notification Size" , NotificationSize },
|
{ "Notification Size" , NotificationSize },
|
||||||
{ "Notification Timer" , NotificationTimer },
|
{ "Notification Timer" , NotificationTimer },
|
||||||
{ "Notification Timer Speed" , RoundUp(UserConfig.NotificationDurationValue, 5) },
|
{ "Notification Timer Speed" , RoundUp(UserConfig.NotificationDurationValue, 5) },
|
||||||
{ "Notification Scroll Speed" , Exact(UserConfig.NotificationScrollSpeed) },
|
{ "Notification Scroll Speed" , Exact(UserConfig.NotificationScrollSpeed) },
|
||||||
{ "Notification Column Title" , Bool(UserConfig.DisplayNotificationColumn) },
|
{ "Notification Column Title" , Bool(UserConfig.DisplayNotificationColumn) },
|
||||||
{ "Notification Media Previews" , Bool(UserConfig.NotificationMediaPreviews) },
|
{ "Notification Media Previews" , Bool(UserConfig.NotificationMediaPreviews) },
|
||||||
{ "Notification Link Skip" , Bool(UserConfig.NotificationSkipOnLinkClick) },
|
{ "Notification Link Skip" , Bool(UserConfig.NotificationSkipOnLinkClick) },
|
||||||
{ "Notification Non-Intrusive" , Bool(UserConfig.NotificationNonIntrusiveMode) },
|
{ "Notification Non-Intrusive" , Bool(UserConfig.NotificationNonIntrusiveMode) },
|
||||||
{ "Notification Idle Pause" , Exact(UserConfig.NotificationIdlePauseSeconds) },
|
{ "Notification Idle Pause" , Exact(UserConfig.NotificationIdlePauseSeconds) },
|
||||||
{ "Custom Sound Notification" , string.IsNullOrEmpty(UserConfig.NotificationSoundPath) ? "off" : Path.GetExtension(UserConfig.NotificationSoundPath) },
|
{ "Custom Sound Notification" , string.IsNullOrEmpty(UserConfig.NotificationSoundPath) ? "off" : Path.GetExtension(UserConfig.NotificationSoundPath) },
|
||||||
|
{ "Custom Sound Notification Volume" , RoundUp(UserConfig.NotificationSoundVolume, 5) },
|
||||||
0,
|
0,
|
||||||
{ "Program Arguments" , List(ProgramArguments) },
|
{ "Program Arguments" , List(ProgramArguments) },
|
||||||
{ "Custom CEF Arguments" , RoundUp((UserConfig.CustomCefArgs ?? string.Empty).Length, 10) },
|
{ "Custom CEF Arguments" , RoundUp((UserConfig.CustomCefArgs ?? string.Empty).Length, 10) },
|
||||||
@@ -91,6 +94,7 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
{ "Opened Guide" , LogRound(file.CountOpenGuide, 4) },
|
{ "Opened Guide" , LogRound(file.CountOpenGuide, 4) },
|
||||||
{ "Desktop Notifications" , LogRound(file.CountDesktopNotifications, 5) },
|
{ "Desktop Notifications" , LogRound(file.CountDesktopNotifications, 5) },
|
||||||
{ "Sound Notifications" , LogRound(file.CountSoundNotifications, 5) },
|
{ "Sound Notifications" , LogRound(file.CountSoundNotifications, 5) },
|
||||||
|
{ "Mute Notifications" , LogRound(file.CountMuteNotifications, 2) },
|
||||||
{ "Browser Context Menus" , LogRound(file.CountBrowserContextMenus, 2) },
|
{ "Browser Context Menus" , LogRound(file.CountBrowserContextMenus, 2) },
|
||||||
{ "Browser Extra Mouse Buttons" , LogRound(file.CountBrowserExtraMouseButtons, 2) },
|
{ "Browser Extra Mouse Buttons" , LogRound(file.CountBrowserExtraMouseButtons, 2) },
|
||||||
{ "Notification Context Menus" , LogRound(file.CountNotificationContextMenus, 2) },
|
{ "Notification Context Menus" , LogRound(file.CountNotificationContextMenus, 2) },
|
||||||
@@ -127,11 +131,16 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
using(RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false)){
|
using(RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion", false)){
|
||||||
// ReSharper disable once PossibleNullReferenceException
|
// ReSharper disable once PossibleNullReferenceException
|
||||||
osName = key.GetValue("ProductName") as string;
|
osName = key.GetValue("ProductName") as string;
|
||||||
osEdition = key.GetValue("EditionID") as string;
|
|
||||||
osBuild = key.GetValue("CurrentBuild") as string;
|
osBuild = key.GetValue("CurrentBuild") as string;
|
||||||
|
osEdition = null;
|
||||||
|
|
||||||
if (osName != null && osEdition != null){
|
if (osName != null){
|
||||||
osName = osName.Replace(osEdition, "").TrimEnd();
|
Match match = Regex.Match(osName, @"^(.*?\d+(?:\.\d+)?) (.*)$");
|
||||||
|
|
||||||
|
if (match.Success){
|
||||||
|
osName = match.Groups[1].Value;
|
||||||
|
osEdition = match.Groups[2].Value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch{
|
}catch{
|
||||||
@@ -257,7 +266,7 @@ namespace TweetDuck.Core.Other.Analytics{
|
|||||||
Match matchAdvanced = Regex.Match(data, "useAdvancedSelector:(.*?)(?:,|$)", RegexOptions.Multiline);
|
Match matchAdvanced = Regex.Match(data, "useAdvancedSelector:(.*?)(?:,|$)", RegexOptions.Multiline);
|
||||||
|
|
||||||
if (!matchType.Success){
|
if (!matchType.Success){
|
||||||
return "(unknown)";
|
return data.Contains("defaultAccount:\"\"") ? "(legacy)" : "(unknown)";
|
||||||
}
|
}
|
||||||
|
|
||||||
string accType = matchType.Groups[1].Value == "#" ? matchType.Groups[2].Value : "account";
|
string accType = matchType.Groups[1].Value == "#" ? matchType.Groups[2].Value : "account";
|
||||||
|
@@ -33,7 +33,7 @@ namespace TweetDuck.Core.Other{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ShowGuide(){
|
private void ShowGuide(){
|
||||||
new FormGuide().Show();
|
FormGuide.Show();
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,28 +8,63 @@ using TweetDuck.Core.Handling;
|
|||||||
using TweetDuck.Core.Handling.General;
|
using TweetDuck.Core.Handling.General;
|
||||||
using TweetDuck.Core.Other.Analytics;
|
using TweetDuck.Core.Other.Analytics;
|
||||||
using TweetDuck.Core.Utils;
|
using TweetDuck.Core.Utils;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace TweetDuck.Core.Other{
|
namespace TweetDuck.Core.Other{
|
||||||
sealed partial class FormGuide : Form{
|
sealed partial class FormGuide : Form{
|
||||||
private const string GuideUrl = "https://tweetduck.chylex.com/guide/v2/";
|
private const string GuideUrl = "https://tweetduck.chylex.com/guide/v2/";
|
||||||
|
private const string GuidePathRegex = @"^guide(?:/v\d+)?(?:/(#.*))?";
|
||||||
|
|
||||||
|
public static bool CheckGuideUrl(string url, out string hash){
|
||||||
|
if (!url.Contains("//tweetduck.chylex.com/guide")){
|
||||||
|
hash = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
string path = url.Substring(url.IndexOf("/guide")+1);
|
||||||
|
Match match = Regex.Match(path, GuidePathRegex);
|
||||||
|
|
||||||
|
if (match.Success){
|
||||||
|
hash = match.Groups[1].Value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
hash = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Show(string hash = null){
|
||||||
|
string url = GuideUrl+(hash ?? string.Empty);
|
||||||
|
FormGuide guide = FormManager.TryFind<FormGuide>();
|
||||||
|
|
||||||
|
if (guide == null){
|
||||||
|
FormBrowser owner = FormManager.TryFind<FormBrowser>();
|
||||||
|
|
||||||
|
if (owner != null){
|
||||||
|
owner.TriggerAnalyticsEvent(AnalyticsFile.Event.OpenGuide);
|
||||||
|
new FormGuide(url, owner).Show(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
guide.Reload(url);
|
||||||
|
guide.Activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private readonly ChromiumWebBrowser browser;
|
private readonly ChromiumWebBrowser browser;
|
||||||
|
|
||||||
public FormGuide(){
|
private FormGuide(string url, Form owner){
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
Text = Program.BrandName+" Guide";
|
Text = Program.BrandName+" Guide";
|
||||||
|
|
||||||
FormBrowser owner = FormManager.TryFind<FormBrowser>();
|
|
||||||
|
|
||||||
if (owner != null){
|
if (owner != null){
|
||||||
Size = new Size(owner.Size.Width*3/4, owner.Size.Height*3/4);
|
Size = new Size(owner.Size.Width*3/4, owner.Size.Height*3/4);
|
||||||
VisibleChanged += (sender, args) => this.MoveToCenter(owner);
|
VisibleChanged += (sender, args) => this.MoveToCenter(owner);
|
||||||
|
|
||||||
owner.TriggerAnalyticsEvent(AnalyticsFile.Event.OpenGuide);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.browser = new ChromiumWebBrowser(GuideUrl){
|
this.browser = new ChromiumWebBrowser(url){
|
||||||
MenuHandler = new ContextMenuGuide(),
|
MenuHandler = new ContextMenuGuide(),
|
||||||
JsDialogHandler = new JavaScriptDialogHandler(),
|
JsDialogHandler = new JavaScriptDialogHandler(),
|
||||||
LifeSpanHandler = new LifeSpanHandler(),
|
LifeSpanHandler = new LifeSpanHandler(),
|
||||||
@@ -52,8 +87,16 @@ namespace TweetDuck.Core.Other{
|
|||||||
Program.UserConfig.ZoomLevelChanged += Config_ZoomLevelChanged;
|
Program.UserConfig.ZoomLevelChanged += Config_ZoomLevelChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Reload(string url){
|
||||||
|
browser.LoadingStateChanged += browser_LoadingStateChanged;
|
||||||
|
browser.Dock = DockStyle.None;
|
||||||
|
browser.Location = ControlExtensions.InvisibleLocation;
|
||||||
|
browser.Load("about:blank");
|
||||||
|
browser.Load(url);
|
||||||
|
}
|
||||||
|
|
||||||
private void browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e){
|
private void browser_LoadingStateChanged(object sender, LoadingStateChangedEventArgs e){
|
||||||
if (!e.IsLoading){
|
if (!e.IsLoading && browser.Address != "about:blank"){
|
||||||
this.InvokeAsyncSafe(() => {
|
this.InvokeAsyncSafe(() => {
|
||||||
browser.Location = Point.Empty;
|
browser.Location = Point.Empty;
|
||||||
browser.Dock = DockStyle.Fill;
|
browser.Dock = DockStyle.Fill;
|
||||||
|
@@ -70,7 +70,13 @@ namespace TweetDuck.Core.Utils{
|
|||||||
|
|
||||||
switch(CheckUrl(url)){
|
switch(CheckUrl(url)){
|
||||||
case UrlCheckResult.Fine:
|
case UrlCheckResult.Fine:
|
||||||
WindowsUtils.OpenAssociatedProgram(url);
|
if (FormGuide.CheckGuideUrl(url, out string hash)){
|
||||||
|
FormGuide.Show(hash);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
WindowsUtils.OpenAssociatedProgram(url);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UrlCheckResult.Tracking:
|
case UrlCheckResult.Tracking:
|
||||||
|
@@ -71,7 +71,17 @@ var init = function(){
|
|||||||
|
|
||||||
if (element && element.tagName === "SUMMARY"){
|
if (element && element.tagName === "SUMMARY"){
|
||||||
element.click();
|
element.click();
|
||||||
|
element.blur();
|
||||||
element.scrollIntoView(true);
|
element.scrollIntoView(true);
|
||||||
|
|
||||||
|
if (window.innerWidth === 0){
|
||||||
|
var ffs = function(){
|
||||||
|
element.scrollIntoView(true);
|
||||||
|
window.removeEventListener("resize", ffs);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener("resize", ffs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -8,7 +8,7 @@ Edit layout & design
|
|||||||
chylex
|
chylex
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
1.1.7
|
1.1.8
|
||||||
|
|
||||||
[website]
|
[website]
|
||||||
https://tweetduck.chylex.com
|
https://tweetduck.chylex.com
|
||||||
|
@@ -400,7 +400,7 @@ enabled(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.config.smallComposeTextSize){
|
if (this.config.smallComposeTextSize){
|
||||||
this.css.insert(".compose-text { font-size: 12px !important; height: 120px !important }");
|
this.css.insert("#tduck .compose-text { font-size: 12px !important; height: 120px !important }");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.config.revertIcons){
|
if (this.config.revertIcons){
|
||||||
|
@@ -283,6 +283,7 @@
|
|||||||
tags.push("a[data-full-url] { word-break: break-all !important }"); // break long urls
|
tags.push("a[data-full-url] { word-break: break-all !important }"); // break long urls
|
||||||
tags.push(".media-item, .media-preview { border-radius: 1px !important }"); // square-ify media
|
tags.push(".media-item, .media-preview { border-radius: 1px !important }"); // square-ify media
|
||||||
tags.push(".quoted-tweet { border-radius: 0 !important }"); // square-ify quoted tweets
|
tags.push(".quoted-tweet { border-radius: 0 !important }"); // square-ify quoted tweets
|
||||||
|
tags.push(".tweet-context .nbfc { text-overflow: ellipsis !important; white-space: nowrap !important }"); // force ellipsis on long usernames
|
||||||
tags.push(".activity-header { align-items: center !important; margin-bottom: 4px !important }"); // tweak alignment of avatar and text in notifications
|
tags.push(".activity-header { align-items: center !important; margin-bottom: 4px !important }"); // tweak alignment of avatar and text in notifications
|
||||||
tags.push(".activity-header .tweet-timestamp { line-height: unset !important }"); // fix timestamp position in notifications
|
tags.push(".activity-header .tweet-timestamp { line-height: unset !important }"); // fix timestamp position in notifications
|
||||||
|
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#td-introduction-modal .mdl {
|
#td-introduction-modal .mdl {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
max-width: 800px;
|
max-width: 830px;
|
||||||
height: 372px;
|
height: 328px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#td-introduction-modal .mdl-header-title {
|
#td-introduction-modal .mdl-header-title {
|
||||||
@@ -31,6 +31,19 @@
|
|||||||
text-shadow: 0 0 #000;
|
text-shadow: 0 0 #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#td-introduction-modal .main-menu {
|
||||||
|
float: left;
|
||||||
|
width: 187px;
|
||||||
|
height: 124px;
|
||||||
|
margin-right: 12px;
|
||||||
|
box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.33);
|
||||||
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALsAAAB8CAMAAAAGozFUAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACZUExURQAAAAAANgAAYQA2YQA2iABhYQBhrDYAADYANjYAYTY2ADY2NjY2YTY2iDZhrDaIiDaIz2EAAGEANmEAYWE2NmE2iGFhNmFhYWGs8og2AIg2Nog2YYiIYYisiIjPrIjPz4jP8qxhAKxhNqzPiKzyrKzy8szMzM+INs/PiM/yrM/yz8/y8tfX1/Dw8PKsYfLPiPLyrPLyz/Ly8nG9GIQAAARDSURBVHja7ZyPd9IwEMdDxbI5cemcWJjbWrWrDi2Q//+PM7m7pOGHfcORlD6v7w1ok2wfwqXkvrs78TTcQzypoR6DZ//dcTA7szM7s8dgX2dCiJxGrG+Kvd+C1w619M+uoZqkGiy7AxvivI+XajURSWVO9AtjQ6UQqTIn18R+PxFSP82SCnuUOYxdfdjMzSmNn9mPMJa9p/QWpH5cZ5rjgqbanNQjOMnGS315nWl+7NGkqrmSqpb6hRuvm+PO++qygtkWKZ2YOW2EGBWr6dK3mTKHmcYeuu3r/fR5UawmUrXjY9tMLRFItez6abPYYd/MffbN4uHT89033UPVInfje1ir+Glbm7msGjKR1mbg/UFv7KFqYzGfwUhq6cbHZle1Jp3QZ65fjMwcize3hbEcu1ZnZkVCb+wBq8L86D4JGl1sm+E9AbMzO7MzO7MzO7Mze586QQqdcav7ggO3juMfF8Whlsj+6hXuzx17x0aWmswO/nBLbPaZ8RqatzdHsO/36In94WOltAOnXSZwoR7A+Qa3H5q/CEH+aA5+OfaQ6ASCYGAuZq3nAi4KjML2oH6T9qxX05+W3T5pt5+WQ5NUpA1s99jMpZt05zpiPxzVpOF1gukSFACPDN3+1p0l/3qbHf1rVBQO9gMFISz7ZnE/Xe6wX3oqXzc7KgoH+4GCEFoXA8VL20CuGprCTG6xkzZwyGZIUTjUDxSEwOybu4regzC3mxLXqm8zVhsoYUXai2aF5qQolL7KQB1QQeDvVWZndmZndmZn9nNn/3WuB9sMszM7szM7sw+WXXvEQgYTRYOyNxA9IEMJiyHZjSijWi1pUOxIDcqWiao6uSgalN0E70BYT7YncJ1CFI0074Uvg55KFI1i715U1SlF0bD3maRSGH4nfbn0VKJo+Pt77qKqTi2KRvlePZObI7PzXozZmZ3ZmZ3Zmf1/YjdO3qjY3xH0rBW8PN9jvDyv3cyR+R7DZvdCNq7pQk8iwfE243l7NUTR9CYSHLNWk8qPRsKcJu9CdJHgmHlXqos9vkhwPLsNuWptpi+R4Hh2G3KF+Vgte3yR4FXfq620Orw9QTleDpLd3M6Tvqed95HMzuzMzuzMzuw9sJep6v7XQSnEXsyBd0AZmN3WVzrAL2Rfvb8t/vK3OgukKM/ddelpkdlraVyLV7LvbZujsLuyG1CkxcURtGlalsQVbaHELfP43YYfeP9WRmGBfPWw7Bpc47dFWnaTsBy7K9ri6r3Q4w47BrSsbx7neeh5NwZTp7ZIy34ik2P3iraYxK22aguyb+c46RfvZGibgZsElfzRc9fB7oq2uJysHXvfZs+u0tDspl4RhqBgOAHGEXhpWu3Ks0VbqF6Lq9piC7vQIGszRSkDs+MfqFMbTkBJWF6almO3RVsocQsfS0yihOxXGgQpW2D4/+728p6A2Zmd2Zmd2c+SfaCHZh/u8QdspaeBZ15I7gAAAABJRU5ErkJggg==);
|
||||||
|
}
|
||||||
|
|
||||||
|
#td-introduction-modal .main-menu + p {
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
#td-introduction-modal footer {
|
#td-introduction-modal footer {
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
}
|
}
|
||||||
@@ -65,10 +78,10 @@
|
|||||||
<div class="mdl-inner">
|
<div class="mdl-inner">
|
||||||
<div class="mdl-content">
|
<div class="mdl-content">
|
||||||
<p>Thank you for downloading TweetDuck!</p>
|
<p>Thank you for downloading TweetDuck!</p>
|
||||||
<p><strong>Right-click anywhere</strong> or click <strong>Settings – TweetDuck</strong> in the left panel to open the main menu, where you can access the <strong>Options</strong>, <strong>Plugins</strong>, and more.</p>
|
<p><a id="td-introduction-follow" href="#">Follow @TryTweetDuck</a> for latest news and updates about the app.</p>
|
||||||
<p>You can also right-click links, media, tweets, notifications, etc. to access their context menu.</p>
|
<div class="main-menu"></div>
|
||||||
<p>If you're using TweetDuck for the first time, check out the <strong>guide</strong> that answers common questions and showcases important features. You can open the main menu, select <strong>About TweetDuck</strong>, and click the help button to view the guide later.</p>
|
<p><strong>Right-click anywhere</strong> or click <strong>Settings – TweetDuck</strong> in the left panel to open the main menu. You can also right-click links, tweets, images and videos, and desktop notifications to access their respective context menus.</p>
|
||||||
<p>Before you continue, please consider helping development by allowing TweetDuck to send anonymous data in the future. You can always disable it in <strong>Options – Feedback</strong>.</p>
|
<p>Click <strong>Show Guide</strong> to see awesome features TweetDuck offers, or view the guide later by going to <strong>About TweetDuck</strong> and clicking the help button on top.</p>
|
||||||
</div>
|
</div>
|
||||||
<footer class="txt-right">
|
<footer class="txt-right">
|
||||||
<div class="anondata">
|
<div class="anondata">
|
||||||
@@ -83,6 +96,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>`).appendTo(".js-app");
|
</div>`).appendTo(".js-app");
|
||||||
|
|
||||||
|
let tdUser = null;
|
||||||
|
let loadTweetDuckUser = (onSuccess, onError) => {
|
||||||
|
if (tdUser !== null){
|
||||||
|
onSuccess(tdUser);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
TD.controller.clients.getPreferredClient().getUsersByIds([ "731137856052269056" ], users => onSuccess(users[0]), onError);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
loadTweetDuckUser(user => tdUser = user);
|
||||||
|
|
||||||
|
ele.find("#td-introduction-follow").click(function(){
|
||||||
|
loadTweetDuckUser(user => {
|
||||||
|
$(document).trigger("uiShowFollowFromOptions", { userToFollow: user });
|
||||||
|
|
||||||
|
$(".js-modals-container").find("header a[rel='user']").each(function(){
|
||||||
|
this.outerHTML = this.innerText;
|
||||||
|
});
|
||||||
|
}, () => {
|
||||||
|
alert("An error occurred when retrieving the account information.");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
ele.find("button, a.mdl-dismiss").click(function(){
|
ele.find("button, a.mdl-dismiss").click(function(){
|
||||||
let showGuide = $(this)[0].hasAttribute("data-guide");
|
let showGuide = $(this)[0].hasAttribute("data-guide");
|
||||||
let allowDataCollection = $("#td-anonymous-data").is(":checked");
|
let allowDataCollection = $("#td-anonymous-data").is(":checked");
|
||||||
|
@@ -94,6 +94,11 @@
|
|||||||
/* Tweak notification layout and design */
|
/* Tweak notification layout and design */
|
||||||
/****************************************/
|
/****************************************/
|
||||||
|
|
||||||
|
.tweet-context .nbfc {
|
||||||
|
text-overflow: ellipsis !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
}
|
||||||
|
|
||||||
.activity-header {
|
.activity-header {
|
||||||
align-items: center !important;
|
align-items: center !important;
|
||||||
margin-bottom: 4px !important;
|
margin-bottom: 4px !important;
|
||||||
@@ -163,6 +168,11 @@ a[data-full-url] {
|
|||||||
vertical-align: 10% !important;
|
vertical-align: 10% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.account-inline .position-rel + .username {
|
||||||
|
/* except for follow notifications because consistency eh */
|
||||||
|
vertical-align: -10% !important;
|
||||||
|
}
|
||||||
|
|
||||||
html[data-td-font='smallest'] .sprite-verified-mini {
|
html[data-td-font='smallest'] .sprite-verified-mini {
|
||||||
/* fix cut off badge when zoomed in */
|
/* fix cut off badge when zoomed in */
|
||||||
width: 13px !important;
|
width: 13px !important;
|
||||||
@@ -177,6 +187,13 @@ html[data-td-font='smallest'] .badge-verified:before {
|
|||||||
background-position: -223px -98px !important;
|
background-position: -223px -98px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html[data-td-font='smallest'] .tweet-detail-wrapper .badge-verified:before {
|
||||||
|
/* fix cut off badge in detail view */
|
||||||
|
width: 13px !important;
|
||||||
|
height: 14px !important;
|
||||||
|
background-position: -223px -97px !important;
|
||||||
|
}
|
||||||
|
|
||||||
.accs-header {
|
.accs-header {
|
||||||
/* fix retweet account selector heading */
|
/* fix retweet account selector heading */
|
||||||
padding-left: 0 !important;
|
padding-left: 0 !important;
|
||||||
@@ -192,11 +209,6 @@ html[data-td-font='smallest'] .badge-verified:before {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.is-inverted-dark .inline-reply .btn:hover {
|
|
||||||
/* Reply buttons in modals are bork */
|
|
||||||
background-color: transparent !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* Fix glaring visual issues that twitter hasn't fixed yet smh */
|
/* Fix glaring visual issues that twitter hasn't fixed yet smh */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
|
/***********/
|
||||||
/* General */
|
/* General */
|
||||||
|
/***********/
|
||||||
|
|
||||||
body:before {
|
body:before {
|
||||||
content: none !important;
|
content: none !important;
|
||||||
@@ -20,7 +22,21 @@ body {
|
|||||||
border-left: 0 !important;
|
border-left: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************/
|
||||||
|
/* Usernames */
|
||||||
|
/*************/
|
||||||
|
|
||||||
|
.account-inline .username {
|
||||||
|
vertical-align: 10% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.account-inline .position-rel + .username {
|
||||||
|
vertical-align: -10% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*********/
|
||||||
/* Media */
|
/* Media */
|
||||||
|
/*********/
|
||||||
|
|
||||||
.media-size-medium {
|
.media-size-medium {
|
||||||
max-height: 240px;
|
max-height: 240px;
|
||||||
@@ -32,11 +48,13 @@ body {
|
|||||||
height: calc(100vh - 28px) !important;
|
height: calc(100vh - 28px) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.js-media.margin-vm, .js-media-preview-container.margin-vm {
|
#tduck .js-media, #tduck .js-media-preview-container {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***************/
|
||||||
/* Skip button */
|
/* Skip button */
|
||||||
|
/***************/
|
||||||
|
|
||||||
#td-skip {
|
#td-skip {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
Reference in New Issue
Block a user