提交 ef11e2d0 编写于 作者: J Johannes Rieken

remove more unused code, #38414

上级 3dd8f493
......@@ -436,21 +436,6 @@ export class Builder implements IDisposable {
return this;
}
/**
* Calls select() on the current HTML element;
*/
public domSelect(range: IRange = null): Builder {
let input = <HTMLInputElement>this.currentElement;
input.select();
if (range) {
input.setSelectionRange(range.start, range.end);
}
return this;
}
/**
* Calls blur() on the current HTML element;
*/
......@@ -660,15 +645,6 @@ export class Builder implements IDisposable {
return this;
}
/**
* Sets the name attribute to the value provided for the current HTML element of the builder.
*/
public name(name: string): Builder {
this.currentElement.setAttribute('name', name);
return this;
}
/**
* Sets the type attribute to the value provided for the current HTML element of the builder.
*/
......@@ -1284,15 +1260,6 @@ export class Builder implements IDisposable {
return this;
}
/**
* Returns a new builder with the parent element of the current element of the builder.
*/
public parent(offdom?: boolean): Builder {
assert.ok(!this.offdom, 'Builder was created with offdom = true and thus has no parent set');
return withElement(<HTMLElement>this.currentElement.parentNode, offdom);
}
/**
* Returns a new builder with the child at the given index.
*/
......@@ -1750,4 +1717,4 @@ export const $: QuickBuilder = function (arg?: any): Builder {
(<any>$).Builder = Builder;
(<any>$).MultiBuilder = MultiBuilder;
(<any>$).Build = Build;
(<any>$).Binding = Binding;
\ No newline at end of file
(<any>$).Binding = Binding;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export class Event {
public time: number;
public originalEvent: Event;
public source: any;
constructor(originalEvent?: Event) {
this.time = (new Date()).getTime();
this.originalEvent = originalEvent;
this.source = null;
}
}
export class PropertyChangeEvent extends Event {
public key: string;
public oldValue: any;
public newValue: any;
constructor(key?: string, oldValue?: any, newValue?: any, originalEvent?: Event) {
super(originalEvent);
this.key = key;
this.oldValue = oldValue;
this.newValue = newValue;
}
}
export class ViewerEvent extends Event {
public element: any;
constructor(element: any, originalEvent?: Event) {
super(originalEvent);
this.element = element;
}
}
export interface ISelectionEvent {
selection: any[];
payload?: any;
source: any;
}
export interface IFocusEvent {
focus: any;
payload?: any;
source: any;
}
export interface IHighlightEvent {
highlight: any;
payload?: any;
source: any;
}
export const EventType = {
PROPERTY_CHANGED: 'propertyChanged',
SELECTION: 'selection',
FOCUS: 'focus',
BLUR: 'blur',
HIGHLIGHT: 'highlight',
EXPAND: 'expand',
COLLAPSE: 'collapse',
TOGGLE: 'toggle',
BEFORE_RUN: 'beforeRun',
RUN: 'run',
EDIT: 'edit',
SAVE: 'save',
CANCEL: 'cancel',
CHANGE: 'change',
DISPOSE: 'dispose',
};
......@@ -306,8 +306,6 @@ suite('Builder', () => {
divBuilder.span({
innerHtml: 'see man'
});
assert.strictEqual(divBuilder.parent().attr('id'), 'foobar');
});
test('Builder.clone()', function () {
......@@ -390,7 +388,6 @@ suite('Builder', () => {
// Assert HTML through DOM
let root = document.getElementById(fixtureId);
assert.strictEqual(b.parent().getHTMLElement(), root);
assert.strictEqual(root.childNodes.length, 1);
let div = root.childNodes[0];
......@@ -551,21 +548,18 @@ suite('Builder', () => {
b.id('foobar');
b.title('foobar');
b.name('foobar');
b.type('foobar');
b.value('foobar');
b.tabindex(0);
assert.strictEqual(b.attr('id'), 'foobar');
assert.strictEqual(b.attr('title'), 'foobar');
assert.strictEqual(b.attr('name'), 'foobar');
assert.strictEqual(b.attr('type'), 'foobar');
assert.strictEqual(b.attr('value'), 'foobar');
assert.strictEqual(b.attr('tabindex'), '0');
assert.strictEqual(b.getHTMLElement().getAttribute('id'), 'foobar');
assert.strictEqual(b.getHTMLElement().getAttribute('title'), 'foobar');
assert.strictEqual(b.getHTMLElement().getAttribute('name'), 'foobar');
assert.strictEqual(b.getHTMLElement().getAttribute('type'), 'foobar');
assert.strictEqual(b.getHTMLElement().getAttribute('value'), 'foobar');
assert.strictEqual(b.getHTMLElement().getAttribute('tabindex'), '0');
......@@ -1382,4 +1376,4 @@ suite('Builder', () => {
assert.equal((<HTMLElement>obj.firstChild).tagName.toLowerCase(), 'span');
assert.equal((<HTMLElement>obj.firstChild).className, 'core');
});
});
\ No newline at end of file
});
......@@ -8,7 +8,6 @@ import { TPromise } from 'vs/base/common/winjs.base';
import paths = require('vs/base/common/paths');
import URI from 'vs/base/common/uri';
import glob = require('vs/base/common/glob');
import events = require('vs/base/common/events');
import { isLinux } from 'vs/base/common/platform';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import Event from 'vs/base/common/event';
......@@ -245,12 +244,11 @@ export interface IFileChange {
resource: URI;
}
export class FileChangesEvent extends events.Event {
export class FileChangesEvent {
private _changes: IFileChange[];
constructor(changes: IFileChange[]) {
super();
this._changes = changes;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册