1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-07 03:55:45 +01:00

Added "titlestring" setting

This commit is contained in:
Martin Stubenschrott
2007-05-17 18:48:16 +00:00
parent d99945054c
commit 71189214c5
6 changed files with 32 additions and 19 deletions

View File

@@ -11,4 +11,5 @@ Patches:
* Lee Hinman (:open ./.. support)
* Bart Trojanowski (Makefile)
* Doug Kearns (vimperator.vim, :tabonly etc. commands)
* Hannes Rist (:set title support)
</pre>

View File

@@ -1,6 +1,9 @@
<pre>
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

3
TODO
View File

@@ -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 <a href=...>.*next.*</a> or <a
href=...>.*prev.*<a/> 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
</pre>

View File

@@ -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;
}

View File

@@ -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\".<br/>If you don't like that, you can restore it with: "+
"<code class=\"command\">:set titlestring=Mozilla Firefox</code>.",
"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:

View File

@@ -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 =