1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 17:27:57 +01:00

whitespace formatting fixes

This commit is contained in:
Doug Kearns
2007-11-10 15:06:07 +00:00
parent 7e59f88c96
commit 2c5655e182
17 changed files with 692 additions and 692 deletions

View File

@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
vimperator.Events = function() //{{{
vimperator.Events = function () //{{{
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
@@ -35,23 +35,23 @@ vimperator.Events = function() //{{{
// this handler is for middle click only in the content
//window.addEventListener("mousedown", onVimperatorKeypress, true);
//content.mPanelContainer.addEventListener("mousedown", onVimperatorKeypress, true);
//document.getElementById("content").onclick = function(event) { alert("foo"); };
//document.getElementById("content").onclick = function (event) { alert("foo"); };
// any tab related events
var tabcontainer = getBrowser().tabContainer;
tabcontainer.addEventListener("TabMove", function(event) {
tabcontainer.addEventListener("TabMove", function (event) {
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
tabcontainer.addEventListener("TabOpen", function(event) {
tabcontainer.addEventListener("TabOpen", function (event) {
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
tabcontainer.addEventListener("TabClose", function(event) {
tabcontainer.addEventListener("TabClose", function (event) {
vimperator.statusline.updateTabCount();
vimperator.buffer.updateBufferList();
}, false);
tabcontainer.addEventListener("TabSelect", function(event) {
tabcontainer.addEventListener("TabSelect", function (event) {
if (vimperator.mode == vimperator.modes.HINTS)
vimperator.modes.reset();
@@ -61,7 +61,7 @@ vimperator.Events = function() //{{{
vimperator.buffer.updateBufferList();
vimperator.tabs.updateSelectionHistory();
setTimeout(function() { vimperator.focusContent(true); }, 10); // just make sure, that no widget has focus
setTimeout(function () { vimperator.focusContent(true); }, 10); // just make sure, that no widget has focus
}, false);
// this adds an event which is is called on each page load, even if the
@@ -107,7 +107,7 @@ vimperator.Events = function() //{{{
window.addEventListener("DOMMenuBarActive", enterMenuMode, true);
window.addEventListener("DOMMenuBarInactive", exitMenuMode, true);
// window.document.addEventListener("DOMTitleChanged", function(event)
// window.document.addEventListener("DOMTitleChanged", function (event)
// {
// vimperator.log("titlechanged");
// }, null);
@@ -231,7 +231,7 @@ vimperator.Events = function() //{{{
// // FIXME: this currently causes window map events which is _very_ annoying
// // we want to stay in command mode after a page has loaded
// //setTimeout(vimperator.focusContent, 10);
// // setTimeout(function() {
// // setTimeout(function () {
// // if (doc.commandDispatcher.focusedElement)
// // doc.commandDispatcher.focusedElement.blur();
// // alert(doc.commandDispatcher.focusedElement);
@@ -246,7 +246,7 @@ vimperator.Events = function() //{{{
/////////////////////////////////////////////////////////////////////////////{{{
this.wantsModeReset = true; // used in onFocusChange since Firefox is so buggy here
this.destroy = function()
this.destroy = function ()
{
// removeEventListeners() to avoid mem leaks
window.dump("TODO: remove all eventlisteners\n");
@@ -268,7 +268,7 @@ vimperator.Events = function() //{{{
//
// @param keys: a string like "2<C-f>" to pass
// if you want < to be taken literally, prepend it with a \\
this.feedkeys = function(keys, noremap)
this.feedkeys = function (keys, noremap)
{
var doc = window.document;
var view = window.document.defaultView;
@@ -332,7 +332,7 @@ vimperator.Events = function() //{{{
// a keycode which can be used in mappings
// e.g. pressing ctrl+n would result in the string "<C-n>"
// null if unknown key
this.toString = function(event) //{{{
this.toString = function (event) //{{{
{
if (!event)
return;
@@ -408,11 +408,11 @@ vimperator.Events = function() //{{{
} //}}}
this.isAcceptKey = function(key)
this.isAcceptKey = function (key)
{
return (key == "<Return>" || key == "<C-j>" || key == "<C-m>");
}
this.isCancelKey = function(key)
this.isCancelKey = function (key)
{
return (key == "<Esc>" || key == "<C-[>" || key == "<C-c>");
}
@@ -422,7 +422,7 @@ vimperator.Events = function() //{{{
//
// the ugly wantsModeReset is needed, because firefox generates a massive
// amount of focus changes for things like <C-v><C-k> (focusing the search field)
this.onFocusChange = function(event)
this.onFocusChange = function (event)
{
// command line has it's own focus change handler
if (vimperator.mode == vimperator.modes.COMMAND_LINE)
@@ -455,14 +455,14 @@ vimperator.Events = function() //{{{
vimperator.mode == vimperator.modes.VISUAL)
{
this.wantsModeReset = true;
setTimeout(function() {
setTimeout(function () {
if (vimperator.events.wantsModeReset)
vimperator.modes.reset();
}, 10);
}
}
this.onSelectionChange = function(event)
this.onSelectionChange = function (event)
{
var could_copy = false;
var controller = document.commandDispatcher.getControllerForCommand("cmd_copy");
@@ -488,7 +488,7 @@ vimperator.Events = function() //{{{
}
// global escape handler, is called in ALL modes
this.onEscape = function()
this.onEscape = function ()
{
if (!vimperator.modes.passNextKey)
{
@@ -549,7 +549,7 @@ vimperator.Events = function() //{{{
// this keypress handler gets always called first, even if e.g.
// the commandline has focus
this.onKeyPress = function(event)
this.onKeyPress = function (event)
{
var key = vimperator.events.toString(event);
if (!key)
@@ -732,7 +732,7 @@ vimperator.Events = function() //{{{
window.addEventListener("keypress", this.onKeyPress, true);
// this is need for sites like msn.com which focus the input field on keydown
this.onKeyUpOrDown = function(event)
this.onKeyUpOrDown = function (event)
{
if (vimperator.modes.passNextKey ^ vimperator.modes.passAllKeys || isFormElemFocused())
return true;
@@ -745,7 +745,7 @@ vimperator.Events = function() //{{{
this.progressListener =
{
QueryInterface: function(aIID)
QueryInterface: function (aIID)
{
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsIXULBrowserWindow) || // for setOverLink();
@@ -756,7 +756,7 @@ vimperator.Events = function() //{{{
},
// XXX: function may later be needed to detect a canceled synchronous openURL()
onStateChange: function(webProgress, aRequest, flags, aStatus)
onStateChange: function (webProgress, aRequest, flags, aStatus)
{
// STATE_IS_DOCUMENT | STATE_IS_WINDOW is important, because we also
// receive statechange events for loading images and other parts of the web page
@@ -783,29 +783,29 @@ vimperator.Events = function() //{{{
else if (aState & nsIWebProgressListener.STATE_IS_SECURE)
vimperator.statusline.setClass("secure");
},
onStatusChange: function(webProgress, request, status, message)
onStatusChange: function (webProgress, request, status, message)
{
vimperator.statusline.updateUrl(message);
},
onProgressChange: function(webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress)
onProgressChange: function (webProgress, request, curSelfProgress, maxSelfProgress, curTotalProgress, maxTotalProgress)
{
vimperator.statusline.updateProgress(curTotalProgress/maxTotalProgress);
},
// happens when the users switches tabs
onLocationChange: function()
onLocationChange: function ()
{
vimperator.statusline.updateUrl();
vimperator.statusline.updateProgress();
// if this is not delayed we get the position of the old buffer
setTimeout(function() { vimperator.statusline.updateBufferPosition(); }, 100);
setTimeout(function () { vimperator.statusline.updateBufferPosition(); }, 100);
},
// called at the very end of a page load
asyncUpdateUI: function()
asyncUpdateUI: function ()
{
setTimeout(vimperator.statusline.updateUrl, 100);
},
setOverLink : function(link, b)
setOverLink : function (link, b)
{
var ssli = vimperator.options["showstatuslinks"];
if (link && ssli)
@@ -826,10 +826,10 @@ vimperator.Events = function() //{{{
},
// stub functions for the interfaces
setJSStatus: function(status) { ; },
setJSDefaultStatus: function(status) { ; },
setDefaultStatus: function(status) { ; },
onLinkIconAvailable: function() { ; }
setJSStatus: function (status) { ; },
setJSDefaultStatus: function (status) { ; },
setDefaultStatus: function (status) { ; },
onLinkIconAvailable: function () { ; }
};
window.XULBrowserWindow = this.progressListener;
@@ -844,7 +844,7 @@ vimperator.Events = function() //{{{
this.prefObserver =
{
register: function()
register: function ()
{
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
@@ -853,13 +853,13 @@ vimperator.Events = function() //{{{
this._branch.addObserver("", this, false);
},
unregister: function()
unregister: function ()
{
if (!this._branch) return;
this._branch.removeObserver("", this);
},
observe: function(aSubject, aTopic, aData)
observe: function (aSubject, aTopic, aData)
{
if (aTopic != "nsPref:changed") return;
// aSubject is the nsIPrefBranch we're observing (after appropriate QI)