Comment Box Does Not Clear After Posting.

Is this a Dolphin bug?  I have searched the forum without luck.  One would expect the normal action would be that once a person types their comments and hit the post button the comment box would clear.  On my installation it does not.  The comment stays in the comment box and has to be cleared by hand in order to post another comment.

Geeks, making the world a better place
Quote · 31 Aug 2012

I guess I am the only one seeing this.  Users are complaining about this so I know it is common to the users, not just me.

Geeks, making the world a better place
Quote · 1 Sep 2012

no, that's the way it is.. Cry

actually, what version are you using first?

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 1 Sep 2012

make SURE you get all the { and } in it.

also, ANYTIME you make code changes, just copy BxDolCmts.js to BxDolCmts.js.old  BEFORE you make the changes in case something goes wrong.

Try this, it works on my site

in the file inc/js/classes/BxDolCmts.js

around line 166 find the function BxDolCmts.prototype.toggleReply = function(e, iCmtParentId) {

replace the whole thing with this.

 

BxDolCmts.prototype.toggleReply = function(e, iCmtParentId) {
    //--- Get form for posting comment in Root ---//

        if(iCmtParentId == -1) {
            if($('#cmts-box-' + this._sSystem + '-' + this._iObjId + ' > .cmt-reply').children().length) {
                $('#cmts-box-' + this._sSystem + '-' + this._iObjId + ' > .cmt-reply').bxdolcmtanim('toggle', this._sAnimationEffect, this._iAnimationSpeed);
            }
        }
        else if(iCmtParentId == 0) {
        if($('#cmts-box-' + this._sSystem + '-' + this._iObjId + ' > .cmt-reply').children().length) {
            $('#cmts-box-' + this._sSystem + '-' + this._iObjId + ' > .cmt-reply').bxdolcmtanim('toggle', this._sAnimationEffect, this._iAnimationSpeed);
        }
//
//end SteveSoft
//
        else {
            var $this = this;
            var oData = this._getDefaultActions();           
            oData['action'] = 'FormGet';
            oData['CmtType'] = 'comment';
            oData['CmtParent'] = iCmtParentId;
           
            $this._loading (e, true);
   
            jQuery.post (
                this._sActionsUrl,
                oData,
                function (s) {                               
                    $this._loading(e, false);                   
                    $('#cmts-box-' + $this._sSystem + '-' + $this._iObjId + ' > .cmt-reply').append($(s).addClass('cmt-post-reply-expanded').css('display', 'none')).children('.cmt-post-reply').bxdolcmtanim('toggle', $this._sAnimationEffect, $this._iAnimationSpeed, function() {
                        if($this._iGlobAllowHtml == 1)
                            $this.createEditor($this._iObjId, $('#cmts-box-' + $this._sSystem + '-' + $this._iObjId + ' .cmt-reply form').find('[name=CmtText][tinypossible=true]'));
                    });
                }
            );
           
        }
    }
    //--- Get form for posting a reply ---//
    else {       
        if ($(e).parents('#cmt' + iCmtParentId).children('.cmt-post-reply').length)
            $(e).parents('#cmt' + iCmtParentId).children('.cmt-post-reply').bxdolcmtanim('toggle', this._sAnimationEffect, this._iAnimationSpeed);
        else {
            var $this = this;
            var oData = this._getDefaultActions();           
            oData['action'] = 'FormGet';
            oData['CmtType'] = 'reply';
            oData['CmtParent'] = iCmtParentId;
           
            $this._loading (e, true);
   
            jQuery.post (
                this._sActionsUrl,
                oData,
                function (s) {                               
                    $this._loading(e, false);                   
                    $(e).parents('#cmt' + iCmtParentId).children('.cmt-cont').after($(s).addClass('cmt-post-reply-expanded').css('display', 'none')).next('.cmt-post-reply').bxdolcmtanim('toggle', this._sAnimationEffect, this._iAnimationSpeed, function() {
                        if($this._iGlobAllowHtml == 1)
                            $this.createEditor(iCmtParentId, $('#cmt' + iCmtParentId + ' > .cmt-post-reply form').find('[name=CmtText][tinypossible=true]'));
                    });
                }
            );                   
        }
    }
};

 

around line 536 find

                } else {
                    $(f).find(':input:not(:button,:submit,[type = hidden],[type = radio],[type = checkbox])').val('');
                    $this._getCmt(f, oData['CmtParent'], iNewCmtId); // display just posted comment

 

ADD this
//
//start SteveSoft
//
                    $this.toggleReply(f,-1); //Close the comments box now
//
//end SteveSoft
//

 

that'll do it for you!

http://www.mytikibar.com
Quote · 1 Sep 2012

No, that just closes the comment box, and if I add the code to reopen the comment box, of course it still has the entered text. 

I can not believe that clearing the comment box after posting is not part of the core and that I have to hack the code to try and get it.  I am using Dolphin 7.0.9. if this was 1.0 or 2.0 code then I might expect it, but not in version seven.

Thanks for your help, at least I know what script controls this.   Maybe I can fix it and post back to the community.

Geeks, making the world a better place
Quote · 1 Sep 2012

OK, this should be as simple as :

// Clear the form

$("#comment_boxt").val(""); 

 

Now, if I just know how to get the actual value of "comment_box"; shouldn't this work?  call that after you submit the form. 

Geeks, making the world a better place
Quote · 1 Sep 2012

Try this.

In the file inc/js/classes/BxDolCmts.js

Find this:

    if (isVideoComment) {

        var iParentId = parseInt($(f).children('[name = CmtParent]').val());
        oData['module'] = 'video_comments';
        oData['action'] = 'post';
        oData['table'] = this._sSystemTable;
        oData['parent'] = iParentId;
        oData['id'] = this._iObjId;
        oData['author'] = this._iAuthorId;
        oData['mood'] = $(f).find('.cmt-post-reply-mood :input:checked').val();

    } else {
        oData['action'] = 'CmtPost';
tinyMCE.activeEditor.setContent("");
    }

    this._loading (eSubmit, true);
    jQuery.post (

 

Add the line of code in red

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Sep 2012

[smacks head hard]

 Of course, I forgot that TinyMCE covers the textarea with an overlay/iframe thingy.

Thanks so much.  Why isn't this already in the core?  Sometimes you may want to leave more than one reply, or if you are watching replies, might want to add a new one

Again, thanks for your help, it is much appreciated. 

Geeks, making the world a better place
Quote · 1 Sep 2012

http://www.boonex.com/trac/dolphin/ticket/2838

 

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Sep 2012

To take this a step further, you can make this change to /templates/base/scripts/BxBaseCmtsView.php

 

                <form name="cmt-post-reply" onsubmit="' . $this->_sJsObjName . '.' . $sFunction . '; return false;">
                    <input type="hidden" name="CmtParent" value="' . $iCmtParentId . '" />
                    <input type="hidden" name="CmtType" value="text" />
                    <div class="cmt-post-reply-text">
                        <textarea name="CmtText" ' . $sTinyStyle . ' >' . $sText . '</textarea>
                    </div>
                    <div class="cmt-post-reply-video">' . getApplicationContent('video_comments', 'recorder', array('user' => $this->_getAuthorId(), 'password' => $this->_getAuthorPassword(), 'extra' => implode('_', array($this->_sSystem . '-' . $this->getId(), $iCmtParentId))), true) . '</div>
                    <div class="cmt-post-reply-post"><input type="submit" value="' . _t('_Submit Comment') . '" />
                    <input type="button" value="Clear" onclick=tinyMCE.activeEditor.setContent(""); /></div>

                    ' . $sMood . '
                </form>';
    }

 

This will add an additional button to the comment box that will clear any typed in text

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 1 Sep 2012

Very nice Houstonlively, thank you Smile

Michael
Quote · 30 Nov 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.