Add httpRoot tip to http node

This commit is contained in:
Nicholas O'Leary 2013-11-22 21:26:18 +00:00
parent 0aa17662f5
commit 7463ef92cb
1 changed files with 21 additions and 1 deletions

View File

@ -32,6 +32,7 @@
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div id="node-input-tip" class="form-tips">The url will be relative to <code><span id="node-input-path"></span></code>.</div>
</script>
<script type="text/x-red" data-help-name="http in">
@ -76,11 +77,30 @@
outputs:1,
icon: "white-globe.png",
label: function() {
return this.name||(this.url?("["+this.method+"] "+this.url):"http");
if (this.name) {
return this.name;
} else if (this.url) {
var root = document.location.pathname.slice(0,-1);
root += this.url;
return "["+this.method+"] "+root;
} else {
return "http";
}
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
var root = document.location.pathname.slice(0,-1);
if (root == "") {
$("#node-input-tip").hide();
} else {
$("#node-input-path").html(root);
$("#node-input-tip").show();
}
//document.getElementById("node-config-wsdocpath").innerHTML=
}
});
</script>