diff options
author | Andrew Dolgov <[email protected]> | 2010-11-08 13:11:56 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2010-11-08 13:15:00 +0300 |
commit | 8801fb017ccd6e2c052ab449eed3ee1eb5b7e982 (patch) | |
tree | 97ce0dfd050cb22fc999c546bb9a9b8ce5277e89 /functions.js | |
parent | 811bea05221c3704037eaba860a70f42eb45994b (diff) |
replace old-style published feed with universal secretkey-based approach used for all feeds; do not allow user/pass handling in generated feed urls; bump schema
Diffstat (limited to 'functions.js')
-rw-r--r-- | functions.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/functions.js b/functions.js index f3ae1965e..f3756051f 100644 --- a/functions.js +++ b/functions.js @@ -2216,3 +2216,48 @@ function quickAddCat(select) { exception_error("quickAddCat", e); } } + +function genUrlChangeKey(feed, is_cat) { + + try { + var ok = confirm(__("Generate new syndication address for this feed?")); + + if (ok) { + + notify_progress("Trying to change address...", true); + + var query = "?op=rpc&subop=regenFeedKey&id=" + param_escape(feed) + + "&is_cat=" + param_escape(is_cat); + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + var new_link = transport.responseXML.getElementsByTagName("link")[0]; + + var e = $('gen_feed_url'); + + if (new_link) { + + new_link = new_link.firstChild.nodeValue; + + e.innerHTML = e.innerHTML.replace(/\&key=.*$/, + "&key=" + new_link); + + e.href = e.href.replace(/\&key=.*$/, + "&key=" + new_link); + + new Effect.Highlight(e); + + notify(''); + + } else { + notify_error("Could not change feed URL."); + } + } }); + } + } catch (e) { + exception_error("genUrlChangeKey", e); + } + return false; +} + |