aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--view/tpl/wiki.tpl5
1 files changed, 5 insertions, 0 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 226d785f5..cf4144357 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -366,8 +366,13 @@
$.post("embedphotos/photolink", {href: href},
function(ddata) {
if (ddata['status']) {
+ {{if !$mimeType || $mimeType == 'text/markdown'}}
var imgURL = ddata['photolink'].replace( /\[.*\]\[.*\](.*)\[.*\]\[.*\]/, '\n![image]($1)' )
editor.getSession().insert(editor.getCursorPosition(), imgURL)
+ {{else}}
+ var currentContent = $('#editor').val();
+ $('#editor').val(currentContent + ddata['photolink']);
+ {{/if}}
} else {
window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']);
}