mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 05:25:46 +01:00
Added "titlestring" setting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user