You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Plugins: Add support for promo_tile manifest key
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { PluginManifest, PluginPermission, Screenshot, Icons } from './types';
|
||||
import { PluginManifest, PluginPermission, Image, Icons } from './types';
|
||||
import validatePluginId from './validatePluginId';
|
||||
|
||||
export default function manifestFromObject(o: any): PluginManifest {
|
||||
@ -31,11 +31,15 @@ export default function manifestFromObject(o: any): PluginManifest {
|
||||
return o[name];
|
||||
};
|
||||
|
||||
const getScreenshots = (defaultValue: Screenshot[] = []): Screenshot[] => {
|
||||
const getScreenshots = (defaultValue: Image[] = []): Image[] => {
|
||||
if (!o.screenshots) return defaultValue;
|
||||
return o.screenshots;
|
||||
};
|
||||
|
||||
const getPromoTile = (): Image => {
|
||||
return o.promo_tile || null;
|
||||
};
|
||||
|
||||
const getIcons = (): Icons => {
|
||||
if (!o.icons) return null;
|
||||
for (const size of [16, 32, 48, 128]) {
|
||||
@ -62,6 +66,7 @@ export default function manifestFromObject(o: any): PluginManifest {
|
||||
screenshots: getScreenshots(),
|
||||
permissions: permissions,
|
||||
icons: getIcons(),
|
||||
promo_tile: getPromoTile(),
|
||||
|
||||
_recommended: getBoolean('_recommended', false, false),
|
||||
};
|
||||
|
Reference in New Issue
Block a user