* Namespaced tinyeditor API

This commit is contained in:
Michaël Van Canneyt 2023-11-27 23:59:25 +01:00
parent 1e4a6845b9
commit ad4c5b5a85
3 changed files with 45 additions and 21 deletions

View File

@ -1,21 +0,0 @@
unit libtinyeditor;
{$mode objfpc}
{$modeswitch externalclass}
interface
Uses JS, Web;
Type
TTinyEditor = class external name 'Object' (TJSObject)
Public
procedure transformToEditor(aElement : TJSHTMLElement);
end;
var
tinyEditor : TTinyEditor; external name '__tinyEditor';
Implementation
end.

View File

@ -0,0 +1,3 @@
{$DEFINE FPC_DOTTEDUNITS}
unit Api.TinyEditor;
{$include ../src/libtinyeditor.pp}

View File

@ -0,0 +1,42 @@
{
This file is part of the Pas2JS run time library.
Copyright (C) 2023 Michael Van Canneyt
tinyeditor import unit
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit libtinyeditor;
{$ENDIF}
{$mode objfpc}
{$modeswitch externalclass}
interface
Uses
{$IFDEF FPC_DOTTEDUNITS}
JSApi.JS, BrowserApi.Web;
{$ELSE}
JS, Web;
{$ENDIF}
Type
TTinyEditor = class external name 'Object' (TJSObject)
Public
procedure transformToEditor(aElement : TJSHTMLElement);
end;
var
tinyEditor : TTinyEditor; external name '__tinyEditor';
Implementation
end.