diff --git a/AUTHORS b/AUTHORS index c3fb1ac2..9dc10466 100644 --- a/AUTHORS +++ b/AUTHORS @@ -11,4 +11,5 @@ Patches: * Lee Hinman (:open ./.. support) * Bart Trojanowski (Makefile) * Doug Kearns (vimperator.vim, :tabonly etc. commands) + * Hannes Rist (:set title support) diff --git a/ChangeLog b/ChangeLog index 75ac494f..2fae36e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@
 2007-05-02:
 	* version ???
+	* Vimperator now sets the window title, so it's "vimperator.mozdev.org -
+	  Vimperator" instead of "vimperator.mozdev.org - Mozilla Firefox"
+	  Use :set title=... to change it back (help from Hannes Rist)
 	* :tabmove command (by Doug Kearns)
 	* 'showstatuslinks' option to control where/if we show the destination of
 	a hovered link
diff --git a/TODO b/TODO
index 12534e8f..9ff361ea 100644
--- a/TODO
+++ b/TODO
@@ -58,5 +58,8 @@ RANDOM IDEAS:
 * 16:06:04       bartman| maxauthority: feature idea: what if :n and :N searched the 
                         page and if they found a unique .*next.* or .*prev.* they would follow that link?
+* 20:12:26         skaar| so, I think get_history_completion effectively will put the oldest 
+                        history entry at the top of the completion list
+  20:12:48         skaar| since you're counting down in the for loop
 
 
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index d7a203a9..85e1c359 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -1478,11 +1478,6 @@ function getCurrentLocation() function getCurrentTitle() { return window.content.document.title; -// var titles = window.content.document.getElementsByTagName('title'); -// if (titles.length >= 1) -// return titles[0]; -// else -// return null; } diff --git a/chrome/content/vimperator/settings.js b/chrome/content/vimperator/settings.js index ebf30152..2dd1f84a 100644 --- a/chrome/content/vimperator/settings.js +++ b/chrome/content/vimperator/settings.js @@ -262,6 +262,20 @@ var g_settings = [/*{{{*/ 2, function (value) { if (value>=0 && value <=2) return true; else return false; } ], + [ + ["titlestring"], + ["titlestring"], + "Change the title of the browser window", + "Vimperator changes the browser title from \"Title of webpage - Mozilla Firefox\" to "+ + "\"Title of webpage - Vimperator\".
If you don't like that, you can restore it with: "+ + ":set titlestring=Mozilla Firefox.", + "string", + null, + function(value) { set_pref("title", value); set_title(value); }, + function() { return get_pref("title"); }, + "Vimperator", + null + ], [ ["usermode", "um", "nousermode", "noum"], ["usermode", "um"], @@ -486,4 +500,13 @@ function set_showtabline(value) } } +function set_title(value) +{ + if (!value || typeof(value) != "string") + value = get_pref("titlestring"); + + document.getElementById("main-window").setAttribute("titlemodifier", value); + document.title = window.content.document.title + " - " + value; // not perfect fix, but good enough +} + // vim: set fdm=marker sw=4 ts=4 et: diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js index f12cf0b6..f0672000 100644 --- a/chrome/content/vimperator/vimperator.js +++ b/chrome/content/vimperator/vimperator.js @@ -47,7 +47,6 @@ const MODE_COMMAND_LINE = 4096; //const MODE_BROWSER //const MODE_CARET - var g_current_mode = MODE_NORMAL; var popup_allowed_events; // need to change and reset this firefox pref @@ -59,18 +58,8 @@ var prev_match = new Array(5); var heredoc = ''; // handles to our gui elements -//var preview_window = null; -//var status_line = null; var command_line = null; -// our status bar fields -const STATUSFIELD_URL = 1; -const STATUSFIELD_INPUTBUFFER = 2; -const STATUSFIELD_PROGRESS = 3; -const STATUSFIELD_BUFFERS = 4; -const STATUSFIELD_CURSOR_POSITION = 5; - - /* this function reacts to status bar and url changes which are sent from the mozilla core */ function nsBrowserStatusHandler() /*{{{*/ @@ -152,7 +141,7 @@ nsBrowserStatusHandler.prototype = vimperator.statusline.updateUrl(url); vimperator.statusline.updateProgress(); - setTimeout(function() {vimperator.statusline.updateBufferPosition();}, 100); // if not delayed we get the wrong position of the old buffer + setTimeout(function() { vimperator.statusline.updateBufferPosition(); }, 100); // if not delayed we get the wrong position of the old buffer // updating history cache is not done here but in the 'pageshow' event // handler, because at this point I don't have access to the url title @@ -344,6 +333,7 @@ function init() set_showtabline(get_pref("showtabline")); set_guioptions(get_pref("guioptions")); + set_title(); // work around firefox popup blocker popup_allowed_events = get_firefox_pref('dom.popup_allowed_events', 'change click dblclick mouseup reset submit'); @@ -727,7 +717,6 @@ function addEventListeners() } g_history.unshift([url, title]); } - // alert('pageshow'); } , null); @@ -752,7 +741,6 @@ function addEventListeners() }, false); container.addEventListener("TabSelect", updateBufferList, false); container.addEventListener("TabMove", updateBufferList, false); - } var buffer_changed_listener =