diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-25 06:50:24 -0500 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-25 06:50:24 -0500 |
commit | 241b257556826e172707689b89e6f07687f8f556 (patch) | |
tree | f3610100278ad6ec323972022298ca19e09c8f15 /view/tpl/wiki.tpl | |
parent | 83a42afddf6e5ffd04028431b36aed6ecadf5b9d (diff) | |
download | volse-hubzilla-241b257556826e172707689b89e6f07687f8f556.tar.gz volse-hubzilla-241b257556826e172707689b89e6f07687f8f556.tar.bz2 volse-hubzilla-241b257556826e172707689b89e6f07687f8f556.zip |
Insert image links wherever cursor is in the editor
Diffstat (limited to 'view/tpl/wiki.tpl')
-rw-r--r-- | view/tpl/wiki.tpl | 4 |
1 files changed, 2 insertions, 2 deletions
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']); } |