Added shortcut "y" to remove formatting of whole text area. Streamline of common css behaviour for p and code in mail clients.

This commit is contained in:
Martin Edenhofer 2016-05-17 13:51:20 +02:00
parent 327a0bd50a
commit 30e40b62d1
4 changed files with 34 additions and 21 deletions

View file

@ -361,6 +361,12 @@ App.Config.set(
description: 'Removes the formatting' description: 'Removes the formatting'
globalEvent: 'richtext-remove-formating' globalEvent: 'richtext-remove-formating'
} }
{
key: 'y'
hotkeys: true
description: '... of whole textarea'
globalEvent: 'richtext-remove-formating-textarea'
}
{ {
key: 'z' key: 'z'
hotkeys: true, hotkeys: true,

View file

@ -111,6 +111,7 @@
// altKey + ctrlKey + i -> Toggles the current selection between italic and non-italic // altKey + ctrlKey + i -> Toggles the current selection between italic and non-italic
// altKey + ctrlKey + v -> Toggles the current selection between strike and non-strike // altKey + ctrlKey + v -> Toggles the current selection between strike and non-strike
// altKey + ctrlKey + f -> Removes the formatting tags from the current selection // altKey + ctrlKey + f -> Removes the formatting tags from the current selection
// altKey + ctrlKey + y -> Removes the formatting from while textarea
// altKey + ctrlKey + z -> Inserts a Horizontal Rule // altKey + ctrlKey + z -> Inserts a Horizontal Rule
// altKey + ctrlKey + l -> Toggles the text selection between an unordered list and a normal block // altKey + ctrlKey + l -> Toggles the text selection between an unordered list and a normal block
// altKey + ctrlKey + k -> Toggles the text selection between an ordered list and a normal block // altKey + ctrlKey + k -> Toggles the text selection between an ordered list and a normal block
@ -125,7 +126,8 @@
|| e.keyCode == 76 || e.keyCode == 76
|| e.keyCode == 75 || e.keyCode == 75
|| e.keyCode == 86 || e.keyCode == 86
|| e.keyCode == 87)) { || e.keyCode == 87
|| e.keyCode == 89)) {
e.preventDefault() e.preventDefault()
// disable rich text b/u/i // disable rich text b/u/i
@ -145,6 +147,9 @@
if (e.keyCode == 70) { if (e.keyCode == 70) {
document.execCommand('RemoveFormat') document.execCommand('RemoveFormat')
} }
if (e.keyCode == 89) {
App.Utils.htmlRemoveRichtext(_this.$element)
}
if (e.keyCode == 90) { if (e.keyCode == 90) {
document.execCommand('insertHorizontalRule') document.execCommand('insertHorizontalRule')
} }

View file

@ -147,6 +147,10 @@ blockquote {
display: inline-block; display: inline-block;
} }
.u-notAllowed {
cursor: not-allowed;
}
.zIndex-1, .zIndex-1,
.zIndex-2, .zIndex-2,
.zIndex-3, .zIndex-3,
@ -8120,7 +8124,6 @@ output {
} }
.richtext-content { .richtext-content {
p,
table, table,
pre, pre,
blockquote { blockquote {
@ -8175,7 +8178,7 @@ output {
code { code {
border: none; border: none;
background: hsl(0,0%,97%); background: hsl(0,0%,97%);
white-space: normal; white-space: pre-wrap;
} }
pre { pre {

View file

@ -180,7 +180,6 @@ Check if string is a complete html document. If not, add head and css styles.
p, table, div, td { p, table, div, td {
max-width: 600px; max-width: 600px;
} }
p,
table, table,
pre, pre,
blockquote { blockquote {
@ -203,7 +202,7 @@ Check if string is a complete html document. If not, add head and css styles.
code { code {
border: none; border: none;
background: hsl(0,0%,97%); background: hsl(0,0%,97%);
white-space: normal; white-space: pre-wrap;
} }
blockquote { blockquote {
padding: 8px 12px; padding: 8px 12px;