hubzilla issue #979 - alter image selection widget to accept/submit on choose (jot, wiki, cover_photo, profile_photo)

This commit is contained in:
zotlabs 2018-02-25 19:25:00 -08:00
parent d406e2aae2
commit 04ec35d9cc
7 changed files with 45 additions and 76 deletions

View File

@ -27,13 +27,7 @@
if (typeof($(image).parent()[0]) !== 'undefined') { if (typeof($(image).parent()[0]) !== 'undefined') {
var imageparent = document.getElementById($(image).parent()[0].id); var imageparent = document.getElementById($(image).parent()[0].id);
$(imageparent).toggleClass('embed-photo-selected-photo'); $(imageparent).toggleClass('embed-photo-selected-photo');
} var href = $(imageparent).attr('href');
});
$('#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}, $.post("embedphotos/photolink", {href: href},
function(ddata) { function(ddata) {
if (ddata['status']) { if (ddata['status']) {
@ -44,11 +38,14 @@
return false; return false;
}, },
'json'); 'json');
});
$('#embedPhotoModalBodyAlbumDialog').html(''); $('#embedPhotoModalBodyAlbumDialog').html('');
$('#embedPhotoModalBodyAlbumDialog').off('click'); $('#embedPhotoModalBodyAlbumDialog').off('click');
$('#embedPhotoModal').modal('hide'); $('#embedPhotoModal').modal('hide');
}
}); });
$('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
$('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
} else { } else {
window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
} }

View File

@ -27,13 +27,7 @@
if (typeof($(image).parent()[0]) !== 'undefined') { if (typeof($(image).parent()[0]) !== 'undefined') {
var imageparent = document.getElementById($(image).parent()[0].id); var imageparent = document.getElementById($(image).parent()[0].id);
$(imageparent).toggleClass('embed-photo-selected-photo'); $(imageparent).toggleClass('embed-photo-selected-photo');
} var href = $(imageparent).attr('href');
});
$('#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}, $.post("embedphotos/photolink", {href: href},
function(ddata) { function(ddata) {
if (ddata['status']) { if (ddata['status']) {
@ -46,11 +40,14 @@
return false; return false;
}, },
'json'); 'json');
});
$('#embedPhotoModalBodyAlbumDialog').html(''); $('#embedPhotoModalBodyAlbumDialog').html('');
$('#embedPhotoModalBodyAlbumDialog').off('click'); $('#embedPhotoModalBodyAlbumDialog').off('click');
$('#embedPhotoModal').modal('hide'); $('#embedPhotoModal').modal('hide');
}
}); });
$('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
$('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
} else { } else {
window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
} }

View File

@ -41,10 +41,6 @@
</div> </div>
<div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div> <div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div>
</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-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->

View File

@ -459,13 +459,7 @@ var activeCommentText = '';
if (typeof($(image).parent()[0]) !== 'undefined') { if (typeof($(image).parent()[0]) !== 'undefined') {
var imageparent = document.getElementById($(image).parent()[0].id); var imageparent = document.getElementById($(image).parent()[0].id);
$(imageparent).toggleClass('embed-photo-selected-photo'); $(imageparent).toggleClass('embed-photo-selected-photo');
} var href = $(imageparent).attr('href');
});
$('#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}, $.post("embedphotos/photolink", {href: href},
function(ddata) { function(ddata) {
if (ddata['status']) { if (ddata['status']) {
@ -477,11 +471,13 @@ var activeCommentText = '';
return false; return false;
}, },
'json'); 'json');
});
$('#embedPhotoModalBodyAlbumDialog').html(''); $('#embedPhotoModalBodyAlbumDialog').html('');
$('#embedPhotoModalBodyAlbumDialog').off('click'); $('#embedPhotoModalBodyAlbumDialog').off('click');
$('#embedPhotoModal').modal('hide'); $('#embedPhotoModal').modal('hide');
}
}); });
$('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
$('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
} else { } else {
window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
} }

View File

@ -293,10 +293,6 @@
</div> </div>
<div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div> <div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div>
</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-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->

View File

@ -35,8 +35,6 @@
<br /> <br />
{{/if}} {{/if}}
<div id="profile-photo-submit-wrapper"> <div id="profile-photo-submit-wrapper">
<input type="submit" name="submit" id="profile-photo-submit" value="{{$submit}}"> <input type="submit" name="submit" id="profile-photo-submit" value="{{$submit}}">
</div> </div>
@ -65,10 +63,6 @@
</div> </div>
<div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div> <div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div>
</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-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->

View File

@ -91,10 +91,6 @@
</div> </div>
<div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div> <div id="embedPhotoModalBodyAlbumDialog" class="d-none"></div>
</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-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->
@ -391,13 +387,7 @@
if (typeof($(image).parent()[0]) !== 'undefined') { if (typeof($(image).parent()[0]) !== 'undefined') {
var imageparent = document.getElementById($(image).parent()[0].id); var imageparent = document.getElementById($(image).parent()[0].id);
$(imageparent).toggleClass('embed-photo-selected-photo'); $(imageparent).toggleClass('embed-photo-selected-photo');
} var href = $(imageparent).attr('href');
});
$('#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}, $.post("embedphotos/photolink", {href: href},
function(ddata) { function(ddata) {
if (ddata['status']) { if (ddata['status']) {
@ -414,11 +404,14 @@
return false; return false;
}, },
'json'); 'json');
});
$('#embedPhotoModalBodyAlbumDialog').html(''); $('#embedPhotoModalBodyAlbumDialog').html('');
$('#embedPhotoModalBodyAlbumDialog').off('click'); $('#embedPhotoModalBodyAlbumDialog').off('click');
$('#embedPhotoModal').modal('hide'); $('#embedPhotoModal').modal('hide');
}
}); });
$('#embedPhotoModalBodyAlbumListDialog').addClass('d-none');
$('#embedPhotoModalBodyAlbumDialog').removeClass('d-none');
} else { } else {
window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']); window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
} }