Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. jQuery(document).ready(function ($) {
  2. var id = 'wc-textarea-0_0';
  3. settings = {
  4. id: id,
  5. buttons: 'strong,em,link,ul,ol,li'
  6. }
  7. QTags.addButton('wpdiscuz_blockquot', 'b-quote', '<blockquote>', '</blockquote>', '', 'Blockquote', 40);
  8. QTags.addButton('wpdiscuz_underline', 'U', '<u>', '</u>', '', 'Underline', 50);
  9. QTags.addButton('wpdiscuz_code', 'code', '`', '`', '', 'Code', 110);
  10. QTags.addButton('wpdiscuz_spoiler', 'spoiler', '[spoiler title=" "]', '[/spoiler]', '', 'Spoiler', 115);
  11. quicktags(settings);
  12.  
  13. $(document).delegate('.wc-reply-button', 'click', function () {
  14. var uniqueId = 'wc-textarea-' + wpdiscuzGetUniqueId($(this));
  15. if (uniqueId) {
  16. var settings = {
  17. id: uniqueId,
  18. buttons: 'strong,em,link,ul,ol,li'
  19. }
  20. quicktags(settings);
  21. QTags._buttonsInit();
  22. }
  23. });
  24. function wpdiscuzGetUniqueId(field) {
  25. var uniqueId = 0;
  26. if (field.parents('.wc-comment').attr('id')) {
  27. uniqueId = field.parents('.wc-comment').attr('id');
  28. }
  29. if (uniqueId !== 0 && uniqueId.length) {
  30. uniqueId = uniqueId.substring(uniqueId.lastIndexOf('-') + 1);
  31. }
  32. return uniqueId;
  33. }
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement