diff --git a/demo/rtl/demoreadfileinput.html b/demo/rtl/demoreadfileinput.html new file mode 100644 index 0000000..ea5e234 --- /dev/null +++ b/demo/rtl/demoreadfileinput.html @@ -0,0 +1,17 @@ + + +
+ +' + LineEnding + LFileContent + LineEnding + ''; + // end edit + + // need a way to assign back modified LFileContent to LFile or create a new TJS(HTMLFile|Blob) with LFileContent as its content + // the Web API standard provides the way as a constructor parameter, but is missing from the declaration + + LFile := TJSHTMLFile.New(TJSString.New(LFileContent), DownloadFileName); + Goutput.HRef := TJSURL.createObjectURL(LFile); + Goutput.Download := DownloadFileName; + Goutput.Click; + TJSURL.revokeObjectURL(Goutput.HRef); + end; + LReader.ReadAsText(LFile); + end; +end. + diff --git a/packages/rtl/web.pas b/packages/rtl/web.pas index f0dbc17..fb585fe 100644 --- a/packages/rtl/web.pas +++ b/packages/rtl/web.pas @@ -1825,6 +1825,8 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject) FLastModifiedDate: TJSDate; external name 'lastModifiedDate'; FName: string; external name 'name'; public + constructor New(ABits: JSValue; AName: string); overload; + constructor New(ABits: JSValue; AName: string; AOptions: TJSObject); overload; property lastModified: NativeInt read FLastModified; property lastModifiedDate : TJSDate read FLastModifiedDate; deprecated; property name: String read FName; diff --git a/packages/rtl/weborworker.pas b/packages/rtl/weborworker.pas index d242fcb..e8da4e3 100644 --- a/packages/rtl/weborworker.pas +++ b/packages/rtl/weborworker.pas @@ -244,6 +244,8 @@ type FSize: NativeInt; external name 'size'; FType: string; external name 'type'; Public + constructor New(AArray: JSValue); overload; + constructor New(AArray: JSValue; AOptions: TJSObject); overload; procedure close; function slice : TJSBlob; overload; function slice(aStart : NativeInt) : TJSBlob; overload;