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.
The forum of the forums
4 posters

    phpBB2 - Asynchronous quotes

    relaxed
    relaxed
    New Member


    Posts : 2
    Reputation : 3
    Language : English

    phpBB2 - Asynchronous quotes  Empty phpBB2 - Asynchronous quotes

    Post by relaxed October 30th 2015, 6: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:
    EndlessDream
    EndlessDream
    Forumember


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

    phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

    Post by EndlessDream October 31st 2015, 3:00 am

    I tested it on PunBB version and it works!

    Thank you! I find this very useful. Smile
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & ę—„ęœ¬čŖž
    Location : Pennsylvania

    phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

    Post by Ange Tuteur October 31st 2015, 10: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
    Abdalah_98
    Abdalah_98
    Forumember


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

    phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

    Post by Abdalah_98 May 16th 2016, 9: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

      Current date/time is September 23rd 2024, 4:30 am