phpBB2 - Asynchronous quotes
4 posters
Page 1 of 1
phpBB2 - Asynchronous quotes
just something I was experimenting with when I got bored
it's a simple script that just loads the text from a quote and puts it into the quick reply textbox
it's a simple script that just loads the text from a quote and puts it into the quick reply textbox
- code:
- Code:
$(document).ready(function() {
var quote_text_info;
$(".i_icon_quote").parent().click(function(e) {
e.preventDefault();
$.get($(this).attr("href"), function(data) {
quote_text_info = $(data).find("textarea").val();
$('.sceditor-container textarea').val($('.sceditor-container textarea').val()+quote_text_info+"\n");
$("html, body").animate({ scrollTop: $('.sceditor-container textarea').offset().top }, 1000, function() {
$('.sceditor-container textarea').focus();
});
});
});
});
Re: phpBB2 - Asynchronous quotes
I tested it on PunBB version and it works!
Thank you! I find this very useful.
Thank you! I find this very useful.
EndlessDream- Forumember
- Posts : 107
Reputation : 22
Language : English, Spanish, Serbian
Re: phpBB2 - Asynchronous quotes
This is a nice plugin, as it makes quoting a lot faster !
It should work on every forum version, so long as the templates aren't modified.
I have some suggestions though :
1. I think the target element is a problem, as it's getting cut off on my one forum. I'd recommend scrolling to this anchor since it's right above the quick reply :
2. .sceditor-container textarea only affects Source mode, not WYSIWYG mode. So, I would recommend setting a sceditor instance on the GET request :
3. I'd change the textarea element in the GET request to #text_editor_textarea as that's the main id for the message editor. If someone has a textarea in the widgets for example, it'll also get this value which is why you should look for specifics or the first instance.
With those suggestions it'll look something like this :
Regardless, keep up the good work !
It should work on every forum version, so long as the templates aren't modified.
I have some suggestions though :
1. I think the target element is a problem, as it's getting cut off on my one forum. I'd recommend scrolling to this anchor since it's right above the quick reply :
- Code:
document.anchors.quickreply
2. .sceditor-container textarea only affects Source mode, not WYSIWYG mode. So, I would recommend setting a sceditor instance on the GET request :
- Code:
$.get($(this).attr("href"), function(data) {
var instance = $('#text_editor_textarea').sceditor('instance');
instance.insert(quote_text_info + "\n");
instance.focus();
});
3. I'd change the textarea element in the GET request to #text_editor_textarea as that's the main id for the message editor. If someone has a textarea in the widgets for example, it'll also get this value which is why you should look for specifics or the first instance.
With those suggestions it'll look something like this :
- Code:
$(function() {
$(".i_icon_quote").parent().click(function(e) {
$.get(this.href, function(data) {
var quote_text_info = $('#text_editor_textarea', data).val(),
instance = $("#text_editor_textarea").sceditor("instance");
instance.insert(quote_text_info + "\n");
$("html, body").animate({ scrollTop: $(document.anchors.quickreply).offset().top }, 1000, function() {
instance.focus();
});
});
e.preventDefault();
});
});
Regardless, keep up the good work !
Re: phpBB2 - Asynchronous quotes
Ange Tuteur wrote:This is a nice plugin, as it makes quoting a lot faster !
It should work on every forum version, so long as the templates aren't modified.
I have some suggestions though :
1. I think the target element is a problem, as it's getting cut off on my one forum. I'd recommend scrolling to this anchor since it's right above the quick reply :
- Code:
document.anchors.quickreply
2. .sceditor-container textarea only affects Source mode, not WYSIWYG mode. So, I would recommend setting a sceditor instance on the GET request :This way, it'll affect both source AND WYSIWYG mode. Check out this documentation for modifications to the SCEditor : http://www.sceditor.com/api/sceditor/
- Code:
$.get($(this).attr("href"), function(data) {
var instance = $('#text_editor_textarea').sceditor('instance');
instance.insert(quote_text_info + "\n");
instance.focus();
});
3. I'd change the textarea element in the GET request to #text_editor_textarea as that's the main id for the message editor. If someone has a textarea in the widgets for example, it'll also get this value which is why you should look for specifics or the first instance.
With those suggestions it'll look something like this :
- Code:
$(function() {
$(".i_icon_quote").parent().click(function(e) {
$.get(this.href, function(data) {
var quote_text_info = $('#text_editor_textarea', data).val(),
instance = $("#text_editor_textarea").sceditor("instance");
instance.insert(quote_text_info + "\n");
$("html, body").animate({ scrollTop: $(document.anchors.quickreply).offset().top }, 1000, function() {
instance.focus();
});
});
e.preventDefault();
});
});
Regardless, keep up the good work !
MUCH BETTER ! AND I SAY : THAT'S SHOULD BE IN NEW TOPIC
Similar topics
» Quotes Not showing
» Make quoted author name clickable in quotes
» Issue in replies with quotes
» How to hide foes in quotes
» Multi-Quotes Background Color
» Make quoted author name clickable in quotes
» Issue in replies with quotes
» How to hide foes in quotes
» Multi-Quotes Background Color
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum