From 2e094c6f76ad3984b2fb94422b7b526cbf092d75 Mon Sep 17 00:00:00 2001 From: Ralf Becker <ralfbecker@outdoor-training.de> Date: Wed, 11 Mar 2015 12:13:32 +0000 Subject: [PATCH] new attribute type "rawstring" not doing html-entity decoding used just for "value" attribute --- etemplate/js/et2_core_common.js | 5 +++-- etemplate/js/et2_core_valueWidget.js | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/etemplate/js/et2_core_common.js b/etemplate/js/et2_core_common.js index b3e4644c8d..fe7dd058d6 100644 --- a/etemplate/js/et2_core_common.js +++ b/etemplate/js/et2_core_common.js @@ -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 diff --git a/etemplate/js/et2_core_valueWidget.js b/etemplate/js/et2_core_valueWidget.js index 7c84cbf404..3645b069a8 100644 --- a/etemplate/js/et2_core_valueWidget.js +++ b/etemplate/js/et2_core_valueWidget.js @@ -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 */