summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/content/liberator.js36
-rw-r--r--muttator/NEWS1
-rw-r--r--muttator/content/config.js3
-rw-r--r--vimperator/content/config.js26
-rw-r--r--xulmus/content/config.js18
5 files changed, 43 insertions, 41 deletions
diff --git a/common/content/liberator.js b/common/content/liberator.js
index 1604b545..72be4aae 100644
--- a/common/content/liberator.js
+++ b/common/content/liberator.js
@@ -242,6 +242,42 @@ const liberator = (function () //{{{
"Load plugin scripts when starting up",
"boolean", true);
+ options.add(["titlestring"],
+ "Change the title of the window",
+ "string", config.defaults.titlestring || config.hostApplication,
+ {
+ setter: function (value)
+ {
+ let win = document.documentElement;
+ function updateTitle(old, current)
+ {
+ document.title = document.title.replace(RegExp("(.*)" + util.escapeRegex(old)), "$1" + current);
+ }
+
+ // TODO: remove this FF3.5 test when we no longer support 3.0
+ // : make this a config feature
+ if (services.get("privateBrowsing"))
+ {
+ let oldValue = win.getAttribute("titlemodifier_normal");
+ let suffix = win.getAttribute("titlemodifier_privatebrowsing").substr(oldValue.length);
+
+ win.setAttribute("titlemodifier_normal", value);
+ win.setAttribute("titlemodifier_privatebrowsing", value + suffix);
+
+ if (services.get("privateBrowsing").privateBrowsingEnabled)
+ {
+ updateTitle(oldValue + suffix, value + suffix);
+ return value;
+ }
+ }
+
+ updateTitle(win.getAttribute("titlemodifier"), value);
+ win.setAttribute("titlemodifier", value);
+
+ return value;
+ }
+ });
+
options.add(["verbose", "vbs"],
"Define which info messages are displayed",
"number", 1,
diff --git a/muttator/NEWS b/muttator/NEWS
index 9a7ae2f2..ec9983c4 100644
--- a/muttator/NEWS
+++ b/muttator/NEWS
@@ -1,5 +1,6 @@
2009-XX-XX
* version 0.6a1pre
+ * add 'titlestring' option
* rename FolderLoaded autocommand event to FolderLoad
* add the DOMLoad autocommand event
* add 'online' option
diff --git a/muttator/content/config.js b/muttator/content/config.js
index 201f85f9..d0ba3fe6 100644
--- a/muttator/content/config.js
+++ b/muttator/content/config.js
@@ -37,7 +37,8 @@ const config = { //{{{
features: ["hints", "mail", "marks", "addressbook", "tabs"],
defaults: {
guioptions: "frb",
- showtabline: 1
+ showtabline: 1,
+ titlestring: "Muttator"
},
guioptions: {
diff --git a/vimperator/content/config.js b/vimperator/content/config.js
index 804aa732..ea62ba30 100644
--- a/vimperator/content/config.js
+++ b/vimperator/content/config.js
@@ -35,7 +35,8 @@ const config = { //{{{
features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "tabUndo", "windows"],
defaults: {
guioptions: "rb",
- showtabline: 2
+ showtabline: 2,
+ titlestring: "Vimperator"
},
guioptions: {
@@ -304,29 +305,6 @@ const config = { //{{{
getter: function () !services.get("io").offline
});
- // TODO: merge with Vimperator version and add Muttator version
- // (TB handles this differently).
- options.add(["titlestring"],
- "Change the title of the window",
- "string", "Vimperator",
- {
- setter: function (value)
- {
- let elem = document.documentElement;
-
- elem.setAttribute("titlemodifier", value);
- // TODO: remove this FF3.5 test when we no longer support 3.0
- if (services.get("privateBrowsing"))
- {
- elem.setAttribute("titlemodifier_privatebrowsing", value);
- elem.setAttribute("titlemodifier_normal", value);
- }
- getBrowser().updateTitlebar();
-
- return value;
- }
- });
-
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMPLETIONS /////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
diff --git a/xulmus/content/config.js b/xulmus/content/config.js
index 9f0e8201..24c2e7ae 100644
--- a/xulmus/content/config.js
+++ b/xulmus/content/config.js
@@ -37,7 +37,8 @@ const config = { //{{{
features: ["bookmarks", "hints", "marks", "history", "quickmarks", "session", "tabs", "windows", "player"],
defaults: {
guioptions: "mprb",
- showtabline: 2
+ showtabline: 2,
+ titlestring: "Xulmus"
},
guioptions: {
@@ -374,21 +375,6 @@ const config = { //{{{
getter: function () !services.get("io").offline
});
- // TODO: merge with Vimperator version and add Muttator version
- // (TB handles this differently).
- options.add(["titlestring"],
- "Change the title of the window",
- "string", "Xulmus",
- {
- setter: function (value)
- {
- document.documentElement.setAttribute("titlemodifier", value);
- getBrowser().updateTitlebar();
-
- return value;
- }
- });
-
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMPLETIONS /////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{