From b46793938598358a9ab5249bd97e8999d5ac67e6 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 29 Dec 2012 16:54:16 +0100 Subject: Rename linkwave to markam --- conkeror/linkwave.js | 77 ---------------------------------------------------- conkeror/markam.js | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 conkeror/linkwave.js create mode 100644 conkeror/markam.js (limited to 'conkeror') diff --git a/conkeror/linkwave.js b/conkeror/linkwave.js deleted file mode 100644 index 75e3735..0000000 --- a/conkeror/linkwave.js +++ /dev/null @@ -1,77 +0,0 @@ -/* linkwave -- Store/retrieve/manage bookmarks - Copyright (C) 2012 Tom Willemsen - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - */ -/// Commentary: - -// A wrapper script that should allow conkeror to interface with -// linkwave. Does not yet allow searching through collected -// bookmarks, only adding new ones. - -/// Code: - -define_variable("linkwave_program", "linkwave", - "The location of the linkwave executable."); - -function linkwave_add_url(I, url, title) -{ // Add URL to linkwave, ask for a title (provide TITLE as a - // default), description and any number of tags. - let url_string = load_spec_uri_string(load_spec(url)); - let title = yield I.minibuffer.read($prompt="name (required): ", - $initial_value=title); - let description = yield I.minibuffer.read( - $prompt="extended description: " - ); - let tags = yield I.minibuffer.read( - $prompt="tags (comma delimited): " - ); - let command = linkwave_program + ' "' + url_string + '" "' + title - + '" "' + description + '" \'' - + tags.split(',').map(function (str) - { return str.trim(); }).join("' '") - + "'"; - yield shell_command(command); -} - -function linkwave_add(I) { - check_buffer(I.buffer, content_buffer); - let result = yield linkwave_add_url(I, I.buffer.top_frame, - I.buffer.title); - - if (!result) - I.window.minibuffer.message('Added to linkwave'); - else - I.window.minibuffer.message('Couldn\'t add to linkwave'); -} -interactive("linkwave-add", - "Bookmark the current page in linkwave", - linkwave_add); - -function linkwave_add_link(I) { - check_buffer(I.buffer, content_buffer); - bo = yield read_browser_object(I); - let result = yield linkwave_add_url(I, encodeURIComponent(bo), - bo.textContent); - - if (!result) - I.window.minibuffer.message('Added to linkwave'); - else - I.window.minibuffer.message('Couldn\'t add to linkwave'); -} -interactive("linkwave-add-link", - "Select and bookmark a link in linkwave", - linkwave_add_link); - -provide("linkwave"); diff --git a/conkeror/markam.js b/conkeror/markam.js new file mode 100644 index 0000000..2151b17 --- /dev/null +++ b/conkeror/markam.js @@ -0,0 +1,77 @@ +/* markam -- Store/retrieve/manage bookmarks + Copyright (C) 2012 Tom Willemsen + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ +/// Commentary: + +// A wrapper script that should allow conkeror to interface with +// markam. Does not yet allow searching through collected bookmarks, +// only adding new ones. + +/// Code: + +define_variable("markam_program", "markam", + "The location of the markam executable."); + +function markam_add_url(I, url, title) +{ // Add URL to markam, ask for a title (provide TITLE as a + // default), description and any number of tags. + let url_string = load_spec_uri_string(load_spec(url)); + let title = yield I.minibuffer.read($prompt="name (required): ", + $initial_value=title); + let description = yield I.minibuffer.read( + $prompt="extended description: " + ); + let tags = yield I.minibuffer.read( + $prompt="tags (comma delimited): " + ); + let command = markam_program + ' "' + url_string + '" "' + title + + '" "' + description + '" \'' + + tags.split(',').map(function (str) + { return str.trim(); }).join("' '") + + "'"; + yield shell_command(command); +} + +function markam_add(I) { + check_buffer(I.buffer, content_buffer); + let result = yield markam_add_url(I, I.buffer.top_frame, + I.buffer.title); + + if (!result) + I.window.minibuffer.message('Added to markam'); + else + I.window.minibuffer.message('Couldn\'t add to markam'); +} +interactive("markam-add", + "Bookmark the current page in markam", + markam_add); + +function markam_add_link(I) { + check_buffer(I.buffer, content_buffer); + bo = yield read_browser_object(I); + let result = yield markam_add_url(I, encodeURIComponent(bo), + bo.textContent); + + if (!result) + I.window.minibuffer.message('Added to markam'); + else + I.window.minibuffer.message('Couldn\'t add to markam'); +} +interactive("markam-add-link", + "Select and bookmark a link in markam", + markam_add_link); + +provide("markam"); -- cgit v1.3-2-g0d8e