added more keyboard shortcuts to the extended wiki editor.

changed the standard wiki editor to capture a tab key and insert '\t'.
removed blockquote from the extended wiki editor
This commit is contained in:
hyung-hwan 2016-01-19 08:01:29 +00:00
parent eb924c6c7e
commit b3cbcf09ab
3 changed files with 87 additions and 5 deletions

View File

@ -470,6 +470,25 @@ $(function () {
$('#wiki_edit_text_preview').hide(); $('#wiki_edit_text_preview').hide();
$(window).resize(resize_text_editor); $(window).resize(resize_text_editor);
resize_text_editor (); resize_text_editor ();
$('#wiki_edit_text_area').keydown (function(e) {
if (e.keyCode == 9) // capture a tab key to insert "\n".
{
// get caret position/selection
var start = this.selectionStart;
var end = this.selectionEnd;
var $this = $(this);
var value = $this.val();
// set textarea value to: text before caret + tab + text after caret
$this.val(value.substring(0, start) + "\t" + value.substring(end));
// put caret at right position again (add one for the tab)
this.selectionStart = this.selectionEnd = start + 1;
e.preventDefault();
}
});
}); });
</script> </script>

View File

@ -368,7 +368,7 @@ $(function () {
buttons: ['bold', 'italic', 'underline', 'strikethrough', buttons: ['bold', 'italic', 'underline', 'strikethrough',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'subscript', 'superscript', 'removeFormat', 'subscript', 'superscript', 'removeFormat',
'quote', 'pre', 'anchor', 'image', 'pre', 'anchor', 'image',
'orderedlist', 'unorderedlist', 'indent', 'outdent', 'orderedlist', 'unorderedlist', 'indent', 'outdent',
'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull', 'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',
'table'], 'table'],
@ -396,6 +396,67 @@ $(function () {
cleanTags: ['meta'] cleanTags: ['meta']
}, },
keyboardCommands: {
commands: [
{ // ctrl-b
command: 'bold',
key: 'B',
meta: true,
shift: false,
alt: false
},
{ // ctrl-i
command: 'italic',
key: 'I',
meta: true,
shift: false,
alt: false
},
{ // ctrl-u
command: 'underline',
key: 'U',
meta: true,
shift: false,
alt: false
},
{ // alt-i
command: 'indent',
key: 'I',
meta: false,
shift: false,
alt: true
},
{ // alt-o
command: 'outdent',
key: 'O',
meta: false,
shift: false,
alt: true
},
{ // alt-l
command: 'insertUnorderedList',
key: 'L',
meta: false,
shift: false,
alt: true
},
{ // alt-p
command: 'append-pre',
key: 'P',
meta: false,
shift: false,
alt: true
},
{ // alt-h
command: 'append-h1',
key: 'H',
meta: false,
shift: false,
alt: true
}
]
},
extensions: { extensions: {
table: new MediumEditorTable() table: new MediumEditorTable()
} }

View File

@ -603,7 +603,7 @@ pre, code, tt {
span.codepot-open-issue-count { span.codepot-open-issue-count {
-moz-border-radius: 45%; -moz-border-radius: 45%;
-webkit-border-radius: 45%; -webkit-border-radius: 45%;
border-radius: 45%; border-radius: 30%;
background-color: #BB4444; background-color: #BB4444;
color: white; color: white;
font-weight: bold; font-weight: bold;
@ -814,8 +814,9 @@ span.codepot-open-issue-count {
.codepot-plain-text-view blockquote, .codepot-plain-text-view blockquote,
.codepot-styled-text-view blockquote, .codepot-styled-text-view blockquote,
.codepot-styled-text-preview blockquote { .codepot-styled-text-preview blockquote {
background: #F5F5F5; /*background: #F5F5F5;*/
border-left: 5px solid #CCCCCC; background: inherit;
border-left: 3px solid #EEEEEE;
margin: 1em 1em 1em 1em; margin: 1em 1em 1em 1em;
padding: 0.5em 0.5em 0.5em 0.5em; padding: 0.5em 0.5em 0.5em 0.5em;
} }
@ -875,7 +876,8 @@ span.codepot-open-issue-count {
.codepot-styled-text-preview blockquote pre { .codepot-styled-text-preview blockquote pre {
border: none; border: none;
margin: 0; margin: 0;
background-color: inherit; /*background-color: inherit;*/
background-color: #F5F5F5;
} }
.codepot-styled-code-view pre, .codepot-styled-code-view pre,