mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Automatic URL shortening support
Automatic URL shortening support if the URL longer than a specified length.
This commit is contained in:
parent
4ff5e27761
commit
bbfc9b7017
3 changed files with 10 additions and 6 deletions
|
@ -11,5 +11,5 @@
|
|||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: Guid("82E6AC09-0FEF-4390-AD9F-0DD3F5561EFC")]
|
||||
[assembly: AssemblyVersion("8.5.0")]
|
||||
[assembly: AssemblyFileVersion("8.5.0")]
|
||||
[assembly: AssemblyVersion("8.5.1")]
|
||||
[assembly: AssemblyFileVersion("8.5.1")]
|
|
@ -302,9 +302,12 @@ public class TaskSettingsAdvanced
|
|||
[Category("After upload"), DefaultValue(""), Description("Balloon tip content format after uploading. Supported variables: $result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $folderpath, $foldername, $uploadtime and other variables such as %y-%mo-%d etc.")]
|
||||
public string BalloonTipContentFormat { get; set; }
|
||||
|
||||
[Category("After upload / Automatic URL Shortener"), DefaultValue(0), Description("Automatically shorten URL if the URL is longer than the specified number of characters. 0 means automatic URL shortening is not active.")]
|
||||
public int AutoShortenURLLength { get; set; }
|
||||
|
||||
private float toastWindowDuration;
|
||||
|
||||
[Category("After upload"), DefaultValue(4f), Description("Specify how long should toast notification window will stay on screen (in seconds).")]
|
||||
[Category("After upload / Notifications"), DefaultValue(4f), Description("Specify how long should toast notification window will stay on screen (in seconds).")]
|
||||
public float ToastWindowDuration
|
||||
{
|
||||
get
|
||||
|
@ -317,12 +320,12 @@ public float ToastWindowDuration
|
|||
}
|
||||
}
|
||||
|
||||
[Category("After upload"), DefaultValue(ContentAlignment.BottomRight), Description("Specify where should toast notification window appear on the screen.")]
|
||||
[Category("After upload / Notifications"), DefaultValue(ContentAlignment.BottomRight), Description("Specify where should toast notification window appear on the screen.")]
|
||||
public ContentAlignment ToastWindowPlacement { get; set; }
|
||||
|
||||
private Size toastWindowSize;
|
||||
|
||||
[Category("After upload"), DefaultValue(typeof(Size), "400, 300"), Description("Maximum toast notification window size.")]
|
||||
[Category("After upload / Notifications"), DefaultValue(typeof(Size), "400, 300"), Description("Maximum toast notification window size.")]
|
||||
public Size ToastWindowSize
|
||||
{
|
||||
get
|
||||
|
|
|
@ -466,7 +466,8 @@ private void DoAfterUploadJobs()
|
|||
{
|
||||
try
|
||||
{
|
||||
if (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.UseURLShortener) || Info.Job == TaskJob.ShortenURL)
|
||||
if (Info.TaskSettings.AfterUploadJob.HasFlag(AfterUploadTasks.UseURLShortener) || Info.Job == TaskJob.ShortenURL ||
|
||||
(Info.TaskSettings.AdvancedSettings.AutoShortenURLLength > 0 && Info.Result.URL.Length > Info.TaskSettings.AdvancedSettings.AutoShortenURLLength))
|
||||
{
|
||||
UploadResult result = ShortenURL(Info.Result.URL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue