diff --git a/wallabag_v2/init.php b/wallabag_v2/init.php index eaeae33..64a12b3 100644 --- a/wallabag_v2/init.php +++ b/wallabag_v2/init.php @@ -22,55 +22,52 @@ function init($host) { function hook_prefs_tab($args) { if ($args != "prefPrefs") return; - $w_user = $this->host->get($this, "wallabag_username"); - $w_pass = $this->host->get($this, "wallabag_password"); - $w_url = $this->host->get($this, "wallabag_url"); - $w_cid = $this->host->get($this, "wallabag_client_id"); - $w_csec = $this->host->get($this, "wallabag_client_secret"); - $w_access = $this->host->get($this, "wallabag_access_token"); + $w_user = $this->host->get($this, "wallabag_username"); + $w_pass = $this->host->get($this, "wallabag_password"); + $w_url = $this->host->get($this, "wallabag_url"); + $w_cid = $this->host->get($this, "wallabag_client_id"); + $w_csec = $this->host->get($this, "wallabag_client_secret"); + $w_access = $this->host->get($this, "wallabag_access_token"); - print "
+ " + ti.title + ""); - } else { - Notify.error("Error saving to Wallabag!: ("+ti.status+": "+ti.error+") "+ti.error_msg+""); - } - } else { - Notify.error("The Wallabag_v2 plugin needs to be configured. See the README for help", true); + (reply) => { + if (reply.status) { + if (reply.status=="200") { + Notify.info("Saved to Wallabag: " + reply.title + ""); + } else { + Notify.error("Error saving to Wallabag!: ("+reply.status+": "+reply.error+") "+reply.error_msg+""); } - } - }); + } else { + Notify.error("The Wallabag_v2 plugin needs to be configured. See the README for help", true); + } + }); } catch (e) { - exception_error("wallabagArticle", e); + Notify.error("wallabagArticle", e); } }