diff options
author | tyru | 2011-05-03 16:52:57 +0900 |
---|---|---|
committer | tyru | 2011-05-03 17:02:55 +0900 |
commit | 1b4d7961dff6d7abca01ded1f395f948917940d8 (patch) | |
tree | 7ae932451bc45c5643015abd2bfa336d6001eb72 /subscldr.js | |
parent | f7f80e4488f07db0fd481aeaaad5b1264962c60e (diff) | |
download | vimperator-plugins-1b4d7961dff6d7abca01ded1f395f948917940d8.tar.bz2 |
show clear message when a user needs to authenticate.
Diffstat (limited to 'subscldr.js')
-rw-r--r-- | subscldr.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/subscldr.js b/subscldr.js index 2c2805c..83a039c 100644 --- a/subscldr.js +++ b/subscldr.js @@ -131,6 +131,7 @@ liberator.plugins.subscldr = (function() { req.addEventListener("onSuccess", function(res) { liberator.log(res.responseText); res.getHTMLDocument(); + if (isLoginForm(res.doc)) throw "Please login to LDR to subscribe the feed."; subscribeInfo = getSubscribeInfo(res.doc); liberator.log(subscribeInfo.toSource()); }); @@ -191,6 +192,11 @@ liberator.plugins.subscldr = (function() { } + function isLoginForm(htmldoc) { + return htmldoc.getElementById('livedoor_id') && + htmldoc.getElementById('password'); + } + function getSubscribeInfo(htmldoc) { var subscribeInfo = { target_url: null, |