mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-09-14 01:32:10 +02:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
1a31e69ec9 | |||
e065983c95 | |||
30a169171a | |||
8d1900362e | |||
e154189de1 | |||
b0f147de24 |
@@ -393,7 +393,7 @@ namespace TweetDuck.Core{
|
||||
FormSettings form = new FormSettings(this, plugins, updates, analytics, startTab);
|
||||
|
||||
form.FormClosed += (sender, args) => {
|
||||
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck){
|
||||
if (!prevEnableUpdateCheck && Config.EnableUpdateCheck && !UpdateHandler.TemporarilyForceUpdateChecking){
|
||||
Config.DismissedUpdate = null;
|
||||
Config.Save();
|
||||
|
||||
|
@@ -1,8 +1,11 @@
|
||||
using CefSharp;
|
||||
using System.Text.RegularExpressions;
|
||||
using CefSharp;
|
||||
using TweetDuck.Core.Utils;
|
||||
|
||||
namespace TweetDuck.Core.Handling{
|
||||
sealed class RequestHandlerBrowser : RequestHandlerBase{
|
||||
private static readonly Regex TmpResourceRedirect = new Regex(@"dist\/(.*?)\.(.*?)\.js$", RegexOptions.Compiled);
|
||||
|
||||
public string BlockNextUserNavUrl { get; set; }
|
||||
|
||||
public RequestHandlerBrowser() : base(true){}
|
||||
@@ -31,6 +34,30 @@ namespace TweetDuck.Core.Handling{
|
||||
request.Url = TwitterUtils.LoadingSpinner.Url;
|
||||
return true;
|
||||
}
|
||||
else if (request.ResourceType == ResourceType.Script){ // TODO delaying the apocalypse
|
||||
Match match = TmpResourceRedirect.Match(request.Url);
|
||||
|
||||
if (match.Success){
|
||||
string scriptType = match.Groups[1].Value;
|
||||
string scriptHash = match.Groups[2].Value;
|
||||
|
||||
const string HashBundle = "1bd75b5854";
|
||||
const string HashVendor = "942c0a20e8";
|
||||
|
||||
if (scriptType == "bundle" && scriptHash != HashBundle){
|
||||
request.Url = TmpResourceRedirect.Replace(request.Url, "dist/$1."+HashBundle+".js");
|
||||
System.Diagnostics.Debug.WriteLine("rewriting "+scriptType+" to "+request.Url);
|
||||
return true;
|
||||
}
|
||||
else if (scriptType == "vendor" && scriptHash != HashVendor){
|
||||
request.Url = TmpResourceRedirect.Replace(request.Url, "dist/$1."+HashVendor+".js");
|
||||
System.Diagnostics.Debug.WriteLine("rewriting "+scriptType+" to "+request.Url);
|
||||
return true;
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine("accepting "+scriptType+" as "+request.Url);
|
||||
}
|
||||
}
|
||||
|
||||
return base.OnResourceResponse(browserControl, browser, frame, request, response);
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ namespace TweetDuck{
|
||||
public const string BrandName = "TweetDuck";
|
||||
public const string Website = "https://tweetduck.chylex.com";
|
||||
|
||||
public const string VersionTag = "1.14.4";
|
||||
public const string VersionTag = "1.14.4.1";
|
||||
|
||||
public static readonly string ProgramPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
public static readonly bool IsPortable = File.Exists(Path.Combine(ProgramPath, "makeportable"));
|
||||
|
@@ -64,6 +64,8 @@ After the window closes, three installers will be generated inside the `bld/Outp
|
||||
|
||||
#### Notes
|
||||
|
||||
> When opening **Batch Build**, you will also see `x64` and `AnyCPU` configurations. These are visible due to what I consider a Visual Studio bug, and will not work without significant changes to the project. Manually running the `Resources/PostCefUpdate.ps1` PowerShell script modifies the downloaded CefSharp packages, and removes the invalid configurations.
|
||||
|
||||
> There is a small chance running `RUN BUILD.bat` immediately shows a resource error. If that happens, close the console window (which terminates all Inno Setup processes and leaves corrupted installers in the output folder), and run it again.
|
||||
|
||||
> Running `RUN BUILD.bat` uses about 400 MB of RAM due to high compression. You can lower this to about 140 MB by opening `gen_full.iss` and `gen_port.iss`, and changing `LZMADictionarySize=15360` to `LZMADictionarySize=4096`.
|
||||
|
@@ -541,7 +541,7 @@ ${iconData.map(entry => `#tduck .icon-${entry[0]}:before{content:\"\\f0${entry[1
|
||||
#tduck .js-docked-compose .js-drawer-close { margin: 20px 0 0 !important }
|
||||
#tduck .search-input-control .icon { font-size: 20px !important; top: -4px !important }
|
||||
|
||||
.column-type-icon { margin-top: -1px !important }
|
||||
.js-column-header .column-type-icon { margin-top: -1px !important }
|
||||
.inline-reply .pull-left .Button--link { margin-top: 3px !important }
|
||||
|
||||
.tweet-action-item .icon-favorite-toggle { font-size: 16px !important; }
|
||||
|
@@ -1,18 +1,60 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$MainProj = "..\TweetDuck.csproj"
|
||||
$BrowserProj = "..\subprocess\TweetDuck.Browser.csproj"
|
||||
|
||||
$Match = Select-String -Path $MainProj '<Import Project="packages\\cef\.redist\.x86\.(.*?)\\'
|
||||
$Version = $Match.Matches[0].Groups[1].Value
|
||||
|
||||
Copy-Item "..\packages\cef.redist.x86.${Version}\CEF\devtools_resources.pak" -Destination "..\bld\Resources\" -Force
|
||||
|
||||
$Match = Select-String -Path $MainProj '<Import Project="packages\\CefSharp\.Common\.(.*?)\\'
|
||||
$Version = $Match.Matches[0].Groups[1].Value
|
||||
|
||||
$Contents = [IO.File]::ReadAllText($BrowserProj)
|
||||
$Contents = $Contents -Replace '(?<=<HintPath>\.\.\\packages\\CefSharp\.Common\.)(.*?)(?=\\)', $Version
|
||||
$Contents = $Contents -Replace '(?<=<Reference Include="CefSharp\.BrowserSubprocess\.Core, Version=)(\d+)', $Version.Split(".")[0]
|
||||
|
||||
[IO.File]::WriteAllText($BrowserProj, $Contents)
|
||||
try{
|
||||
$mainProj = "..\TweetDuck.csproj"
|
||||
$browserProj = "..\subprocess\TweetDuck.Browser.csproj"
|
||||
|
||||
$cefMatch = Select-String -Path $mainProj '<Import Project="packages\\cef\.redist\.x86\.(.*?)\\'
|
||||
$cefVersion = $cefMatch.Matches[0].Groups[1].Value
|
||||
|
||||
$sharpMatch = Select-String -Path $mainProj '<Import Project="packages\\CefSharp\.Common\.(.*?)\\'
|
||||
$sharpVersion = $sharpMatch.Matches[0].Groups[1].Value
|
||||
|
||||
$propsFiles = "..\packages\CefSharp.Common.${sharpVersion}\build\CefSharp.Common.props",
|
||||
"..\packages\CefSharp.WinForms.${sharpVersion}\build\CefSharp.WinForms.props"
|
||||
|
||||
# Greetings
|
||||
|
||||
$title = "CEF ${cefVersion}, CefSharp ${sharpVersion}"
|
||||
|
||||
Write-Host ("-" * $title.Length)
|
||||
Write-Host $title
|
||||
Write-Host ("-" * $title.Length)
|
||||
|
||||
# Perform update
|
||||
|
||||
Write-Host "Copying dev tools to repository..."
|
||||
|
||||
Copy-Item "..\packages\cef.redist.x86.${cefVersion}\CEF\devtools_resources.pak" -Destination "..\bld\Resources\" -Force
|
||||
|
||||
Write-Host "Updating browser subprocess reference..."
|
||||
|
||||
$contents = [IO.File]::ReadAllText($browserProj)
|
||||
$contents = $contents -Replace '(?<=<HintPath>\.\.\\packages\\CefSharp\.Common\.)(.*?)(?=\\)', $sharpVersion
|
||||
$contents = $contents -Replace '(?<=<Reference Include="CefSharp\.BrowserSubprocess\.Core, Version=)(\d+)', $sharpVersion.Split(".")[0]
|
||||
|
||||
[IO.File]::WriteAllText($browserProj, $contents)
|
||||
|
||||
Write-Host "Removing x64 and AnyCPU from CefSharp props..."
|
||||
|
||||
foreach($file in $propsFiles){
|
||||
$contents = [IO.File]::ReadAllText($file)
|
||||
$contents = $contents -Replace '(?<=<When Condition=")(''\$\(Platform\)'' == ''(AnyCPU|x64)'')(?=">)', 'false'
|
||||
|
||||
[IO.File]::WriteAllText($file, $contents)
|
||||
}
|
||||
|
||||
# Finished
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Finished. Exiting in 6 seconds..."
|
||||
Start-Sleep -Seconds 6
|
||||
|
||||
}catch{
|
||||
Write-Host ""
|
||||
Write-Host "Encountered an error while running PostBuild.ps1 on line" $_.InvocationInfo.ScriptLineNumber
|
||||
Write-Host $_
|
||||
|
||||
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||
Exit 1
|
||||
}
|
||||
|
@@ -398,6 +398,8 @@
|
||||
let menu = $(".js-dropdown-content").children("ul").first();
|
||||
return if menu.length === 0;
|
||||
|
||||
menu.find(".update-available-item").parent().remove(); // TODO temp
|
||||
|
||||
let button = $('<li class="is-selectable" data-tweetduck><a href="#" data-action>TweetDuck</a></li>');
|
||||
button.insertBefore(menu.children(".drp-h-divider").last());
|
||||
|
||||
@@ -519,19 +521,21 @@
|
||||
TD.services.TwitterUser.prototype.fromJSONObject = function(){
|
||||
let obj = prevFunc.apply(this, arguments);
|
||||
let e = arguments[0].entities;
|
||||
|
||||
|
||||
if (obj.id === accountId){
|
||||
obj.name = realDisplayName;
|
||||
obj.emojifiedName = realDisplayName;
|
||||
obj.profileImageURL = realAvatar;
|
||||
obj.url = "https://tweetduck.chylex.com";
|
||||
|
||||
obj.entities.url.urls = [{
|
||||
url: obj.url,
|
||||
expanded_url: obj.url,
|
||||
display_url: "tweetduck.chylex.com",
|
||||
indices: [ 0, 23 ]
|
||||
}];
|
||||
if (obj.entities && obj.entities.url){
|
||||
obj.entities.url.urls = [{
|
||||
url: obj.url,
|
||||
expanded_url: obj.url,
|
||||
display_url: "tweetduck.chylex.com",
|
||||
indices: [ 0, 23 ]
|
||||
}];
|
||||
}
|
||||
}
|
||||
else if (e && e.url && e.url.urls && e.url.urls.length && e.url.urls[0].expanded_url){
|
||||
obj.url = e.url.urls[0].expanded_url;
|
||||
@@ -1518,10 +1522,17 @@
|
||||
//
|
||||
// Block: Disable default TweetDeck update notification.
|
||||
//
|
||||
onAppReady.push(function(){
|
||||
$(document).on("uiSuggestRefreshToggle", function(e){
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
});
|
||||
|
||||
/*onAppReady.push(function(){
|
||||
let events = $._data(document, "events");
|
||||
delete events["uiSuggestRefreshToggle"];
|
||||
});
|
||||
|
||||
//$(".js-app-settings .icon-settings").removeClass("color-twitter-yellow"); // TODO temp
|
||||
});*/
|
||||
|
||||
//
|
||||
// Block: Disable TweetDeck metrics.
|
||||
|
@@ -164,7 +164,7 @@
|
||||
<div class='tdu-buttons'>
|
||||
<button class='tdu-btn-download'>Update now</button>
|
||||
<button class='tdu-btn-later'>Remind me later</button>
|
||||
<button class='tdu-btn-ignore'>Ignore this update</button>
|
||||
<!-- TODO <button class='tdu-btn-ignore'>Ignore this update</button>-->
|
||||
</div>
|
||||
</div>
|
||||
`).appendTo(document.body).css("display", existed ? "block" : "none");
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="packages\CefSharp.WinForms.66.0.0-CI2629\build\CefSharp.WinForms.props" Condition="Exists('packages\CefSharp.WinForms.66.0.0-CI2629\build\CefSharp.WinForms.props')" />
|
||||
<Import Project="packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.props" Condition="Exists('packages\CefSharp.Common.66.0.0-CI2629\build\CefSharp.Common.props')" />
|
||||
@@ -15,25 +15,8 @@
|
||||
<AssemblyName>TweetDuck</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<StartArguments>-datafolder TweetDuckDebug</StartArguments>
|
||||
@@ -47,23 +30,15 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<LangVersion>7</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<Optimize>true</Optimize>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<DefineConstants>
|
||||
</DefineConstants>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>7</LangVersion>
|
||||
</PropertyGroup>
|
||||
@@ -330,11 +305,6 @@
|
||||
<Compile Include="Updates\Events\UpdateEventArgs.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
@@ -345,11 +315,6 @@
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.4.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 4.5</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Core\FormBrowser.resx">
|
||||
|
@@ -10,6 +10,8 @@ using Timer = System.Windows.Forms.Timer;
|
||||
|
||||
namespace TweetDuck.Updates{
|
||||
sealed class UpdateHandler : IDisposable{
|
||||
public const bool TemporarilyForceUpdateChecking = true;
|
||||
|
||||
public const int CheckCodeUpdatesDisabled = -1;
|
||||
public const int CheckCodeNotOnTweetDeck = -2;
|
||||
|
||||
@@ -53,7 +55,7 @@ namespace TweetDuck.Updates{
|
||||
|
||||
timer.Stop();
|
||||
|
||||
if (Program.UserConfig.EnableUpdateCheck){
|
||||
if (Program.UserConfig.EnableUpdateCheck || TemporarilyForceUpdateChecking){
|
||||
DateTime now = DateTime.Now;
|
||||
TimeSpan nextHour = now.AddSeconds(60*(60-now.Minute)-now.Second)-now;
|
||||
|
||||
@@ -67,7 +69,7 @@ namespace TweetDuck.Updates{
|
||||
}
|
||||
|
||||
public int Check(bool force){
|
||||
if (Program.UserConfig.EnableUpdateCheck || force){
|
||||
if (Program.UserConfig.EnableUpdateCheck || TemporarilyForceUpdateChecking || force){
|
||||
if (!browser.IsTweetDeckWebsite){
|
||||
return CheckCodeNotOnTweetDeck;
|
||||
}
|
||||
|
@@ -1,11 +1,11 @@
|
||||
namespace Unit.Data
|
||||
namespace Unit.Data.Result
|
||||
|
||||
open Xunit
|
||||
open TweetDuck.Data
|
||||
open System
|
||||
|
||||
|
||||
module TestResult_WithValue =
|
||||
module Result_WithValue =
|
||||
let result = Result<int>(10)
|
||||
|
||||
[<Fact>]
|
||||
@@ -31,7 +31,7 @@ module TestResult_WithValue =
|
||||
Assert.Equal(20, result.Select(fun x -> x * 2).Value)
|
||||
|
||||
|
||||
module TestResult_WithException =
|
||||
module Result_WithException =
|
||||
let result = Result<int>(IndexOutOfRangeException("bad"))
|
||||
|
||||
[<Fact>]
|
||||
|
Reference in New Issue
Block a user