Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div data---="modal__common.form__if:request;submit:request/submit;title:Confirmation Window" class="hidden">
- <div>
- <span class="link cancel"><i class="fa fa-times"></i></span>
- <label></label>
- </div>
- <div>
- <div class="padding bgsmoke">
- <div class="row">
- <div class="col-md-6 m">
- <div data---="input__comment__type:string">Comments</div>
- </div>
- <div class="col-md-6 m">
- <div data---="input__vercode__type:password;required">Verification Code</div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12">
- <button class="pull-right" name="submit" data-exec="request/submit">
- Send request
- </button>
- </div>
- </div>
- </div>
- <hr class="nmt nmb">
- <div class="padding">
- <div class="row">
- <div class="col-md-12">
- <div><b>Response:</b></div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-12 mt10">
- <div data---="codemirror__response__type:json;height:150;">response from server goes here.</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- PLUGIN('request', function (exports) {
- exports.submit = function () {
- console.log(GET("path.to.access.comments"));
- console.log(GET("path.to.access.vercode"));
- // Event Listener whenever server websocket sends a message.
- ON('message', function (data) {
- if (data.type != null && data.type == 'request') {
- console.log('Received a message from the server');
- console.log(data);
- SET("path.to.access.code.mirror", data.response); // Display response to codemirror.
- }
- });
- // Sends values to flow server that ultimately sends an api call to another endpoint.
- SETTER('websocket', 'send', {
- 'type': 'request', 'value': {
- 'comment': GET("path.to.access.comments"),
- 'code': GET("path.to.access.vercode")
- }
- });
- }
- })
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement