-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e12b76b
commit 42b3c5d
Showing
9 changed files
with
160 additions
and
83 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Submodule fcitx5-webview
updated
6 files
+2 −0 | include/webview_candidate_window.hpp | |
+18 −1 | page/api.ts | |
+10 −0 | page/global.d.ts | |
+43 −0 | page/plugin.ts | |
+1 −0 | src/platform/macos.mm | |
+11 −2 | src/webview_candidate_window.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import Logging | ||
import SwiftUI | ||
|
||
struct PluginOptionView: OptionView { | ||
let label: String | ||
let overrideLabel: String? = nil | ||
@ObservedObject var model: PluginOption | ||
@State private var availablePlugins = [String]() | ||
|
||
var body: some View { | ||
Picker("", selection: $model.value) { | ||
ForEach(availablePlugins, id: \.self) { plugin in | ||
Text(plugin) | ||
} | ||
}.onAppear { | ||
for fileName in getFileNamesWithExtension(pluginDir.localPath()) { | ||
let url = pluginDir.appendingPathComponent(fileName) | ||
if !url.isDirectory { | ||
continue | ||
} | ||
let packageJsonURL = url.appendingPathComponent("package.json") | ||
if let json = readJSON(packageJsonURL) { | ||
if json["license"].stringValue.hasPrefix("GPL-3.0") { | ||
availablePlugins.append(fileName) | ||
} else { | ||
FCITX_WARN("Rejecting plugin \(fileName) which is not GPLv3") | ||
} | ||
} else { | ||
FCITX_WARN("Invalid package.json for plugin \(fileName)") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters