Feature #33018 » 33018.patch
| 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, "!", "!") }
|
||
|
}
|
||
|
}
|
||