I found this at: http://tsdh.wordpress.com/2008/11/14/calling-org-remember-from-inside-conkeror/
110 lines
No EOL
4.5 KiB
JavaScript
110 lines
No EOL
4.5 KiB
JavaScript
// conkerorrc -*- Javascript -*-
|
|
// Configuration for Conkeror web browser.
|
|
// To use as my configuration, I did the following command:
|
|
// /bin/ln -sf `pwd`/conkerorrc $HOME/.conkerorrc
|
|
|
|
|
|
// Copyright © 2009, 2010, 2013, Bradley M. Kuhn
|
|
|
|
// The copyright holders wish that this document could be placed into the public
|
|
// domain. However, should such a public domain dedication not be possible, the
|
|
// copyright holders grant a waiver and/or license under the terms of CC0-1.0, as
|
|
// published by Creative Commons, Inc. A copy of CC0-1.0 can be found in the
|
|
// same repository as this README.md file under the filename CC0-1.0.txt. If
|
|
// this document has been separated from the repository, a copy of CC0-1.0 can
|
|
// be found on Creative Commons' website at:
|
|
// http://creativecommons.org/publicdomain/zero/1.0/legalcode).
|
|
|
|
session_pref("xpinstall.whitelist.required", false);
|
|
define_key(default_global_keymap, "C-o", "cmd_scrollPageUp");
|
|
define_key(default_base_keymap, "C-o", "cmd_scrollPageUp");
|
|
// define_key(default_global_keymap, "C-j", "ns-toggle-temp");
|
|
|
|
url_completion_use_bookmarks = true;
|
|
url_completion_use_history = false;
|
|
|
|
define_webjump("epguide","http://www.epguides.com/%s");
|
|
define_webjump("message_on_gmane","http://news.gmane.org/find-root.php?message_id=%s");
|
|
webjumps.m = webjumps.message_on_gmane;
|
|
|
|
url_remoting_fn = load_url_in_new_buffer;
|
|
dowload_buffer_automatic_open_target = OPEN_NEW_BUFFER_BACKGROUND;
|
|
|
|
user_pref("font.name.monospace.x-western", "Bitstream Vera Sans Mono");
|
|
user_pref("font.name.sans-serif.x-western", "Bitstream Vera Sans");
|
|
user_pref("font.name.serif.x-western", "Bitstream Vera Sans");
|
|
user_pref("browser.display.use_document_fonts", 0);
|
|
user_pref("font.default.x-western", "serif");
|
|
user_pref("font.minimum-size.x-western", 17);
|
|
user_pref("font.size.fixed.x-western", 17);
|
|
user_pref("font.size.variable.x-western", 17);
|
|
|
|
session_auto_save_file = "auto-save-session.conkeror";
|
|
|
|
hints_auto_exit_delay = 400;
|
|
hints_ambiguous_auto_exit_delay = 2000;
|
|
|
|
// require("noscript");
|
|
// While we wait for noscript support to be fixed:
|
|
// C-j toggles Javascript support on and off, displays status of it in minibuffer
|
|
|
|
// The below first creates a mode_line_hook to always display in the modeline if
|
|
// Javascript is enabled.
|
|
|
|
require("pref");
|
|
var global_update_mode_line_for_javascript;
|
|
var global_watch_mode_line_for_javascript;
|
|
|
|
function javascript_status_widget (window) {
|
|
this.class_name = "javascript-status-widget";
|
|
text_widget.call(this, window);
|
|
var obj = this;
|
|
this.do_update = function () {
|
|
obj.update();
|
|
watch_pref("javascript.enabled", obj.do_update);
|
|
}
|
|
global_update_mode_line_for_javascript =
|
|
function () { obj.do_update();};
|
|
global_watch_mode_line_for_javascript =
|
|
function () { watch_pref("javascript.enabled", obj.do_update);};
|
|
global_watch_mode_line_for_javascript();
|
|
}
|
|
javascript_status_widget.prototype = {
|
|
constructor: javascript_status_widget,
|
|
__proto__: text_widget.prototype,
|
|
update: function () {
|
|
this.view.text = (get_pref("javascript.enabled")) ?
|
|
"Javascript: ENABLED!" : "";
|
|
}
|
|
};
|
|
add_hook("mode_line_hook", mode_line_adder(javascript_status_widget), true);
|
|
// Then, the maps C-j to toggle javascript on and off.
|
|
interactive("toggle-js", "toggle javascript",
|
|
function (I) {
|
|
var js_pref = "javascript.enabled";
|
|
var js_val = get_pref(js_pref);
|
|
js_val = ! js_val;
|
|
session_pref(js_pref, js_val);
|
|
I.window.minibuffer.show("JavaScript Status: " + (js_val ? "on" : "off"));
|
|
global_update_mode_line_for_javascript();
|
|
});
|
|
define_key(default_global_keymap, "C-j", "toggle-js");
|
|
|
|
// org-protocol, for org-mode remembring via conkerror
|
|
// Found this at: http://tsdh.wordpress.com/2008/11/14/calling-org-remember-from-inside-conkeror/
|
|
function org_remember(url, title, text, window) {
|
|
var eurl = encodeURIComponent(url);
|
|
var etitle = encodeURIComponent(title);
|
|
var etext = encodeURIComponent(text);
|
|
var cmd_str = "emacsclient -c org-protocol://remember://" + eurl + "/" + etitle + "/" + etext;
|
|
window.minibuffer.message("Issuing " + cmd_str);
|
|
shell_command_blind(cmd_str);
|
|
}
|
|
|
|
interactive("org-remember", "Remember the current url with org-remember",
|
|
function (I) {
|
|
org_remember(I.buffer.display_uri_string,
|
|
I.buffer.document.title,
|
|
I.buffer.top_frame.getSelection(),
|
|
I.window);
|
|
}); |