diff --git a/app/client/components/CustomView.ts b/app/client/components/CustomView.ts index 70133e40..76caf650 100644 --- a/app/client/components/CustomView.ts +++ b/app/client/components/CustomView.ts @@ -57,12 +57,15 @@ export class CustomView extends Disposable { private _updateData: () => void; // debounced call to let the view know linked data changed. private _updateCursor: () => void; // debounced call to let the view know linked cursor changed. private _rpc: Rpc; // rpc connection to view. + private _emptyWidgetPage: string; public create(gristDoc: GristDoc, viewSectionModel: ViewSectionRec) { BaseView.call(this as any, gristDoc, viewSectionModel); this._customDef = this.viewSection.customDef; + this._emptyWidgetPage = new URL("custom-widget.html", gristDoc.app.topAppModel.getUntrustedContentOrigin()).href; + this.autoDisposeCallback(() => { if (this._customSection) { this._customSection.dispose(); @@ -227,7 +230,7 @@ export class CustomView extends Disposable { // in a simple and unambiguous way. let fullUrl: string; if (!baseUrl) { - fullUrl = baseUrl; + fullUrl = this._emptyWidgetPage; } else { const url = new URL(baseUrl); url.searchParams.append('access', access); diff --git a/static/custom-widget.html b/static/custom-widget.html new file mode 100644 index 00000000..0b00b690 --- /dev/null +++ b/static/custom-widget.html @@ -0,0 +1,43 @@ + + + +
+ + + ++ The Custom widget allows a user to insert almost anything in their document. + Creating a custom widget currently requires knowledge of web development, + and access to a public web server (for example, GitHub Pages). +
++ To configure this widget, open the right panel by clicking Widget options in the section menu. +
++ Learn more about Custom Widgets at: + + https://support.getgrist.com/widget-custom + +
+