From 241b257556826e172707689b89e6f07687f8f556 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 25 Jun 2016 06:50:24 -0500 Subject: Insert image links wherever cursor is in the editor --- view/tpl/wiki.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/tpl') diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 11c12e628..d0744009d 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -423,8 +423,8 @@ function wiki_delete_wiki(wikiHtmlName, resource_id) { $.post("embedphotos/photolink", {href: href}, function(ddata) { if (ddata['status']) { - var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '![image]($1)' ) - editor.getSession().setValue(editor.getValue() + imgURL); + var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' ) + editor.getSession().insert(editor.getCursorPosition(), imgURL) } else { window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']); } -- cgit v1.2.3