diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/af_redditimgur/init.php | 14 | ||||
-rw-r--r-- | plugins/digest/digest.js | 18 | ||||
-rw-r--r-- | plugins/import_export/import_export.js | 2 | ||||
-rw-r--r-- | plugins/import_export/init.php | 17 | ||||
-rw-r--r-- | plugins/instances/init.php | 7 | ||||
-rw-r--r-- | plugins/instances/instances.js | 10 | ||||
-rw-r--r-- | plugins/updater/updater.js | 2 |
7 files changed, 43 insertions, 27 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 2bb44f6d3..f2d5c7b67 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -40,7 +40,9 @@ class Af_RedditImgur extends Plugin { $img = $doc->createElement('img'); $img->setAttribute("src", $entry->getAttribute("href")); - $entry->parentNode->replaceChild($img, $entry); + $br = $doc->createElement('br'); + $entry->parentNode->insertBefore($img, $entry); + $entry->parentNode->insertBefore($br, $entry); $found = true; } @@ -66,7 +68,12 @@ class Af_RedditImgur extends Plugin { if (preg_match("/^http:\/\/i.imgur.com\/$token\./", $aentry->getAttribute("src"))) { $img = $doc->createElement('img'); $img->setAttribute("src", $aentry->getAttribute("src")); + + $br = $doc->createElement('br'); + $entry->parentNode->insertBefore($img, $entry); + $entry->parentNode->insertBefore($br, $entry); + $found = true; break; @@ -94,7 +101,12 @@ class Af_RedditImgur extends Plugin { $img = $doc->createElement('img'); $img->setAttribute("src", $aentry->getAttribute("href")); $entry->parentNode->insertBefore($doc->createElement('br'), $entry); + + $br = $doc->createElement('br'); + $entry->parentNode->insertBefore($img, $entry); + $entry->parentNode->insertBefore($br, $entry); + $found = true; } } diff --git a/plugins/digest/digest.js b/plugins/digest/digest.js index 6d90a9c8a..5815e60e5 100644 --- a/plugins/digest/digest.js +++ b/plugins/digest/digest.js @@ -29,7 +29,7 @@ function catchup_feed(feed_id, callback) { if (feed_id < 0) is_cat = "true"; // KLUDGE - var query = "?op=rpc&method=catchupFeed&feed_id=" + + var query = "op=rpc&method=catchupFeed&feed_id=" + feed_id + "&is_cat=" + is_cat; new Ajax.Request("backend.php", { @@ -71,7 +71,7 @@ function catchup_visible_articles(callback) { if (confirm(ngettext("Mark %d displayed article as read?", "Mark %d displayed articles as read?", ids.length).replace("%d", ids.length))) { - var query = "?op=rpc&method=catchupSelected" + + var query = "op=rpc&method=catchupSelected" + "&cmode=0&ids=" + param_escape(ids); new Ajax.Request("backend.php", { @@ -91,7 +91,7 @@ function catchup_visible_articles(callback) { function catchup_article(article_id, callback) { try { - var query = "?op=rpc&method=catchupSelected" + + var query = "op=rpc&method=catchupSelected" + "&cmode=0&ids=" + article_id; new Ajax.Request("backend.php", { @@ -172,7 +172,7 @@ function update(callback) { window.clearTimeout(_update_timeout); new Ajax.Request("backend.php", { - parameters: "?op=digest&method=digestinit", + parameters: "op=digest&method=digestinit", onComplete: function(transport) { fatal_error_check(transport); parse_feeds(transport); @@ -223,7 +223,7 @@ function view(article_id) { }, 500); new Ajax.Request("backend.php", { - parameters: "?op=digest&method=digestgetcontents&article_id=" + + parameters: "op=digest&method=digestgetcontents&article_id=" + article_id, onComplete: function(transport) { fatal_error_check(transport); @@ -331,7 +331,7 @@ function viewfeed(feed_id, offset, replace, no_effects, no_indicator, callback) if (!offset) $("headlines").scrollTop = 0; - var query = "backend.php?op=digest&method=digestupdate&feed_id=" + + var query = "op=digest&method=digestupdate&feed_id=" + param_escape(feed_id) + "&offset=" + offset + "&seq=" + _update_seq; @@ -669,7 +669,7 @@ function parse_headlines(transport, replace, no_effects) { function init_second_stage() { try { new Ajax.Request("backend.php", { - parameters: "backend.php?op=digest&method=digestinit&init=1", + parameters: "op=digest&method=digestinit&init=1", onComplete: function(transport) { parse_feeds(transport); Element.hide("overlay"); @@ -705,7 +705,7 @@ function toggle_mark(img, id) { try { - var query = "?op=rpc&id=" + id + "&method=mark"; + var query = "op=rpc&id=" + id + "&method=mark"; if (!img) return; @@ -734,7 +734,7 @@ function toggle_pub(img, id, note) { try { - var query = "?op=rpc&id=" + id + "&method=publ"; + var query = "op=rpc&id=" + id + "&method=publ"; if (note != undefined) { query = query + "¬e=" + param_escape(note); diff --git a/plugins/import_export/import_export.js b/plugins/import_export/import_export.js index 86b0458be..780f6bfc7 100644 --- a/plugins/import_export/import_export.js +++ b/plugins/import_export/import_export.js @@ -17,7 +17,7 @@ function exportData() { notify_progress("Loading, please wait..."); new Ajax.Request("backend.php", { - parameters: "?op=pluginhandler&plugin=import_export&method=exportrun&offset=" + exported, + parameters: "op=pluginhandler&plugin=import_export&method=exportrun&offset=" + exported, onComplete: function(transport) { try { var rv = JSON.parse(transport.responseText); diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index 5a3051edb..ab47288b3 100644 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -9,7 +9,7 @@ class Import_Export extends Plugin implements IHandler { $this->host = $host; $host->add_hook($host::HOOK_PREFS_TAB, $this); - $host->add_command("xml-import", "USER FILE: import articles from XML", $this); + $host->add_command("xml-import", "import articles from XML", $this, ":", "FILE"); } function about() { @@ -19,21 +19,18 @@ class Import_Export extends Plugin implements IHandler { } function xml_import($args) { - array_shift($args); - $username = $args[count($args) - 2]; - $filename = $args[count($args) - 1]; - - if (!$username) { - print "error: please specify username.\n"; - return; - } + $filename = $args['xml_import']; if (!is_file($filename)) { print "error: input filename ($filename) doesn't exist.\n"; return; } + _debug("please enter your username:"); + + $username = db_escape_string($this->link, trim(read_stdin())); + _debug("importing $filename for user $username...\n"); $result = db_query($this->link, "SELECT id FROM ttrss_users WHERE login = '$username'"); @@ -382,7 +379,7 @@ class Import_Export extends Plugin implements IHandler { } print "<p>" . - vsprintf(__("Finished: ")). + __("Finished: "). vsprintf(ngettext("%d article processed, ", "%d articles processed, ", $num_processed), $num_processed). vsprintf(ngettext("%d imported, ", "%d imported, ", $num_imported), $num_imported). vsprintf(ngettext("%d feed created.", "%d feeds created.", $num_feeds_created), $num_feeds_created). diff --git a/plugins/instances/init.php b/plugins/instances/init.php index 6a7f7003a..7f822c7bf 100644 --- a/plugins/instances/init.php +++ b/plugins/instances/init.php @@ -442,5 +442,12 @@ class Instances extends Plugin implements IHandler { return; } + function genHash() { + $hash = sha1(uniqid(rand(), true)); + + print json_encode(array("hash" => $hash)); + } + + } ?> diff --git a/plugins/instances/instances.js b/plugins/instances/instances.js index 4a60692b3..f699acf72 100644 --- a/plugins/instances/instances.js +++ b/plugins/instances/instances.js @@ -11,7 +11,7 @@ function addInstance() { style: "width: 600px", regenKey: function() { new Ajax.Request("backend.php", { - parameters: "?op=rpc&method=genHash", + parameters: "op=pluginhandler&plugin=instances&method=genHash", onComplete: function(transport) { var reply = JSON.parse(transport.responseText); if (reply) @@ -47,7 +47,7 @@ function addInstance() { function updateInstanceList(sort_key) { new Ajax.Request("backend.php", { - parameters: "?op=pref-instances&sort=" + param_escape(sort_key), + parameters: "op=pluginhandler&plugin=instances&sort=" + param_escape(sort_key), onComplete: function(transport) { dijit.byId('instanceConfigTab').attr('content', transport.responseText); selectTab("instanceConfig", true); @@ -62,7 +62,7 @@ function editInstance(id, event) { selectTableRows('prefInstanceList', 'none'); selectTableRowById('LIRR-'+id, 'LICHK-'+id, true); - var query = "backend.php?op=pref-instances&method=edit&id=" + + var query = "backend.php?op=pluginhandler&plugin=instances&method=edit&id=" + param_escape(id); if (dijit.byId("instanceEditDlg")) @@ -74,7 +74,7 @@ function editInstance(id, event) { style: "width: 600px", regenKey: function() { new Ajax.Request("backend.php", { - parameters: "?op=rpc&method=genHash", + parameters: "op=pluginhandler&plugin=instances&method=genHash", onComplete: function(transport) { var reply = JSON.parse(transport.responseText); if (reply) @@ -124,7 +124,7 @@ function removeSelectedInstances() { if (ok) { notify_progress("Removing selected instances..."); - var query = "?op=pref-instances&method=remove&ids="+ + var query = "op=pluginhandler&plugin=instances&method=remove&ids="+ param_escape(sel_rows.toString()); new Ajax.Request("backend.php", { diff --git a/plugins/updater/updater.js b/plugins/updater/updater.js index 17452d734..40fcc871b 100644 --- a/plugins/updater/updater.js +++ b/plugins/updater/updater.js @@ -16,7 +16,7 @@ function updateSelf() { notify_progress("Loading, please wait...", true); new Ajax.Request("backend.php", { - parameters: "?op=pluginhandler&plugin=updater&method=performUpdate&step=" + step + + parameters: "op=pluginhandler&plugin=updater&method=performUpdate&step=" + step + "¶ms=" + param_escape(JSON.stringify(dialog.attr("update-params"))), onComplete: function(transport) { try { |