stompcooler.js
/**
   * Attach STOMP publisher event handlers
   *
   * @param client
   */
Attach STOMP publisher event handlers
@param client
Attach STOMP publisher event handlers @param client
function initPublishers(client) {
    let publishAttr = "data-sc-publish-to";
    let replyToAttr = "data-sc-reply-to";
    let fieldAttr = "data-field-id";
    $("body")
      .find("[" + publishAttr + "]")
      .each(function() {
        let _this = $(this);
        let destination = getAttr(_this, publishAttr);
        let replyTo = getAttr(_this, replyToAttr, null);
        let fieldId = getAttr(_this, fieldAttr, null);
        _this.on("submit", function(e) {
          e.preventDefault();
          let message_body;
          if (fieldId == null) {
            message_body = _this.serialize();
          } else {
            message_body = _this
              .find("#" + fieldId)
              .first()
              .val();
          }
          let headers;
          if (replyTo == null) {
            headers = {};
          } else {
            headers = { "reply-to": replyTo };
          }
          console.log("sending data");
          console.log(message_body);
          client.send(destination, headers, message_body);
          return false;
        });
      });
  }
function initPublishers ( client ) { let publishAttr = "data-sc-publish-to" ; let replyToAttr = "data-sc-reply-to" ; let fieldAttr = "data-field-id" ; $ ( "body" ) . find ( "[" + publishAttr + "]" ) . each ( function ( ) { let _this = $ ( this ) ; let destination = getAttr ( _this , publishAttr ) ; let replyTo = getAttr ( _this , replyToAttr , null ) ; let fieldId = getAttr ( _this , fieldAttr , null ) ; _this . on ( "submit" , function ( e ) { e . preventDefault ( ) ; let message_body ; if ( fieldId == null ) { message_body = _this . serialize ( ) ; } else { message_body = _this . find ( "#" + fieldId ) . first ( ) . val ( ) ; } let headers ; if ( replyTo == null ) { headers = { } ; } else { headers = { "reply-to" : replyTo } ; } console . log ( "sending data" ) ; console . log ( message_body ) ; client . send ( destination , headers , message_body ) ; return false ; } ) ; } ) ; }
Attach STOMP publisher event handlers
 @param client
Attach STOMP publisher event handlers @param client