images

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageFeature = &ImageFeatureBlock{
	BaseFeature: features.BaseFeature{
		Type:          "image",
		JSConstructor: "Image",
		JSFiles: []string{
			"editorjs/js/deps/tools/image.js",
		},
		Build: func(fb *features.FeatureBlock) *features.FeatureBlock {
			fb.GetString = func(d editor.BlockData) string {
				return fmt.Sprintf("[%s](%s)", d.Data["caption"], d.Data["url"])
			}
			return fb
		},
		Register: func(m django.Mux) {
			m.Post(
				"/upload-image",
				mux.NewHandler(uploadImage),
				"upload-image",
			)
		},
	},
	RenderFunc: renderImage,
}

Functions

This section is empty.

Types

type ImageFeatureBlock

type ImageFeatureBlock features.Block

func (*ImageFeatureBlock) Config

func (i *ImageFeatureBlock) Config(widgetContext ctx.Context) map[string]interface{}

Jump to

Keyboard shortcuts

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