The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Quick Quote

View previous topic View next topic Go down

In progress Quick Quote

Post by troyeccles on September 1st 2015, 11:20 am

Hi,

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?

--------

$(function(){
var forum_version = 1,
new_button = false,
quote_image = 'http://i39.servimg.com/u/f39/18/21/60/73/quick10.png';

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") }

$(document).on('mouseup',n[0],function(e){
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;
});

troyeccles
Forumember

Posts : 239
Reputation : 5
Language : English

Back to top Go down

In progress Re: Quick Quote

Post by Ange Tuteur on September 1st 2015, 12:01 pm

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 :
Code:
new_button = false,

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

That will create a separate button for the quick quote.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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