1
marcionline
Quote comment(s) button?

Is there a way to include a "quote comment" button to comments, like in many others CMS ??

Thanks

2
giba
Re: Quote comment(s) button?
  • 2007/5/25 15:08

  • giba

  • Just can't stay away

  • Posts: 638

  • Since: 2003/4/26


Hi Marcio.

You is member team www.xoops.net.br , look in forum privative.

Thanks

3
marcionline
Re: Quote comment(s) button?

Well, I have found a javascript that can be used to do something like I want but I don't know to integrate it into XOOPS comments form.

Here is the code:

<script>
var 
isNav4Min = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4)
var 
isIE4Min = (navigator.appName.indexOf("Microsoft") != -&& parseInt(navigator.appVersion) >= 4)
function 
quoteSelection()
{
    var 
userSelection false;
    var 
textarea document.postform.message;

    if (
isNav4Min && window.getSelection() !=  '') {
        
userSelection window.getSelection();
    }
    else if (
isIE4Min && document.selection) {
        
userSelection document.selection.createRange().text;
    }

    if (
userSelection) {
        
insert_text'[quote]n' userSelection 'n[/quote]n'truefalse);
        
textarea.focus();
        
userSelection '';
        return;
    }
    else
    {
        
alert('Select a text in page and try again');
    }
}

</
script>


To use it is just to create a link like this:

<a href="#" onclick="quoteSelection(); return false;">Quote Selected</a>


How could I use it with XOOPS comments?

Thanks in advance.

Login

Who's Online

160 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 160


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits