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

Fixing issue 1024 (#1041)

Signed-off-by: Moshe Wajnberg <wajnberg@il.ibm.com>
This commit is contained in:
wajnberg 2016-11-16 16:11:27 +02:00 committed by Nick O'Leary
parent dbceef2581
commit b67df2c0ab
6 changed files with 22 additions and 10 deletions

View File

@ -758,7 +758,7 @@ RED.text.format = (function() {
{
guiDir: isRtl ? "rtl" : "ltr",
dir: "ltr",
points: "/\\:."
points: "/\\:.&<>"
};
if (!parseOnly) {
return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
@ -876,7 +876,7 @@ RED.text.format = (function() {
{
guiDir: isRtl ? "rtl" : "ltr",
dir: "ltr",
points: ":?#/@.[]="
points: ":?#/@.[]=&<>"
};
if (!parseOnly) {
return stext.parseAndDisplayStructure(text, fArgs, !!isHtml, locale);
@ -1304,6 +1304,18 @@ RED.text.format = (function() {
}
return {
/**
* Returns the string representation of a given structured text
* @param text - the structured text
* @param type - could be one of filepath, url, email
* @param args - pass additional arguments to the handler. generally null.
* @param isRtl - indicates if the GUI is mirrored
* @param locale - the browser locale
*/
getString: function (text, type, args, isRtl, locale) {
return getHandler(type).format(text, args, isRtl, false, locale);
},
/**
* Returns the HTML representation of a given structured text
* @param text - the structured text

View File

@ -137,7 +137,7 @@ msg.cookies = {
} else {
root += this.url;
}
return "["+this.method+"] "+root;
return RED.text.format.getString("["+this.method+"] "+root, "url", {}, false, "en");
} else {
return "http";
}

View File

@ -160,7 +160,7 @@
} else {
root += this.path;
}
return root;
return RED.text.format.getString(root, "filepath", {}, false, "en");
},
oneditprepare: function() {
var root = RED.settings.httpNodeRoot;
@ -185,7 +185,7 @@
inputs:0,
outputs:0,
label: function() {
return this.path;
return RED.text.format.getString(this.path, "filepath", {}, false, "en");
}
});

View File

@ -53,7 +53,7 @@
outputs:1,
icon: "watch.png",
label: function() {
return this.name||this.files;
return this.name||RED.text.format.getString(this.files, "filepath", {}, false, "en");
},
labelStyle: function() {
return this.name?"node_label_italic":"";

View File

@ -57,7 +57,7 @@
outputs:1,
icon: "file.png",
label: function() {
return this.name||this.filename;
return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en");
},
labelStyle: function() {
return this.name?"node_label_italic":"";

View File

@ -95,9 +95,9 @@
align: "right",
label: function() {
if (this.overwriteFile === "delete") {
return this.name||this._("file.label.deletelabel",{file:this.filename})
return this.name||this._("file.label.deletelabel",{file:RED.text.format.getString(this.filename, "filepath", {}, false, "en")})
} else {
return this.name||this.filename||this._("file.label.filelabel");
return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en")||this._("file.label.filelabel");
}
},
labelStyle: function() {
@ -123,7 +123,7 @@
outputs:1,
icon: "file.png",
label: function() {
return this.name||this.filename||this._("file.label.filelabel");
return this.name||RED.text.format.getString(this.filename, "filepath", {}, false, "en")||this._("file.label.filelabel");
},
labelStyle: function() {
return this.name?"node_label_italic":"";