Skip to content

Commit

Permalink
v1.0.15
Browse files Browse the repository at this point in the history
大量更新
  • Loading branch information
js-deliver committed Jul 27, 2019
1 parent b549cfd commit 27db30e
Show file tree
Hide file tree
Showing 16 changed files with 168 additions and 150 deletions.
9 changes: 8 additions & 1 deletion TencentVideoEnhanced/Data/rules.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 3,
"version": 4,
"rules": {
"eval": [
{
Expand Down Expand Up @@ -415,6 +415,13 @@
"status": true,
"enable": true
},
{
"id": "X007",
"value": "",
"description": "内容更丰富的搜索页",
"status": false,
"enable": true
},
{
"id": "X003",
"value": "",
Expand Down
10 changes: 7 additions & 3 deletions TencentVideoEnhanced/Model/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace TencentVideoEnhanced.Model
{
public class ToggleSwitchVisibilityConverter : IValueConverter
{
private Collection<string> ShowAsToggleButton = new Collection<string>(){ "X001", "X003", "X004", "X005", "X006" };
private Collection<string> ShowAsToggleButton = new Collection<string>(){ "X001", "X003", "X004", "X005", "X006","X007" };

public object Convert(object value, Type targetType, object parameter, string language)
{
Expand All @@ -27,6 +27,7 @@ public object Convert(object value, Type targetType, object parameter, string la
return Visibility.Collapsed;
}
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
Expand All @@ -49,6 +50,7 @@ public object Convert(object value, Type targetType, object parameter, string la
return Visibility.Collapsed;
}
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
Expand All @@ -57,8 +59,6 @@ public object ConvertBack(object value, Type targetType, object parameter, strin

public class ToggleButtonContentConverter : IValueConverter
{
private Collection<string> ShowAsToggleButton = new Collection<string>() { "X002" };

public object Convert(object value, Type targetType, object parameter, string language)
{
bool status = (bool)value;
Expand All @@ -71,6 +71,7 @@ public object Convert(object value, Type targetType, object parameter, string la
return "搜索页";
}
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
Expand All @@ -93,6 +94,7 @@ public object Convert(object value, Type targetType, object parameter, string la
return Visibility.Collapsed;
}
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
Expand All @@ -115,6 +117,7 @@ public object Convert(object value, Type targetType, object parameter, string la
}
return result;
}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return string.Format("{0}",value);
Expand All @@ -136,6 +139,7 @@ public object Convert(object value, Type targetType, object parameter, string la
}

}

public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
Expand Down
2 changes: 1 addition & 1 deletion TencentVideoEnhanced/Model/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace TencentVideoEnhanced.Model
class Utils
{
private static UserActivitySession CurrentSession;
public static Uri UpdateRulesUri = new Uri("http://aikatsucn.cn/files/rules.json");
public static Uri UpdateRulesUri = new Uri("http://static.aikatsucn.cn/static/tencent-video-enhanced/rules.json");

public static string TransferTemplate(string format)
{
Expand Down
31 changes: 0 additions & 31 deletions TencentVideoEnhanced/Model/exception.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,6 @@

namespace TencentVideoEnhanced.Model
{
/// <summary>
/// Wrapper around a standard synchronization context, that catches any unhandled exceptions.
/// Acts as a facade passing calls to the original SynchronizationContext
/// </summary>
/// <example>
/// Set this up inside your App.xaml.cs file as follows:
/// <code>
/// protected override void OnActivated(IActivatedEventArgs args)
/// {
/// EnsureSyncContext();
/// ...
/// }
///
/// protected override void OnLaunched(LaunchActivatedEventArgs args)
/// {
/// EnsureSyncContext();
/// ...
/// }
///
/// private void EnsureSyncContext()
/// {
/// var exceptionHandlingSynchronizationContext = ExceptionHandlingSynchronizationContext.Register();
/// exceptionHandlingSynchronizationContext.UnhandledException += OnSynchronizationContextUnhandledException;
/// }
///
/// private void OnSynchronizationContextUnhandledException(object sender, UnhandledExceptionEventArgs args)
/// {
/// args.Handled = true;
/// }
/// </code>
/// </example>
public class ExceptionHandlingSynchronizationContext : SynchronizationContext
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion TencentVideoEnhanced/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="418144ECEFCB8.web" Publisher="CN=6CAF9BFA-D22E-4D62-B95C-0817613375A5" Version="1.0.14.0" />
<Identity Name="418144ECEFCB8.web" Publisher="CN=6CAF9BFA-D22E-4D62-B95C-0817613375A5" Version="1.0.15.0" />
<mp:PhoneIdentity PhoneProductId="38c38351-a928-4f47-8cc9-89fd6eca5108" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>腾讯视频web增强版</DisplayName>
Expand Down
2 changes: 1 addition & 1 deletion TencentVideoEnhanced/TencentVideoEnhanced.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Model\Activity.cs" />
<Compile Include="Model\exception.cs" />
<Compile Include="Model\Exception.cs" />
<Compile Include="Model\Utils.cs" />
<Compile Include="View\History.xaml.cs">
<DependentUpon>History.xaml</DependentUpon>
Expand Down
21 changes: 21 additions & 0 deletions TencentVideoEnhanced/View/History.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,26 @@
x:Name="Loading" Width="80" Height="80"
>
</ProgressRing>
<Grid x:Name="TitleArea" Background="Transparent" Height="31" VerticalAlignment="Top" >
</Grid>

<Grid>
<StackPanel Orientation="Horizontal">
<Button
x:Name="Refresh" Content="&#xE72C;"
FontFamily="Segoe MDL2 Assets" Background="Transparent"
Click="Refresh_Click" HorizontalAlignment="Left"
VerticalAlignment="Top" Height="31"
Foreground="Black" Width="46"
ToolTipService.ToolTip="刷新"
/>
<Button x:Name="Go" Content="&#xE8B2;"
FontFamily="Segoe MDL2 Assets" Background="Transparent" HorizontalAlignment="Left"
VerticalAlignment="Top" Height="31"
Foreground="Black" Width="46"
ToolTipService.ToolTip="立刻进入" Click="Go_Click"
/>
</StackPanel>
</Grid>
</Grid>
</Page>
31 changes: 16 additions & 15 deletions TencentVideoEnhanced/View/History.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using TencentVideoEnhanced.Model;
using System.Threading.Tasks;
using Microsoft.Toolkit.Uwp.Helpers;
using Newtonsoft.Json;
using System.Collections.ObjectModel;
using Windows.UI.Popups;
using Windows.UI.Core;
using Windows.Foundation.Metadata;
using Windows.UI;
Expand Down Expand Up @@ -61,6 +46,7 @@ public History()

private void Init()
{
Window.Current.SetTitleBar(TitleArea);
SystemNavigationManager.BackRequested += BackRequested;
SystemNavigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
Loading.IsActive = true;
Expand Down Expand Up @@ -122,6 +108,7 @@ private async void NavigationCompleted(WebView sender, WebViewNavigationComplete

Loading.IsActive = false;
Blur.Visibility = Visibility.Collapsed;
Go.Visibility = Visibility.Collapsed;
}

private async void AdaptWebViewWithWindow()
Expand All @@ -145,5 +132,19 @@ private void HistoryWebView_SizeChanged(object sender, SizeChangedEventArgs e)
{
AdaptWebViewWithWindow();
}

private void Refresh_Click(object sender, RoutedEventArgs e)
{
Loading.IsActive = true;
Blur.Visibility = Visibility.Visible;
Go.Visibility = Visibility.Visible;
HistoryWebView.Refresh();
}

private void Go_Click(object sender, RoutedEventArgs e)
{
Loading.IsActive = false;
Blur.Visibility = Visibility.Collapsed;
}
}
}
6 changes: 0 additions & 6 deletions TencentVideoEnhanced/View/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using System.Threading;
using Windows.Storage;
using Windows.UI.Xaml.Controls;
using TencentVideoEnhanced.Model;
using TencentVideoEnhanced.View;
using Microsoft.Toolkit.Uwp.Helpers;
using Newtonsoft.Json;
using Windows.UI.Core;
using Windows.ApplicationModel.Core;
using Windows.UI;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using System.Collections.Generic;

// https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x804 上介绍了“空白页”项模板

Expand Down
23 changes: 23 additions & 0 deletions TencentVideoEnhanced/View/Search.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,39 @@
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
>
<Grid>

<WebView x:Name="SearchWebView"
NewWindowRequested="NewWindowRequested"
NavigationCompleted="NavigationCompleted"
>
</WebView>

<Grid x:Name="Blur">
</Grid>

<ProgressRing
x:Name="Loading" Width="80" Height="80"
>
</ProgressRing>

<Grid>
<StackPanel Orientation="Horizontal">
<Button
x:Name="Refresh" Content="&#xE72C;"
FontFamily="Segoe MDL2 Assets" Background="Transparent"
Click="Refresh_Click" HorizontalAlignment="Left"
VerticalAlignment="Top" Height="31"
Foreground="Black" Width="46"
ToolTipService.ToolTip="刷新"
/>
<Button x:Name="Go" Content="&#xE8B2;"
FontFamily="Segoe MDL2 Assets" Background="Transparent" HorizontalAlignment="Left"
VerticalAlignment="Top" Height="31"
Foreground="Black" Width="46"
ToolTipService.ToolTip="立刻进入" Click="Go_Click"
/>
</StackPanel>
</Grid>

</Grid>
</Page>
37 changes: 23 additions & 14 deletions TencentVideoEnhanced/View/Search.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.ViewManagement;
using Windows.Storage;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Newtonsoft.Json;
using TencentVideoEnhanced.Model;
using System.Threading.Tasks;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.Foundation.Metadata;
using Windows.UI;
using Windows.UI.Core;
Expand Down Expand Up @@ -46,6 +32,14 @@ public Search()
{
NavigationCacheMode = NavigationCacheMode.Required;
}

RulesItem MoreInformation = Utils.GetRulesItemById("X007");
if (MoreInformation.status)
{
UriSearch = new Uri("https://v.qq.com/?ptag=qqbsc");
}


if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 5))
{
Blur.Background = new AcrylicBrush
Expand Down Expand Up @@ -105,6 +99,7 @@ private void NavigationCompleted(WebView sender, WebViewNavigationCompletedEvent
}
Loading.IsActive = false;
Blur.Visibility = Visibility.Collapsed;
Go.Visibility = Visibility.Collapsed;
}

private async void RemoveElementsByClassName(string ClassName)
Expand All @@ -114,5 +109,19 @@ private async void RemoveElementsByClassName(string ClassName)
string script = string.Format(template, ClassName);
await SearchWebView.InvokeScriptAsync("eval", new string[] { script });
}

private void Refresh_Click(object sender, RoutedEventArgs e)
{
Loading.IsActive = true;
Blur.Visibility = Visibility.Visible;
Go.Visibility = Visibility.Visible;
SearchWebView.Refresh();
}

private void Go_Click(object sender, RoutedEventArgs e)
{
Loading.IsActive = false;
Blur.Visibility = Visibility.Collapsed;
}
}
}
Loading

0 comments on commit 27db30e

Please sign in to comment.