summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2008-12-11 15:22:01 -0500
committerKris Maglione <maglione.k@gmail.com>2008-12-11 15:22:01 -0500
commit0f330b3a153fbc525610b293e421267bc74ed9eb (patch)
tree07790b092441618f33a1dd60a859344153c4cdb1 /common
parent016770bf7d4ef0659eac61b90b186ee08492fd2c (diff)
downloadpentadactyl-0f330b3a153fbc525610b293e421267bc74ed9eb.tar.gz
Fix :echo undefined
Diffstat (limited to 'common')
-rw-r--r--common/content/events.js36
-rw-r--r--common/content/liberator.xul4
-rw-r--r--common/content/tabs.js6
-rw-r--r--common/content/ui.js2
4 files changed, 26 insertions, 22 deletions
diff --git a/common/content/events.js b/common/content/events.js
index f79a1cd9..1ad20b0b 100644
--- a/common/content/events.js
+++ b/common/content/events.js
@@ -811,7 +811,7 @@ function Events() //{{{
// This method pushes keys into the event queue from liberator
// it is similar to vim's feedkeys() method, but cannot cope with
- // 2 partially feeded strings, you have to feed one parsable string
+ // 2 partially-fed strings, you have to feed one parsable string
//
// @param keys: a string like "2<C-f>" to pass
// if you want < to be taken literally, prepend it with a \\
@@ -829,6 +829,8 @@ function Events() //{{{
try
{
+ liberator.threadYield(true, true);
+
noremap = !!noremap;
for (var i = 0; i < keys.length; i++)
@@ -1259,7 +1261,8 @@ function Events() //{{{
if (key == "<C-c>" && !event.isMacro)
{
events.feedingKeys = false;
- setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'") }, 100);
+ if (lastMacro)
+ setTimeout(function () { liberator.echomsg("Canceled playback of macro '" + lastMacro + "'") }, 100);
event.preventDefault();
event.stopPropagation();
return true;
@@ -1527,23 +1530,18 @@ function Events() //{{{
// TODO: move to buffer.js?
progressListener: {
- QueryInterface: function (aIID)
- {
- if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
- aIID.equals(Components.interfaces.nsIXULBrowserWindow) || // for setOverLink();
- aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
- aIID.equals(Components.interfaces.nsISupports))
- return this;
- throw Components.results.NS_NOINTERFACE;
- },
+ QueryInterface: XPCOMUtils.generateQI([
+ Components.interfaces.nsIWebProgressListener,
+ Components.interfaces.nsIXULBrowserWindow
+ ]),
// XXX: function may later be needed to detect a canceled synchronous openURL()
onStateChange: function (webProgress, request, flags, status)
{
+ const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
// STATE_IS_DOCUMENT | STATE_IS_WINDOW is important, because we also
// receive statechange events for loading images and other parts of the web page
- if (flags & (Components.interfaces.nsIWebProgressListener.STATE_IS_DOCUMENT |
- Components.interfaces.nsIWebProgressListener.STATE_IS_WINDOW))
+ if (flags & (nsIWebProgressListener.STATE_IS_DOCUMENT | nsIWebProgressListener.STATE_IS_WINDOW))
{
// This fires when the load event is initiated
// only thrown for the current tab, not when another tab changes
@@ -1624,11 +1622,13 @@ function Events() //{{{
}
},
- // stub functions for the interfaces
- setJSStatus: function (status) { ; },
- setJSDefaultStatus: function (status) { ; },
- setDefaultStatus: function (status) { ; },
- onLinkIconAvailable: function () { ; }
+ // nsIXULBrowserWindow stubs
+ setJSDefaultStatus: function (status) {},
+ setJSStatus: function (status) {},
+
+ // Stub for something else, presumably. Not in any documented
+ // interface.
+ onLinkIconAvailable: function () {}
},
// TODO: move to options.js?
diff --git a/common/content/liberator.xul b/common/content/liberator.xul
index a2e67338..b8003cfd 100644
--- a/common/content/liberator.xul
+++ b/common/content/liberator.xul
@@ -59,11 +59,11 @@ the terms of any one of the MPL, the GPL or the LGPL.
<commandset id="onVimperatorFocus"
commandupdater="true"
events="focus"
- oncommandupdate="if (typeof liberator.modules.events != 'undefined') liberator.modules.events.onFocusChange(event);"/>
+ oncommandupdate="if (liberator.modules.events != undefined) liberator.modules.events.onFocusChange(event);"/>
<commandset id="onVimperatorSelect"
commandupdater="true"
events="select"
- oncommandupdate="if (typeof liberator.modules.events != 'undefined') liberator.modules.events.onSelectionChange(event);"/>
+ oncommandupdate="if (liberator.modules.events != undefined) liberator.modules.events.onSelectionChange(event);"/>
<!-- As of Firefox 3.1pre, <iframe>.height changes do not seem to have immediate effect,
therefore we need to put them into a <vbox> for which that works just fine -->
diff --git a/common/content/tabs.js b/common/content/tabs.js
index 4b521d2d..d82899df 100644
--- a/common/content/tabs.js
+++ b/common/content/tabs.js
@@ -663,14 +663,16 @@ function Tabs() //{{{
return store.options;
},
- get localStore()
+ getLocalStore: function (tab)
{
- let tab = this.getTab();
+ let tab = this.getTab(tab);
if (!tab.liberatorStore)
tab.liberatorStore = {};
return tab.liberatorStore;
},
+ get localStore() this.getLocalStore(),
+
get tabStrip()
{
if (config.hostApplication == "Firefox")
diff --git a/common/content/ui.js b/common/content/ui.js
index 5a8cf656..1c000ade 100644
--- a/common/content/ui.js
+++ b/common/content/ui.js
@@ -631,6 +631,8 @@ function CommandLine() //{{{
arg = util.objectToString(arg, useColor);
else if (typeof arg == "string" && /\n/.test(arg))
arg = <span highlight="CmdOutput">{arg}</span>;
+ else
+ arg = String(arg);
return arg;
}