Library location and deployment
The editor is built on the Summernote JavaScript library, which must be available to the embedded web control at run time. The LibraryLocation property decides where that library comes from, and that single choice has real consequences for how — and where — your application can run. Read this chapter before you ship: the right setting depends on whether your users will have internet access.
Online vs offline
LibraryLocation is a TTMSFNCWXLibraryLocation with two values:
| Value | Behavior | Use when |
|---|---|---|
llOnline (default) |
Loads the library live from a content-delivery network (CDN). | The machine has reliable internet; you want the smallest deployment and the fastest first load. |
llOffline |
Loads the library from bundled resources. | The application must work without a network — kiosk, intranet, field, or air-gapped deployments. |
Important
With the default llOnline setting the editor requires an internet connection. If your application may run offline, switch to llOffline.
procedure TForm1.ConfigureLibraryLocation;
begin
{ llOnline (default) pulls the JavaScript library from a CDN: smaller deploy,
faster first paint, but requires an internet connection at run time. }
TMSFNCWXHTMLMemo1.LibraryLocation := llOnline;
{ llOffline loads the library from bundled resources, so the editor works
with no network. Use this for kiosk, intranet or air-gapped deployments. }
if not InternetAvailable then
TMSFNCWXHTMLMemo1.LibraryLocation := llOffline;
end;
llOffline guarantees the editor works with no connection, at the cost of slightly slower loading on lower-powered devices. Decide based on your target environment, and prefer setting LibraryLocation before the editor initializes so the correct source is used on the first load.
Hosting caveats
When the editor is hosted inside a container that intercepts mouse clicks before they reach the embedded control, the toolbar dropdowns may fail to open. This is most often seen with a TWebPanel in TMS WEB Core applications and inside some modal hosts.
In a TMS WEB Core application, allow click events to propagate to the editor:
{ Inside your web form's OnCreate: let clicks reach the embedded editor. }
WebPanel1.EventStopPropagation := WebPanel1.EventStopPropagation - [eeClick];
Alternatively, enable full propagation on the host panel (EnablePropagation := True). On native frameworks (FMX/VCL), prefer hosting the editor directly on the form or a plain container rather than a control that captures input.
Pitfalls
- Shipping with
llOnlineto an offline environment. The editor will not load its library and stays blank. Test on a disconnected machine, and switch tollOfflinewhen in doubt. - Toolbar dropdowns not opening. Almost always an event-propagation issue from the host container — see Hosting caveats above.
- Changing
LibraryLocationafter initialization. Set it early (design time or before first show) so the editor loads from the intended source.
See also
- Configuring the toolbar — the dropdowns affected by the hosting caveat.
- Events —
OnInitconfirms the library finished loading. TTMSFNCWXHTMLMemoAPI reference