new attribute type "rawstring" not doing html-entity decoding used just for "value" attribute

This commit is contained in:
Ralf Becker 2015-03-11 12:12:52 +00:00
parent 6c22a1cb20
commit f3869d366e
2 changed files with 7 additions and 6 deletions

View File

@ -40,6 +40,7 @@ var et2_validTypes = ["boolean", "string", "html", "float", "integer", "any", "j
var et2_typeDefaults = {
"boolean": false,
"string": "",
"rawstring": "", // no html-entity decoding
"html": "",
"js": null,
"float": 0.0,
@ -153,7 +154,7 @@ function et2_checkType(_val, _type, _attr, _widget)
}
// Check whether the given value is of the type "string"
if (_type == "string" || _type == "html")
if (_type == "string" || _type == "html" || _type == "rawstring")
{
if (typeof _val == "number") // as php is a bit vague here, silently convert to a string
{
@ -162,7 +163,7 @@ function et2_checkType(_val, _type, _attr, _widget)
if (typeof _val == "string")
{
return _type == "html" ? _val : html_entity_decode(_val);
return _type == "string" ? html_entity_decode(_val) : _val;
}
// Handle some less common possibilities

View File

@ -21,7 +21,7 @@
* et2_valueWidget is the base class for et2_inputWidget - valueWidget introduces
* the "value" attribute and automatically loads it from the "content" array
* after loading from XML.
*
*
* @augments et2_baseWidget
*/
var et2_valueWidget = et2_baseWidget.extend(
@ -37,14 +37,14 @@ var et2_valueWidget = et2_baseWidget.extend(
"value": {
"name": "Value",
"description": "The value of the widget",
"type": "string",
"type": "rawstring", // no html-entity decoding
"default": et2_no_init
}
},
/**
*
*
*
*
* @memberOf et2_valueWidget
* @param _attrs
*/