diff --git a/just/just.fnl b/just/just.fnl index d4ef7ac..b75d4fd 100644 --- a/just/just.fnl +++ b/just/just.fnl @@ -72,6 +72,28 @@ progress, trough { )) +(fn handle-webview-properties [self pspec bus] + (if (= pspec.name "uri") + (bus:publish + :url-changed self.uri) + + (and (= pspec.name "title") + (> (# self.title) 0)) + (bus:publish + :title-changed + self.title) + + (= pspec.name + "estimated-load-progress") + (bus:publish + :loading-progress + self.estimated_load_progress) + + (= pspec.name "is-loading") + (bus:publish + :loading? self.is_loading) + )) + (let [current-url "https://terse.telent.net/admin/stream" bus (event-bus) r {} @@ -108,27 +130,7 @@ progress, trough { }) webview (WebKit2.WebView { :on_notify - (fn [self pspec c] - (if (= pspec.name "uri") - (bus:publish - :url-changed self.uri) - - (and (= pspec.name "title") - (> (# self.title) 0)) - (bus:publish - :title-changed - self.title) - - (= pspec.name - "estimated-load-progress") - (bus:publish - :loading-progress - self.estimated_load_progress) - - (= pspec.name "is-loading") - (bus:publish - :loading? self.is_loading) - )) + #(handle-webview-properties $1 $2 bus) }) back (doto (Gtk.Button {