mirror of
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat.git
synced 2025-04-19 12:33:06 -06:00
- Fixed some nodes not matching how their docs describe how they function (such as node configuration should always take precedence over inputs)
74 lines
2.5 KiB
HTML
74 lines
2.5 KiB
HTML
<script type="text/javascript">
|
|
RED.nodes.registerType('matrix-react',{
|
|
category: 'matrix',
|
|
color: '#00b7ca',
|
|
icon: "matrix.png",
|
|
outputLabels: ["success", "error"],
|
|
inputs:1,
|
|
outputs:2,
|
|
defaults: {
|
|
name: { value: null },
|
|
server: { value: "", type: "matrix-server-config" },
|
|
roomId: { value: null }
|
|
},
|
|
label: function() {
|
|
return this.name || "React";
|
|
},
|
|
paletteLabel: 'React'
|
|
});
|
|
</script>
|
|
|
|
<script type="text/html" data-template-name="matrix-react">
|
|
<div class="form-row">
|
|
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
|
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-server"><i class="fa fa-user"></i> Matrix Server Config</label>
|
|
<input type="text" id="node-input-server">
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-roomId"><i class="fa fa-user"></i> Room ID</label>
|
|
<input type="text" id="node-input-roomId" placeholder="msg.topic">
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/html" data-help-name="matrix-react">
|
|
<h3>Details</h3>
|
|
<p>React to a message in a Matrix room.</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>msg.payload
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> Usually an emoji but can also be text. </dd>
|
|
|
|
<dt>msg.topic
|
|
<span class="property-type">string | null</span>
|
|
</dt>
|
|
<dd> Room ID to send image to. Optional if configured on the node. If configured on the node this will be ignored.</dd>
|
|
|
|
<dt>msg.referenceEventId<br />
|
|
msg.eventId
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd> One of these is required. This is the eventId of the message to react to. Uses <code>msg.referenceEventId</code> first and falls back to <code>msg.eventId</code>.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Success
|
|
<dl class="message-properties">
|
|
<dt>msg.eventId <span class="property-type">string</span></dt>
|
|
<dd>the eventId from the posted reaction.</dd>
|
|
</dl>
|
|
</li>
|
|
<li>Error
|
|
<dl class="message-properties">
|
|
<dt>msg.error <span class="property-type">string</span></dt>
|
|
<dd>the error that occurred.</dd>
|
|
</dl>
|
|
</li>
|
|
</ol>
|
|
</script> |