From 605a08c2e2e8634263d7626cf7471310add3acb2 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Tue, 6 Jun 2017 23:24:06 -0700 Subject: Preparing preferences --- .../com/pitchedapps/frost/injectors/JsActions.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt (limited to 'app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt new file mode 100644 index 00000000..7d59f797 --- /dev/null +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt @@ -0,0 +1,18 @@ +package com.pitchedapps.frost.injectors + +import android.webkit.WebView + +/** + * Created by Allan Wang on 2017-05-31. + */ +enum class JsActions(body: String) { + /** + * Redirects to login activity if create account is found + * see [com.pitchedapps.frost.web.FrostJSI.loadLogin] + */ + LOGIN_CHECK("document.getElementById('signup-button')&&Frost.loadLogin();"); + + val function = "!function(){$body}();" + + fun inject(webView: WebView, callback: ((String) -> Unit)? = null) = JsInjector(function).inject(webView, callback) +} \ No newline at end of file -- cgit v1.2.3