changes
authorJoerg Jaspert <joerg@ganneff.de>
Thu, 11 Apr 2013 14:39:22 +0000 (16:39 +0200)
committerJoerg Jaspert <joerg@ganneff.de>
Thu, 11 Apr 2013 14:39:22 +0000 (16:39 +0200)
13 files changed:
.conkerorrc/basics.js
.conkerorrc/keybindings.js
.conkerorrc/modeline.js
.conkerorrc/reopenclosedtab.js [new file with mode: 0644]
.conkerorrc/theme.js [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/content-buffer-input.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/eye-guide.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/hints--url-panel.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/minibuffer.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/mode-line.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/new-tabs.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/tab-bar.css [new file with mode: 0644]
.conkerorrc/themes/tommytxtruong/theme.json [new file with mode: 0644]

index a275b35..657b00c 100644 (file)
@@ -1,9 +1,23 @@
+//mozrepl
+user_pref('extensions.mozrepl.autoStart', true);
+if ('@hyperstruct.net/mozlab/mozrepl;1' in Cc) {
+  let mozrepl = Cc['@hyperstruct.net/mozlab/mozrepl;1']
+    .getService(Ci.nsIMozRepl);
+  if (! mozrepl.isActive())
+    mozrepl.start(4242);
+}
+let (mozrepl_init = get_home_directory()) {
+    mozrepl_init.appendRelativePath(".mozrepl-conkeror.js");
+    session_pref('extensions.mozrepl.initUrl', make_uri(mozrepl_init).spec);
+}
+
 //allow for 'contrib' stuff
 load_paths.unshift("chrome://conkeror-contrib/content/");
 
 // the default page for new buffers.
 homepage = "about:blank";
 
+require("favicon.js");
 // give me new tabs; open buffers (tabs) in the background
 require("new-tabs.js");
 require("clicks-in-new-buffer.js");
@@ -11,20 +25,22 @@ require("page-modes/google-search-results.js");
 require("page-modes/wikipedia.js");
 require("index-webjump.js");
 require("extensions/adblockplus.js");
-// require("extensions/noscript.js");
+//require("extensions/noscript.js");
 require("session.js");
 require("block-content-focus-change.js");
-require("favicon");
+require("daemon.js");
+require("dom-inspector.js");
 
-// require("github");
-require("gmail");
+// Auto load the auto-save session when conkeror starts
+session_auto_save_auto_load = true;
 
 // Some settings
-session_auto_save_auto_load = "prompt";
 url_remoting_fn = load_url_in_new_buffer;
 read_buffer_show_icons = true;
 hints_display_url_panel = true;
-
+tab_bar_show_icon = true;
+tab_bar_show_index = true;
+can_kill_last_buffer = false;
 
 // auto completion in the minibuffer
 require("minibuffer-completion.js");
@@ -35,6 +51,16 @@ url_completion_use_bookmarks = true;
 // use emacs as editor
 editor_shell_command = "emacsclient -c";
 
+require("github.js");
+require("newsblur.js");
+
+// gmail-mode
+require("page-modes/gmail.js");
+define_key(gmail_keymap, "v", null, $fallthrough);
+define_key(gmail_keymap, "space", null, $fallthrough);
+define_key(gmail_keymap, "S-space", null, $fallthrough);
+define_key(gmail_keymap, "page_up", null, $fallthrough);
+define_key(gmail_keymap, "page_down", null, $fallthrough);
 
 // load urls from the command line in new buffers instead
 // of new windows.
@@ -76,11 +102,23 @@ session_pref("signon.expireMasterPassword", false);
 session_pref("signon.SignonFileName", "signons.txt");
 Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager); // init
 
+
+// Allow installing extension from any source
+session_pref("xpinstall.whitelist.required", false);
+
+// form
+user_pref("signon.prefillForms", true);
+user_pref("signon.autofillForms", true);
+user_pref("signon.rememberSignons", true);
+
 // Allow extensions (like Adblock Plus) to be installed
 session_pref("xpinstall.whitelist.required", false);
 
-//session_pref("font.minimum-size.x-western", 16);
-//session_pref("font.name.serif.x-western", "Gentium");
+session_pref("font.minimum-size.x-western", 14);
+session_pref("font.name.serif.x-western", "Bitstream Vera Serif");
+session_pref("font.name.monospace.x-western", "Bitstream Vera Sans Mono");
+session_pref("font.name.sans-serif.x-western", "Bitstream Vera Sans");
+session_pref("browser.display.use_document_fonts", 0);
 
 // When true image documents will be automatically scaled to fit the viewport. 
 session_pref("browser.enable_automatic_image_resizing", true);
@@ -152,3 +190,58 @@ function content_delay_do_initial_load (b) {
 
 add_hook("create_buffer_early_hook", content_delay_init);
 add_hook("select_buffer_hook", content_delay_do_initial_load);
+
+//viewmarks extension, to manage bookmarks
+interactive("viewmarks",
+    "Open ViewMarks window.",
+    function (I) {
+        make_chrome_window('chrome://viewmarks/content/viewmark.xul');
+    });
+
+//colors-toggle
+//replace darken-page mode
+interactive("colors-toggle", "toggle between document and forced colors",
+            function (I) {
+                var p = "browser.display.use_document_colors";
+                if (get_pref(p)) {
+                    session_pref("browser.active_color", "yellow");
+                    session_pref("browser.anchor_color", "#4986dd");
+                    session_pref("browser.display.background_color", "#0C141E");
+                    session_pref("browser.display.foreground_color", "#A0AFA8");
+                    session_pref("browser.display.focus_background_color", "green"); // ?
+                    session_pref("browser.display.focus_text_color", "red"); // ?
+                    session_pref("browser.visited_color", "#805DBB");
+                    session_pref(p, false);
+                } else {
+                    session_pref("browser.active_color", "#EE0000");
+                    session_pref("browser.anchor_color", "#0000EE");
+                    session_pref("browser.display.background_color", "#FFFFFF");
+                    session_pref("browser.display.foreground_color", "#000000");
+                    session_pref("browser.display.focus_background_color", "#117722");
+                    session_pref("browser.display.focus_text_color", "#FFFFFF");
+                    session_pref("browser.visited_color", "#551A8B");
+                    session_pref(p, true);
+                }
+            });
+define_key(content_buffer_normal_keymap, "A-d", "colors-toggle");
+
+// get tiny url for the current page
+// press * q and then c to generate and copy the tinyurl into clipboard
+define_browser_object_class(
+    "tinyurl", "Get a tinyurl for the current page",
+    function (I, prompt) {
+        check_buffer(I.buffer, content_buffer);
+        let createurl = 'http://tinyurl.com/api-create.php?url=' +
+            encodeURIComponent(
+                load_spec_uri_string(
+                    load_spec(I.buffer.top_frame)));
+        try {
+            var content = yield send_http_request(
+                load_spec({uri: createurl}));
+            yield co_return(content.responseText);
+        } catch (e) { }
+    });
+define_key(content_buffer_normal_keymap, "* q", "browser-object-tinyurl");
+
+/// open remote url in new tab not new frame
+url_remoting_fn = load_url_in_new_buffer;
index 98cc7ad..4d1daa7 100644 (file)
@@ -5,3 +5,110 @@
 //define_key(content_buffer_normal_keymap, "C-w", "kill-current-buffer");
 define_key(content_buffer_normal_keymap, "M-left", "back");
 define_key(content_buffer_normal_keymap, "M-right", "forward");
+
+
+define_key(default_global_keymap, "A-h",
+           function (I)
+           {
+               for (var i = 0; i < I.window.buffers.count; i++)
+               {
+                   stop_loading(I.window.buffers.get_buffer(i));
+               }
+           });
+
+define_key(default_global_keymap, "A-r",
+          function (I)
+          {
+              for (var i = 0; i < I.window.buffers.count; i++)
+              {
+                  reload(I.window.buffers.get_buffer(i));
+              }
+          });
+
+// next and previous buffer
+// define_key(default_global_keymap, "A-z", "buffer-previous"); //one hand user
+define_key(default_global_keymap, "C-j", "buffer-previous"); //two hands user
+// define_key(default_global_keymap, "A-x", "buffer-next"); //one hand user
+define_key(default_global_keymap, "C-l", "buffer-next"); //two hands user
+
+//// Use numeric key to switch buffers (1-9)
+function define_switch_buffer_key (key, buf_num) {
+    define_key(default_global_keymap, key,
+               function (I) {
+                   switch_to_buffer(I.window,
+                                    I.window.buffers.get_buffer(buf_num));
+               });
+}
+for (let i = 0; i < 9; ++i) {
+    define_switch_buffer_key(String((i+1)%10), i);
+}
+//// Use  to swtich to first buffer
+define_switch_buffer_key("C-A-z", 0);
+
+//// Switch to last buffer (key 0 or )
+define_key(default_global_keymap, "0",
+          function (I)
+          {
+              switch_to_buffer(I.window,
+                               I.window.buffers.get_buffer(I.window.buffers.count - 1));
+          });
+
+//open the url in the clipboard in new buffer
+define_key(content_buffer_normal_keymap, "C-A-v", "paste-url-new-buffer");
+
+//quit conkeror
+define_key(default_global_keymap, "A-q" , "quit");
+
+// Replacement of built-in buffer switcher
+minibuffer.prototype.read_recent_buffer = function () {
+    var window = this.window;
+    var buffer = this.window.buffers.current;
+    keywords(arguments, $prompt = "Buffer:",
+             $default = buffer,
+             $history = "buffer");
+    var buffers = window.buffers.buffer_history.slice(0);
+    buffers.push(buffers.shift());
+    var completer = all_word_completer(
+        $completions = buffers,
+        $get_string = function (x) {
+            return ' ' + x.title;
+        },
+        $get_description = function (x) x.description,
+        $get_icon = (read_buffer_show_icons ?
+                     function (x) x.icon : null)
+    );
+    var result = yield this.read(
+        $keymap = read_buffer_keymap,
+        $prompt = arguments.$prompt,
+        $history = arguments.$history,
+        $completer = completer,
+        $enable_icons = read_buffer_show_icons,
+        $match_required = true,
+        $auto_complete = "buffer",
+        $auto_complete_initial = true,
+        $auto_complete_delay = 0,
+        $default_completion = arguments.$default
+    );
+    yield co_return(result);
+};
+
+interactive("switch-to-recent-buffer",
+            "Switch to a buffer specified in the minibuffer. ┬áList of buffers "+
+            "will be ordered by recency.",
+            function (I) {
+              switch_to_buffer(
+                I.window,
+                (yield I.minibuffer.read_recent_buffer(
+                  $prompt = "Switch to buffer:",
+                  $default = (I.window.buffers.count > 1 ?
+                              I.window.buffers.buffer_history[1] :
+                              I.buffer))));
+            });
+
+define_key(default_global_keymap, "C-x B", "switch-to-recent-buffer");
+define_key(default_global_keymap, "C-tab", "switch-to-recent-buffer");
+//define_key(read_buffer_keymap, "C-tab", "minibuffer-complete");
+define_key(read_buffer_keymap, "C-S-tab", "minibuffer-complete-previous");
+define_key(default_global_keymap, "A-return", "switch-to-recent-buffer");
+define_key(read_buffer_keymap, "A-return", "minibuffer-complete");
+define_key(read_buffer_keymap, "A-S-return", "minibuffer-complete-previous");
index 24d8405..937b71a 100644 (file)
@@ -2,8 +2,9 @@ require("mode-line.js");
 
 //load_paths.unshift("chrome://conkeror-contrib/content/");
 // funky icons in the modeline
-//require("mode-line-buttons.js");
-//mode_line_add_buttons(standard_mode_line_buttons, true);
+load_paths.unshift("chrome://conkeror-contrib/content/");
+require("mode-line-buttons.js");
+mode_line_add_buttons(standard_mode_line_buttons, true);
 
 // we'd like to see the # of buffers being loaded 
 // favicons hook
diff --git a/.conkerorrc/reopenclosedtab.js b/.conkerorrc/reopenclosedtab.js
new file mode 100644 (file)
index 0000000..037215b
--- /dev/null
@@ -0,0 +1,36 @@
+var my_closed_buffers = new Array();
+
+//save the URL of the current buffer before closing it
+interactive("my-close-and-save-current-buffer",
+               "close and save the current buffer for later restore",
+function(I) {
+       if(my_closed_buffers.length==10){
+               my_closed_buffers.shift(); // remove older item to save
+               // memory, just save maximum 10 buffers
+       }
+       my_closed_buffers.push(I.buffer.document.URL);
+       kill_buffer(I.buffer); //kill the current buffer
+});
+
+undefine_key(default_global_keymap, "q");
+define_key(default_global_keymap, "q", "my-close-and-save-current-buffer");
+undefine_key(default_global_keymap, "C-x k");
+define_key(default_global_keymap, "C-x k", "my-close-and-save-current-buffer");
+//// kill current buffer
+define_key(default_global_keymap, "w", "my-close-and-save-current-buffer");
+define_key(default_global_keymap, "A-w", "my-close-and-save-current-buffer");
+
+interactive("my-open-closed-buffer",
+  "open the last closed buffer", 
+function(I){
+    // check if the array length > 0
+    if(my_closed_buffers.length>0){
+        // load the URL in new windows
+        load_url_in_new_buffer(
+            my_closed_buffers[my_closed_buffers.length - 1], I.window);
+        // remove the first item in the array
+        my_closed_buffers.pop();
+    }
+});
+
+define_key(default_global_keymap, "A-W", "my-open-closed-buffer")
diff --git a/.conkerorrc/theme.js b/.conkerorrc/theme.js
new file mode 100644 (file)
index 0000000..d5b94b4
--- /dev/null
@@ -0,0 +1,9 @@
+// Personal theme
+theme_load_paths.unshift("~/.conkerorrc/themes/");
+theme_unload("default");
+theme_load("tommytxtruong");
+interactive("tommytxtruong-theme", "Load my personal theme",
+            function(I) {
+                theme_load("tommytxtruong");
+            });
+define_key(default_global_keymap, "A-u", "tommytxtruong-theme");
diff --git a/.conkerorrc/themes/tommytxtruong/content-buffer-input.css b/.conkerorrc/themes/tommytxtruong/content-buffer-input.css
new file mode 100644 (file)
index 0000000..82acb9e
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * (C) Copyright 2007-2008 Jeremy Maitin-Shepard
+ *
+ * Use, modification, and distribution are subject to the terms specified in the
+ * COPYING file.
+**/
+
+@namespace url("http://www.w3.org/1999/xhtml");
+
+.__conkeror_textbox_edited_externally {
+  background-color: #bbbbbb;
+  -moz-appearance: none;
+}
diff --git a/.conkerorrc/themes/tommytxtruong/eye-guide.css b/.conkerorrc/themes/tommytxtruong/eye-guide.css
new file mode 100644 (file)
index 0000000..502049b
--- /dev/null
@@ -0,0 +1,22 @@
+
+@namespace url("http://www.w3.org/1999/xhtml");
+
+#__conkeror_eye_guide {
+  position: fixed;
+  left: 0px;
+  top: 0px;
+  width: 100%;
+  background: black;
+  opacity: 0.1;
+  z-index: 100000;
+}
+
+/*
+ *  Note, the following selectors can be styled with a
+ * border-top and border-bottom respectively to achieve
+ * the effect of a single line scroll-guide:
+ *
+ *  #__conkeror_eye_guide.__conkeror_eye_guide_scroll_down
+ *  #__conkeror_eye_guide.__conkeror_eye_guide_scroll_up
+ *
+ */
diff --git a/.conkerorrc/themes/tommytxtruong/hints--url-panel.css b/.conkerorrc/themes/tommytxtruong/hints--url-panel.css
new file mode 100644 (file)
index 0000000..8a41a11
--- /dev/null
@@ -0,0 +1,11 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+.panel .panel-row-label {
+  font-weight: bold;
+}
+
+.panel .url-panel-label {
+  font-weight: bold;
+}
+
diff --git a/.conkerorrc/themes/tommytxtruong/minibuffer.css b/.conkerorrc/themes/tommytxtruong/minibuffer.css
new file mode 100644 (file)
index 0000000..84fb373
--- /dev/null
@@ -0,0 +1,82 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#minibuffer {
+  border-top: 1px solid -moz-Dialog;
+  font-family: Menlo;
+  font-size: 12px;
+}
+
+#minibuffer-prompt {
+  font-weight: bold;
+  color: blue;
+}
+
+#minibuffer-input {
+  background-color: -moz-field !important;
+}
+
+
+/* mode text widgets */
+
+#minibuffer .mode-text-widget {
+  display: none;
+}
+
+#minibuffer[minibuffermode="message"] .mode-text-widget {
+  display: block;
+  border-left: 1px solid threedshadow;
+  padding-left: 4px !important;
+  padding-right: 4px !important;
+  margin-left: 0px !important;
+  margin-right: 0px !important;
+}
+
+#minibuffer[minibuffermode="message"] .mode-text-widget[value=""] {
+  display: none;
+}
+
+
+/* minibuffer highlighting */
+
+#minibuffer.highlight {
+  background-color: Highlight;
+  color: HighlightText;
+}
+
+#minibuffer.highlight[minibuffermode="message"] .mode-text-widget {
+  border-left: 1px solid highlighttext;
+}
+
+
+/* Completions display */
+
+tree.completions { margin: 0px !important; }
+
+tree.completions treechildren { border: none !important; }
+
+tree.completions treecol { -moz-binding: none !important; }
+tree.completions {
+  -moz-appearance: none !important;
+  border: 0px none !important;
+  border-top: 1px solid -moz-Dialog !important;
+  -moz-border-top-colors: -moz-initial !important;
+}
+
+tree.completions treechildren::-moz-tree-row {
+  border: none;
+}
+
+tree.completions treechildren::-moz-tree-row(current) {
+  background-color: Highlight !important;
+  color: HighlightText !important;
+}
+
+tree.completions treechildren::-moz-tree-cell-text(completion-description) {
+  font-weight: bold !important;
+}
+
+tree.completions treechildren::-moz-tree-cell-text(current) {
+  color: HighlightText !important;
+}
+
diff --git a/.conkerorrc/themes/tommytxtruong/mode-line.css b/.conkerorrc/themes/tommytxtruong/mode-line.css
new file mode 100644 (file)
index 0000000..30974e1
--- /dev/null
@@ -0,0 +1,10 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+.mode-line {
+  padding: 2px;
+  /* -moz-appearance: -moz-mac-unified-toolbar; */
+  font-family: Menlo;
+  font-size: 12px;
+  
+}
diff --git a/.conkerorrc/themes/tommytxtruong/new-tabs.css b/.conkerorrc/themes/tommytxtruong/new-tabs.css
new file mode 100644 (file)
index 0000000..950a251
--- /dev/null
@@ -0,0 +1,55 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#tab2-bar {
+  -moz-appearance: textfield;
+  border-bottom: 1px solid threedshadow;
+}
+
+.tab2 {
+  /* -moz-appearance: statusbar; */
+  -moz-appearance: none;
+  min-width: 150px;
+  max-width: 200px;
+  overflow: hidden; /* Chops end of label */
+  border-style: solid;
+  border-width: 1px 1px 0 1px;
+  border-color: #999999;
+  -moz-border-radius-topleft: 10px 12px;
+  -moz-border-radius-topright: 10px 12px;
+  background: -moz-linear-gradient(top, rgba(170,170,170,255), rgba(240,240,240,255));
+  color: #222222;
+  height: 23px;
+}
+
+.tab2:hover {
+  background: -moz-linear-gradient(top, rgba(240,240,240,255), rgba(240,240,240,255));
+}
+
+.tab2[selected="true"] {
+  /* -moz-appearance: toolbar; */
+  background: -moz-linear-gradient(top, rgba(255,255,255,255), rgba(255,255,255,255));
+  color: black;
+}
+
+.tab2-label {
+  margin-left: 4px;
+  font-family: Verdana;
+  font-size: 12px;
+}
+
+.tab2-index {
+  font: 500 15px Menlo;
+  text-align: center;
+  color: blue;
+  max-width: 30px;
+  margin: 0px 0px 3px 0px;
+}
+
+.tab2-icon  {
+  width: 16px;
+  height: 16px;
+  /* -moz-margin-start: 4px; */
+  /* -moz-margin-end: 3px; */
+  margin: 3px 0px 3px 10px;
+}
diff --git a/.conkerorrc/themes/tommytxtruong/tab-bar.css b/.conkerorrc/themes/tommytxtruong/tab-bar.css
new file mode 100644 (file)
index 0000000..7f5ae2e
--- /dev/null
@@ -0,0 +1,73 @@
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+
+#tab-bar {
+  -moz-box-pack: end;
+}
+
+.tab {
+  -moz-appearance: tab;
+  margin-top: 2px;
+  border-top: 2px solid;
+  border-right: 2px solid;
+  border-left: 2px solid;
+  border-bottom: 1px solid ThreeDHighlight;
+  -moz-border-top-colors: ThreeDHighlight ThreeDLightShadow;
+  -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
+  -moz-border-left-colors: ThreeDHighlight ThreeDLightShadow;
+  -moz-border-radius-topleft: 2px;
+  -moz-border-radius-topright: 2px;
+  -moz-border-radius-bottomright: 1px;
+  padding: 1px 4px 2px 4px;
+  background-color: -moz-Dialog;
+  color: -moz-DialogText;
+  min-width: 100px;
+  max-width: 250px;
+  -moz-box-flex: 100;
+  -moz-box-align: center;
+}
+
+.tab[selected="true"] {
+  border-bottom-color: transparent;
+  padding: 1px 6px 4px 6px;
+  background-color: -moz-Dialog;
+}
+
+.tab-close-button {
+  -moz-appearance: none !important;
+  list-style-image: url("chrome://global/skin/icons/close.png") !important;
+  -moz-image-region: rect(0px, 14px, 14px, 0px);
+  border: none !important;
+}
+
+.tab[selected="false"] .tab-close-button {
+  display: none;
+}
+
+.tab-close-button:hover {
+  -moz-image-region: rect(0px, 28px, 14px, 14px);
+}
+
+.tab-close-button:active:hover {
+  -moz-image-region: rect(0px, 42px, 14px, 28px);
+}
+
+.tab-label {
+  -moz-box-flex: 100;
+  font: icon;
+}
+
+.tab[selected="true"] > .tab-label {
+  font-weight: bold;
+}
+
+.tab-icon  {
+  min-width: 16px;
+  min-height: 16px;
+  max-width: 16px;
+  max-height: 16px;
+  list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png");
+  -moz-margin-start: 4px;
+  -moz-margin-end: 3px;
+}
+
diff --git a/.conkerorrc/themes/tommytxtruong/theme.json b/.conkerorrc/themes/tommytxtruong/theme.json
new file mode 100644 (file)
index 0000000..28682cb
--- /dev/null
@@ -0,0 +1,11 @@
+
+{ "sheets": [
+      "content-buffer-input.css",
+      "minibuffer.css",
+      "mode-line.css",
+      "tab-bar.css",
+      "new-tabs.css",
+      "hints--url-panel.css",
+      "eye-guide.css"
+  ]
+}