Changeset 13875 for trunk/FACT++


Ignore:
Timestamp:
05/24/12 15:32:55 (12 years ago)
Author:
tbretz
Message:
Included a function to properly convert html special chars to unicode
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/smartfact/index.js

    r13870 r13875  
    163163function valid(str) { if (str==undefined) return false; if (str.length==0) return false; return true;}
    164164function isSliding() { var z = $("body").getAttribute("data-visible"); return $("table"+z).offsetLeft!=0; }
     165function htmlDecode(input) { var e = document.createElement('div'); e.innerHTML = input; return e.childNodes[0].nodeValue; }
    165166
    166167function cycleCol(el)
     
    12741275    var umax = data[2];
    12751276
    1276     var unit = canv.getAttribute("data-data");//.split("/");
    1277     unit = unit.replace("°",   "\u00B0");
    1278     unit = unit.replace("µ", "\u00B5");
    1279     unit = unit.replace("²",  "\u00B2");
    1280     unit = unit.replace("³",  "\u00B3");
     1277    var unit = htmlDecode(canv.getAttribute("data-data"));
     1278    //unit = unit.replace("°",   "\u00B0");
     1279    //unit = unit.replace("µ", "\u00B5");
     1280    //unit = unit.replace("²",  "\u00B2");
     1281    //unit = unit.replace("³",  "\u00B3");
    12811282
    12821283    var min = data[3]+unit
     
    13181319function drawGraph(canv, vals, data)
    13191320{
    1320     var unit = canv.getAttribute("data-data");//.split("/");
    1321     unit = unit.replace("°",   "\u00B0");
    1322     unit = unit.replace("µ", "\u00B5");
    1323     unit = unit.replace("²",  "\u00B2");
    1324     unit = unit.replace("³",  "\u00B3");
     1321    var unit = htmlDecode(canv.getAttribute("data-data"));//.split("/");
     1322
     1323    //unit = unit.replace("°",   "\u00B0");
     1324    //unit = unit.replace("µ", "\u00B5");
     1325    //unit = unit.replace("²",  "\u00B2");
     1326    //unit = unit.replace("³",  "\u00B3");
    13251327
    13261328    var umin = vals[1]+unit;
Note: See TracChangeset for help on using the changeset viewer.