mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-18 13:31:41 +02:00
Configuration
Core
Bridge
CallbackBridge.cs
PropertyBridge.cs
TweetDeckBridge.cs
Controls
Handling
Notification
Other
Utils
FormBrowser.Designer.cs
FormBrowser.cs
FormBrowser.resx
TrayIcon.Designer.cs
TrayIcon.cs
Plugins
Properties
Resources
Updates
bld
lib
subprocess
tests
.gitignore
LICENSE.md
Program.cs
README.md
Reporter.cs
TweetDuck.csproj
TweetDuck.sln
TweetDuck.sln.DotSettings
_postbuild.bat
packages.config
46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
using System;
|
|
using System.Text;
|
|
|
|
namespace TweetDuck.Core.Bridge{
|
|
static class PropertyBridge{
|
|
[Flags]
|
|
public enum Properties{
|
|
ExpandLinksOnHover = 1,
|
|
MuteNotifications = 2,
|
|
HasCustomNotificationSound = 4,
|
|
SkipOnLinkClick = 8,
|
|
SwitchAccountSelectors = 16,
|
|
AllBrowser = ExpandLinksOnHover | SwitchAccountSelectors | MuteNotifications | HasCustomNotificationSound,
|
|
AllNotification = ExpandLinksOnHover | SkipOnLinkClick
|
|
}
|
|
|
|
public static string GenerateScript(Properties properties){
|
|
StringBuilder build = new StringBuilder();
|
|
build.Append("(function(c){");
|
|
|
|
if (properties.HasFlag(Properties.ExpandLinksOnHover)){
|
|
build.Append("c.expandLinksOnHover=").Append(Program.UserConfig.ExpandLinksOnHover ? "true;" : "false;");
|
|
}
|
|
|
|
if (properties.HasFlag(Properties.SwitchAccountSelectors)){
|
|
build.Append("c.switchAccountSelectors=").Append(Program.UserConfig.SwitchAccountSelectors ? "true;" : "false;");
|
|
}
|
|
|
|
if (properties.HasFlag(Properties.MuteNotifications)){
|
|
build.Append("c.muteNotifications=").Append(Program.UserConfig.MuteNotifications ? "true;" : "false;");
|
|
}
|
|
|
|
if (properties.HasFlag(Properties.HasCustomNotificationSound)){
|
|
build.Append("c.hasCustomNotificationSound=").Append(Program.UserConfig.NotificationSoundPath.Length > 0 ? "true;" : "false;");
|
|
}
|
|
|
|
if (properties.HasFlag(Properties.SkipOnLinkClick)){
|
|
build.Append("c.skipOnLinkClick=").Append(Program.UserConfig.NotificationSkipOnLinkClick ? "true;" : "false;");
|
|
}
|
|
|
|
build.Append("})(window.$TDX=window.$TDX||{})");
|
|
return build.ToString();
|
|
}
|
|
}
|
|
}
|