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.

phpBB2 - Asynchronous quotes

4 posters

Go down

phpBB2 - Asynchronous quotes  Empty phpBB2 - Asynchronous quotes

Post by relaxed Fri Oct 30, 2015 5:16 pm

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

code:
relaxed
relaxed
New Member

Posts : 2
Reputation : 3
Language : English

http://thespritas.com/

Back to top Go down

phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

Post by EndlessDream Sat Oct 31, 2015 2:00 am

I tested it on PunBB version and it works!

Thank you! I find this very useful. Smile
EndlessDream
EndlessDream
Forumember

Male Posts : 107
Reputation : 22
Language : English, Spanish, Serbian

Back to top Go down

phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

Post by Ange Tuteur Sat Oct 31, 2015 9:59 am

This is a nice plugin, as it makes quoting a lot faster ! Clap

It should work on every forum version, so long as the templates aren't modified. Wink

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();
});
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/


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 ! Yes
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

Post by Abdalah_98 Mon May 16, 2016 8:00 am

Ange Tuteur wrote:This is a nice plugin, as it makes quoting a lot faster ! Clap

It should work on every forum version, so long as the templates aren't modified. Wink

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();
});
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/


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 ! Yes

MUCH BETTER ! AND I SAY : THAT'S SHOULD BE IN NEW TOPIC cheers
Abdalah_98
Abdalah_98
Forumember

Male Posts : 32
Reputation : 1
Language : EN,AR
Location : Earth :D

http://uteach.forum0.net/

Back to top Go down

Back to top

- Similar topics

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