From b3bd6392061366d1188771fcb5227597667043d5 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 17 Jun 2015 10:36:20 +0200 Subject: Add org-capture template for Conkeror --- conkeror/.conkerorrc/init.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'conkeror/.conkerorrc/init.js') diff --git a/conkeror/.conkerorrc/init.js b/conkeror/.conkerorrc/init.js index bb6a578..6e4acc6 100644 --- a/conkeror/.conkerorrc/init.js +++ b/conkeror/.conkerorrc/init.js @@ -99,6 +99,34 @@ interactive("org-store-link", + "kill ring", oni_org_store_link); +function org_capture(url, title, body, window, template) { + template = template || ''; + var cmd_str = 'emacsclient "org-protocol://capture:/'+template+'/'+url+'/'+title+'/'+body+'"'; + + if (window != null) { + window.minibuffer.message('Issuing ' + cmd_str); + } + + shell_command_blind(cmd_str); +} +interactive("org-capture", "Clip url, title, and selection to capture via org-protocol", + function (I) { + org_capture(encodeURIComponent(I.buffer.display_uri_string), + encodeURIComponent(I.buffer.document.title), + encodeURIComponent(I.buffer.top_frame.getSelection()), + I.window); + }); +interactive("org-capture-taiga", "Capture a Taiga task via org-protocol", + function(I) { + var title = I.buffer.document.getElementsByClassName('view-subject')[0].childNodes[0].nodeValue, + body = I.buffer.document.getElementsByClassName('markItUpEditor')[0].value; + org_capture(encodeURIComponent(I.buffer.display_uri_string), + encodeURIComponent(title), + encodeURIComponent(body), + I.window, + 'w'); + }); + interactive("find-url-from-history", "Find a page from history in the current buffer", "find-url", -- cgit v1.2.3-54-g00ecf