public/js/util.js
function (msg, nodeId, ns, isShow) {
            ns = ns || Rocket.Plugin.currentPlugin.namespace;
            var node = $("#" + ns + "_" + nodeId),
                msgSpan = node.find("span.message");
            isShow ? node.removeClass("hide") && node.css("display", "block") : node.addClass("hide");
            if (node.data("autohide") == true && !node.hasClass("hide")) {
                node.delay(4000).fadeOut(1000, function () {
                    $(this).addClass("hide");
                    $(msgSpan).html("");
                });
            }

            //attach close listener to hide the flash message
            $(node.find(".close")).click(function () {
                node.addClass('hide').css("display", "none");
                $(msgSpan).html("");
            });

            if (msg) msgSpan.html(msg);
        }
function (msg, nodeId, ns, isShow) {
            ns = ns || Rocket.Plugin.currentPlugin.namespace;
            var node = $("#" + ns + "_" + nodeId),
                msgSpan = node.find("span.message");
            isShow ? node.removeClass("hide") && node.css("display", "block") : node.addClass("hide");
            if (node.data("autohide") == true && !node.hasClass("hide")) {
                node.delay(4000).fadeOut(1000, function () {
                    $(this).addClass("hide");
                    $(msgSpan).html("");
                });
            }

            //attach close listener to hide the flash message
            $(node.find(".close")).click(function () {
                node.addClass('hide').css("display", "none");
                $(msgSpan).html("");
            });

            if (msg) msgSpan.html(msg);
        }
function ( msg , nodeId , ns , isShow ) { ns = ns || Rocket . Plugin . currentPlugin . namespace ; var node = $ ( "#" + ns + "_" + nodeId ) , msgSpan = node . find ( "span.message" ) ; isShow ? node . removeClass ( "hide" ) && node . css ( "display" , "block" ) : node . addClass ( "hide" ) ; if ( node . data ( "autohide" ) == true && ! node . hasClass ( "hide" ) ) { node . delay ( 4000 ) . fadeOut ( 1000 , function ( ) { $ ( this ) . addClass ( "hide" ) ; $ ( msgSpan ) . html ( "" ) ; } ) ; } //attach close listener to hide the flash message $ ( node . find ( ".close" ) ) . click ( function ( ) { node . addClass ( 'hide' ) . css ( "display" , "none" ) ; $ ( msgSpan ) . html ( "" ) ; } ) ; if ( msg ) msgSpan . html ( msg ) ; }
Method to toggle show of a flash messages

Jade template should be as
for error flash

#<nodeId>.hide.alert.alert-error
button(class="close", data-dismiss="alert") x
span.message

for success flash

#<nodeId>.hide.alert.alert-success
button(class="close", data-dismiss="alert") x
span.message



@param msg - Message to be displayed
@param nodeId - Id for flash message container
@param ns -  Namespace of current plugin
@param isShow - flag to show or hide
Method to toggle show of a flash messages