summaryrefslogtreecommitdiffstats
path: root/conkeror
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-06-17 10:36:20 +0200
committerGravatar Tom Willemse2015-06-17 10:36:20 +0200
commitb3bd6392061366d1188771fcb5227597667043d5 (patch)
tree5812255dc2828d3e7cd31ce65dba2fda06f0455b /conkeror
parent1e46767718fd70f974036041cee59a139c7c3997 (diff)
downloaddotfiles-b3bd6392061366d1188771fcb5227597667043d5.tar.gz
dotfiles-b3bd6392061366d1188771fcb5227597667043d5.zip
Add org-capture template for Conkeror
Diffstat (limited to 'conkeror')
-rw-r--r--conkeror/.conkerorrc/init.js28
1 files changed, 28 insertions, 0 deletions
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",