Changeset 13927


Ignore:
Timestamp:
05/26/12 18:57:28 (13 years ago)
Author:
tbretz
Message:
Removed the use of 'undfined' from the code.
File:
1 edited

Legend:

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

    r13926 r13927  
    165165function $txt(txt) { return document.createTextNode(txt); }
    166166function trim(str) { return str.replace("/^\s\s*/", '').replace("/\s\s*$/", ''); }
    167 function valid(str) { if (str===undefined) return false; if (str.length==0) return false; return true;}
     167function valid(str) { if (!str) return false; if (str.length==0) return false; return true;}
    168168function isSliding() { var z = $("body").getAttribute("data-visible"); return $("table"+z) ? $("table"+z).offsetLeft!=0 : false; }
    169 function htmlDecode(input) { var e = $new('div'); e.innerHTML = input; return e.firstChild===undefined ? input : e.firstChild.nodeValue; }
     169function htmlDecode(input) { var e = $new('div'); e.innerHTML = input; return e.firstChild ? e.firstChild.nodeValue : input; }
    170170function setUTC(el, time) { var str = time.toUTCString(); var utc = str.substr(str.length-12, 8); el.innerHTML = "• "+utc+" UTC •"; }
    171171
     
    811811    var img  = $("image"+z);
    812812    var canv = $("canvas"+z);
    813     if (img === undefined || canv === undefined)
     813    if (!img || !canv)
    814814        return;
    815815
     
    10791079
    10801080        var e = $("data"+z+"-"+line);
    1081         if (e === undefined)
     1081        if (!e)
    10821082            continue;
    10831083
    10841084        var form = e.getAttribute("data-form");
    1085         if (form===undefined)
     1085        if (!form)
    10861086            continue;
    10871087
     
    14981498    var z = $("body").getAttribute("data-visible");
    14991499    var canv = $("canvas"+z);
    1500     if (canv === undefined)
     1500    if (!canv)
    15011501        return;
    15021502
Note: See TracChangeset for help on using the changeset viewer.