Updates on Twitter-In node: 1. Node now takes topic string input rather than hard-coded 2. "Sticky" followers: If new input string suggests updates in handles to follow, creates "sticky" new intervals - meaning previously followed handles are maintained, new ones added 3. Node now takes refresh time as an input value, previously hardcoded at 60s

This commit is contained in:
hgill
2021-05-05 22:20:02 +05:30
parent 4bd657fcd8
commit 3bb5bcf9b5
3 changed files with 78 additions and 19 deletions

View File

@@ -96,6 +96,10 @@
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
</div>
<div class="form-row">
<label for="node-input-pollInterval"><i class="fa fa-clock"></i> <span data-i18n="twitter.label.pollInterval"></span></label>
<input type="text" id="node-input-pollInterval" data-i18n="[placeholder]twitter.placeholder.pollInterval">
</div>
<div class="form-tips"><span data-i18n="[html]twitter.tip"></span></div>
</script>
@@ -108,7 +112,8 @@
tags: {value:""},
user: {value:"false",required:true},
name: {value:""},
inputs: {value:0}
inputs: {value:0},
pollInterval: {value:60000}
},
inputs: 0,
outputs: 1,
@@ -139,6 +144,7 @@
var userph = this._("twitter.placeholder.user");
var forlabel = this._("twitter.label.for");
var forph = this._("twitter.placeholder.for");
var pollInterval = this._("twitter.placeholder.pollInterval")
$("#node-input-user").change(function() {
var type = $("#node-input-user option:selected").val();
if (type == "user") {
@@ -156,7 +162,7 @@
$("#node-input-user").change();
},
oneditsave: function() {
if ($('#node-input-tags').val() === '' && $("#node-input-user option:selected").val() === 'false') {
if ($('#node-input-tags').val() === ''/* && $("#node-input-user option:selected").val() === 'false'*/) {
this.inputs = 1;
}
else {