phpBB2 - Asynchronous quotes  Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
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 Fri 30 Oct - 18:16

    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 Sat 31 Oct - 3:00

    I tested it on PunBB version and it works!

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


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

    phpBB2 - Asynchronous quotes  Empty Re: phpBB2 - Asynchronous quotes

    Post by Ange Tuteur Sat 31 Oct - 10:59

    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 Mon 16 May - 9:00

    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