Hello
Can anyone make modification to this script
https://help.forumotion.com/t134813-quick-quote#907916
so basically its quick quote but you must highlight the word first before click the button the problem is when you not highlight anything it just send you to quick reply box
can anybody help how to make it quote the whole content in the post and send it to quick reply box when you not highlight anything ?
Can anyone make modification to this script
- Code:
$(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 += '[quote="' + uname + '"]' + theSelection + '[/quote]'
});
var n,q;
});
https://help.forumotion.com/t134813-quick-quote#907916
so basically its quick quote but you must highlight the word first before click the button the problem is when you not highlight anything it just send you to quick reply box
can anybody help how to make it quote the whole content in the post and send it to quick reply box when you not highlight anything ?
Last edited by nooneknow on April 2nd 2016, 8:09 pm; edited 1 time in total