Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] Fast Quote
#31
To make the plugin new PHP releases and HHVM compatible, "create_function" should be replaced with anonymous functions.

E.g. change fastQuote.php (around line 122) from

    public function __construct()
    {
        global $plugins;

        // Add all hooks
        $plugins->hooks["parse_message_start"][10]["fastQuote_injectParser"] = array("function" => create_function('&$arg', 'global $plugins; $plugins->objects[\'fastQuote\']->injectParser($arg);'));
        $plugins->hooks["postbit"][10]["fastQuote_addButton"] = array("function" => create_function('&$arg', 'global $plugins; $plugins->objects[\'fastQuote\']->addButton($arg);'));
        $plugins->hooks["showthread_start"][10]["fastQuote_checkQuickReplyStatus"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'fastQuote\']->checkQuickReplyStatus();'));
        $plugins->hooks["pre_output_page"][10]["fastQuote_pluginThanks"] = array("function" => create_function('&$arg', 'global $plugins; $plugins->objects[\'fastQuote\']->pluginThanks($arg);'));
    }

to

    public function __construct()
    {
        global $plugins;

        // Add all hooks
        $plugins->hooks["parse_message_start"][10]["fastQuote_injectParser"] = array("function" => function(&$arg) { global $plugins;$plugins->objects['fastQuote']->injectParser($arg); } );
        $plugins->hooks["postbit"][10]["fastQuote_addButton"] = array("function" => function(&$arg) { global $plugins; $plugins->objects['fastQuote']->addButton($arg); } );
        $plugins->hooks["showthread_start"][10]["fastQuote_checkQuickReplyStatus"] = array("function" => function() { global $plugins; $plugins->objects['fastQuote']->checkQuickReplyStatus(); });
        $plugins->hooks["pre_output_page"][10]["fastQuote_pluginThanks"] = array("function" => function(&$arg) {global $plugins; $plugins->objects['fastQuote']->pluginThanks($arg);});
    }
Reply
#32
Version 1.2.0
    * small fix in usernames
    * code cleanup
Reply
#33
Could you incorporate tooltip next to selected text?

the tooltip consist of quote button.

http://stackoverflow.com/questions/43622...-selection
Reply
#34
Can someone tell me how to change the button style of the "Reply" button which appears when you select a text. I tried some things but it didn't work out. Would appreciate it.
Reply
#35
Is there a way to make this so that you can 1) add text to the quote image, and/or 2) only show the fast quote button when there is text selected?
Reply
#36
How do I make this plugin compatible with MyBB Go Mobile? All you see is a '*', which I have replaced with fa-fa quote right, but it doesn't look like the other buttons.

https://ontic-philosophy.com
Reply
#37
How can i switch the destination of the quote to a new editor . I am using Rin Editor and when i click the button it doesnt put the highlighted content into the quick reply editor of the Rin Editor. Can i changed the destination?
Reply
#38
Code is on github. You can feel free to edit plugin and change code for other editors.
There are many third-party editors, so I will not make any changes to make plugin compatile with them.
Reply
#39
We changed your code for the Rin Editor as it appears to put the editor in an iframe. However this works for chrome and firefox in windows, but apparently no longer in chrome in linux. It does work in firefox though in both systems. 

https://python-forum.io/jscripts/fastQuote.js line 50
function insert_text(text, spaces, popup)
{
    var textarea;
 
    if (!popup)
    {
        //textarea = document.forms[form_name].elements[text_name];
        textarea = document.forms[form_name].getElementsByTagName("iframe")[0].contentDocument.body;
    }
    else
    {
        textarea = opener.document.forms[form_name].elements[text_name];
    }
    if (spaces)
    {
        text = ' ' + text + ' ';
    }
    if (!isNaN(textarea.selectionStart))
    {
        var sel_start = textarea.selectionStart;
        var sel_end = textarea.selectionEnd;
 
        mozWrap(textarea, text, '');
        textarea.selectionStart = sel_start + text.length;
        textarea.selectionEnd = sel_end + text.length;
    }
 
    else if (textarea.createTextRange && textarea.caretPos)
    {
        if (baseHeight != textarea.caretPos.boundingHeight)
        {
            setTimeout(function() { textarea.focus(); }, 10);
            storeCaret(textarea);
        }
        var caret_pos = textarea.caretPos;
        caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
 
    }
    else
    {
        if (popup) {
            textarea.value = textarea.value + text;
        } else {
            textarea.append(text);
        }
    }
    if (!popup)
    {
        //setTimeout(function() { textarea.focus(); }, 10);
    }
}
Reply
#40
Version 1.3.0
* fix installation (close #6)
* remove thanks code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)