aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt
index 7d59f797..17d7ca81 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/JsActions.kt
@@ -5,14 +5,15 @@ import android.webkit.WebView
/**
* Created by Allan Wang on 2017-05-31.
*/
-enum class JsActions(body: String) {
+enum class JsActions(body: String) : InjectorContract {
/**
* Redirects to login activity if create account is found
* see [com.pitchedapps.frost.web.FrostJSI.loadLogin]
*/
- LOGIN_CHECK("document.getElementById('signup-button')&&Frost.loadLogin();");
+ LOGIN_CHECK("document.getElementById('signup-button')&&Frost.loadLogin();"),
+ EMPTY("");
val function = "!function(){$body}();"
- fun inject(webView: WebView, callback: ((String) -> Unit)? = null) = JsInjector(function).inject(webView, callback)
+ override fun inject(webView: WebView, callback: ((String) -> Unit)?) = JsInjector(function).inject(webView, callback)
} \ No newline at end of file