mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
markdown编辑器paste图片
This commit is contained in:
@@ -826,6 +826,11 @@ $(function() {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
// markdown编辑器paste
|
||||
$('#wmd-input-sub').on('paste', function(e) {
|
||||
pasteImage(e);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
@@ -79,10 +79,10 @@ $(function() {
|
||||
|
||||
// bind close event
|
||||
// 保存当前打开的笔记
|
||||
// win.on('close', function() {
|
||||
win.on('close', function() {
|
||||
// TODO
|
||||
// win.close(true);
|
||||
// });
|
||||
win.close(true);
|
||||
});
|
||||
|
||||
function isURL(str_url){
|
||||
var re = new RegExp("^((https|http|ftp|rtsp|mms)://).+");
|
||||
@@ -109,8 +109,9 @@ $('#noteTitle, #searchNoteInput, #searchNotebookForList, #addTagInput, #wmd-inpu
|
||||
|
||||
menu.canOpenInBroswer(!!winHref);
|
||||
var selectionType = window.getSelection().type.toUpperCase();
|
||||
var clipData = gui.Clipboard.get().get();
|
||||
menu.canPaste(clipData.length > 0);
|
||||
// var clipData = gui.Clipboard.get().get();
|
||||
// menu.canPaste(clipData.length > 0);
|
||||
menu.canPaste(true);
|
||||
menu.canCopy(selectionType === 'RANGE');
|
||||
menu.popup(e.originalEvent.x, e.originalEvent.y);
|
||||
});
|
||||
|
@@ -441,10 +441,10 @@ function pasteImage(e) {
|
||||
}
|
||||
|
||||
// 插入图片(链接)
|
||||
// TODO Markdown 插入图片
|
||||
// Markdown 插入图片
|
||||
function insertImage(link) {
|
||||
if(LEA.isMarkdownEditor()) {
|
||||
MD.insertLink(link);
|
||||
MD.insertLink(link, '', true);
|
||||
} else {
|
||||
tinymce.activeEditor.insertContent('<img src="' + link + '">');
|
||||
}
|
||||
|
Reference in New Issue
Block a user