Quick Quote
2 posters
Page 1 of 1
Quick Quote
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 = 'https://i.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 += '
});
var n,q;
});
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 = 'https://i.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 : 301
Reputation : 5
Language : English
Re: Quick Quote
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 :
and set it to "true" :
That will create a separate button for the quick quote.
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.
Similar topics
» Quoting a quote - Script bug Quick quote?
» Quick quote
» Quick quote change
» Quick Quote?
» Quick Quote Modification
» Quick quote
» Quick quote change
» Quick Quote?
» Quick Quote Modification
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum