Feature #33018 » 33018.patch
public/javascripts/jstoolbar/jstoolbar.js | ||
---|---|---|
506 | 506 |
}); |
507 | 507 |
return false; |
508 | 508 |
}; |
509 | ||
510 |
/* Embed Image */ |
|
511 |
jsToolBar.prototype.EmbedImage = function(e, stag, etag){ |
|
512 |
var textarea = this.textarea; |
|
513 |
if (e.isTrusted |
|
514 |
&& textarea.selectionStart==textarea.selectionEnd |
|
515 |
&& $(textarea).closest('form').find('input:file.filedrop').length > 0) { |
|
516 |
handleFileDropEvent.target = textarea; |
|
517 |
var inputEl = $('input:file.filedrop').first(); |
|
518 |
inputEl.attr("accept", "image/*"); |
|
519 |
inputEl.click(); |
|
520 |
inputEl.attr("accept", ""); |
|
521 |
}else{ |
|
522 |
this.encloseSelection(stag, etag); |
|
523 |
} |
|
524 |
}; |
public/javascripts/jstoolbar/markdown.js | ||
---|---|---|
227 | 227 |
type: 'button', |
228 | 228 |
title: 'Image', |
229 | 229 |
fn: { |
230 |
wiki: function() { this.encloseSelection("![](", ")") }
|
|
230 |
wiki: function(e) { this.EmbedImage(e, "![](", ")") }
|
|
231 | 231 |
} |
232 | 232 |
} |
233 | 233 |
public/javascripts/jstoolbar/textile.js | ||
---|---|---|
226 | 226 |
type: 'button', |
227 | 227 |
title: 'Image', |
228 | 228 |
fn: { |
229 |
wiki: function() { this.encloseSelection("!", "!") }
|
|
229 |
wiki: function(e) { this.EmbedImage(e, "!", "!") }
|
|
230 | 230 |
} |
231 | 231 |
} |
232 | 232 |