tslint
This commit is contained in:
Родитель
a0f6c38606
Коммит
48f2281621
|
@ -16,7 +16,7 @@
|
|||
"mocha": "^3.1.2",
|
||||
"requirejs": "^2.3.2",
|
||||
"tfx-cli": "^0.3.30",
|
||||
"typescript": "^1.8.10",
|
||||
"typescript": "^2.1.4",
|
||||
"typings": "^1.4.0",
|
||||
"vss-web-extension-sdk": "^1.106.0"
|
||||
},
|
||||
|
@ -26,4 +26,4 @@
|
|||
"scripts": {
|
||||
"postinstall": "typings install"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
// Ignore this file. See https://github.com/grunt-ts/grunt-ts/issues/77
|
|
@ -14,7 +14,7 @@ var provider = () => {
|
|||
control.updateExternal(changedValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
VSS.register(VSS.getContribution().id, provider);
|
||||
VSS.register(VSS.getContribution().id, provider);
|
||||
|
|
|
@ -2,9 +2,8 @@
|
|||
/** The class control.ts will orchestrate the classes of InputParser, Model and View
|
||||
* in order to perform the required actions of the extensions.
|
||||
*/
|
||||
import * as VSSService from "VSS/Service";
|
||||
|
||||
import * as WitService from "TFS/WorkItemTracking/Services";
|
||||
import * as ExtensionContracts from "TFS/WorkItemTracking/ExtensionContracts";
|
||||
import { Model } from "./model";
|
||||
import { View } from "./view";
|
||||
import { ErrorView } from "./errorView";
|
||||
|
@ -29,7 +28,7 @@ export class Controller {
|
|||
Q.spread(
|
||||
[service.getFieldValue(this._fieldName)],
|
||||
(currentValue: number) => {
|
||||
// Dependent on view, model, and inputParser refactoring
|
||||
// dependent on view, model, and inputParser refactoring
|
||||
this._model = new Model(Number(currentValue));
|
||||
this._view = new View(this._model, (val) => {
|
||||
this._updateInternal(val);
|
||||
|
@ -47,7 +46,7 @@ export class Controller {
|
|||
}
|
||||
|
||||
private _handleError(error: string): void {
|
||||
let errorView = new ErrorView(error);
|
||||
new ErrorView(error);
|
||||
}
|
||||
|
||||
private _updateInternal(value: number): void {
|
||||
|
@ -56,7 +55,7 @@ export class Controller {
|
|||
service.setFieldValue(this._fieldName, value).then(
|
||||
() => {
|
||||
this._update(value);
|
||||
}, this._handleError)
|
||||
}, this._handleError);
|
||||
},
|
||||
this._handleError
|
||||
);
|
||||
|
|
|
@ -32,6 +32,6 @@ export class ErrorView {
|
|||
help.append(a);
|
||||
container.append(help);
|
||||
|
||||
$('body').empty().append(container);
|
||||
$("body").empty().append(container);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { expect } from 'chai';
|
||||
import { Model } from './model';
|
||||
import { expect } from "chai";
|
||||
import { Model } from "./model";
|
||||
|
||||
describe("Model", () => {
|
||||
let model: Model;
|
||||
|
@ -35,4 +35,4 @@ describe("Model", () => {
|
|||
expect(model.getCurrentValue()).to.be.deep.equal(18);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -7,14 +7,14 @@ export class Model {
|
|||
*/
|
||||
|
||||
constructor(initialValue: number) {
|
||||
this._currentValue = initialValue;
|
||||
this._currentValue = initialValue;
|
||||
}
|
||||
|
||||
private _currentValue: number;
|
||||
|
||||
public setCurrentValue(value: number) {
|
||||
if (value === undefined) {
|
||||
throw "Undefined value";
|
||||
throw "Undefined value";
|
||||
}
|
||||
this._currentValue = value;
|
||||
}
|
||||
|
|
|
@ -30,14 +30,13 @@ export class View {
|
|||
hitcount.attr("aria-valuenow", this.currentValue);
|
||||
hitcount.change(() => {
|
||||
this._inputChanged();
|
||||
}).on('keydown', (evt: JQueryKeyEventObject) => {
|
||||
if (evt.keyCode == 38) {
|
||||
}).on("keydown", (evt: JQueryKeyEventObject) => {
|
||||
if (evt.keyCode === 38) {
|
||||
if (this.onUpTick) {
|
||||
this.onUpTick();
|
||||
evt.preventDefault();
|
||||
}
|
||||
}
|
||||
else if (evt.keyCode == 40) {
|
||||
} else if (evt.keyCode === 40) {
|
||||
if (this.onDownTick) {
|
||||
this.onDownTick();
|
||||
evt.preventDefault();
|
||||
|
@ -68,7 +67,7 @@ export class View {
|
|||
downtick.show();
|
||||
uptick.show();
|
||||
}, () => {
|
||||
if(!hitcount.is(':focus')) {
|
||||
if (!hitcount.is(":focus")) {
|
||||
wrap.removeClass("border");
|
||||
downtick.hide();
|
||||
uptick.hide();
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
{
|
||||
"globalDependencies": {
|
||||
"chai": "registry:dt/chai#3.4.0+20160601211834",
|
||||
"jquery": "registry:dt/jquery#1.10.0+20160929162922",
|
||||
"knockout": "registry:dt/knockout#0.0.0+20160914182733",
|
||||
"mocha": "registry:dt/mocha#2.2.5+20160720003353",
|
||||
"q": "registry:dt/q#0.0.0+20161004185634",
|
||||
"require": "registry:dt/require#2.1.20+20160919185614",
|
||||
"tfs": "npm:vss-web-extension-sdk/typings/tfs.d.ts",
|
||||
"vss": "npm:vss-web-extension-sdk/typings/vss.d.ts"
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче