Guest User

Untitled

a guest
Aug 28th, 2022
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. // add missing Reply buttons...
  2. $('div[id^=forum-post-]').each(function () {
  3. if ($('button[data-modal-template^=SC_Forms_Forum_]', this).length) return
  4. heart = $('button[data-forum-post-heart]', this)
  5. if (heart.length) {
  6. threadid = $('button[data-thread-subscribe]').attr('data-thread-subscribe')
  7. parentid = $('a', heart.parent().prev()).attr('href').match(/\d+$/)
  8. who = $('a[data-usercard]', this).attr('data-usercard')
  9. heart.parent().append(' <button type="button" data-toggle="tooltip" class="btn btn-primary mb-1 " '
  10. + 'data-modal-size="large" data-title="Post to this Thread" data-modal-template="SC_Forms_Forum_postNew" '
  11. + 'data-param=\'{"threadid":"' + threadid + '","parentpost":"' + parentid + '","name":"' + who + '"}\'>'
  12. + '<i class="fas fa-reply"></i> Reply</button>')
  13. }
  14. })
Advertisement
Add Comment
Please, Sign In to add comment