Refactor the file-system-access API to be synchronous. Added *Sync equivalents of the file-system APIs. Removed usage of file-system-access within the code.

This commit is contained in:
atanasovg
2015-08-04 16:52:27 +03:00
parent 114118bc7a
commit c683ea44e6
13 changed files with 370 additions and 361 deletions

View File

@@ -1,13 +1,11 @@
import observable = require("data/observable");
import fs = require("file-system");
import fileSystemAccess = require("file-system/file-system-access");
var fileAccess = new fileSystemAccess.FileSystemAccess();
export class WebViewModel extends observable.Observable {
constructor() {
super();
fileAccess.readText(fs.path.join(__dirname, "style.css"), (result) => { this._css = result; });
var file = fs.File.fromPath(fs.path.join(__dirname, "style.css"));
this._css = file.readTextSync();
}
private _url: string;
@@ -19,19 +17,6 @@ export class WebViewModel extends observable.Observable {
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "url", value: value });
}
//private _text: string;
//get text(): string {
// return this._text;
//}
//set text(value: string) {
// this._text = value;
// this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "text", value: value });
// if (application.ios) {
// this.url = this.text;
// }
//}
private _css: string;
get css(): string {
return this._css;