Project

General

Profile

Feature #33018 » 33018.patch

Takenori TAKAKI, 2020-03-11 10:22

View differences:

public/javascripts/jstoolbar/jstoolbar.js
});
return false;
};
/* Embed Image */
jsToolBar.prototype.EmbedImage = function(e, stag, etag){
var textarea = this.textarea;
if (e.isTrusted
&& textarea.selectionStart==textarea.selectionEnd
&& $(textarea).closest('form').find('input:file.filedrop').length > 0) {
handleFileDropEvent.target = textarea;
var inputEl = $('input:file.filedrop').first();
inputEl.attr("accept", "image/*");
inputEl.click();
inputEl.attr("accept", "");
}else{
this.encloseSelection(stag, etag);
}
};
public/javascripts/jstoolbar/markdown.js
type: 'button',
title: 'Image',
fn: {
wiki: function() { this.encloseSelection("![](", ")") }
wiki: function(e) { this.EmbedImage(e, "![](", ")") }
}
}
public/javascripts/jstoolbar/textile.js
type: 'button',
title: 'Image',
fn: {
wiki: function() { this.encloseSelection("!", "!") }
wiki: function(e) { this.EmbedImage(e, "!", "!") }
}
}
(3-3/4)