librelist archives

« back to archive

[PATCH] feedly-mode

[PATCH] feedly-mode

From:
Artur Malabarba
Date:
2013-10-23 @ 18:02
Implement a page-mode for cloud.feedly.com.

---
 modules/page-modes/feedly.js | 61 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 modules/page-modes/feedly.js

diff --git a/modules/page-modes/feedly.js b/modules/page-modes/feedly.js
new file mode 100644
index 0000000..a132ab2
--- /dev/null
+++ b/modules/page-modes/feedly.js
@@ -0,0 +1,61 @@
+/**
+ * (C) Copyright 2013 Artur Malabarba
+ *
+ * Use, modification, and distribution are subject to the terms specified in the
+ * COPYING file.
+**/
+
+require("content-buffer.js");
+
+define_keymap("feedly_keymap");
+
+// Help menu
+define_key(feedly_keymap, "?", null, $fallthrough); // keyboard shortcuts
+
+// Navigation
+define_key(feedly_keymap, "h", null, $fallthrough); // home
+define_key(feedly_keymap, "g", null, $fallthrough); // magic bar
+define_key(feedly_keymap, "l", null, $fallthrough); // saved article
+define_key(feedly_keymap, "a", null, $fallthrough); // add content
+define_key(feedly_keymap, "r", null, $fallthrough); // refresh
+define_key(feedly_keymap, "J", null, $fallthrough); // next feed/category
+define_key(feedly_keymap, "K", null, $fallthrough); // previous feed/category
+
+// Lists
+define_key(feedly_keymap, "j", null, $fallthrough); // inline next article
+define_key(feedly_keymap, "k", null, $fallthrough); // inline previous
+define_key(feedly_keymap, "n", null, $fallthrough); // select next article
+define_key(feedly_keymap, "p", null, $fallthrough); // select previous
+define_key(feedly_keymap, "o", null, $fallthrough); // inline/close
+define_key(feedly_keymap, "A", null, $fallthrough); // mark all as read
+define_key(feedly_keymap, "v", null, $fallthrough); // view original new tab
+// Uncomment the following to have conkeror re-focus the feedly buffer
+// after the new tab is opened by the "v" command.
+//define_key(feedly_keymap, "v", "wait-then-go-back", $fallthrough);
+
+// Selected Article
+define_key(feedly_keymap, "m", null, $fallthrough); // toggle mark as read
+define_key(feedly_keymap, "x", null, $fallthrough); // minimize and hide
+define_key(feedly_keymap, "s", null, $fallthrough); // save for later
+define_key(feedly_keymap, "b", null, $fallthrough); // buffer
+define_key(feedly_keymap, "c", null, $fallthrough); // clip to evernote
+define_key(feedly_keymap, "V", null, $fallthrough); // preview
+
+interactive("wait-then-go-back",
+    "Wait 150 ms, then move back to the current buffer.",
+    function (I) {
+        var win = I.window;
+        var cur = win.buffers.buffer_list.indexOf(win.buffers.current);
+        win.setTimeout(function () {
+            win.buffers.current = win.buffers.get_buffer(cur);
+        }, 150);
+    });
+
+define_keymaps_page_mode("feedly-mode",
+    build_url_regexp($domain = "cloud.feedly"),
+    { normal: feedly_keymap },
+    $display_name = "Feedly");
+
+page_mode_activate(feedly_mode);
+
+provide("feedly");
-- 
1.8.4

Re: [conkeror] [PATCH] feedly-mode

From:
John J. Foerch
Date:
2013-10-27 @ 18:30
On Wed, Oct 23, 2013 at 07:02:23PM +0100, Artur Malabarba wrote:
> Implement a page-mode for cloud.feedly.com.
> 

Thanks Artur!  I'm removing "wait-then-go-back" from the patch, as this
kind of thing is best left for users to add to their rc if they want it.
It can be given on the page-mode's wiki page.  It should also be prefixed
with "feedly-", as that is how we manage the main namespace.

Also, the presence of an arbitrary delay (150 ms) is a red flag for a hack
that will not work reliably in all cases.  It's probably not the best way
to do what you want to do, or if it is, this is why it should be left to
users' rc scripts.

Will have this merged momentarily.  Please add a new page for this
page-mode to the wiki, following the pattern of those already listed at
http://conkeror.org/PageModes

-- 
John Foerch

Re: [conkeror] [PATCH] feedly-mode

From:
Bruce Connor
Date:
2013-10-27 @ 20:46
No problem, Thanks for the great software.

I just added the wiki page. Should I mention there that the mode is not yet
included?

Re: [conkeror] [PATCH] feedly-mode

From:
John J. Foerch
Date:
2013-10-27 @ 21:06
On Sun, Oct 27, 2013 at 08:46:40PM +0000, Bruce Connor wrote:
> No problem, Thanks for the great software.
> 
> I just added the wiki page. Should I mention there that the mode is not yet
> included?
> 
> 

No need.  It is now in master branch of Conkeror's official repository,
and that is the version that the documentation targets.

-- 
John Foerch