Changeset 13768 for trunk/FACT++/www


Ignore:
Timestamp:
05/17/12 20:22:25 (12 years ago)
Author:
tbretz
Message:
Unified the command script name and the page name; do not output graphs if they have only a single point
File:
1 edited

Legend:

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

    r13747 r13768  
    299299    var inputs = document.getElementsByTagName("input");
    300300
    301     var args = "start="+script;
     301    var args = "start="+script+".dim";
    302302    for (var i=0; i<inputs.length; i++)
    303303        args += "&"+inputs[i].name+"="+inputs[i].value;
     
    329329    }
    330330
    331     var title = lines[0].split('/');
     331    var title  = lines[0];
     332    var is_cmd = title[0]=='*';
     333    if (is_cmd)
     334        title = title.substr(1);
    332335
    333336    var table = $("table"+z);
     
    411414    sp2.setAttribute("data-color", "3");
    412415    sp0.appendChild(document.createTextNode(" \u2022 "));
    413     sp1.appendChild(document.createTextNode(title[0]));
     416    sp1.appendChild(document.createTextNode(title));
    414417    sp2.appendChild(document.createTextNode(" \u2022 "));
    415     if (title[1]!=undefined)
    416     {
    417         // sp1.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; loadPage('fact', z, -1); }
     418    if (is_cmd)
     419    {
     420        sp1.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; submit(name); this.style.backgroundColor=''; }
    418421    }
    419422    else
     
    426429    div1.id = "reporttime"+z;
    427430    div1.appendChild(document.createTextNode("---"));
     431
     432    div1.onclick = function() { this.style.backgroundColor='rgba(0,0,0,0.77)'; sendCommand('stop'); this.style.backgroundColor=''; }
    428433
    429434    htd0.appendChild(sp0);
     
    12861291
    12871292    // --- data ---
    1288     ctx.beginPath();
    1289     ctx.moveTo(ml, ch-mb-data.charCodeAt(0)/128*h);
    1290     for (var i=1; i<data.length; i++)
    1291         ctx.lineTo(ml+w/(data.length-1)*i, ch-mb-data.charCodeAt(i)/128*h);
    1292 
    1293     // --- finalize data ---
    1294     ctx.lineTo(cw-mr, ch-mb);
    1295     ctx.lineTo(ml,    ch-mb);
    1296     ctx.fillStyle = "#"+color(100);
    1297     ctx.stroke();
    1298     ctx.fill();
     1293    if (data.length>1)
     1294    {
     1295        ctx.beginPath();
     1296        ctx.moveTo(ml, ch-mb-data.charCodeAt(0)/128*h);
     1297        for (var i=1; i<data.length; i++)
     1298            ctx.lineTo(ml+w/(data.length-1)*i, ch-mb-data.charCodeAt(i)/128*h);
     1299
     1300        // --- finalize data ---
     1301        ctx.lineTo(cw-mr, ch-mb);
     1302        ctx.lineTo(ml,    ch-mb);
     1303        ctx.fillStyle = "#"+color(100);
     1304        ctx.stroke();
     1305        ctx.fill();
     1306    }
    12991307
    13001308    ctx.beginPath();
Note: See TracChangeset for help on using the changeset viewer.