Skip to content

Commit f6e5760

Browse files
committed
fix whitespace
1 parent b232ee5 commit f6e5760

19 files changed

Lines changed: 182 additions & 182 deletions

File tree

src/vs/base/browser/globalMouseMoveMonitor.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,45 +38,45 @@ export function standardMouseMoveMerger(lastEvent:IStandardMouseMoveEventData, c
3838
}
3939

4040
export class GlobalMouseMoveMonitor<R> implements Lifecycle.IDisposable {
41-
41+
4242
private hooks:Lifecycle.IDisposable[];
4343
private mouseMoveEventMerger:IEventMerger<R>;
4444
private mouseMoveCallback:IMouseMoveCallback<R>;
4545
private onStopCallback:IOnStopCallback;
46-
46+
4747
constructor() {
4848
this.hooks = [];
4949
this.mouseMoveEventMerger = null;
5050
this.mouseMoveCallback = null;
5151
this.onStopCallback = null;
5252
}
53-
53+
5454
public dispose(): void {
5555
this.stopMonitoring(false);
5656
}
57-
57+
5858
public stopMonitoring(invokeStopCallback:boolean): void {
5959
if (!this.isMonitoring()) {
6060
// Not monitoring
6161
return;
6262
}
63-
63+
6464
// Unhook
6565
this.hooks = Lifecycle.disposeAll(this.hooks);
6666
this.mouseMoveEventMerger = null;
6767
this.mouseMoveCallback = null;
6868
var onStopCallback = this.onStopCallback;
6969
this.onStopCallback = null;
70-
70+
7171
if (invokeStopCallback) {
7272
onStopCallback();
7373
}
7474
}
75-
75+
7676
public isMonitoring() {
7777
return this.hooks.length > 0;
7878
}
79-
79+
8080
public startMonitoring(
8181
mouseMoveEventMerger:IEventMerger<R>,
8282
mouseMoveCallback:IMouseMoveCallback<R>,
@@ -89,7 +89,7 @@ export class GlobalMouseMoveMonitor<R> implements Lifecycle.IDisposable {
8989
this.mouseMoveEventMerger = mouseMoveEventMerger;
9090
this.mouseMoveCallback = mouseMoveCallback;
9191
this.onStopCallback = onStopCallback;
92-
92+
9393
var windowChain = IframeUtils.getSameOriginWindowChain();
9494
for (var i = 0; i < windowChain.length; i++) {
9595
this.hooks.push(DomUtils.addDisposableThrottledListener(windowChain[i].window.document, 'mousemove',
@@ -98,7 +98,7 @@ export class GlobalMouseMoveMonitor<R> implements Lifecycle.IDisposable {
9898
));
9999
this.hooks.push(DomUtils.addDisposableListener(windowChain[i].window.document, 'mouseup', (e:MouseEvent) => this.stopMonitoring(true)));
100100
}
101-
101+
102102
if (IframeUtils.hasDifferentOriginAncestor()) {
103103
var lastSameOriginAncestor = windowChain[windowChain.length - 1];
104104
// We might miss a mouse up if it happens outside the iframe

src/vs/base/browser/idleMonitor.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,49 +17,49 @@ export enum UserStatus {
1717
export var DEFAULT_IDLE_TIME = 60 * 60 * 1000; // 60 minutes
1818

1919
export class IdleMonitor {
20-
20+
2121
private toDispose:Lifecycle.IDisposable[];
2222
private lastActiveTime:number;
2323
private idleCheckTimeout:number;
2424
private status:UserStatus;
2525
private eventEmitter:EventEmitter.EventEmitter;
2626
private instance:ReferenceCountedIdleMonitor;
2727
private idleTime:number;
28-
28+
2929
constructor(idleTime:number = DEFAULT_IDLE_TIME) {
3030
this.instance = ReferenceCountedIdleMonitor.INSTANCE;
3131
this.instance.increment();
32-
32+
3333
this.status = null;
3434
this.idleCheckTimeout = -1;
3535
this.lastActiveTime = -1;
3636
this.idleTime = idleTime;
37-
37+
3838
this.toDispose = [];
3939
this.eventEmitter = new EventEmitter.EventEmitter();
4040
this.toDispose.push(this.eventEmitter);
4141
this.toDispose.push({dispose: this.instance.addListener(() => this.onUserActive())});
4242
this.onUserActive();
4343
}
44-
44+
4545
public addOneTimeActiveListener(callback:()=>void): Lifecycle.IDisposable {
4646
return this.eventEmitter.addOneTimeDisposableListener('onActive', callback);
4747
}
48-
48+
4949
public addOneTimeIdleListener(callback:()=>void): Lifecycle.IDisposable {
5050
return this.eventEmitter.addOneTimeDisposableListener('onIdle', callback);
5151
}
52-
52+
5353
public getStatus(): UserStatus {
5454
return this.status;
5555
}
56-
56+
5757
public dispose(): void {
5858
this.cancelIdleCheck();
5959
this.toDispose = Lifecycle.disposeAll(this.toDispose);
6060
this.instance.decrement();
6161
}
62-
62+
6363
private onUserActive(): void {
6464
this.lastActiveTime = (new Date()).getTime();
6565
if (this.status !== UserStatus.Active) {
@@ -68,14 +68,14 @@ export class IdleMonitor {
6868
this.eventEmitter.emit('onActive');
6969
}
7070
}
71-
71+
7272
private onUserIdle(): void {
7373
if (this.status !== UserStatus.Idle) {
7474
this.status = UserStatus.Idle;
7575
this.eventEmitter.emit('onIdle');
7676
}
7777
}
78-
78+
7979
private scheduleIdleCheck(): void {
8080
if (this.idleCheckTimeout === -1) {
8181
var minimumTimeWhenUserCanBecomeIdle = this.lastActiveTime + this.idleTime;
@@ -85,14 +85,14 @@ export class IdleMonitor {
8585
}, minimumTimeWhenUserCanBecomeIdle - (new Date()).getTime());
8686
}
8787
}
88-
88+
8989
private cancelIdleCheck(): void {
9090
if (this.idleCheckTimeout !== -1) {
9191
clearTimeout(this.idleCheckTimeout);
9292
this.idleCheckTimeout = -1;
9393
}
9494
}
95-
95+
9696
private checkIfUserIsIdle(): void {
9797
var actualIdleTime = (new Date()).getTime() - this.lastActiveTime;
9898
if (actualIdleTime >= this.idleTime) {
@@ -104,20 +104,20 @@ export class IdleMonitor {
104104
}
105105

106106
class ReferenceCountedObject {
107-
107+
108108
private referenceCount:number;
109-
109+
110110
constructor() {
111111
this.referenceCount = 0;
112112
}
113-
113+
114114
public increment(): void {
115115
if (this.referenceCount === 0) {
116116
this.construct();
117117
}
118118
this.referenceCount++;
119119
}
120-
120+
121121
public decrement(): void {
122122
if (this.referenceCount > 0) {
123123
this.referenceCount--;
@@ -126,23 +126,23 @@ class ReferenceCountedObject {
126126
}
127127
}
128128
}
129-
129+
130130
public construct(): void {
131131
throw new Error('Implement me');
132132
}
133-
133+
134134
public dispose(): void {
135135
throw new Error('Implement me');
136136
}
137137
}
138138

139139
class ReferenceCountedIdleMonitor extends ReferenceCountedObject {
140-
140+
141141
public static INSTANCE:ReferenceCountedIdleMonitor = new ReferenceCountedIdleMonitor();
142-
142+
143143
private toDispose:Lifecycle.IDisposable[];
144144
private eventEmitter:EventEmitter.EventEmitter;
145-
145+
146146
public construct(): void {
147147
this.toDispose = [];
148148
this.eventEmitter = new EventEmitter.EventEmitter();
@@ -151,15 +151,15 @@ class ReferenceCountedIdleMonitor extends ReferenceCountedObject {
151151
this.toDispose.push(DomUtils.addDisposableListener(BrowserService.getService().document, 'keydown', () => this.onUserActive()));
152152
this.onUserActive();
153153
}
154-
154+
155155
public dispose(): void {
156156
this.toDispose = Lifecycle.disposeAll(this.toDispose);
157157
}
158-
158+
159159
private onUserActive(): void {
160160
this.eventEmitter.emit('onActive');
161161
}
162-
162+
163163
public addListener(callback:()=>void):EventEmitter.ListenerUnbind {
164164
return this.eventEmitter.addListener('onActive', callback);
165165
}

src/vs/base/browser/iframe.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function getParentWindowIfSameOrigin(w:Window): Window {
2525
if (!w.parent || w.parent === w) {
2626
return null;
2727
}
28-
28+
2929
// Cannot really tell if we have access to the parent window unless we try to access something in it
3030
try {
3131
var location = w.location;
@@ -38,7 +38,7 @@ function getParentWindowIfSameOrigin(w:Window): Window {
3838
hasDifferentOriginAncestorFlag = true;
3939
return null;
4040
}
41-
41+
4242
return w.parent;
4343
}
4444

@@ -97,34 +97,34 @@ export function hasDifferentOriginAncestor(): boolean {
9797
* Returns the position of `childWindow` relative to `ancestorWindow`
9898
*/
9999
export function getPositionOfChildWindowRelativeToAncestorWindow(childWindow:Window, ancestorWindow:any) {
100-
100+
101101
if (!ancestorWindow || childWindow === ancestorWindow) {
102102
return {
103103
top: 0,
104104
left: 0
105105
};
106106
}
107-
107+
108108
var top = 0, left = 0;
109-
109+
110110
var windowChain = getSameOriginWindowChain();
111-
111+
112112
for (var i = 0; i < windowChain.length; i++) {
113113
var windowChainEl = windowChain[i];
114-
114+
115115
if (windowChainEl.window === ancestorWindow) {
116116
break;
117117
}
118-
118+
119119
if (!windowChainEl.iframeElement) {
120120
break;
121121
}
122-
122+
123123
var boundingRect = windowChainEl.iframeElement.getBoundingClientRect();
124124
top += boundingRect.top;
125125
left += boundingRect.left;
126126
}
127-
127+
128128
return {
129129
top: top,
130130
left: left

src/vs/base/common/collections.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function contains<T>(from:any, what:any):boolean {
9494
export function keys<T>(from:IStringDictionary<T>):IIterable<string>;
9595
export function keys<T>(from:INumberDictionary<T>):IIterable<number>;
9696
export function keys<T>(from:any):IIterable<any> {
97-
97+
9898
return {
9999
every: function(callback:(element:any)=>boolean):boolean {
100100
for (var key in from) {
@@ -174,7 +174,7 @@ export function groupBy<T>(data: T[], groupFn: (element: T) => string): IStringD
174174
* compatible with the JavaScript array.
175175
*/
176176
export interface IIterable<E> {
177-
177+
178178
/**
179179
* Iterates over every element in the array
180180
* as long as the callback does not return some
@@ -273,33 +273,33 @@ interface ICacheRow<T> {
273273
* removes the older elements as new ones are inserted.
274274
*/
275275
export class LimitedSizeCache<T> {
276-
276+
277277
private cache: { [id: string]: ICacheRow<T> };
278278
private order: string[];
279-
279+
280280
constructor(private size: number) {
281281
this.cache = Object.create(null);
282282
this.order = [];
283283
}
284-
284+
285285
public get(id: string): T {
286286
var result = this.cache[id];
287287
return result && result.element;
288288
}
289-
289+
290290
public put(id: string, element: T, onRemove: ()=>void): void {
291291
var existing = this.cache[id];
292292
var row: ICacheRow<T> = { element: element, onRemove: onRemove };
293-
293+
294294
this.cache[id] = row;
295-
295+
296296
if (!existing) {
297297
this.order.push(id);
298298
}
299-
299+
300300
this.swipe();
301301
}
302-
302+
303303
private swipe(): void {
304304
while (this.order.length > this.size) {
305305
var id = this.order.shift();

0 commit comments

Comments
 (0)