summaryrefslogtreecommitdiff
path: root/frontend/app/views/tile/forms/tile.constants.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-03-31 17:37:40 +0200
committerJules Laplace <julescarbon@gmail.com>2021-03-31 17:37:40 +0200
commitcda9c115283be8e4e224f6036ba07e5eca243289 (patch)
treed0b150bf108813873c7b59cc9f9bd9c00ea3eba7 /frontend/app/views/tile/forms/tile.constants.js
parenta6793f922991d326eeb33cf08b245863218eaef7 (diff)
refactor tile forms into own files. add full-width marquee support
Diffstat (limited to 'frontend/app/views/tile/forms/tile.constants.js')
-rw-r--r--frontend/app/views/tile/forms/tile.constants.js92
1 files changed, 92 insertions, 0 deletions
diff --git a/frontend/app/views/tile/forms/tile.constants.js b/frontend/app/views/tile/forms/tile.constants.js
new file mode 100644
index 0000000..f2dd0ad
--- /dev/null
+++ b/frontend/app/views/tile/forms/tile.constants.js
@@ -0,0 +1,92 @@
+/*
+import {
+ SELECT_TYPES, ALIGNMENTS,
+ REQUIRED_KEYS,
+ IMAGE_TILE_STYLES, VIDEO_STYLES,
+ TEXT_FONT_FAMILIES, TEXT_FONT_STYLES,
+ CURSORS, UNITS,
+ NO_LINK, EXTERNAL_LINK, OPEN_POPUP_LINK, CLOSE_POPUP_LINK,
+ PAGE_LIST_TOP_OPTIONS,
+ NO_POPUP, POPUP_LIST_TOP_OPTIONS,
+} from 'app/constants'
+*/
+
+export const SELECT_TYPES = [
+ "image", "text", "video", "link", "gradient", "script",
+].map(s => ({ name: s, label: s }))
+
+export const ALIGNMENTS = [
+ "top_left", "top_center", "top_right",
+ "center_left", "center_center", "center_right",
+ "bottom_left", "bottom_center", "bottom_right",
+].map(align => ({
+ name: align,
+ label: align === 'center_center'
+ ? 'center'
+ : align.replace('_', ' ')
+ }))
+
+export const REQUIRED_KEYS = {
+ image: ['url'],
+ video: ['url'],
+ text: ['content'],
+ link: [],
+ gradient: [],
+ script: [],
+}
+
+export const IMAGE_TILE_STYLES = [
+ 'tile', 'cover', 'contain', 'contain no-repeat'
+].map(style => ({ name: style, label: style }))
+
+export const VIDEO_STYLES = [
+ 'normal', 'cover', 'contain',
+].map(style => ({ name: style, label: style }))
+
+export const TEXT_FONT_FAMILIES = [
+ 'sans-serif', 'serif', 'fantasy', 'monospace', 'cursive',
+].map(style => ({ name: style, label: style }))
+
+export const TEXT_FONT_STYLES = [
+ 'normal', 'bold', 'italic', 'bold-italic',
+].map(style => ({ name: style, label: style }))
+
+export const CURSORS = [
+ { name: 'none', label: 'None', },
+ { name: 'hand_up', label: 'Up', },
+ { name: 'hand_down', label: 'Down', },
+ { name: 'hand_left', label: 'Left', },
+ { name: 'hand_right', label: 'Right', },
+ { name: 'unclickable', label: 'Unclickable', },
+]
+
+export const MARQUEE_DIRECTIONS = [
+ { name: 'left', label: 'Left', },
+ { name: 'right', label: 'Right', },
+]
+
+export const UNITS = [
+ { name: 'px', label: 'pixels' },
+ { name: '%', label: 'percent' },
+ { name: 'video', label: 'video' },
+ { name: 'vmin', label: 'screen min' },
+ { name: 'vmax', label: 'screen max' },
+]
+
+export const NO_LINK = 0
+export const EXTERNAL_LINK = -1
+export const OPEN_POPUP_LINK = -2
+export const CLOSE_POPUP_LINK = -3
+export const PAGE_LIST_TOP_OPTIONS = [
+ { name: NO_LINK, label: 'No link' },
+ { name: EXTERNAL_LINK, label: 'External link' },
+ { name: OPEN_POPUP_LINK, label: 'Open popup' },
+ { name: CLOSE_POPUP_LINK, label: 'Close popup' },
+ { name: -99, label: '──────────', disabled: true },
+]
+
+export const NO_POPUP = 0
+export const POPUP_LIST_TOP_OPTIONS = [
+ { name: NO_POPUP, label: 'Select a popup group' },
+ { name: -99, label: '──────────', disabled: true },
+]