This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dialog_promise (title, fields, primary_action_label) { | |
// Return a function that returns a promise | |
// The promise resolves when the dialog is submitted and rejects when the dialog is closed | |
// On resolve, the promise returns the values from the dialog. | |
return () => new Promise((resolve, reject) => { | |
const dialog = new frappe.ui.Dialog({ | |
title: title, | |
fields: fields, | |
onhide: () => reject(), | |
primary_action_label: primary_action_label, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var WebSocket = require("socket.io").listen( 6969 ); | |
WebSocket.sockets.on("connection", ws_start); | |
function ws_start(data) | |
{ | |
data.on("new_message", ws_sendData); | |
} | |
function ws_sendData(data) |