From 8bd0382047826ebb65de9f75ebe53a17bf3dc141 Mon Sep 17 00:00:00 2001 From: ryuslash Date: Tue, 6 Jul 2010 23:44:38 +0200 Subject: Added some conkerorrc stuff --- .conkerorrc | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) (limited to '.conkerorrc') diff --git a/.conkerorrc b/.conkerorrc index 28262da..e9fea2a 100644 --- a/.conkerorrc +++ b/.conkerorrc @@ -1,3 +1,102 @@ // -*- mode: javascript -*- require("new-tabs.js"); -require("clicks-in-new-buffer-button.js"); \ No newline at end of file +require("clicks-in-new-buffer.js"); + +// STYLE +/*let (sheet = get_home_directory()) { + sheet.append(".conkerorrc.d"); + sheet.append("stylesheets"); + sheet.append("tabs.css"); + register_user_stylesheet(make_uri(sheet)); +}*/ +function test(window) +{ + var test = window.tab2-bar; + window.buffers.container.removeChild(test); +} + +//add_hook("window_initialize_hook", test); + +// VARIABLES +// Make middle mouse button open new tab in background +clicks_in_new_buffer_target = OPEN_NEW_BUFFER_BACKGROUND; + +// WEBJUMPS +define_webjump("delicious", + "http://delicious.com/search?p=linux&lc=0&context=userposts%7Cslashed%7C", + $alternative="http://delicious.com/slashed"); +define_webjump("gmail", + "https://mail.google.com/mail/#search/%s"); +define_webjump("greader", + "http://www.google.com/reader/view/#search/%s/"); +define_webjump("github", + "http://github.com/search?q=%s", + $alternative="http://github.com/ryuslash/"); +define_webjump("archwiki", + "http://wiki.archlinux.org/index.php?search=%s"); +define_webjump("fedorawiki", + "https://fedoraproject.org/wiki/search=%s"); + +// FUNCTIONS +interactive("delicious-post", + "bookmark the page via delicious", + function (I) { + check_buffer(I.buffer, content_buffer); + let posturl = 'https://api.del.icio.us/v1/posts/add?&url=' + + encodeURIComponent( + load_spec_uri_string( + load_spec(I.buffer.top_frame))) + + "&description=" + + encodeURIComponent( + yield I.minibuffer.read( + $prompt = "name (required): ", + $initial_value = I.buffer.title)) + + "&tags=" + + encodeURIComponent( + yield I.minibuffer.read( + $prompt = "tags (space delimited): ")) + + "&extended=" + + encodeURIComponent( + yield I.minibuffer.read( + $prompt = "extended description: ")); + + try { + var content = yield send_http_request( + load_spec({uri: posturl})); + I.window.minibuffer.message(content.responseText); + } catch (e) { } + }); + +interactive("delicious-post-link", + "bookmar the link via delicious", + function (I) { + bo = yield read_browser_object(I); + mylink = load_spec_uri_string( + load_spec(encodeURIComponent(bo))); + check_buffer(I.buffer, content_buffer); + let postlinkurl = "https://api.del.icio.us/v1/posts/add?&yrl=" + + mylink + + "&description=" + + encodeURIComponent( + yield I.minibuffer.read( + $prompt = "name (required): ", + $initial_value = bo.textContent)) + + "&tags=" + + encodeURIComponent( + yield I.minibuffer.read( + $prompt = "tags (space delimited): ")) + + "&extended=" + + encodeURIComponent( + yield I.minibuffer.read( + $prompt = "extended description: ")); + + try { + var content = yield send_http_request( + load_spec({uri: postlinkurl})); + I.window.minibuffer.message(content.responseText); + } catch (e) { } + }, $browser_object = browser_object_links); + +// KEYMAPPINGS +define_key(default_global_keymap, "p", "delicious-post"); +define_key(default_global_keymap, "P", "delicious-post-link"); \ No newline at end of file -- cgit v1.2.3-54-g00ecf