mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 16:17:57 +01:00
remove unnecessary parentheses from typeof operands
This commit is contained in:
@@ -1347,7 +1347,7 @@ function zoom_to(value)
|
||||
value = 100;
|
||||
|
||||
// convert to int, if string was given
|
||||
if (typeof(value) != "number")
|
||||
if (typeof value != "number")
|
||||
{
|
||||
oldval = value;
|
||||
value = parseInt(oldval, 10);
|
||||
|
||||
@@ -413,11 +413,11 @@ function get_pref(name, forced_default)
|
||||
|
||||
try
|
||||
{
|
||||
if (typeof(default_value) == "string")
|
||||
if (typeof default_value == "string")
|
||||
pref = g_vimperator_prefs.getCharPref(name);
|
||||
else if (typeof(default_value) == "number")
|
||||
else if (typeof default_value == "number")
|
||||
pref = g_vimperator_prefs.getIntPref(name);
|
||||
else if (typeof(default_value) == "boolean")
|
||||
else if (typeof default_value == "boolean")
|
||||
pref = g_vimperator_prefs.getBoolPref(name);
|
||||
else
|
||||
pref = default_value;
|
||||
@@ -436,11 +436,11 @@ function get_firefox_pref(name, default_value)
|
||||
var pref;
|
||||
try
|
||||
{
|
||||
if (typeof(default_value) == "string")
|
||||
if (typeof default_value == "string")
|
||||
pref = g_firefox_prefs.getCharPref(name);
|
||||
else if (typeof(default_value) == "number")
|
||||
else if (typeof default_value == "number")
|
||||
pref = g_firefox_prefs.getIntPref(name);
|
||||
else if (typeof(default_value) == "boolean")
|
||||
else if (typeof default_value == "boolean")
|
||||
pref = g_firefox_prefs.getBoolPref(name);
|
||||
else
|
||||
pref = default_value;
|
||||
@@ -460,28 +460,28 @@ function set_pref(name, value)
|
||||
if (!g_vimperator_prefs)
|
||||
g_vimperator_prefs = g_firefox_prefs.getBranch("extensions.vimperator.");
|
||||
|
||||
if (typeof(value) == "string")
|
||||
if (typeof value == "string")
|
||||
g_vimperator_prefs.setCharPref(name, value);
|
||||
else if (typeof(value) == "number")
|
||||
else if (typeof value == "number")
|
||||
g_vimperator_prefs.setIntPref(name, value);
|
||||
else if (typeof(value) == "boolean")
|
||||
else if (typeof value == "boolean")
|
||||
g_vimperator_prefs.setBoolPref(name, value);
|
||||
else
|
||||
vimperator.echoerr("Unkown typeof pref: " + value);
|
||||
vimperator.echoerr("Unknown typeof pref: " + value);
|
||||
}
|
||||
|
||||
function set_firefox_pref(name, value)
|
||||
{
|
||||
// NOTE: firefox prefs are always inititialized, no need to re-init
|
||||
|
||||
if (typeof(value) == "string")
|
||||
if (typeof value == "string")
|
||||
g_firefox_prefs.setCharPref(name, value);
|
||||
else if (typeof(value) == "number")
|
||||
else if (typeof value == "number")
|
||||
g_firefox_prefs.setIntPref(name, value);
|
||||
else if (typeof(value) == "boolean")
|
||||
else if (typeof value == "boolean")
|
||||
g_firefox_prefs.setBoolPref(name, value);
|
||||
else
|
||||
vimperator.echoerr("Unkown typeof pref: " + value);
|
||||
vimperator.echoerr("Unknown typeof pref: " + value);
|
||||
}
|
||||
|
||||
|
||||
@@ -524,7 +524,7 @@ function set_showtabline(value)
|
||||
|
||||
function set_titlestring(value)
|
||||
{
|
||||
if (!value || typeof(value) != "string")
|
||||
if (!value || typeof value != "string")
|
||||
value = get_pref("titlestring");
|
||||
|
||||
document.getElementById("main-window").setAttribute("titlemodifier", value);
|
||||
|
||||
@@ -110,7 +110,7 @@ function CommandLine ()
|
||||
// Sets the prompt - for example, : or /
|
||||
function setPrompt(prompt)
|
||||
{
|
||||
if (typeof(prompt) != "string")
|
||||
if (typeof prompt != "string")
|
||||
prompt = "";
|
||||
|
||||
prompt_widget.value = prompt;
|
||||
@@ -738,7 +738,7 @@ function StatusLine()
|
||||
|
||||
this.updateUrl = function(url)
|
||||
{
|
||||
if (!url || typeof(url) != "string")
|
||||
if (!url || typeof url != "string")
|
||||
url = getCurrentLocation();
|
||||
|
||||
url_widget.value = url;
|
||||
@@ -746,7 +746,7 @@ function StatusLine()
|
||||
|
||||
this.updateInputBuffer = function(buffer)
|
||||
{
|
||||
if (!buffer || typeof(buffer) != "string")
|
||||
if (!buffer || typeof buffer != "string")
|
||||
buffer = "";
|
||||
|
||||
inputbuffer_widget.value = buffer;
|
||||
@@ -757,9 +757,9 @@ function StatusLine()
|
||||
if (!progress)
|
||||
progress = "";
|
||||
|
||||
if (typeof(progress) == "string")
|
||||
if (typeof progress == "string")
|
||||
progress_widget.value = progress;
|
||||
else if (typeof(progress) == "number")
|
||||
else if (typeof progress == "number")
|
||||
{
|
||||
var progress_str = "";
|
||||
if (progress <= 0)
|
||||
@@ -785,9 +785,9 @@ function StatusLine()
|
||||
// you can omit either of the 2 arguments
|
||||
this.updateTabCount = function(cur_index, total_tabs)
|
||||
{
|
||||
if(!cur_index || typeof(cur_index != "number"))
|
||||
if(!cur_index || typeof cur_index != "number")
|
||||
cur_index = vimperator.tabs.index() + 1;
|
||||
if(!total_tabs || typeof(cur_index != "number"))
|
||||
if(!total_tabs || typeof cur_index != "number")
|
||||
total_tabs = vimperator.tabs.count();
|
||||
|
||||
tabcount_widget.value = "[" + cur_index.toString() + "/" + total_tabs.toString() + "]";
|
||||
@@ -796,7 +796,7 @@ function StatusLine()
|
||||
// percent is given between 0 and 1
|
||||
this.updateBufferPosition = function(percent)
|
||||
{
|
||||
if(!percent || typeof(percent) != "number")
|
||||
if(!percent || typeof percent != "number")
|
||||
{
|
||||
var win = document.commandDispatcher.focusedWindow;
|
||||
percent = win.scrollMaxY == 0 ? -1 : win.scrollY / win.scrollMaxY;
|
||||
|
||||
@@ -246,7 +246,7 @@ function Vimperator() //{{{1
|
||||
mode = main;
|
||||
extended_mode = this.modes.NONE;
|
||||
}
|
||||
if (typeof(extended) === "number")
|
||||
if (typeof extended === "number")
|
||||
extended_mode = extended;
|
||||
|
||||
if (!silent)
|
||||
@@ -742,7 +742,7 @@ function Tabs() //{{{1
|
||||
if (spec === undefined || spec === "")
|
||||
return position;
|
||||
|
||||
if (typeof(spec) === "number")
|
||||
if (typeof spec === "number")
|
||||
position = spec;
|
||||
else if (spec === "$")
|
||||
return last;
|
||||
|
||||
Reference in New Issue
Block a user