banner_editor

package module
v0.0.0-...-ee5d14e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 18 Imported by: 19

README

BannerEditor

A visual editor to design a banner with customize elements, e.g. Text, Button, etc.

Documentation

https://doc.getqor.com/metas/banner-editor.html

License

Released under the MIT License.

Documentation

Index

Constants

View Source
const (
	// Laptop default laptop platform name
	Laptop = "Laptop"
	// Mobile default mobile platform name
	Mobile = "Mobile"
)

Variables

This section is empty.

Functions

func Create

func Create(context *admin.Context)

Create handle create setting

func GetContent

func GetContent(value string, detector interface{}) string

GetContent return HTML string by detector, detector could be a string (Platform, Mobile or other), http request and nil

func New

func New(context *admin.Context)

New handle new setting page

func RegisterElement

func RegisterElement(e *Element)

RegisterElement register a element

func RegisterExternalStylePath

func RegisterExternalStylePath(path string)

RegisterExternalStylePath register a asset path

func RegisterViewPath

func RegisterViewPath(p string)

RegisterViewPath register views directory

func SetAssetFS

func SetAssetFS(assetFS assetfs.Interface)

SetAssetFS set asset fs for render

func Update

func Update(context *admin.Context)

Update handle update setting

Types

type BannerEditorConfig

type BannerEditorConfig struct {
	MediaLibrary    *admin.Resource
	Elements        []string
	SettingResource *admin.Resource
	Platforms       []Platform
}

BannerEditorConfig configure display elements and setting model

func (*BannerEditorConfig) ConfigureQorMeta

func (config *BannerEditorConfig) ConfigureQorMeta(metaor resource.Metaor)

ConfigureQorMeta configure route and funcmap for banner_editor meta

type Element

type Element struct {
	Icon     string
	Name     string
	Label    string
	Template string
	Resource *admin.Resource
	Context  func(context *admin.Context, setting interface{}) interface{}
}

Element represent a button/element in banner_editor toolbar

func GetElement

func GetElement(name string) *Element

GetElement returnn element struct by name

type Platform

type Platform struct {
	Name     string
	SafeArea Size
}

Platform used to defined how many platform a banner need to support

type QorBannerEditorSetting

type QorBannerEditorSetting struct {
	gorm.Model
	serializable_meta.SerializableMeta
}

QorBannerEditorSetting default setting model

func (QorBannerEditorSetting) GetID

func (setting QorBannerEditorSetting) GetID() uint

GetID return setting ID

func (QorBannerEditorSetting) GetSerializableArgumentResource

func (setting QorBannerEditorSetting) GetSerializableArgumentResource() *admin.Resource

GetSerializableArgumentResource return setting's resource

type QorBannerEditorSettingInterface

type QorBannerEditorSettingInterface interface {
	GetID() uint
	serializable_meta.SerializableMetaInterface
}

QorBannerEditorSettingInterface interface to support customize setting model

type Size

type Size struct {
	Width  int
	Height int
}

Size contains width ad height

Directories

Path Synopsis
test

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL