Bladeren bron

* Namespaced tinyeditor API

Michaël Van Canneyt 1 jaar geleden
bovenliggende
commit
ad4c5b5a85

+ 0 - 21
packages/tinyeditor/libtinyeditor.pp

@@ -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.

+ 3 - 0
packages/tinyeditor/namespaced/Api.TinyEditor.pas

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

+ 42 - 0
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.