chg: refactored global encodeForm() method to JS
This commit is contained in:
parent
98a8cdbc53
commit
c085492c27
2 changed files with 11 additions and 13 deletions
10
js/Global/encodeForm.js
Normal file
10
js/Global/encodeForm.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
// import 'encode';
|
||||
|
||||
var encodeForm = function(str, buffer) {
|
||||
str = String(str);
|
||||
|
||||
if (str === null || !str.length) return str;
|
||||
if (!buffer) buffer = [];
|
||||
|
||||
return encode(str, buffer, false);
|
||||
};
|
|
@ -68,8 +68,7 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder {
|
|||
public void init() {
|
||||
String[] globalFuncs = {
|
||||
"renderSkin", "renderSkinAsString", "getProperty",
|
||||
"authenticate", "createSkin", "format",
|
||||
"encodeForm", "formatParagraphs",
|
||||
"authenticate", "createSkin", "format", "formatParagraphs",
|
||||
"getXmlDocument", "getHtmlDocument", "seal",
|
||||
"getDBConnection", "getURL", "write", "writeln",
|
||||
"serialize", "deserialize", "defineLibraryScope",
|
||||
|
@ -453,17 +452,6 @@ public class GlobalObject extends ImporterTopLevel implements PropertyRecorder {
|
|||
return new NativeJavaObject(this, obj, null);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param obj ...
|
||||
*
|
||||
* @return ...
|
||||
*/
|
||||
public String encodeForm(Object obj) {
|
||||
return HtmlEncoder.encodeFormValue(toString(obj));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue