Skip to content

Commit

Permalink
Updated to 5.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WindowsMEMZ committed Oct 2, 2024
1 parent a65cceb commit 8690a9e
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 11 deletions.
43 changes: 43 additions & 0 deletions Localization/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -5520,6 +5520,9 @@
"A" : {
"shouldTranslate" : false
},
"Active Pro" : {
"shouldTranslate" : false
},
"All data will be lost!" : {
"shouldTranslate" : false
},
Expand Down Expand Up @@ -23333,6 +23336,16 @@
}
}
},
"前往 TestFlight" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Go to TestFlight"
}
}
}
},
"前往“提示”了解更多" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -27325,6 +27338,16 @@
}
}
},
"喵哩喵哩" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "MeowBili"
}
}
}
},
"回复" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -29219,6 +29242,16 @@
}
}
},
"在喵哩喵哩中打开" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Open in MeowBili"
}
}
}
},
"在安全延时期间您仍然可以使用暗礁浏览器。" : {
"localizations" : {
"ar" : {
Expand Down Expand Up @@ -58906,6 +58939,16 @@
}
}
},
"第三方哔哩哔哩客户端" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Third-party Bilibili Client"
}
}
}
},
"等待 Darock 修复" : {
"localizations" : {
"ar" : {
Expand Down
2 changes: 0 additions & 2 deletions WatchBrowser Watch App/Media/Image/ImageViewerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ struct ImageViewerView: View {
.onFailure { _ in
isFailedToLoad = true
}
.indicator(.activity)
.transition(.fade(duration: 0.5))
.scaledToFit()
.frame(width: CGFloat(100), height: CGFloat(100), alignment: .center)
Expand All @@ -33,7 +32,6 @@ struct ImageViewerView: View {
.onFailure { _ in
isFailedToLoad = true
}
.indicator(.activity)
.transition(.fade(duration: 0.5))
.scaledToFit()
}
Expand Down
18 changes: 17 additions & 1 deletion WatchBrowser Watch App/Preferences/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct SettingsView: View {
NavigationLink(destination: { ProPurchaseView() }, label: { SettingItemLabel(title: "暗礁浏览器 Pro", image: "sparkles", color: .blue) })
if isProPurchased {
if _featureFlagIsDarockIntelligenceEnabled {
NavigationLink(destination: {}, label: {
NavigationLink(destination: { DarockIntelligenceView() }, label: {
HStack {
Image("DarockIntelligenceIcon")
.resizable()
Expand Down Expand Up @@ -248,6 +248,14 @@ struct SettingsView: View {
}
}

struct DarockIntelligenceView: View {
var body: some View {
List {

}
.navigationTitle("Darock 智能")
}
}
@available(watchOS 10.0, *)
struct WidgetSettingsView: View {
var body: some View {
Expand Down Expand Up @@ -3464,6 +3472,14 @@ struct SettingsView: View {
}, label: {
Text("Reset Pro State")
})
Button(action: {
isProPurchased = true
UserDefaults(suiteName: "group.darock.WatchBrowser.Widgets")!.set(true, forKey: "IsProWidgetsAvailable")
WidgetCenter.shared.reloadAllTimelines()
WidgetCenter.shared.invalidateConfigurationRecommendations()
}, label: {
Text("Active Pro")
})
} header: {
Text("Purchasing")
}
Expand Down
55 changes: 55 additions & 0 deletions WatchBrowser Watch App/WebKit/BrowsingMenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SwiftUI
import Dynamic
import DarockKit
import SwiftSoup
import SDWebImageSwiftUI

struct BrowsingMenuView: View {
@Binding var webViewPresentationMode: PresentationMode
Expand Down Expand Up @@ -39,6 +40,60 @@ struct BrowsingMenuView: View {
ZStack {
NavigationStack {
List {
if (webView.url?.absoluteString ?? "").contains("bilibili.com/") {
Section {
VStack {
HStack {
WebImage(url: URL(string: "https://darock.top/meowbili/assetsv2/meow-93aa09e9.png")!)
.resizable()
.placeholder {
RoundedRectangle(cornerRadius: 12)
.fill(Color.gray)
.opacity(0.6)
}
.cornerRadius(12)
.frame(width: 50, height: 50)
VStack(alignment: .leading) {
Text("喵哩喵哩")
Text("第三方哔哩哔哩客户端")
.font(.footnote)
.opacity(0.6)
}
Spacer()
}
Group {
if UserDefaults(suiteName: "group.darockst")?.bool(forKey: "DCIsMeowBiliInstalled") ?? false {
Button(action: {
if let bvid = (webView.url?.absoluteString ?? "").split(separator: "bilibili.com/video/")[from: 1],
bvid.hasPrefix("BV") {
WKExtension.shared().openSystemURL(URL(string: "https://darock.top/meowbili/video/\(bvid)")!)
} else {
WKExtension.shared().openSystemURL(URL(string: "https://darock.top/meowbili/video")!)
}
}, label: {
HStack {
Text("在喵哩喵哩中打开")
Image(systemName: "arrow.up.forward.app")
}
.font(.headline)
})
} else {
Button(action: {
webView.load(URLRequest(url: URL(string: "https://testflight.apple.com/join/skaCe2L2")!))
}, label: {
HStack {
Text("前往 TestFlight")
Image(systemName: "arrow.up.right.square")
}
.font(.headline)
})
}
}
.buttonStyle(.borderedProminent)
.buttonBorderShape(.roundedRectangle(radius: 12))
}
}
}
Section {
TextField("页面链接", text: $webLinkInput, style: "field-page") {
if webLinkInput.isURL() {
Expand Down
5 changes: 0 additions & 5 deletions WatchBrowser Watch App/WebKit/WebViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ public final class WebViewNavigationDelegate: NSObject, WKNavigationDelegate {
dismissListsShouldRepresentWebView = true
return
}
if _slowPath(curl.contains("bilibili.com/")) && (UserDefaults(suiteName: "group.darockst")?.bool(forKey: "DCIsMeowBiliInstalled") ?? false) {
if let bvid = curl.split(separator: "bilibili.com/video/")[from: 1], bvid.hasPrefix("BV") {
WKExtension.shared().openSystemURL(URL(string: "https://darock.top/meowbili/video/\(bvid)")!)
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion WatchBrowser.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2800,7 +2800,7 @@
repositoryURL = "https://github.com/SDWebImage/SDWebImageSwiftUI";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 3.0.4;
minimumVersion = 2.2.7;
};
};
8CA7B84D2BE3E053004643FE /* XCRemoteSwiftPackageReference "SDWebImageWebPCoder" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImageSwiftUI",
"state" : {
"revision" : "5aa947356f4ea49a0c3b9968564267f6ea5abea7",
"version" : "3.1.2"
"revision" : "53573d6dd017e354c0e7d8f1c86b77ef1383c996",
"version" : "2.2.7"
}
},
{
Expand Down

0 comments on commit 8690a9e

Please sign in to comment.