aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-06-25 06:50:24 -0500
committerAndrew Manning <tamanning@zoho.com>2016-06-25 06:50:24 -0500
commit241b257556826e172707689b89e6f07687f8f556 (patch)
treef3610100278ad6ec323972022298ca19e09c8f15 /view/tpl
parent83a42afddf6e5ffd04028431b36aed6ecadf5b9d (diff)
downloadvolse-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')
-rw-r--r--view/tpl/wiki.tpl4
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']);
}