Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. DigizuiteInitPostMessage - So you know it is the Digizuite Iframe

  2. DigizuiteChangeUrlPostMessage - If the user tries to change URL

  3. DigizuiteAssetPostMessage - When a user clicks on asset. When multi-select you receive more.

Code Block
export enum MessageType {
  AssetMessage = 'AssetMessage',
  ChangeUrl = 'ChangeUrl',
  SmartPickerInitialized = 'SmartPickerInitialized',
}

export interface DigizuitePostMessage {
  messageType: MessageType;
}

export class DigizuiteInitPostMessage implements DigizuitePostMessage {
  messageType = MessageType.SmartPickerInitialized;
}

export class DigizuiteChangeUrlPostMessage implements DigizuitePostMessage {
  messageType = MessageType.ChangeUrl;
  mmUrl: string;

  constructor(mmUrl: string) {
    this.mmUrl = mmUrl;
  }
}

export class DigizuiteAssetPostMessage implements DigizuitePostMessage {
  messageType = MessageType.AssetMessage;
  asset: AssetMessage;

  constructor(asset: AssetMessage) {
    this.asset = asset;
  }
}

export interface AssetMessage {
  assetId: number;
  itemId: number;
  title: string;
  description: string;
  downloadUrl: string;
  thumb: string;
  extension: string;
}

...