复制外链图片, 复制到leanote

This commit is contained in:
lealife
2015-10-10 16:18:26 +08:00
parent 320263eefa
commit c844c8b188
6 changed files with 26 additions and 64 deletions

View File

@ -47,8 +47,9 @@ define("tinymce/pasteplugin/Clipboard", [
ajaxPost("/file/copyHttpImage", {src: src}, function(ret) {
if(reIsOk(ret)) {
// 将图片替换之
var src = urlPrefix + "/" + ret.Item;
var dom = editor.dom
// var src = urlPrefix + "/" + ret.Item;
var src = urlPrefix + "/file/outputImage?fileId=" + ret.Id;
var dom = editor.dom;
for(var i in ids) {
var id = ids[i];
var imgElm = dom.get(id);

View File

@ -44,26 +44,11 @@ define("tinymce/pasteplugin/Plugin", [
}
}
}
function togglePasteCopyImage() {
if (clipboard.copyImage) {
this.active(false);
clipboard.copyImage = false
} else {
clipboard.copyImage = true;
this.active(true);
if (!userIsInformed2) {
editor.windowManager.alert(
"When copy other site's images (not in leanote) into editor, it will copy the image into your album."
);
userIsInformed2 = true;
}
}
}
self.clipboard = clipboard = new Clipboard(editor);
self.quirks = new Quirks(editor);
self.wordFilter = new WordFilter(editor);
clipboard.copyImage = true;
if (editor.settings.paste_as_text) {
self.clipboard.pasteFormat = "text";
@ -116,13 +101,6 @@ define("tinymce/pasteplugin/Plugin", [
onclick: togglePlainTextPaste,
active: self.clipboard.pasteFormat == "text"
});
editor.addButton('pasteCopyImage', {
icon: 'copy',
tooltip: "When Paste other site's image, copy it into my album as public image",
onclick: togglePasteCopyImage,
active: self.clipboard.copyImage === true
});
editor.addMenuItem('pastetext', {
text: 'Paste as text',

View File

@ -117,4 +117,4 @@
writeScripts();
})(this);
// $hash: e0933a5a75e12f26b54b4e7b86f5bdc2
// $hash: cb0df1bfb67ded475df65e7e75c7998f

View File

@ -232,8 +232,9 @@ define("tinymce/pasteplugin/Clipboard", [
ajaxPost("/file/copyHttpImage", {src: src}, function(ret) {
if(reIsOk(ret)) {
// 将图片替换之
var src = urlPrefix + "/" + ret.Item;
var dom = editor.dom
// var src = urlPrefix + "/" + ret.Item;
var src = urlPrefix + "/file/outputImage?fileId=" + ret.Id;
var dom = editor.dom;
for(var i in ids) {
var id = ids[i];
var imgElm = dom.get(id);
@ -1103,26 +1104,11 @@ define("tinymce/pasteplugin/Plugin", [
}
}
}
function togglePasteCopyImage() {
if (clipboard.copyImage) {
this.active(false);
clipboard.copyImage = false
} else {
clipboard.copyImage = true;
this.active(true);
if (!userIsInformed2) {
editor.windowManager.alert(
"When copy other site's images (not in leanote) into editor, it will copy the image into your album."
);
userIsInformed2 = true;
}
}
}
self.clipboard = clipboard = new Clipboard(editor);
self.quirks = new Quirks(editor);
self.wordFilter = new WordFilter(editor);
clipboard.copyImage = true;
if (editor.settings.paste_as_text) {
self.clipboard.pasteFormat = "text";
@ -1175,13 +1161,6 @@ define("tinymce/pasteplugin/Plugin", [
onclick: togglePlainTextPaste,
active: self.clipboard.pasteFormat == "text"
});
editor.addButton('pasteCopyImage', {
icon: 'copy',
tooltip: "When Paste other site's image, copy it into my album as public image",
onclick: togglePasteCopyImage,
active: self.clipboard.copyImage === true
});
editor.addMenuItem('pastetext', {
text: 'Paste as text',

File diff suppressed because one or more lines are too long