[mapguide-commits] r5884 - trunk/MgDev/Web/src/viewerfiles
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue May 31 08:37:01 EDT 2011
Author: jng
Date: 2011-05-31 05:37:01 -0700 (Tue, 31 May 2011)
New Revision: 5884
Modified:
trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ
Log:
#1682: Use a local div element to parse html string properties
Modified: trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ 2011-05-31 12:24:54 UTC (rev 5883)
+++ trunk/MgDev/Web/src/viewerfiles/propertyctrl.templ 2011-05-31 12:37:01 UTC (rev 5884)
@@ -75,7 +75,7 @@
{
code = '<table id="Grid" cellspacing=0 cellpadding=0 border=0><tr class="Header"><td id="Name" class="Name" width=65><span style="font-family: __#@font#__; font-size: __#@fontsize#__;"> __#PROPERTIESNAME#__</span></td><td class="CellSplitter" width=1 onmousedown="StartResizing()"></td><td class="Value"><span style="font-family: __#@font#__; font-size: __#@fontsize#__;"> __#PROPERTIESVALUE#__</span></td></tr>';
for(var i=0; i < properties.length; i++)
- code += '<tr class="GridCell"><td><span style="font-family: __#@font#__; font-size: __#@fontsize#__;"> ' + properties[i].name + '</span></td><td></td><td><span style="font-family: __#@font#__; font-size: __#@fontsize#__;">' + properties[i].value + '</span></td></tr>';
+ code += '<tr class="GridCell"><td><span style="font-family: __#@font#__; font-size: __#@fontsize#__;"> ' + properties[i].name + '</span></td><td></td><td><span style="font-family: __#@font#__; font-size: __#@fontsize#__;">' + HtmlDecode(properties[i].value) + '</span></td></tr>';
code += '</table>';
GetMapFrame().SetPropertyPaneToolbarVisibility(true);
}
@@ -97,6 +97,17 @@
OnResizeGrid();
}
+var _el = null; //Our "parser" element
+
+function HtmlDecode(input)
+{
+ if (_el == null)
+ _el = document.createElement('div');
+
+ _el.innerHTML = input;
+ return _el.childNodes[0].nodeValue;
+}
+
function InitDocument()
{
document.onmousedown = OnMouseDown;
More information about the mapguide-commits
mailing list