diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-02-26 18:19:08 -0500 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-02-26 19:48:15 -0500 |
commit | 1035c453ea6468de13db8eb04fbb55d38347ff2a (patch) | |
tree | 6334368706467665fa7a5f5d75efd1dce886620e /view/tpl/wiki.tpl | |
parent | 45e0fc6802b360710becf7ddaf6aed6a9de1d876 (diff) | |
parent | fe7fba4789fac2024c4e8e711e2f8a2492c683bd (diff) | |
download | volse-hubzilla-1035c453ea6468de13db8eb04fbb55d38347ff2a.tar.gz volse-hubzilla-1035c453ea6468de13db8eb04fbb55d38347ff2a.tar.bz2 volse-hubzilla-1035c453ea6468de13db8eb04fbb55d38347ff2a.zip |
Merge branch 'dev' into oauth2
Diffstat (limited to 'view/tpl/wiki.tpl')
-rw-r--r-- | view/tpl/wiki.tpl | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index f1ab1ebad..2be323deb 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -91,10 +91,6 @@ </div> <div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div> </div> - <div class="modal-footer"> - <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">{{$embedPhotosModalCancel}}</button> - <button id="embed-photo-OKButton" type="button" class="btn btn-primary">{{$embedPhotosModalOK}}</button> - </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> @@ -391,16 +387,10 @@ if (typeof($(image).parent()[0]) !== 'undefined') { var imageparent = document.getElementById($(image).parent()[0].id); $(imageparent).toggleClass('embed-photo-selected-photo'); - } - }); - $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); - $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); - $('#embed-photo-OKButton').click(function () { - $('.embed-photo-selected-photo').each(function (index) { - var href = $(this).attr('href'); - $.post("embedphotos/photolink", {href: href}, - function(ddata) { - if (ddata['status']) { + var href = $(imageparent).attr('href'); + $.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) @@ -408,17 +398,20 @@ var currentContent = $('#editor').val(); $('#editor').val(currentContent + ddata['photolink']); {{/if}} - } else { - window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); - } - return false; + } else { + window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']); + } + return false; }, - 'json'); - }); - $('#embedPhotoModalBodyAlbumDialog').html(''); - $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal('hide'); - }); + 'json'); + $('#embedPhotoModalBodyAlbumDialog').html(''); + $('#embedPhotoModalBodyAlbumDialog').off('click'); + $('#embedPhotoModal').modal('hide'); + } + }); + + $('#embedPhotoModalBodyAlbumListDialog').addClass('d-none'); + $('#embedPhotoModalBodyAlbumDialog').removeClass('d-none'); } else { window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); } |