Insert image links wherever cursor is in the editor
This commit is contained in:
parent
83a42afddf
commit
241b257556
@ -423,8 +423,8 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) {
|
|||||||
$.post("embedphotos/photolink", {href: href},
|
$.post("embedphotos/photolink", {href: href},
|
||||||
function(ddata) {
|
function(ddata) {
|
||||||
if (ddata['status']) {
|
if (ddata['status']) {
|
||||||
var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '' )
|
var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n' )
|
||||||
editor.getSession().setValue(editor.getValue() + imgURL);
|
editor.getSession().insert(editor.getCursorPosition(), imgURL)
|
||||||
} else {
|
} else {
|
||||||
window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']);
|
window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user