1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-09-14 19:32:10 +02:00

Compare commits

..

24 Commits
1.11 ... 1.11.2

Author SHA1 Message Date
98799734c5 Add a box shadow to main menu in the guide 2017-11-21 06:59:54 +01:00
96f491a666 Redo the introduction dialog (add main menu image & follow link, rewrite text) 2017-11-21 06:11:49 +01:00
29e541dbef Fix comment formatting in notification.css 2017-11-20 18:01:17 +01:00
1343b9c113 Fix username alignment (follow notifications & all types in desktop notifications) 2017-11-20 18:01:02 +01:00
94920fd459 Ensure only one guide window is open and fix webkit element outline 2017-11-20 17:44:28 +01:00
b2f3b245b7 Open TweetDuck guide links directly in the app 2017-11-20 17:25:25 +01:00
15bc6c1d73 Fix idiot chromium being unable to figure out window size while loading guide 2017-11-20 17:21:46 +01:00
2c175b8d3a Fix incorrect default config value for notification scroll speed 2017-11-18 15:31:36 +01:00
a48c17a769 Update analytics (fix system edition, add dev tools and other feature collection) 2017-11-18 07:15:18 +01:00
03465c4ab0 Remove dismissed update config entry after accepting an update 2017-11-18 02:53:25 +01:00
b4e936c530 Minor refactoring of notification classes & remove no longer needed CSS 2017-11-14 19:06:05 +01:00
fb1482370a Fix issues from TweetDeck updates (long usernames, badge in detail view, notification media previews) 2017-11-14 18:42:34 +01:00
e831bc2bea Fix broken compose text size in edit-design plugin after a TweetDeck update 2017-11-11 17:32:20 +01:00
c74c168c96 Release 1.11.1 2017-11-10 14:59:48 +01:00
40b53fa40c Fix broken update notification CSS after a TweetDeck update 2017-11-10 14:52:32 +01:00
3481cc0349 Fix broken CSS in browser and plugins after a TweetDeck update 2017-11-10 14:44:47 +01:00
09abd889e9 Add ID to <html> for selector priority 2017-11-10 14:14:50 +01:00
330bbfbb31 Fix broken CSS in notifications after a TweetDeck update 2017-11-10 13:35:29 +01:00
6b7b690476 Remove Log method from the bridge object 2017-11-09 21:43:22 +01:00
cea72801a7 Fix video player process sometimes taking too long to close 2017-11-09 19:29:01 +01:00
04369e22a7 Add option to disable animated avatars (general GIF toggle)
Note: this breaks when disable-extensions is used, so it was changed to
disable-pdf-extension instead
2017-11-09 18:18:22 +01:00
f1b16eab9a Add a global function (including one for plugins) to reload columns 2017-11-09 18:15:58 +01:00
13646d9c90 Increase quality of media previews in desktop notifications 2017-11-09 17:08:39 +01:00
17d762ce91 Make spell check option not require a restart 2017-11-09 16:51:40 +01:00
32 changed files with 393 additions and 193 deletions

View File

@@ -45,6 +45,7 @@ namespace TweetDuck.Configuration{
public bool SwitchAccountSelectors { get; set; } = true; public bool SwitchAccountSelectors { get; set; } = true;
public bool OpenSearchInFirstColumn { get; set; } = true; public bool OpenSearchInFirstColumn { get; set; } = true;
public bool BestImageQuality { get; set; } = true; public bool BestImageQuality { get; set; } = true;
public bool EnableAnimatedImages { get; set; } = true;
public bool EnableSpellCheck { get; set; } = false; public bool EnableSpellCheck { get; set; } = false;
public int VideoPlayerVolume { get; set; } = 50; public int VideoPlayerVolume { get; set; } = 50;
private int _zoomLevel = 100; private int _zoomLevel = 100;
@@ -73,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;
@@ -172,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){

View File

@@ -148,13 +148,9 @@ namespace TweetDuck.Core.Bridge{
public void CrashDebug(string message){ public void CrashDebug(string message){
#if DEBUG #if DEBUG
Log(message); System.Diagnostics.Debug.WriteLine(message);
System.Diagnostics.Debugger.Break(); System.Diagnostics.Debugger.Break();
#endif #endif
} }
public void Log(string data){
System.Diagnostics.Debug.WriteLine(data);
}
} }
} }

View 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();
} }
@@ -260,6 +269,11 @@ namespace TweetDuck.Core{
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){
UpdateInstallerPath = update.InstallerPath; UpdateInstallerPath = update.InstallerPath;
@@ -350,6 +364,10 @@ namespace TweetDuck.Core{
browser.TriggerTweetScreenshot(); browser.TriggerTweetScreenshot();
} }
public void ReloadColumns(){
browser.ReloadColumns();
}
public void ApplyROT13(){ public void ApplyROT13(){
browser.ApplyROT13(); browser.ApplyROT13();
} }
@@ -373,7 +391,7 @@ namespace TweetDuck.Core{
} }
if (showGuide){ if (showGuide){
ShowChildForm(new FormGuide()); FormGuide.Show();
} }
} }

View File

@@ -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;

View File

@@ -1,14 +1,24 @@
using System; using System;
using System.Threading.Tasks;
using CefSharp; using CefSharp;
namespace TweetDuck.Core.Handling.General{ namespace TweetDuck.Core.Handling.General{
sealed class BrowserProcessHandler : IBrowserProcessHandler{ sealed class BrowserProcessHandler : IBrowserProcessHandler{
void IBrowserProcessHandler.OnContextInitialized(){ public static Task UpdatePrefs(){
return Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal);
}
private static void UpdatePrefsInternal(){
using(IRequestContext ctx = Cef.GetGlobalRequestContext()){ using(IRequestContext ctx = Cef.GetGlobalRequestContext()){
ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _); ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _);
ctx.SetPreference("settings.a11y.animation_policy", Program.UserConfig.EnableAnimatedImages ? "allowed" : "none", out string _);
} }
} }
void IBrowserProcessHandler.OnContextInitialized(){
UpdatePrefsInternal();
}
void IBrowserProcessHandler.OnScheduleMessagePumpWork(long delay){} void IBrowserProcessHandler.OnScheduleMessagePumpWork(long delay){}
void IDisposable.Dispose(){} void IDisposable.Dispose(){}
} }

View File

@@ -110,6 +110,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){

View File

@@ -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)){

View File

@@ -5,7 +5,7 @@ using TweetDuck.Resources;
namespace TweetDuck.Core.Notification{ namespace TweetDuck.Core.Notification{
sealed class TweetNotification{ sealed class TweetNotification{
private const string DefaultHeadLayout = @"<html class='os-windows txt-size--14' data-td-font='medium' data-td-theme='dark'><head><meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='chrome=1'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/font.5ef884f9f9.css'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/app-dark.5631e0dd42.css'><style type='text/css'>body{background:#222426}</style>"; private const string DefaultHeadLayout = @"<html id='tduck' class='os-windows txt-size--14' data-td-font='medium' data-td-theme='dark'><head><meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='chrome=1'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/font.5ef884f9f9.css'><link rel='stylesheet' href='https://ton.twimg.com/tweetdeck-web/web/css/app-dark.5631e0dd42.css'><style type='text/css'>body{background:#222426}</style>";
private static readonly string CustomCSS = ScriptLoader.LoadResource("styles/notification.css"); private static readonly string CustomCSS = ScriptLoader.LoadResource("styles/notification.css");
public static TweetNotification Example(string html, int characters){ public static TweetNotification Example(string html, int characters){
@@ -70,7 +70,7 @@ namespace TweetDuck.Core.Notification{
build.Append(' ').Append(bodyClasses); build.Append(' ').Append(bodyClasses);
} }
build.Append('\'').Append(isExample ? " td-example-notification" : "").Append("><div class='column' style='width:100%;height:auto;overflow:initial;'>"); build.Append('\'').Append(isExample ? " td-example-notification" : "").Append("><div class='column' style='width:100%!important;height:auto!important;overflow:initial!important;'>");
build.Append(html); build.Append(html);
build.Append("</div></body>"); build.Append("</div></body>");
build.Append("</html>"); build.Append("</html>");

View File

@@ -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;

View File

@@ -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;
@@ -20,6 +21,7 @@ namespace TweetDuck.Core.Other.Analytics{
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 },
@@ -62,6 +64,7 @@ namespace TweetDuck.Core.Other.Analytics{
{ "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";

View File

@@ -33,7 +33,7 @@ namespace TweetDuck.Core.Other{
} }
private void ShowGuide(){ private void ShowGuide(){
new FormGuide().Show(); FormGuide.Show();
Close(); Close();
} }
} }

View File

@@ -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;

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using TweetDuck.Core.Controls; using TweetDuck.Core.Controls;
using TweetDuck.Core.Handling.General;
using TweetDuck.Core.Notification.Example; using TweetDuck.Core.Notification.Example;
using TweetDuck.Core.Other.Analytics; using TweetDuck.Core.Other.Analytics;
using TweetDuck.Core.Other.Settings; using TweetDuck.Core.Other.Settings;
@@ -35,7 +36,7 @@ namespace TweetDuck.Core.Other{
this.buttonHeight = BrowserUtils.Scale(39, this.GetDPIScale()) | 1; this.buttonHeight = BrowserUtils.Scale(39, this.GetDPIScale()) | 1;
AddButton("General", () => new TabSettingsGeneral(updates)); AddButton("General", () => new TabSettingsGeneral(this.browser, updates));
AddButton("System Tray", () => new TabSettingsTray()); AddButton("System Tray", () => new TabSettingsTray());
AddButton("Notifications", () => new TabSettingsNotifications(new FormNotificationExample(this.browser, this.plugins))); AddButton("Notifications", () => new TabSettingsNotifications(new FormNotificationExample(this.browser, this.plugins)));
AddButton("Sounds", () => new TabSettingsSounds()); AddButton("Sounds", () => new TabSettingsSounds());
@@ -67,6 +68,7 @@ namespace TweetDuck.Core.Other{
if (dialog.ShowDialog() == DialogResult.OK){ if (dialog.ShowDialog() == DialogResult.OK){
browser.ResumeNotification(); browser.ResumeNotification();
BrowserProcessHandler.UpdatePrefs();
ShouldReloadBrowser = dialog.ShouldReloadBrowser; ShouldReloadBrowser = dialog.ShouldReloadBrowser;
Close(); Close();
} }

View File

@@ -40,6 +40,7 @@
this.panelUI = new System.Windows.Forms.Panel(); this.panelUI = new System.Windows.Forms.Panel();
this.panelUpdates = new System.Windows.Forms.Panel(); this.panelUpdates = new System.Windows.Forms.Panel();
this.labelUpdates = new System.Windows.Forms.Label(); this.labelUpdates = new System.Windows.Forms.Label();
this.checkAnimatedAvatars = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).BeginInit();
this.panelUI.SuspendLayout(); this.panelUI.SuspendLayout();
this.panelUpdates.SuspendLayout(); this.panelUpdates.SuspendLayout();
@@ -60,11 +61,11 @@
// checkSpellCheck // checkSpellCheck
// //
this.checkSpellCheck.AutoSize = true; this.checkSpellCheck.AutoSize = true;
this.checkSpellCheck.Location = new System.Drawing.Point(6, 97); this.checkSpellCheck.Location = new System.Drawing.Point(6, 120);
this.checkSpellCheck.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3); this.checkSpellCheck.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.checkSpellCheck.Name = "checkSpellCheck"; this.checkSpellCheck.Name = "checkSpellCheck";
this.checkSpellCheck.Size = new System.Drawing.Size(119, 17); this.checkSpellCheck.Size = new System.Drawing.Size(119, 17);
this.checkSpellCheck.TabIndex = 4; this.checkSpellCheck.TabIndex = 5;
this.checkSpellCheck.Text = "Enable Spell Check"; this.checkSpellCheck.Text = "Enable Spell Check";
this.toolTip.SetToolTip(this.checkSpellCheck, "Underlines words that are spelled incorrectly."); this.toolTip.SetToolTip(this.checkSpellCheck, "Underlines words that are spelled incorrectly.");
this.checkSpellCheck.UseVisualStyleBackColor = true; this.checkSpellCheck.UseVisualStyleBackColor = true;
@@ -95,11 +96,11 @@
// labelZoomValue // labelZoomValue
// //
this.labelZoomValue.BackColor = System.Drawing.Color.Transparent; this.labelZoomValue.BackColor = System.Drawing.Color.Transparent;
this.labelZoomValue.Location = new System.Drawing.Point(147, 146); this.labelZoomValue.Location = new System.Drawing.Point(147, 169);
this.labelZoomValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); this.labelZoomValue.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0);
this.labelZoomValue.Name = "labelZoomValue"; this.labelZoomValue.Name = "labelZoomValue";
this.labelZoomValue.Size = new System.Drawing.Size(38, 13); this.labelZoomValue.Size = new System.Drawing.Size(38, 13);
this.labelZoomValue.TabIndex = 7; this.labelZoomValue.TabIndex = 8;
this.labelZoomValue.Text = "100%"; this.labelZoomValue.Text = "100%";
this.labelZoomValue.TextAlign = System.Drawing.ContentAlignment.TopRight; this.labelZoomValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
this.toolTip.SetToolTip(this.labelZoomValue, "Changes the zoom level.\r\nAlso affects notifications and screenshots."); this.toolTip.SetToolTip(this.labelZoomValue, "Changes the zoom level.\r\nAlso affects notifications and screenshots.");
@@ -145,24 +146,24 @@
this.trackBarZoom.AutoSize = false; this.trackBarZoom.AutoSize = false;
this.trackBarZoom.BackColor = System.Drawing.SystemColors.Control; this.trackBarZoom.BackColor = System.Drawing.SystemColors.Control;
this.trackBarZoom.LargeChange = 25; this.trackBarZoom.LargeChange = 25;
this.trackBarZoom.Location = new System.Drawing.Point(3, 145); this.trackBarZoom.Location = new System.Drawing.Point(3, 168);
this.trackBarZoom.Maximum = 200; this.trackBarZoom.Maximum = 200;
this.trackBarZoom.Minimum = 50; this.trackBarZoom.Minimum = 50;
this.trackBarZoom.Name = "trackBarZoom"; this.trackBarZoom.Name = "trackBarZoom";
this.trackBarZoom.Size = new System.Drawing.Size(148, 30); this.trackBarZoom.Size = new System.Drawing.Size(148, 30);
this.trackBarZoom.SmallChange = 5; this.trackBarZoom.SmallChange = 5;
this.trackBarZoom.TabIndex = 6; this.trackBarZoom.TabIndex = 7;
this.trackBarZoom.TickFrequency = 25; this.trackBarZoom.TickFrequency = 25;
this.trackBarZoom.Value = 100; this.trackBarZoom.Value = 100;
// //
// labelZoom // labelZoom
// //
this.labelZoom.AutoSize = true; this.labelZoom.AutoSize = true;
this.labelZoom.Location = new System.Drawing.Point(3, 129); this.labelZoom.Location = new System.Drawing.Point(3, 152);
this.labelZoom.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0); this.labelZoom.Margin = new System.Windows.Forms.Padding(3, 12, 3, 0);
this.labelZoom.Name = "labelZoom"; this.labelZoom.Name = "labelZoom";
this.labelZoom.Size = new System.Drawing.Size(34, 13); this.labelZoom.Size = new System.Drawing.Size(34, 13);
this.labelZoom.TabIndex = 5; this.labelZoom.TabIndex = 6;
this.labelZoom.Text = "Zoom"; this.labelZoom.Text = "Zoom";
// //
// zoomUpdateTimer // zoomUpdateTimer
@@ -185,6 +186,7 @@
// //
this.panelUI.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.panelUI.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelUI.Controls.Add(this.checkAnimatedAvatars);
this.panelUI.Controls.Add(this.checkOpenSearchInFirstColumn); this.panelUI.Controls.Add(this.checkOpenSearchInFirstColumn);
this.panelUI.Controls.Add(this.checkBestImageQuality); this.panelUI.Controls.Add(this.checkBestImageQuality);
this.panelUI.Controls.Add(this.checkExpandLinks); this.panelUI.Controls.Add(this.checkExpandLinks);
@@ -195,7 +197,7 @@
this.panelUI.Controls.Add(this.labelZoomValue); this.panelUI.Controls.Add(this.labelZoomValue);
this.panelUI.Location = new System.Drawing.Point(9, 31); this.panelUI.Location = new System.Drawing.Point(9, 31);
this.panelUI.Name = "panelUI"; this.panelUI.Name = "panelUI";
this.panelUI.Size = new System.Drawing.Size(322, 179); this.panelUI.Size = new System.Drawing.Size(322, 205);
this.panelUI.TabIndex = 1; this.panelUI.TabIndex = 1;
// //
// panelUpdates // panelUpdates
@@ -204,7 +206,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelUpdates.Controls.Add(this.checkUpdateNotifications); this.panelUpdates.Controls.Add(this.checkUpdateNotifications);
this.panelUpdates.Controls.Add(this.btnCheckUpdates); this.panelUpdates.Controls.Add(this.btnCheckUpdates);
this.panelUpdates.Location = new System.Drawing.Point(9, 257); this.panelUpdates.Location = new System.Drawing.Point(8, 283);
this.panelUpdates.Name = "panelUpdates"; this.panelUpdates.Name = "panelUpdates";
this.panelUpdates.Size = new System.Drawing.Size(322, 55); this.panelUpdates.Size = new System.Drawing.Size(322, 55);
this.panelUpdates.TabIndex = 3; this.panelUpdates.TabIndex = 3;
@@ -213,13 +215,25 @@
// //
this.labelUpdates.AutoSize = true; this.labelUpdates.AutoSize = true;
this.labelUpdates.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.labelUpdates.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.labelUpdates.Location = new System.Drawing.Point(6, 234); this.labelUpdates.Location = new System.Drawing.Point(5, 260);
this.labelUpdates.Margin = new System.Windows.Forms.Padding(0, 21, 0, 0); this.labelUpdates.Margin = new System.Windows.Forms.Padding(0, 21, 0, 0);
this.labelUpdates.Name = "labelUpdates"; this.labelUpdates.Name = "labelUpdates";
this.labelUpdates.Size = new System.Drawing.Size(70, 20); this.labelUpdates.Size = new System.Drawing.Size(70, 20);
this.labelUpdates.TabIndex = 2; this.labelUpdates.TabIndex = 2;
this.labelUpdates.Text = "Updates"; this.labelUpdates.Text = "Updates";
// //
// checkAnimatedAvatars
//
this.checkAnimatedAvatars.AutoSize = true;
this.checkAnimatedAvatars.Location = new System.Drawing.Point(6, 97);
this.checkAnimatedAvatars.Margin = new System.Windows.Forms.Padding(6, 3, 3, 3);
this.checkAnimatedAvatars.Name = "checkAnimatedAvatars";
this.checkAnimatedAvatars.Size = new System.Drawing.Size(145, 17);
this.checkAnimatedAvatars.TabIndex = 4;
this.checkAnimatedAvatars.Text = "Enable Animated Avatars";
this.toolTip.SetToolTip(this.checkAnimatedAvatars, "Some old Twitter avatars could be uploaded as animated GIFs.");
this.checkAnimatedAvatars.UseVisualStyleBackColor = true;
//
// TabSettingsGeneral // TabSettingsGeneral
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -229,7 +243,7 @@
this.Controls.Add(this.panelUI); this.Controls.Add(this.panelUI);
this.Controls.Add(this.labelUI); this.Controls.Add(this.labelUI);
this.Name = "TabSettingsGeneral"; this.Name = "TabSettingsGeneral";
this.Size = new System.Drawing.Size(340, 322); this.Size = new System.Drawing.Size(340, 348);
((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).EndInit();
this.panelUI.ResumeLayout(false); this.panelUI.ResumeLayout(false);
this.panelUI.PerformLayout(); this.panelUI.PerformLayout();
@@ -258,5 +272,6 @@
private System.Windows.Forms.Label labelUpdates; private System.Windows.Forms.Label labelUpdates;
private System.Windows.Forms.CheckBox checkBestImageQuality; private System.Windows.Forms.CheckBox checkBestImageQuality;
private System.Windows.Forms.CheckBox checkOpenSearchInFirstColumn; private System.Windows.Forms.CheckBox checkOpenSearchInFirstColumn;
private System.Windows.Forms.CheckBox checkAnimatedAvatars;
} }
} }

View File

@@ -1,15 +1,19 @@
using System; using System;
using TweetDuck.Core.Controls; using TweetDuck.Core.Controls;
using TweetDuck.Core.Handling.General;
using TweetDuck.Updates; using TweetDuck.Updates;
namespace TweetDuck.Core.Other.Settings{ namespace TweetDuck.Core.Other.Settings{
sealed partial class TabSettingsGeneral : BaseTabSettings{ sealed partial class TabSettingsGeneral : BaseTabSettings{
private readonly FormBrowser browser;
private readonly UpdateHandler updates; private readonly UpdateHandler updates;
private int updateCheckEventId = -1; private int updateCheckEventId = -1;
public TabSettingsGeneral(UpdateHandler updates){ public TabSettingsGeneral(FormBrowser browser, UpdateHandler updates){
InitializeComponent(); InitializeComponent();
this.browser = browser;
this.updates = updates; this.updates = updates;
this.updates.CheckFinished += updates_CheckFinished; this.updates.CheckFinished += updates_CheckFinished;
Disposed += (sender, args) => this.updates.CheckFinished -= updates_CheckFinished; Disposed += (sender, args) => this.updates.CheckFinished -= updates_CheckFinished;
@@ -22,6 +26,7 @@ namespace TweetDuck.Core.Other.Settings{
checkSwitchAccountSelectors.Checked = Config.SwitchAccountSelectors; checkSwitchAccountSelectors.Checked = Config.SwitchAccountSelectors;
checkOpenSearchInFirstColumn.Checked = Config.OpenSearchInFirstColumn; checkOpenSearchInFirstColumn.Checked = Config.OpenSearchInFirstColumn;
checkBestImageQuality.Checked = Config.BestImageQuality; checkBestImageQuality.Checked = Config.BestImageQuality;
checkAnimatedAvatars.Checked = Config.EnableAnimatedImages;
checkSpellCheck.Checked = Config.EnableSpellCheck; checkSpellCheck.Checked = Config.EnableSpellCheck;
checkUpdateNotifications.Checked = Config.EnableUpdateCheck; checkUpdateNotifications.Checked = Config.EnableUpdateCheck;
@@ -32,6 +37,7 @@ namespace TweetDuck.Core.Other.Settings{
checkSwitchAccountSelectors.CheckedChanged += checkSwitchAccountSelectors_CheckedChanged; checkSwitchAccountSelectors.CheckedChanged += checkSwitchAccountSelectors_CheckedChanged;
checkOpenSearchInFirstColumn.CheckedChanged += checkOpenSearchInFirstColumn_CheckedChanged; checkOpenSearchInFirstColumn.CheckedChanged += checkOpenSearchInFirstColumn_CheckedChanged;
checkBestImageQuality.CheckedChanged += checkBestImageQuality_CheckedChanged; checkBestImageQuality.CheckedChanged += checkBestImageQuality_CheckedChanged;
checkAnimatedAvatars.CheckedChanged += checkAnimatedAvatars_CheckedChanged;
checkSpellCheck.CheckedChanged += checkSpellCheck_CheckedChanged; checkSpellCheck.CheckedChanged += checkSpellCheck_CheckedChanged;
trackBarZoom.ValueChanged += trackBarZoom_ValueChanged; trackBarZoom.ValueChanged += trackBarZoom_ValueChanged;
@@ -59,9 +65,14 @@ namespace TweetDuck.Core.Other.Settings{
Config.BestImageQuality = checkBestImageQuality.Checked; Config.BestImageQuality = checkBestImageQuality.Checked;
} }
private void checkAnimatedAvatars_CheckedChanged(object sender, EventArgs e){
Config.EnableAnimatedImages = checkAnimatedAvatars.Checked;
BrowserProcessHandler.UpdatePrefs().ContinueWith(task => browser.ReloadColumns());
}
private void checkSpellCheck_CheckedChanged(object sender, EventArgs e){ private void checkSpellCheck_CheckedChanged(object sender, EventArgs e){
Config.EnableSpellCheck = checkSpellCheck.Checked; Config.EnableSpellCheck = checkSpellCheck.Checked;
PromptRestart(); BrowserProcessHandler.UpdatePrefs();
} }
private void trackBarZoom_ValueChanged(object sender, EventArgs e){ private void trackBarZoom_ValueChanged(object sender, EventArgs e){

View File

@@ -231,6 +231,10 @@ namespace TweetDuck.Core{
browser.ExecuteScriptAsync("TDGF_triggerScreenshot()"); browser.ExecuteScriptAsync("TDGF_triggerScreenshot()");
} }
public void ReloadColumns(){
browser.ExecuteScriptAsync("TDGF_reloadColumns()");
}
public void ApplyROT13(){ public void ApplyROT13(){
browser.ExecuteScriptAsync("TDGF_applyROT13()"); browser.ExecuteScriptAsync("TDGF_applyROT13()");
} }

View File

@@ -31,7 +31,7 @@ namespace TweetDuck.Core.Utils{
args["disable-gpu-vsync"] = "1"; args["disable-gpu-vsync"] = "1";
} }
args["disable-extensions"] = "1"; args["disable-pdf-extension"] = "1";
args["disable-plugins-discovery"] = "1"; args["disable-plugins-discovery"] = "1";
args["enable-system-flash"] = "0"; args["enable-system-flash"] = "0";
@@ -70,7 +70,13 @@ namespace TweetDuck.Core.Utils{
switch(CheckUrl(url)){ switch(CheckUrl(url)){
case UrlCheckResult.Fine: case UrlCheckResult.Fine:
if (FormGuide.CheckGuideUrl(url, out string hash)){
FormGuide.Show(hash);
}
else{
WindowsUtils.OpenAssociatedProgram(url); WindowsUtils.OpenAssociatedProgram(url);
}
break; break;
case UrlCheckResult.Tracking: case UrlCheckResult.Tracking:

View File

@@ -20,7 +20,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.11"; public const string VersionTag = "1.11.1";
public static readonly bool IsPortable = File.Exists("makeportable"); public static readonly bool IsPortable = File.Exists("makeportable");

View File

@@ -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);
}
} }
} }
}; };

View File

@@ -8,7 +8,7 @@ Edit layout & design
chylex chylex
[version] [version]
1.1.6 1.1.8
[website] [website]
https://tweetduck.chylex.com https://tweetduck.chylex.com

View File

@@ -364,23 +364,23 @@ enabled(){
if (this.config.themeColorTweaks){ if (this.config.themeColorTweaks){
switch(TD.settings.getTheme()){ switch(TD.settings.getTheme()){
case "dark": case "dark":
this.css.insert(".app-content, .app-columns-container { background-color: #444448 }"); this.css.insert(".app-content, .app-columns-container { background-color: #444448 !important }");
this.css.insert(".column-drag-handle { opacity: 0.5 }"); this.css.insert(".column-drag-handle { opacity: 0.5 !important }");
this.css.insert(".column-drag-handle:hover { opacity: 1 }"); this.css.insert(".column-drag-handle:hover { opacity: 1 !important }");
this.css.insert(".scroll-styled-v:not(.scroll-alt)::-webkit-scrollbar-thumb, .scroll-styled-h:not(.scroll-alt)::-webkit-scrollbar-thumb { background-color: #666 }"); this.css.insert(".scroll-styled-v:not(.scroll-alt)::-webkit-scrollbar-thumb, .scroll-styled-h:not(.scroll-alt)::-webkit-scrollbar-thumb { background-color: #666 !important }");
notificationScrollbarColor = "666"; notificationScrollbarColor = "666";
break; break;
case "light": case "light":
this.css.insert(".scroll-styled-v:not(.scroll-alt)::-webkit-scrollbar-thumb, .scroll-styled-h:not(.scroll-alt)::-webkit-scrollbar-thumb { background-color: #d2d6da }"); this.css.insert(".scroll-styled-v:not(.scroll-alt)::-webkit-scrollbar-thumb, .scroll-styled-h:not(.scroll-alt)::-webkit-scrollbar-thumb { background-color: #d2d6da !important }");
this.css.insert(".app-columns-container.scroll-styled-h::-webkit-scrollbar-thumb:not(:hover) { background-color: #a5aeb5 }"); this.css.insert(".app-columns-container.scroll-styled-h::-webkit-scrollbar-thumb:not(:hover) { background-color: #a5aeb5 !important }");
notificationScrollbarColor = "a5aeb5"; notificationScrollbarColor = "a5aeb5";
break; break;
} }
} }
if (this.config.showCharacterCount){ if (this.config.showCharacterCount){
this.css.insert(".js-character-count.is-hidden { display: inline !important }"); this.css.insert("#tduck .js-character-count.is-hidden { display: inline !important }");
} }
if (this.config.hideTweetActions){ if (this.config.hideTweetActions){
@@ -391,8 +391,8 @@ enabled(){
} }
if (this.config.moveTweetActionsToRight){ if (this.config.moveTweetActionsToRight){
this.css.insert(".tweet-actions { float: right !important; width: auto !important }"); this.css.insert("#tduck .tweet-actions { float: right !important; width: auto !important }");
this.css.insert(".tweet-actions > li:nth-child(4) { margin-right: 2px !important }"); this.css.insert("#tduck .tweet-actions > li:nth-child(4) { margin-right: 2px !important }");
} }
if (this.config.increaseQuoteTextSize){ if (this.config.increaseQuoteTextSize){
@@ -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){
@@ -491,13 +491,13 @@ enabled(){
this.icons = document.createElement("style"); this.icons = document.createElement("style");
this.icons.innerHTML = ` this.icons.innerHTML = `
@font-face { @font-face {
font-family: 'oldfont'; font-family: '_of';
src: url("https://ton.twimg.com/tweetdeck-web/web/assets/fonts/tweetdeck-regular-webfont.5f4ea87976.woff") format("woff"); src: url("https://ton.twimg.com/tweetdeck-web/web/assets/fonts/tweetdeck-regular-webfont.5f4ea87976.woff") format("woff");
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
${iconData.map(entry => `${entry[0]}:before{content:\"\\f0${entry[1]}\";font-family:oldfont!important}`).join("")} ${iconData.map(entry => `#tduck ${entry[0]}:before{content:\"\\f0${entry[1]}\";font-family:_of!important}`).join("")}
.drawer .btn .icon, .app-header .btn .icon { line-height: 1em !important } .drawer .btn .icon, .app-header .btn .icon { line-height: 1em !important }
.column-header .column-type-icon { bottom: 26px !important } .column-header .column-type-icon { bottom: 26px !important }
@@ -552,17 +552,17 @@ ${this.config.increaseQuoteTextSize ? `
` : ``} ` : ``}
${this.config.revertIcons ? ` ${this.config.revertIcons ? `
@font-face { font-family: 'oldfont'; src: url(\"https://ton.twimg.com/tweetdeck-web/web/assets/fonts/tweetdeck-regular-webfont.5f4ea87976.woff\") format(\"woff\"); font-weight: normal; font-style: normal } @font-face { font-family: '_of'; src: url(\"https://ton.twimg.com/tweetdeck-web/web/assets/fonts/tweetdeck-regular-webfont.5f4ea87976.woff\") format(\"woff\"); font-weight: normal; font-style: normal }
.icon-reply:before{content:"\\f006";font-family:oldfont} #tduck .icon-reply:before{content:"\\f006";font-family:_of!important}
.icon-heart-filled:before{content:"\\f055";font-family:oldfont} #tduck .icon-heart-filled:before{content:"\\f055";font-family:_of!important}
.icon-retweet-filled:before{content:"\\f008";font-family:oldfont} #tduck .icon-retweet-filled:before{content:"\\f008";font-family:_of!important}
.icon-list-filled:before{content:"\\f014";font-family:oldfont} #tduck .icon-list-filled:before{content:"\\f014";font-family:_of!important}
.icon-user-filled:before{content:"\\f035";font-family:oldfont} #tduck .icon-user-filled:before{content:"\\f035";font-family:_of!important}
.icon-user-dd:before{content:"\\f01a";font-family:oldfont} #tduck .icon-user-dd:before{content:"\\f01a";font-family:_of!important}
` : ``} ` : ``}
${notificationScrollbarColor ? ` ${notificationScrollbarColor ? `
.scroll-styled-v::-webkit-scrollbar-thumb, .scroll-styled-h::-webkit-scrollbar-thumb { background-color: #${notificationScrollbarColor} } .scroll-styled-v::-webkit-scrollbar-thumb, .scroll-styled-h::-webkit-scrollbar-thumb { background-color: #${notificationScrollbarColor} !important }
` : ``} ` : ``}
</style>`); </style>`);
}; };

View File

@@ -1,4 +1,4 @@
<div class="td-modal-panel js-modal-panel mdl s-tall-fixed is-inverted-dark"> <div id="edit-design-panel" class="js-modal-panel mdl s-tall-fixed is-inverted-dark">
<header class="js-mdl-header mdl-header js-drag-handle"> <header class="js-mdl-header mdl-header js-drag-handle">
<h3 class="mdl-header-title js-header-title">TweetDuck - Layout &amp; Design</h3> <h3 class="mdl-header-title js-header-title">TweetDuck - Layout &amp; Design</h3>
<a href="#" class="mdl-dismiss js-dismiss link-normal-dark"> <a href="#" class="mdl-dismiss js-dismiss link-normal-dark">
@@ -6,8 +6,8 @@
</a> </a>
</header> </header>
<div class="mdl-inner"> <div class="mdl-inner">
<div class="td-modal-content mdl-content js-mdl-content horizontal-flow-container"> <div id="edit-design-panel-content" class="mdl-content js-mdl-content horizontal-flow-container">
<div class="td-modal-inner-cols"> <div id="edit-design-panel-inner-cols">
<div class="l-column mdl-column"> <div class="l-column mdl-column">
<!-- THEME --> <!-- THEME -->
@@ -159,60 +159,52 @@
/* Containers */ /* Containers */
.td-modal-panel { #edit-design-panel {
width: 693px; width: 693px;
height: 380px; height: 380px;
} }
.td-modal-inner-cols { #edit-design-panel-inner-cols {
padding: 0 6px; padding: 0 6px;
} }
.td-modal-inner-cols .l-column { #edit-design-panel-inner-cols .l-column {
padding: 15px 9px; padding: 15px 9px;
box-sizing: border-box; box-sizing: border-box;
width: 225px; width: 225px;
font-size: 0; /* fix custom font size breaking the modal layout */ font-size: 0; /* fix custom font size breaking the modal layout */
} }
.td-modal-inner-cols .l-column:nth-child(3) { #edit-design-panel-inner-cols .l-column:nth-child(3) {
width: 200px; width: 200px;
} }
.td-modal-inner-full {
padding: 15px;
}
.td-modal-inner-full .txt-center {
margin-bottom: 10px;
}
/* Elements */ /* Elements */
.td-modal-content label { #edit-design-panel-content label.txt-uppercase {
margin-top: 18px; margin-top: 18px;
} }
.td-modal-content label:first-child { #edit-design-panel-content label.txt-uppercase:first-child {
margin-top: 0; margin-top: 0;
} }
.td-modal-content label.radio { #edit-design-panel-content label.radio {
display: inline-block; display: inline-block;
margin: 0 16px 5px 4px; margin: 0 16px 5px 4px;
cursor: pointer; cursor: pointer;
} }
.td-modal-content label.checkbox { #edit-design-panel-content label.checkbox {
margin: 0 0 5px 4px; margin: 0 0 5px 4px;
cursor: pointer; cursor: pointer;
} }
.td-modal-content select + label.checkbox { #edit-design-panel-content select + label.checkbox {
margin-top: 9px; margin-top: 9px;
} }
.td-modal-content input.js-theme-checkbox, .td-modal-content input.js-theme-radio { #edit-design-panel-content input.js-theme-checkbox, #edit-design-panel-content input.js-theme-radio {
margin-top: 1px; margin-top: 1px;
} }

View File

@@ -8,7 +8,7 @@ Templates
chylex chylex
[version] [version]
1.0.2 1.0.3
[website] [website]
https://tweetduck.chylex.com https://tweetduck.chylex.com

View File

@@ -50,25 +50,25 @@ enabled(){
this.css = window.TDPF_createCustomStyle(this); this.css = window.TDPF_createCustomStyle(this);
this.css.insert(".manage-templates-btn.active { color: #fff; box-shadow: 0 0 2px 3px #50a5e6; outline: 0; }"); this.css.insert(".manage-templates-btn.active { color: #fff; box-shadow: 0 0 2px 3px #50a5e6; outline: 0; }");
this.css.insert(".templates-modal-wrap { width: 100%; height: 100%; padding: 49px; position: absolute; z-index: 999; box-sizing: border-box; background-color: rgba(0, 0, 0, 0.5); }"); this.css.insert("#templates-modal-wrap { width: 100%; height: 100%; padding: 49px; position: absolute; z-index: 999; box-sizing: border-box; background-color: rgba(0, 0, 0, 0.5); }");
this.css.insert(".templates-modal { width: 100%; height: 100%; background-color: #fff; display: flex; }"); this.css.insert("#templates-modal { width: 100%; height: 100%; background-color: #fff; display: flex; }");
this.css.insert(".templates-modal > div { display: flex; flex-direction: column; }"); this.css.insert("#templates-modal > div { display: flex; flex-direction: column; }");
this.css.insert(".templates-modal-bottom { flex: 0 0 auto; padding: 16px; }"); this.css.insert(".templates-modal-bottom { flex: 0 0 auto; padding: 16px; }");
this.css.insert(".template-list .templates-modal-bottom { display: flex; justify-content: space-between; }"); this.css.insert("#template-list .templates-modal-bottom { display: flex; justify-content: space-between; }");
this.css.insert(".template-editor .templates-modal-bottom { text-align: right; }"); this.css.insert("#template-editor .templates-modal-bottom { text-align: right; }");
this.css.insert(".template-list { height: 100%; flex: 1 1 auto; }"); this.css.insert("#template-list { height: 100%; flex: 1 1 auto; }");
this.css.insert(".template-list ul { list-style-type: none; font-size: 24px; color: #222; flex: 1 1 auto; padding: 12px; overflow-y: auto; }"); this.css.insert("#template-list ul { list-style-type: none; font-size: 24px; color: #222; flex: 1 1 auto; padding: 12px; overflow-y: auto; }");
this.css.insert(".template-list li { display: block; width: 100%; padding: 4px 8px; box-sizing: border-box; }"); this.css.insert("#template-list li { display: block; width: 100%; padding: 4px 8px; box-sizing: border-box; }");
this.css.insert(".template-list li[data-template] { cursor: pointer; }"); this.css.insert("#template-list li[data-template] { cursor: pointer; }");
this.css.insert(".template-list li[data-template]:hover { background-color: #d8d8d8; }"); this.css.insert("#template-list li[data-template]:hover { background-color: #d8d8d8; }");
this.css.insert(".template-list li span { white-space: nowrap; }"); this.css.insert("#template-list li span { white-space: nowrap; }");
this.css.insert(".template-list li .icon { opacity: 0.6; margin-left: 4px; padding: 3px; }"); this.css.insert("#template-list li .icon { opacity: 0.6; margin-left: 4px; padding: 3px; }");
this.css.insert(".template-list li .icon:hover { opacity: 1; }"); this.css.insert("#template-list li .icon:hover { opacity: 1; }");
this.css.insert(".template-list li .template-actions { float: right; }"); this.css.insert("#template-list li .template-actions { float: right; }");
this.css.insert(".template-editor { height: 100%; flex: 0 0 auto; width: 25vw; min-width: 150px; max-width: 400px; background-color: #485865; }"); this.css.insert("#template-editor { height: 100%; flex: 0 0 auto; width: 25vw; min-width: 150px; max-width: 400px; background-color: #485865; }");
this.css.insert(".template-editor-form { flex: 1 1 auto; padding: 12px 16px; font-size: 14px; overflow-y: auto; }"); this.css.insert(".template-editor-form { flex: 1 1 auto; padding: 12px 16px; font-size: 14px; overflow-y: auto; }");
this.css.insert(".template-editor-form .compose-text-title { margin: 24px 0 9px; }"); this.css.insert(".template-editor-form .compose-text-title { margin: 24px 0 9px; }");
this.css.insert(".template-editor-form .compose-text-title:first-child { margin-top: 0; }"); this.css.insert(".template-editor-form .compose-text-title:first-child { margin-top: 0; }");
@@ -261,9 +261,9 @@ enabled(){
$(".manage-templates-btn").addClass("active"); $(".manage-templates-btn").addClass("active");
let html = ` let html = `
<div class="templates-modal-wrap"> <div id="templates-modal-wrap">
<div class="templates-modal"> <div id="templates-modal">
<div class="template-list"> <div id="template-list">
<ul></ul> <ul></ul>
<div class="templates-modal-bottom"> <div class="templates-modal-bottom">
@@ -272,7 +272,7 @@ enabled(){
</div> </div>
</div> </div>
<div class="template-editor invisible"> <div id="template-editor" class="invisible">
<div class="template-editor-form"> <div class="template-editor-form">
<div class="compose-text-title">Template Name</div> <div class="compose-text-title">Template Name</div>
<input name="template-name" type="text"> <input name="template-name" type="text">
@@ -320,7 +320,7 @@ enabled(){
$(".js-app-content").prepend(html); $(".js-app-content").prepend(html);
let ele = $(".templates-modal-wrap").first(); let ele = $("#templates-modal-wrap").first();
ele.on("click", "li[data-template]", function(e){ ele.on("click", "li[data-template]", function(e){
let template = me.config.templates[$(this).attr("data-template")]; let template = me.config.templates[$(this).attr("data-template")];
@@ -332,7 +332,7 @@ enabled(){
switch($(this).attr("data-action")){ switch($(this).attr("data-action")){
case "edit-template": case "edit-template":
let editor = $(".template-editor"); let editor = $("#template-editor");
if (editor.hasClass("invisible")){ if (editor.hasClass("invisible")){
toggleEditor(); toggleEditor();
@@ -372,7 +372,7 @@ enabled(){
break; break;
case "editor-confirm": case "editor-confirm":
let editor = $(".template-editor"); let editor = $("#template-editor");
if (me.editingTemplate !== null){ if (me.editingTemplate !== null){
delete me.config.templates[me.editingTemplate]; delete me.config.templates[me.editingTemplate];
@@ -408,15 +408,15 @@ enabled(){
}; };
var hideTemplateModal = function(){ var hideTemplateModal = function(){
$(".templates-modal-wrap").remove(); $("#templates-modal-wrap").remove();
$(".manage-templates-btn").removeClass("active"); $(".manage-templates-btn").removeClass("active");
}; };
var toggleEditor = function(){ var toggleEditor = function(){
let editor = $(".template-editor"); let editor = $("#template-editor");
$("[name]", editor).val(""); $("[name]", editor).val("");
if ($("button[data-action='new-template']", ".template-list").add(editor).toggleClass("invisible").hasClass("invisible")){ if ($("button[data-action='new-template']", "#template-list").add(editor).toggleClass("invisible").hasClass("invisible")){
me.editingTemplate = null; me.editingTemplate = null;
} }
}; };
@@ -435,7 +435,7 @@ enabled(){
eles.push("<li>No templates available</li>"); eles.push("<li>No templates available</li>");
} }
$(".template-list").children("ul").html(eles.join("")); $("#template-list").children("ul").html(eles.join(""));
if (save){ if (save){
this.saveConfig(); this.saveConfig();
@@ -445,7 +445,7 @@ enabled(){
// event handlers // event handlers
this.manageTemplatesButtonClickEvent = function(e){ this.manageTemplatesButtonClickEvent = function(e){
if ($(".templates-modal-wrap").length){ if ($("#templates-modal-wrap").length){
hideTemplateModal(); hideTemplateModal();
} }
else{ else{
@@ -471,7 +471,7 @@ disabled(){
this.css.remove(); this.css.remove();
$(".manage-templates-btn").remove(); $(".manage-templates-btn").remove();
$(".templates-modal-wrap").remove(); $("#templates-modal-wrap").remove();
$(document).off("uiDrawerActive", this.drawerToggleEvent); $(document).off("uiDrawerActive", this.drawerToggleEvent);

View File

@@ -1,8 +1,4 @@
enabled(){ enabled(){
this.reloadColumns = () => {
Object.values(TD.controller.columnManager.getAll()).forEach(column => column.reloadTweets());
};
// styles // styles
this.css = window.TDPF_createCustomStyle(this); this.css = window.TDPF_createCustomStyle(this);
@@ -10,17 +6,17 @@ enabled(){
// utility functions // utility functions
var hasPoll = function(tweet){ const hasPoll = function(tweet){
return tweet.hasPoll && tweet.hasPoll(); return tweet.hasPoll && tweet.hasPoll();
}; };
var renderTweetPoll = function(tweet){ const renderTweetPoll = function(tweet){
return `<div class='td-timeline-poll'>${TD.ui.template.render("status/poll", $.extend({}, tweet, { return `<div class='td-timeline-poll'>${TD.ui.template.render("status/poll", $.extend({}, tweet, {
chirp: tweet chirp: tweet
}))}</div>`; }))}</div>`;
}; };
var renderPollHook = function(tweet, html){ const renderPollHook = function(tweet, html){
let ele = null; let ele = null;
if (hasPoll(tweet)){ if (hasPoll(tweet)){
@@ -67,7 +63,7 @@ enabled(){
}; };
this.prevRenderFuncs = funcs; this.prevRenderFuncs = funcs;
this.reloadColumns(); window.TDPF_reloadColumns();
} }
disabled(){ disabled(){
@@ -76,5 +72,5 @@ disabled(){
TD.components.TweetDetailView.prototype._renderChirp = this.prevRenderFuncs.TweetDetailView; TD.components.TweetDetailView.prototype._renderChirp = this.prevRenderFuncs.TweetDetailView;
this.css.remove(); this.css.remove();
this.reloadColumns(); window.TDPF_reloadColumns();
} }

View File

@@ -128,7 +128,7 @@
}; };
let fixMedia = (html, media) => { let fixMedia = (html, media) => {
return html.find(".js-media a[data-media-entity-id='"+media.mediaId+"']").css("background-image", 'url("'+media.thumb()+'")').removeClass("is-zoomable"); return html.find(".js-media a[data-media-entity-id='"+media.mediaId+"']").css("background-image", 'url("'+media.small()+'")').removeClass("is-zoomable");
}; };
return function(column, tweet){ return function(column, tweet){
@@ -271,20 +271,21 @@
let themeName = TD.settings.getTheme(); let themeName = TD.settings.getTheme();
let tags = [ let tags = [
`<html class='os-windows ${(doc.getAttribute("class").match(/txt-\S+/) || [ "txt-size--14" ])[0]}' data-td-font='${fontSizeName}' data-td-theme='${themeName}'><head>` "<html "+Array.prototype.map.call(document.documentElement.attributes, ele => `${ele.name}="${ele.value}"`).join(" ")+"><head>"
]; ];
$(document.head).children("link[rel='stylesheet']:not([title]),link[title='"+themeName+"'],meta[charset],meta[http-equiv]").each(function(){ $(document.head).children("link[href*='css/font.']:first,link[href*='css/app-"+themeName+".']:first,meta[charset],meta[http-equiv]").each(function(){
tags.push($(this)[0].outerHTML); tags.push($(this)[0].outerHTML);
}); });
tags.push("<style type='text/css'>"); tags.push("<style type='text/css'>");
tags.push("body { background: "+getClassStyleProperty("column", "background-color")+" }"); // set background color tags.push("body { background: "+getClassStyleProperty("column", "background-color")+" !important }"); // set background color
tags.push("a[data-full-url] { word-break: break-all }"); // 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(".activity-header { align-items: center !important; margin-bottom: 4px }"); // tweak alignment of avatar and text in notifications tags.push(".tweet-context .nbfc { text-overflow: ellipsis !important; white-space: nowrap !important }"); // force ellipsis on long usernames
tags.push(".activity-header .tweet-timestamp { line-height: unset }"); // fix timestamp position 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
if (fontSizeName === "smallest"){ if (fontSizeName === "smallest"){
tags.push(".badge-verified:before { width: 13px !important; height: 13px !important; background-position: -223px -98px !important }"); // fix cut off badge icon tags.push(".badge-verified:before { width: 13px !important; height: 13px !important; background-position: -223px -98px !important }"); // fix cut off badge icon
@@ -309,7 +310,7 @@
})(); })();
// //
// Block: Fix OS name. // Block: Fix OS name and add ID to the document for priority CSS selectors.
// //
if (ensurePropertyExists(TD, "util", "getOSName")){ if (ensurePropertyExists(TD, "util", "getOSName")){
TD.util.getOSName = function(){ TD.util.getOSName = function(){
@@ -320,6 +321,8 @@
doc.classList.add("os-windows"); doc.classList.add("os-windows");
} }
doc.id = "tduck";
// //
// Block: Enable popup notifications. // Block: Enable popup notifications.
// //
@@ -1116,6 +1119,13 @@
}); });
}); });
//
// Block: Setup global function to refresh all columns.
//
window.TDGF_reloadColumns = function(){
Object.values(TD.controller.columnManager.getAll()).forEach(column => column.reloadTweets());
};
// //
// Block: Allow applying ROT13 to input selection. // Block: Allow applying ROT13 to input selection.
// //

View File

@@ -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&nbsp;&nbsp;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");

View File

@@ -107,5 +107,6 @@
// Block: Setup bridges to global functions. // Block: Setup bridges to global functions.
// //
window.TDPF_playVideo = window.TDGF_playVideo; window.TDPF_playVideo = window.TDGF_playVideo;
window.TDPF_reloadColumns = window.TDGF_reloadColumns;
window.TDPF_prioritizeNewestEvent = window.TDGF_prioritizeNewestEvent; window.TDPF_prioritizeNewestEvent = window.TDGF_prioritizeNewestEvent;
})(); })();

View File

@@ -3,23 +3,23 @@
/***********************/ /***********************/
.scroll-styled-v::-webkit-scrollbar-thumb, .scroll-styled-h::-webkit-scrollbar-thumb, .antiscroll-scrollbar { .scroll-styled-v::-webkit-scrollbar-thumb, .scroll-styled-h::-webkit-scrollbar-thumb, .antiscroll-scrollbar {
border-radius: 0; border-radius: 0 !important;
} }
.antiscroll-scrollbar-vertical { .antiscroll-scrollbar-vertical {
margin-top: 0; margin-top: 0 !important;
} }
.antiscroll-scrollbar-horizontal { .antiscroll-scrollbar-horizontal {
margin-left: 0; margin-left: 0 !important;
} }
.scroll-styled-v:not(.antiscroll-inner)::-webkit-scrollbar { .scroll-styled-v:not(.antiscroll-inner)::-webkit-scrollbar {
width: 8px; width: 8px !important;
} }
.scroll-styled-h:not(.antiscroll-inner)::-webkit-scrollbar { .scroll-styled-h:not(.antiscroll-inner)::-webkit-scrollbar {
height: 8px; height: 8px !important;
} }
.app-columns-container::-webkit-scrollbar { .app-columns-container::-webkit-scrollbar {
@@ -27,7 +27,7 @@
} }
.app-columns-container::-webkit-scrollbar-track { .app-columns-container::-webkit-scrollbar-track {
border-left: 0; border-left: 0 !important;
} }
.app-columns-container { .app-columns-container {
@@ -87,20 +87,25 @@
} }
.app-header:not(.is-condensed) .nav-user-info { .app-header:not(.is-condensed) .nav-user-info {
padding: 0 5px; padding: 0 5px !important;
} }
/****************************************/ /****************************************/
/* 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; margin-bottom: 4px !important;
} }
.activity-header .tweet-timestamp { .activity-header .tweet-timestamp {
line-height: unset; line-height: unset !important;
} }
.account-bio.padding-t--5 { .account-bio.padding-t--5 {
@@ -126,12 +131,12 @@ html[data-td-theme='dark'] .stream-item:not(:hover) .js-user-actions-menu {
a[data-full-url] { a[data-full-url] {
/* break long urls */ /* break long urls */
word-break: break-all; word-break: break-all !important;
} }
.is-video a:not([href*='youtu']) .icon-bg-dot, .is-gif .icon-bg-dot { .is-video a:not([href*='youtu']) .icon-bg-dot, .is-gif .icon-bg-dot {
/* change play icon on mp4s */ /* change play icon on mp4s */
color: #9f51cf; color: #9f51cf !important;
} }
/***************************************/ /***************************************/
@@ -147,7 +152,7 @@ a[data-full-url] {
} }
.js-docked-compose footer { .js-docked-compose footer {
display: none; display: none !important;
} }
.compose-content { .compose-content {
@@ -160,7 +165,12 @@ a[data-full-url] {
.account-inline .username { .account-inline .username {
/* move usernames a bit higher */ /* move usernames a bit higher */
vertical-align: 10%; 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 {
@@ -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;
@@ -184,7 +201,7 @@ html[data-td-font='smallest'] .badge-verified:before {
.keyboard-shortcut-list { .keyboard-shortcut-list {
/* fix keyboard navigation alignment */ /* fix keyboard navigation alignment */
vertical-align: top; vertical-align: top !important;
} }
.tweet-detail-wrapper .js-media-gif-container { .tweet-detail-wrapper .js-media-gif-container {
@@ -192,21 +209,16 @@ 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;
}
/***************************************************************/ /***************************************************************/
/* Fix glaring visual issues that twitter hasn't fixed yet smh */ /* 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 */
position: absolute; position: absolute !important;
} }
.js-docked-compose .js-drawer-close { #tduck .js-docked-compose .js-drawer-close {
/* fix close drawer button position */ /* fix close drawer button position */
margin: 20px 0 0 !important; margin: 20px 0 0 !important;
} }
@@ -219,7 +231,7 @@ html[data-td-font='smallest'] .badge-verified:before {
#account-safeguard-checkbox, #inline-account-safeguard-checkbox { #account-safeguard-checkbox, #inline-account-safeguard-checkbox {
/* fix "Ready to Tweet/send" alignment with the checkbox */ /* fix "Ready to Tweet/send" alignment with the checkbox */
vertical-align: -15%; vertical-align: -15% !important;
} }
/************************************************/ /************************************************/
@@ -231,7 +243,7 @@ html[data-td-font='smallest'] .badge-verified:before {
} }
.js-column-header .column-header-link { .js-column-header .column-header-link {
padding: 0; padding: 0 !important;
} }
.js-column-header .column-header-link .icon { .js-column-header .column-header-link .icon {
@@ -250,9 +262,9 @@ html[data-td-font='smallest'] .badge-verified:before {
} }
.column:not(.is-options-open) .column-header { .column:not(.is-options-open) .column-header {
border-bottom: none; border-bottom: none !important;
} }
.is-options-open .column-type-icon { .is-options-open .column-type-icon {
bottom: 27px; bottom: 27px !important;
} }

View File

@@ -1,26 +1,42 @@
/***********/
/* General */ /* General */
/***********/
body:before { body:before {
content: none; content: none !important;
} }
body { body {
overflow-y: auto; overflow-y: auto !important;
} }
.scroll-styled-v::-webkit-scrollbar { .scroll-styled-v::-webkit-scrollbar {
width: 7px; width: 7px !important;
} }
.scroll-styled-v::-webkit-scrollbar-thumb { .scroll-styled-v::-webkit-scrollbar-thumb {
border-radius: 0; border-radius: 0 !important;
} }
.scroll-styled-v::-webkit-scrollbar-track { .scroll-styled-v::-webkit-scrollbar-track {
border-left: 0; 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;

View File

@@ -46,25 +46,25 @@
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
} }
.tdu-title { #tweetduck-update .tdu-title {
font-size: 15px; font-size: 15px;
font-weight: bold; font-weight: bold;
margin: 8px 0 2px; margin: 8px 0 2px;
cursor: default; cursor: default;
} }
.tdu-info { #tweetduck-update .tdu-info {
display: inline-block; display: inline-block;
font-size: 14px; font-size: 14px;
margin: 3px 0; margin: 3px 0;
} }
.tdu-showlog { #tweetduck-update .tdu-showlog {
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
.tdu-buttons button { #tweetduck-update .tdu-buttons button {
display: block; display: block;
margin: 7px auto 0; margin: 7px auto 0;
padding: 4px 10px; padding: 4px 10px;
@@ -81,12 +81,12 @@
transition: box-shadow 0.2s ease; transition: box-shadow 0.2s ease;
} }
.tdu-buttons button:hover { #tweetduck-update .tdu-buttons button:hover {
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.75); text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.75);
box-shadow: 1px 1px 1px rgba(17, 17, 17, 0.75), 0 -2px 0 rgba(17, 17, 17, 0.33) inset !important; box-shadow: 1px 1px 1px rgba(17, 17, 17, 0.75), 0 -2px 0 rgba(17, 17, 17, 0.33) inset !important;
} }
.tdu-buttons button.tdu-btn-ignore, .tdu-buttons button.tdu-btn-later { #tweetduck-update .tdu-buttons button.tdu-btn-ignore, .tdu-buttons button.tdu-btn-later {
background-color: #607a8e; background-color: #607a8e;
color: #dfdfdf; color: #dfdfdf;
} }

View File

@@ -262,6 +262,7 @@ namespace TweetDuck.Video{
Visible = false; Visible = false;
pipe.Write("rip"); pipe.Write("rip");
Player.close();
Close(); Close();
} }