登录ui按钮支持JavaScript (#2558)
* LoginUI button supports running JavaScript * Update jsHelp.md * Update ruleHelp.md
This commit is contained in:
@@ -67,6 +67,15 @@ class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login, true) {
|
||||
it.root.onClick {
|
||||
if (rowUi.action.isAbsUrl()) {
|
||||
context?.openUrl(rowUi.action!!)
|
||||
} else {
|
||||
// JavaScript
|
||||
rowUi.action?.let {
|
||||
kotlin.runCatching {
|
||||
source.evalJS(it)
|
||||
}.onFailure {
|
||||
AppLog.put("LoginUI Button ${rowUi.name} JavaScript error", it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -133,4 +142,4 @@ class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login, true) {
|
||||
activity?.finish()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user