aboutsummaryrefslogtreecommitdiffstats
path: root/view/tpl
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-12-02 12:27:59 +0100
committerMario Vavti <mario@mariovavti.com>2016-12-02 12:27:59 +0100
commitce0ba8edbd24ed782706c15374bd1d41f2919713 (patch)
treef93e9fc3d5d30462742ac8e013342067109eca86 /view/tpl
parentec97464007d2e770860523908231a771f7b811ec (diff)
downloadvolse-hubzilla-ce0ba8edbd24ed782706c15374bd1d41f2919713.tar.gz
volse-hubzilla-ce0ba8edbd24ed782706c15374bd1d41f2919713.tar.bz2
volse-hubzilla-ce0ba8edbd24ed782706c15374bd1d41f2919713.zip
fix embed image for text/bbcode
Diffstat (limited to 'view/tpl')
-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']);
}