add option to disable the "Select Media to Download" for embeds (#485)
- Fixes #486 - Adding `nomediadownload` attr, eg. `<replay-web-page nomediadownload ...>` will hide the new option in the main menu. - Add a general EmbedOpts that setting that can be used to configure other embedding options.
This commit is contained in:
+9
-1
@@ -26,7 +26,7 @@ import { SWManager } from "./swmanager";
|
||||
import "./item";
|
||||
import "./item-index";
|
||||
import "./chooser";
|
||||
import { type LoadInfo } from "./item";
|
||||
import { type EmbedOpts, type LoadInfo } from "./item";
|
||||
import type { FavIconEventDetail } from "./types";
|
||||
|
||||
// ===========================================================================
|
||||
@@ -59,6 +59,9 @@ export class ReplayWebApp extends LitElement {
|
||||
@property({ type: String })
|
||||
embed: string | null = null;
|
||||
|
||||
@property({ type: Object })
|
||||
embedOpts: EmbedOpts = {};
|
||||
|
||||
@property({ type: String })
|
||||
collPageUrl = "";
|
||||
|
||||
@@ -398,6 +401,7 @@ export class ReplayWebApp extends LitElement {
|
||||
.loadInfo="${this.loadInfo}"
|
||||
sourceUrl="${this.sourceUrl || ""}"
|
||||
embed="${ifDefined(this.embed === null ? undefined : this.embed)}"
|
||||
.embedOpts="${this.embedOpts}"
|
||||
appName="${this.appName}"
|
||||
swName="${ifDefined(this.swName)}"
|
||||
@replay-favicons=${this.onFavIcons}
|
||||
@@ -587,6 +591,10 @@ export class ReplayWebApp extends LitElement {
|
||||
if (!this.loadInfo) {
|
||||
this.loadInfo = {};
|
||||
}
|
||||
|
||||
if (this.pageParams.has("noMediaDownload")) {
|
||||
this.embedOpts = { ...this.embedOpts, noMediaDownloadUI: true };
|
||||
}
|
||||
}
|
||||
|
||||
if (this.pageParams.get("config")) {
|
||||
|
||||
Reference in New Issue
Block a user