diff options
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 43 | ||||
-rw-r--r-- | view/js/mod_cdav.js | 4 |
2 files changed, 45 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js index 1322c2112..e91bd914d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -231,6 +231,10 @@ function handle_comment_form(e) { $('#' + emptyCommentElm).removeAttr('tabindex'); $('#' + emptySubmitElm).removeAttr('tabindex'); form.find(':not(.comment-edit-text)').hide(); + form.find(':input[name=parent]').val(emptyCommentElm.replace(/\D/g,'')); + var btn = form.find(':button[type=submit]').html(); + form.find(':button[type=submit]').html(btn.replace(/<[^>]*>/g, '').trim()); + form.find(':button[type=submit]').prop('title', ''); } }); @@ -1144,8 +1148,44 @@ function doprofilelike(ident, verb) { $.get('like/' + ident + '?verb=' + verb, function() { window.location.href=window.location.href; }); } +function doreply(parent, ident, owner, hint) { + var form = $('#comment-edit-form-' + parent.toString()); + form.find('input[name=parent]').val(ident); + var i = form.find('button[type=submit]'); + var btn = i.html().replace(/<[^>]*>/g, '').trim(); + i.html('<i class="fa fa-reply" ></i> ' + btn); + i.prop('title', hint); + form.find('textarea').val("@{" + owner + "} "); + $('#comment-edit-text-' + parent.toString()).focus(); +} + +function doscroll(parent, hidden) { + var x = '#hide-comments-outer-' + hidden.toString(); + var back = $('#back-to-reply'); + if(back.length == 0) + var pos = $(window).scrollTop(); + else + var pos = back.attr('href').replace(/[^\d|\.]/g,''); + if($(x).length !== 0) { + x = $(x).attr("onclick").replace(/\D/g,''); + var c = '#collapsed-comments-' + x; + if($(c).length !== 0 && (! $(c).is(':visible'))) { + showHideComments(x); + pos += $(c).height(); + } + } + back.remove(); + var id = $('[data-mid="' + parent + '"]'); + $('html, body').animate({scrollTop:(id.offset().top) - 50}, 'slow'); + $('<a href="javascript:doscrollback(' + pos + ');" id="back-to-reply" class="float-right" title="' + aStr['to_reply'] + '"><i class="fa fa-angle-double-down"> </i></a>').insertBefore('#wall-item-info-' + id.attr('id').replace(/\D/g,'')); +} -function dropItem(url, object) { +function doscrollback(pos) { + $('#back-to-reply').remove(); + $(window).scrollTop(pos); +} + +function dropItem(url, object) { var confirm = confirmDelete(); if(confirm) { @@ -1157,7 +1197,6 @@ function dropItem(url, object) { }); }); return true; - } else { return false; diff --git a/view/js/mod_cdav.js b/view/js/mod_cdav.js new file mode 100644 index 000000000..31ce87f7a --- /dev/null +++ b/view/js/mod_cdav.js @@ -0,0 +1,4 @@ +$(document).ready(function() { + $('#id_description').editor_autocomplete(baseurl + "/acl"); + $('textarea').bbco_autocomplete('bbcode'); +}); |