[Pas2js] project SaintClaus for pas2js 1.5.1

Michael Van Canneyt michael at freepascal.org
Wed Oct 16 22:39:40 CEST 2019



On Wed, 16 Oct 2019, warleyalex via Pas2js wrote:

> live preview: https://pas2js.github.io/master/projectSantaClaus/
> download project: https://pas2js.github.io/master/projectSantaClaus.rar
>
> Note:
> ===
> Project written by Ingemar Ragnemalm (2018) using the old pas2js ver 0.8.39
> (macOS).
> New version: Pas2JS Compiler version 1.5.1 [2019/10/15] for Win64 x86_64
>
> On the previous version, we have the "Uncaught (in promise) DOMException",
> In modern versions of Chrome, you can’t have videos autoplay with sound
> enabled by default. We need a button to the user click and that will break
> if play doesn't return a promise (currently, play() only returns a promise
> in Chrome, Anyway.
>
> I believe some changes are required in the web.pas unit:
>
>  TJSKeyboardEvent = class external name 'KeyboardEvent' (TJSUIEvent)
>  private
>    FkeyCode: Integer; external name 'keyCode'; // Read Only
>  Public
>    property keyCode: Integer read FkeyCode;
>  end;

Deprecated

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode

>
>  TJSHTMLImageElement = class external name 'Image' (TJSHTMLElement)
>  Public
>    constructor New; overload;
>  end;

Not according to

https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image

But I added 'overload' so the new of TJSObject is found.

>
>  TJSAudio = class external name 'Audio' (TJSHTMLAudioElement)
>  public
>    constructor New; overload;
>    constructor New(src: String); overload;
>    function play: TJSAudio; overload; external name 'play';
>  end;

I need to check this. The class is not Audio, but HTMLAudioElement.


Michael.


More information about the Pas2js mailing list