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

Compare commits

...

11 Commits
1.11 ... 1.11.1

23 changed files with 189 additions and 147 deletions

View File

@@ -45,6 +45,7 @@ namespace TweetDuck.Configuration{
public bool SwitchAccountSelectors { get; set; } = true;
public bool OpenSearchInFirstColumn { get; set; } = true;
public bool BestImageQuality { get; set; } = true;
public bool EnableAnimatedImages { get; set; } = true;
public bool EnableSpellCheck { get; set; } = false;
public int VideoPlayerVolume { get; set; } = 50;
private int _zoomLevel = 100;

View File

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

View File

@@ -350,6 +350,10 @@ namespace TweetDuck.Core{
browser.TriggerTweetScreenshot();
}
public void ReloadColumns(){
browser.ReloadColumns();
}
public void ApplyROT13(){
browser.ApplyROT13();
}

View File

@@ -1,14 +1,24 @@
using System;
using System.Threading.Tasks;
using CefSharp;
namespace TweetDuck.Core.Handling.General{
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()){
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 IDisposable.Dispose(){}
}

View File

@@ -5,7 +5,7 @@ using TweetDuck.Resources;
namespace TweetDuck.Core.Notification{
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");
public static TweetNotification Example(string html, int characters){
@@ -70,7 +70,7 @@ namespace TweetDuck.Core.Notification{
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("</div></body>");
build.Append("</html>");

View File

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

View File

@@ -40,6 +40,7 @@
this.panelUI = new System.Windows.Forms.Panel();
this.panelUpdates = new System.Windows.Forms.Panel();
this.labelUpdates = new System.Windows.Forms.Label();
this.checkAnimatedAvatars = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.trackBarZoom)).BeginInit();
this.panelUI.SuspendLayout();
this.panelUpdates.SuspendLayout();
@@ -60,11 +61,11 @@
// checkSpellCheck
//
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.Name = "checkSpellCheck";
this.checkSpellCheck.Size = new System.Drawing.Size(119, 17);
this.checkSpellCheck.TabIndex = 4;
this.checkSpellCheck.TabIndex = 5;
this.checkSpellCheck.Text = "Enable Spell Check";
this.toolTip.SetToolTip(this.checkSpellCheck, "Underlines words that are spelled incorrectly.");
this.checkSpellCheck.UseVisualStyleBackColor = true;
@@ -95,11 +96,11 @@
// labelZoomValue
//
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.Name = "labelZoomValue";
this.labelZoomValue.Size = new System.Drawing.Size(38, 13);
this.labelZoomValue.TabIndex = 7;
this.labelZoomValue.TabIndex = 8;
this.labelZoomValue.Text = "100%";
this.labelZoomValue.TextAlign = System.Drawing.ContentAlignment.TopRight;
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.BackColor = System.Drawing.SystemColors.Control;
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.Minimum = 50;
this.trackBarZoom.Name = "trackBarZoom";
this.trackBarZoom.Size = new System.Drawing.Size(148, 30);
this.trackBarZoom.SmallChange = 5;
this.trackBarZoom.TabIndex = 6;
this.trackBarZoom.TabIndex = 7;
this.trackBarZoom.TickFrequency = 25;
this.trackBarZoom.Value = 100;
//
// labelZoom
//
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.Name = "labelZoom";
this.labelZoom.Size = new System.Drawing.Size(34, 13);
this.labelZoom.TabIndex = 5;
this.labelZoom.TabIndex = 6;
this.labelZoom.Text = "Zoom";
//
// zoomUpdateTimer
@@ -185,6 +186,7 @@
//
this.panelUI.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panelUI.Controls.Add(this.checkAnimatedAvatars);
this.panelUI.Controls.Add(this.checkOpenSearchInFirstColumn);
this.panelUI.Controls.Add(this.checkBestImageQuality);
this.panelUI.Controls.Add(this.checkExpandLinks);
@@ -195,7 +197,7 @@
this.panelUI.Controls.Add(this.labelZoomValue);
this.panelUI.Location = new System.Drawing.Point(9, 31);
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;
//
// panelUpdates
@@ -204,7 +206,7 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.panelUpdates.Controls.Add(this.checkUpdateNotifications);
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.Size = new System.Drawing.Size(322, 55);
this.panelUpdates.TabIndex = 3;
@@ -213,13 +215,25 @@
//
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.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.Name = "labelUpdates";
this.labelUpdates.Size = new System.Drawing.Size(70, 20);
this.labelUpdates.TabIndex = 2;
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
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -229,7 +243,7 @@
this.Controls.Add(this.panelUI);
this.Controls.Add(this.labelUI);
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();
this.panelUI.ResumeLayout(false);
this.panelUI.PerformLayout();
@@ -258,5 +272,6 @@
private System.Windows.Forms.Label labelUpdates;
private System.Windows.Forms.CheckBox checkBestImageQuality;
private System.Windows.Forms.CheckBox checkOpenSearchInFirstColumn;
private System.Windows.Forms.CheckBox checkAnimatedAvatars;
}
}

View File

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

View File

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

View File

@@ -31,7 +31,7 @@ namespace TweetDuck.Core.Utils{
args["disable-gpu-vsync"] = "1";
}
args["disable-extensions"] = "1";
args["disable-pdf-extension"] = "1";
args["disable-plugins-discovery"] = "1";
args["enable-system-flash"] = "0";

View File

@@ -20,7 +20,7 @@ namespace TweetDuck{
public const string BrandName = "TweetDuck";
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");

View File

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

View File

@@ -364,23 +364,23 @@ enabled(){
if (this.config.themeColorTweaks){
switch(TD.settings.getTheme()){
case "dark":
this.css.insert(".app-content, .app-columns-container { background-color: #444448 }");
this.css.insert(".column-drag-handle { opacity: 0.5 }");
this.css.insert(".column-drag-handle:hover { opacity: 1 }");
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(".app-content, .app-columns-container { background-color: #444448 !important }");
this.css.insert(".column-drag-handle { opacity: 0.5 !important }");
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 !important }");
notificationScrollbarColor = "666";
break;
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(".app-columns-container.scroll-styled-h::-webkit-scrollbar-thumb:not(:hover) { background-color: #a5aeb5 }");
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 !important }");
notificationScrollbarColor = "a5aeb5";
break;
}
}
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){
@@ -391,8 +391,8 @@ enabled(){
}
if (this.config.moveTweetActionsToRight){
this.css.insert(".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 { float: right !important; width: auto !important }");
this.css.insert("#tduck .tweet-actions > li:nth-child(4) { margin-right: 2px !important }");
}
if (this.config.increaseQuoteTextSize){
@@ -491,13 +491,13 @@ enabled(){
this.icons = document.createElement("style");
this.icons.innerHTML = `
@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");
font-weight: 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 }
.column-header .column-type-icon { bottom: 26px !important }
@@ -552,17 +552,17 @@ ${this.config.increaseQuoteTextSize ? `
` : ``}
${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 }
.icon-reply:before{content:"\\f006";font-family:oldfont}
.icon-heart-filled:before{content:"\\f055";font-family:oldfont}
.icon-retweet-filled:before{content:"\\f008";font-family:oldfont}
.icon-list-filled:before{content:"\\f014";font-family:oldfont}
.icon-user-filled:before{content:"\\f035";font-family:oldfont}
.icon-user-dd:before{content:"\\f01a";font-family:oldfont}
@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 }
#tduck .icon-reply:before{content:"\\f006";font-family:_of!important}
#tduck .icon-heart-filled:before{content:"\\f055";font-family:_of!important}
#tduck .icon-retweet-filled:before{content:"\\f008";font-family:_of!important}
#tduck .icon-list-filled:before{content:"\\f014";font-family:_of!important}
#tduck .icon-user-filled:before{content:"\\f035";font-family:_of!important}
#tduck .icon-user-dd:before{content:"\\f01a";font-family:_of!important}
` : ``}
${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>`);
};

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">
<h3 class="mdl-header-title js-header-title">TweetDuck - Layout &amp; Design</h3>
<a href="#" class="mdl-dismiss js-dismiss link-normal-dark">
@@ -6,8 +6,8 @@
</a>
</header>
<div class="mdl-inner">
<div class="td-modal-content mdl-content js-mdl-content horizontal-flow-container">
<div class="td-modal-inner-cols">
<div id="edit-design-panel-content" class="mdl-content js-mdl-content horizontal-flow-container">
<div id="edit-design-panel-inner-cols">
<div class="l-column mdl-column">
<!-- THEME -->
@@ -159,60 +159,52 @@
/* Containers */
.td-modal-panel {
#edit-design-panel {
width: 693px;
height: 380px;
}
.td-modal-inner-cols {
#edit-design-panel-inner-cols {
padding: 0 6px;
}
.td-modal-inner-cols .l-column {
#edit-design-panel-inner-cols .l-column {
padding: 15px 9px;
box-sizing: border-box;
width: 225px;
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;
}
.td-modal-inner-full {
padding: 15px;
}
.td-modal-inner-full .txt-center {
margin-bottom: 10px;
}
/* Elements */
.td-modal-content label {
#edit-design-panel-content label.txt-uppercase {
margin-top: 18px;
}
.td-modal-content label:first-child {
#edit-design-panel-content label.txt-uppercase:first-child {
margin-top: 0;
}
.td-modal-content label.radio {
#edit-design-panel-content label.radio {
display: inline-block;
margin: 0 16px 5px 4px;
cursor: pointer;
}
.td-modal-content label.checkbox {
#edit-design-panel-content label.checkbox {
margin: 0 0 5px 4px;
cursor: pointer;
}
.td-modal-content select + label.checkbox {
#edit-design-panel-content select + label.checkbox {
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;
}

View File

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

View File

@@ -50,25 +50,25 @@ enabled(){
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(".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 > div { display: flex; flex-direction: column; }");
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 > div { display: flex; flex-direction: column; }");
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-editor .templates-modal-bottom { text-align: right; }");
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-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 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]:hover { background-color: #d8d8d8; }");
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:hover { opacity: 1; }");
this.css.insert(".template-list li .template-actions { float: right; }");
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 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]:hover { background-color: #d8d8d8; }");
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:hover { opacity: 1; }");
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 .compose-text-title { margin: 24px 0 9px; }");
this.css.insert(".template-editor-form .compose-text-title:first-child { margin-top: 0; }");
@@ -261,9 +261,9 @@ enabled(){
$(".manage-templates-btn").addClass("active");
let html = `
<div class="templates-modal-wrap">
<div class="templates-modal">
<div class="template-list">
<div id="templates-modal-wrap">
<div id="templates-modal">
<div id="template-list">
<ul></ul>
<div class="templates-modal-bottom">
@@ -272,7 +272,7 @@ enabled(){
</div>
</div>
<div class="template-editor invisible">
<div id="template-editor" class="invisible">
<div class="template-editor-form">
<div class="compose-text-title">Template Name</div>
<input name="template-name" type="text">
@@ -320,7 +320,7 @@ enabled(){
$(".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){
let template = me.config.templates[$(this).attr("data-template")];
@@ -332,7 +332,7 @@ enabled(){
switch($(this).attr("data-action")){
case "edit-template":
let editor = $(".template-editor");
let editor = $("#template-editor");
if (editor.hasClass("invisible")){
toggleEditor();
@@ -372,7 +372,7 @@ enabled(){
break;
case "editor-confirm":
let editor = $(".template-editor");
let editor = $("#template-editor");
if (me.editingTemplate !== null){
delete me.config.templates[me.editingTemplate];
@@ -408,15 +408,15 @@ enabled(){
};
var hideTemplateModal = function(){
$(".templates-modal-wrap").remove();
$("#templates-modal-wrap").remove();
$(".manage-templates-btn").removeClass("active");
};
var toggleEditor = function(){
let editor = $(".template-editor");
let editor = $("#template-editor");
$("[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;
}
};
@@ -435,7 +435,7 @@ enabled(){
eles.push("<li>No templates available</li>");
}
$(".template-list").children("ul").html(eles.join(""));
$("#template-list").children("ul").html(eles.join(""));
if (save){
this.saveConfig();
@@ -445,7 +445,7 @@ enabled(){
// event handlers
this.manageTemplatesButtonClickEvent = function(e){
if ($(".templates-modal-wrap").length){
if ($("#templates-modal-wrap").length){
hideTemplateModal();
}
else{
@@ -471,7 +471,7 @@ disabled(){
this.css.remove();
$(".manage-templates-btn").remove();
$(".templates-modal-wrap").remove();
$("#templates-modal-wrap").remove();
$(document).off("uiDrawerActive", this.drawerToggleEvent);

View File

@@ -1,8 +1,4 @@
enabled(){
this.reloadColumns = () => {
Object.values(TD.controller.columnManager.getAll()).forEach(column => column.reloadTweets());
};
// styles
this.css = window.TDPF_createCustomStyle(this);
@@ -10,17 +6,17 @@ enabled(){
// utility functions
var hasPoll = function(tweet){
const hasPoll = function(tweet){
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, {
chirp: tweet
}))}</div>`;
};
var renderPollHook = function(tweet, html){
const renderPollHook = function(tweet, html){
let ele = null;
if (hasPoll(tweet)){
@@ -67,7 +63,7 @@ enabled(){
};
this.prevRenderFuncs = funcs;
this.reloadColumns();
window.TDPF_reloadColumns();
}
disabled(){
@@ -76,5 +72,5 @@ disabled(){
TD.components.TweetDetailView.prototype._renderChirp = this.prevRenderFuncs.TweetDetailView;
this.css.remove();
this.reloadColumns();
window.TDPF_reloadColumns();
}

View File

@@ -128,7 +128,7 @@
};
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){
@@ -271,20 +271,20 @@
let themeName = TD.settings.getTheme();
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("<style type='text/css'>");
tags.push("body { background: "+getClassStyleProperty("column", "background-color")+" }"); // set background color
tags.push("a[data-full-url] { word-break: break-all }"); // break long urls
tags.push("body { background: "+getClassStyleProperty("column", "background-color")+" !important }"); // set background color
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(".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(".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"){
tags.push(".badge-verified:before { width: 13px !important; height: 13px !important; background-position: -223px -98px !important }"); // fix cut off badge icon
@@ -309,7 +309,7 @@
})();
//
// Block: Fix OS name.
// Block: Fix OS name and add ID to the document for priority CSS selectors.
//
if (ensurePropertyExists(TD, "util", "getOSName")){
TD.util.getOSName = function(){
@@ -320,6 +320,8 @@
doc.classList.add("os-windows");
}
doc.id = "tduck";
//
// Block: Enable popup notifications.
//
@@ -1116,6 +1118,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.
//

View File

@@ -107,5 +107,6 @@
// Block: Setup bridges to global functions.
//
window.TDPF_playVideo = window.TDGF_playVideo;
window.TDPF_reloadColumns = window.TDGF_reloadColumns;
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 {
border-radius: 0;
border-radius: 0 !important;
}
.antiscroll-scrollbar-vertical {
margin-top: 0;
margin-top: 0 !important;
}
.antiscroll-scrollbar-horizontal {
margin-left: 0;
margin-left: 0 !important;
}
.scroll-styled-v:not(.antiscroll-inner)::-webkit-scrollbar {
width: 8px;
width: 8px !important;
}
.scroll-styled-h:not(.antiscroll-inner)::-webkit-scrollbar {
height: 8px;
height: 8px !important;
}
.app-columns-container::-webkit-scrollbar {
@@ -27,7 +27,7 @@
}
.app-columns-container::-webkit-scrollbar-track {
border-left: 0;
border-left: 0 !important;
}
.app-columns-container {
@@ -87,7 +87,7 @@
}
.app-header:not(.is-condensed) .nav-user-info {
padding: 0 5px;
padding: 0 5px !important;
}
/****************************************/
@@ -96,11 +96,11 @@
.activity-header {
align-items: center !important;
margin-bottom: 4px;
margin-bottom: 4px !important;
}
.activity-header .tweet-timestamp {
line-height: unset;
line-height: unset !important;
}
.account-bio.padding-t--5 {
@@ -126,12 +126,12 @@ html[data-td-theme='dark'] .stream-item:not(:hover) .js-user-actions-menu {
a[data-full-url] {
/* 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 {
/* change play icon on mp4s */
color: #9f51cf;
color: #9f51cf !important;
}
/***************************************/
@@ -147,7 +147,7 @@ a[data-full-url] {
}
.js-docked-compose footer {
display: none;
display: none !important;
}
.compose-content {
@@ -160,7 +160,7 @@ a[data-full-url] {
.account-inline .username {
/* move usernames a bit higher */
vertical-align: 10%;
vertical-align: 10% !important;
}
html[data-td-font='smallest'] .sprite-verified-mini {
@@ -184,7 +184,7 @@ html[data-td-font='smallest'] .badge-verified:before {
.keyboard-shortcut-list {
/* fix keyboard navigation alignment */
vertical-align: top;
vertical-align: top !important;
}
.tweet-detail-wrapper .js-media-gif-container {
@@ -194,7 +194,7 @@ html[data-td-font='smallest'] .badge-verified:before {
.is-inverted-dark .inline-reply .btn:hover {
/* Reply buttons in modals are bork */
background-color: transparent;
background-color: transparent !important;
}
/***************************************************************/
@@ -203,10 +203,10 @@ html[data-td-font='smallest'] .badge-verified:before {
.column-nav-link .attribution {
/* 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 */
margin: 20px 0 0 !important;
}
@@ -219,7 +219,7 @@ html[data-td-font='smallest'] .badge-verified:before {
#account-safeguard-checkbox, #inline-account-safeguard-checkbox {
/* fix "Ready to Tweet/send" alignment with the checkbox */
vertical-align: -15%;
vertical-align: -15% !important;
}
/************************************************/
@@ -231,7 +231,7 @@ html[data-td-font='smallest'] .badge-verified:before {
}
.js-column-header .column-header-link {
padding: 0;
padding: 0 !important;
}
.js-column-header .column-header-link .icon {
@@ -250,9 +250,9 @@ html[data-td-font='smallest'] .badge-verified:before {
}
.column:not(.is-options-open) .column-header {
border-bottom: none;
border-bottom: none !important;
}
.is-options-open .column-type-icon {
bottom: 27px;
bottom: 27px !important;
}

View File

@@ -1,23 +1,23 @@
/* General */
body:before {
content: none;
content: none !important;
}
body {
overflow-y: auto;
overflow-y: auto !important;
}
.scroll-styled-v::-webkit-scrollbar {
width: 7px;
width: 7px !important;
}
.scroll-styled-v::-webkit-scrollbar-thumb {
border-radius: 0;
border-radius: 0 !important;
}
.scroll-styled-v::-webkit-scrollbar-track {
border-left: 0;
border-left: 0 !important;
}
/* Media */

View File

@@ -46,25 +46,25 @@
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
.tdu-title {
#tweetduck-update .tdu-title {
font-size: 15px;
font-weight: bold;
margin: 8px 0 2px;
cursor: default;
}
.tdu-info {
#tweetduck-update .tdu-info {
display: inline-block;
font-size: 14px;
margin: 3px 0;
}
.tdu-showlog {
#tweetduck-update .tdu-showlog {
text-decoration: underline;
cursor: pointer;
}
.tdu-buttons button {
#tweetduck-update .tdu-buttons button {
display: block;
margin: 7px auto 0;
padding: 4px 10px;
@@ -81,12 +81,12 @@
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);
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;
color: #dfdfdf;
}

View File

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