From c789688f621436ae1eba4a2015a144d2372b40fb Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Tue, 27 Nov 2012 11:11:34 +0100 Subject: .conkerorrc/init.js --- .conkerorrc/init.js | 52 +++------------------------------------------------- 1 file changed, 3 insertions(+), 49 deletions(-) (limited to '.conkerorrc/init.js') diff --git a/.conkerorrc/init.js b/.conkerorrc/init.js index f4818d8..a165cb6 100644 --- a/.conkerorrc/init.js +++ b/.conkerorrc/init.js @@ -1,10 +1,11 @@ require("content-policy.js"); require("favicon"); -var linkwave_program = "/home/slash/var/src/linkwave/src/linkwave"; - +load_paths.push("file:///home/slash/var/src/linkwave/conkeror/"); theme_load_paths.push("/home/slash/.conkerorrc/themes/"); +require("linkwave"); + define_browser_object_class( "history-url", null, function (I, prompt) { @@ -46,53 +47,6 @@ function oni_escape(str) { return str.replace(/(["$`])/g, '\\$1'); } -function oni_linkwave_add(I) { - check_buffer(I.buffer, content_buffer); - let url = - load_spec_uri_string(load_spec(I.buffer.top_frame)); - let title = yield I.minibuffer.read( - $prompt = "name (required): ", - $initial_value = I.buffer.title); - // let tags = escape(yield I.minibuffer.read( - // $prompt = "tags (space delimited): ")); - let description = yield I.minibuffer.read( - $prompt = "extended description: "); - let command = linkwave_program + ' "' + url + '" "' + title + '" "' - + description + '"'; - let result = yield shell_command(command); - - if (!result) - I.window.minibuffer.message('Added to linkwave'); - else - I.window.minibuffer.message('Couldn\'t add to linkwave'); -} -interactive("linkwave-add", "Bookmark the page in linkwave", - oni_linkwave_add); - -function oni_linkwave_add_link(I) { - bo = yield read_browser_object(I); - let url = load_spec_uri_string( - load_spec(encodeURIComponent(bo))); - check_buffer(I.buffer, content_buffer); - let title = yield I.minibuffer.read( - $prompt = "name (required): ", - $initial_value = bo.textContent); - // let tags = escape(yield I.minibuffer.read( - // $prompt = "tags (space delimited): ")); - let description = yield I.minibuffer.read( - $prompt = "extended description: "); - let command = linkwave_program + ' "' + url + '" "' + title + '" "' - + description + '"'; - let result = yield shell_command(command); - - if (!result) - I.window.minibuffer.message('Added to linkwave'); - else - I.window.minibuffer.message('Couldn\'t add to linkwave'); -} -interactive("linkwave-add-link", "Bookmark the a link in linkwave", - oni_linkwave_add_link); - function oni_org_store_link(I) { var cmd_str = 'emacsclient \"org-protocol://store-link://' + encodeURIComponent(I.buffer.display_uri_string) + '/' -- cgit v1.2.3-54-g00ecf