mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 10:36:21 +00:00
Merge branch 'rails' into panel.sutty.nl
This commit is contained in:
commit
1a9bdb95e1
7 changed files with 19 additions and 3 deletions
|
@ -67,7 +67,11 @@
|
||||||
|
|
||||||
.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, blockquote, figcaption { outline: #ccc solid thin; }
|
||||||
|
blockquote {
|
||||||
|
border-left: #555 solid .25em;
|
||||||
|
padding: .75em;
|
||||||
|
}
|
||||||
strong, em, del, u, sub, sup, small { 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; }
|
||||||
|
|
|
@ -21,11 +21,12 @@ function makeBlock(tag: string): EditorBlock {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const li: EditorBlock = makeBlock("li");
|
export const li: EditorBlock = makeBlock("li");
|
||||||
|
const paragraph: EditorBlock = makeBlock("p");
|
||||||
|
|
||||||
// XXX: si agregás algo acá, agregalo a blockNames
|
// XXX: si agregás algo acá, agregalo a blockNames
|
||||||
// (y probablemente le quieras hacer un botón en app/views/posts/attributes/_content.haml)
|
// (y probablemente le quieras hacer un botón en app/views/posts/attributes/_content.haml)
|
||||||
export const blocks: { [propName: string]: EditorBlock } = {
|
export const blocks: { [propName: string]: EditorBlock } = {
|
||||||
paragraph: makeBlock("p"),
|
paragraph,
|
||||||
h1: makeBlock("h1"),
|
h1: makeBlock("h1"),
|
||||||
h2: makeBlock("h2"),
|
h2: makeBlock("h2"),
|
||||||
h3: makeBlock("h3"),
|
h3: makeBlock("h3"),
|
||||||
|
@ -42,6 +43,11 @@ export const blocks: { [propName: string]: EditorBlock } = {
|
||||||
allowedChildren: ["li"],
|
allowedChildren: ["li"],
|
||||||
handleEmpty: li,
|
handleEmpty: li,
|
||||||
},
|
},
|
||||||
|
blockquote: {
|
||||||
|
...makeBlock("blockquote"),
|
||||||
|
allowedChildren: blockNames,
|
||||||
|
handleEmpty: paragraph,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export function setupButtons(editor: Editor): void {
|
export function setupButtons(editor: Editor): void {
|
||||||
|
|
|
@ -10,6 +10,7 @@ export const blockNames = [
|
||||||
"h6",
|
"h6",
|
||||||
"unordered_list",
|
"unordered_list",
|
||||||
"ordered_list",
|
"ordered_list",
|
||||||
|
"blockquote",
|
||||||
];
|
];
|
||||||
export const markNames = [
|
export const markNames = [
|
||||||
"bold",
|
"bold",
|
||||||
|
|
|
@ -202,7 +202,7 @@ MetadataTemplate = Struct.new(:site, :document, :name, :label, :type,
|
||||||
end
|
end
|
||||||
|
|
||||||
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 blockquote
|
||||||
figcaption a sub sup small].freeze
|
figcaption a sub sup small].freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,9 @@
|
||||||
%button.btn{ type: 'button', title: t('editor.right'), data: { editor_button: 'parentBlock-right' } }>
|
%button.btn{ type: 'button', title: t('editor.right'), data: { editor_button: 'parentBlock-right' } }>
|
||||||
%i.fa.fa-fw.fa-align-right>
|
%i.fa.fa-fw.fa-align-right>
|
||||||
%span.sr-only>= t('editor.right')
|
%span.sr-only>= t('editor.right')
|
||||||
|
%button.btn{ type: 'button', title: t('editor.blockquote'), data: { editor_button: 'block-blockquote' } }>
|
||||||
|
%i.fa.fa-fw.fa-quote-left>
|
||||||
|
%span.sr-only>= t('editor.blockquote')
|
||||||
|
|
||||||
-# HAML cringe
|
-# HAML cringe
|
||||||
.editor-auxiliary-toolbar.mt-1.scrollbar-black{ data: { editor_auxiliary_toolbar: '' } }
|
.editor-auxiliary-toolbar.mt-1.scrollbar-black{ data: { editor_auxiliary_toolbar: '' } }
|
||||||
|
|
|
@ -577,6 +577,7 @@ en:
|
||||||
left: Left
|
left: Left
|
||||||
right: Right
|
right: Right
|
||||||
center: Center
|
center: Center
|
||||||
|
blockquote: Quote
|
||||||
color: Color
|
color: Color
|
||||||
text-color: Text color
|
text-color: Text color
|
||||||
multimedia: Media
|
multimedia: Media
|
||||||
|
|
|
@ -585,6 +585,7 @@ es:
|
||||||
left: Izquierda
|
left: Izquierda
|
||||||
right: Derecha
|
right: Derecha
|
||||||
center: Centro
|
center: Centro
|
||||||
|
blockquote: Cita
|
||||||
color: Color
|
color: Color
|
||||||
text-color: Color del texto
|
text-color: Color del texto
|
||||||
multimedia: Multimedia
|
multimedia: Multimedia
|
||||||
|
|
Loading…
Reference in a new issue