diff options
author | 2014-12-10 17:10:17 +0100 | |
---|---|---|
committer | 2014-12-10 17:10:17 +0100 | |
commit | cbb7761b2a045a1506e0ba01fb7e26a1c75704b8 (patch) | |
tree | d5d1a1aa62cd57c834d1453504bdb4dbccd0c2f6 /conkeror/.conkerorrc/init.js | |
parent | fe2f5bd66a2d6815ac617f625f9f396e5f43f031 (diff) | |
download | dotfiles-cbb7761b2a045a1506e0ba01fb7e26a1c75704b8.tar.gz dotfiles-cbb7761b2a045a1506e0ba01fb7e26a1c75704b8.zip |
Add scuttle bookmarked widget
This widget shows whether or not the currently visited buffer is
bookmarked in scuttle. This function requires a patch to scuttle to
work.
Diffstat (limited to 'conkeror/.conkerorrc/init.js')
-rw-r--r-- | conkeror/.conkerorrc/init.js | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/conkeror/.conkerorrc/init.js b/conkeror/.conkerorrc/init.js index 9391810..50f35c0 100644 --- a/conkeror/.conkerorrc/init.js +++ b/conkeror/.conkerorrc/init.js @@ -38,6 +38,7 @@ let (home = get_home_directory()) { require("cdispass"); require("jira"); +require('scuttle'); define_browser_object_class( "history-url", null, @@ -218,6 +219,7 @@ add_hook("content_policy_hook", content_policy_bytype); add_hook("mode_line_hook", mode_line_adder(buffer_count_widget)); add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true); add_hook("mode_line_hook", mode_line_adder(downloads_status_widget)); +add_hook('mode_line_hook', mode_line_adder(scuttle_bookmarked_widget)); remove_hook("download_added_hook", open_download_buffer_automatically); @@ -324,65 +326,6 @@ register_user_stylesheet( ) ); -interactive("scuttle-post", - "bookmark the page via scuttle", - function (I) { - check_buffer(I.buffer, content_buffer); - let posturl = 'https://ryuslash.org/scuttle/api/posts_add.php?&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("scuttle-post-link", - "bookmark the link via scuttle", - function (I) { - var bo = yield read_browser_object(I); - var mylink = load_spec_uri_string( - load_spec(encodeURIComponent(bo))); - check_buffer(I.buffer, content_buffer); - let postlinkurl = 'https://ryuslash.org/scuttle/api/posts_add.php?&url=' + - 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); - define_key(default_global_keymap, "p", "scuttle-post"); define_key(default_global_keymap, "P", "scuttle-post-link"); |