Add the markdown toolbar in profile

pull/1/head
yflory 7 years ago
parent b0a384e8e0
commit acd8ab7446

@ -175,6 +175,7 @@
background-color: lighten(@bg-color, 20%); background-color: lighten(@bg-color, 20%);
display: none; display: none;
button { button {
height: @toolbar_line-height !important;
outline: 0; outline: 0;
color: @color; color: @color;
.toolbar_button; .toolbar_button;

@ -125,7 +125,7 @@
} }
.cp-app-profile-description-ok, .cp-app-profile-description-spin { .cp-app-profile-description-ok, .cp-app-profile-description-spin {
position: absolute; position: absolute;
top: 2px; bottom: 2px;
right: 2px; right: 2px;
display: none; display: none;
z-index: 1000; z-index: 1000;

@ -100,7 +100,6 @@ define([
'id': name+'Input', 'id': name+'Input',
placeholder: ph placeholder: ph
}).val(value); }).val(value);
var $icon = $('<span>', {'class': 'fa fa-pencil cp-app-profile-input-edit'});
var editing = false; var editing = false;
var todo = function () { var todo = function () {
if (editing) { return; } if (editing) { return; }
@ -126,12 +125,11 @@ define([
$input.val(lastVal); $input.val(lastVal);
} }
}); });
$icon.click(function () { $input.focus(); });
$input.focus(function () { $input.focus(function () {
$input.width(''); $input.width('');
}); });
$input.focusout(todo); $input.focusout(todo);
$block.append($input).append($icon); $block.append($input);
}); });
}; };
@ -354,6 +352,7 @@ define([
var $spinner = $('<span>', { var $spinner = $('<span>', {
'class': 'cp-app-profile-description-spin fa fa-spinner fa-pulse' 'class': 'cp-app-profile-description-spin fa fa-spinner fa-pulse'
}).appendTo($block); }).appendTo($block);
var $textarea = $('<textarea>').val(APP.lm.proxy.description || ''); var $textarea = $('<textarea>').val(APP.lm.proxy.description || '');
$block.append($textarea); $block.append($textarea);
var editor = APP.editor = CodeMirror.fromTextArea($textarea[0], { var editor = APP.editor = CodeMirror.fromTextArea($textarea[0], {
@ -363,6 +362,9 @@ define([
mode: "markdown", mode: "markdown",
}); });
var markdownTb = common.createMarkdownToolbar(editor);
$block.prepend(markdownTb.toolbar);
var onLocal = function () { var onLocal = function () {
$ok.hide(); $ok.hide();
$spinner.show(); $spinner.show();

Loading…
Cancel
Save