1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Rename typedInput.options

This commit is contained in:
Nick O'Leary 2016-01-04 15:11:24 +00:00
parent 587c4e5915
commit 231adac6d8
5 changed files with 13 additions and 13 deletions

View File

@ -52,11 +52,11 @@
}); });
this.uiSelect.addClass("red-ui-typedInput-container"); this.uiSelect.addClass("red-ui-typedInput-container");
this.options.options = this.options.options||Object.keys(allOptions); this.options.types = this.options.types||Object.keys(allOptions);
var hasSubOptions = false; var hasSubOptions = false;
this.typeMap = {}; this.typeMap = {};
this.types = this.options.options.map(function(opt) { this.types = this.options.types.map(function(opt) {
var result; var result;
if (typeof opt === 'string') { if (typeof opt === 'string') {
result = allOptions[opt]; result = allOptions[opt];
@ -115,7 +115,7 @@
}); });
} }
this.menu = this._createMenu(this.types, function(v) { that.type(v) }); this.menu = this._createMenu(this.types, function(v) { that.type(v) });
this.type(this.options.default||this.options.options[0]); this.type(this.options.default||this.types[0].value);
}, },
_hideMenu: function(menu) { _hideMenu: function(menu) {
$(document).off("mousedown.close-property-select"); $(document).off("mousedown.close-property-select");

View File

@ -230,7 +230,7 @@
$("#node-input-payload").typedInput({ $("#node-input-payload").typedInput({
default: 'str', default: 'str',
typeField: $("#node-input-payloadType"), typeField: $("#node-input-payloadType"),
options:['flow','global','str','num','bool','json',{value:"date",label:this._("inject.timestamp"),hasValue:false}] types:['flow','global','str','num','bool','json',{value:"date",label:this._("inject.timestamp"),hasValue:false}]
}); });
$("#inject-time-type-select").change(function() { $("#inject-time-type-select").change(function() {

View File

@ -84,7 +84,7 @@
} }
$("#node-input-field").typedInput({ $("#node-input-field").typedInput({
default: 'msg', default: 'msg',
options: ['msg','flow','global'], types: ['msg','flow','global'],
typeField: $("#node-input-fieldType") typeField: $("#node-input-fieldType")
}); });

View File

@ -65,7 +65,7 @@
return this.name||"switch"; return this.name||"switch";
}, },
oneditprepare: function() { oneditprepare: function() {
$("#node-input-property").typedInput({default:this.propertyType||'msg',options:['msg','flow','global']}); $("#node-input-property").typedInput({default:this.propertyType||'msg',types:['msg','flow','global']});
var operators = [ var operators = [
{v:"eq",t:"=="}, {v:"eq",t:"=="},
{v:"neq",t:"!="}, {v:"neq",t:"!="},
@ -128,10 +128,10 @@
selectField.append($("<option></option>").val(operators[d].v).text(operators[d].t)); selectField.append($("<option></option>").val(operators[d].v).text(operators[d].t));
} }
var valueField = $('<input/>',{class:"node-input-rule-value",type:"text",style:"margin-left: 5px; width: 145px;"}).appendTo(row).typedInput({default:'str',options:['msg','flow','global','str','num']}); var valueField = $('<input/>',{class:"node-input-rule-value",type:"text",style:"margin-left: 5px; width: 145px;"}).appendTo(row).typedInput({default:'str',types:['msg','flow','global','str','num']});
var btwnValueField = $('<input/>',{class:"node-input-rule-btwn-value",type:"text",style:"margin-left: 5px;"}).appendTo(row).typedInput({default:'num',options:['msg','flow','global','str','num']}); var btwnValueField = $('<input/>',{class:"node-input-rule-btwn-value",type:"text",style:"margin-left: 5px;"}).appendTo(row).typedInput({default:'num',types:['msg','flow','global','str','num']});
var btwnAndLabel = $('<span/>',{class:"node-input-rule-btwn-label"}).text(" "+andLabel+" ").appendTo(row3); var btwnAndLabel = $('<span/>',{class:"node-input-rule-btwn-label"}).text(" "+andLabel+" ").appendTo(row3);
var btwnValue2Field = $('<input/>',{class:"node-input-rule-btwn-value2",type:"text",style:"margin-left:2px;"}).appendTo(row3).typedInput({default:'num',options:['msg','flow','global','str','num']}); var btwnValue2Field = $('<input/>',{class:"node-input-rule-btwn-value2",type:"text",style:"margin-left:2px;"}).appendTo(row3).typedInput({default:'num',types:['msg','flow','global','str','num']});
var finalspan = $('<span/>',{style:"float: right;margin-right: 10px;"}).appendTo(row); var finalspan = $('<span/>',{style:"float: right;margin-right: 10px;"}).appendTo(row);
finalspan.append(' &#8594; <span class="node-input-rule-index">'+i+'</span> '); finalspan.append(' &#8594; <span class="node-input-rule-index">'+i+'</span> ');

View File

@ -133,21 +133,21 @@
selectField.append($("<option></option>").val(selectOptions[i].v).text(selectOptions[i].l)); selectField.append($("<option></option>").val(selectOptions[i].v).text(selectOptions[i].l));
} }
var propertyName = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-name",type:"text"}).appendTo(row1).typedInput({options:['msg','flow','global']}); var propertyName = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-name",type:"text"}).appendTo(row1).typedInput({types:['msg','flow','global']});
var finalspan = $('<span/>',{style:"float: right; margin-right: 10px;"}).appendTo(row1); var finalspan = $('<span/>',{style:"float: right; margin-right: 10px;"}).appendTo(row1);
var deleteButton = $('<a/>',{href:"#",class:"editor-button editor-button-small", style:"margin-top: 7px; margin-left: 5px;"}).appendTo(finalspan); var deleteButton = $('<a/>',{href:"#",class:"editor-button editor-button-small", style:"margin-top: 7px; margin-left: 5px;"}).appendTo(finalspan);
$('<i/>',{class:"fa fa-remove"}).appendTo(deleteButton); $('<i/>',{class:"fa fa-remove"}).appendTo(deleteButton);
$('<div/>',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(to).appendTo(row2); $('<div/>',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(to).appendTo(row2);
var propertyValue = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-value",type:"text"}).appendTo(row2).typedInput({default:'str',options:['msg','flow','global','str','num','bool','json']}); var propertyValue = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-value",type:"text"}).appendTo(row2).typedInput({default:'str',types:['msg','flow','global','str','num','bool','json']});
var row3_1 = $('<div/>').appendTo(row3); var row3_1 = $('<div/>').appendTo(row3);
$('<div/>',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(search).appendTo(row3_1); $('<div/>',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(search).appendTo(row3_1);
var fromValue = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-search-value",type:"text"}).appendTo(row3_1).typedInput({default:'str',options:['msg','flow','global','str','re']}); var fromValue = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-search-value",type:"text"}).appendTo(row3_1).typedInput({default:'str',types:['msg','flow','global','str','re']});
var row3_2 = $('<div/>',{style:"margin-top:8px;"}).appendTo(row3); var row3_2 = $('<div/>',{style:"margin-top:8px;"}).appendTo(row3);
$('<div/>',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(replace).appendTo(row3_2); $('<div/>',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(replace).appendTo(row3_2);
var toValue = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-replace-value",type:"text"}).appendTo(row3_2).typedInput({default:'str',options:['msg','flow','global','str','num','json']}); var toValue = $('<input/>',{style:"width: 250px",class:"node-input-rule-property-replace-value",type:"text"}).appendTo(row3_2).typedInput({default:'str',types:['msg','flow','global','str','num','json']});
selectField.change(function() { selectField.change(function() {
var width = $("#node-input-rule-container").width(); var width = $("#node-input-rule-container").width();