5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 07:31:42 +00:00

editor: WIP: <small>

This commit is contained in:
void 2021-03-26 15:31:36 +00:00
parent 102cd0abd3
commit 117fa84cc4
7 changed files with 9 additions and 3 deletions

View file

@ -61,7 +61,7 @@
.editor-content { .editor-content {
min-height: 480px; min-height: 480px;
p, h1, h2, h3, h4, h5, h6, ul, li, figcaption { outline: #ccc solid thin; } p, h1, h2, h3, h4, h5, h6, ul, li, figcaption { outline: #ccc solid thin; }
strong, em, del, u, sub, sup { background: #0002; } strong, em, del, u, sub, sup, small { background: #0002; }
a { background: #13fefe50; } a { background: #13fefe50; }
[data-editor-selected] { outline: #f206f9 solid thick; } [data-editor-selected] { outline: #f206f9 solid thick; }
} }

View file

@ -27,6 +27,7 @@ export const marks: { [propName: string]: EditorNode } = {
super: makeMark('super', 'sup'), super: makeMark('super', 'sup'),
mark, mark,
link, link,
small: makeMark('small', 'small'),
} }
function recursiveFilterSelection ( function recursiveFilterSelection (

View file

@ -1,7 +1,7 @@
import { Editor } from 'editor/editor' import { Editor } from 'editor/editor'
export const blockNames = ['paragraph', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'unordered_list', 'ordered_list'] export const blockNames = ['paragraph', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'unordered_list', 'ordered_list']
export const markNames = ['bold', 'italic', 'deleted', 'underline', 'sub', 'super', 'mark', 'link'] export const markNames = ['bold', 'italic', 'deleted', 'underline', 'sub', 'super', 'mark', 'link', 'small']
export const parentBlockNames = ['left', 'center', 'right'] export const parentBlockNames = ['left', 'center', 'right']
export function moveChildren (from: Element, to: Element, toRef: Node | null) { export function moveChildren (from: Element, to: Element, toRef: Node | null) {

View file

@ -178,7 +178,7 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type,
def allowed_tags def allowed_tags
@allowed_tags ||= %w[strong em del u mark p h1 h2 h3 h4 h5 h6 ul ol li img iframe audio video div figure @allowed_tags ||= %w[strong em del u mark p h1 h2 h3 h4 h5 h6 ul ol li img iframe audio video div figure
figcaption a].freeze figcaption a small].freeze
end end
# Decifra el valor # Decifra el valor

View file

@ -47,6 +47,9 @@
%button.btn{ type: 'button', title: t('editor.sub'), data: { editor_button: 'mark-sub' } }> %button.btn{ type: 'button', title: t('editor.sub'), data: { editor_button: 'mark-sub' } }>
%i.fa.fa-fw.fa-subscript> %i.fa.fa-fw.fa-subscript>
%span.sr-only>= t('editor.sub') %span.sr-only>= t('editor.sub')
%button.btn{ type: 'button', title: t('editor.small'), data: { editor_button: 'mark-small' } }>
%i.fa.fa-fw.fa-subscript>
%span.sr-only>= t('editor.small')
%button.btn.mr-0{ type: 'button', title: t('editor.h1'), data: { editor_button: 'block-h1' } }> %button.btn.mr-0{ type: 'button', title: t('editor.h1'), data: { editor_button: 'block-h1' } }>
%i.fa.fa-fw.fa-heading> %i.fa.fa-fw.fa-heading>
1 1

View file

@ -584,6 +584,7 @@ en:
link: Link link: Link
super: Superscript super: Superscript
sub: Subscript sub: Subscript
small: Small
h1: Heading 1 h1: Heading 1
h2: Heading 2 h2: Heading 2
h3: Heading 3 h3: Heading 3

View file

@ -596,6 +596,7 @@ es:
mark: Resaltado mark: Resaltado
super: Índice super: Índice
sub: Subíndice sub: Subíndice
small: Chico
link: Vínculo link: Vínculo
h1: Título 1 h1: Título 1
h2: Título 2 h2: Título 2