From 231adac6d866345edcd50a0e672d824c2b3945d0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 4 Jan 2016 15:11:24 +0000 Subject: [PATCH] Rename typedInput.options --- editor/js/ui/typedInput.js | 6 +++--- nodes/core/core/20-inject.html | 2 +- nodes/core/core/80-template.html | 2 +- nodes/core/logic/10-switch.html | 8 ++++---- nodes/core/logic/15-change.html | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/editor/js/ui/typedInput.js b/editor/js/ui/typedInput.js index bd9c8a7f7..fdb3c8661 100644 --- a/editor/js/ui/typedInput.js +++ b/editor/js/ui/typedInput.js @@ -52,11 +52,11 @@ }); 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; this.typeMap = {}; - this.types = this.options.options.map(function(opt) { + this.types = this.options.types.map(function(opt) { var result; if (typeof opt === 'string') { result = allOptions[opt]; @@ -115,7 +115,7 @@ }); } 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) { $(document).off("mousedown.close-property-select"); diff --git a/nodes/core/core/20-inject.html b/nodes/core/core/20-inject.html index 9dfead8ca..dcc9ba274 100644 --- a/nodes/core/core/20-inject.html +++ b/nodes/core/core/20-inject.html @@ -230,7 +230,7 @@ $("#node-input-payload").typedInput({ default: 'str', 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() { diff --git a/nodes/core/core/80-template.html b/nodes/core/core/80-template.html index 4e800da21..d1388f24e 100644 --- a/nodes/core/core/80-template.html +++ b/nodes/core/core/80-template.html @@ -84,7 +84,7 @@ } $("#node-input-field").typedInput({ default: 'msg', - options: ['msg','flow','global'], + types: ['msg','flow','global'], typeField: $("#node-input-fieldType") }); diff --git a/nodes/core/logic/10-switch.html b/nodes/core/logic/10-switch.html index 555385092..35adfacd4 100644 --- a/nodes/core/logic/10-switch.html +++ b/nodes/core/logic/10-switch.html @@ -65,7 +65,7 @@ return this.name||"switch"; }, 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 = [ {v:"eq",t:"=="}, {v:"neq",t:"!="}, @@ -128,10 +128,10 @@ selectField.append($("").val(operators[d].v).text(operators[d].t)); } - var valueField = $('',{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 btwnValueField = $('',{class:"node-input-rule-btwn-value",type:"text",style:"margin-left: 5px;"}).appendTo(row).typedInput({default:'num',options:['msg','flow','global','str','num']}); + var valueField = $('',{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 = $('',{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 = $('',{class:"node-input-rule-btwn-label"}).text(" "+andLabel+" ").appendTo(row3); - var btwnValue2Field = $('',{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 = $('',{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 = $('',{style:"float: right;margin-right: 10px;"}).appendTo(row); finalspan.append(' → '+i+' '); diff --git a/nodes/core/logic/15-change.html b/nodes/core/logic/15-change.html index 0a95f5500..d64525022 100644 --- a/nodes/core/logic/15-change.html +++ b/nodes/core/logic/15-change.html @@ -133,21 +133,21 @@ selectField.append($("").val(selectOptions[i].v).text(selectOptions[i].l)); } - var propertyName = $('',{style:"width: 250px",class:"node-input-rule-property-name",type:"text"}).appendTo(row1).typedInput({options:['msg','flow','global']}); + var propertyName = $('',{style:"width: 250px",class:"node-input-rule-property-name",type:"text"}).appendTo(row1).typedInput({types:['msg','flow','global']}); var finalspan = $('',{style:"float: right; margin-right: 10px;"}).appendTo(row1); var deleteButton = $('',{href:"#",class:"editor-button editor-button-small", style:"margin-top: 7px; margin-left: 5px;"}).appendTo(finalspan); $('',{class:"fa fa-remove"}).appendTo(deleteButton); $('
',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(to).appendTo(row2); - var propertyValue = $('',{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 = $('',{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 = $('
').appendTo(row3); $('
',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(search).appendTo(row3_1); - var fromValue = $('',{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 = $('',{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 = $('
',{style:"margin-top:8px;"}).appendTo(row3); $('
',{style:"display: inline-block;text-align:right; width:120px;padding-right: 10px; box-sizing: border-box;"}).text(replace).appendTo(row3_2); - var toValue = $('',{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 = $('',{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() { var width = $("#node-input-rule-container").width();