The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Quick Quote

2 posters

Go down

In progress Quick Quote

Post by troyeccles Tue 1 Sep 2015 - 11:20


There may be an issue with my Quick Quote javascript.

It works ok when you select a bunch of text and then hit QUOTE but I'd have thought that the QUOTE button would have worked as normal...but it's now broken; unless you highlight a part (or all) of the text, it does nothing.

The script is below. Can anyone help to make the QUOTE button work or do I have to add in a new QUICK quote button alongside the original one?


  var forum_version = 1, 
  new_button = false,
  quote_image = '';

  if (forum_version == 0) n = [".postbody div",".name strong a"];
  if (forum_version == 1) n = [".postbody .content div",".postprofile dl dt strong a"];
  if (forum_version == 2) n = [".entry-content div",".username a"];
  if (forum_version == 3) n = [".post-entry div",".postprofile-details dt a + br + a"];
  if (new_button == true) { q = ".quickquote"; $(forum_version==1?"li:has(.i_icon_quote)":"a:has(.i_icon_quote)").after($('<li style="display:inline-block;list-style:none;"><a href="#quick_reply"><img src="'+quote_image+'" class="quickquote" alt="Quick quote" title="Quick quote" /></a></li>')) }
  if (new_button == false) { q = "a:has(.i_icon_quote)"; $("a:has(.i_icon_quote)").attr("href", "#quick_reply"); $(".i_icon_quote").attr("title", "Reply with quote") }
    qtext = $(this).parents(".post");
    if (window.getSelection) theSelection = window.getSelection().toString();
    else if (document.getSelection) theSelection = document.getSelection();
    else if (document.selection) theSelection = document.selection.createRange().text;
  $(q).click(function () {
    if (typeof qtext == 'undefined') return;
    uname = qtext.find(n[1]).text();
    $("div.sceditor-toolbar + iframe").contents().find("body").append('<blockquote><cite>' + uname + '</cite>' + theSelection + '</blockquote> <br />');
    $('.sceditor-container textarea')[0].value += '
+ uname + wrote:' + theSelection + '
  var n,q;

Posts : 301
Reputation : 5
Language : English

Back to top Go down

In progress Re: Quick Quote

Post by Ange Tuteur Tue 1 Sep 2015 - 12:01

Hi @troyeccles,

The quick quote button works based on text selection. If you want to have both quick quote and normal quote change the following in the script :
new_button = false,

and set it to "true" :
new_button = true,

That will create a separate button for the quick quote.
Ange Tuteur
Ange Tuteur

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum