From ad4c5b5a85cba6c084b95ecb869a7f86d71d235f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Mon, 27 Nov 2023 23:59:25 +0100 Subject: [PATCH] * Namespaced tinyeditor API --- packages/tinyeditor/libtinyeditor.pp | 21 ---------- .../tinyeditor/namespaced/Api.TinyEditor.pas | 3 ++ packages/tinyeditor/src/libtinyeditor.pp | 42 +++++++++++++++++++ 3 files changed, 45 insertions(+), 21 deletions(-) delete mode 100644 packages/tinyeditor/libtinyeditor.pp create mode 100644 packages/tinyeditor/namespaced/Api.TinyEditor.pas create mode 100644 packages/tinyeditor/src/libtinyeditor.pp diff --git a/packages/tinyeditor/libtinyeditor.pp b/packages/tinyeditor/libtinyeditor.pp deleted file mode 100644 index 64a845b..0000000 --- a/packages/tinyeditor/libtinyeditor.pp +++ /dev/null @@ -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. diff --git a/packages/tinyeditor/namespaced/Api.TinyEditor.pas b/packages/tinyeditor/namespaced/Api.TinyEditor.pas new file mode 100644 index 0000000..4cb4a17 --- /dev/null +++ b/packages/tinyeditor/namespaced/Api.TinyEditor.pas @@ -0,0 +1,3 @@ +{$DEFINE FPC_DOTTEDUNITS} +unit Api.TinyEditor; +{$include ../src/libtinyeditor.pp} diff --git a/packages/tinyeditor/src/libtinyeditor.pp b/packages/tinyeditor/src/libtinyeditor.pp new file mode 100644 index 0000000..6a17cb4 --- /dev/null +++ b/packages/tinyeditor/src/libtinyeditor.pp @@ -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.